Re: Incoming host state file
Egil Kvaleberg <[email protected]> 21 Jan 2003 14:51:19 +0100
| Newsgroups | gmane.network.newsx |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2003-01-21 at 14:19, Egil Kvaleberg wrote:
> On Mon, 2003-01-13 at 18:31, Triebwasser, Mark wrote:
> > When does an update occur for the incoming host state file?
>
> I will have a look.
It seems like the intention was that the state file should be updated,
but this did not always work. In particular for large groups.
The enclosed patch should fix this....
Egil
-------------------------------------------------------------------------------
Index: src/pull.c
===================================================================
RCS file: /home/cvs/newsx/src/pull.c,v
retrieving revision 1.17.2.1
diff -c -r1.17.2.1 pull.c
*** src/pull.c 14 Feb 2001 06:55:40 -0000 1.17.2.1
--- src/pull.c 21 Jan 2003 13:41:45 -0000
***************
*** 142,147 ****
--- 142,152 ----
log_msg(L_DEBUG,"flushing spool...");
flush_spool(0);
bytes_in_spool = 0;
+
+ if (latest_where > 0) {
+ /* checkpoint: last article retrieved */
+ *wherep = latest_where;
+ }
}
}
/* flush all remaining requests */
***************
*** 156,162 ****
*wherep = where;
} else {
log_msg(L_DEBUGMORE,"transfer interrupted");
! if (latest_where) {
/* this was the last article we retieved */
*wherep = latest_where;
log_msg(L_DEBUGMORE,"latest article was %ld", latest_where);
--- 161,167 ----
*wherep = where;
} else {
log_msg(L_DEBUGMORE,"transfer interrupted");
! if (latest_where > 0) {
/* this was the last article we retieved */
*wherep = latest_where;
log_msg(L_DEBUGMORE,"latest article was %ld", latest_where);
***************
*** 189,195 ****
}
if ((f = pull_tmp)) {
pull_tmp = 0;
! fclose(pull_tmp);
}
/* clean up and update host active */
--- 194,200 ----
}
if ((f = pull_tmp)) {
pull_tmp = 0;
! fclose(f);
}
/* clean up and update host active */
***************
*** 211,216 ****
--- 216,222 ----
log_msg(l_debug,"renaming %s to %s",activename,active_old);
unlink(active_old);
if (!rename_file(activename,active_old)) exit_cleanup(6);
+ active_old[0] = '\0';
}
log_msg(l_debug,"renaming %s to %s",active_tmp,activename);
if (!rename_file(active_tmp,activename)) exit_cleanup(6);
***************
*** 330,342 ****
ok = pull_group(group,&where,1);
if (ok) ++unseen_groups;
}
if (!ok) {
fetch_aborted = 1;
skip = 1;
/* continue reading active to clean up things */
- } else if (where0 != where) {
- ++pull_anything;
- fflush(pull_tmp);
}
} else {
if (forget_inactive) {
--- 336,350 ----
ok = pull_group(group,&where,1);
if (ok) ++unseen_groups;
}
+ if (where0 != where) {
+ /* remember spooled files, always */
+ ++pull_anything;
+ fflush(pull_tmp);
+ }
if (!ok) {
fetch_aborted = 1;
skip = 1;
/* continue reading active to clean up things */
}
} else {
if (forget_inactive) {
-------------------------------------------------------------------------------
--
Email: [email protected]
Voice/videophone: +47 22523641 Voice: +47 92022780 Fax: +47 22525899
Mail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
Home: http://www.kvaleberg.com/
-----------------------------------------------------------------------
This message has been sent to you because you are subcribed to the mailing
list [email protected]. To remove yourself from this lists, send an email to
[email protected] containing "unsubscribe newsx <your_email_address>"
in the message body.