Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/vere/io/ames.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,7 @@ _fine_hear_response(u3_pact* pac_u, c3_w cur_w)
u3_auto_plan(&pac_u->sam_u->car_u, ovo_u);

_ames_cap_queue(pac_u->sam_u);
_ames_pact_free(pac_u);
}

/* _ames_hear_ames(): hear ames packet.
Expand Down
26 changes: 5 additions & 21 deletions pkg/vere/io/mesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,9 @@ _mesa_io_exit(u3_auto* car_u)
u3_mesa* sam_u = (u3_mesa*)car_u;
uv_timer_stop(&sam_u->tim_u);
sam_u->tim_u.data = sam_u;
uv_udp_recv_stop(&u3_Host.wax_u);
uv_close((uv_handle_t*)&sam_u->tim_u, _mesa_exit_cb);
uv_close((uv_handle_t*)&u3_Host.wax_u, 0);
}

static void
Expand Down Expand Up @@ -2427,26 +2429,9 @@ _mesa_add_hop(c3_y hop_y, u3_mesa_head* hed_u, u3_mesa_page_pact* pag_u, sockadd
{
c3_w pip_w = ntohl(lan_u.sin_addr.s_addr);
c3_s por_s = ntohs(lan_u.sin_port);
if ( 1 == hop_y ) {
c3_etch_word(pag_u->sot_u, pip_w);
c3_etch_short(pag_u->sot_u + 4, por_s);
hed_u->nex_y = HOP_SHORT;
return;
}


u3_mesa_hop_once* lan_y = c3_calloc(sizeof(u3_mesa_hop_once));

c3_etch_word(lan_y->dat_y, pip_w);
c3_etch_short(lan_y->dat_y, por_s);

lan_y->len_w = 6;

c3_realloc(&pag_u->man_u, pag_u->man_u.len_w + 8);
pag_u->man_u.dat_y[pag_u->man_u.len_w] = *lan_y;

pag_u->man_u.len_w++;

c3_etch_word(pag_u->sot_u, pip_w);
c3_etch_short(pag_u->sot_u + 4, por_s);
hed_u->nex_y = HOP_SHORT;
}

/* static c3_d avg_time() { */
Expand Down Expand Up @@ -2561,7 +2546,6 @@ _mesa_hear_page(u3_mesa_pict* pic_u, sockaddr_in lan_u)

_mesa_send_pact(sam_u, pin_u->adr_u, NULL, pac_u);
_mesa_del_pit(sam_u, nam_u);
return;
}

c3_d lev_d = mesa_num_leaves(pac_u->pag_u.dat_u.tob_d);
Expand Down
23 changes: 2 additions & 21 deletions pkg/vere/io/mesa/pact.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,6 @@ _sift_bytes(u3_sifter* sif_u, c3_y *buf_y, c3_w len_w)
memcpy(buf_y, res_y, len_w);
}

static c3_y*
_sift_bytes_alloc(u3_sifter* sif_u, c3_w len_w)
{
c3_y *buf_y = c3_calloc(len_w);
_sift_bytes(sif_u, buf_y, len_w);
return buf_y;
}

static void
_etch_byte(u3_etcher* ech_u, c3_y val_y)
{
Expand Down Expand Up @@ -762,13 +754,6 @@ _mesa_etch_hop_long(u3_etcher* ech_u, u3_mesa_hop_once* hop_u)
_etch_bytes(ech_u, hop_u->dat_y, hop_u->len_w);
}

static void
_mesa_sift_hop_long(u3_sifter* sif_u, u3_mesa_hop_once* hop_u)
{
hop_u->len_w = _sift_byte(sif_u);
hop_u->dat_y = _sift_bytes_alloc(sif_u, hop_u->len_w);
}

static void
_mesa_etch_page_pact(u3_etcher* ech_u, u3_mesa_page_pact* pag_u, u3_mesa_head* hed_u)
{
Expand Down Expand Up @@ -812,15 +797,11 @@ _mesa_sift_page_pact(u3_sifter* sif_u, u3_mesa_page_pact* pag_u, c3_y nex_y)
return;
}
case HOP_LONG: {
_mesa_sift_hop_long(sif_u, &pag_u->one_u);
_sift_fail(sif_u, "mesa: sift invalid hop long");
return;
}
case HOP_MANY: {
pag_u->man_u.len_w = _sift_byte(sif_u);
pag_u->man_u.dat_y = c3_calloc(sizeof(u3_mesa_hop_once) * pag_u->man_u.len_w);
for ( c3_w i = 0; i < pag_u->man_u.len_w; i++ ) {
_mesa_sift_hop_long(sif_u, &pag_u->man_u.dat_y[i]);
}
_sift_fail(sif_u, "mesa: sift invalid hop many");
return;
}
}
Expand Down
Loading