2
回答
nginx自定义模块困惑
百度AI开发者大赛带你边学边开发,赢100万奖金,加群:418589053   

        哪位达人帮忙解释下?

 ngx_chain_t   out;
    b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
    b->pos = some_bytes; //问题在这里,既然分配了内存,这里为啥不拷贝,只把指针指过去?
    b->last = some_bytes + some_bytes_length; 
    b->memory = 1;
    b->last_buf = 1;
    out.buf = b;
    out.next = NULL;
    return ngx_http_output_filter(r, &out); ngx_buf_t    *b;
举报
火星人
发帖于8年前 2回/336阅
顶部