summaryrefslogtreecommitdiffstats
path: root/imap/pop3dserver.c
diff options
context:
space:
mode:
authorSam Varshavchik2022-03-05 23:32:10 -0500
committerSam Varshavchik2022-03-06 08:41:58 -0500
commita219cd3c45aa2545a7a641acb277acb5e8be87f9 (patch)
tree4cf5a163ddc15e88a5739dfce2a974edbadb8b9b /imap/pop3dserver.c
parent4c4693e3497b7723446d360a04522de9cee8b063 (diff)
downloadcourier-libs-a219cd3c45aa2545a7a641acb277acb5e8be87f9.tar.bz2
Add additional tests.
Diffstat (limited to 'imap/pop3dserver.c')
-rw-r--r--imap/pop3dserver.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/imap/pop3dserver.c b/imap/pop3dserver.c
index 5e938ad..82a1ec0 100644
--- a/imap/pop3dserver.c
+++ b/imap/pop3dserver.c
@@ -60,6 +60,14 @@
#define POP3DLIST "courierpop3dsizelist"
#define LISTVERSION 3
+#ifndef RUNTIME_START
+#define RUNTIME_START time(NULL)
+#endif
+
+#ifndef RUNTIME_CUR
+#define RUNTIME_CUR time(NULL)
+#endif
+
extern void pop3dcapa();
extern void pop3dlang(const char *);
@@ -190,7 +198,7 @@ static struct msglist **readpop3dlist(unsigned long *uid)
int vernum=0;
unsigned long size;
- uidv=time(NULL);
+ uidv=RUNTIME_CUR;
if (fp == NULL ||
fgets(linebuf, sizeof(linebuf)-1, fp) == NULL ||
@@ -299,6 +307,9 @@ static int savepop3dlist(struct msglist **a, size_t cnt,
struct maildir_tmpcreate_info createInfo;
+#ifdef SAVEHOOK
+ SAVEHOOK();
+#endif
maildir_tmpcreate_init(&createInfo);
createInfo.uniq="pop3";
@@ -488,7 +499,9 @@ static void sortmsgs()
}
if (prev_list[n])
+ {
savesizes=1;
+ }
for (i=0; prev_list[i]; i++)
{
@@ -728,7 +741,7 @@ static void do_retr(unsigned i, unsigned *lptr)
if (msglist_a[i]->isutf8 && !utf8_enabled)
{
- sprintf(boundary, "=_%d-%d", (int)getpid(), (int)time(NULL));
+ sprintf(boundary, "=_%d-%d", (int)getpid(), (int)RUNTIME_CUR);
sprintf(wrapheader, MIMEWRAPTXT, boundary, boundary, boundary,
mime_message_type);
@@ -910,7 +923,7 @@ static void acctout(const char *disc)
libmail_str_size_t(top_count, num1);
libmail_str_size_t(retr_count, num2);
- libmail_str_time_t(time(NULL)-start_time, num3);
+ libmail_str_time_t(RUNTIME_CUR-start_time, num3);
libmail_str_size_t(bytes_received_count, numAR);
libmail_str_size_t(bytes_sent_count, numAS);
@@ -1121,11 +1134,10 @@ char *n;
int main(int argc, char **argv)
{
char *p;
-
#ifdef HAVE_SETVBUF_IOLBF
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
#endif
- time(&start_time);
+ start_time=RUNTIME_START;
if ((authaddr=getenv("AUTHADDR")) == NULL ||
*authaddr == 0)