Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify SSLserver, no fork()s anymore

  • Loading branch information...
commit ed46f67ace15c13b3609820f61c3bd6d51422cc5 1 parent 06f7962
tcatm authored
Showing with 2 additions and 21 deletions.
  1. +2 −21 SSLserver.py
View
23 SSLserver.py
@@ -5,7 +5,6 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
import socket, os, time, shutil, signal
-from multiprocessing import Process, current_process, freeze_support
from SocketServer import BaseServer, ThreadingMixIn
from optparse import OptionParser
import ssl
@@ -147,23 +146,6 @@ def send_head(self):
self.end_headers()
return f
-def serve_forever(server):
- try:
- server.serve_forever()
- except KeyboardInterrupt:
- pass
-
-
-def runpool(options):
- server = SecureHTTPServer(('', options.port), RequestHandler, options)
-
- # create child processes to act as workers
- for i in range(options.procs-1):
- Process(target=serve_forever, args=(server,)).start()
-
- # main process also acts as a worker
- serve_forever(server)
-
parser = OptionParser()
parser.add_option('-r', dest='url', default='http://localhost:8332/', help='URL to bitcoin RPC (default: %default)')
parser.add_option('-p', dest='port', type="int", default=8338, help='listen port (default: %default)')
@@ -173,8 +155,7 @@ def runpool(options):
(options, args) = parser.parse_args()
-freeze_support()
-
print 'Ctrl-C to exit'
-runpool(options)
+server = SecureHTTPServer(('', options.port), RequestHandler, options)
+server.serve_forever()
Please sign in to comment.
Something went wrong with that request. Please try again.