summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-10-08 01:04:27 +0000
committerStef Walter <stef@memberwebs.com>2004-10-08 01:04:27 +0000
commitf9bd5f80131da43080e0f64405167599949c7ea9 (patch)
tree5596a1f836f03fbed8f8721d58aec2f962e27de9
parent296ae6560f61a05b022a53e8090cd7acf349419c (diff)
Keep end of logline
-rw-r--r--ChangeLog2
-rw-r--r--common/smtppass.c26
-rw-r--r--configure.in4
3 files changed, 23 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a464684..9dd0288 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
- Fixed problem when filtering the last of a list of EHLO responses
- Send NOOPs to the server when receiving data slowly from client
to prevent timeouts on the server side.
+ - Made the log line always keep the status, rather than dropping of
+ the end in the case of many recipeints.
0.9.5
- Fixed problems with the select zeroing out timeouts.
diff --git a/common/smtppass.c b/common/smtppass.c
index 9e50c55..e00f7a1 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -1090,23 +1090,35 @@ static const char* get_successful_rsp(const char* line, int* cont)
void sp_add_log(spctx_t* ctx, char* prefix, char* line)
{
- int l = SP_LINE_LENGTH;
char* t = ctx->logline;
+ int l = strlen(t);
+ int x;
- ASSERT(l >= 0);
+ ASSERT(l <= SP_LINE_LENGTH);
- if(t[0] != 0)
- strlcat(ctx->logline, ", ", l);
+ /* Add up necessary lengths */
+ x = 2 + strlen(prefix) + strlen(line) + 1;
- strlcat(ctx->logline, prefix, l);
+ if(l + x >= SP_LINE_LENGTH)
+ l = SP_LINE_LENGTH - x;
+
+ t += l;
+ l = SP_LINE_LENGTH - l;
+
+ *t = 0;
+
+ if(ctx->logline[0] != 0)
+ strlcat(t, ", ", l);
+
+ strlcat(t, prefix, l);
/* Skip initial white space */
line = trim_start(line);
- strlcat(ctx->logline, line, l);
+ strlcat(t, line, l);
/* Skip later white space */
- trim_end(ctx->logline);
+ trim_end(t);
}
int sp_read_data(spctx_t* ctx, const char** data)
diff --git a/configure.in b/configure.in
index 7c612c8..537f53b 100644
--- a/configure.in
+++ b/configure.in
@@ -36,8 +36,8 @@ dnl Nate Nielsen <nielsen@memberwebs.com>
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(clamsmtp, 0.9.5.91, nielsen@memberwebs.com)
-AM_INIT_AUTOMAKE(clamsmtp, 0.9.5.91)
+AC_INIT(clamsmtp, 0.9.5.92, nielsen@memberwebs.com)
+AM_INIT_AUTOMAKE(clamsmtp, 0.9.5.92)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include"