Disable Nagle's algorithm before we start the TLS handshake. Just speculation that it will help with some responsiveness.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4170 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-02-06 02:29:00 +00:00
parent f6742bebf3
commit beda047eb0
2 changed files with 8 additions and 6 deletions

View File

@ -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";

View File

@ -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);
}