Permalink
Browse files

don't reuse connection as httplib has buggy persistent connection sup…

  • Loading branch information...
1 parent 54a87d6 commit 54cc92b5010629b756189825a463dab45f20a000 Robert Newson committed Dec 29, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 couchdb-external-hook.py
View
4 couchdb-external-hook.py
@@ -37,15 +37,15 @@ def main():
if len(args):
parser.error("Unrecognized arguments: %s" % ' '.join(args))
- res = httplib.HTTPConnection(opts.remote_host, opts.remote_port)
for req in requests():
+ res = httplib.HTTPConnection(opts.remote_host, opts.remote_port)
try:
resp = respond(res, req, opts.local_host, opts.local_port)
except Exception, e:
body = traceback.format_exc()
resp = mkresp(500, body, {"Content-Type": "text/plain"})
- res = httplib.HTTPConnection(opts.remote_host, opts.remote_port)
+ res.close()
sys.stdout.write(json.dumps(resp))
sys.stdout.write("\n")
sys.stdout.flush()

0 comments on commit 54cc92b

Please sign in to comment.