Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752656809, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"7aff3fdd0f0e8515fb269c21057dda85", "commit": {"type":"commit", "time": 1751702166, "time_ofs": 60, "oid_tree": { "oid": "a604995a11dcd2b2803633b0177af2e65513dffd", "alias": []}, "oid":{ "oid": "576f6682f00dcc1ef9c273baa519bd02c14b8fd5", "alias": []}, "msg": " keepalive-timeout", "sig_commit": { "git_time": { "time": 1751702166, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1751701256, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": " keepalive-timeout\n" , "diff": "diff --git a/lib/core-net/private-lib-core-net.h b/lib/core-net/private-lib-core-net.h\nindex 3ffb007..0926cf9 100644\n--- a/lib/core-net/private-lib-core-net.h\n+++ b/lib/core-net/private-lib-core-net.h\n@@ -1629,6 +1629,9 @@ int\n lws_score_dns_results(struct lws_context *ctx,\n \t\t\t const struct addrinfo **result);\n \n+int\n+lws_wsi_keepalive_timeout_eff(struct lws *wsi);\n+\n #if defined(LWS_WITH_SYS_SMD)\n int\n lws_netdev_smd_cb(void *opaque, lws_smd_class_t _class, lws_usec_t timestamp,\ndiff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c\nindex 1adfe85..4b475d5 100644\n--- a/lib/core-net/wsi.c\n+++ b/lib/core-net/wsi.c\n@@ -1296,9 +1296,8 @@ lws_http_close_immortal(struct lws *wsi)\n \t\t * since we closed the only immortal stream on this nwsi, we\n \t\t * need to reapply a normal timeout regime to the nwsi\n \t\t */\n-\t\tlws_set_timeout(nwsi, PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE,\n-\t\t\t\twsi-\u003ea.vhost-\u003ekeepalive_timeout ?\n-\t\t\t\t wsi-\u003ea.vhost-\u003ekeepalive_timeout : 31);\n+\t\tlws_set_timeout(wsi, PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE,\n+\t\t\t\tlws_wsi_keepalive_timeout_eff(wsi));\n }\n \n void\n@@ -1601,6 +1600,27 @@ lws_wsi_txc_describe(struct lws_tx_credit *txc, const char *at, uint32_t sid)\n #endif\n \n int\n+lws_wsi_keepalive_timeout_eff(struct lws *wsi)\n+{\n+\tint ds \u003d wsi-\u003ea.vhost-\u003ekeepalive_timeout;\n+\n+#if defined(LWS_WITH_SERVER)\n+\tif (wsi-\u003ehttp.mount_specific_keepalive_timeout_secs)\n+\t\tds \u003d (int)wsi-\u003ehttp.mount_specific_keepalive_timeout_secs;\n+\n+\tif (wsi-\u003eparent \u0026\u0026 (int)wsi-\u003eparent-\u003ehttp.mount_specific_keepalive_timeout_secs \u003e ds)\n+\t\tds \u003d (int)wsi-\u003eparent-\u003ehttp.mount_specific_keepalive_timeout_secs;\n+#endif\n+\n+\tif (!ds)\n+\t\tds \u003d 31;\n+\n+\t// lwsl_wsi_notice(wsi, \u0022Eff keepalive_timeout %ds \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u005cn\u0022, ds);\n+\n+\treturn ds;\n+}\n+\n+int\n lws_wsi_tx_credit(struct lws *wsi, char peer_to_us, int add)\n {\n \tif (wsi-\u003erole_ops \u0026\u0026 lws_rops_fidx(wsi-\u003erole_ops, LWS_ROPS_tx_credit))\ndiff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c\nindex 9fa370c..96df019 100644\n--- a/lib/roles/h2/http2.c\n+++ b/lib/roles/h2/http2.c\n@@ -986,13 +986,8 @@ lws_h2_parse_frame_header(struct lws *wsi)\n \t/* let the network wsi live a bit longer if subs are active */\n \n \tif (!wsi-\u003eimmortal_substream_count) {\n-\t\tint ds \u003d wsi-\u003ea.vhost-\u003ekeepalive_timeout;\n+\t\tint ds \u003d lws_wsi_keepalive_timeout_eff(wsi);\n \n-\t\tif (wsi-\u003ehttp.mount_specific_keepalive_timeout_secs)\n-\t\t\tds \u003d (int)wsi-\u003ehttp.mount_specific_keepalive_timeout_secs;\n-\n-\t\tif (!ds)\n-\t\t\tds \u003d 31;\n \t\t/*\n \t\t * A short (5s) timeout here affects the reverse proxy if\n \t\t * the onward box takes a long time to respond, eg to a POST.\n@@ -2191,9 +2186,8 @@ lws_h2_parser(struct lws *wsi, unsigned char *in, lws_filepos_t _inlen,\n \t\t\t\t */\n \t\t\t\tif (!wsi-\u003eimmortal_substream_count)\n \t\t\t\t\tlws_set_timeout(wsi,\n-\t\t\t\t\tPENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE,\n-\t\t\t\t\t\twsi-\u003ea.vhost-\u003ekeepalive_timeout ?\n-\t\t\t\t\t wsi-\u003ea.vhost-\u003ekeepalive_timeout : 31);\n+\t\t\t\t\t\tPENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE,\n+\t\t\t\t\t\tlws_wsi_keepalive_timeout_eff(wsi));\n \n \t\t\t\tif (!h2n-\u003eswsi)\n \t\t\t\t\tbreak;\ndiff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c\nindex 174176b..6e5581c 100644\n--- a/lib/roles/http/server/server.c\n+++ b/lib/roles/http/server/server.c\n@@ -1538,6 +1538,8 @@ lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,\n \tlwsl_info(\u0022%s: setting proxy clientside on %s (parent %s)\u005cn\u0022,\n \t\t __func__, lws_wsi_tag(cwsi), lws_wsi_tag(lws_get_parent(cwsi)));\n \n+\tcwsi-\u003ehttp.mount_specific_keepalive_timeout_secs \u003d (unsigned int)lws_wsi_keepalive_timeout_eff(wsi);\n+\n \tcwsi-\u003ehttp.proxy_clientside \u003d 1;\n \tif (ws) {\n \t\twsi-\u003eproxied_ws_parent \u003d 1;\n@@ -1858,6 +1860,8 @@ lws_http_action(struct lws *wsi)\n \twsi-\u003ehttp.mount_specific_headers \u003d hit-\u003eheaders;\n \twsi-\u003ehttp.mount_specific_keepalive_timeout_secs \u003d hit-\u003ekeepalive_timeout;\n \n+\t// lwsl_wsi_notice(wsi, \u0022keepalive_timeout %d ******************\u005cn\u0022, hit-\u003ekeepalive_timeout);\n+\n #if defined(LWS_WITH_FILE_OPS)\n \ts \u003d uri_ptr + hit-\u003emountpoint_len;\n #endif\n@@ -2723,9 +2727,13 @@ lws_http_transaction_completed(struct lws *wsi)\n #endif\n \n \tn \u003d NO_PENDING_TIMEOUT;\n-\tif (wsi-\u003ea.vhost-\u003ekeepalive_timeout)\n+\tif (wsi-\u003ea.vhost-\u003ekeepalive_timeout\n+#if defined(LWS_WITH_SERVER)\n+\t\t\t|| wsi-\u003ehttp.mount_specific_keepalive_timeout_secs\n+#endif\n+ \t )\n \t\tn \u003d PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE;\n-\tlws_set_timeout(wsi, (enum pending_timeout)n, wsi-\u003ea.vhost-\u003ekeepalive_timeout);\n+\tlws_set_timeout(wsi, n, lws_wsi_keepalive_timeout_eff(wsi));\n \n \t/*\n \t * We already know we are on http1.1 / keepalive and the next thing\n","s":{"c":1752656809,"u": 6995}} ],"g": 8175,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}