Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1713489761, "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":"a367e3643a9def674c8668b59b60a50f", "commit": {"type":"commit", "time": 1465289201, "time_ofs": 480, "oid_tree": { "oid": "e43190dcac91addb8acc230371cdbe1a2091881b", "alias": []}, "oid":{ "oid": "d5466c97ae57063beda7511d6c5463929a70f910", "alias": []}, "msg": "lws_write escalate pending truncated to make the", "sig_commit": { "git_time": { "time": 1465289201, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1465289201, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "lws_write escalate pending truncated to make the\n\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e" , "diff": "diff --git a/README.coding.md b/README.coding.md\nindex 1e3f171..a4da4db 100644\n--- a/README.coding.md\n+++ b/README.coding.md\n@@ -36,6 +36,19 @@ with the socket closing and the `wsi` freed.\n Websocket write activities should only take place in the\n `LWS_CALLBACK_SERVER_WRITEABLE` callback as described below.\n \n+[This network-programming necessity to link the issue of new data to\n+the peer taking the previous data is not obvious to all users so let's\n+repeat that in other words:\n+\n+***ONLY DO LWS_WRITE FROM THE WRITEABLE CALLBACK***\n+\n+There is another network-programming truism that surprises some people which\n+is if the sink for the data cannot accept more:\n+\n+***YOU MUST PERFORM RX FLOW CONTROL***\n+\n+See the mirror protocol implementations for example code.\n+\n Only live connections appear in the user callbacks, so this removes any\n possibility of trying to used closed and freed wsis.\n \ndiff --git a/lib/output.c b/lib/output.c\nindex 3398fd1..f14a4a3 100644\n--- a/lib/output.c\n+++ b/lib/output.c\n@@ -109,7 +109,9 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)\n \tif (wsi-\u003etrunc_len \u0026\u0026 (buf \u003c wsi-\u003etrunc_alloc ||\n \t buf \u003e (wsi-\u003etrunc_alloc + wsi-\u003etrunc_len +\n \t\t wsi-\u003etrunc_offset))) {\n-\t\tlwsl_err(\u0022****** %x Sending new, pending truncated ...\u005cn\u0022, wsi);\n+\t\tlwsl_err(\u0022****** %p: Sending new, pending truncated ...\u005cn\u0022\n+\t\t\t \u0022 It's illegal to do an lws_write outside of\u005cn\u0022\n+\t\t\t \u0022 the writable callback: fix your code\u0022, wsi);\n \t\tassert(0);\n \n \t\treturn -1;\n","s":{"c":1713489761,"u": 1721}} ],"g": 2203,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}