Define a random skey to return to the client when media syncing begins, so we don't send a null skey value.

This commit is contained in:
Christoph Mack 2016-01-22 08:34:10 +01:00 committed by jdoe0
parent f03aea67c1
commit 1b1a3d8e22

View File

@ -518,7 +518,11 @@ class SyncApp(object):
if url not in self.valid_urls:
raise HTTPNotFound()
if url == 'begin' or url == 'mediaChanges' or url == 'uploadChanges':
if url == 'begin':
skey = checksum(str(random.random()))[:8]
data['skey'] = skey
session.skey = skey
elif url == 'mediaChanges' or url == 'uploadChanges':
data['skey'] = session.skey
return self._execute_handler_method_in_thread(url, data, session)
@ -673,4 +677,4 @@ def main():
finally:
shutdown()
if __name__ == '__main__': main()
if __name__ == '__main__': main()