wipcheck and wipexpire
Kachun Lee
kachun at pathlink.com
Mon May 15 23:52:37 UTC 2000
In article <20000516074939H.kondou at inn.do.mms.mt.nec.co.jp>, you say...
>
>In article <200005151747.KAA44783 at pathlink.net>,
> kachun at pathlink.com (Kachun Lee) wrote;
>
>} If different behavior was intended for offered channel between wipcheck and
>} wipexpire, I think it should be the inverted, i.e. negative for the offered
>} channel and positive for others. The logic is that if the offered channel
send
>} another CHECK for the same msgid, it must have lost the previous SENDIT
>} response, so it should be responsed with SENDIT again. And others should
always
>} response with RESEND as long as the msgid is in WIP.
>
>I agree in that case, but I think it depends on peer.
>
>} the weekend. I can post the patch (to inn-patch?) after I recheck some
numbers
>} and if someone kind enough to confirm that I have not miss some purpose
about
>} wipcheck/wipexpire.
>
>I'd like to see the patch.
>--
>Katsuhiro Kondou
>
>
Here is the patch (I reapplied to a inn-2.3 beta of last week - we are running
a heavily patched inn2.2 :-( ). Any comment would be appreciated. Thanks.
*** innd.h.00 Thu May 11 03:04:10 2000
--- innd.h Mon May 15 16:19:07 2000
***************
*** 207,212 ****
--- 207,215 ----
int ActiveCnx;
int MaxCnx;
int HoldTime;
+
+ time_t ArtBeg;
+ int ArtMax;
} CHANNEL;
*** chan.c.00 Mon May 15 16:24:20 2000
--- chan.c Mon May 15 16:20:48 2000
***************
*** 207,212 ****
--- 207,214 ----
cp->Lastch=0;
cp->MaxCnx=0;
cp->ActiveCnx=0;
+ cp->ArtBeg = 0;
+ cp->ArtMax = 0;
HashClear(&cp->CurrentMessageIDHash);
memset(cp->PrecommitWIP, '\0', sizeof(cp->PrecommitWIP));
cp->PrecommitiCachenext=0;
*** art.c.00 Thu May 11 03:04:10 2000
--- art.c Mon May 15 16:25:52 2000
***************
*** 2571,2576 ****
--- 2571,2582 ----
clearerr(Log);
}
+ /* Calculate Max Article Time */
+ i = Now.time - cp->ArtBeg;
+ if(i > cp->ArtMax)
+ cp->ArtMax = i;
+ cp->ArtBeg = 0;
+
cp->Size += Data.SizeValue;
if (innconf->logartsize) {
if (fprintf(Log, " %ld",Data.SizeValue) == EOF || ferror (Log)) {
*** wip.c.00 Fri Nov 26 08:53:00 1999
--- wip.c Mon May 15 16:40:28 2000
***************
*** 16,21 ****
--- 16,23 ----
#define WIPTABLESIZE 1024
+ #define WIP_ARTMAX 300 /* innfeed default max send time */
+
STATIC WIP *WIPtable[WIPTABLESIZE]; /* Top level of the WIP hash
tabl
e */
void WIPsetup(void) {
***************
*** 100,108 ****
int i;
if ((wp = WIPbyid(msgid)) != NULL) {
! if ((Now.time - wp->Timestamp) < innconf->wipcheck)
return TRUE;
! if ((Now.time - wp->Timestamp) > innconf->wipexpire) {
for (i = 0 ; i < PRECOMMITCACHESIZE ; i++) {
if (wp->Chan->PrecommitWIP[i] == wp) {
wp->Chan->PrecommitWIP[i] = (WIP *)NULL;
--- 102,118 ----
int i;
if ((wp = WIPbyid(msgid)) != NULL) {
! if(wp->Chan->ArtBeg == 0)
! i = 0;
! else {
! i = wp->Chan->ArtMax;
! if(i > WIP_ARTMAX)
! i = WIP_ARTMAX;
! }
!
! if ((Now.time - wp->Timestamp) < (i + innconf->wipcheck))
return TRUE;
! if ((Now.time - wp->Timestamp) > (i + innconf->wipexpire)) {
for (i = 0 ; i < PRECOMMITCACHESIZE ; i++) {
if (wp->Chan->PrecommitWIP[i] == wp) {
wp->Chan->PrecommitWIP[i] = (WIP *)NULL;
*** nc.c.00 Thu May 11 03:04:11 2000
--- nc.c Mon May 15 16:34:28 2000
***************
*** 87,92 ****
--- 87,93 ----
void NCclearwip(CHANNEL *cp) {
WIPfree(WIPbyhash(cp->CurrentMessageIDHash));
HashClear(&cp->CurrentMessageIDHash);
+ cp->ArtBeg = 0;
}
/*
***************
*** 515,520 ****
--- 516,522 ----
else {
cp->Ihave_SendIt++;
NCwritereply(cp, NNTP_SENDIT);
+ cp->ArtBeg = Now.time;
cp->State = CSgetarticle;
}
}
***************
*** 1382,1387 ****
--- 1384,1390 ----
(void)sprintf(cp->Sendid.Data, "%d %s", NNTP_ERR_FAILID_VAL, p);
cp->State = CSgetarticle;
+ cp->ArtBeg = Now.time;
/* set WIP for benefit of later code in NCreader */
if ((wp = WIPbyid(p)) == (WIP *)NULL)
wp = WIPnew(p, cp);
More information about the inn-workers
mailing list