Differences From 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]
To Artifact [cc1af7fa6d]:
- File
src/OFHTTPClient.m
— part of check-in
[3b43d51006]
at
2020-01-14 00:16:04
on branch trunk
— More consistent -[close] behavior
This means refusing to close twice, calling -[close] from -[dealloc] and
not calling -[cancelAsyncRequests].Calling -[cancelAsyncRequests] in -[close] is too dangerous, as -[close]
gets called by -[dealloc]: If the queue is the last reference to the
object, at the point where -[cancelAsyncRequests] removes it from the
queue, the object will start to deallocate and call into
-[cancelAsyncRequests] again, which is still in the middle of removing
it and now finds itself with an inconsistent state. (user: js, size: 28008) [annotate] [blame] [check-ins using]
︙ | |||
729 730 731 732 733 734 735 | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | + - + - | } return self; } - (void)dealloc { if (_socket != nil) |
︙ | |||
785 786 787 788 789 790 791 | 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | - + + + | { return _atEndOfStream; } - (void)close { if (_socket == nil) |
︙ | |||
817 818 819 820 821 822 823 | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | - + + | _socket = [sock retain]; return self; } - (void)dealloc { |
︙ | |||
981 982 983 984 985 986 987 988 989 990 991 992 993 994 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 | + + + | - (bool)hasDataInReadBuffer { return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer); } - (void)close { if (_socket == nil) @throw [OFNotOpenException exceptionWithObject: self]; _atEndOfStream = false; [_socket release]; _socket = nil; [super close]; } |
︙ |