Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1711647345, "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":"58bde7a7ed2c5ce24740c6a7848a95da", "commit": {"type":"commit", "time": 1527216545, "time_ofs": 480, "oid_tree": { "oid": "17c533c1210b81d8a14936b3527cad0cd2f3ce7d", "alias": []}, "oid":{ "oid": "9488424b8de5fc9ec0ca18fb1ddf9f1961f9f00c", "alias": []}, "msg": "cancel pipes: treat nonzero return code from platform only as indication not to use dummy_pipe", "sig_commit": { "git_time": { "time": 1527216545, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1527216545, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "cancel pipes: treat nonzero return code from platform only as indication not to use dummy_pipe_fds\n\nhttps://github.com/warmcat/libwebsockets/issues/1291" , "diff": "diff --git a/lib/core/context.c b/lib/core/context.c\nindex 37ab024..3792724 100644\n--- a/lib/core/context.c\n+++ b/lib/core/context.c\n@@ -988,24 +988,29 @@ lws_create_event_pipes(struct lws_context *context)\n \t\twsi-\u003etsi \u003d n;\n \t\twsi-\u003evhost \u003d NULL;\n \t\twsi-\u003eevent_pipe \u003d 1;\n+\t\twsi-\u003edesc.sockfd \u003d LWS_SOCK_INVALID;\n+\t\tcontext-\u003ept[n].pipe_wsi \u003d wsi;\n+\t\tcontext-\u003ecount_wsi_allocated++;\n \n-\t\tif (lws_plat_pipe_create(wsi)) {\n-\t\t\tlws_free(wsi);\n+\t\tif (lws_plat_pipe_create(wsi))\n+\t\t\t/*\n+\t\t\t * platform code returns 0 if it actually created pipes\n+\t\t\t * and initialized pt-\u003edummy_pipe_fds[]. If it used\n+\t\t\t * some other mechanism outside of signaling in the\n+\t\t\t * normal event loop, we skip treating the pipe as\n+\t\t\t * related to dummy_pipe_fds[], adding it to the fds,\n+\t\t\t * etc.\n+\t\t\t */\n \t\t\tcontinue;\n-\t\t}\n+\n \t\twsi-\u003edesc.sockfd \u003d context-\u003ept[n].dummy_pipe_fds[0];\n \t\tlwsl_debug(\u0022event pipe fd %d\u005cn\u0022, wsi-\u003edesc.sockfd);\n \n-\t\tcontext-\u003ept[n].pipe_wsi \u003d wsi;\n-\n \t\tif (context-\u003eevent_loop_ops-\u003eaccept)\n \t\t\tcontext-\u003eevent_loop_ops-\u003eaccept(wsi);\n \n \t\tif (__insert_wsi_socket_into_fds(context, wsi))\n \t\t\treturn 1;\n-\n-\t\t//lws_change_pollfd(context-\u003ept[n].pipe_wsi, 0, LWS_POLLIN);\n-\t\tcontext-\u003ecount_wsi_allocated++;\n \t}\n \n \treturn 0;\n","s":{"c":1711647345,"u": 2367}} ],"g": 2724,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}