Currently SCGI::Request reads the socket data as a string, and tries to capture the whole request at once. In order to support binary data, this should be changed.
1.) Read 1 byte at a time, appending the results together, until we find a byte of 0x3C (the ":" character).
2.) Decode the appended results, and use it as the length of the netstring, containing the SCGI headers.
3.) Read that many bytes, and parse the headers.
4.) Read one byte, and confirm it is a "," character.
5.) Using the CONTENT_LENGTH header, read the rest of the request data as a Buf.
I am writing a Netstring library to assist in the encoding and decoding of netstrings, use of it will help in this issue.
Currently SCGI::Request reads the socket data as a string, and tries to capture the whole request at once. In order to support binary data, this should be changed.
1.) Read 1 byte at a time, appending the results together, until we find a byte of 0x3C (the ":" character).
2.) Decode the appended results, and use it as the length of the netstring, containing the SCGI headers.
3.) Read that many bytes, and parse the headers.
4.) Read one byte, and confirm it is a "," character.
5.) Using the CONTENT_LENGTH header, read the rest of the request data as a Buf.
I am writing a Netstring library to assist in the encoding and decoding of netstrings, use of it will help in this issue.