mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 02:21:59 +01:00
src: fixing aborted connection handling, mostly from o365
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
20d41eb261
commit
9646225ae9
@ -206,12 +206,17 @@ int main(int argc, char **argv){
|
|||||||
n = epoll_wait(efd, events, cfg.max_connections, -1);
|
n = epoll_wait(efd, events, cfg.max_connections, -1);
|
||||||
for(i=0; i<n; i++){
|
for(i=0; i<n; i++){
|
||||||
|
|
||||||
// The remote side has disconnected without sending QUIT
|
// Office365 sometimes behaves oddly: when it receives the 250 OK
|
||||||
// We log the event only in case of a very high verbosity level
|
// message after sending the email, it doesn't send the QUIT command
|
||||||
// so it won't scare users
|
// rather it aborts the connection
|
||||||
|
|
||||||
if((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN))){
|
if((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) || (!(events[i].events & EPOLLIN))){
|
||||||
if(cfg.verbosity >= _LOG_EXTREME) syslog(LOG_PRIORITY, "ERROR: the remote end hung up without sending QUIT");
|
if(cfg.verbosity >= _LOG_EXTREME) syslog(LOG_PRIORITY, "ERROR: the remote end hung up without sending QUIT");
|
||||||
close(events[i].data.fd);
|
session = get_session_by_socket(sessions, cfg.max_connections, events[i].data.fd);
|
||||||
|
if(session)
|
||||||
|
tear_down_session(sessions, session->slot, &num_connections);
|
||||||
|
else
|
||||||
|
close(events[i].data.fd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user