{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1757792446,
"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":"41639e348d53df140adbd467cca2ea20",
"commit": {"type":"commit",
"time": 1588599457,
"time_ofs": 60,
"oid_tree": { "oid": "7ae3d60b271f09ff0c5f947ae5845bb06068ef96", "alias": []},
"oid":{ "oid": "51ad2f2d9e18c816625afd0de7c13e8de2e9b328", "alias": [ "refs/tags/v4.0.5"]},
"msg": "h2: client sid: must be allocated at header send",
"sig_commit": { "git_time": { "time": 1588599457, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1588577208, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "h2: client sid: must be allocated at header send\n\nThere is no way to allocate a client wsi mux sid before the headers are\nsend, because we don't know the order in which new wsi headers will be sent\nand so seen by the peer.\n\nThe peer inisists that sid indexes only increase... we cannot allocat sids\nmonotonically at the client and then send them disordered..."
,
"diff": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 6e4d005..aca07f0 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -327,7 +327,7 @@ set(PACKAGE \u0022libwebsockets\u0022)\n set(CPACK_PACKAGE_NAME \u0022${PACKAGE}\u0022)\n set(CPACK_PACKAGE_VERSION_MAJOR \u00224\u0022)\n set(CPACK_PACKAGE_VERSION_MINOR \u00220\u0022)\n-set(CPACK_PACKAGE_VERSION_PATCH \u00224\u0022)\n+set(CPACK_PACKAGE_VERSION_PATCH \u00225\u0022)\n set(CPACK_PACKAGE_RELEASE 1)\n set(CPACK_GENERATOR \u0022RPM\u0022)\n set(CPACK_PACKAGE_VERSION \u0022${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\u0022)\ndiff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c\nindex 850380c..659da9b 100644\n--- a/lib/roles/h2/http2.c\n+++ b/lib/roles/h2/http2.c\n@@ -316,10 +316,13 @@ lws_wsi_h2_adopt(struct lws *parent_wsi, struct lws *wsi)\n #endif\n \twsi-\u003eh2.initialized \u003d 1;\n \n+#if 0\n+\t/* only assign sid at header send time when we know it */\n \tif (!wsi-\u003emux.my_sid) {\n \t\twsi-\u003emux.my_sid \u003d nwsi-\u003eh2.h2n-\u003ehighest_sid;\n \t\tnwsi-\u003eh2.h2n-\u003ehighest_sid +\u003d 2;\n \t}\n+#endif\n \n \tlwsl_info(\u0022%s: binding wsi %p to sid %d (next %d)\u005cn\u0022, __func__,\n \t\t\twsi, (int)wsi-\u003emux.my_sid, (int)nwsi-\u003eh2.h2n-\u003ehighest_sid);\n@@ -2329,14 +2332,16 @@ lws_h2_client_handshake(struct lws *wsi)\n \n \tlwsl_debug(\u0022%s\u005cn\u0022, __func__);\n \n-\tnwsi-\u003eh2.h2n-\u003ehighest_sid_opened \u003d sid;\n-\tif (!wsi-\u003emux.my_sid)\n-\t\twsi-\u003emux.my_sid \u003d sid;\n-\telse {\n-\t\tlwsl_debug(\u0022%s: %p already sid %d\u005cn\u0022,\n-\t\t\t\t__func__, wsi, wsi-\u003emux.my_sid);\n-\t\t//assert(0);\n-\t}\n+\t/*\n+\t * We MUST allocate our sid here at the point we're about to send the\n+\t * stream open. It's because we don't know the order in which multiple\n+\t * open streams will send their headers... in h2, sending the headers\n+\t * is the point the stream is opened. The peer requires that we only\n+\t * open streams in ascending sid order\n+\t */\n+\n+\twsi-\u003emux.my_sid \u003d nwsi-\u003eh2.h2n-\u003ehighest_sid_opened \u003d sid;\n+\tlwsl_info(\u0022%s: wsi %p: assigning SID %d at header send\u005cn\u0022, __func__, wsi, sid);\n \n \tlwsl_info(\u0022%s: CLIENT_WAITING_TO_SEND_HEADERS: pollout (sid %d)\u005cn\u0022,\n \t\t\t__func__, wsi-\u003emux.my_sid);\n","s":{"c":1757792446,"u": 5196}}
],"g": 5942,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}