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

Function hdr_ready

lib_protocol/src/http/http_chat_async.c:73–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71/* ����һ������, �Ƿ���һ��������HTTPЭ��ͷ */
72
73static int hdr_ready(HTTP_HDR *hdr, char *line, int dlen)
74{
75 const char *myname = "hdr_ready";
76 HTTP_HDR_ENTRY *entry;
77
78 hdr->cur_lines++;
79 if (hdr->max_lines > 0 && hdr->cur_lines > hdr->max_lines) {
80 acl_msg_error("%s(%d): cur_lines(%d) > max_lines(%d)",
81 myname, __LINE__, hdr->cur_lines, hdr->max_lines);
82 return HTTP_CHAT_ERR_TOO_MANY_LINES;
83 }
84
85 if (dlen > 0) {
86 hdr->valid_lines++;
87 }
88
89 if (dlen == 0) {
90 if (hdr->valid_lines > 0) {
91 return HTTP_CHAT_OK;
92 } else {
93 return HTTP_CHAT_CONTINUE;
94 }
95 }
96
97 if (hdr->valid_lines == 1) {
98 entry = http_hdr_entry_head(line);
99 } else {
100 entry = http_hdr_entry_new2(line);
101 }
102 if (entry == NULL) { /* ignore invalid entry line */
103 return HTTP_CHAT_CONTINUE;
104 }
105
106 http_hdr_append_entry(hdr, entry);
107 return HTTP_CHAT_CONTINUE;
108}
109
110/* �첽��ȡһ�����ݵĻص����� */
111

Callers 2

hdr_gets_readyFunction · 0.70
hdr_can_readFunction · 0.70

Calls 4

acl_msg_errorFunction · 0.85
http_hdr_entry_headFunction · 0.85
http_hdr_entry_new2Function · 0.85
http_hdr_append_entryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…