Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752662795, "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":"7e5653e32a06ded7b0c904dfa053dc60", "commit": {"type":"commit", "time": 1698383742, "time_ofs": 60, "oid_tree": { "oid": "6a574500bce306be228ff098ada9a291e4eac838", "alias": []}, "oid":{ "oid": "816544f1d6d05cfa5d9fa5875f38e218c56285b3", "alias": []}, "msg": "ss: http: support PATCH", "sig_commit": { "git_time": { "time": 1698383742, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1698382226, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "ss: http: support PATCH\n\nhttps://github.com/warmcat/libwebsockets/issues/2989\n" , "diff": "diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c\nindex 8bf622b..ac760be 100644\n--- a/lib/secure-streams/protocols/ss-h1.c\n+++ b/lib/secure-streams/protocols/ss-h1.c\n@@ -248,12 +248,13 @@ lws_apply_metadata(lws_ss_handle_t *h, struct lws *wsi, uint8_t *buf,\n \t}\n \n \t/*\n-\t * Content-length on POST / PUT if we have the length information\n+\t * Content-length on POST / PUT / PATCH if we have the length information\n \t */\n \n \tif (h-\u003epolicy-\u003eu.http.method \u0026\u0026 (\n \t\t(!strcmp(h-\u003epolicy-\u003eu.http.method, \u0022POST\u0022) ||\n-\t !strcmp(h-\u003epolicy-\u003eu.http.method, \u0022PUT\u0022))) \u0026\u0026\n+\t\t !strcmp(h-\u003epolicy-\u003eu.http.method, \u0022PATCH\u0022) ||\n+\t\t !strcmp(h-\u003epolicy-\u003eu.http.method, \u0022PUT\u0022))) \u0026\u0026\n \t wsi-\u003ehttp.writeable_len) {\n \t\tif (!(h-\u003epolicy-\u003eflags \u0026\n \t\t\tLWSSSPOLF_HTTP_NO_CONTENT_LENGTH)) {\n@@ -840,6 +841,7 @@ malformed:\n \t\t h-\u003epolicy-\u003eprotocol \u003d\u003d LWSSSP_H2) \u0026\u0026\n \t\t h-\u003ebeing_serialized \u0026\u0026 (\n \t\t\t\t!strcmp(h-\u003epolicy-\u003eu.http.method, \u0022PUT\u0022) ||\n+\t\t\t\t!strcmp(h-\u003epolicy-\u003eu.http.method, \u0022PATCH\u0022) ||\n \t\t\t\t!strcmp(h-\u003epolicy-\u003eu.http.method, \u0022POST\u0022))) {\n \n \t\t\twsi-\u003eclient_suppress_CONNECTION_ERROR \u003d 1;\n@@ -1105,6 +1107,16 @@ malformed:\n \t\t\t\t\t\t\treturn -1;\n \t\t\t\t\t\tif (lws_ss_alloc_set_metadata(h, \u0022method\u0022, \u0022POST\u0022, 4))\n \t\t\t\t\t\t\treturn -1;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tm \u003d lws_hdr_total_length(wsi, WSI_TOKEN_PATCH_URI);\n+\t\t\t\t\t\tif (m) {\n+\t\t\t\t\t\t\tif (lws_ss_alloc_set_metadata(h, \u0022path\u0022,\n+\t\t\t\t\t\t\t\t\tlws_hdr_simple_ptr(wsi,\n+\t\t\t\t\t\t\t\t\t\tWSI_TOKEN_PATCH_URI), (unsigned int)m))\n+\t\t\t\t\t\t\t\treturn -1;\n+\t\t\t\t\t\t\tif (lws_ss_alloc_set_metadata(h, \u0022method\u0022, \u0022PATCH\u0022, 5))\n+\t\t\t\t\t\t\t\treturn -1;\n+\t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n","s":{"c":1752662795,"u": 2640}} ],"g": 4013,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}