| 106 | } |
| 107 | |
| 108 | static void http_proxy_complete(HTTP_CLIENT *http_client, int error_happen) |
| 109 | { |
| 110 | /* ��Ҫ��ǰ֪����������Ϳͻ������Ƿ��Ѿ������룬��Ϊ���澭�� |
| 111 | * http_proxy_server_complete �� http_proxy_client_complte �� |
| 112 | * http_client ��ռ�ڴ�����Ѿ����ͷţ�������ǰ֪�������/�ͻ� |
| 113 | * ������״̬���Ա����ڴ�Ƿ����� |
| 114 | */ |
| 115 | int server_null = http_client->entry.server == NULL; |
| 116 | int client_null = http_client->entry.client == NULL; |
| 117 | |
| 118 | /* �ж���������Ƿ�Ӧ���ֳ����� */ |
| 119 | |
| 120 | if (var_cfg_http_server_keepalive && !error_happen |
| 121 | && http_client->hdr_res |
| 122 | && http_client->hdr_res->hdr.keep_alive) |
| 123 | { |
| 124 | http_client->flag |= HTTP_FLAG_SERVER_KEEP_ALIVE; |
| 125 | } |
| 126 | |
| 127 | /* �ж��ͻ������Ƿ�Ӧ���ֳ����� */ |
| 128 | |
| 129 | if (var_cfg_http_client_keepalive && !error_happen |
| 130 | && (http_client->flag & HTTP_FLAG_SERVER_KEEP_ALIVE) |
| 131 | && http_client->req_curr |
| 132 | && http_client->req_curr->hdr_req |
| 133 | && http_client->req_curr->hdr_req->hdr.keep_alive) |
| 134 | { |
| 135 | http_client->flag |= HTTP_FLAG_CLIENT_KEEP_ALIVE; |
| 136 | } else { |
| 137 | http_client->flag &= ~HTTP_FLAG_CLIENT_KEEP_ALIVE; |
| 138 | } |
| 139 | |
| 140 | /* ������������������״̬�������رշ������ */ |
| 141 | |
| 142 | if (!server_null && !(http_client->flag & HTTP_FLAG_SERVER_LOCKED)) { |
| 143 | http_proxy_server_complete(http_client, |
| 144 | (http_client->flag & HTTP_FLAG_SERVER_KEEP_ALIVE)); |
| 145 | } |
| 146 | |
| 147 | /* ����ͻ�������������״̬�������رտͻ����� */ |
| 148 | |
| 149 | if (!client_null && !(http_client->flag & HTTP_FLAG_CLIENT_LOCKED)) { |
| 150 | http_proxy_client_complete(http_client, |
| 151 | (http_client->flag & HTTP_FLAG_CLIENT_KEEP_ALIVE)); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /*---------------------------------------------------------------------------*/ |
| 156 |
no test coverage detected
searching dependent graphs…