Skip to content
Permalink
Browse files

samples: net: dumb_http_server: Check EOF while skipping headers

If recv() returns 0 bytes, then terminate the connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Mar 30, 2019
1 parent 3d6ce30 commit a9395157a368b074aa9897f71449570076543d43
Showing with 4 additions and 0 deletions.
  1. +4 −0 samples/net/sockets/dumb_http_server/src/socket_dumb_http.c
@@ -86,6 +86,10 @@ int main(void)
char c;

r = recv(client, &c, 1, 0);
if (r == 0) {
goto close_client;
}

if (r < 0) {
if (errno == EAGAIN || errno == EINTR) {
continue;

0 comments on commit a939515

Please sign in to comment.
You can’t perform that action at this time.