Skip to content

Commit

Permalink
Handle interactive sessions again
Browse files Browse the repository at this point in the history
Don't know why it broke, but socket handling should now be cleaner
  • Loading branch information
MarcelWaldvogel committed Sep 19, 2019
1 parent 6a62dbc commit 4f77d65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
* Handle empty roster information
* Handle interactive sessions again

### Changed

Expand Down
10 changes: 4 additions & 6 deletions xclib/authops.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ def perform(args):
# Single socket; unclear whether it is connected or an acceptor
try:
stdinfd = sys.stdin.fileno()
except io.UnsupportedOperation:
stdinfd = None
if stdinfd is None:
# Not a real socket, assume stdio communication
perform_from_fd(sys.stdin, sys.stdout, xc, args.type)
else:
# Is it a socket?
s = socket.socket(fileno=stdinfd)
try:
# Is it an acceptor socket?
Expand All @@ -110,6 +105,9 @@ def perform(args):
except OSError:
# Not an acceptor socket, use for stdio
perform_from_fd(sys.stdin, sys.stdout, xc, args.type, closefds=(sys.stdin,sys.stdout,s))
except (io.UnsupportedOperation, OSError):
# Not a real socket, assume stdio communication
perform_from_fd(sys.stdin, sys.stdout, xc, args.type)
else:
# Uses systemd socket activation
perform_from_listeners(listeners, xc, args.type)
Expand Down

0 comments on commit 4f77d65

Please sign in to comment.