Differences From Artifact [0ef7b9c0c4]:
- File
src/OFHTTPClient.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: 30982) [annotate] [blame] [check-ins using]
To Artifact [0ddda28409]:
- File src/OFHTTPClient.m — part of check-in [1203f45de1] at 2021-11-21 00:41:59 on branch trunk — OFHTTPClient: Enable non-blocking mode on socket (user: js, size: 31007) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
633 634 635 636 637 638 639 640 641 642 643 644 645 646 | port: (uint16_t)port exception: (id)exception { if (exception != nil) { [self raiseException: exception]; return; } if ([_client->_delegate respondsToSelector: @selector(client:didCreateTCPSocket:request:)]) [_client->_delegate client: _client didCreateTCPSocket: sock request: _request]; | > > | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | port: (uint16_t)port exception: (id)exception { if (exception != nil) { [self raiseException: exception]; return; } sock.canBlock = false; if ([_client->_delegate respondsToSelector: @selector(client:didCreateTCPSocket:request:)]) [_client->_delegate client: _client didCreateTCPSocket: sock request: _request]; |
︙ | ︙ |