Differences From Artifact [0d964b4cba]:
- File src/OFHTTPClient.m — part of check-in [0f99128a67] at 2020-01-05 02:05:47 on branch trunk — Update URL in a few places (user: js, size: 27936) [annotate] [blame] [check-ins using] [more...]
To Artifact [90f1585c87]:
- File
src/OFHTTPClient.m
— part of check-in
[b4810363ea]
at
2020-01-12 17:37:29
on branch trunk
— OFHTTPClient: Always keep the underlying socket
When there's no keep-alive and the socket is not kept, it fails when the
OFHTTPClientResponse gets removed from the kernel event observer. (user: js, size: 27846) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
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); |
︙ | ︙ |