src: bdat fix

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2017-08-30 20:46:39 +02:00
parent 64056bdc73
commit b2c372b0fe
3 changed files with 5 additions and 3 deletions

View File

@ -66,7 +66,7 @@ void process_bdat(struct smtp_session *session, char *readbuf, int readlen){
if(readlen <= 0) return;
if(session->bdat_rounds == 1){
if(session->bdat_rounds == 1 && session->fd == -1){
session->fd = open(session->ttmpfile, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP);
if(session->fd == -1){
syslog(LOG_PRIORITY, "%s: %s", ERR_OPEN_TMP_FILE, session->ttmpfile);

View File

@ -9,9 +9,9 @@
#include "piler-config.h"
#include "params.h"
#define VERSION "1.3.0-epoll"
#define VERSION "1.3.1-epoll"
#define BUILD 979
#define BUILD 980
#define HOSTID "mailarchiver"

View File

@ -118,6 +118,8 @@ void init_smtp_session(struct smtp_session *session, int slot, int sd, struct co
session->net.ctx = NULL;
session->net.ssl = NULL;
session->fd = -1;
memset(session->buf, 0, SMALLBUFSIZE);
memset(session->remote_host, 0, INET6_ADDRSTRLEN);