{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1750824331,
"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":"b390a377924c1d89c0864a5299d1507c",
"commit": {"type":"commit",
"time": 1649570172,
"time_ofs": 60,
"oid_tree": { "oid": "e7a98f8207d1d8a2ae652e04deeb103ec71b6480", "alias": []},
"oid":{ "oid": "76a5a9e2f231c347f2c830daf38e85cd251b4838", "alias": []},
"msg": "client: connect report actual socket error to user callback rather than EINPROGRESS",
"sig_commit": { "git_time": { "time": 1649570172, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1634305581, "offset": -240 }, "name": "Felipe Gasper", "email": "felipe@felipegasper.com", "md5": "7025edb9fd7d7bf4911a432c1072c6f4" }},
"body": "client: connect report actual socket error to user callback rather than EINPROGRESS\n\nhttps://github.com/warmcat/libwebsockets/pull/2452\n\n"
,
"diff": "diff --git a/lib/core-net/client/connect3.c b/lib/core-net/client/connect3.c\nindex 6498ff0..b6433e7 100644\n--- a/lib/core-net/client/connect3.c\n+++ b/lib/core-net/client/connect3.c\n@@ -71,7 +71,7 @@ typedef enum {\n } lcccr_t;\n \n static lcccr_t\n-lws_client_connect_check(struct lws *wsi)\n+lws_client_connect_check(struct lws *wsi, int *real_errno)\n {\n #if !defined(LWS_WITH_NO_LOGS)\n \tchar t16[16];\n@@ -103,6 +103,8 @@ lws_client_connect_check(struct lws *wsi)\n \t\tlwsl_wsi_notice(wsi, \u0022getsockopt fd %d says %s\u0022, wsi-\u003edesc.sockfd,\n \t\t\t\tlws_errno_describe(e, t16, sizeof(t16)));\n \n+\t\t*real_errno \u003d e;\n+\n \t\treturn LCCCR_FAILED;\n \t}\n \n@@ -133,7 +135,7 @@ lws_client_connect_check(struct lws *wsi)\n #endif\n \n \tlwsl_wsi_notice(wsi, \u0022connect check FAILED: %s\u0022,\n-\t\t\tlws_errno_describe(en, t16, sizeof(t16)));\n+\t\t\tlws_errno_describe(*real_errno || en, t16, sizeof(t16)));\n \n \treturn LCCCR_FAILED;\n }\n@@ -238,7 +240,15 @@ lws_client_connect_3_connect(struct lws *wsi, const char *ads,\n \t\t\t/* no dns results and no ongoing timeout for one */\n \t\t\tgoto connect_to;\n \n-\t\tswitch (lws_client_connect_check(wsi)) {\n+\t\t/*\n+\t\t * If the connection failed, the OS-level errno may be\n+\t\t * something like EINPROGRESS rather than the actual problem\n+\t\t * that prevented a connection. This value will represent the\n+\t\t * “real” problem that we should report to the caller.\n+\t\t */\n+\t\tint real_errno \u003d 0;\n+\n+\t\tswitch (lws_client_connect_check(wsi, \u0026real_errno)) {\n \t\tcase LCCCR_CONNECTED:\n \t\t\t/*\n \t\t\t * Oh, it has happened...\n@@ -247,9 +257,11 @@ lws_client_connect_3_connect(struct lws *wsi, const char *ads,\n \t\tcase LCCCR_CONTINUE:\n \t\t\treturn NULL;\n \t\tdefault:\n-\t\t\ten \u003d LWS_ERRNO;\n+\t\t\tif (!real_errno)\n+\t\t\t\treal_errno \u003d LWS_ERRNO;\n \t\t\tlws_snprintf(dcce, sizeof(dcce), \u0022conn fail: %s\u0022,\n-\t\t\t\t lws_errno_describe(en, t16, sizeof(t16)));\n+\t\t\t\t lws_errno_describe(real_errno, t16, sizeof(t16)));\n+\n \t\t\tcce \u003d dcce;\n \t\t\tlwsl_wsi_debug(wsi, \u0022%s\u0022, dcce);\n \t\t\tlws_metrics_caliper_report(wsi-\u003ecal_conn, METRES_NOGO);\n","s":{"c":1750824331,"u": 5752}}
],"g": 6591,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}