changeset 183:c912e8288164 noffle

[svn] * src/client.c: Only bail out of fetching multiple articles if the connection fails. If we do get a status from the upstream server note it and see what is reported for the next article. Otherwise failure to retrieve one article will cause all successive article fetches to fail even through they would succeed if tried. * src/lock.c: Fix assert in lazy locking. If another noffle signalled us to release the lock at the next close, and then repeats the signal so that it arrives during LOCK_closeDatabases, the signal handler was trying to close the databases again.
author bears
date Tue, 15 May 2001 13:07:53 +0100
parents a43a528cfbe7
children 9854ea5f295f
files ChangeLog src/client.c src/lock.c
diffstat 3 files changed, 32 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 10 17:07:46 2001 +0100
+++ b/ChangeLog	Tue May 15 13:07:53 2001 +0100
@@ -1,4 +1,16 @@
-Thu May 10 2001 Jim Hageu <jim.hague@acm.org>
+Tue May 15 2001 Jim Hague <jim.hague@acm.org>
+
+ * src/client.c: Only bail out of fetching multiple articles if the
+   connection fails. If we do get a status from the upstream server
+   note it and see what is reported for the next article. Otherwise
+   failure to retrieve one article will cause all successive article
+   fetches to fail even through they would succeed if tried.
+ * src/lock.c: Fix assert in lazy locking. If another noffle signalled us
+   to release the lock at the next close, and then repeats the signal so that
+   it arrives during LOCK_closeDatabases, the signal handler was trying
+   to close the databases again.
+	
+Thu May 10 2001 Jim Hague <jim.hague@acm.org>
 
  * src/client.c: Only return failure getting NEWGROUPS if the connection
    failed. If the server doesn't implement NEWGROUPS correctly (step
--- a/src/client.c	Thu May 10 17:07:46 2001 +0100
+++ b/src/client.c	Tue May 15 13:07:53 2001 +0100
@@ -1,7 +1,7 @@
 /*
   client.c
 
-  $Id: client.c 286 2001-05-10 16:07:46Z bears $
+  $Id: client.c 292 2001-05-15 12:07:53Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -1153,13 +1153,20 @@
     res = TRUE;
     while ( res && ( p = Utl_getLn( msgId, p ) ) )
     {
-        if ( getStat() != STAT_ART_FOLLOWS )
+	switch( getStat() )
 	{
-            retrievingFailed( msgId, client.lastStat );
+	case STAT_ART_FOLLOWS:
+	    res = retrieveAndStoreArt( msgId, ++(*artcnt), artmax );
+	    break;
+
+	case STAT_PROGRAM_FAULT:
 	    res = FALSE;
+	    /* Fall through */
+
+	default:
+            retrievingFailed( msgId, client.lastStat );
+	    break;
 	}
-        else
-	    res = retrieveAndStoreArt( msgId, ++(*artcnt), artmax );
     }
     del_DynStr( s );
     Lock_openDatabases();
--- a/src/lock.c	Thu May 10 17:07:46 2001 +0100
+++ b/src/lock.c	Tue May 15 13:07:53 2001 +0100
@@ -1,7 +1,7 @@
 /*
   lock.c
 
-  $Id: lock.c 260 2001-02-25 23:29:50Z bears $
+  $Id: lock.c 292 2001-05-15 12:07:53Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -233,9 +233,13 @@
 {
     UNUSED( sig );
 
+    /*
+     * If we hold the lock right now, flag it to be released next close.
+     * Otherwise, if we are holding it lazily, release it.
+     */
     if ( globalLock.lazyLockBusy )
 	globalLock.lazyClose = FALSE;
-    else
+    else if ( gotLock( &globalLock ) )
 	closeDatabases();
     return;
 }
@@ -280,7 +284,7 @@
     blockSignal( FALSE );
 }
 
-/* Sync al databases to disc. Maintain global lock status. */
+/* Sync all databases to disc. Maintain global lock status. */
 void
 Lock_syncDatabases( void )
 {