##// END OF EJS Templates
httppeer: close the temporary bundle file after two-way streaming it...
Matt Harbison -
r23086:cde6904f stable
parent child Browse files
Show More
@@ -214,6 +214,7 b' class httppeer(wireproto.wirepeer):'
214 214
215 215 def _calltwowaystream(self, cmd, fp, **args):
216 216 fh = None
217 fp_ = None
217 218 filename = None
218 219 try:
219 220 # dump bundle to disk
@@ -225,10 +226,12 b' class httppeer(wireproto.wirepeer):'
225 226 d = fp.read(4096)
226 227 fh.close()
227 228 # start http push
228 fp = httpconnection.httpsendfile(self.ui, filename, "rb")
229 fp_ = httpconnection.httpsendfile(self.ui, filename, "rb")
229 230 headers = {'Content-Type': 'application/mercurial-0.1'}
230 return self._callstream(cmd, data=fp, headers=headers, **args)
231 return self._callstream(cmd, data=fp_, headers=headers, **args)
231 232 finally:
233 if fp_ is not None:
234 fp_.close()
232 235 if fh is not None:
233 236 fh.close()
234 237 os.unlink(filename)
General Comments 0
You need to be logged in to leave comments. Login now