Overview
Comment: | OFHTTPClient: Always keep the underlying socket
When there's no keep-alive and the socket is not kept, it fails when the |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b4810363eac59fd5ffc7937be92962ed |
User & Date: | js on 2020-01-12 17:37:29 |
Other Links: | manifest | tags |
Context
2020-01-13
| ||
00:18 | OFPollKernelEventObserver: Copy FDs check-in: 7e9f70c477 user: js tags: trunk | |
2020-01-12
| ||
17:37 | OFHTTPClient: Always keep the underlying socket check-in: b4810363ea user: js tags: trunk | |
16:22 | Cancel async requests in OFStreamSocket instead check-in: cea3f2133d user: js tags: trunk | |
Changes
Modified src/OFHTTPClient.m from [0d964b4cba] to [90f1585c87].
︙ | ︙ | |||
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #import "OFNotOpenException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "OFUnsupportedVersionException.h" #import "OFWriteFailedException.h" #define REDIRECTS_DEFAULT 10 @interface OFHTTPClientRequestHandler: OFObject <OFTCPSocketDelegate> { @public OFHTTPClient *_client; | > > | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #import "OFNotOpenException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "OFUnsupportedVersionException.h" #import "OFWriteFailedException.h" #import "socket_helpers.h" #define REDIRECTS_DEFAULT 10 @interface OFHTTPClientRequestHandler: OFObject <OFTCPSocketDelegate> { @public OFHTTPClient *_client; |
︙ | ︙ | |||
878 879 880 881 882 883 884 | length: length]; if (ret > length) @throw [OFOutOfRangeException exception]; _toRead -= ret; | | < < < < < < | 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | length: length]; if (ret > length) @throw [OFOutOfRangeException exception]; _toRead -= ret; if (_toRead == 0) _atEndOfStream = true; return ret; } /* Chunked */ if (_toRead > 0) { if (length > _toRead) length = (size_t)_toRead; |
︙ | ︙ | |||
947 948 949 950 951 952 953 | @throw [OFInvalidServerReplyException exception]; } if (line.length > 0) @throw [OFInvalidServerReplyException exception]; | < < < | 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | @throw [OFInvalidServerReplyException exception]; } if (line.length > 0) @throw [OFInvalidServerReplyException exception]; } } objc_autoreleasePoolPop(pool); return 0; } |
︙ | ︙ | |||
976 977 978 979 980 981 982 | return _atEndOfStream; } - (int)fileDescriptorForReading { if (_socket == nil) | | | 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 | return _atEndOfStream; } - (int)fileDescriptorForReading { if (_socket == nil) return INVALID_SOCKET; return _socket.fileDescriptorForReading; } - (bool)hasDataInReadBuffer { return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer); |
︙ | ︙ |