Differences From Artifact [6bac196b77]:
- File
utils/ofhttp/OFHTTP.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: 29663) [annotate] [blame] [check-ins using]
To Artifact [1e6fb1a87b]:
- File
utils/ofhttp/OFHTTP.m
— part of check-in
[8f8af474fc]
at
2021-11-20 13:18:28
on branch trunk
— Move TLS implementations to a separate library
These implementations all depend on additional libraries that are
otherwise not needed for an ObjFW application that does not use TLS,
meaning they would add unnecessary dependencies for a lot of
applications and waste memory. (user: js, size: 29813) [annotate] [blame] [check-ins using]
︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + + + + | #endif #import "OFSandbox.h" #import "OFStdIOStream.h" #import "OFSystemInfo.h" #import "OFTCPSocket.h" #import "OFTLSStream.h" #import "OFURL.h" #ifdef HAVE_TLS_SUPPORT # import "ObjFWTLS.h" #endif #import "OFConnectionFailedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOpenItemFailedException.h" |
︙ | |||
73 74 75 76 77 78 79 80 81 82 83 84 85 86 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + + + + + + + | OFStream *_output; unsigned long long _received, _length, _resumedFrom; ProgressBar *_progressBar; } - (void)downloadNextURL; @end #ifdef HAVE_TLS_SUPPORT void _reference_to_ObjFWTLS(void) { _ObjFWTLS_reference = 1; } #endif OF_APPLICATION_DELEGATE(OFHTTP) static void help(OFStream *stream, bool full, int status) { [OFStdErr writeLine: |
︙ |