{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1752656078,
"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":"be3cdbc31eb7da1d3e9cf3db2753f11a",
"commit": {"type":"commit",
"time": 1572194347,
"time_ofs": 0,
"oid_tree": { "oid": "4d1eb3e0957008cd19c5735ffc59e2ad72795932", "alias": []},
"oid":{ "oid": "9dd8d03387870978e55e0589cfe16d7d085f116e", "alias": []},
"msg": "Improve logging when setting sock opts on windows",
"sig_commit": { "git_time": { "time": 1572194347, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1572194347, "offset": 0 }, "name": "Kristján Valur Jónsson", "email": "sweskman@gmail.com", "md5": "abd1db44a5e5138fbfec8ccf71d47691" }},
"body": "Improve logging when setting sock opts on windows\n"
,
"diff": "diff --git a/lib/plat/windows/windows-sockets.c b/lib/plat/windows/windows-sockets.c\nindex 6ebff31..d8a1e2f 100644\n--- a/lib/plat/windows/windows-sockets.c\n+++ b/lib/plat/windows/windows-sockets.c\n@@ -46,8 +46,13 @@ int\n lws_plat_set_nonblocking(int fd)\n {\n \tu_long optl \u003d 1;\n-\n-\treturn !!ioctlsocket(fd, FIONBIO, \u0026optl);\n+\tint result \u003d !!ioctlsocket(fd, FIONBIO, \u0026optl);\n+\tif (!result)\n+\t{\n+\t\tint error \u003d LWS_ERRNO;\n+\t\tlwsl_err(\u0022ioctlsocket FIONBIO 1 failed with error %d\u005cn\u0022, error);\n+\t}\n+\treturn result;\n }\n \n int\n@@ -67,16 +72,22 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd,\n \t\t/* enable keepalive on this socket */\n \t\toptval \u003d 1;\n \t\tif (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE,\n-\t\t\t (const char *)\u0026optval, optlen) \u003c 0)\n+\t\t\t (const char *)\u0026optval, optlen) \u003c 0) {\n+\t\t\tint error \u003d LWS_ERRNO;\n+\t\t\tlwsl_err(\u0022setsockopt SO_KEEPALIVE 1 failed with error %d\u005cn\u0022, error);\n \t\t\treturn 1;\n+\t\t}\n \n \t\talive.onoff \u003d TRUE;\n \t\talive.keepalivetime \u003d vhost-\u003eka_time * 1000;\n \t\talive.keepaliveinterval \u003d vhost-\u003eka_interval * 1000;\n \n \t\tif (WSAIoctl(fd, SIO_KEEPALIVE_VALS, \u0026alive, sizeof(alive),\n-\t\t\t NULL, 0, \u0026dwBytesRet, NULL, NULL))\n+\t\t\t NULL, 0, \u0026dwBytesRet, NULL, NULL)) {\n+\t\t\tint error \u003d LWS_ERRNO;\n+\t\t\tlwsl_err(\u0022WSAIoctl SIO_KEEPALIVE_VALS 1 %lu %lu failed with error %d\u005cn\u0022, alive.keepalivetime, alive.keepaliveinterval, error);\n \t\t\treturn 1;\n+\t\t}\n \t}\n \n \t/* Disable Nagle */\n@@ -84,7 +95,8 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd,\n #ifndef _WIN32_WCE\n \ttcp_proto \u003d getprotobyname(\u0022TCP\u0022);\n \tif (!tcp_proto) {\n-\t\tlwsl_err(\u0022getprotobyname() failed with error %d\u005cn\u0022, LWS_ERRNO);\n+\t\tint error \u003d LWS_ERRNO;\n+\t\tlwsl_err(\u0022getprotobyname() failed with error %d\u005cn\u0022, error);\n \t\treturn 1;\n \t}\n \tprotonbr \u003d tcp_proto-\u003ep_proto;\n@@ -92,7 +104,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd,\n \tprotonbr \u003d 6;\n #endif\n \n-\tsetsockopt(fd, protonbr, TCP_NODELAY, (const char *)\u0026optval, optlen);\n+\tif (setsockopt(fd, protonbr, TCP_NODELAY, (const char *)\u0026optval, optlen) ) {\n+\t\tint error \u003d LWS_ERRNO;\n+\t\tlwsl_warn(\u0022setsockopt TCP_NODELAY 1 failed with error %d\u005cn\u0022, error);\n+\t}\n+\n \n \treturn lws_plat_set_nonblocking(fd);\n }\n","s":{"c":1752656078,"u": 1682}}
],"g": 3021,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}