[Openlanhouse-development] SF.net SVN: openlanhouse:[302] trunk/openlh-core/src/OpenlhCore/net/clie
Status: Pre-Alpha
Brought to you by:
n3rd3x
|
From: <n3...@us...> - 2008-10-14 17:21:10
|
Revision: 302
http://openlanhouse.svn.sourceforge.net/openlanhouse/?rev=302&view=rev
Author: n3rd3x
Date: 2008-10-14 17:20:50 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
* Replaced all headers in client.py by header constansts
Modified Paths:
--------------
trunk/openlh-core/src/OpenlhCore/net/client.py
Modified: trunk/openlh-core/src/OpenlhCore/net/client.py
===================================================================
--- trunk/openlh-core/src/OpenlhCore/net/client.py 2008-10-14 16:39:04 UTC (rev 301)
+++ trunk/openlh-core/src/OpenlhCore/net/client.py 2008-10-14 17:20:50 UTC (rev 302)
@@ -368,11 +368,11 @@
xmlout = xmlpickler_dumps(params, method)
size = len(xmlout)
- head = "-----BEGIN XMLREQUEST ID=%d SIZE=%d-----" % (self.currid, size)
+ head = BEGIN_XMLREQUEST_HEADER % (self.currid, size)
self.send_lock.acquire()
self.session.send(head)
self.session.send(xmlout)
- self.session.send("-----END XMLREQUEST-----")
+ self.session.send(END_XMLREQUEST_HEADER)
self.send_lock.release()
@@ -387,15 +387,13 @@
Send Response to peer
"""
- self.logger.info('sending response number %d' % id)
-
try:
output = xmlpickler_dumps((response,), methodresponse=1)
- head = '-----BEGIN XMLRESPONSE ID=%d SIZE=%d-----' % (id, len(output))
+ head = BEGIN_XMLRESPONSE_HEADER % (id, len(output))
self.send_lock.acquire()
self.session.send(head)
self.session.send(output)
- self.session.send("-----END XMLRESPONSE-----")
+ self.session.send(END_XMLRESPONSE_HEADER)
except Exception, error:
self.logger.error(error)
@@ -418,8 +416,7 @@
f = open(filepath)
size = ospath.getsize(filepath)
- head = "-----BEGIN SENDFILE ID=%d METHOD=%s SIZE=%d-----" % (self.currid,
- method, size)
+ head = BEGIN_SENDFILE_HEADER % (self.currid, method, size)
self.currid += 1
self.send_lock.acquire()
@@ -434,7 +431,7 @@
else:
break
- self.session.send("-----END SENDFILE-----")
+ self.session.send(END_SENDFILE_HEADER)
self.logger.info('Done: File sent %s to server' % filepath)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|