ephemeral stuff

This commit is contained in:
Sergio R. Caprile 2026-07-30 18:36:29 -03:00
parent 501c5a4bcd
commit 309cb1006f

View file

@ -3213,7 +3213,7 @@ static void test_http_chunked_case(mg_event_handler_t s, mg_event_handler_t c,
struct mg_mgr mgr;
uint32_t i, crc = 0, expected_crc = mg_crc32(0, expected, strlen(expected));
struct mg_connection *conn;
static uint16_t port = 32344; // To prevent bind errors on Windows
static uint16_t port = 32344; // To prevent bind errors on Windows
mg_snprintf(url, sizeof(url), "http://127.0.0.1:%d", port++);
mg_mgr_init(&mgr);
mg_http_listen(&mgr, url, s, NULL);
@ -3992,8 +3992,8 @@ static void ph(struct mg_connection *c, int ev, void *ev_data) {
static void test_poll(void) {
int count = 0, i;
struct mg_mgr mgr;
mg_mgr_init(&mgr); // To prevent bind errors on Windows
mg_http_listen(&mgr, "http://127.0.0.1:32345", ph, &count);
mg_mgr_init(&mgr);
mg_http_listen(&mgr, "http://127.0.0.1:12340", ph, &count);
for (i = 0; i < 10; i++) mg_mgr_poll(&mgr, 0);
ASSERT(count == 10);
mg_mgr_free(&mgr);
@ -5478,8 +5478,8 @@ static void test_wakeup(void) {
struct wudata *data;
int i;
mg_mgr_init(&mgr); // Initialise event manager
mg_log_set(MG_LL_DEBUG); // To prevent bind errors on Windows
c = mg_http_listen(&mgr, "http://127.0.0.1:32346", hwu, NULL);
mg_log_set(MG_LL_DEBUG);
c = mg_http_listen(&mgr, "http://127.0.0.1:12341", hwu, NULL);
mg_wakeup_init(&mgr); // Initialise wakeup socket pair
data = (struct wudata *) calloc(1, sizeof(*data)); // wuthread owns it
data->conn_id = c->id;