Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2024 |
3 |
|
|
** zappy |
4 |
|
|
** File description: |
5 |
|
|
** client.c |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#include "client.h" |
9 |
|
|
#include "server.h" |
10 |
|
|
|
11 |
|
29 |
void client_time_handler(client_t *client, int command) |
12 |
|
|
{ |
13 |
|
|
signed char index = -1; |
14 |
|
29 |
char *tmp = NULL; |
15 |
|
|
|
16 |
1/2
✓ Branch 0 taken 29 times.
✗ Branch 1 not taken.
|
29 |
for (unsigned char i = 0; i < NB_REQUESTS_HANDLEABLE; i++) { |
17 |
1/2
✓ Branch 0 taken 29 times.
✗ Branch 1 not taken.
|
29 |
if (client->tclient[i].available_request == false) { |
18 |
|
29 |
index = i; |
19 |
|
29 |
client->tclient[i].available_request = true; |
20 |
|
29 |
client->tclient[i].command = command; |
21 |
|
29 |
handle_response(&tmp, "%s", client->payload); |
22 |
|
29 |
client->tclient[i].payload = tmp; |
23 |
|
29 |
break; |
24 |
|
|
} |
25 |
|
|
} |
26 |
1/2
✓ Branch 0 taken 29 times.
✗ Branch 1 not taken.
|
29 |
if (index >= 0) |
27 |
|
29 |
clock_gettime(CLOCK_REALTIME, &client->tclient[index].future_time); |
28 |
|
29 |
} |
29 |
|
|
|