|
|
1.1 root 1: /*
2: ** Process timeouts for packets
3: */
4:
5: #include "pconfig.h"
6: #include "proto.h"
7: #include "packets.h"
8: #include "pstats.h"
9:
10: void
11: ptimeout(sig)
12: int sig;
13: {
14: register Pch_p pcp;
15: register Pks_p psp;
16: register int i;
17: register int retrys;
18:
19: # ifndef Blit
20: signal(sig, ptimeout);
21: # endif
22: Ptflag = 0;
23:
24: if ( precvpkt.timo > 0 && ++Ptflag && (precvpkt.timo -= Pscanrate) <= 0 )
25: {
26: precvpkt.state = PR_NULL;
27: ptrace("RECV TIMEOUT");
28: }
29:
30: for ( pcp = pconvs, retrys = 0 ; pcp < pconvsend && retrys < MAXTIMORETRYS ; pcp++ )
31: for ( psp = pcp->nextpkt, i = NPCBUFS ; i-- ; )
32: {
33: if ( psp->timo > 0 && ++Ptflag && (psp->timo -= Pscanrate) <= 0 )
34: {
35: ptrace("XMIT TIMEOUT");
36: psp->timo = Pxtimeout;
37: Pxfunc(&psp->pkt, psp->size);
38: PSTATS(PS_TIMOPKT);
39: plogpkt(&psp->pkt, PLOGOUT);
40: ptrace("END TIMEOUT");
41: if ( ++retrys >= MAXTIMORETRYS )
42: break;
43: }
44: if ( ++psp >= &pcp->pkts[NPCBUFS] )
45: psp = pcp->pkts;
46: }
47:
48: # ifndef Blit
49: if ( Ptflag )
50: (void)alarm(Pscanrate);
51: # endif
52: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.