The function is in file ngx_event_pipe.c,it is not too long,but i am confused by it.
when i debug it,it always says buf->shadow is NULL,and then return.so i think it is useless.At the same time,i am confused how can cl->buf equal s.Thanks for your explanations.The follow is the code.
static ngx_inline void
ngx_event_pipe_free_shadow_raw_buf(ngx_chain_t **free, ngx_buf_t *buf)
{
ngx_buf_t *s;
ngx_chain_t *cl, **ll;
if (buf->shadow == NULL) {
return;
}
for (s = buf->shadow; !s->last_shadow; s = s->shadow) { /* void */ }
ll = free;
for (cl = *free; cl; cl = cl->next) {
if (cl->buf == s) {
*ll = cl->next;
break;
}
if (cl->buf->shadow) {
break;
}
ll = &cl->next;
}
}