Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
фильтр
- To: nginx-ru@xxxxxxxxx
- Subject: фильтр
- From: "Alexander Dolgarev" <a.dolgarev@xxxxxxxxx>
- Date: Sun, 30 Mar 2008 03:03:29 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=/bIbtkJaxdiaAy5AvDAWgoEzoskZvKnjOnUhjW+M9eI=; b=KliZjYZlEWYOOIA661PkGcBXsbkKobnG/msOD7HwnnZoxVmkpMjjqEtVU/nWGFlgy1afH0jEBFXmg2Rpdy6un2miBGJjmFwTGOgSC4XKpbBaTKfkJYItuxgUbfn+m4VQ4Mgbl4aQGsODGUq/hr4s1Wr0/fscxsWG/tBBmUYG5lg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=pl3IAVzol9fqtUKYHlshtMIXPiOf4PM162Mg5e2El4XMNoff0P8bVNWr6d4AxwR4LFuG+0zx1SnIBiMX9KzrWSJXsgVaFrK+Q7xLv1xRN/r6euwhCZSEnXe6qfJDVRCuSoLGHyifSr77r4+Lwg0r1g0Y13t86BH7APQ5wkk22LE=
В чем принципиальная неправильность следующего фрагмента кода (если
допустить что in != NULL и in->next == NULL)? Клиент просто ждет и
ничего не получает в ответ.
static ngx_int_t
ngx_http_*_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
{
ngx_chain_t *out;
ngx_buf_t *b;
out = ngx_pcalloc(r->pool, sizeof(ngx_chain_t));
b = ngx_create_temp_buf(r->pool, in->buf->last - in->buf->pos);
memcpy (b->pos, in->buf->pos, in->buf->last - in->buf->pos);
b->last_buf = in->buf->last_buf;
out->buf = b;
return ngx_http_next_body_filter(r, out);
}
|