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

Method send_response

lib_rpc/src/http_stream.cpp:205–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205bool http_response::send_response(const MessageLite& in)
206{
207 std::string buf;
208
209#ifdef DEBUG
210 struct timeval begin, end;
211 gettimeofday(&begin, NULL);
212#endif
213
214 in.SerializeToString(&buf);
215
216#ifdef DEBUG
217 gettimeofday(&end, NULL);
218 build_spent_ = stamp_sub(&end, &begin);
219
220 gettimeofday(&begin, NULL);
221#endif
222
223 acl::http_header& header = response_->response_header();
224 header.set_status(200);
225 header.set_content_length(buf.length());
226 header.set_keep_alive(true);
227
228 bool ret = response_->response(buf.c_str(), buf.length());
229
230#ifdef DEBUG
231 gettimeofday(&end, NULL);
232 response_spent_ = stamp_sub(&end, &begin);
233#endif
234
235 return ret;
236}
237
238} // namespace io
239} // namespace protobuf

Callers 1

handle_oneFunction · 0.80

Calls 7

set_keep_aliveMethod · 0.80
responseMethod · 0.80
stamp_subFunction · 0.70
gettimeofdayFunction · 0.50
set_statusMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected