Permalink
Browse files

Fix up the server

  • Loading branch information...
1 parent b979d91 commit c8082962e1dce331c01ee162ba31eaeb01df293f @njoyce committed Nov 11, 2010
Showing with 14 additions and 5 deletions.
  1. +14 −5 server.py
View
19 server.py
@@ -3,7 +3,7 @@
dump the raw payload. Use in conjunction with C{amfbench/flex/main.swf}
"""
-import os
+import os.path
import sys
import logging
from optparse import OptionParser
@@ -143,8 +143,17 @@ def __call__(self, environ, start_response):
builder_name, size, amf_version, uid, bytes = self.strip_envelope(bytes)
- f = open(amfbench.get_blob_filename(
- builder_name, int(size), amf_version), 'wb')
+ fn = amfbench.get_blob_filename(
+ builder_name, int(size), amf_version)
+
+ dn = os.path.dirname(fn)
+
+ try:
+ os.makedirs(dn)
+ except OSError:
+ pass
+
+ f = open(fn, 'wb')
f.write(bytes)
f.flush()
@@ -209,10 +218,10 @@ def four_oh_four(environ, start_response):
return ['<html><body><h1>404 Not Found</h1></body></html>']
app = four_oh_four
- app = Redirector(app, '/', '/static/AMFBench.html')
+ app = Redirector(app, '/', '/flex/DecodingGenerator.swf')
app = CrossdomainMiddleware(app)
app = DecodingGeneratorGateway(app)
- app = ServeStatic(app, 'static', '/static/')
+ app = ServeStatic(app, 'flex', '/flex/')
return app

0 comments on commit c808296

Please sign in to comment.