MCPcopy Create free account
hub / github.com/acl-dev/acl / http_proxy_connect_complete

Function http_proxy_connect_complete

app/jaws/module/mod_http/http_proxy.c:1033–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1031}
1032
1033static int http_proxy_connect_complete(CLIENT_ENTRY *entry)
1034{
1035 HTTP_CLIENT *http_client = (HTTP_CLIENT*) entry;
1036 const char *method = http_client->req_curr->hdr_req->method;
1037
1038 /* ���ӷ������ر�ʱ�Ļص����� */
1039 acl_aio_add_close_hook(http_client->entry.server,
1040 on_close_server, http_client);
1041
1042 /* CONNECT ����, ת�� TCP ����ģʽ, �Ӷ�����֧�� SSL */
1043 if (var_cfg_http_method_connect_enable && strcasecmp(method, "CONNECT") == 0) {
1044 if (entry->client == NULL) {
1045 acl_msg_warn("%s(%d): client null", __FILE__, __LINE__);
1046 http_proxy_complete(http_client, -1);
1047 return (0);
1048 }
1049
1050 acl_aio_writen(entry->client, HTTP_CONNECT_FIRST,
1051 (int) strlen(HTTP_CONNECT_FIRST));
1052 if (entry->client && entry->server) {
1053 tcp_start(entry);
1054 return (0);
1055 } else {
1056 http_proxy_complete(http_client, -1);
1057 return (0);
1058 }
1059 }
1060
1061 if (strcasecmp(method, "GET") != 0 && strcasecmp(method, "POST") != 0) {
1062 if (entry->client == NULL) {
1063 acl_msg_error("%s(%d): client null", __FILE__, __LINE__);
1064 } else
1065 acl_aio_writen(entry->client, HTTP_REQUEST_INVALID,
1066 (int) strlen(HTTP_REQUEST_INVALID));
1067 acl_msg_error("%s(%d): method(%s) invalid",
1068 __FILE__, __LINE__, method);
1069 http_proxy_complete(http_client, -1);
1070 return (0); /* ���أ�1��ʹ�첽��ܹرո��첽�� */
1071 }
1072
1073 /* ���� GET��POST ���� */
1074 start_forward_request(http_client);
1075 return (0);
1076}
1077
1078static void http_proxy_connect_timeout(CLIENT_ENTRY *entry)
1079{

Callers

nothing calls this directly

Calls 7

acl_aio_add_close_hookFunction · 0.85
acl_msg_warnFunction · 0.85
http_proxy_completeFunction · 0.85
acl_aio_writenFunction · 0.85
tcp_startFunction · 0.85
acl_msg_errorFunction · 0.85
start_forward_requestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…