pallas
pallas copied to clipboard
Change HTTP chunk processing to do stream-parsing.
The (or one of the) functions to be replaced:
; Take an HTTP chunk of any size and help build a buffer.
; - append into the assembledData
; - if we have the Request Line completed yet, set it in the buffer
; - if we have all the headers completed yet, set them in the buffer
; - if we have a body, set it in the buffer
> HTTPBuffer > Bar > HTTPBuffer
= (processHttpChunk buffer chunk)
@ newAssembledData | (barWeld (getAssembledData buffer) chunk)
@ buffer | setAssembledData newAssembledData buffer
@ buffer | parseAndSetReqline newAssembledData buffer
@ buffer | parseAndSetHeaders newAssembledData buffer
| if (haveBodyContent (getHeaders buffer))
@ buffer | parseAndSetBody newAssembledData buffer
buffer
buffer
related: #20