MCPcopy Create free account
hub / github.com/apache/httpd / c2_process

Function c2_process

modules/http2/h2_c2.c:731–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729}
730
731static apr_status_t c2_process(h2_conn_ctx_t *conn_ctx, conn_rec *c)
732{
733 const h2_request *req = conn_ctx->request;
734 conn_state_t *cs = c->cs;
735 request_rec *r = NULL;
736 const char *tenc;
737 apr_time_t timeout;
738 apr_status_t rv = APR_SUCCESS;
739
740 if (req->protocol && !strcmp("websocket", req->protocol)) {
741 req = h2_ws_rewrite_request(req, c, conn_ctx->beam_in == NULL);
742 if (!req) {
743 rv = APR_EGENERAL;
744 goto cleanup;
745 }
746 }
747
748 r = h2_create_request_rec(req, c, conn_ctx->beam_in == NULL);
749
750 if (!r) {
751 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
752 "h2_c2(%s-%d): create request_rec failed, r=NULL",
753 conn_ctx->id, conn_ctx->stream_id);
754 goto cleanup;
755 }
756 if (r->status != HTTP_OK) {
757 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
758 "h2_c2(%s-%d): create request_rec failed, r->status=%d",
759 conn_ctx->id, conn_ctx->stream_id, r->status);
760 goto cleanup;
761 }
762
763 tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
764 conn_ctx->input_chunked = tenc && ap_is_chunked(r->pool, tenc);
765
766 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
767 "h2_c2(%s-%d): created request_rec for %s",
768 conn_ctx->id, conn_ctx->stream_id, r->the_request);
769 conn_ctx->server = r->server;
770 timeout = h2_config_geti64(r, r->server, H2_CONF_STREAM_TIMEOUT);
771 if (timeout <= 0) {
772 timeout = r->server->timeout;
773 }
774 h2_conn_ctx_set_timeout(conn_ctx, timeout);
775
776 if (h2_config_sgeti(conn_ctx->server, H2_CONF_COPY_FILES)) {
777 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
778 "h2_mplx(%s-%d): copy_files in output",
779 conn_ctx->id, conn_ctx->stream_id);
780 h2_beam_set_copy_files(conn_ctx->beam_out, 1);
781 }
782
783 ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
784 if (cs) {
785 cs->state = CONN_STATE_HANDLER;
786 }
787 ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
788 "h2_c2(%s-%d): start process_request",

Callers 1

h2_c2_hook_processFunction · 0.85

Calls 10

h2_ws_rewrite_requestFunction · 0.85
h2_create_request_recFunction · 0.85
ap_is_chunkedFunction · 0.85
h2_config_geti64Function · 0.85
h2_conn_ctx_set_timeoutFunction · 0.85
h2_config_sgetiFunction · 0.85
h2_beam_set_copy_filesFunction · 0.85
ap_update_child_statusFunction · 0.85
ap_process_requestFunction · 0.85
h2_beam_closeFunction · 0.85

Tested by

no test coverage detected