]> prime8.dev >> repos - ttyd.git/commitdiff
http: fix keepalive issue
authorShuanglei Tao <tsl0922@gmail.com>
Fri, 14 Jun 2019 23:43:18 +0000 (07:43 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Fri, 14 Jun 2019 23:43:18 +0000 (07:43 +0800)
src/http.c

index 1704e91986e452658c7b8e945843fdd9b72db015..cda1c8d39327804180a6f990903086c841e4457f 100644 (file)
@@ -100,15 +100,14 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, voi
 #if LWS_LIBRARY_VERSION_MAJOR < 3
                 if (n > 0 && lws_write_http(wsi, buf, n) < 0)
                     return 1;
-                goto try_to_reuse;
 #else
                 if (n > 0) {
                     pss->buffer = pss->ptr = strdup(buf);
                     pss->len = n;
                     lws_callback_on_writable(wsi);
                 }
-                return 0;
 #endif
+                goto try_to_reuse;
             }
 
             if (strcmp(pss->path, "/") != 0) {