Server: Fix bug causing some things to not work when using SSL support on Linux of macOS

sendfile() does nto work with SSL sockets because of SSL framing
This commit is contained in:
Kovid Goyal 2017-06-22 21:18:23 +05:30
parent 313de840ac
commit c2d6ba54fa
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -546,7 +546,9 @@ class HTTPConnection(HTTPRequest):
self.reset_state() self.reset_state()
return return
if isinstance(output, ReadableOutput): if isinstance(output, ReadableOutput):
self.use_sendfile = output.use_sendfile and self.opts.use_sendfile and sendfile_to_socket_async is not None self.use_sendfile = output.use_sendfile and self.opts.use_sendfile and sendfile_to_socket_async is not None and self.ssl_context is None
# sendfile() does nto work with SSL sockets since encryption has to
# be done in userspace
if output.ranges is not None: if output.ranges is not None:
if isinstance(output.ranges, Range): if isinstance(output.ranges, Range):
r = output.ranges r = output.ranges