comparison src/http/modules/ngx_http_userid_filter_module.c @ 362:54fad6c4b555 NGINX_0_6_25

nginx 0.6.25 *) Change: now the "server_name_in_redirect" directive is used instead of the "server_name" directive's special "*" parameter. *) Change: now wildcard and regex names can be used as main name in a "server_name" directive. *) Change: the "satisfy_any" directive was replaced by the "satisfy" directive. *) Workaround: old worker processes might hog CPU after reconfiguration if they was run under Linux OpenVZ. *) Feature: the "min_delete_depth" directive. *) Bugfix: the COPY and MOVE methods did not work with single files. *) Bugfix: the ngx_http_gzip_static_module did not allow the ngx_http_dav_module to work; bug appeared in 0.6.23. *) Bugfix: socket leak in HTTPS mode if deferred accept was used. Thanks to Ben Maurer. *) Bugfix: nginx could not be built without PCRE library; bug appeared in 0.6.23.
author Igor Sysoev <http://sysoev.ru>
date Tue, 08 Jan 2008 00:00:00 +0300
parents e10168d6e371
children edf1cb6c328e
comparison
equal deleted inserted replaced
361:160660bad929 362:54fad6c4b555
298 298
299 static ngx_int_t 299 static ngx_int_t
300 ngx_http_userid_set_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx, 300 ngx_http_userid_set_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx,
301 ngx_http_userid_conf_t *conf) 301 ngx_http_userid_conf_t *conf)
302 { 302 {
303 u_char *cookie, *p; 303 u_char *cookie, *p;
304 size_t len; 304 size_t len;
305 socklen_t slen; 305 ngx_str_t src, dst;
306 struct sockaddr_in sin; 306 ngx_table_elt_t *set_cookie, *p3p;
307 ngx_str_t src, dst;
308 ngx_table_elt_t *set_cookie, *p3p;
309 307
310 /* 308 /*
311 * TODO: in the threaded mode the sequencers should be in TLS and their 309 * TODO: in the threaded mode the sequencers should be in TLS and their
312 * ranges should be divided between threads 310 * ranges should be divided between threads
313 */ 311 */
325 ctx->uid_set[3] = sequencer_v1; 323 ctx->uid_set[3] = sequencer_v1;
326 sequencer_v1 += 0x100; 324 sequencer_v1 += 0x100;
327 325
328 } else { 326 } else {
329 if (conf->service == NGX_CONF_UNSET) { 327 if (conf->service == NGX_CONF_UNSET) {
330 if (r->in_addr == 0) { 328 if (ngx_http_server_addr(r, NULL) != NGX_OK) {
331 slen = sizeof(struct sockaddr_in); 329 return NGX_ERROR;
332 if (getsockname(r->connection->fd,
333 (struct sockaddr *) &sin, &slen)
334 == -1)
335 {
336 ngx_connection_error(r->connection, ngx_socket_errno,
337 "getsockname() failed");
338 return NGX_ERROR;
339 }
340
341 r->in_addr = sin.sin_addr.s_addr;
342 } 330 }
343 331
344 ctx->uid_set[0] = htonl(r->in_addr); 332 ctx->uid_set[0] = htonl(r->in_addr);
345 333
346 } else { 334 } else {