Don't do a DNS lookup on every connection attempt, fix TCP disconnect detection

This commit is contained in:
Kouya Heika
2026-04-20 19:21:03 -05:00
parent 3d13336d22
commit 091d91d2c4
2 changed files with 83 additions and 72 deletions

View File

@@ -16,7 +16,7 @@
#include "../deps/vector/vector.h"
#include "util.h"
enum State { DOWN, PARTIAL, UP };
enum State { NONE, DOWN, PARTIAL, UP };
struct StatusPeroid;
struct ServerStatus;
struct EndpointStatus;
@@ -63,6 +63,7 @@ struct Endpoint {
double last_ping;
Vector status_history;
pthread_t thread;
struct addrinfo* addr;
int sockfd;
int last_errno;
};