simonwittber / uniwebserver

An embedded HTTP server for Unity3D.
MIT License
76 stars 30 forks source link

Requests don't complete? #3

Open peterept opened 6 years ago

peterept commented 6 years ago

Hi,

Thank you for your great web server.

I'm running UniWeb and have a handler at path /status.

When I call:

$ curl http://localhost:<port>/status

It doesn't complete and just blocks. According to Unity logs I see it has handled the request.

Any ideas?

peterept commented 6 years ago

Ahh the reason is the request network stream isn't being closed, so it never completes. It appears to complete in a browser because a browser is more forgiving then curl and will output data it receives streaming it into the browser. Eventually the browser (or curl) decide to close the connection themselves to avoid having stuck open connections.

I'll create a PR.

peterept commented 6 years ago

Added PR with the fix:

https://github.com/simonwittber/uniwebserver/pull/4