Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:badshah400:lapack2023:Leap15
python-websockify
u_Fix-inetd-mode-on-python-2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File u_Fix-inetd-mode-on-python-2.patch of Package python-websockify
From 7b382d043e9b85fab2fcddf46a54d19bbd4d601c Mon Sep 17 00:00:00 2001 From: Michal Srb <msrb@suse.com> Date: Tue, 1 Aug 2017 15:35:34 +0200 Subject: [PATCH] Fix inetd mode on Python 2. In python 2 the ssl.wrap_socket doesn't work on sockets created using socket.fromfd. The workaround is to wrap the socket returned by socket.fromfd into another socket object using the private _sock constructor parameter. --- websockify/websockifyserver.py | 4 ++++ 1 file changed, 4 insertions(+) Index: websockify-0.8.0/websockify/websocket.py =================================================================== --- websockify-0.8.0.orig/websockify/websocket.py +++ websockify-0.8.0/websockify/websocket.py @@ -972,6 +972,10 @@ class WebSocketServer(object): if self.listen_fd != None: lsock = socket.fromfd(self.listen_fd, socket.AF_INET, socket.SOCK_STREAM) + if sys.hexversion < 0x3000000: + # For python 2 we have to wrap the "raw" socket into a socket object, + # otherwise ssl wrap_socket doesn't work. + lsock = socket.socket(_sock=lsock) else: lsock = self.socket(self.listen_host, self.listen_port, False, self.prefer_ipv6,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor