mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
vere: removes single-homing from king/serf protocol
This commit is contained in:
parent
d1b655c5c9
commit
4cdce421ed
@ -494,14 +494,16 @@ _pier_work_boot(u3_pier* pir_u, c3_o sav_o)
|
||||
|
||||
c3_assert( 0 != pir_u->lif_d );
|
||||
|
||||
u3_noun who = u3i_chubs(2, pir_u->who_d);
|
||||
u3_noun len = u3i_chubs(1, &pir_u->lif_d);
|
||||
|
||||
if ( c3y == sav_o ) {
|
||||
_pier_db_write_header(pir_u, u3k(who), pir_u->fak_o, u3k(len));
|
||||
_pier_db_write_header(pir_u,
|
||||
u3i_chubs(2, pir_u->who_d),
|
||||
pir_u->fak_o,
|
||||
u3k(len));
|
||||
}
|
||||
|
||||
u3_noun msg = u3nq(c3__boot, who, pir_u->fak_o, len);
|
||||
u3_noun msg = u3nc(c3__boot, len);
|
||||
u3_atom mat = u3ke_jam(msg);
|
||||
u3_newt_write(&god_u->inn_u, mat, 0);
|
||||
}
|
||||
@ -897,30 +899,21 @@ _pier_work_poke(void* vod_p,
|
||||
// the worker process starts with a %play task,
|
||||
// which tells us where to start playback
|
||||
//
|
||||
// XX [our fak] ignored. Remove
|
||||
//
|
||||
case c3__play: {
|
||||
c3_d lav_d;
|
||||
c3_l mug_l;
|
||||
|
||||
if ( u3_nul == u3t(jar) ) {
|
||||
lav_d = 1ULL;
|
||||
mug_l = 0;
|
||||
}
|
||||
else {
|
||||
if ( (c3n == u3r_qual(u3t(jar), 0, &p_jar, &q_jar, 0)) ||
|
||||
if ( (c3n == u3r_trel(jar, 0, &p_jar, &q_jar)) ||
|
||||
(c3n == u3ud(p_jar)) ||
|
||||
(u3r_met(6, p_jar) != 1) ||
|
||||
(c3n == u3ud(q_jar)) ||
|
||||
(u3r_met(5, q_jar) != 1) )
|
||||
(1 < u3r_met(5, q_jar)) )
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
else {
|
||||
|
||||
lav_d = u3r_chub(0, p_jar);
|
||||
mug_l = u3r_word(0, q_jar);
|
||||
}
|
||||
}
|
||||
|
||||
_pier_work_play(pir_u, lav_d, mug_l);
|
||||
break;
|
||||
@ -1035,6 +1028,7 @@ _pier_work_poke(void* vod_p,
|
||||
return;
|
||||
|
||||
error: {
|
||||
u3m_p("jar", jar);
|
||||
u3z(jar); u3z(mat);
|
||||
_pier_work_bail(0, "bad jar");
|
||||
}
|
||||
|
@ -46,17 +46,10 @@
|
||||
+$ plea
|
||||
$% :: status on startup
|
||||
::
|
||||
$: %play
|
||||
$= p
|
||||
:: ~ if no snapshot
|
||||
::
|
||||
%- unit
|
||||
:: p: event number expected
|
||||
:: q: mug of kernel
|
||||
:: r: identity, fake flag
|
||||
:: q: mug of kernel (or 0)
|
||||
::
|
||||
[p=@ q=@ r=[our=@p fak=?]]
|
||||
==
|
||||
[%play p=@ q=@]
|
||||
:: event executed unchanged (in response to %work)
|
||||
::
|
||||
$: %done
|
||||
@ -97,11 +90,9 @@
|
||||
+$ writ
|
||||
$% :: prepare to boot
|
||||
::
|
||||
:: p: identity
|
||||
:: q: fake?
|
||||
:: r: number of boot formulas
|
||||
:: p: length of lifecycle sequence
|
||||
::
|
||||
[%boot p=@p q=? r=@]
|
||||
[%boot p=@]
|
||||
:: exit immediately
|
||||
::
|
||||
:: p: exit code
|
||||
@ -879,13 +870,11 @@ _worker_poke(void* vod_p, u3_noun mat)
|
||||
goto error;
|
||||
}
|
||||
|
||||
// XX [our fak] ignored. Remove
|
||||
//
|
||||
case c3__boot: {
|
||||
u3_noun len;
|
||||
c3_w len_w;
|
||||
|
||||
if ( (c3n == u3r_qual(jar, 0, 0, 0, &len)) ||
|
||||
if ( (c3n == u3r_cell(jar, 0, &len)) ||
|
||||
(c3n == u3ud(len)) ||
|
||||
(1 < u3r_met(3, len)) )
|
||||
{
|
||||
@ -975,25 +964,22 @@ void
|
||||
u3_worker_boot(void)
|
||||
{
|
||||
c3_d nex_d = 1ULL;
|
||||
u3_noun dat = u3_nul;
|
||||
|
||||
if ( 0 != u3V.dun_d ) {
|
||||
// no boot sequence expected
|
||||
// if a lifecycle sequence is needed, [len_w] will be set on %boot
|
||||
//
|
||||
u3V.len_w = 0;
|
||||
|
||||
if ( 0 != u3V.dun_d ) {
|
||||
u3V.mug_l = u3r_mug(u3A->roc);
|
||||
nex_d = u3V.dun_d + 1ULL;
|
||||
// XX [our fak] is unused/ignored. Remove.
|
||||
// Temporarily defaulted to [~zod fake=&]
|
||||
//
|
||||
dat = u3nc(u3_nul, u3nt(u3i_chubs(1, &nex_d),
|
||||
u3V.mug_l,
|
||||
u3nc(0, 0)));
|
||||
nex_d += u3V.dun_d;
|
||||
}
|
||||
else {
|
||||
u3V.mug_l = 0;
|
||||
}
|
||||
|
||||
u3l_log("work: play %" PRIu64 "\r\n", nex_d);
|
||||
|
||||
_worker_send(u3nc(c3__play, dat));
|
||||
_worker_send(u3nt(c3__play, u3i_chubs(1, &nex_d), u3V.mug_l));
|
||||
|
||||
// measure/print static memory usage if < 1/2 of the loom is available
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user