/[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.33 by davidhaas, Mon Mar 31 20:45:08 2003 UTC revision 1.34 by davidhaas, Mon Mar 31 21:32:30 2003 UTC
# Line 825  pbuf_take(struct pbuf *f) Line 825  pbuf_take(struct pbuf *f)
825            /* prev->next == p at this point */            /* prev->next == p at this point */
826            /* break chain and insert new pbuf instead */            /* break chain and insert new pbuf instead */
827            prev->next = q;            prev->next = q;
           /* p is no longer pointed to by prev or by our caller,  
            * as the caller must do p = pbuf_take(p); so free it  
            * from reference through linkage.  
            * note that we have set p->next to NULL already so that  
            * we will not free the rest of the chain by accident.  
            */  
           pbuf_free(p);  
828          /* prev == NULL, so we replaced the top pbuf of the chain */          /* prev == NULL, so we replaced the top pbuf of the chain */
829          } else          } else
830            top = q;            top = q;
# Line 842  pbuf_take(struct pbuf *f) Line 835  pbuf_take(struct pbuf *f)
835          /* do not copy ref, since someone else might be using the old buffer */          /* do not copy ref, since someone else might be using the old buffer */
836          /* pbuf is not freed, as this is the responsibility of the application */          /* pbuf is not freed, as this is the responsibility of the application */
837          DEBUGF(PBUF_DEBUG, ("pbuf_take: replaced PBUF_REF %p with %p\n", (void *)p, (void *)q));          DEBUGF(PBUF_DEBUG, ("pbuf_take: replaced PBUF_REF %p with %p\n", (void *)p, (void *)q));
838            /* p is no longer pointed to by prev or by our caller,
839             * as the caller must do p = pbuf_take(p); so free it
840             * from reference through linkage.
841             * note that we have set p->next to NULL already so that
842             * we will not free the rest of the chain by accident.
843             */
844            pbuf_free(p);
845          p = q;          p = q;
846        }        }
847        else        else

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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