/* Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf. */
void pbuf_cat(struct pbuf *h, struct pbuf *t)
/* Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf. */
void pbuf_cat(struct pbuf *h, struct pbuf *t)
{
  struct pbuf *p;
  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
             ((h != NULL) && (t != NULL)), return;);
  for (p = h; p->next != NULL; p = p->next) {
    p->tot_len += t->tot_len;
  }
  LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
  LWIP_ASSERT("p->next == NULL", p->next == NULL);
  p->tot_len += t->tot_len;
  p->next = t;
}