mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 10:03:43 +00:00
Merge pull request #3983 from pks-t/pks/smart-early-eof
transports: smart: abort on early end of stream
This commit is contained in:
commit
cc5966b071
@ -19,7 +19,7 @@ typedef enum {
|
|||||||
/**
|
/**
|
||||||
* Do not attempt to connect through a proxy
|
* Do not attempt to connect through a proxy
|
||||||
*
|
*
|
||||||
* If built against lbicurl, it itself may attempt to connect
|
* If built against libcurl, it itself may attempt to connect
|
||||||
* to a proxy if the environment variables specify it.
|
* to a proxy if the environment variables specify it.
|
||||||
*/
|
*/
|
||||||
GIT_PROXY_NONE,
|
GIT_PROXY_NONE,
|
||||||
|
@ -50,7 +50,7 @@ int git_smart__store_refs(transport_smart *t, int flushes)
|
|||||||
if ((recvd = gitno_recv(buf)) < 0)
|
if ((recvd = gitno_recv(buf)) < 0)
|
||||||
return recvd;
|
return recvd;
|
||||||
|
|
||||||
if (recvd == 0 && !flush) {
|
if (recvd == 0) {
|
||||||
giterr_set(GITERR_NET, "early EOF");
|
giterr_set(GITERR_NET, "early EOF");
|
||||||
return GIT_EEOF;
|
return GIT_EEOF;
|
||||||
}
|
}
|
||||||
@ -222,8 +222,12 @@ static int recv_pkt(git_pkt **out, gitno_buffer *buf)
|
|||||||
if (error < 0 && error != GIT_EBUFS)
|
if (error < 0 && error != GIT_EBUFS)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if ((ret = gitno_recv(buf)) < 0)
|
if ((ret = gitno_recv(buf)) < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
|
} else if (ret == 0) {
|
||||||
|
giterr_set(GITERR_NET, "early EOF");
|
||||||
|
return GIT_EEOF;
|
||||||
|
}
|
||||||
} while (error);
|
} while (error);
|
||||||
|
|
||||||
gitno_consume(buf, line_end);
|
gitno_consume(buf, line_end);
|
||||||
|
Loading…
Reference in New Issue
Block a user