dsi->flags &= ~DSI_RECONSOCKET;
continue;
}
- /* Some error on the client connection, enter disconnected state */
- if (dsi_disconnect(dsi) != 0)
- afp_dsi_die(EXITERR_CLNT);
/* the client sometimes logs out (afp_logout) but doesn't close the DSI session */
if (dsi->flags & DSI_AFP_LOGGED_OUT) {
+ LOG(log_note, logtype_afpd, "afp_over_dsi: client logged out, terminating DSI session");
afp_dsi_close(obj);
exit(0);
}
+ /* got ECONNRESET in read from client => exit*/
+ if (dsi->flags & DSI_GOT_ECONNRESET) {
+ LOG(log_note, logtype_afpd, "afp_over_dsi: client connection reset");
+ afp_dsi_close(obj);
+ exit(0);
+ }
+
+ /* Some error on the client connection, enter disconnected state */
+ if (dsi_disconnect(dsi) != 0)
+ afp_dsi_die(EXITERR_CLNT);
+
pause(); /* gets interrupted by SIGALARM or SIGURG tickle */
continue; /* continue receiving until disconnect timer expires
* or a primary reconnect succeeds */
#define DSI_RECONSOCKET (1 << 7) /* we have a new socket from primary reconnect */
#define DSI_RECONINPROG (1 << 8) /* used in the new session in reconnect */
#define DSI_AFP_LOGGED_OUT (1 << 9) /* client called afp_logout, quit on next EOF from socket */
+#define DSI_GOT_ECONNRESET (1 << 10) /* got ECONNRESET from client => exit */
/* basic initialization: dsi_init.c */
extern DSI *dsi_init (const dsi_proto /*protocol*/,
stored += len;
} else { /* eof or error */
/* don't log EOF error if it's just after connect (OSX 10.3 probe) */
+ if (errno == ECONNRESET)
+ dsi->flags |= DSI_GOT_ECONNRESET;
if (len || stored || dsi->read_count) {
if (! (dsi->flags & DSI_DISCONNECTED)) {
LOG(log_error, logtype_dsi, "dsi_stream_read: len:%d, %s",