mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
khan: special case removing chan at list head
This commit is contained in:
parent
ed7c33e070
commit
2e12d3792e
@ -64,20 +64,24 @@ _khan_moor_bail(void* ptr_v, ssize_t err_i, const c3_c* err_c)
|
|||||||
{
|
{
|
||||||
u3_chan* can_u = (u3_chan*)ptr_v;
|
u3_chan* can_u = (u3_chan*)ptr_v;
|
||||||
u3_shan* san_u = can_u->san_u;
|
u3_shan* san_u = can_u->san_u;
|
||||||
u3_khan* kan_u = san_u->kan_u;
|
|
||||||
u3_chan* inn_u;
|
u3_chan* inn_u;
|
||||||
|
|
||||||
if ( err_i == UV_EOF ) {
|
if ( err_i == UV_EOF ) {
|
||||||
// close socket and remove reference.
|
// close socket and remove reference.
|
||||||
|
if ( san_u->can_u == can_u ) {
|
||||||
|
san_u->can_u = (u3_chan*)can_u->mor_u.nex_u;
|
||||||
|
}
|
||||||
|
else {
|
||||||
for ( inn_u = san_u->can_u; inn_u; inn_u = (u3_chan*)inn_u->mor_u.nex_u ) {
|
for ( inn_u = san_u->can_u; inn_u; inn_u = (u3_chan*)inn_u->mor_u.nex_u ) {
|
||||||
if ( (u3_chan*)inn_u->mor_u.nex_u == can_u ) {
|
if ( (u3_chan*)inn_u->mor_u.nex_u == can_u ) {
|
||||||
inn_u->mor_u.nex_u = can_u->mor_u.nex_u;
|
inn_u->mor_u.nex_u = can_u->mor_u.nex_u;
|
||||||
can_u->mor_u.nex_u = NULL;
|
|
||||||
u3_newt_moat_stop((u3_moat*)&can_u->mor_u, _khan_moat_free);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
can_u->mor_u.nex_u = NULL;
|
||||||
|
u3_newt_moat_stop((u3_moat*)&can_u->mor_u, _khan_moat_free);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// TODO retry up to N
|
// TODO retry up to N
|
||||||
u3_noun bal;
|
u3_noun bal;
|
||||||
|
Loading…
Reference in New Issue
Block a user