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
58705bbb
Commit
58705bbb
authored
19 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
patch from Alexey: new function: SendAndCallForResponse.
It will help in resolving locking problems
parent
e4692d22
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/auth.py
+1
-1
1 addition, 1 deletion
src/common/xmpp/auth.py
src/common/xmpp/dispatcher.py
+17
-4
17 additions, 4 deletions
src/common/xmpp/dispatcher.py
with
18 additions
and
5 deletions
src/common/xmpp/auth.py
+
1
−
1
View file @
58705bbb
...
...
@@ -12,7 +12,7 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
# $Id: auth.py,v 1.2
7
2005/0
4/30 10:17:20
snakeru Exp $
# $Id: auth.py,v 1.2
8
2005/0
5/07 02:42:04
snakeru Exp $
"""
Provides library with all Non-SASL and SASL authentication mechanisms.
...
...
This diff is collapsed.
Click to expand it.
src/common/xmpp/dispatcher.py
+
17
−
4
View file @
58705bbb
...
...
@@ -12,7 +12,7 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
# $Id: dispatcher.py,v 1.3
4
2005/05/0
2
0
8:3
6:
4
1 snakeru Exp $
# $Id: dispatcher.py,v 1.3
5
2005/05/0
7
0
3:2
6:
5
1 snakeru Exp $
"""
Main xmpppy mechanism. Provides library with methods to assign different handlers
...
...
@@ -44,7 +44,8 @@ class Dispatcher(PlugIn):
self
.
_exported_methods
=
[
self
.
Process
,
self
.
RegisterHandler
,
self
.
RegisterDefaultHandler
,
\
self
.
RegisterEventHandler
,
self
.
UnregisterCycleHandler
,
self
.
RegisterCycleHandler
,
\
self
.
RegisterHandlerOnce
,
self
.
UnregisterHandler
,
self
.
RegisterProtocol
,
\
self
.
WaitForResponse
,
self
.
SendAndWaitForResponse
,
self
.
send
,
self
.
disconnect
]
self
.
WaitForResponse
,
self
.
SendAndWaitForResponse
,
self
.
send
,
self
.
disconnect
,
\
self
.
SendAndCallForResponse
,
]
def
dumpHandlers
(
self
):
"""
Return set of user-registered callbacks in it
'
s internal format.
...
...
@@ -266,9 +267,16 @@ class Dispatcher(PlugIn):
output
=
''
if
session
.
_expected
.
has_key
(
ID
):
session
.
_expected
[
ID
]
=
stanza
user
=
0
session
.
DEBUG
(
"
Expected stanza arrived!
"
,
'
ok
'
)
if
type
(
session
.
_expected
[
ID
])
==
type
(()):
cb
,
args
=
session
.
_expected
[
ID
]
session
.
DEBUG
(
"
Expected stanza arrived. Callback %s(%s) found!
"
%
(
cb
,
args
),
'
ok
'
)
try
:
cb
(
session
,
stanza
,
**
args
)
except
Exception
,
typ
:
if
typ
.
__class__
.
__name__
<>
'
NodeProcessed
'
:
raise
else
:
session
.
DEBUG
(
"
Expected stanza arrived!
"
,
'
ok
'
)
session
.
_expected
[
ID
]
=
stanza
else
:
user
=
1
for
handler
in
chain
:
if
user
or
handler
[
'
system
'
]:
...
...
@@ -307,6 +315,11 @@ class Dispatcher(PlugIn):
"""
Put stanza on the wire and wait for recipient
'
s response to it.
"""
return
self
.
WaitForResponse
(
self
.
send
(
stanza
),
timeout
)
def
SendAndCallForResponse
(
self
,
stanza
,
func
,
args
=
{}):
"""
Put stanza on the wire and call back when recipient replies.
Additional callback arguments can be specified in args.
"""
self
.
_expected
[
self
.
send
(
stanza
)]
=
(
func
,
args
)
def
send
(
self
,
stanza
):
"""
Serialise stanza and put it on the wire. Assign an unique ID to it before send.
Returns assigned ID.
"""
...
...
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