Crafter.Network/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
catbot b758419007 fix(tcp): resolve, connect, bind and send failures were silent or wrong
The HTTP/1.1 stack sits directly on these two classes and each of these
bit it:

- gethostbyname() returning null on an unresolvable host was dereferenced
  straight into a crash, and it is not thread safe; use getaddrinfo.
- A failed socket()/connect() only printed to stderr and handed back an
  unusable ClientTCP, so the real error surfaced much later as an
  unrelated errno from send().
- send() was assumed to accept everything it was offered. It does not
  once a buffer outgrows the socket's send buffer, which silently
  truncated multi-megabyte bodies. Loop, and pass MSG_NOSIGNAL so a
  vanished peer raises EPIPE instead of killing the process.
- ClientTCP's move constructor closed the socket it had just taken
  ownership of, and both it and the destructor tested `socketid != 1`
  where they meant `!= -1`.
- ListenerTCP ignored bind()'s result, leaving a listener that accepted
  nothing with no explanation, and did not set SO_REUSEADDR, so a
  restart hit EADDRINUSE for the length of TIME_WAIT.

accept() failing during Stop() is expected and no longer logged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 00:44:56 +00:00
..
Crafter.Network-ClientHTTP-Browser.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientHTTP.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientQUIC-Browser.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientQUIC.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientTCP.cpp fix(tcp): resolve, connect, bind and send failures were silent or wrong 2026-07-27 00:44:56 +00:00
Crafter.Network-ListenerHTTP.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ListenerQUIC.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ListenerTCP.cpp fix(tcp): resolve, connect, bind and send failures were silent or wrong 2026-07-27 00:44:56 +00:00
Crafter.Network-WebTransport.cpp SPDX license 2026-07-22 17:55:45 +02:00