Another revision of http.prs

This commit is contained in:
Tony Garnock-Jones 2024-04-10 14:31:27 +02:00
parent ef1ebe6412
commit 70f42dd931
2 changed files with 19 additions and 7 deletions

View File

@ -6,7 +6,7 @@ ByteString
QueryValue„„„„´³named³body´³refµ„³ RequestBody„„„„„³ HttpService´³rec´³lit³ http-service„´³tupleµ´³named³host´³refµ„³ HostPattern„„´³named³port´³atom³ SignedInteger„„´³named³method´³refµ„³ MethodPattern„„´³named³path´³refµ„³ PathPattern„„„„„³ PathPattern´³seqof´³refµ„³PathPatternElement„„³ RequestBody´³orµµ±present´³atom³
ByteString„„µ±absent´³lit€„„„„³ HttpListener´³rec´³lit³ http-listener„´³tupleµ´³named³port´³atom³ SignedInteger„„„„„³ HttpResponse´³orµµ±
processing´³rec´³lit³
processing„´³tupleµ„„„„µ±status´³rec´³lit³status„´³tupleµ´³named³code´³atom³ SignedInteger„„´³named³message´³atom³String„„„„„„µ±header´³rec´³lit³header„´³tupleµ´³named³name´³atom³Symbol„„´³named³value´³atom³String„„„„„„µ±body´³rec´³lit³body„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„µ±done´³rec´³lit³done„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„„„³ MethodPattern´³orµµ±any´³lit€„„µ±specific´³atom³Symbol„„„„³PathPatternElement´³orµµ±label´³atom³String„„µ±wildcard´³lit³_„„µ±rest´³lit³...„„„„„³ embeddedType€„„µ³noise„´³schema·³version°³ definitions·³Packet´³orµµ±complete´³atom³
processing„´³tupleµ„„„„µ±status´³rec´³lit³status„´³tupleµ´³named³code´³atom³ SignedInteger„„´³named³message´³atom³String„„„„„„µ±header´³rec´³lit³header„´³tupleµ´³named³name´³atom³Symbol„„´³named³value´³atom³String„„„„„„µ±chunk´³rec´³lit³chunk„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„µ±done´³rec´³lit³done„´³tupleµ´³named³chunk´³refµ„³Chunk„„„„„„„„³ MethodPattern´³orµµ±any´³lit€„„µ±specific´³atom³Symbol„„„„³PathPatternElement´³orµµ±label´³atom³String„„µ±wildcard´³lit³_„„µ±rest´³lit³...„„„„„³ embeddedType€„„µ³noise„´³schema·³version°³ definitions·³Packet´³orµµ±complete´³atom³
ByteString„„µ±
fragmented´³seqof´³atom³
ByteString„„„„„³ Initiator´³rec´³lit³ initiator„´³tupleµ´³named³initiatorSession´³embedded´³refµ„³Packet„„„„„„³ NoiseSpec´³andµ´³dict·³key´³named³key´³atom³

View File

@ -36,17 +36,29 @@ RequestBody = @present bytes / @absent #f .
# Assertion to handler entity
HttpContext = <request @req HttpRequest @res #:HttpResponse> .
# HttpResponse protocol. Delivered to the `res` ref in `HttpContext`.
#
# Use of `processing` is optional, so the flow is either:
#
# +processing . (status | header)* . chunk* . done? . -processing
#
# or
#
# (status | header)* . chunk* . done
#
# Done triggers completion of the response and retraction of the frame by the peer, whether
# `processing` is used or not. In addition, if `processing` is used, its retraction triggers
# completion and termination. If `processing` is retracted before `status` is delivered, the
# response is considered a 500.
#
@<TODO "trailers?">
# Messages
HttpResponse =
# Assertion - frames the response. When retracted, response is considered complete.
# If retracted before `status` is delivered, response is considered a 500.
# Assertion - frames the response.
/ <processing>
# Remainder are messages: +processing . (status | header)* . body* . done? . -processing
# Done triggers completion of the response and retraction of the frame by the peer.
# Remainder are messages.
/ <status @code int @message string>
/ <header @name symbol @value string>
/ <body @chunk Chunk>
/ <chunk @chunk Chunk>
/ <done @chunk Chunk>
.