mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 23:51:59 +01:00
remove stale files if the smtp connection timed out
This commit is contained in:
parent
ad62822658
commit
19784163be
@ -83,11 +83,6 @@ int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg){
|
||||
memcpy(last2buf+prevlen, puf, MAXBUFSIZE);
|
||||
|
||||
|
||||
/*if(sdata.hdr_len == 0){
|
||||
sdata.hdr_len = searchStringInBuffer(last2buf, 2*MAXBUFSIZE+1, "\n\r\n", 3);
|
||||
if(sdata.hdr_len == 0) searchStringInBuffer(last2buf, 2*MAXBUFSIZE+1, "\n\n", 2);
|
||||
}*/
|
||||
|
||||
pos = searchStringInBuffer(last2buf, 2*MAXBUFSIZE+1, SMTP_CMD_PERIOD, 5);
|
||||
if(pos > 0){
|
||||
|
||||
@ -455,6 +450,15 @@ AFTER_PERIOD:
|
||||
send(new_sd, buf, strlen(buf), 0);
|
||||
if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: sent: %s", sdata.ttmpfile, buf);
|
||||
|
||||
if(sdata.fd != -1){
|
||||
|
||||
syslog(LOG_PRIORITY, "%s: removing stale files: %s, %s", sdata.ttmpfile, sdata.ttmpfile, sdata.tmpframe);
|
||||
|
||||
close(sdata.fd);
|
||||
unlink(sdata.ttmpfile);
|
||||
unlink(sdata.tmpframe);
|
||||
}
|
||||
|
||||
goto QUITTING;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user