Warmcat homepage andy@warmcat.com
libwebsockets
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1745908187, "reponame":"sai", "desc":"Sai lightweight distributed CI", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/sai", "f":3, "items": [ {"schema":"libjg2-1", "cid":"8fc5a2a00d04b9e8cb05943702eb9f4c", "commit": {"type":"commit", "time": 1444607271, "time_ofs": 480, "oid_tree": { "oid": "0e688297ea2e589a9b2732fe1db5bc0ba00738e0", "alias": []}, "oid":{ "oid": "92b69635dd3efbb1e7684c7fb00aa338664c2a62", "alias": []}, "msg": "Fixing occasional failure of connect() on Windows", "sig_commit": { "git_time": { "time": 1444607271, "offset": 480 }, "name": "Andy Green", "email": "andy.green@linaro.org", "md5": "4863edaebb4491aa6049a4d2d9c98c2c" }, "sig_author": { "git_time": { "time": 1440613888, "offset": -420 }, "name": "Frugality", "email": "court@idstrom.com", "md5": "7d6348d380a4113ab9f91f7278948bc7" }}, "body": "Fixing occasional failure of connect() on Windows\n\nSee: https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v\u003dvs.85).aspx\n\nSpecifically the section reading:\n\n\u0022Until the connection attempt completes on a nonblocking socket, all subsequent calls to connect on the same socket will fail with the error code WSAEALREADY, and WSAEISCONN when the connection completes successfully. Due to ambiguities in version 1.1 of the Windows Sockets specification, error codes returned from connect while a connection is already pending may vary among implementations. As a result, it is not recommended that applications use multiple calls to connect to detect connection completion. If they do, they must be prepared to handle WSAEINVAL and WSAEWOULDBLOCK error values the same way that they handle WSAEALREADY, to assure robust operation.\u0022\n" , "diff": "diff --git a/lib/client-handshake.c b/lib/client-handshake.c\nindex ebb0daf..e5c1357 100644\n--- a/lib/client-handshake.c\n+++ b/lib/client-handshake.c\n@@ -203,8 +203,14 @@ struct libwebsocket *libwebsocket_client_connect_2(\n \n \tif (connect(wsi-\u003esock, v, n) \u003d\u003d -1 || LWS_ERRNO \u003d\u003d LWS_EISCONN) {\n \n-\t\tif (LWS_ERRNO \u003d\u003d LWS_EALREADY || LWS_ERRNO \u003d\u003d LWS_EINPROGRESS\n-\t\t || LWS_ERRNO \u003d\u003d LWS_EWOULDBLOCK) {\n+\t\tif (LWS_ERRNO \u003d\u003d LWS_EALREADY\n+\t\t\t|| LWS_ERRNO \u003d\u003d LWS_EINPROGRESS\n+\t\t\t|| LWS_ERRNO \u003d\u003d LWS_EWOULDBLOCK\n+#ifdef _WIN32\n+\t\t\t|| LWS_ERRNO \u003d\u003d WSAEINVAL\n+#endif\n+\t\t\t)\n+\t\t{\n \t\t\tlwsl_client(\u0022nonblocking connect retry\u005cn\u0022);\n \n \t\t\t/*\n","s":{"c":1745908187,"u": 1076}} ],"g": 1659,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}