From dd66e6306b4553154692326bcf91bfdfd4a1ee89 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 26 Jan 2001 23:17:26 +0000 Subject: [PATCH] Remove isc_socket/[send|recv]mark, which were never used. --- lib/isc/include/isc/socket.h | 39 +---------- lib/isc/unix/socket.c | 122 ++--------------------------------- 2 files changed, 5 insertions(+), 156 deletions(-) diff --git a/lib/isc/include/isc/socket.h b/lib/isc/include/isc/socket.h index c947dd7ce9..63cc7d6f93 100644 --- a/lib/isc/include/isc/socket.h +++ b/lib/isc/include/isc/socket.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.51 2001/01/09 21:57:34 bwelling Exp $ */ +/* $Id: socket.h,v 1.52 2001/01/26 23:17:25 bwelling Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -135,8 +135,6 @@ struct isc_socket_connev { #define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2) #define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3) #define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4) -#define ISC_SOCKEVENT_RECVMARK (ISC_EVENTCLASS_SOCKET + 5) -#define ISC_SOCKEVENT_SENDMARK (ISC_EVENTCLASS_SOCKET + 6) /* * Internal events. @@ -559,41 +557,6 @@ isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, * XXX needs other net-type errors */ -isc_result_t -isc_socket_recvmark(isc_socket_t *sock, isc_task_t *task, - isc_taskaction_t action, const void *arg); -isc_result_t -isc_socket_sendmark(isc_socket_t *sock, isc_task_t *task, - isc_taskaction_t action, const void *arg); -/* - * Insert a recv/send marker for the socket. - * - * This marker is processed when all I/O requests in the proper queue - * have been processed. - * - * Requires: - * - * 'socket' is a valid, bound socket. - * - * 'task' is a valid task, 'action' is a valid action. - * - * Notes: - * - * If the queue is empty, the event will be posted immediately to the - * task. - * - * On return, the event's 'result' member will sometimes contain useful - * information. If the mark was processed after a fatal error, it will - * contain the same error that the last isc_socket_recv(), _send(), - * or sendto() returned, depending on the mark type. - * - * Returns: - * - * ISC_R_SUCCESS - * ISC_R_NOMEMORY - * ISC_R_UNEXPECTED - */ - isc_result_t isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp); /* diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 43e0486a56..d7d04793ab 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.184 2001/01/25 22:25:10 neild Exp $ */ +/* $Id: socket.c,v 1.185 2001/01/26 23:17:26 bwelling Exp $ */ #include @@ -1789,21 +1789,10 @@ internal_recv(isc_task_t *me, isc_event_t *ev) { /* * Try to do as much I/O as possible on this socket. There are no - * limits here, currently. If some sort of quantum read count is - * desired before giving up control, make certain to process markers - * regardless of quantum. + * limits here, currently. */ dev = ISC_LIST_HEAD(sock->recv_list); while (dev != NULL) { - /* - * If this is a marker event, post its completion and - * continue the loop. - */ - if (dev->ev_type == ISC_SOCKEVENT_RECVMARK) { - send_recvdone_event(sock, &dev, ISC_R_SUCCESS); - goto next; - } - switch (doio_recv(sock, dev)) { case DOIO_SOFT: goto poke; @@ -1812,9 +1801,7 @@ internal_recv(isc_task_t *me, isc_event_t *ev) { /* * read of 0 means the remote end was closed. * Run through the event queue and dispatch all - * the events with an EOF result code. This will - * set the EOF flag in markers as well, but - * that's really ok. + * the events with an EOF result code. */ do { send_recvdone_event(sock, &dev, ISC_R_EOF); @@ -1869,21 +1856,10 @@ internal_send(isc_task_t *me, isc_event_t *ev) { /* * Try to do as much I/O as possible on this socket. There are no - * limits here, currently. If some sort of quantum write count is - * desired before giving up control, make certain to process markers - * regardless of quantum. + * limits here, currently. */ dev = ISC_LIST_HEAD(sock->send_list); while (dev != NULL) { - /* - * If this is a marker event, post its completion and - * continue the loop. - */ - if (dev->ev_type == ISC_SOCKEVENT_SENDMARK) { - send_senddone_event(sock, &dev, ISC_R_SUCCESS); - goto next; - } - switch (doio_send(sock, dev)) { case DOIO_SOFT: goto poke; @@ -3268,96 +3244,6 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { UNLOCK(&sock->lock); } -isc_result_t -isc_socket_recvmark(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - isc_task_t *ntask = NULL; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&sock->lock); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVMARK, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - - dev->result = ISC_R_SUCCESS; - dev->minimum = 0; - - /* - * Bad luck. The queue wasn't empty. Insert this in the proper - * place. - */ - isc_task_attach(task, &ntask); - - dev->ev_sender = ntask; - - ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link); - - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "isc_socket_recvmark: event %p -> task %p", dev, ntask); - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_socket_sendmark(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - isc_task_t *ntask = NULL; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&sock->lock); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDMARK, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - - dev->result = ISC_R_SUCCESS; - dev->minimum = 0; - - /* - * Bad luck. The queue wasn't empty. Insert this in the proper - * place. - */ - isc_task_attach(task, &ntask); - - dev->ev_sender = ntask; - - ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link); - - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "isc_socket_sendmark: event %p -> task %p", dev, ntask); - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - isc_sockettype_t isc_socket_gettype(isc_socket_t *sock) { REQUIRE(VALID_SOCKET(sock));