pallas icon indicating copy to clipboard operation
pallas copied to clipboard

Change HTTP chunk processing to do stream-parsing.

Open vcavallo opened this issue 1 year ago • 1 comments

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

vcavallo avatar Oct 09 '24 14:10 vcavallo

related: #20

vcavallo avatar Oct 09 '24 14:10 vcavallo