MCPcopy Index your code
hub / github.com/apache/httpd / ap_switch_protocol

Function ap_switch_protocol

server/protocol.c:2532–2562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2530}
2531
2532AP_DECLARE(apr_status_t) ap_switch_protocol(conn_rec *c, request_rec *r,
2533 server_rec *s,
2534 const char *protocol)
2535{
2536 const char *current = ap_get_protocol(c);
2537 int rc;
2538
2539 if (!strcmp(current, protocol)) {
2540 ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, c, APLOGNO(02906)
2541 "already at it, protocol_switch to %s",
2542 protocol);
2543 return APR_SUCCESS;
2544 }
2545
2546 rc = ap_run_protocol_switch(c, r, s, protocol);
2547 switch (rc) {
2548 case DECLINED:
2549 ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02907)
2550 "no implementation for protocol_switch to %s",
2551 protocol);
2552 return APR_ENOTIMPL;
2553 case OK:
2554 case DONE:
2555 return APR_SUCCESS;
2556 default:
2557 ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02905)
2558 "unexpected return code %d from protocol_switch to %s"
2559 , rc, protocol);
2560 return APR_EOF;
2561 }
2562}
2563
2564AP_DECLARE(int) ap_is_allowed_protocol(conn_rec *c, request_rec *r,
2565 server_rec *s, const char *protocol)

Callers 2

ssl_callback_alpn_selectFunction · 0.85
core_upgrade_handlerFunction · 0.85

Calls 1

ap_get_protocolFunction · 0.85

Tested by

no test coverage detected