aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/sideband/demux.go
diff options
context:
space:
mode:
authorAyman Bagabas <ayman.bagabas@gmail.com>2024-04-26 18:39:34 -0400
committerAyman Bagabas <ayman.bagabas@gmail.com>2024-04-26 18:56:12 -0400
commit59b792bf8a814ad5d7810c51a18e9f618153ace8 (patch)
tree9f64982e8e218f7a29512224d183e9d96eb731fb /plumbing/protocol/packp/sideband/demux.go
parent1ddd78a55f803c9ed0fac6a56d201271fef21eeb (diff)
downloadgo-git-59b792bf8a814ad5d7810c51a18e9f618153ace8.tar.gz
plumbing: fix sideband demux on flush
Canonical Git implementation terminates the sideband stream with a flush. If the demux scanner is not terminated, it can hang the connection. Returns io.EOF when encountering a flush pkt. https://github.com/git/git/blob/master/upload-pack.c#L460
Diffstat (limited to 'plumbing/protocol/packp/sideband/demux.go')
-rw-r--r--plumbing/protocol/packp/sideband/demux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/protocol/packp/sideband/demux.go b/plumbing/protocol/packp/sideband/demux.go
index 0116f96..01d95a3 100644
--- a/plumbing/protocol/packp/sideband/demux.go
+++ b/plumbing/protocol/packp/sideband/demux.go
@@ -114,7 +114,7 @@ func (d *Demuxer) nextPackData() ([]byte, error) {
size := len(content)
if size == 0 {
- return nil, nil
+ return nil, io.EOF
} else if size > d.max {
return nil, ErrMaxPackedExceeded
}