| 502 | } |
| 503 | |
| 504 | void 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 | |
| 520 | void Socket::ReturnFailedWriteRequest(Socket::WriteRequest* p, int error_code, |
| 521 | const std::string& error_text) { |
no test coverage detected