summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-10-05 16:38:49 +0000
committerStef Walter <stef@memberwebs.com>2004-10-05 16:38:49 +0000
commit296ae6560f61a05b022a53e8090cd7acf349419c (patch)
tree5e8a58b54926e0c5275c51bb2e48027029b507fd /common
parenta6778ed6bf02bc95d5da124b671880e5a1fd5df3 (diff)
Don't send server NOOPs if it closed the connection.
Diffstat (limited to 'common')
-rw-r--r--common/smtppass.c7
-rw-r--r--common/spio.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/common/smtppass.c b/common/smtppass.c
index 8b71f4d..9e50c55 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -1388,8 +1388,11 @@ static int read_server_response(spctx_t* ctx)
static void do_server_noop(spctx_t* ctx)
{
- if(spio_write_data(ctx, &(ctx->server), SMTP_NOOP) != -1)
- spio_read_line(ctx, &(ctx->server), SPIO_DISCARD);
+ if(spio_valid(&(ctx->server)))
+ {
+ if(spio_write_data(ctx, &(ctx->server), SMTP_NOOP) != -1)
+ spio_read_line(ctx, &(ctx->server), SPIO_DISCARD);
+ }
}
void sp_setup_forked(spctx_t* ctx, int file)
diff --git a/common/spio.c b/common/spio.c
index 4075e9a..f3247da 100644
--- a/common/spio.c
+++ b/common/spio.c
@@ -478,7 +478,7 @@ int spio_write_data(spctx_t* ctx, spio_t* io, const char* data)
if(!spio_valid(io))
{
- sp_message(ctx, LOG_ERR, "connection closed. can't write data.");
+ sp_message(ctx, LOG_ERR, "connection closed. can't write data");
return -1;
}