bdat fixes

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-05-13 16:48:20 +02:00
parent a0fb4137a5
commit ac49647fc3
3 changed files with 5 additions and 5 deletions

View File

@ -257,7 +257,7 @@ int main(int argc, char **argv){
if(getnameinfo((struct sockaddr *)&client_address, client_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0){ if(getnameinfo((struct sockaddr *)&client_address, client_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0){
// Strictly speaking it's not correct to log num_connections+1 connections // Strictly speaking it's not correct to log num_connections+1 connections
// but it still gives a good clue how many connections we have at the moment // but it still gives a good clue how many connections we have at the moment
syslog(LOG_PRIORITY, "connected from %s:%s on descriptor %d (active connections: %d)", hbuf, sbuf, client_sockfd, num_connections + 1); syslog(LOG_PRIORITY, "connected from %s:%s on fd=%d (active connections: %d)", hbuf, sbuf, client_sockfd, num_connections + 1);
} }
if(make_socket_non_blocking(client_sockfd) == -1){ if(make_socket_non_blocking(client_sockfd) == -1){

View File

@ -159,7 +159,7 @@ void free_smtp_session(struct smtp_session *session){
void tear_down_session(struct smtp_session **sessions, int slot, int *num_connections){ void tear_down_session(struct smtp_session **sessions, int slot, int *num_connections){
syslog(LOG_PRIORITY, "disconnected from %s on descriptor %d (%d active connections)", sessions[slot]->remote_host, sessions[slot]->net.socket, (*num_connections)-1); syslog(LOG_PRIORITY, "disconnected from %s on fd=%d (%d active connections)", sessions[slot]->remote_host, sessions[slot]->net.socket, (*num_connections)-1);
close(sessions[slot]->net.socket); close(sessions[slot]->net.socket);

View File

@ -18,7 +18,7 @@
void process_smtp_command(struct smtp_session *session, char *buf, struct config *cfg){ void process_smtp_command(struct smtp_session *session, char *buf, struct config *cfg){
char response[SMALLBUFSIZE]; char response[SMALLBUFSIZE];
if(session->cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "processing command (fd: %d): *%s*", session->net.socket, buf); if(session->cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "got on fd=%d: *%s*", session->net.socket, buf);
if(strncasecmp(buf, SMTP_CMD_HELO, strlen(SMTP_CMD_HELO)) == 0){ if(strncasecmp(buf, SMTP_CMD_HELO, strlen(SMTP_CMD_HELO)) == 0){
process_command_helo(session, response, sizeof(response)); process_command_helo(session, response, sizeof(response));
@ -47,7 +47,7 @@ void process_smtp_command(struct smtp_session *session, char *buf, struct config
} }
/* Support only BDAT xxxx LAST command */ /* Support only BDAT xxxx LAST command */
if(session->cfg->enable_chunking == 1 && strncasecmp(buf, SMTP_CMD_BDAT, strlen(SMTP_CMD_BDAT)) == 0 && strncasecmp(buf, "LAST", 4) == 0){ if(session->cfg->enable_chunking == 1 && strncasecmp(buf, SMTP_CMD_BDAT, strlen(SMTP_CMD_BDAT)) == 0 && strcasestr(buf, "LAST")){
get_bdat_size_to_read(session, buf); get_bdat_size_to_read(session, buf);
return; return;
} }
@ -115,7 +115,7 @@ void wait_for_ssl_accept(struct smtp_session *session){
void send_smtp_response(struct smtp_session *session, char *buf){ void send_smtp_response(struct smtp_session *session, char *buf){
write1(&(session->net), buf, strlen(buf)); write1(&(session->net), buf, strlen(buf));
if(session->cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "sent (fd: %d): %s", session->net.socket, buf); if(session->cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "sent on fd=%d: %s", session->net.socket, buf);
} }