diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2016-07-21 14:38:48 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2016-08-02 16:46:31 +0100 |
commit | e520153e6c5035b99c25e2d6b7530237d9dbfa49 (patch) | |
tree | 02895607f1f22ffd1acca0d2e9511760eaeb7afb | |
parent | 3d50ca302570c24095749bd051cf6c1f4b495c0d (diff) |
tidying: dkim output buffer
-rw-r--r-- | src/src/transport.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/src/transport.c b/src/src/transport.c index 3c1b00501..4675a2c56 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -998,6 +998,7 @@ uschar * dkim_spool_name; int sread = 0; int wwritten = 0; uschar *dkim_signature = NULL; +int siglen; off_t k_file_size; /* If we can't sign, just call the original function. */ @@ -1062,28 +1063,30 @@ if (dkim->dkim_private_key && dkim->dkim_domain && dkim->dkim_selector) } } - if (dkim_signature) + siglen = 0; + } + +if (dkim_signature) + { + siglen = Ustrlen(dkim_signature); + while(siglen > 0) { - int siglen = Ustrlen(dkim_signature); - while(siglen > 0) - { #ifdef SUPPORT_TLS - wwritten = tls_out.active == out_fd - ? tls_write(FALSE, dkim_signature, siglen) - : write(out_fd, dkim_signature, siglen); + wwritten = tls_out.active == out_fd + ? tls_write(FALSE, dkim_signature, siglen) + : write(out_fd, dkim_signature, siglen); #else - wwritten = write(out_fd, dkim_signature, siglen); + wwritten = write(out_fd, dkim_signature, siglen); #endif - if (wwritten == -1) - { - /* error, bail out */ - save_errno = errno; - rc = FALSE; - goto CLEANUP; - } - siglen -= wwritten; - dkim_signature += wwritten; + if (wwritten == -1) + { + /* error, bail out */ + save_errno = errno; + rc = FALSE; + goto CLEANUP; } + siglen -= wwritten; + dkim_signature += wwritten; } } |