mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Remove isc_socket/[send|recv]mark, which were never used.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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
|
#ifndef ISC_SOCKET_H
|
||||||
#define ISC_SOCKET_H 1
|
#define ISC_SOCKET_H 1
|
||||||
@@ -135,8 +135,6 @@ struct isc_socket_connev {
|
|||||||
#define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2)
|
#define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2)
|
||||||
#define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3)
|
#define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3)
|
||||||
#define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4)
|
#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.
|
* Internal events.
|
||||||
@@ -559,41 +557,6 @@ isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
|
|||||||
* XXX needs other net-type errors
|
* 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_result_t
|
||||||
isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
|
isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
|
||||||
/*
|
/*
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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 <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -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
|
* 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
|
* limits here, currently.
|
||||||
* desired before giving up control, make certain to process markers
|
|
||||||
* regardless of quantum.
|
|
||||||
*/
|
*/
|
||||||
dev = ISC_LIST_HEAD(sock->recv_list);
|
dev = ISC_LIST_HEAD(sock->recv_list);
|
||||||
while (dev != NULL) {
|
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)) {
|
switch (doio_recv(sock, dev)) {
|
||||||
case DOIO_SOFT:
|
case DOIO_SOFT:
|
||||||
goto poke;
|
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.
|
* read of 0 means the remote end was closed.
|
||||||
* Run through the event queue and dispatch all
|
* Run through the event queue and dispatch all
|
||||||
* the events with an EOF result code. This will
|
* the events with an EOF result code.
|
||||||
* set the EOF flag in markers as well, but
|
|
||||||
* that's really ok.
|
|
||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
send_recvdone_event(sock, &dev, ISC_R_EOF);
|
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
|
* 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
|
* limits here, currently.
|
||||||
* desired before giving up control, make certain to process markers
|
|
||||||
* regardless of quantum.
|
|
||||||
*/
|
*/
|
||||||
dev = ISC_LIST_HEAD(sock->send_list);
|
dev = ISC_LIST_HEAD(sock->send_list);
|
||||||
while (dev != NULL) {
|
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)) {
|
switch (doio_send(sock, dev)) {
|
||||||
case DOIO_SOFT:
|
case DOIO_SOFT:
|
||||||
goto poke;
|
goto poke;
|
||||||
@@ -3268,96 +3244,6 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
|
|||||||
UNLOCK(&sock->lock);
|
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_sockettype_t
|
||||||
isc_socket_gettype(isc_socket_t *sock) {
|
isc_socket_gettype(isc_socket_t *sock) {
|
||||||
REQUIRE(VALID_SOCKET(sock));
|
REQUIRE(VALID_SOCKET(sock));
|
||||||
|
Reference in New Issue
Block a user