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

Method handle

app/master/daemon/manage/http_client.cpp:161–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159};
160
161bool http_client::handle(void)
162{
163 const char* cmd = http_hdr_req_param(hdr_req_, "cmd");
164 if (cmd == NULL || *cmd == 0) {
165 //logger_error("cmd null");
166 acl::string dummy;
167 do_reply(400, "none", dummy, false);
168 if (hdr_req_->hdr.keep_alive)
169 wait();
170 else
171 acl_aio_iocp_close(conn_);
172 return true;
173 }
174
175#define EQ !strcasecmp
176
177 int i;
178
179 for (i = 0; handlers[i].cmd != NULL; i++) {
180 if (EQ(cmd, handlers[i].cmd))
181 break;
182 }
183
184 if (handlers[i].handler == NULL) {
185 logger_warn("invalid cmd=%s", cmd);
186 acl::string dummy;
187 do_reply(400, "unknown", dummy, false);
188 if (hdr_req_->hdr.keep_alive)
189 wait();
190 else
191 acl_aio_iocp_close(conn_);
192 return true;
193 }
194
195 if ((this->*handlers[i].handler)())
196 return true;
197
198 acl_aio_iocp_close(conn_);
199 return false;
200}
201
202bool http_client::handle_list(void)
203{

Callers 7

event_handleFunction · 0.45
event_handleFunction · 0.45
http_json_serviceFunction · 0.45
http_xml_serviceFunction · 0.45
cmdline_serviceFunction · 0.45
on_headMethod · 0.45
on_bodyMethod · 0.45

Calls 2

http_hdr_req_paramFunction · 0.85
acl_aio_iocp_closeFunction · 0.85

Tested by

no test coverage detected