]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- from http://trac.lighttpd.net/trac/changeset/259?format=diff
authoraredridel <aredridel@pld-linux.org>
Thu, 14 Apr 2005 19:01:53 +0000 (19:01 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lighttpd-proxy-error-handler.patch -> 1.1

lighttpd-proxy-error-handler.patch [new file with mode: 0644]

diff --git a/lighttpd-proxy-error-handler.patch b/lighttpd-proxy-error-handler.patch
new file mode 100644 (file)
index 0000000..9594159
--- /dev/null
@@ -0,0 +1,81 @@
+--- trunk/src/mod_proxy.c      (revision 258)
++++ trunk/src/mod_proxy.c      (revision 259)
+@@ -365,8 +365,6 @@
+                       log_error_write(srv, __FILE__, __LINE__, "sdsd", 
+                                       "connect failed:", proxy_fd, strerror(errno), errno);
+                       
+-                      proxy_connection_cleanup(srv, hctx);
+-                      
+                       return -1;
+               }
+       }
+@@ -615,7 +613,7 @@
+ }
+-static int proxy_write_request(server *srv, handler_ctx *hctx) {
++static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
+       data_proxy *host= hctx->host;
+       
+       int r;
+@@ -629,7 +627,7 @@
+               
+               if (-1 == (hctx->fd->fd = socket(r, SOCK_STREAM, 0))) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
+-                      return -1;
++                      return HANDLER_ERROR;
+               }
+               
+               srv->cur_fds++;
+@@ -639,9 +637,7 @@
+               if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
+                       log_error_write(srv, __FILE__, __LINE__, "ss", "fcntl failed: ", strerror(errno));
+                       
+-                      proxy_connection_cleanup(srv, hctx);
+-                      
+-                      return -1;
++                      return HANDLER_ERROR;
+               }
+               
+               /* fall through */
+@@ -706,10 +702,10 @@
+               break;
+       default:
+               log_error_write(srv, __FILE__, __LINE__, "s", "(debug) unknown state");
+-              return -1;
++              return HANDLER_ERROR;
+       }
+       
+-      return 0;
++      return HANDLER_GO_ON;
+ }
+ #define PATCH(x) \
+@@ -779,7 +775,8 @@
+       if (con->mode != p->id) return HANDLER_GO_ON;
+       
+       /* ok, create the request */
+-      if (-1 == proxy_write_request(srv, hctx)) {
++      switch(proxy_write_request(srv, hctx)) {
++      case HANDLER_ERROR:
+               log_error_write(srv, __FILE__, __LINE__,  "sbdd", "proxy-server disabled:", 
+                               host->host,
+                               host->port,
+@@ -789,9 +786,17 @@
+               host->usage = -1;
+               host->disable_ts = srv->cur_ts;
+               
++              proxy_connection_cleanup(srv, hctx);
++              
+               con->mode = DIRECT;
+               con->http_status = 503;
+               return HANDLER_FINISHED;
++      case HANDLER_WAIT_FOR_EVENT:
++              return HANDLER_WAIT_FOR_EVENT;
++      case HANDLER_WAIT_FOR_FD:
++              return HANDLER_WAIT_FOR_FD;
++      default:
++              break;
+       }
+       
+       if (con->file_started == 1) {
This page took 0.035594 seconds and 4 git commands to generate.