API Change: Remove unnecessary params from oio_tcp_handle_accept()
closes #13.
This commit is contained in:
parent
0027dbd976
commit
d546a3115f
@ -236,8 +236,7 @@ void oio__server_io(EV_P_ ev_io* watcher, int revents) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client,
|
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client) {
|
||||||
oio_close_cb close_cb, void* data) {
|
|
||||||
if (server->accepted_fd < 0) {
|
if (server->accepted_fd < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
3
oio.h
3
oio.h
@ -107,8 +107,7 @@ int oio_shutdown(oio_req* req);
|
|||||||
|
|
||||||
/* TCP server methods. */
|
/* TCP server methods. */
|
||||||
int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb);
|
int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb);
|
||||||
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client,
|
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client);
|
||||||
oio_close_cb close_cb, void* data);
|
|
||||||
|
|
||||||
/* Generic handle methods */
|
/* Generic handle methods */
|
||||||
int oio_read(oio_req* req, oio_buf* bufs, int bufcnt);
|
int oio_read(oio_req* req, oio_buf* bufs, int bufcnt);
|
||||||
|
|||||||
@ -67,7 +67,7 @@ void on_accept(oio_handle* server) {
|
|||||||
int r = oio_tcp_handle_init(&p->handle, on_close, (void*)p);
|
int r = oio_tcp_handle_init(&p->handle, on_close, (void*)p);
|
||||||
ASSERT(!r)
|
ASSERT(!r)
|
||||||
|
|
||||||
if (oio_tcp_handle_accept(server, &p->handle, on_close, (void*)p)) {
|
if (oio_tcp_handle_accept(server, &p->handle)) {
|
||||||
FATAL(oio_tcp_handle_accept failed)
|
FATAL(oio_tcp_handle_accept failed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user