From 56a3ab4f7a60d4bb90e8a8ed2d60142e82b40b20 Mon Sep 17 00:00:00 2001 From: Bergur Snorrason Date: Tue, 21 Apr 2026 14:53:24 +0000 Subject: [PATCH 1/4] Update README.md Fix line endings in .md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e08a45..1654a5e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ int main(int argc, const char* argv[]) tcs_socket(&client_socket, TCS_AF_IP4, TCS_SOCK_STREAM, TCS_PROTOCOL_IP_TCP); tcs_connect_str(client_socket, "example.com", 80); - uint8_t send_buffer[] = "GET / HTTP/1.1\nHost: example.com\n\n"; + uint8_t send_buffer[] = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"; tcs_send(client_socket, send_buffer, sizeof(send_buffer), TCS_MSG_SENDALL, NULL); uint8_t recv_buffer[8192] = {0}; From 1d9dbd284ea69a2f5c9535d2de16ca2beb2d746c Mon Sep 17 00:00:00 2001 From: Bergur Snorrason Date: Tue, 21 Apr 2026 14:54:51 +0000 Subject: [PATCH 2/4] Update tests.cpp Oh, it's also here. --- tests/tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.cpp b/tests/tests.cpp index 34c7276..b64cb1a 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -103,7 +103,7 @@ TEST_CASE("Example from README") REQUIRE(tcs_socket(&client_socket, TCS_AF_IP4, TCS_SOCK_STREAM, TCS_PROTOCOL_IP_TCP) == TCS_SUCCESS); REQUIRE(tcs_connect_str(client_socket, "example.com", 80) == TCS_SUCCESS); - uint8_t send_buffer[] = "GET / HTTP/1.1\nHost: example.com\n\n"; + uint8_t send_buffer[] = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"; CHECK(tcs_send(client_socket, send_buffer, sizeof(send_buffer), TCS_MSG_SENDALL, NULL) == TCS_SUCCESS); static uint8_t recv_buffer[8192] = {0}; From da4623f27888f4a37d1a1e02072d368064bf82ee Mon Sep 17 00:00:00 2001 From: Bergur Snorrason Date: Tue, 21 Apr 2026 14:55:24 +0000 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1654a5e..a698d81 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ int main(int argc, const char* argv[]) tcs_connect_str(client_socket, "example.com", 80); uint8_t send_buffer[] = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"; - tcs_send(client_socket, send_buffer, sizeof(send_buffer), TCS_MSG_SENDALL, NULL); + tcs_send(client_socket, send_buffer, sizeof(send_buffer) - 1, TCS_MSG_SENDALL, NULL); uint8_t recv_buffer[8192] = {0}; size_t bytes_received = 0; From e936a0914df0a7fe0f0053efc06ca245873cba42 Mon Sep 17 00:00:00 2001 From: Bergur Snorrason Date: Tue, 21 Apr 2026 14:56:13 +0000 Subject: [PATCH 4/4] Update tests.cpp This was giving me errors. --- tests/tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.cpp b/tests/tests.cpp index b64cb1a..eec06f3 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -104,7 +104,7 @@ TEST_CASE("Example from README") REQUIRE(tcs_connect_str(client_socket, "example.com", 80) == TCS_SUCCESS); uint8_t send_buffer[] = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"; - CHECK(tcs_send(client_socket, send_buffer, sizeof(send_buffer), TCS_MSG_SENDALL, NULL) == TCS_SUCCESS); + CHECK(tcs_send(client_socket, send_buffer, sizeof(send_buffer) - 1, TCS_MSG_SENDALL, NULL) == TCS_SUCCESS); static uint8_t recv_buffer[8192] = {0}; size_t bytes_received = 0;