|
Lines 142-147
Link Here
|
| 142 |
#define MARK 0x008 /* this message is a mark */ |
142 |
#define MARK 0x008 /* this message is a mark */ |
| 143 |
#define ISKERNEL 0x010 /* kernel generated message */ |
143 |
#define ISKERNEL 0x010 /* kernel generated message */ |
| 144 |
|
144 |
|
|
|
145 |
#define DELAY_MUL 2 /* delay multiplier */ |
| 146 |
#define DELAY_INIT 30 /* initial delay in seconds */ |
| 147 |
|
| 145 |
/* |
148 |
/* |
| 146 |
* This structure represents the files that will have log |
149 |
* This structure represents the files that will have log |
| 147 |
* copies printed. |
150 |
* copies printed. |
|
Lines 159-164
Link Here
|
| 159 |
#define PRI_EQ 0x2 |
162 |
#define PRI_EQ 0x2 |
| 160 |
#define PRI_GT 0x4 |
163 |
#define PRI_GT 0x4 |
| 161 |
char *f_program; /* program this applies to */ |
164 |
char *f_program; /* program this applies to */ |
|
|
165 |
/* should this be part of the union? */ |
| 166 |
time_t f_unreach; /* time since last unreach */ |
| 167 |
time_t f_delay; /* backoff time */ |
| 162 |
union { |
168 |
union { |
| 163 |
char f_uname[MAXUNAMES][UT_NAMESIZE+1]; |
169 |
char f_uname[MAXUNAMES][UT_NAMESIZE+1]; |
| 164 |
struct { |
170 |
struct { |
|
Lines 999-1004
Link Here
|
| 999 |
l = MAXLINE; |
1005 |
l = MAXLINE; |
| 1000 |
|
1006 |
|
| 1001 |
if (finet) { |
1007 |
if (finet) { |
|
|
1008 |
dprintf("FORW: now: %d f_unreach: %d f_delay: %d\n", (int) now, (int) f->f_unreach, (int) f->f_delay); |
| 1009 |
/* XXX: must make sure this is initialized to 0 */ |
| 1010 |
if (f->f_unreach) { /* there was a failure last time */ |
| 1011 |
dprintf("another try at host\n"); |
| 1012 |
if ( (now - f->f_unreach) < f->f_delay) { |
| 1013 |
dprintf("skipping: now: %d, f_unreach: %d f_delay: %d\n", (int) now, (int) f->f_unreach, (int) f->f_delay); |
| 1014 |
break; /* do not send */ |
| 1015 |
} |
| 1016 |
} |
| 1002 |
for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) { |
1017 |
for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) { |
| 1003 |
for (i = 0; i < *finet; i++) { |
1018 |
for (i = 0; i < *finet; i++) { |
| 1004 |
#if 0 |
1019 |
#if 0 |
|
Lines 1017-1028
Link Here
|
| 1017 |
if (lsent == l && !send_to_all) |
1032 |
if (lsent == l && !send_to_all) |
| 1018 |
break; |
1033 |
break; |
| 1019 |
} |
1034 |
} |
|
|
1035 |
dprintf("lsent: %d\n", lsent); |
| 1020 |
if (lsent != l) { |
1036 |
if (lsent != l) { |
| 1021 |
int e = errno; |
1037 |
int e = errno; |
| 1022 |
(void)close(f->f_file); |
1038 |
dprintf("sendto: f_unreach: %d f_delay: %d\n", (int) f->f_unreach, (int) f->f_delay); |
| 1023 |
errno = e; |
|
|
| 1024 |
f->f_type = F_UNUSED; |
| 1025 |
logerror("sendto"); |
1039 |
logerror("sendto"); |
|
|
1040 |
errno = e; |
| 1041 |
switch (errno) { |
| 1042 |
case EHOSTUNREACH: |
| 1043 |
case EHOSTDOWN: |
| 1044 |
if (f->f_unreach) |
| 1045 |
f->f_delay *= DELAY_MUL; |
| 1046 |
else { |
| 1047 |
f->f_unreach = now; |
| 1048 |
f->f_delay = DELAY_INIT; |
| 1049 |
} |
| 1050 |
dprintf("setting: f_unreach: %d f_delay: %d\n", (int) f->f_unreach, (int) f->f_delay); |
| 1051 |
break; |
| 1052 |
/* case EBADF: */ |
| 1053 |
/* case EACCES: */ |
| 1054 |
/* case ENOTSOCK: */ |
| 1055 |
/* case EFAULT: */ |
| 1056 |
/* case EMSGSIZE: */ |
| 1057 |
/* case EAGAIN: */ |
| 1058 |
/* case ENOBUFS: */ |
| 1059 |
/* case ECONNREFUSED: */ |
| 1060 |
default: |
| 1061 |
dprintf("removing entry\n", e); |
| 1062 |
(void)close(f->f_file); |
| 1063 |
errno = e; |
| 1064 |
f->f_type = F_UNUSED; |
| 1065 |
break; |
| 1066 |
} |
| 1026 |
} |
1067 |
} |
| 1027 |
} |
1068 |
} |
| 1028 |
break; |
1069 |
break; |
|
Lines 2301-2303
Link Here
|
| 2301 |
|
2342 |
|
| 2302 |
return(socks); |
2343 |
return(socks); |
| 2303 |
} |
2344 |
} |
|
|
2345 |
|
| 2346 |
/* Local Variables: *** */ |
| 2347 |
/* c-basic-offset:8 *** */ |
| 2348 |
/* End: *** */ |