|
version 1.3.2.2, 2012/05/23 15:41:38
|
version 1.5, 2015/05/19 23:25:30
|
|
Line 12 terms:
|
Line 12 terms:
|
| All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
| Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
| |
|
| Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 | Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 |
| by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
| |
|
| Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
|
Line 49 SUCH DAMAGE.
|
Line 49 SUCH DAMAGE.
|
| |
|
| |
|
| struct tagProc * |
struct tagProc * |
| InitProc(int h, io_sockaddr_t *sa, u_short id, int len) | InitProc(int h, sockaddr_t *sa, u_short id, int len) |
| { |
{ |
| struct tagProc *proc; |
struct tagProc *proc; |
| |
|
| FTRACE(5); |
FTRACE(5); |
| |
|
| proc = io_malloc(sizeof(struct tagProc)); | proc = e_malloc(sizeof(struct tagProc)); |
| if (!proc) { |
if (!proc) { |
| ERR("Not enough memory #%d - %s", errno, strerror(errno)); |
ERR("Not enough memory #%d - %s", errno, strerror(errno)); |
| return NULL; |
return NULL; |
|
Line 64 InitProc(int h, io_sockaddr_t *sa, u_short id, int len
|
Line 64 InitProc(int h, io_sockaddr_t *sa, u_short id, int len
|
| proc->proc_sock = h; |
proc->proc_sock = h; |
| proc->proc_id = id; |
proc->proc_id = id; |
| if (sa) |
if (sa) |
| memcpy(&proc->proc_cli, sa, sizeof(io_sockaddr_t)); | memcpy(&proc->proc_cli, sa, sizeof(sockaddr_t)); |
| |
|
| proc->proc_blen = len; |
proc->proc_blen = len; |
| proc->proc_buf_[0] = io_malloc(proc->proc_blen); | proc->proc_buf_[0] = e_malloc(proc->proc_blen); |
| if (!proc->proc_buf_[0]) { |
if (!proc->proc_buf_[0]) { |
| io_free(proc); | e_free(proc); |
| proc = NULL; |
proc = NULL; |
| } |
} |
| proc->proc_buf_[1] = io_malloc(proc->proc_blen); | proc->proc_buf_[1] = e_malloc(proc->proc_blen); |
| if (!proc->proc_buf_[1]) { |
if (!proc->proc_buf_[1]) { |
| io_free(proc->proc_buf_[0]); | e_free(proc->proc_buf_[0]); |
| io_free(proc); | e_free(proc); |
| proc = NULL; |
proc = NULL; |
| } |
} |
| |
|
|
Line 105 FreeProc(struct tagProc ** __restrict proc)
|
Line 105 FreeProc(struct tagProc ** __restrict proc)
|
| return; |
return; |
| |
|
| if ((*proc)->proc_buf_[1]) |
if ((*proc)->proc_buf_[1]) |
| io_free((*proc)->proc_buf_[1]); | e_free((*proc)->proc_buf_[1]); |
| if ((*proc)->proc_buf_[0]) |
if ((*proc)->proc_buf_[0]) |
| io_free((*proc)->proc_buf_[0]); | e_free((*proc)->proc_buf_[0]); |
| io_free(*proc); | e_free(*proc); |
| *proc = NULL; |
*proc = NULL; |
| } |
} |
| |
|