Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
c8dc8cd7
Commit
c8dc8cd7
authored
16 years ago
by
steve-e
Browse files
Options
Downloads
Patches
Plain Diff
Fix a potential traceback in onreceive() of NonBlockingTransport. A few more codingstandards
parent
6080bea6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/xmpp/bosh.py
+1
-1
1 addition, 1 deletion
src/common/xmpp/bosh.py
src/common/xmpp/transports_nb.py
+8
-6
8 additions, 6 deletions
src/common/xmpp/transports_nb.py
with
9 additions
and
7 deletions
src/common/xmpp/bosh.py
+
1
−
1
View file @
c8dc8cd7
...
@@ -104,7 +104,7 @@ class NonBlockingBOSH(NonBlockingTransport):
...
@@ -104,7 +104,7 @@ class NonBlockingBOSH(NonBlockingTransport):
self
.
after_init
=
True
self
.
after_init
=
True
self
.
http_socks
.
append
(
self
.
get_new_http_socket
())
self
.
http_socks
.
append
(
self
.
get_new_http_socket
())
self
.
tcp_connecting_started
()
self
.
_
tcp_connecting_started
()
self
.
http_socks
[
0
].
connect
(
self
.
http_socks
[
0
].
connect
(
conn_5tuple
=
conn_5tuple
,
conn_5tuple
=
conn_5tuple
,
...
...
This diff is collapsed.
Click to expand it.
src/common/xmpp/transports_nb.py
+
8
−
6
View file @
c8dc8cd7
...
@@ -200,7 +200,7 @@ class NonBlockingTransport(PlugIn):
...
@@ -200,7 +200,7 @@ class NonBlockingTransport(PlugIn):
Do not confuse it with on_receive() method, which is the callback itself.
Do not confuse it with on_receive() method, which is the callback itself.
'''
'''
if
not
recv_handler
:
if
not
recv_handler
:
if
hasattr
(
self
.
_owner
,
'
Dispatcher
'
):
if
hasattr
(
self
,
'
_owner
'
)
and
hasattr
(
self
.
_owner
,
'
Dispatcher
'
):
self
.
on_receive
=
self
.
_owner
.
Dispatcher
.
ProcessNonBlocking
self
.
on_receive
=
self
.
_owner
.
Dispatcher
.
ProcessNonBlocking
else
:
else
:
log
.
warning
(
'
No Dispatcher plugged. Received data will not be processed
'
)
log
.
warning
(
'
No Dispatcher plugged. Received data will not be processed
'
)
...
@@ -208,7 +208,7 @@ class NonBlockingTransport(PlugIn):
...
@@ -208,7 +208,7 @@ class NonBlockingTransport(PlugIn):
return
return
self
.
on_receive
=
recv_handler
self
.
on_receive
=
recv_handler
def
tcp_connecting_started
(
self
):
def
_
tcp_connecting_started
(
self
):
self
.
set_state
(
CONNECTING
)
self
.
set_state
(
CONNECTING
)
def
read_timeout
(
self
):
def
read_timeout
(
self
):
...
@@ -313,7 +313,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
...
@@ -313,7 +313,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
# connecting in progress
# connecting in progress
log
.
info
(
'
After NB connect() of %s.
"
%s
"
raised => CONNECTING
'
%
log
.
info
(
'
After NB connect() of %s.
"
%s
"
raised => CONNECTING
'
%
(
id
(
self
),
errstr
))
(
id
(
self
),
errstr
))
self
.
tcp_connecting_started
()
self
.
_
tcp_connecting_started
()
return
return
# if there was some other exception, call failure callback and unplug
# if there was some other exception, call failure callback and unplug
...
@@ -397,7 +397,8 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
...
@@ -397,7 +397,8 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
return
return
self
.
set_state
(
DISCONNECTED
)
self
.
set_state
(
DISCONNECTED
)
self
.
idlequeue
.
unplug_idle
(
self
.
fd
)
self
.
idlequeue
.
unplug_idle
(
self
.
fd
)
if
'
NonBlockingTLS
'
in
self
.
__dict__
:
self
.
NonBlockingTLS
.
PlugOut
()
if
'
NonBlockingTLS
'
in
self
.
__dict__
:
self
.
NonBlockingTLS
.
PlugOut
()
try
:
try
:
self
.
_sock
.
shutdown
(
socket
.
SHUT_RDWR
)
self
.
_sock
.
shutdown
(
socket
.
SHUT_RDWR
)
self
.
_sock
.
close
()
self
.
_sock
.
close
()
...
@@ -513,7 +514,8 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
...
@@ -513,7 +514,8 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
exc_info
=
True
)
exc_info
=
True
)
errnum
,
errstr
=
e
.
exc
errnum
,
errstr
=
e
.
exc
if
received
==
''
:
errstr
=
'
zero bytes on recv
'
if
received
==
''
:
errstr
=
'
zero bytes on recv
'
if
(
self
.
ssl_lib
is
None
and
received
==
''
)
or
\
if
(
self
.
ssl_lib
is
None
and
received
==
''
)
or
\
(
self
.
ssl_lib
==
tls_nb
.
PYSTDLIB
and
errnum
==
8
)
or
\
(
self
.
ssl_lib
==
tls_nb
.
PYSTDLIB
and
errnum
==
8
)
or
\
...
@@ -563,7 +565,7 @@ class NonBlockingHTTP(NonBlockingTCP):
...
@@ -563,7 +565,7 @@ class NonBlockingHTTP(NonBlockingTCP):
def
__init__
(
self
,
raise_event
,
on_disconnect
,
idlequeue
,
estabilish_tls
,
def
__init__
(
self
,
raise_event
,
on_disconnect
,
idlequeue
,
estabilish_tls
,
certs
,
on_http_request_possible
,
on_persistent_fallback
,
http_dict
,
certs
,
on_http_request_possible
,
on_persistent_fallback
,
http_dict
,
proxy_dict
=
None
):
proxy_dict
=
None
):
'''
'''
:param on_http_request_possible: method to call when HTTP request to
:param on_http_request_possible: method to call when HTTP request to
socket owned by transport is possible.
socket owned by transport is possible.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment