* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.136.2.5 2001/04/19 18:54:51 gson Exp $ */
+/* $Id: client.c,v 1.136.2.6 2001/05/15 05:15:20 bwelling Exp $ */
#include <config.h>
client->dispevent = devent;
buffer = &devent->buffer;
result = devent->result;
- client->peeraddr = devent->addr;
- client->peeraddr_valid = ISC_TRUE;
+ if (result == ISC_R_SUCCESS) {
+ client->peeraddr = devent->addr;
+ client->peeraddr_valid = ISC_TRUE;
+ }
if ((devent->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0) {
client->attributes |= NS_CLIENTATTR_PKTINFO;
client->pktinfo = devent->pktinfo;
client->nreads--;
}
- ns_client_log(client, NS_LOGCATEGORY_CLIENT,
- NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(3),
- "%s request",
- TCP_CLIENT(client) ? "TCP" : "UDP");
-
if (exit_check(client))
goto cleanup_serverlock;
client->state = client->newstate = NS_CLIENTSTATE_WORKING;
set_timeout(client, 60);
if (result != ISC_R_SUCCESS) {
- if (TCP_CLIENT(client))
+ if (TCP_CLIENT(client)) {
ns_client_next(client, result);
- else
+ } else {
+ if (result != ISC_R_CANCELED)
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_CLIENT,
+ NS_LOGMODULE_CLIENT,
+ ISC_LOG_ERROR,
+ "UDP client handler shutting "
+ "down due to fatal receive "
+ "error: %s",
+ isc_result_totext(result));
isc_task_shutdown(client->task);
+ }
goto cleanup_serverlock;
}
#endif
}
+ ns_client_log(client, NS_LOGCATEGORY_CLIENT,
+ NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(3),
+ "%s request",
+ TCP_CLIENT(client) ? "TCP" : "UDP");
+
result = dns_message_parse(client->message, buffer, 0);
if (result != ISC_R_SUCCESS) {
ns_client_error(client, result);