Differences From Artifact [9d3b80f535]:
- File
src/OFHTTPServer.m
— part of check-in
[d30efa8bbf]
at
2021-11-13 13:04:13
on branch trunk
— Completely rework the TLS/SSL API
The previous API could never work cleanly and would always require
hacks, as it needed intercepting all interactions of OFTCPSocket with
the raw socket and did not work at all if the OFTCPSocket had anything
in its read buffer before starting the TLS handshake. This also could
not be fixed easily, as it would have required the object to contain two
read buffers, one for the unencrypted connection and one for the
encrypted connection. There was also no clean way to perform the
handshake in a non-blocking way.The new API is a lot cleaner and requires none of the hacks, but using
it requires slightly more work. But this is more than made up for by
making a fully asynchronous handshake possible. It uses the concept of a
stream wrapping another stream, meaning the entire connecting part is
being handled by OFTCPSocket and then the connected socket is passed off
to OFTLSStream to wrap it. This also makes for a lot cleaner separation
of concerns. (user: js, size: 19818) [annotate] [blame] [check-ins using]
To Artifact [7cab88af66]:
- File src/OFHTTPServer.m — part of check-in [d9586ed175] at 2022-01-28 19:34:41 on branch trunk — Don't assume EWOULDBLOCK and EAGAIN are the same (user: js, size: 19839) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
228 229 230 231 232 233 234 | if (!_headersSent) [self of_sendHeaders]; if (!_chunked) { @try { [_socket writeBuffer: buffer length: length]; } @catch (OFWriteFailedException *e) { | | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | if (!_headersSent) [self of_sendHeaders]; if (!_chunked) { @try { [_socket writeBuffer: buffer length: length]; } @catch (OFWriteFailedException *e) { if (e.errNo == EWOULDBLOCK || e.errNo == EAGAIN) return e.bytesWritten; @throw e; } return length; } |
︙ | ︙ |