git ssb

0+

cel / pull-git-remote-helper



Commit 4a9d5400daada5adb7d75ff284f609121cff1cdb

Close stream cleanly on fetch while up-to-date

Fix %ZK8LSxtNB63OwOR4/73anKV44ObqqE9aWjiRgqVLi8s=.sha256 "socket closed" error
Charles Lehner committed on 7/13/2016, 1:45:19 PM
Parent: d057f150341d53094347e3a42383c9fe8942cab6

Files changed

index.jschanged
index.jsView
@@ -70,8 +70,9 @@
7070 var commonHash
7171 var sendPack
7272 var wants = {}
7373 var shallows = {}
74+ var aborted
7475
7576 // Packfile negotiation
7677 return cat([
7778 pktLine.encode(cat([
@@ -83,9 +84,9 @@
8384
8485 // read upload request (wants list) from client
8586 var readWant = lines.wants()
8687 readWant(null, function (end, want) {
87- if (end === true) return cb(true) // early client disconnect
88+ if (end === true) return cb(aborted = true) // early client disconnect
8889 else if (end) cb(end)
8990 else nextWant(null, want)
9091 })
9192 function nextWant(end, want) {
@@ -130,9 +131,9 @@
130131 },
131132 ])),
132133
133134 function havesDone(abort, cb) {
134- if (abort) return cb(abort)
135+ if (abort || aborted) return cb(abort || aborted)
135136 // send pack file to client
136137 if (sendPack)
137138 return sendPack(abort, cb)
138139 getObjects(repo, commonHash, wants, shallows,

Built with git-ssb-web