Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change HTTP chunk processing to do stream-parsing. #22

Open
vcavallo opened this issue Oct 9, 2024 · 1 comment
Open

Change HTTP chunk processing to do stream-parsing. #22

vcavallo opened this issue Oct 9, 2024 · 1 comment
Assignees

Comments

@vcavallo
Copy link
Contributor

vcavallo commented Oct 9, 2024

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
Copy link
Contributor Author

vcavallo commented Oct 9, 2024

related: #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants