Even more stuff happens

This commit is contained in:
Emery Hemingway 2023-06-06 01:20:34 +01:00
parent a1068cd836
commit a18cdd16b4
3 changed files with 13 additions and 14 deletions

View File

@ -20,4 +20,4 @@ Fields = [Field ...] .
ActionStart = <start @id int @level int @type int @text string @fields Fields @parent int> .
ActionStop = <stop @id int> .
ActionResult = <stop @id int @type int @fields Fields> .
ActionResult = <result @id int @type int @fields Fields> .

View File

@ -51,7 +51,7 @@ type
ActionStop* {.preservesRecord: "stop".} = object
`id`*: BiggestInt
ActionResult* {.preservesRecord: "stop".} = object
ActionResult* {.preservesRecord: "result".} = object
`id`*: BiggestInt
`type`*: BiggestInt
`fields`*: Fields

View File

@ -180,9 +180,10 @@ type ValidPathInfo = object
sigs: HashSet[string]
ca: string
proc passDaemonValidPathInfo(session: Session): Future[ValidPathInfo] {.async.} =
proc passDaemonValidPathInfo(session: Session; includePath: bool): Future[ValidPathInfo] {.async.} =
var info: ValidPathInfo
info.path = await passDaemonString(session)
if includePath:
info.path = await passDaemonString(session)
info.deriver = await passDaemonString(session)
info.narHash = await passDaemonString(session)
info.references = await passDaemonStringSet(session)
@ -271,22 +272,18 @@ proc passWork(session: Session) {.async.} =
act.text = await passDaemonString(session)
act.fields = await passDaemonFields(session)
act.parent = BiggestInt(await passDaemonWord(session))
echo "STDERR_START_ACTIVITY ", act
of STDERR_STOP_ACTIVITY:
var act: ActionStop
act.id = BiggestInt(await passDaemonWord(session))
echo "STDERR_STOP_ACTIVITY ", act
of STDERR_RESULT:
var act: ActionResult
act.id = BiggestInt(await passDaemonWord(session))
act.`type` = BiggestInt(await passDaemonWord(session))
act.fields = await passDaemonFields(session)
echo "STDERR_RESULT ", act
of STDERR_LAST:
echo "STDERR_LAST"
break
else:
@ -315,7 +312,7 @@ proc loop(session: Session) {.async.} =
echo "wopAddToStore: ", name, " refs: ", refs
await passClientChunks(session)
await passWork(session)
let info = await passDaemonValidPathInfo(session)
let info = await passDaemonValidPathInfo(session, true)
echo "finshed wopAddToStore ", name
of wopAddTempRoot:
@ -353,13 +350,15 @@ proc loop(session: Session) {.async.} =
of wopQueryPathInfo:
echo "wopQueryPathInfo"
assert session.version >= 17
let path = await passClientString(session)
await passWork(session)
assert session.version >= 17
let
valid = await passClientWord(session)
info = await passDaemonValidPathInfo(session)
echo "wopQueryPathInfo ", path, " ", info
let valid = await passDaemonWord(session)
echo "daemon says valid is ", valid
if valid != 0:
echo "get path info from daemon"
let info = await passDaemonValidPathInfo(session, false)
echo "wopQueryPathInfo ", path, " ", info
of wopQueryMissing:
echo "wopQueryMissing"