diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index d45e587b6f..674e592171 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -656,7 +656,8 @@ =/ connection=outstanding-connection [action [authenticated secure address request] ~ 0] =. connections.state - :: XX pretty sure this is superfluous - done in +handle-response + :: NB: required by +handle-response. XX optimize + :: (~(put by connections.state) duct connection) :: redirect to https if insecure, redirects enabled :: and secure port live @@ -1986,7 +1987,10 @@ |= =tang ^- [(list move) server-state] :: - =+ connection=(~(got by connections.state) duct) + ?~ connection-state=(~(get by connections.state) duct) + %. `state + (trace 0 |.("{} error on invalid outstanding connection")) + =* connection u.connection-state =/ moves-1=(list move) ?. ?=(%app -.action.connection) ~ @@ -2055,8 +2059,8 @@ (session-cookie-string u.session-id &) headers.response-header.http-event :: - =/ connection=outstanding-connection - (~(got by connections.state) duct) + =* connection u.connection-state + :: :: if the request was a simple cors request from an approved origin :: append the necessary cors headers to the response :: @@ -2073,16 +2077,18 @@ :: =. response-header.http-event response-header =. connections.state + ?: complete.http-event + :: XX optimize by not requiring +put:by in +request + :: + (~(del by connections.state) duct) + :: %- (trace 2 |.("{} start")) %+ ~(put by connections.state) duct - %_ connection + %= connection response-header `response-header bytes-sent ?~(data.http-event 0 p.u.data.http-event) == :: - =? state complete.http-event - log-complete-request - :: pass-response :: %continue @@ -2091,14 +2097,18 @@ (trace 0 |.("{} error continue without start")) :: =. connections.state - %- (trace 2 |.("{} continuing ")) - %+ ~(jab by connections.state) duct - |= connection=outstanding-connection - =+ size=?~(data.http-event 0 p.u.data.http-event) - connection(bytes-sent (add bytes-sent.connection size)) - :: - =? state complete.http-event - log-complete-request + ?: complete.http-event + %- (trace 2 |.("{} completed")) + (~(del by connections.state) duct) + :: + %- (trace 2 |.("{} continuing")) + ?~ data.http-event + connections.state + :: + %+ ~(put by connections.state) duct + =* size p.u.data.http-event + =* conn u.connection-state + conn(bytes-sent (add size bytes-sent.conn)) :: pass-response :: @@ -2112,16 +2122,6 @@ ^- [(list move) server-state] [[duct %give %response http-event]~ state] :: - ++ log-complete-request - :: todo: log the complete request - :: - :: remove all outstanding state for this connection - :: - =. connections.state - %. (~(del by connections.state) duct) - (trace 2 |.("{} completed")) - state - :: ++ error-connection :: todo: log application error ::