static ngx_chain_t *
ngx_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *cl)
{
    size_t         total, size;
    u_char        *prev;
    ngx_uint_t     n;
    struct iovec  *iov;
    iov = NULL;
    prev = NULL;
    total = 0;
    n = 0;
    for (   ; cl; cl = cl->next) {
        size = cl->buf->last - cl->buf->pos;
        if (prev == cl->buf->pos) {
            iov->iov_len += size;
        } else {
            if (n == vec->nalloc) {
                break;
            }
            iov = &vec->iovs[n++];
            iov->iov_base = (void *) cl->buf->pos;
            iov->iov_len = size;
        }
        prev = cl->buf->pos + size;
        total += size;
    }
    vec->count = n;
    vec->size = total;
    return cl;
}
['static ngx_chain_t *\nngx_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *cl)\n{\n    size_t         total, size;\n    u_char        *prev;\n    ngx_uint_t     n;\n    struct iovec  *iov;\n    iov = NULL;\n    prev = NULL;\n    total = 0;\n    n = 0;\n    for (   ; cl; cl = cl->next) {\n        size = cl->buf->last - cl->buf->pos;\n        if (prev == cl->buf->pos) {\n            iov->iov_len += size;\n        } else {\n            if (n == vec->nalloc) {\n                break;\n            }\n            iov = &vec->iovs[n++];\n            iov->iov_base = (void *) cl->buf->pos;\n            iov->iov_len = size;\n        }\n        prev = cl->buf->pos + size;\n        total += size;\n    }\n    vec->count = n;\n    vec->size = total;\n    return cl;\n}']