static void reqread_on_timeout(h2o_timeout_entry_t *entry) { struct st_h2o_http1_conn_t *conn = H2O_STRUCT_FROM_MEMBER(struct st_h2o_http1_conn_t, _timeout_entry, entry); if (conn->_req_index == 1) { /* assign hostconf and bind conf so that the request can be logged */ h2o_hostconf_t *hostconf = h2o_req_setup(&conn->req); h2o_req_bind_conf(&conn->req, hostconf, &hostconf->fallback_path); /* set error status for logging */ conn->req.res.reason = "Request Timeout"; } conn->req.http1_is_persistent = 0; close_connection(conn, 1); }
static int delegate_dynamic_request(h2o_req_t *req, size_t url_path_len, const char *local_path, size_t local_path_len, h2o_mimemap_type_t *mime_type) { h2o_filereq_t *filereq; h2o_handler_t *handler; assert(mime_type->data.dynamic.pathconf.handlers.size == 1); filereq = h2o_mem_alloc_pool(&req->pool, sizeof(*filereq)); filereq->url_path_len = url_path_len; filereq->local_path = h2o_strdup(&req->pool, local_path, local_path_len); h2o_req_bind_conf(req, req->hostconf, &mime_type->data.dynamic.pathconf); req->filereq = filereq; handler = mime_type->data.dynamic.pathconf.handlers.entries[0]; return handler->on_req(handler, req); }