s/oio_tcp_handle_accept/oio_accept/

This commit is contained in:
Ryan Dahl 2011-04-18 12:53:02 -07:00
parent cf4fbc0925
commit 8f6a175e9d
4 changed files with 6 additions and 6 deletions

View File

@ -248,7 +248,7 @@ void oio__server_io(EV_P_ ev_io* watcher, int revents) {
handle->accepted_fd = fd;
handle->accept_cb(handle);
if (handle->accepted_fd >= 0) {
/* The user hasn't yet accepted called oio_tcp_handle_accept() */
/* The user hasn't yet accepted called oio_accept() */
ev_io_stop(EV_DEFAULT_ &handle->read_watcher);
return;
}
@ -257,7 +257,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_accept(oio_handle* server, oio_handle* client,
oio_close_cb close_cb, void* data) {
if (server->accepted_fd < 0) {
return -1;

View File

@ -371,7 +371,7 @@ int oio_tcp_handle_init(oio_handle *handle, oio_close_cb close_cb,
}
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client,
int oio_accept(oio_handle* server, oio_handle* client,
oio_close_cb close_cb, void* data) {
if (!server->accepted_socket == INVALID_SOCKET) {
oio_errno_ = WSAENOTCONN;

2
oio.h
View File

@ -130,7 +130,7 @@ int oio_shutdown(oio_req* req);
int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb);
/* Call this after accept_cb. client does not need to be initialized. */
int oio_tcp_handle_accept(oio_handle* server, oio_handle* client,
int oio_accept(oio_handle* server, oio_handle* client,
oio_close_cb close_cb, void* data);
/* Generic handle methods */

View File

@ -85,8 +85,8 @@ void on_close(oio_handle* peer, oio_err err) {
void on_accept(oio_handle* server) {
peer_t* p = (peer_t*)calloc(sizeof(peer_t), 1);
if (oio_tcp_handle_accept(server, &p->handle, on_close, (void*)p)) {
FATAL("oio_tcp_handle_accept failed");
if (oio_accept(server, &p->handle, on_close, (void*)p)) {
FATAL("oio_accept failed");
}
p->buf.base = (char*)&p->read_buffer;