-1

I have an HTTP server listening on a specific TCP port written in Golang. I have a logic that the server will reject the client request if the client payload is larger than a certain size. Now I'm wondering if the total size of the user data is also negotiated in the TCP handshake or not?

hani
  • 45
  • 5
  • 1
    TCP is only concerned with individual, ordered, packets, not application-layer operations. – Dai May 04 '23 at 11:25
  • Also, your question assumes HTTP uses TCP - [when in fact HTTP supports UDP just fine](https://stackoverflow.com/questions/323351/does-http-use-udp). – Dai May 04 '23 at 11:26

1 Answers1

0

I have a logic that the server will reject the client request if the client payload is larger than a certain size

I assume you're doing this by verifying the Request's Content-Length header against the actual aggregate data received.

Now I'm wondering if the total size of the user data is also negotiated in the TCP handshake or not?

No, it isn't.

Dai
  • 141,631
  • 28
  • 261
  • 374