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