Mercurial > hg > nginx-quic
diff src/http/modules/ngx_http_realip_module.c @ 1118:cec2866f29bd
a client address must be allocated from a connection pool
to live through the keep-alive requests
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 17 Feb 2007 21:06:47 +0000 |
parents | 3f354952e91d |
children | b590a528fd41 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_realip_module.c +++ b/src/http/modules/ngx_http_realip_module.c @@ -163,10 +163,17 @@ ngx_http_realip_handler(ngx_http_request return NGX_DECLINED; } + p = ngx_palloc(r->connection->pool, len); + if (p == NULL) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + + ngx_memcpy(p, ip, len); + sin->sin_addr.s_addr = addr; r->connection->addr_text.len = len; - r->connection->addr_text.data = ip; + r->connection->addr_text.data = p; return NGX_DECLINED; }