Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bf949f3d authored by rswindell's avatar rswindell

Socket.connect() and .sendto() would not set Socket.error (aka last_error)

when a host-name lookup (getaddrinfo call) failed.
parent 61856178
......@@ -608,7 +608,7 @@ js_bind(JSContext *cx, uintN argc, jsval *arglist)
rc=JS_SUSPENDREQUEST(cx);
if((ret=getaddrinfo(cstr, portstr, &hints, &res)) != 0) {
JS_RESUMEREQUEST(cx,rc);
dbprintf(TRUE, p, "getaddrinfo (%s %s) failed with error %d", cstr, portstr, ret);
dbprintf(TRUE, p, "getaddrinfo(%s, %s) failed with error %d", cstr, portstr, ret);
p->last_error=ERROR_VALUE;
return(JS_TRUE);
}
......@@ -765,7 +765,8 @@ js_connect(JSContext *cx, uintN argc, jsval *arglist)
result = getaddrinfo(p->hostname, NULL, &hints, &res);
if(result != 0) {
JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
dbprintf(TRUE, p, "looking up addresses for %s", p->hostname);
p->last_error = ERROR_VALUE;
dbprintf(TRUE, p, "getaddrinfo(%s) failed with error %d", p->hostname, result);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -950,7 +951,8 @@ js_sendto(JSContext *cx, uintN argc, jsval *arglist)
dbprintf(FALSE, p, "resolving hostname: %s", p->hostname);
if((result=getaddrinfo(p->hostname, NULL, &hints, &res) != 0)) {
dbprintf(TRUE, p, "getaddrinfo failed with error %d",result);
p->last_error = ERROR_VALUE;
dbprintf(TRUE, p, "getaddrinfo(%s) failed with error %d", p->hostname, result);
JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
free(cp);
JS_RESUMEREQUEST(cx, rc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment