MCPcopy Create free account
hub / github.com/MariaDB/server / request_send

Method request_send

plugin/handler_socket/libhsclient/hstcpcli.cpp:294–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294int
295hstcpcli::request_send()
296{
297 if (error_code < 0) {
298 return error_code;
299 }
300 clear_error();
301 if (fd.get() < 0) {
302 close();
303 return set_error(-1, "write: closed");
304 }
305 if (num_req_bufd == 0 || num_req_sent > 0 || num_req_rcvd > 0) {
306 close();
307 return set_error(-1, "request_send: protocol out of sync");
308 }
309 const size_t wrlen = writebuf.size();
310 const ssize_t r = send(fd.get(), writebuf.begin(), wrlen, MSG_NOSIGNAL);
311 if (r <= 0) {
312 close();
313 return set_error(-1, r < 0 ? "write: failed" : "write: eof");
314 }
315 writebuf.erase_front(r);
316 if (static_cast<size_t>(r) != wrlen) {
317 close();
318 return set_error(-1, "write: incomplete");
319 }
320 num_req_sent = num_req_bufd;
321 num_req_bufd = 0;
322 DBG(fprintf(stderr, "REQSEND 0\n"));
323 return 0;
324}
325
326int
327hstcpcli::response_recv(size_t& num_flds_r)

Callers 8

hstcpcli_mainFunction · 0.80
runMethod · 0.80
op_insertMethod · 0.80
op_deleteMethod · 0.80
op_updateMethod · 0.80
op_readMethod · 0.80
op_readnolockMethod · 0.80
test_11Method · 0.80

Calls 5

sendFunction · 0.85
erase_frontMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by 1

test_11Method · 0.64