##// 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 def _calltwowaystream(self, cmd, fp, **args):
215 def _calltwowaystream(self, cmd, fp, **args):
216 fh = None
216 fh = None
217 fp_ = None
217 filename = None
218 filename = None
218 try:
219 try:
219 # dump bundle to disk
220 # dump bundle to disk
@@ -225,10 +226,12 b' class httppeer(wireproto.wirepeer):'
225 d = fp.read(4096)
226 d = fp.read(4096)
226 fh.close()
227 fh.close()
227 # start http push
228 # start http push
228 fp = httpconnection.httpsendfile(self.ui, filename, "rb")
229 fp_ = httpconnection.httpsendfile(self.ui, filename, "rb")
229 headers = {'Content-Type': 'application/mercurial-0.1'}
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 finally:
232 finally:
233 if fp_ is not None:
234 fp_.close()
232 if fh is not None:
235 if fh is not None:
233 fh.close()
236 fh.close()
234 os.unlink(filename)
237 os.unlink(filename)
General Comments 0
You need to be logged in to leave comments. Login now