remove forbidden function fcntl, add early stop for errors during parsing, remove debug print
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/24 22:49:22 by tomoron #+# #+# */
|
||||
/* Updated: 2025/06/03 00:40:54 by tomoron ### ########.fr */
|
||||
/* Updated: 2025/08/08 22:19:52 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "includes/ft_ping.h"
|
||||
@ -72,7 +72,7 @@ t_waitlist *send_icmp(t_settings *set, struct addrinfo *host, uint16_t *seq, str
|
||||
if(timediff(last) < set->interval)
|
||||
return (0);
|
||||
packet = prepare_icmp_echo(*seq, set->id);
|
||||
len = sendto(set->socket, &packet, sizeof(t_icmp_echo), 0, host->ai_addr, host->ai_addrlen);
|
||||
len = sendto(set->socket, &packet, sizeof(t_icmp_echo), MSG_DONTWAIT, host->ai_addr, host->ai_addrlen);
|
||||
if(len == (size_t)-1)
|
||||
{
|
||||
perror(set->name);
|
||||
@ -137,7 +137,7 @@ void receive_icmp(t_settings *set, t_waitlist **wl, t_stats *stats)
|
||||
uint16_t checksum;
|
||||
t_waitlist *elem;
|
||||
|
||||
len = recvfrom(set->socket, &buffer, 1024, 0, 0, 0);
|
||||
len = recv(set->socket, &buffer, 1024, MSG_DONTWAIT);
|
||||
|
||||
res = (void *)buffer;
|
||||
if(len == (size_t)-1 )
|
||||
|
Reference in New Issue
Block a user