| 962 | /* ���ͻ��������������������������������� */ |
| 963 | |
| 964 | static 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 |
no test coverage detected
searching dependent graphs…