Mercurial > hg > nginx
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 Sat Feb 17 19:53:52 2007 +0000 +++ b/src/http/modules/ngx_http_realip_module.c Sat Feb 17 21:06:47 2007 +0000 @@ -163,10 +163,17 @@ 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; }