Socket leak on accept.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4144 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
adefa76dfd
commit
5d5ff121f9
@ -180,13 +180,10 @@ function handleRequest(request, response) {
|
|||||||
|
|
||||||
if (handler) {
|
if (handler) {
|
||||||
try {
|
try {
|
||||||
let promise = handler.invoke(request, response);
|
Promise.resolve(handler.invoke(request, response)).catch(function(error) {
|
||||||
if (promise) {
|
|
||||||
promise.catch(function(error) {
|
|
||||||
response.reportError(error);
|
response.reportError(error);
|
||||||
request.client.close();
|
request.client.close();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
response.reportError(error);
|
response.reportError(error);
|
||||||
request.client.close();
|
request.client.close();
|
||||||
|
@ -605,6 +605,7 @@ JSValue _socket_accept(JSContext* context, JSValueConst this_val, int argc, JSVa
|
|||||||
}
|
}
|
||||||
client->_connected = true;
|
client->_connected = true;
|
||||||
tf_task_resolve_promise(socket->_task, promise, client->_object);
|
tf_task_resolve_promise(socket->_task, promise, client->_object);
|
||||||
|
JS_FreeValue(context, client->_object);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user