ssb: Try harder to avoid doing things with new connections during shutdown.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 26m2s

This commit is contained in:
2025-01-16 12:47:50 -05:00
parent 5ce4f55228
commit 3e3d58a4a9
2 changed files with 12 additions and 1 deletions

View File

@ -629,6 +629,12 @@ static void _http_on_connection(uv_stream_t* stream, int status)
{
tf_http_listener_t* listener = stream->data;
tf_http_t* http = listener->http;
if (http->is_shutting_down)
{
tf_printf("Ignoring HTTP connection during shutdown.\n");
return;
}
tf_http_connection_t* connection = tf_malloc(sizeof(tf_http_connection_t));
*connection = (tf_http_connection_t) { .http = http, .tcp = { .data = connection }, .is_receiving_headers = true };
if (listener->tls)