[nginx] svn commit: r5079 - trunk/src/http/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Wed Feb 20 16:41:06 UTC 2013


Author: mdounin
Date: 2013-02-20 16:41:05 +0000 (Wed, 20 Feb 2013)
New Revision: 5079
URL: http://trac.nginx.org/nginx/changeset/5079/nginx

Log:
Connection upgrade support in uwsgi and scgi modules.

Prodded by Roberto De Ioris.


Modified:
   trunk/src/http/modules/ngx_http_scgi_module.c
   trunk/src/http/modules/ngx_http_uwsgi_module.c

Modified: trunk/src/http/modules/ngx_http_scgi_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_scgi_module.c	2013-02-19 17:48:45 UTC (rev 5078)
+++ trunk/src/http/modules/ngx_http_scgi_module.c	2013-02-20 16:41:05 UTC (rev 5079)
@@ -984,7 +984,7 @@
             u = r->upstream;
 
             if (u->headers_in.status_n) {
-                return NGX_OK;
+                goto done;
             }
 
             if (u->headers_in.status) {
@@ -1015,6 +1015,14 @@
                 u->state->status = u->headers_in.status_n;
             }
 
+        done:
+
+            if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
+                && r->headers_in.upgrade) 
+            {
+                u->upgrade = 1;
+            }
+
             return NGX_OK;
         }
 

Modified: trunk/src/http/modules/ngx_http_uwsgi_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_uwsgi_module.c	2013-02-19 17:48:45 UTC (rev 5078)
+++ trunk/src/http/modules/ngx_http_uwsgi_module.c	2013-02-20 16:41:05 UTC (rev 5079)
@@ -1018,7 +1018,7 @@
             u = r->upstream;
 
             if (u->headers_in.status_n) {
-                return NGX_OK;
+                goto done;
             }
 
             if (u->headers_in.status) {
@@ -1049,6 +1049,14 @@
                 u->state->status = u->headers_in.status_n;
             }
 
+        done:
+
+            if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
+                && r->headers_in.upgrade) 
+            {
+                u->upgrade = 1;
+            }
+
             return NGX_OK;
         }
 



More information about the nginx-devel mailing list