diff -r 2fccd121e818 lib/thirdparty/httpserver.py
|
a
|
b
|
|
| 324 | 324 | self.wsgi_write_chunk("Internal Server Error\n") |
| 325 | 325 | raise |
| 326 | 326 | |
| | 327 | |
| | 328 | class _HTTPServer(HTTPServer): |
| | 329 | def server_bind(self): |
| | 330 | if self.RequestHandlerClass.protocol_version == "HTTP/1.1": |
| | 331 | # Disable Nagle's Algorithm, which causes performance |
| | 332 | # problems with Keep-Alive. Sometimes the server has sent |
| | 333 | # a response to the client but the TCP stack buffers the |
| | 334 | # response in hopes of reducing the number of packets to |
| | 335 | # send. After about 200ms it gives up and sends the rest |
| | 336 | # of the packet, but 0.2s is a long time to wait when |
| | 337 | # there are many small, fast requests on the same |
| | 338 | # connection. |
| | 339 | self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) |
| | 340 | HTTPServer.server_bind(self) |
| | 341 | |
| 327 | 342 | # |
| 328 | 343 | # SSL Functionality |
| 329 | 344 | # |
| … |
… |
|
| 338 | 353 | # functionality in that case. |
| 339 | 354 | SSL = None |
| 340 | 355 | SocketErrors = (socket.error,) |
| 341 | | class SecureHTTPServer(HTTPServer): |
| | 356 | class SecureHTTPServer(_HTTPServer): |
| 342 | 357 | def __init__(self, server_address, RequestHandlerClass, |
| 343 | 358 | ssl_context=None, request_queue_size=None): |
| 344 | 359 | assert not ssl_context, "pyOpenSSL not installed" |
| … |
… |
|
| 356 | 371 | def __getattr__(self, attrib): |
| 357 | 372 | return getattr(self.__conn, attrib) |
| 358 | 373 | |
| 359 | | class SecureHTTPServer(HTTPServer): |
| | 374 | class SecureHTTPServer(_HTTPServer): |
| 360 | 375 | """ |
| 361 | 376 | Provides SSL server functionality on top of the BaseHTTPServer |
| 362 | 377 | by overriding _private_ members of Python's standard |