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

Function ajp_read_header

modules/proxy/ajp_header.c:725–767  ·  view source on GitHub ↗

* Read the ajp message and return the type of the message. */

Source from the content-addressed store, hash-verified

723 * Read the ajp message and return the type of the message.
724 */
725apr_status_t ajp_read_header(apr_socket_t *sock,
726 request_rec *r,
727 apr_size_t buffsize,
728 ajp_msg_t **msg)
729{
730 apr_byte_t result;
731 apr_status_t rc;
732
733 if (*msg) {
734 rc = ajp_msg_reuse(*msg);
735 if (rc != APR_SUCCESS) {
736 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00990)
737 "ajp_read_header: ajp_msg_reuse failed");
738 return rc;
739 }
740 }
741 else {
742 rc = ajp_msg_create(r->pool, buffsize, msg);
743 if (rc != APR_SUCCESS) {
744 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00991)
745 "ajp_read_header: ajp_msg_create failed");
746 return rc;
747 }
748 }
749 ajp_msg_reset(*msg);
750 rc = ajp_ilink_receive(sock, *msg);
751 if (rc != APR_SUCCESS) {
752 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00992)
753 "ajp_read_header: ajp_ilink_receive failed");
754 return rc;
755 }
756 ajp_msg_log(r, *msg, "ajp_read_header: ajp_ilink_receive packet dump");
757 rc = ajp_msg_peek_uint8(*msg, &result);
758 if (rc != APR_SUCCESS) {
759 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00993)
760 "ajp_read_header: ajp_msg_peek_uint8 failed");
761 return rc;
762 }
763 ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
764 "ajp_read_header: ajp_ilink_received %s (0x%02x)",
765 ajp_type_str(result), result);
766 return APR_SUCCESS;
767}
768
769/* parse the msg to read the type */
770int ajp_parse_type(request_rec *r, ajp_msg_t *msg)

Callers 1

ap_proxy_ajp_requestFunction · 0.85

Calls 7

ajp_msg_reuseFunction · 0.85
ajp_msg_createFunction · 0.85
ajp_msg_resetFunction · 0.85
ajp_ilink_receiveFunction · 0.85
ajp_msg_logFunction · 0.85
ajp_msg_peek_uint8Function · 0.85
ajp_type_strFunction · 0.85

Tested by

no test coverage detected