Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
c4829371
Commit
c4829371
authored
Mar 14, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset signature on server side just before checking modifications, it has no meaning otherwise
parent
b9e543c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
product/ERP5SyncML/Document/SyncMLSubscription.py
product/ERP5SyncML/Document/SyncMLSubscription.py
+4
-1
product/ERP5SyncML/Engine/AsynchronousEngine.py
product/ERP5SyncML/Engine/AsynchronousEngine.py
+7
-0
product/ERP5SyncML/Engine/EngineMixin.py
product/ERP5SyncML/Engine/EngineMixin.py
+0
-5
product/ERP5SyncML/Engine/SynchronousEngine.py
product/ERP5SyncML/Engine/SynchronousEngine.py
+5
-0
No files found.
product/ERP5SyncML/Document/SyncMLSubscription.py
View file @
c4829371
...
@@ -574,7 +574,6 @@ class SyncMLSubscription(XMLObject):
...
@@ -574,7 +574,6 @@ class SyncMLSubscription(XMLObject):
media_type
=
conduit
.
getContentType
())
media_type
=
conduit
.
getContentType
())
elif
signature
.
getValidationState
()
in
(
'not_synchronized'
,
elif
signature
.
getValidationState
()
in
(
'not_synchronized'
,
'synchronized'
,
'conflict_resolved_with_merge'
):
'conflict_resolved_with_merge'
):
# We don't have synchronized this object yet but it has a signature
# We don't have synchronized this object yet but it has a signature
xml_object
=
conduit
.
getXMLFromObjectWithId
(
document
,
xml_object
=
conduit
.
getXMLFromObjectWithId
(
document
,
...
@@ -674,6 +673,10 @@ class SyncMLSubscription(XMLObject):
...
@@ -674,6 +673,10 @@ class SyncMLSubscription(XMLObject):
finished
=
False
finished
=
False
xml_string
=
signature
.
getFirstPdataChunk
(
MAX_LEN
)
xml_string
=
signature
.
getFirstPdataChunk
(
MAX_LEN
)
xml_string
=
etree
.
CDATA
(
xml_string
.
decode
(
'utf-8'
))
xml_string
=
etree
.
CDATA
(
xml_string
.
decode
(
'utf-8'
))
elif
signature
.
getValidationState
()
in
(
'syncing'
,
'synchronized"):
raise ValueError("Must not get signature in %s state here, signature is %s"
% (signature.getValidationState(),
signature.getPath(),))
syncml_response.addSyncCommand(
syncml_response.addSyncCommand(
sync_command=signature.getPartialAction(),
sync_command=signature.getPartialAction(),
...
...
product/ERP5SyncML/Engine/AsynchronousEngine.py
View file @
c4829371
...
@@ -202,9 +202,16 @@ class SyncMLAsynchronousEngine(EngineMixin):
...
@@ -202,9 +202,16 @@ class SyncMLAsynchronousEngine(EngineMixin):
if
syncml_request
.
isFinal
:
if
syncml_request
.
isFinal
:
# Server then sends its modifications
# Server then sends its modifications
subscriber
.
sendModifications
()
subscriber
.
sendModifications
()
# Now that everything is ok, init sync information
if
subscriber
.
getSyncmlAlertCode
()
not
in
(
"one_way_from_client"
,
"refresh_from_client_only"
):
# Reset signature only if we have to check modifications on server side
subscriber
.
initialiseSynchronization
()
# Start to send modification only once we have processed
# Start to send modification only once we have processed
# all message from client
# all message from client
after_method_id
=
'processServerSynchronization'
,
after_method_id
=
'processServerSynchronization'
,
tag
=
(
tag
,
"%s_reset"
%
subscriber
.
getPath
(),)
# Do not continue in elif, as sending modifications is done in the same
# Do not continue in elif, as sending modifications is done in the same
# package as sending notifications
# package as sending notifications
if
subscriber
.
getSynchronizationState
()
==
"sending_modifications"
:
if
subscriber
.
getSynchronizationState
()
==
"sending_modifications"
:
...
...
product/ERP5SyncML/Engine/EngineMixin.py
View file @
c4829371
...
@@ -437,11 +437,6 @@ class EngineMixin(object):
...
@@ -437,11 +437,6 @@ class EngineMixin(object):
last_anchor
=
subscriber
.
getLastAnchor
(),
last_anchor
=
subscriber
.
getLastAnchor
(),
next_anchor
=
subscriber
.
getNextAnchor
())
next_anchor
=
subscriber
.
getNextAnchor
())
# Now that everything is ok, init sync information
if
subscriber
.
getSyncmlAlertCode
()
not
in
(
"one_way_from_client"
,
"refresh_from_client_only"
):
# Reset signature only if we have to check modifications on server side
subscriber
.
initialiseSynchronization
()
# Server get sync commands from client first
# Server get sync commands from client first
subscriber
.
processSyncRequest
()
subscriber
.
processSyncRequest
()
else
:
else
:
...
...
product/ERP5SyncML/Engine/SynchronousEngine.py
View file @
c4829371
...
@@ -182,6 +182,11 @@ class SyncMLSynchronousEngine(EngineMixin):
...
@@ -182,6 +182,11 @@ class SyncMLSynchronousEngine(EngineMixin):
if
syncml_request
.
isFinal
:
if
syncml_request
.
isFinal
:
# Server will now send its modifications
# Server will now send its modifications
subscriber
.
sendModifications
()
subscriber
.
sendModifications
()
if
subscriber
.
getSyncmlAlertCode
()
not
in
(
"one_way_from_client"
,
"refresh_from_client_only"
):
# Reset signature only if we have to check modifications on server side
subscriber
.
initialiseSynchronization
()
# Do not continue in elif, as sending modifications is done in the same
# Do not continue in elif, as sending modifications is done in the same
# package as sending notifications
# package as sending notifications
if
subscriber
.
getSynchronizationState
()
==
"sending_modifications"
:
if
subscriber
.
getSynchronizationState
()
==
"sending_modifications"
:
...
...
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