Scott McDermott on Tue 4/12 23:29 -0500:
> > If you want to take a look at what I had, here you go...if you
> > finish fixing it please let me know...
>
> it seems the patch did not make it through. Strange, let me try
> again.
I think something is eating attachments. It sure ain't our systems.
Here is the text.
diff -ur qpopper4.0.3/popper/pop_cache.c qpopper4.0.3-local/popper/pop_cache.c
--- qpopper4.0.3/popper/pop_cache.c Tue Apr 3 20:23:29 2001
+++ qpopper4.0.3-local/popper/pop_cache.c Wed Jun 6 00:20:47 2001
@@ -367,6 +367,14 @@
return POP_FAILURE;
}
+ /*
+ * NOTE: below comment is not implemented yet; if the above check
+ * fails we fall out of server mode and cause a full re-parse in
+ * pop_dropcopy(). Otherwise we still use the cache when there
+ * are no changes, which should still give significant performance
+ * advantage for the usual case of frequent checks when there is
+ * no additional mail from the last check.
+ */
/*
* Now we know that the cache information is probably compatible
diff -ur qpopper4.0.3/popper/pop_config.c qpopper4.0.3-local/popper/pop_config.c
--- qpopper4.0.3/popper/pop_config.c Fri Jun 1 22:24:33 2001
+++ qpopper4.0.3-local/popper/pop_config.c Tue Jun 5 15:26:16 2001
@@ -5,6 +5,9 @@
*
* Revisions:
*
+ * 06/04/01 [[EMAIL PROTECTED]]
+ * - Added 'full-session-lock' Boolean option.
+ *
* 06/01/01 [RCG]
* - Added 'uw-kludge' as synonym for 'uw-kluge'.
*
@@ -217,6 +220,7 @@
kLOG_FACILITY, /* -y facility */
kLOG_LOGIN, /* (no flag) */
kMAXBULLS, /* (no flag) */
+ kFULL_SESSION_LOCK, /* (no flag) */
LAST_OPT_VAL
@@ -248,6 +252,7 @@
{ "downcase-user" , CfgBool , CfgResUser, kDCASEUSER },
{ "drac-host" , CfgStr , CfgResNone, kDRACHOST },
{ "fast-update" , CfgBool , CfgResNone, kFASTUPDATE },
+ { "full-session-lock" , CfgBool , CfgResUser, kFULL_SESSION_LOCK },
{ "group-bulletins" , CfgBool , CfgResUser, kGROUP_BULLS },
{ "group-no-server-mode" , CfgStr , CfgResUser, kGRP_NO_SERV_MODE },
{ "group-server-mode" , CfgStr , CfgResUser, kGRP_SERV_MODE },
@@ -882,6 +887,7 @@
case kLOG_FACILITY: R__MNM ( &p->log_facility );
case kLOG_LOGIN: R__PTR ( &p->pLog_login );
case kMAXBULLS: R__INT ( &p->nMaxBulls );
+ case kFULL_SESSION_LOCK: R__BOO ( &p->bFullSessionLock );
default: R__PTR ( NULL );
} /* switch ( item ) */
diff -ur qpopper4.0.3/popper/pop_dropcopy.c qpopper4.0.3-local/popper/pop_dropcopy.c
--- qpopper4.0.3/popper/pop_dropcopy.c Fri Jun 1 22:24:34 2001
+++ qpopper4.0.3-local/popper/pop_dropcopy.c Tue Jun 5 17:54:07 2001
@@ -6,6 +6,13 @@
*
* Revisions:
*
+ * 06/05/01 [[EMAIL PROTECTED]]
+ * - new option bFullSessionLock that, when set, causes the drop lock
+ * to continue to be held after exiting pop_dropcopy() (when in
+ * server mode). Idea is to surround the whole session with the
+ * lock up until update completes and avoid the chance of mail spool
+ * corruption by shell users, while still using server mode.
+ *
* 03/09/01 [rcg]
* - Now including continuation of UIDL headers in UIDL hash.
* - Don't include random component of extra headers in UIDL
@@ -1806,7 +1813,7 @@
Qmailunlock ( HERE );
- if ( p->server_mode )
+ if ( p->server_mode && p->bFullSessionLock == FALSE )
flock ( mfd, LOCK_UN );
if ( p->bDo_timing )
diff -ur qpopper4.0.3/popper/pop_updt.c qpopper4.0.3-local/popper/pop_updt.c
--- qpopper4.0.3/popper/pop_updt.c Tue Apr 3 20:23:39 2001
+++ qpopper4.0.3-local/popper/pop_updt.c Tue Jun 5 17:55:35 2001
@@ -5,6 +5,11 @@
*
* Revisions:
*
+ * 01/06/05 [[EMAIL PROTECTED]]
+ * - don't try to relock the drop for updating when in server mode and
+ * p->bFullSessionLock is used (we never dropped the lock in the
+ * first place)
+ *
* 01/31/01 [rcg]
* - No longer hiding messages deleted in prior aborted session
* when '--disable-update-abort' set.
@@ -381,16 +386,20 @@
}
/*
- * Lock the user's real mail drop
+ * Lock the user's real mail drop; if we are in server mode and
+ * full-session-lock option has been used, then the lock still exists on
+ * mfd.
*/
- while ( flock ( mfd, LOCK_EX ) == -1 && retrycnt++ < 4 )
- sleep ( retrycnt * 5 );
- if ( retrycnt == 4 ) {
- fclose ( (p->server_mode) ? p->drop : md );
- Qmailunlock ( HERE );
- return pop_msg ( p, POP_FAILURE, HERE, "flock: '%s': %s (%d)",
- p->drop_name,
- STRERROR(errno), errno );
+ if (!(p->server_mode == TRUE && p->bFullSessionLock == TRUE)) {
+ while ( flock ( mfd, LOCK_EX ) == -1 && retrycnt++ < 4 )
+ sleep ( retrycnt * 5 );
+ if ( retrycnt == 4 ) {
+ fclose ( (p->server_mode) ? p->drop : md );
+ Qmailunlock ( HERE );
+ return pop_msg ( p, POP_FAILURE, HERE, "flock: '%s': %s (%d)",
+ p->drop_name,
+ STRERROR(errno), errno );
+ }
}
if ( p->server_mode == FALSE ) {
diff -ur qpopper4.0.3/popper/popper.h qpopper4.0.3-local/popper/popper.h
--- qpopper4.0.3/popper/popper.h Fri Jun 1 22:24:36 2001
+++ qpopper4.0.3-local/popper/popper.h Tue Jun 5 20:08:37 2001
@@ -682,6 +682,7 @@
BOOL bNo_atomic_open; /* open() isn't automic. */
log_facility_type log_facility; /* Which log facility to use */
char *pLog_login; /* String to use when logging log-ins
*/
+ BOOL bFullSessionLock; /* lock spool for whole session or
+just dropcopy and updt */
};