Skip to content

Instantly share code, notes, and snippets.

@harrishancock
Created January 10, 2017 21:43
Show Gist options
  • Save harrishancock/f5ff6bc92ea149071f20893830d9c06d to your computer and use it in GitHub Desktop.
Save harrishancock/f5ff6bc92ea149071f20893830d9c06d to your computer and use it in GitHub Desktop.
Test output from read-until-delim
# Test client command line:
# curl -X PUT -d "Hello, world! 01234567890123456789overread" localhost:3337
harris@harris-VirtualBox:~/git/beast/build/examples$ ./read-until-delim 3337 170 30
Listening on port 3337 with header buffer size 170, body buffer size 30
Accepted connection from 127.0.0.1:51066
Read 170 bytes
HEADER IS 147 BYTES:
--------------------
PUT / HTTP/1.1
Host: localhost:3337
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 42
Content-Type: application/x-www-form-urlencoded
--------------------
BODY PREFIX IS 23 BYTES:
--------------------
Hello, world! 012345678
--------------------
Read 19 bytes
FULL BODY IS 34 BYTES:
--------------------
Hello, world! 01234567890123456789
--------------------
OVERREAD IS 8 BYTES:
--------------------
overread
--------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment