mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
serf: fix incorrect structure in %peek response
This commit is contained in:
parent
a53e462be8
commit
406c865689
@ -791,7 +791,7 @@ u3_serf_play(u3_serf* sef_u, c3_d eve_d, u3_noun lit)
|
||||
u3_noun
|
||||
u3_serf_peek(u3_serf* sef_u, c3_w mil_w, u3_noun sam)
|
||||
{
|
||||
u3_noun wen, pat, gon, pro;
|
||||
u3_noun wen, pat, pro;
|
||||
|
||||
// stash the previous date and set current
|
||||
//
|
||||
@ -805,14 +805,19 @@ u3_serf_peek(u3_serf* sef_u, c3_w mil_w, u3_noun sam)
|
||||
u3A->now = u3k(now);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
u3_noun tag, dat;
|
||||
|
||||
// XX incomplete interface, should pass [lyc] as well
|
||||
//
|
||||
gon = u3m_soft(mil_w, u3v_peek, u3k(pat));
|
||||
u3_noun gon = u3m_soft(mil_w, u3v_peek, u3k(pat));
|
||||
u3x_cell(gon, &tag, &dat);
|
||||
|
||||
// read succeeded, produce result
|
||||
//
|
||||
if ( u3_blip == u3h(gon) ) {
|
||||
if ( u3_nul == gon ) {
|
||||
if ( u3_blip == tag ) {
|
||||
if ( u3_nul == dat ) {
|
||||
pro = u3nc(c3__done, u3_nul);
|
||||
}
|
||||
else {
|
||||
@ -820,15 +825,18 @@ u3_serf_peek(u3_serf* sef_u, c3_w mil_w, u3_noun sam)
|
||||
//
|
||||
// XX incomplete interface, should recv mark from arvo
|
||||
//
|
||||
pro = u3nq(c3__done, u3_nul, c3__noun, u3k(u3t(gon)));
|
||||
pro = u3nq(c3__done, u3_nul, c3__noun, u3k(u3t(dat)));
|
||||
}
|
||||
|
||||
u3z(gon);
|
||||
}
|
||||
// read failed, produce trace
|
||||
//
|
||||
// NB, reads should *not* fail deterministically
|
||||
//
|
||||
else {
|
||||
pro = u3nc(c3__bail, u3k(gon));
|
||||
pro = u3nc(c3__bail, gon);
|
||||
}
|
||||
}
|
||||
|
||||
// restore the previous date
|
||||
@ -838,7 +846,6 @@ u3_serf_peek(u3_serf* sef_u, c3_w mil_w, u3_noun sam)
|
||||
u3z(u3A->now);
|
||||
u3A->now = wen;
|
||||
|
||||
u3z(gon);
|
||||
u3z(sam);
|
||||
return u3nc(c3__peek, pro);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user