]> git.proxmox.com Git - libgit2.git/commit - src/transports/smart_protocol.c
transports: smart: abort receiving packets on end of stream
authorPatrick Steinhardt <ps@pks.im>
Wed, 2 Nov 2016 08:38:40 +0000 (09:38 +0100)
committerPatrick Steinhardt <ps@pks.im>
Wed, 2 Nov 2016 08:42:56 +0000 (09:42 +0100)
commit62494bf234919e04a6e145d59942d2a05c96ae0d
tree8f9e28050fd6d93cdb7a3b72b73225c4035af71b
parent61530c497dc23f6140557059ca9a55805c21b5fc
transports: smart: abort receiving packets on end of stream

When trying to receive packets from the remote, we loop until
either an error distinct to `GIT_EBUFS` occurs or until we
successfully parsed the packet. This does not honor the case
where we are looping over an already closed socket which has no
more data, leaving us in an infinite loop if we got a bogus
packet size or if the remote hang up.

Fix the issue by returning `GIT_EEOF` when we cannot read data
from the socket anymore.
src/transports/smart_protocol.c