From 70f42dd9316e4df773c13036a6dc4591f453179c Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 10 Apr 2024 14:31:27 +0200 Subject: [PATCH] Another revision of http.prs --- schema-bundle.bin | 2 +- schemas/http.prs | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/schema-bundle.bin b/schema-bundle.bin index 0e046c7..43d3c49 100644 --- a/schema-bundle.bin +++ b/schema-bundle.bin @@ -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³ diff --git a/schemas/http.prs b/schemas/http.prs index 524a83f..75871d1 100644 --- a/schemas/http.prs +++ b/schemas/http.prs @@ -36,17 +36,29 @@ RequestBody = @present bytes / @absent #f . # Assertion to handler entity HttpContext = . +# 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. +# @ -# 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. / -# 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. / /
-/ +/ / .