]> git.kaiwu.me - nginx.git/commitdiff
Removed c->single_connection flag.
authorValentin Bartenev <vbart@nginx.com>
Thu, 7 Mar 2013 18:07:16 +0000 (18:07 +0000)
committerValentin Bartenev <vbart@nginx.com>
Thu, 7 Mar 2013 18:07:16 +0000 (18:07 +0000)
The c->single_connection was intended to be used as lock mechanism
to serialize modifications of request object from several threads
working with client and upstream connections.  The flag is redundant
since threads in nginx have never been used that way.

src/core/ngx_connection.c
src/core/ngx_connection.h
src/http/ngx_http_request.c
src/http/ngx_http_upstream.c

index c818114dfebd30a5fd071906e64a5f04f27c4015..09ad15fcc3d3032cb3245187115fc3e773b1c2bb 100644 (file)
@@ -900,11 +900,9 @@ ngx_close_connection(ngx_connection_t *c)
     c->read->closed = 1;
     c->write->closed = 1;
 
-    if (c->single_connection) {
-        ngx_unlock(&c->lock);
-        c->read->locked = 0;
-        c->write->locked = 0;
-    }
+    ngx_unlock(&c->lock);
+    c->read->locked = 0;
+    c->write->locked = 0;
 
     ngx_mutex_unlock(ngx_posted_events_mutex);
 
index 87fd087238bb37669cfe2fbb3c7069530f4f6341..3daf2eee4cbb82f9d6cd2b7651cecfc6e00cd9ff 100644 (file)
@@ -152,7 +152,6 @@ struct ngx_connection_s {
 
     unsigned            log_error:3;     /* ngx_connection_log_error_e */
 
-    unsigned            single_connection:1;
     unsigned            unexpected_eof:1;
     unsigned            timedout:1;
     unsigned            error:1;
index ea053057be59848ff70815c467fe20aaeeb878fe..7fe30e57db9a872791e0b7e9f862cebb3ad57ab2 100644 (file)
@@ -554,7 +554,6 @@ ngx_http_init_request(ngx_event_t *rev)
         return;
     }
 
-    c->single_connection = 1;
     c->destroyed = 0;
 
 #if (NGX_HTTP_SSL)
index 6a77f7f0369ee97784ac4573399cddb75d7bf4f9..d3e9b55aafc3fc107022a034e0da66492b6634cf 100644 (file)
@@ -1118,8 +1118,6 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u)
 
     r->connection->log->action = "connecting to upstream";
 
-    r->connection->single_connection = 0;
-
     if (u->state && u->state->response_sec) {
         tp = ngx_timeofday();
         u->state->response_sec = tp->sec - u->state->response_sec;