forked from cory/tildefriends
At least one legit memory leak, but also add a SIGTERM handler that attempts a clean shutdown so that I can ensure that it succeeds. It currently does not.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4793 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -104,6 +104,7 @@ static JSValue _httpd_response_end(JSContext* context, JSValueConst this_val, in
|
||||
const char* headers[64] = { 0 };
|
||||
JSValue response_headers = JS_GetPropertyStr(context, this_val, "response_headers");
|
||||
int headers_count = _object_to_headers(context, response_headers, headers, tf_countof(headers));
|
||||
JS_FreeValue(context, response_headers);
|
||||
|
||||
tf_http_respond(request, status, headers, headers_count, data, length);
|
||||
|
||||
@ -302,11 +303,6 @@ static JSValue _httpd_websocket_upgrade(JSContext* context, JSValueConst this_va
|
||||
}
|
||||
headers_count += _object_to_headers(context, argv[1], headers + headers_count * 2, tf_countof(headers) - headers_count * 2);
|
||||
|
||||
for (int i = 0; i < headers_count; i += 2)
|
||||
{
|
||||
tf_printf("[%d] %s = %s\n", i / 2, headers[i * 2 + 0], headers[i * 2 + 1]);
|
||||
}
|
||||
|
||||
tf_http_request_websocket_upgrade(request);
|
||||
tf_http_respond(request, 101, headers, headers_count, NULL, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user