|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-01-17 15:05:33
|
Revision: 453
http://sword-app.svn.sourceforge.net/sword-app/?rev=453&view=rev
Author: richard-jones
Date: 2012-01-17 15:05:22 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
fix handling of max_upload_size; this now doesn't cause an error if it is triggered, and can be set to unlimited by not setting the config value
Modified Paths:
--------------
sss/branches/sss-2/sss/config.py
sss/branches/sss-2/sss/core.py
sss/branches/sss-2/sss/pylons_sword_controller.py
sss/branches/sss-2/sss/webpy.py
Modified: sss/branches/sss-2/sss/config.py
===================================================================
--- sss/branches/sss-2/sss/config.py 2012-01-16 16:52:59 UTC (rev 452)
+++ sss/branches/sss-2/sss/config.py 2012-01-17 15:05:22 UTC (rev 453)
@@ -63,6 +63,7 @@
"max_upload_size" : 16777216,
# used to generate errors
# "max_upload_size" : 0,
+ # Just omit the max_upload_size parameter if you don't want any limit
# list of package formats that SSS can provide when retrieving the Media Resource
"sword_disseminate_package" : [
Modified: sss/branches/sss-2/sss/core.py
===================================================================
--- sss/branches/sss-2/sss/core.py 2012-01-16 16:52:59 UTC (rev 452)
+++ sss/branches/sss-2/sss/core.py 2012-01-17 15:05:22 UTC (rev 453)
@@ -316,7 +316,7 @@
version.text = self.version
# max upload size
- if self.max_upload_size != 0:
+ if self.max_upload_size is not None:
mus = etree.SubElement(service, self.ns.SWORD + "maxUploadSize")
mus.text = str(self.max_upload_size)
Modified: sss/branches/sss-2/sss/pylons_sword_controller.py
===================================================================
--- sss/branches/sss-2/sss/pylons_sword_controller.py 2012-01-16 16:52:59 UTC (rev 452)
+++ sss/branches/sss-2/sss/pylons_sword_controller.py 2012-01-17 15:05:22 UTC (rev 453)
@@ -189,10 +189,10 @@
if d.content_length == 0:
ssslog.info("Received empty deposit request")
empty_request = True
- if d.content_length > config.max_upload_size:
+ if config.max_upload_size is not None and d.content_length > config.max_upload_size:
raise SwordError(error_uri=Errors.max_upload_size_exceeded,
- msg="Max upload size is " + config.max_upload_size +
- "; incoming content length was " + str(cl))
+ msg="Max upload size is " + str(config.max_upload_size) +
+ "; incoming content length was " + str(d.content_length))
# FIXME: this method does NOT support multipart
# find out if this is a multipart or not
Modified: sss/branches/sss-2/sss/webpy.py
===================================================================
--- sss/branches/sss-2/sss/webpy.py 2012-01-16 16:52:59 UTC (rev 452)
+++ sss/branches/sss-2/sss/webpy.py 2012-01-17 15:05:22 UTC (rev 453)
@@ -209,8 +209,8 @@
empty_request = True
if d.content_length > config.max_upload_size:
raise SwordError(error_uri=Errors.max_upload_size_exceeded,
- msg="Max upload size is " + config.max_upload_size +
- "; incoming content length was " + str(cl))
+ msg="Max upload size is " + str(config.max_upload_size) +
+ "; incoming content length was " + str(d.content_length))
# find out if this is a multipart or not
is_multipart = False
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|