MCPcopy Create free account
hub / github.com/apache/brpc / ReturnSuccessfulWriteRequest

Method ReturnSuccessfulWriteRequest

src/brpc/socket.cpp:504–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void Socket::ReturnSuccessfulWriteRequest(Socket::WriteRequest* p) {
505 DCHECK(p->data.empty());
506 AddOutputMessages(1);
507 const bthread_id_t id_wait = p->id_wait;
508 bool is_notify_on_success = p->is_notify_on_success();
509 butil::return_object(p);
510 // Do not access `p' after it is returned to ObjectPool.
511 if (id_wait != INVALID_BTHREAD_ID) {
512 if (is_notify_on_success && !Failed()) {
513 bthread_id_error(id_wait, 0);
514 } else {
515 NotifyOnFailed(id_wait);
516 }
517 }
518}
519
520void Socket::ReturnFailedWriteRequest(Socket::WriteRequest* p, int error_code,
521 const std::string& error_text) {

Callers 1

KeepWriteMethod · 0.80

Calls 2

return_objectFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected