Skip to content

Commit

Permalink
FEAT: tiny code optimization in the HTTP scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed May 12, 2022
1 parent e89f4b7 commit 5ae9b0f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mezz/prot-http.reb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ sync-op: func [port body /local header state][
reduce [header body]
]

read-sync-awake: func [event [event!] /local error][
read-sync-awake: func [event [event!] /local error state][
sys/log/debug 'HTTP ["Read-sync-awake:" event/type]
state: event/port/state
switch/default event/type [
connect ready [
do-request event/port
Expand All @@ -119,15 +120,15 @@ read-sync-awake: func [event [event!] /local error][
]
custom [
if event/code = 300 [
event/port/state/state: 'redirect
state/state: 'redirect
return true
]
false
]
error [
if all [
event/port/state
event/port/state/state <> 'closing
state
state/state <> 'closing
][
sys/log/debug 'HTTP ["Closing (sync-awake):^[[1m" event/port/spec/ref]
close event/port
Expand Down

0 comments on commit 5ae9b0f

Please sign in to comment.