pld-builder.new: PLD_Builder/request_handler.py, PLD_Builder/request_handle...
glen
glen at pld-linux.org
Mon Aug 25 15:12:43 CEST 2008
Author: glen Date: Mon Aug 25 13:12:42 2008 GMT
Module: pld-builder.new Tag: HEAD
---- Log message:
- grab filename from http post headers
---- Files affected:
pld-builder.new/PLD_Builder:
request_handler.py (1.39 -> 1.40) , request_handler_server.py (1.1 -> 1.2)
---- Diffs:
================================================================
Index: pld-builder.new/PLD_Builder/request_handler.py
diff -u pld-builder.new/PLD_Builder/request_handler.py:1.39 pld-builder.new/PLD_Builder/request_handler.py:1.40
--- pld-builder.new/PLD_Builder/request_handler.py:1.39 Thu Jul 17 12:02:49 2008
+++ pld-builder.new/PLD_Builder/request_handler.py Mon Aug 25 15:12:37 2008
@@ -135,9 +135,15 @@
os.chmod(path.req_queue_signed_file, 0644)
q.unlock()
-def handle_request(f):
+def handle_request(f, filename = None):
sio = StringIO.StringIO()
util.sendfile(f, sio)
+
+ sio.seek(0)
+ if sio.read() == '':
+ log.alert('Empty body received. Filename: %s' % filename)
+ return False
+
sio.seek(0)
(em, body) = gpg.verify_sig(sio)
user = acl.user_by_email(em)
@@ -165,10 +171,10 @@
status.pop()
return True
-def handle_request_main(stream):
+def handle_request_main(stream, filename = None):
init_conf("src")
status.push("handling email request")
- ret = handle_request(stream)
+ ret = handle_request(stream, filename = filename)
status.pop()
return ret
================================================================
Index: pld-builder.new/PLD_Builder/request_handler_server.py
diff -u pld-builder.new/PLD_Builder/request_handler_server.py:1.1 pld-builder.new/PLD_Builder/request_handler_server.py:1.2
--- pld-builder.new/PLD_Builder/request_handler_server.py:1.1 Wed Mar 7 20:45:02 2007
+++ pld-builder.new/PLD_Builder/request_handler_server.py Mon Aug 25 15:12:37 2008
@@ -34,7 +34,9 @@
sio.write(query)
sio.seek(0)
- if not request_handler.handle_request_main(sio):
+ filename = self.headers.getheader('x-filename')
+
+ if not request_handler.handle_request_main(sio, filename = filename):
self.send_error(500)
self.end_headers()
return
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler.py?r1=1.39&r2=1.40&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler_server.py?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list