Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sshpeer.py @ 36841:46f4d71ed505
sshpeer: check pipe validity before forwarding output from it
After the previous fix, fileobjectproxy._observedcall() (called when
win32.peekpipe() accesses .fileno) started exploding. With this fix, similar
checks are needed inside debugwireproto(). Since that is hardcoded to not use
os.devnull, IDK if those are worth fixing.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 10 Mar 2018 12:45:10 -0500 |
parents | 70415568ea65 |
children | a8a902d7176e |
comparison
equal
deleted
inserted
replaced
36840:6bdea0efdab5 | 36841:46f4d71ed505 |
---|---|
30 | 30 |
31 def _forwardoutput(ui, pipe): | 31 def _forwardoutput(ui, pipe): |
32 """display all data currently available on pipe as remote output. | 32 """display all data currently available on pipe as remote output. |
33 | 33 |
34 This is non blocking.""" | 34 This is non blocking.""" |
35 s = util.readpipe(pipe) | 35 if pipe: |
36 if s: | 36 s = util.readpipe(pipe) |
37 for l in s.splitlines(): | 37 if s: |
38 ui.status(_("remote: "), l, '\n') | 38 for l in s.splitlines(): |
39 ui.status(_("remote: "), l, '\n') | |
39 | 40 |
40 class doublepipe(object): | 41 class doublepipe(object): |
41 """Operate a side-channel pipe in addition of a main one | 42 """Operate a side-channel pipe in addition of a main one |
42 | 43 |
43 The side-channel pipe contains server output to be forwarded to the user | 44 The side-channel pipe contains server output to be forwarded to the user |