MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

properly check connections

+20 -14
+1 -1
meson.build
··· 67 67 build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() 68 68 69 69 version_conf = configuration_data() 70 - version_conf.set('ANT_VERSION', '0.0.6.23') 70 + version_conf.set('ANT_VERSION', '0.0.6.24') 71 71 version_conf.set('ANT_GIT_HASH', git_hash) 72 72 version_conf.set('ANT_BUILD_DATE', build_date) 73 73
+19 -13
src/modules/server.c
··· 313 313 jsval_t args[2] = {req, res_obj}; 314 314 result = js_call(server->js, server->handler, args, 2); 315 315 316 + if (js_type(result) == JS_ERR) { 317 + fprintf(stderr, "Handler error: %s\n", js_str(server->js, result)); 318 + res_ctx->status = 500; 319 + res_ctx->body = "Internal Server Error"; 320 + res_ctx->content_type = "text/plain"; 321 + res_ctx->sent = 1; 322 + } else if (!res_ctx->sent) { 323 + res_ctx->status = 404; 324 + res_ctx->body = "Not Found"; 325 + res_ctx->content_type = "text/plain"; 326 + res_ctx->sent = 1; 327 + } 328 + 316 329 return; 317 330 } 318 331 319 - if (js_type(result) == JS_ERR) { 320 - fprintf(stderr, "Handler error: %s\n", js_str(server->js, result)); 321 - res_ctx->status = 500; 322 - res_ctx->body = "Internal Server Error"; 323 - res_ctx->content_type = "text/plain"; 324 - res_ctx->sent = 1; 325 - } else { 326 - res_ctx->status = 404; 327 - res_ctx->body = "Not Found"; 328 - res_ctx->content_type = "text/plain"; 329 - res_ctx->sent = 1; 330 - } 331 - 332 + res_ctx->status = 404; 333 + res_ctx->body = "Not Found"; 334 + res_ctx->content_type = "text/plain"; 335 + res_ctx->sent = 1; 332 336 } 333 337 334 338 static void on_close(uv_handle_t *handle) { ··· 404 408 http_request_t http_req = {0}; 405 409 if (parse_http_request(client->buffer, client->buffer_len, &http_req) == 0) { 406 410 handle_http_request(client, &http_req); 411 + check_pending_responses(client->server); 407 412 free_http_request(&http_req); 408 413 } else { 409 414 response_ctx_t *res_ctx = malloc(sizeof(response_ctx_t)); ··· 416 421 res_ctx->next = client->server->pending_responses; 417 422 client->server->pending_responses = res_ctx; 418 423 client->response_ctx = res_ctx; 424 + check_pending_responses(client->server); 419 425 } 420 426 } 421 427 }