/[lwip]/lwip/src/core/pbuf.c
ViewVC logotype

Diff of /lwip/src/core/pbuf.c

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

revision 1.52 by likewise, Wed Jun 4 09:06:22 2003 UTC revision 1.53 by likewise, Wed Jun 4 19:09:11 2003 UTC
# Line 251  pbuf_alloc(pbuf_layer l, u16_t length, p Line 251  pbuf_alloc(pbuf_layer l, u16_t length, p
251      p->len = length > PBUF_POOL_BUFSIZE - offset? PBUF_POOL_BUFSIZE - offset: length;      p->len = length > PBUF_POOL_BUFSIZE - offset? PBUF_POOL_BUFSIZE - offset: length;
252      /* set pbuf type */      /* set pbuf type */
253      p->flags = PBUF_FLAG_POOL;      p->flags = PBUF_FLAG_POOL;
254        /* set reference count (needed here in case we fail) */
255        p->ref = 1;
256            
257      /* now allocate the tail of the pbuf chain */      /* now allocate the tail of the pbuf chain */
258            
# Line 266  pbuf_alloc(pbuf_layer l, u16_t length, p Line 268  pbuf_alloc(pbuf_layer l, u16_t length, p
268  #ifdef PBUF_STATS  #ifdef PBUF_STATS
269          ++lwip_stats.pbuf.err;          ++lwip_stats.pbuf.err;
270  #endif /* PBUF_STATS */  #endif /* PBUF_STATS */
271          /* bail out unsuccesfully */          /* free chain so far allocated */
272          pbuf_free(p);          pbuf_free(p);
273            /* bail out unsuccesfully */
274          return NULL;          return NULL;
275        }        }
276        /*q->next = NULL;*/        q->next = NULL;
277        /* make previous pbuf point to this pbuf */        /* make previous pbuf point to this pbuf */
278        r->next = q;        r->next = q;
279        /* set total length of this pbuf and next in chain */        /* set total length of this pbuf and next in chain */
# Line 326  pbuf_alloc(pbuf_layer l, u16_t length, p Line 329  pbuf_alloc(pbuf_layer l, u16_t length, p
329      LWIP_ASSERT("pbuf_alloc: erroneous flag", 0);      LWIP_ASSERT("pbuf_alloc: erroneous flag", 0);
330      return NULL;      return NULL;
331    }    }
332      /* set reference count */
333    p->ref = 1;    p->ref = 1;
334    return p;    return p;
335  }  }

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

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