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

Function http_request_reforward

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

Source from the content-addressed store, hash-verified

962/* ���ͻ��������������������������������� */
963
964static int http_request_reforward(HTTP_CLIENT *http_client)
965{
966 const char *myname = "http_request_reforward";
967 ACL_ASTREAM *server = http_client->entry.server;
968
969 /* ������Ǵ����ӳ���ȡ�õ����������Դ����� 1 */
970 if (!http_client->entry.flag_conn_reuse)
971 http_client->entry.nretry_on_error++;
972
973 if (http_client->hdr_res) {
974 http_hdr_res_free(http_client->hdr_res);
975 http_client->hdr_res = NULL;
976 }
977
978 /* �Ͽ������˵����ӣ���������������˵����� */
979 if (server) {
980 /* ʹ��������ûỰ���� */
981 client_entry_detach(&http_client->entry, acl_aio_vstream(server));
982 /* ȡ�� HTTP ��Ӧͷ�Ļص����� */
983 acl_aio_clean_hooks(server);
984 /* only for test */
985 if (acl_aio_iswset(server)) {
986 acl_msg_info("%s(%d): defer free(%d)\n", myname, __LINE__, ACL_VSTREAM_SOCK(server->stream));
987 } else
988 acl_msg_info("%s(%d): not defer free(%d)\n", myname, __LINE__, ACL_VSTREAM_SOCK(server->stream));
989 /* ���첽�رշ������ */
990 acl_aio_iocp_close(server);
991 }
992
993 /* ������Դ�����������������Ӧ��IP���������򷵻ش��󣬲������� */
994 if (http_client->entry.nretry_on_error > http_client->entry.dns_ctx.ip_cnt) {
995 acl_msg_error("%s(%d): has retried before(%d,%d), reuse connecion %s",
996 myname, __LINE__, http_client->entry.nretry_on_error,
997 http_client->entry.dns_ctx.ip_cnt,
998 http_client->entry.flag_conn_reuse ? "yes" : "no");
999 return (-1);
1000 }
1001
1002 /* ������Դ���������ֵ����������ֱ�ӷ��ش��� */
1003 if (http_client->entry.nretry_on_error >= MAX_RETRIED) {
1004 acl_msg_error("%s(%d): has retried before(%d,%d)",
1005 myname, __LINE__, http_client->entry.nretry_on_error,
1006 MAX_RETRIED);
1007 return (-1);
1008 }
1009
1010 /* ��ʼ����������һ��IP */
1011 forward_start((CLIENT_ENTRY*) http_client);
1012 return (0);
1013}
1014
1015/*----------------------------------------------------------------------------*/
1016

Callers 4

get_respond_hdr_readyFunction · 0.85
read_respond_hdr_timeoutFunction · 0.85
read_respond_hdr_errorFunction · 0.85
send_request_hdr_errorFunction · 0.85

Calls 9

http_hdr_res_freeFunction · 0.85
client_entry_detachFunction · 0.85
acl_aio_vstreamFunction · 0.85
acl_aio_clean_hooksFunction · 0.85
acl_aio_iswsetFunction · 0.85
acl_msg_infoFunction · 0.85
acl_aio_iocp_closeFunction · 0.85
acl_msg_errorFunction · 0.85
forward_startFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…