lwdclient.c revision 783055c0a61eba5f3a828d1b138155bae575eb14
/*
* Copyright (C) 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwdclient.c,v 1.10 2000/10/31 22:39:25 bwelling Exp $ */
#include <config.h>
#include <named/lwdclient.h>
static void
void
}
{
unsigned int i;
return (ISC_R_NOMEMORY);
!= ISC_R_SUCCESS)
goto errout;
for (i = 0 ; i < nclients ; i++) {
}
}
/*
* If we could create no clients, clean up and return.
*/
goto errout;
if (result != ISC_R_SUCCESS)
goto errout;
/*
* This MUST be last, since there is no way to cancel an onshutdown...
*/
cm);
if (result != ISC_R_SUCCESS)
goto errout;
return (ISC_R_SUCCESS);
}
return (result);
}
static void
if (!SHUTTINGDOWN(cm))
return;
/*
* run through the idle list and free the clients there. Idle
* clients do not have a recv running nor do they have any finds
* or similar running.
*/
}
return;
}
static void
if (result != ISC_R_SUCCESS) {
goto restart;
}
return;
return;
case LWRES_OPCODE_NOOP:
return;
default:
goto restart;
}
/*
* Drop the packet.
*/
}
void
ns_lwdclient_log(50,
"event received: task %p, length %u, result %u (%s)",
isc_event_free(&ev);
/*
* Go idle.
*/
return;
}
} else
isc_event_free(&ev);
}
/*
* This function will start a new recv() on a socket for this client manager.
*/
isc_region_t r;
if (SHUTTINGDOWN(cm)) {
return (ISC_R_SUCCESS);
}
/*
* If a recv is already running, don't bother.
*/
return (ISC_R_SUCCESS);
/*
* If we have no idle slots, just return success.
*/
return (ISC_R_SUCCESS);
/*
* Issue the recv. If it fails, return that it did.
*/
r.length = LWRES_RECVLENGTH;
client);
if (result != ISC_R_SUCCESS)
return (result);
/*
* Set the flag to say we've issued a recv() call.
*/
/*
* Remove the client from the idle list, and put it on the running
* list.
*/
return (ISC_R_SUCCESS);
}
static void
/*
* run through the idle list and free the clients there. Idle
* clients do not have a recv running nor do they have any finds
* or similar running.
*/
}
/*
* Cancel any pending I/O.
*/
/*
* Run through the running client list and kill off any finds
* in progress.
*/
}
isc_event_free(&ev);
}
/*
* Do all the crap needed to move a client from the run queue to the idle
* queue.
*/
void
}
void
client->sendlength);
client->sendlength = 0;
isc_event_free(&ev);
}
struct in6_pktinfo *pktinfo;
if (client->pktinfo_valid)
else
}
void
client->recvlength = 0;
client->sendlength = 0;
client->find_wanted = 0;
}