* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.142 2001/01/27 02:07:59 bwelling Exp $ */
+/* $Id: client.c,v 1.143 2001/01/29 19:49:48 bwelling Exp $ */
#include <config.h>
clientmgr_destroy(manager);
}
-static void
-set_timeout(ns_client_t *client, unsigned int seconds) {
+void
+ns_client_settimeout(ns_client_t *client, unsigned int seconds) {
isc_result_t result;
isc_interval_t interval;
isc_interval_set(&interval, seconds, 0);
result = isc_timer_reset(client->timer, isc_timertype_once, NULL,
&interval, ISC_FALSE);
+ client->timerset = ISC_TRUE;
if (result != ISC_R_SUCCESS) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_CLIENT, ISC_LOG_ERROR,
if (client->tcpquota != NULL)
isc_quota_detach(&client->tcpquota);
- (void) isc_timer_reset(client->timer, isc_timertype_inactive,
- NULL, NULL, ISC_TRUE);
+ if (client->timerset) {
+ (void) isc_timer_reset(client->timer,
+ isc_timertype_inactive,
+ NULL, NULL, ISC_TRUE);
+ client->timerset = ISC_FALSE;
+ }
client->peeraddr_valid = ISC_FALSE;
isc_stdtime_get(&client->requesttime);
client->now = client->requesttime;
- set_timeout(client, 60);
-
if (result != ISC_R_SUCCESS) {
if (TCP_CLIENT(client))
ns_client_next(client, result);
break;
case dns_opcode_update:
CTRACE("update");
+ ns_client_settimeout(client, 60);
ns_update_start(client, sigresult);
break;
case dns_opcode_notify:
CTRACE("notify");
+ ns_client_settimeout(client, 60);
ns_notify_start(client);
break;
case dns_opcode_iquery:
client, &client->timer);
if (result != ISC_R_SUCCESS)
goto cleanup_task;
+ client->timerset = ISC_FALSE;
client->message = NULL;
result = dns_message_create(manager->mctx, DNS_MESSAGE_INTENTPARSE,
* Set a timeout to limit the amount of time we will wait
* for a request on this TCP connection.
*/
- set_timeout(client, 30);
+ ns_client_settimeout(client, 30);
client->state = client->newstate = NS_CLIENTSTATE_READING;
INSIST(client->nreads == 0);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.h,v 1.50 2001/01/27 02:08:03 bwelling Exp $ */
+/* $Id: client.h,v 1.51 2001/01/29 19:49:51 bwelling Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
dns_tcpmsg_t tcpmsg;
isc_boolean_t tcpmsg_valid;
isc_timer_t * timer;
+ isc_boolean_t timerset;
dns_message_t * message;
unsigned char * sendbuf;
unsigned char * recvbuf;
* leaving the dispatch/socket without service.
*/
+void
+ns_client_settimeout(ns_client_t *client, unsigned int seconds);
+/*
+ * Set a timer in the client to go off in the specified amount of time.
+ */
+
isc_result_t
ns_clientmgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
isc_timermgr_t *timermgr, ns_clientmgr_t **managerp);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: query.c,v 1.177 2001/01/26 23:40:44 gson Exp $ */
+/* $Id: query.c,v 1.178 2001/01/29 19:49:50 bwelling Exp $ */
#include <config.h>
client->query.attributes = (NS_QUERYATTR_RECURSIONOK |
NS_QUERYATTR_CACHEOK);
client->query.restarts = 0;
+ client->query.timerset = ISC_FALSE;
client->query.origqname = NULL;
client->query.qname = NULL;
client->query.dboptions = 0;
ISC_LIST_INIT(client->query.activeversions);
ISC_LIST_INIT(client->query.freeversions);
client->query.restarts = 0;
+ client->query.timerset = ISC_FALSE;
client->query.qname = NULL;
client->query.fetch = NULL;
client->query.authdb = NULL;
} else
sigrdataset = NULL;
+ if (client->query.timerset == ISC_FALSE)
+ ns_client_settimeout(client, 60);
result = dns_resolver_createfetch(client->view->resolver,
client->query.qname,
qtype, qdomain, nameservers,