diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index 5db4dda9a..c1e412436 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -222,8 +222,12 @@ static int recv_pkt(git_pkt **out, gitno_buffer *buf) if (error < 0 && error != GIT_EBUFS) return error; - if ((ret = gitno_recv(buf)) < 0) + if ((ret = gitno_recv(buf)) < 0) { return ret; + } else if (ret == 0) { + giterr_set(GITERR_NET, "early EOF"); + return GIT_EEOF; + } } while (error); gitno_consume(buf, line_end);