Commit 829b94ae authored by Jim Fulton's avatar Jim Fulton

fix lazy server implementation cuz client is less forgiving in 3.3

parent 029469b5
......@@ -21,9 +21,8 @@ testing repository.
Turn on logging on this server so that we can see when eggs are pulled
from it.
>>> get(link_server2 + 'enable_server_logging')
>>> _ = get(link_server2 + 'enable_server_logging')
GET 200 /enable_server_logging
''
Let's create a develop egg in our buildout that specifies
dependency_links which point to the new server.
......
......@@ -50,9 +50,8 @@ download:
We'll enable logging on the link server so we can see what's going on:
>>> get(link_server+'enable_server_logging')
>>> _ = get(link_server+'enable_server_logging')
GET 200 /enable_server_logging
''
We also specified a download cache.
......
......@@ -376,9 +376,8 @@ We have a link server that has a number of eggs:
Turn on logging on this server so that we can see when eggs are pulled
from it.
>>> get(link_server2 + 'enable_server_logging')
>>> _ = get(link_server2 + 'enable_server_logging')
GET 200 /enable_server_logging
''
Now we can create an egg that specifies that its dependencies are
found on this server.
......@@ -1192,9 +1191,8 @@ We have a link server that has a number of eggs:
We'd like to see what is being fetched from the server, so we'll
enable server logging:
>>> get(link_server+'enable_server_logging')
>>> _ = get(link_server+'enable_server_logging')
GET 200 /enable_server_logging
''
Now, if we install demo, and extdemo:
......
......@@ -311,15 +311,21 @@ class Handler(BaseHTTPRequestHandler):
if '__stop__' in self.path:
raise SystemExit
def k():
self.send_response(200)
out = '<html><body>k</body></html>\n'.encode()
self.send_header('Content-Length', str(len(out)))
self.send_header('Content-Type', 'text/html')
self.end_headers()
self.wfile.write(out)
if self.path == '/enable_server_logging':
self.__server.__log = True
self.send_response(200)
return
return k()
if self.path == '/disable_server_logging':
self.__server.__log = False
self.send_response(200)
return
return k()
path = os.path.abspath(os.path.join(self.tree, *self.path.split('/')))
if not (
......@@ -361,6 +367,7 @@ class Handler(BaseHTTPRequestHandler):
self.send_header('Content-Type', 'application/x-gzip')
else:
self.send_header('Content-Type', 'text/html')
self.end_headers()
self.wfile.write(out)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment