#ifdef DEBUG_STATE_MACHINE
if (debug_flag) printf("(%u) ********\tSTATE %s C%u -> C%u\t********\n", request->number, __FUNCTION__, request->child_state, REQUEST_DONE);
#endif
+#ifdef HAVE_PTHREAD_H
+ rad_assert(request->child_pid == NO_SUCH_CHILD_PID);
+#endif
request->child_state = REQUEST_DONE;
break;
RADIUS_PACKET **packet_p;
REQUEST *request = NULL;
struct timeval now;
+ listen_socket_t *sock = listener->data;
/*
* Set the last packet received.
*/
gettimeofday(&now, NULL);
-#ifdef WITH_DETAIL
- if (listener->type != RAD_LISTEN_DETAIL)
-#endif
- {
- listen_socket_t *sock = listener->data;
-
- sock->last_packet = now.tv_sec;
- }
+ sock->last_packet = now.tv_sec;
packet_p = fr_packet_list_find(pl, packet);
if (packet_p) {
/*
* Quench maximum number of outstanding requests.
- *
- * But we can always read from the detail file.
*/
if (mainconfig.max_requests &&
-#ifdef WITH_DETAIL
- (listener->type != RAD_LISTEN_DETAIL) &&
-#endif
((count = fr_packet_list_num_elements(pl)) > mainconfig.max_requests)) {
static time_t last_complained = 0;
return 0;
}
+ return request_insert(listener, packet, client, fun);
+}
+
+int request_insert(rad_listen_t *listener, RADIUS_PACKET *packet,
+ RADCLIENT *client, RAD_REQUEST_FUNP fun,
+ struct timeval *pnow)
+{
+ REQUEST *request;
+
/*
* Create and initialize the new request.
*/
request->listener = listener;
request->client = client;
request->packet = packet;
- request->packet->timestamp = now;
+ request->packet->timestamp = *pnow;
request->number = request_num_counter++;
request->priority = listener->type;
request->master_state = REQUEST_ACTIVE;
if (debug_flag) printf("(%u) ********\tSTATE %s C%u -> C%u\t********\n", request->number, __FUNCTION__, request->child_state, REQUEST_DONE);
if (debug_flag) printf("(%u) ********\tNEXT-STATE %s -> %s\n", request->number, __FUNCTION__, "request_ping");
#endif
+#ifdef HAVE_PTHREAD_H
+ rad_assert(request->child_pid == NO_SUCH_CHILD_PID);
+#endif
request->child_state = REQUEST_DONE;
request->process = request_ping;
#ifdef DEBUG_STATE_MACHINE
if (debug_flag) printf("(%u) ********\tSTATE %s C%u -> C%u\t********\n", request->number, __FUNCTION__, request->child_state, REQUEST_DONE);
#endif
+#ifdef HAVE_PTHREAD_H
+ rad_assert(request->child_pid == NO_SUCH_CHILD_PID);
+#endif
request->child_state = REQUEST_DONE;
request_process_timer(request);
return;
RDEBUG3("%s: Ignoring action %s", __FUNCTION__, action_codes[action]);
break;
}
-
}
#endif /* WITH_COA */