| 86 | /* ͬ����ȡһ��������HTTPЭ��ͷ */ |
| 87 | |
| 88 | static int hdr_get(HTTP_HDR *hdr, ACL_VSTREAM *stream, int timeout) |
| 89 | { |
| 90 | /* ��ʹ��Э�̹���ջʱ���������BUFF��Ĺ���������ջ�Ŀռ��С������ڴ��˷� */ |
| 91 | char buf[HTTP_BUF_SIZE]; |
| 92 | int ret; |
| 93 | |
| 94 | stream->rw_timeout = timeout; |
| 95 | |
| 96 | while (1) { |
| 97 | ret = acl_vstream_gets_nonl(stream, buf, sizeof(buf) - 1); |
| 98 | if (ret == ACL_VSTREAM_EOF) { |
| 99 | return HTTP_CHAT_ERR_IO; |
| 100 | } |
| 101 | |
| 102 | ret = hdr_ready(hdr, buf, ret); |
| 103 | if (ret != HTTP_CHAT_CONTINUE) { |
| 104 | break; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /* ret: HTTP_CHAT_OK or error */ |
| 109 | return ret; |
| 110 | } |
| 111 | |
| 112 | int http_hdr_req_get_sync(HTTP_HDR_REQ *hdr_req, ACL_VSTREAM *stream, int timeout) |
| 113 | { |
no test coverage detected
searching dependent graphs…