From 8b86f150b93feb9987011c68a3faf236efd6ec53 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 10 Sep 2016 04:00:09 +0200 Subject: [PATCH] respondd: do not drop any request (if the schedule is full) --- net/respondd/src/respondd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/respondd/src/respondd.c b/net/respondd/src/respondd.c index e229583..66c8e81 100644 --- a/net/respondd/src/respondd.c +++ b/net/respondd/src/respondd.c @@ -391,6 +391,7 @@ static struct json_object * handle_request(char *request, bool *compress) { // until we reach the scheduling deadline. // 2a. If the incomming request was sent to a multicast destination IPv6, // choose a random delay between 0 and max_multicast_delay milliseconds. +// 2b. If the schedule is full, send the reply immediately. // 2c. If the incomming request was sent to a unicast destination, the response // will be also sent immediately. static void accept_request(struct request_schedule *schedule, int sock, @@ -468,6 +469,8 @@ static void accept_request(struct request_schedule *schedule, int sock, } if (!schedule_push_request(schedule, new_task)) { + // we can't schedule, so send the response immediately + serve_request(new_task, sock); free(new_task); } }