fine: set and handle the response bit correctly

This commit is contained in:
fang 2022-01-24 23:06:06 +01:00
parent 176aa3a45e
commit 03b73b85bf
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -102,8 +102,9 @@
|= [=path num=@ud] |= [=path num=@ud]
^- hoot ^- @ ^- hoot ^- @
=+ bod=(request-body path num) =+ bod=(request-body path num)
=+ con=(can 3 64^(sign:keys dat.bod) bod ~) =+ syn=(can 3 64^(sign:keys dat.bod) bod ~)
(encode-packet [our ~zod] (mod life:keys 16) 0b0 ~ con) %+ con 0b100 ::NOTE request bit
(encode-packet [our ~zod] (mod life:keys 16) 0b0 ~ syn)
:: ::
++ encode-response ++ encode-response
|= [=path data=(unit (cask))] |= [=path data=(unit (cask))]
@ -338,8 +339,8 @@
%purr %purr
^- (quip move _state) ^- (quip move _state)
=/ =packet:ames (decode-packet `@ux`purr.task) =/ =packet:ames (decode-packet `@ux`purr.task)
=/ req=? =(& (cut 0 [2 1] purr.task)) =/ resp=? =(& (cut 0 [2 1] purr.task))
?: req ?. resp
::TODO crash instead, scry/peek should be used for this ::TODO crash instead, scry/peek should be used for this
=/ =twit (decode-request `@ux`content.packet) =/ =twit (decode-request `@ux`content.packet)
::TODO verify request signature ::TODO verify request signature