Mercurial > hg > mlmmj
changeset 154:58e5a553a6a0
Simply close socket if error in transmission
author | mmj |
---|---|
date | Thu, 03 Jun 2004 07:52:48 +1000 |
parents | 1c3083e7acfa |
children | f844a6213c62 |
files | src/mlmmj-send.c |
diffstat | 1 files changed, 15 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mlmmj-send.c Thu Jun 03 07:50:40 2004 +1000 +++ b/src/mlmmj-send.c Thu Jun 03 07:52:48 2004 +1000 @@ -530,14 +530,18 @@ break; case '2': /* Moderators */ initsmtp(&sockfd, relayhost); - send_mail_many(sockfd, bounceaddr, NULL, mailfile, subfile, - NULL, NULL, listdir, NULL); + if(send_mail_many(sockfd, bounceaddr, NULL, mailfile, subfile, + NULL, NULL, listdir, NULL)) + close(sockfd); + else endsmtp(&sockfd); break; case '3': /* resending earlier failed mails */ initsmtp(&sockfd, relayhost); - send_mail_many(sockfd, NULL, NULL, mailfile, subfile, - listaddr, mailfilename, listdir, mlmmjbounce); + if(send_mail_many(sockfd, NULL, NULL, mailfile, subfile, + listaddr, mailfilename, listdir, mlmmjbounce)) + close(sockfd); + else endsmtp(&sockfd); unlink(subfilename); break; @@ -568,9 +572,11 @@ free(subfilename); initsmtp(&sockfd, relayhost); - send_mail_many(sockfd, NULL, NULL, mailfile, subfile, + if(send_mail_many(sockfd, NULL, NULL, mailfile, subfile, listaddr, archivefilename, listdir, - mlmmjbounce); + mlmmjbounce)) + close(sockfd); + else endsmtp(&sockfd); fclose(subfile); }