c-cube / tiny_httpd

Minimal HTTP server using good old threads + blocking IO, with a small request router.
https://c-cube.github.io/tiny_httpd
75 stars 11 forks source link

Preserve client address down to Request.t #71

Closed vphantom closed 1 year ago

vphantom commented 1 year ago

It was as difficult as predicted, and I'm pretty sure you won't like it as-is, but this does preserve the client address, when available, down to Request.t.

c-cube commented 1 year ago

Ok so, why is the address optional in Request.t ? :)

vphantom commented 1 year ago

Ok so, why is the address optional in Request.t ? :)

Because Internal_ does not use an address.

c-cube commented 1 year ago

But internal is just for testing purpose, it could take a dummy address (e.g. loopback)

vphantom commented 1 year ago

I haven't found anyone actually using it so I didn't dare touch it. Is it related to that (*$R comment? Is that comment actually test code?

If so, then do I hard-code localhost in that comment or in Internal_ itself? Author's choice. 😉

vphantom commented 1 year ago

Option gone, localhost hard-coded in the test case. How's it look now?

c-cube commented 1 year ago

merged manually.