}
while (!conn->authenticated) {
- if ((line = i_stream_next_line(conn->input)) != NULL) {
+ if ((line = i_stream_next_line(conn->input)) == NULL) {
+ if (conn->input->eof || conn->input->stream_errno != 0) {
+ server_log_disconnect_error(conn);
+ server_connection_destroy(&conn);
+ }
+ return;
+ } else {
/* Allow VERSION before or after the "+" or "-" line,
because v2.2.33 sent the version after and newer
versions send before. */
server_connection_destroy(&conn);
return;
}
- } else {
- if (conn->input->eof || conn->input->stream_errno != 0) {
- server_log_disconnect_error(conn);
- server_connection_destroy(&conn);
- }
- return;
}
}