From e2c043aaf37c1cf92d6a71c9edf6f9dc0687820a Mon Sep 17 00:00:00 2001 From: Tam Nguyen Duc <1218621+tamnd@users.noreply.github.com> Date: Tue, 27 Oct 2026 21:14:56 +0700 Subject: [PATCH] net/http: skip the CrossOriginProtection server test without TCP Windows has no TCP yet, so httptest panics on listen there. --- tests/http_csrf_test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/http_csrf_test.c b/tests/http_csrf_test.c index d91d1ef2..7ad28316 100644 --- a/tests/http_csrf_test.c +++ b/tests/http_csrf_test.c @@ -18,6 +18,7 @@ #include "burrow/net/http.h" #include "burrow/net/http/httptest.h" #include "burrow/net/url.h" +#include "burrow/netpoll.h" #include "burrow/proc.h" #include "burrow/slice.h" #include "burrow/strings.h" @@ -28,6 +29,18 @@ #define S BURROW_S +#if defined(BURROW_NETPOLL_READINESS) && !defined(BURROW_OS_WASI) +#define HAVE_TCP 1 +#endif + +static void need_tcp(TestingT *t) { +#if !defined(HAVE_TCP) + testing_t_skip_v(t, "TCP here needs the readiness poll FD"); +#else + (void)t; +#endif +} + static Str cs(const char *s) { return s == NULL ? BURROW_STR_EMPTY : str_from_cstr(s); } @@ -544,6 +557,7 @@ static void server_case(void *env, TestingT *t) { } static void TestCrossOriginProtectionServer(TestingT *t) { + need_tcp(t); HttpCrossOriginProtection *protection = http_new_cross_origin_protection(heap_allocator()); (void)http_cross_origin_protection_add_trusted_origin(protection,