Skip to content
Snippets Groups Projects
Commit 30d40911 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix bug with Socket.getoption() of byte-sized options

Only observed on Windows, the option value variable (val) was uninitialized so querying byte-sized options using WinSock getsockopt() would leave the MSB of the value as undefined (garbage), resulting in sockinfo.js output like this:
KEEPALIVE = -858993663
instead of this:
KEEPALIVE = 1
parent 0d26e562
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #836 passed
...@@ -1515,8 +1515,8 @@ js_getsockopt(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1515,8 +1515,8 @@ js_getsockopt(JSContext *cx, uintN argc, jsval *arglist)
JSObject *obj=JS_THIS_OBJECT(cx, arglist); JSObject *obj=JS_THIS_OBJECT(cx, arglist);
jsval *argv=JS_ARGV(cx, arglist); jsval *argv=JS_ARGV(cx, arglist);
int opt; int opt;
int level; int level = 0;
int val; int val = 0;
js_socket_private_t* p; js_socket_private_t* p;
LINGER linger; LINGER linger;
void* vp=&val; void* vp=&val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment