http: fix keepalive issue

This commit is contained in:
Shuanglei Tao
2019-06-15 07:43:18 +08:00
parent dbb72de418
commit e3b569160d

View 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) {