/[lwip]/lwip/src/api/api_lib.c
ViewVC logotype

Diff of /lwip/src/api/api_lib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16.2.1 by marcbou, Thu Jun 19 12:32:24 2003 UTC revision 1.16.2.2 by kieranm, Thu Aug 21 09:59:21 2003 UTC
# Line 154  netbuf_copy_partial(struct netbuf *buf, Line 154  netbuf_copy_partial(struct netbuf *buf,
154    
155    left = 0;    left = 0;
156    
157    if (buf == NULL) {    if(buf == NULL || dataptr == NULL) {
158      return;      return;
159    }    }
160        
# Line 197  struct Line 197  struct
197  netconn *netconn_new(enum netconn_type t)  netconn *netconn_new(enum netconn_type t)
198  {  {
199    struct netconn *conn;    struct netconn *conn;
200      struct api_msg *msg;
201    
202    conn = memp_malloc(MEMP_NETCONN);    conn = memp_malloc(MEMP_NETCONN);
203    if (conn == NULL) {    if (conn == NULL) {
204      return NULL;      return NULL;
205    }    }
206      
207      conn->err = ERR_OK;
208    conn->type = t;    conn->type = t;
209    conn->pcb.tcp = NULL;    conn->pcb.tcp = NULL;
210    
# Line 216  netconn *netconn_new(enum netconn_type t Line 219  netconn *netconn_new(enum netconn_type t
219    conn->socket = 0;    conn->socket = 0;
220    conn->callback = 0;    conn->callback = 0;
221    conn->recv_avail = 0;    conn->recv_avail = 0;
222    
223      if((msg = memp_malloc(MEMP_API_MSG)) == NULL) {
224        memp_free(MEMP_NETCONN, conn);
225        return NULL;
226      }
227      
228      msg->type = API_MSG_NEWCONN;
229      msg->msg.conn = conn;
230      api_msg_post(msg);  
231      sys_mbox_fetch(conn->mbox, NULL);
232      memp_free(MEMP_API_MSG, msg);
233    
234      if ( conn->err != ERR_OK ) {
235        memp_free(MEMP_NETCONN, conn);
236        return NULL;
237      }
238    
239    return conn;    return conn;
240  }  }
241  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/

Legend:
Removed from v.1.16.2.1  
changed lines
  Added in v.1.16.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26