diff --git a/core/httpd.js b/core/httpd.js index cf557a4f..b5836cb0 100644 --- a/core/httpd.js +++ b/core/httpd.js @@ -456,8 +456,6 @@ function handleConnection(client) { } } - client.noDelay = true; - client.onError(function(error) { logError(client.peerName + " - - [" + new Date() + "] " + error); }); @@ -558,10 +556,14 @@ let kHost = "0.0.0.0" let socket = new Socket(); socket.bind(kHost, tildefriends.http_port).then(function() { - let listenResult = socket.listen(kBacklog, function() { - socket.accept().then(handleConnection).catch(function(error) { + let listenResult = socket.listen(kBacklog, async function() { + try { + let client = await socket.accept(); + client.noDelay = true; + handleConnection(client); + } catch (error) { logError("[" + new Date() + "] accept error " + error); - }); + } }); }).catch(function(error) { logError("[" + new Date() + "] bind error " + error); @@ -574,6 +576,7 @@ if (tildefriends.https_port) { return secureSocket.listen(kBacklog, async function() { try { let client = await secureSocket.accept(); + client.noDelay = true; client.tls = true; const kCertificatePath = "data/httpd/certificate.pem"; const kPrivateKeyPath = "data/httpd/privatekey.pem"; diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 81c66f0f..7027ba0c 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -863,7 +863,6 @@ static void _tf_ssb_rpc_ebt_replicate_send_clock(tf_ssb_connection_t* connection tf_free(visible); - /* TODO: Send it in bite-size chunks. */ tf_ssb_connection_rpc_send_json(connection, k_ssb_rpc_flag_stream, -request_number, full_clock, NULL, NULL, NULL); JS_FreeValue(context, full_clock); }