diff options
-rw-r--r-- | include/salticidae/network.h | 2 | ||||
-rw-r--r-- | src/conn.cpp | 2 | ||||
-rw-r--r-- | test/test_bounded_recv_buffer.cpp | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/include/salticidae/network.h b/include/salticidae/network.h index 6f7a034..5b4cd7d 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -590,7 +590,7 @@ void MsgNetwork<OpcodeType>::on_read(const ConnPool::conn_t &_conn) { conn->ev_socket.del(); conn->ev_socket.add(FdEvent::READ | (conn->ready_send ? 0: FdEvent::WRITE)); - conn->send_data_func(conn, conn->fd, FdEvent::READ); + conn->recv_data_func(conn, conn->fd, FdEvent::READ); } } diff --git a/src/conn.cpp b/src/conn.cpp index a627a15..6a44a36 100644 --- a/src/conn.cpp +++ b/src/conn.cpp @@ -179,7 +179,7 @@ void ConnPool::Conn::_send_data_tls(const conn_t &conn, int fd, int events) { } } conn->ev_socket.del(); - conn->ev_socket.add(conn->ready_recv ? : FdEvent::READ); + conn->ev_socket.add(conn->ready_recv ? 0 : FdEvent::READ); /* consumed the buffer but endpoint still seems to be writable */ conn->ready_send = true; } diff --git a/test/test_bounded_recv_buffer.cpp b/test/test_bounded_recv_buffer.cpp index a2ec4e1..b092260 100644 --- a/test/test_bounded_recv_buffer.cpp +++ b/test/test_bounded_recv_buffer.cpp @@ -116,6 +116,7 @@ struct MyNet: public MsgNetworkByteOp { fprintf(stderr, "cannot send message, retrying\n"); sleep(1); } + printf("sent message\n"); if (!conn->is_terminated()) tcall.async_call(trigger); }; @@ -140,7 +141,8 @@ struct MyNet: public MsgNetworkByteOp { conn->get_pool()->stop(); return; } - sleep(1); + sleep(5); + printf("got message\n"); nrecv++; } }; |