rad_assert(request->magic == REQUEST_MAGIC);
+ /*
+ * The socket was closed. Tell the request that
+ * there is no point in continuing.
+ */
+ if (request->listener->status != RAD_LISTEN_STATUS_KNOWN) {
+ goto stop_processing;
+ }
+
#ifdef WITH_COA
/*
* The CoA request is a new (internally generated)
request->component ? request->component : "<server core>");
}
+ stop_processing:
request->master_state = REQUEST_STOP_PROCESSING;
request->delay = USEC / 4;
callback = wait_for_child_to_die;
break;
}
+#else /* no child threads */
+ stop_processing:
#endif
/*
check_for_zombie_home_server(request);
/*
- * If we've just discovered that the home server is
- * dead, send the packet to another one.
+ * If we've just discovered that the home server
+ * is dead, OR the socket has been closed, look for
+ * another connection to a home server.
*/
- if ((request->packet->dst_port != 0) &&
- (request->home_server->state == HOME_STATE_IS_DEAD)) {
+ if (((request->packet->dst_port != 0) &&
+ (request->home_server->state == HOME_STATE_IS_DEAD)) ||
+ (request->proxy_listener->status != RAD_LISTEN_STATUS_KNOWN)) {
home_server *home;
remove_from_proxy_hash(request);
}
event_new_fd(this);
+
+ this->status = RAD_LISTEN_STATUS_KNOWN;
}
mainconfig.listen = head;