1515// specific language governing permissions and limitations
1616// under the License.
1717
18- #include " tcp_transport.h"
18+ #include " brpc/tcp_transport.h"
19+
1920namespace brpc {
2021DECLARE_bool (usercode_in_coroutine);
2122DECLARE_bool (usercode_in_pthread);
@@ -49,14 +50,15 @@ ssize_t TcpTransport::CutFromIOBufList(butil::IOBuf** buf, size_t ndata) {
4950 return butil::IOBuf::cut_multiple_into_file_descriptor (_socket->fd (), buf, ndata);
5051}
5152
52- int TcpTransport::WaitEpollOut (butil::atomic<int >* _epollout_butex, bool pollin, const timespec duetime) {
53+ int TcpTransport::WaitEpollOut (butil::atomic<int >* _epollout_butex,
54+ bool pollin, timespec duetime) {
5355 g_vars->nwaitepollout << 1 ;
5456 const int rc = _socket->WaitEpollOut (_socket->fd (), pollin, &duetime);
5557 if (rc < 0 && errno != ETIMEDOUT) {
5658 const int saved_errno = errno;
5759 PLOG (WARNING) << " Fail to wait epollout of " << _socket;
5860 _socket->SetFailed (saved_errno, " Fail to wait epollout of %s: %s" ,
59- _socket->description ().c_str (), berror (saved_errno));
61+ _socket->description ().c_str (), berror (saved_errno));
6062 return 1 ;
6163 }
6264 return 0 ;
@@ -71,15 +73,18 @@ void TcpTransport::ProcessEvent(bthread_attr_t attr) {
7173 OnEdge (_socket);
7274 }
7375}
74- void TcpTransport::QueueMessage (InputMessageClosure& input_msg, int * num_bthread_created, bool last_msg) {
76+ void TcpTransport::QueueMessage (InputMessageClosure& input_msg,
77+ int * num_bthread_created, bool ) {
7578 InputMessageBase* to_run_msg = input_msg.release ();
7679 if (!to_run_msg) {
7780 return ;
7881 }
7982 // Create bthread for last_msg. The bthread is not scheduled
8083 // until bthread_flush() is called (in the worse case).
8184 bthread_t th;
82- bthread_attr_t tmp = (FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL) | BTHREAD_NOSIGNAL;
85+ bthread_attr_t tmp =
86+ (FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL) |
87+ BTHREAD_NOSIGNAL;
8388 tmp.keytable_pool = _socket->keytable_pool ();
8489 tmp.tag = bthread_self_tag ();
8590 bthread_attr_set_name (&tmp, " ProcessInputMessage" );
@@ -90,5 +95,5 @@ void TcpTransport::QueueMessage(InputMessageClosure& input_msg, int* num_bthread
9095 ProcessInputMessage (to_run_msg);
9196 }
9297}
93- void TcpTransport::Debug (std::ostream &os) {}
94- }
98+
99+ } // namespace brpc
0 commit comments