Repository: qpid-dispatch
Updated Branches:
  refs/heads/1.1.x 478a98688 -> 3dbbafc2d


DISPATCH-941: Router is returning incorrect files from http get

Bug in http-libwebsockets code. A partial HTTP handler such as we have needs to
call lws_callback_http_dummy() to fill in default HTTP behaviours. Without that
the LWS library was not properly informed of termination of HTTP transactions
causing confusion if a connection was re-used.

(cherry picked from commit c728d7f41c78ccc8db127b87c11470a5b9bc8c82)


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/3dbbafc2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/3dbbafc2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/3dbbafc2

Branch: refs/heads/1.1.x
Commit: 3dbbafc2dc0e2dbd4aa90c1f1509da966360327e
Parents: 478a986
Author: Alan Conway <[email protected]>
Authored: Tue May 29 14:21:15 2018 -0400
Committer: Ganesh Murthy <[email protected]>
Committed: Thu Jun 7 16:16:15 2018 -0400

----------------------------------------------------------------------
 src/http-libwebsockets.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/3dbbafc2/src/http-libwebsockets.c
----------------------------------------------------------------------
diff --git a/src/http-libwebsockets.c b/src/http-libwebsockets.c
index 398a7ec..6df0cca 100644
--- a/src/http-libwebsockets.c
+++ b/src/http-libwebsockets.c
@@ -340,20 +340,14 @@ static int callback_http(struct lws *wsi, enum 
lws_callback_reasons reason,
                          void *user, void *in, size_t len)
 {
     switch (reason) {
-
     case LWS_CALLBACK_PROTOCOL_DESTROY:
         qd_http_listener_free(wsi_listener(wsi));
-        return -1;
-
-    case LWS_CALLBACK_HTTP: {
-        /* Called if file mount can't find the file */
-        lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, (char*)in);
-        return -1;
-    }
-
-    default:
-        return 0;
+        break;
+      default:
+        break;
     }
+    /* Do default HTTP handling for all the cases we don't care about. */
+    return lws_callback_http_dummy(wsi, reason, user, in, len);
 }
 
 /* Wake up a connection managed by the http server thread */


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to