Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wspy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
wspy
Commits
8db0a06c
Commit
8db0a06c
authored
Aug 22, 2013
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug where default extension parameters were ignored
parent
4388fc5c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
extension.py
extension.py
+6
-0
handshake.py
handshake.py
+2
-2
No files found.
extension.py
View file @
8db0a06c
...
@@ -23,6 +23,12 @@ class Extension(object):
...
@@ -23,6 +23,12 @@ class Extension(object):
return
'<Extension "%s" defaults=%s request=%s>'
\
return
'<Extension "%s" defaults=%s request=%s>'
\
%
(
self
.
name
,
self
.
defaults
,
self
.
request
)
%
(
self
.
name
,
self
.
defaults
,
self
.
request
)
def
create_hook
(
self
,
**
kwargs
):
params
=
{}
params
.
update
(
self
.
defaults
)
params
.
update
(
kwargs
)
return
self
.
Hook
(
**
params
)
class
Hook
:
class
Hook
:
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
for
param
,
value
in
kwargs
.
iteritems
():
for
param
,
value
in
kwargs
.
iteritems
():
...
...
handshake.py
View file @
8db0a06c
...
@@ -154,7 +154,7 @@ class ServerHandshake(Handshake):
...
@@ -154,7 +154,7 @@ class ServerHandshake(Handshake):
self
.
wsock
.
extensions
=
filter_extensions
(
extensions
)
self
.
wsock
.
extensions
=
filter_extensions
(
extensions
)
for
ext
,
params
in
zip
(
self
.
wsock
.
extensions
,
all_params
):
for
ext
,
params
in
zip
(
self
.
wsock
.
extensions
,
all_params
):
hook
=
ext
.
H
ook
(
**
params
)
hook
=
ext
.
create_h
ook
(
**
params
)
self
.
wsock
.
add_hook
(
send
=
hook
.
send
,
recv
=
hook
.
recv
)
self
.
wsock
.
add_hook
(
send
=
hook
.
send
,
recv
=
hook
.
recv
)
else
:
else
:
self
.
wsock
.
extensions
=
[]
self
.
wsock
.
extensions
=
[]
...
@@ -249,7 +249,7 @@ class ClientHandshake(Handshake):
...
@@ -249,7 +249,7 @@ class ClientHandshake(Handshake):
raise
HandshakeError
(
'server handshake contains '
raise
HandshakeError
(
'server handshake contains '
'unsupported extension "%s"'
%
name
)
'unsupported extension "%s"'
%
name
)
hook
=
supported_ext
[
name
].
H
ook
(
**
params
)
hook
=
supported_ext
[
name
].
create_h
ook
(
**
params
)
self
.
wsock
.
extensions
.
append
(
supported_ext
[
name
])
self
.
wsock
.
extensions
.
append
(
supported_ext
[
name
])
self
.
wsock
.
add_hook
(
send
=
hook
.
send
,
recv
=
hook
.
recv
)
self
.
wsock
.
add_hook
(
send
=
hook
.
send
,
recv
=
hook
.
recv
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment