In si_cs_recv(), report that arrive at the end of stream only if we were
indeed connected, we don't want that if the connection failed and we're about
to retry.
return (cur_read != 0) || si_rx_blocked(si);
out_shutdown_r:
- /* we received a shutdown */
- ic->flags |= CF_READ_NULL;
- if (ic->flags & CF_AUTO_CLOSE)
- channel_shutw_now(ic);
- stream_sock_read0(si);
+ if (conn->flags & CO_FL_CONNECTED) {
+ /* we received a shutdown */
+ ic->flags |= CF_READ_NULL;
+ if (ic->flags & CF_AUTO_CLOSE)
+ channel_shutw_now(ic);
+ stream_sock_read0(si);
+ }
return 1;
}