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

Function get_body_ready

lib_protocol/samples/http_probe/probe_run.cpp:117–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117static int get_body_ready(int status, char *data acl_unused,
118 int dlen acl_unused, void *arg)
119{
120 const char *myname = "get_body_ready";
121 PROBE_SERVER *server = (PROBE_SERVER *) arg;
122
123#if 0
124 if (var_probe_debug_fp && status !=HTTP_STATUS_OK && dlen > 0) {
125 acl_vstream_writen(var_probe_debug_fp, data, dlen);
126 }
127#else
128 acl_msg_info("%s: len(%d), status=%d", myname, dlen, status);
129#endif
130
131 if (status == HTTP_CHAT_OK) {
132 msg_info(server, "%s(%d), get body over, body_len(%d)",
133 myname, __LINE__, dlen);
134
135 close_stream(server);
136 printf("---------------read over(%d) -----------------\r\n", dlen);
137 timer_retry(server);
138 } else if (status >= HTTP_CHAT_ERR_IO) {
139 msg_error(server, "%s(%d), get body error(io), status(%d)",
140 myname, __LINE__, status);
141
142 close_stream(server);
143 timer_retry(server);
144 return -1;
145 }
146
147 return 0;
148}
149
150static int get_header_ready(int status, void *arg)
151{

Callers

nothing calls this directly

Calls 6

acl_vstream_writenFunction · 0.85
acl_msg_infoFunction · 0.85
timer_retryFunction · 0.85
msg_infoFunction · 0.70
close_streamFunction · 0.70
msg_errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…