mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 10:52:12 +03:00
Merge branch 'czar-dont-give-up' into maint-0.4
Don't give up if we can't find a czar
This commit is contained in:
commit
71d94d14e3
16
vere/ames.c
16
vere/ames.c
@ -58,7 +58,8 @@ _ames_czar(c3_y imp_y, c3_s* por_s)
|
|||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
*por_s = 13337 + imp_y;
|
*por_s = 13337 + imp_y;
|
||||||
|
|
||||||
if ( 0xffffffff == sam_u->imp_w[imp_y] ) {
|
if ( 0xffffffff == sam_u->imp_w[imp_y]
|
||||||
|
&& (now - sam_u -> imp_t[imp_y]) < 300 ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if ( 0 == sam_u->imp_w[imp_y]
|
else if ( 0 == sam_u->imp_w[imp_y]
|
||||||
@ -78,8 +79,11 @@ _ames_czar(c3_y imp_y, c3_s* por_s)
|
|||||||
|
|
||||||
if ( 0 != getaddrinfo(dns_c, 0, 0, &air_u) ) {
|
if ( 0 != getaddrinfo(dns_c, 0, 0, &air_u) ) {
|
||||||
uL(fprintf(uH, "ames: czar at %s: not found (a)\n", dns_c));
|
uL(fprintf(uH, "ames: czar at %s: not found (a)\n", dns_c));
|
||||||
|
if ( sam_u->imp_w[imp_y] == 0
|
||||||
|
|| sam_u->imp_w[imp_y] == 0xffffffff ) {
|
||||||
sam_u->imp_w[imp_y] = 0xffffffff;
|
sam_u->imp_w[imp_y] = 0xffffffff;
|
||||||
sam_u->imp_t[imp_y] = 0;
|
} /* else keep existing ip for 5 more minutes */
|
||||||
|
sam_u->imp_t[imp_y] = now;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,8 +93,11 @@ _ames_czar(c3_y imp_y, c3_s* por_s)
|
|||||||
while ( 1 ) {
|
while ( 1 ) {
|
||||||
if ( !rai_u ) {
|
if ( !rai_u ) {
|
||||||
uL(fprintf(uH, "ames: czar at %s: not found (b)\n", dns_c));
|
uL(fprintf(uH, "ames: czar at %s: not found (b)\n", dns_c));
|
||||||
|
if ( sam_u->imp_w[imp_y] == 0
|
||||||
|
|| sam_u->imp_w[imp_y] == 0xffffffff ) {
|
||||||
sam_u->imp_w[imp_y] = 0xffffffff;
|
sam_u->imp_w[imp_y] = 0xffffffff;
|
||||||
sam_u->imp_t[imp_y] = 0;
|
} /* else keep existing ip for 5 more minutes */
|
||||||
|
sam_u->imp_t[imp_y] = now;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ( (AF_INET == rai_u->ai_family) ) {
|
if ( (AF_INET == rai_u->ai_family) ) {
|
||||||
@ -100,7 +107,8 @@ _ames_czar(c3_y imp_y, c3_s* por_s)
|
|||||||
sam_u->imp_w[imp_y] = ntohl(add_u->sin_addr.s_addr);
|
sam_u->imp_w[imp_y] = ntohl(add_u->sin_addr.s_addr);
|
||||||
sam_u->imp_t[imp_y] = now;
|
sam_u->imp_t[imp_y] = now;
|
||||||
#if 1
|
#if 1
|
||||||
if ( sam_u->imp_w[imp_y] != old_w ) {
|
if ( sam_u->imp_w[imp_y] != old_w
|
||||||
|
&& sam_u->imp_w[imp_y] != 0xffffffff ) {
|
||||||
u3_noun wad = u3i_words(1, &sam_u->imp_w[imp_y]);
|
u3_noun wad = u3i_words(1, &sam_u->imp_w[imp_y]);
|
||||||
u3_noun nam = u3dc("scot", c3__if, wad);
|
u3_noun nam = u3dc("scot", c3__if, wad);
|
||||||
c3_c* nam_c = u3r_string(nam);
|
c3_c* nam_c = u3r_string(nam);
|
||||||
|
Loading…
Reference in New Issue
Block a user