2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

A socket result of ISC_R_SUCCESS can still possibly be posted even after

isc_socket_cancel() has been called.  resquery_senddone() has been fixed
to account for this (there was a race condition because of the faulty
assumption that only ISC_R_CANCELED would be returned after
isc_socket_cancel()).

The interaction of resquery_response() with the dispatcher now has to be
closely reviewed to make sure it does not have a similar problem with
a canceled query.  If the faulty assumption hadn't been faulty, it was
fine, but now I'm not so sure.
This commit is contained in:
David Lawrence
2000-07-07 19:43:14 +00:00
parent 0308460880
commit d20d22616b

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: resolver.c,v 1.143 2000/07/06 02:33:42 bwelling Exp $ */
/* $Id: resolver.c,v 1.144 2000/07/07 19:43:14 tale Exp $ */
#include <config.h>
@@ -555,20 +555,18 @@ resquery_senddone(isc_task_t *task, isc_event_t *event) {
query->sends--;
if (sevent->result != ISC_R_SUCCESS) {
if (RESQUERY_CANCELED(query)) {
if (query->sends == 0) {
/*
* This query was canceled while the
* isc_socket_sendto() was in progress.
*/
if (query->tcpsocket != NULL)
isc_socket_detach(&query->tcpsocket);
resquery_destroy(&query);
}
} else
fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
}
if (RESQUERY_CANCELED(query)) {
if (query->sends == 0) {
/*
* This query was canceled while the
* isc_socket_sendto() was in progress.
*/
if (query->tcpsocket != NULL)
isc_socket_detach(&query->tcpsocket);
resquery_destroy(&query);
}
} else if (sevent->result != ISC_R_SUCCESS)
fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
isc_event_free(&event);
}