mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
serf: use u3s_cue_sill() for ipc $writ's
This commit is contained in:
parent
fe01695594
commit
a79a0e9437
@ -24,10 +24,10 @@
|
||||
|
||||
#include "ur/hashcons.h"
|
||||
|
||||
static u3_serf u3V; // one serf per process
|
||||
static u3_moat inn_u; // input stream
|
||||
static u3_mojo out_u; // output stream
|
||||
static ur_dict32_t dic_u; // cue dictionary
|
||||
static u3_serf u3V; // one serf per process
|
||||
static u3_moat inn_u; // input stream
|
||||
static u3_mojo out_u; // output stream
|
||||
static u3_cue_sill* sil_u; // cue handle
|
||||
|
||||
#undef SERF_TRACE_JAM
|
||||
#undef SERF_TRACE_CUE
|
||||
@ -107,8 +107,8 @@ _cw_serf_step_trace(void)
|
||||
static void
|
||||
_cw_serf_writ(void* vod_p, c3_d len_d, c3_y* byt_y)
|
||||
{
|
||||
u3_noun ret, jar;
|
||||
c3_o ret_o;
|
||||
u3_weak jar;
|
||||
u3_noun ret;
|
||||
|
||||
_cw_serf_step_trace();
|
||||
|
||||
@ -116,16 +116,13 @@ _cw_serf_writ(void* vod_p, c3_d len_d, c3_y* byt_y)
|
||||
u3t_event_trace("serf ipc cue", 'B');
|
||||
#endif
|
||||
|
||||
ret_o = u3s_cue_xeno_unsafe(&dic_u, len_d, byt_y, &jar);
|
||||
// XX check if the dictionary grew too much and shrink?
|
||||
//
|
||||
ur_dict32_wipe(&dic_u);
|
||||
jar = u3s_cue_sill_with(sil_u, len_d, byt_y);
|
||||
|
||||
#ifdef SERF_TRACE_CUE
|
||||
u3t_event_trace("serf ipc cue", 'E');
|
||||
#endif
|
||||
|
||||
if ( (c3n == ret_o)
|
||||
if ( (u3_none == jar)
|
||||
|| (c3n == u3_serf_writ(&u3V, jar, &ret)) )
|
||||
{
|
||||
_cw_serf_fail(0, -1, "bad jar");
|
||||
@ -165,7 +162,7 @@ _cw_serf_stdio(c3_i* inn_i, c3_i* out_i)
|
||||
static void
|
||||
_cw_serf_exit(void)
|
||||
{
|
||||
ur_dict_free((ur_dict_t*)&dic_u);
|
||||
u3s_cue_sill_done(sil_u);
|
||||
u3t_trace_close();
|
||||
}
|
||||
|
||||
@ -239,7 +236,7 @@ _cw_serf_commence(c3_i argc, c3_c* argv[])
|
||||
uv_stream_set_blocking((uv_stream_t*)&out_u.pyp_u, 1);
|
||||
}
|
||||
|
||||
ur_dict32_grow((ur_root_t*)0, &dic_u, ur_fib10, ur_fib11);
|
||||
sil_u = u3s_cue_sill_init();
|
||||
|
||||
// set up writing
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user