ObjFW  Diff

Differences From 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]

To Artifact [36ad6829ee]:


972
973
974
975
976
977
978
979
980
981
982
983
984
985
986

	return _atEndOfStream;
}

- (int)fileDescriptorForReading
{
	if (_socket == nil)
		return INVALID_SOCKET;

	return _socket.fileDescriptorForReading;
}

- (bool)hasDataInReadBuffer
{
	return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer);







|







972
973
974
975
976
977
978
979
980
981
982
983
984
985
986

	return _atEndOfStream;
}

- (int)fileDescriptorForReading
{
	if (_socket == nil)
		return -1;

	return _socket.fileDescriptorForReading;
}

- (bool)hasDataInReadBuffer
{
	return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer);