ObjFW  Check-in [8cd4bd9fdd]

Overview
Comment:OFSecureTransportTLSStream: Fix EWOULDBLOCK
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8cd4bd9fddf42921861d2a84932adae5eb715169c5da9619fab9a28b6b78e3fc
User & Date: js on 2021-11-21 10:18:14
Other Links: manifest | tags
Context
2021-11-21
10:40
OFTLSStream: wrappedStream -> underlyingStream check-in: 3ed8cf7a52 user: js tags: trunk
10:18
OFSecureTransportTLSStream: Fix EWOULDBLOCK check-in: 8cd4bd9fdd user: js tags: trunk
10:13
README.md: Update iOS simulator instructions check-in: 2ca0e3c7d7 user: js tags: trunk
Changes

Modified src/tls/OFSecureTransportTLSStream.m from [b4eff5da92] to [e80afd9547].

27
28
29
30
31
32
33



34
35
36








37
38
39
40
41
42
43

int _ObjFWTLS_reference;

static OSStatus
readFunc(SSLConnectionRef connection, void *data, size_t *dataLength)
{
	bool incomplete;



	size_t length = [((OFTLSStream *)connection).wrappedStream
	    readIntoBuffer: data
		    length: *dataLength];









	incomplete = (length < *dataLength);
	*dataLength = length;

	return (incomplete ? errSSLWouldBlock : noErr);
}








>
>
>
|


>
>
>
>
>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

int _ObjFWTLS_reference;

static OSStatus
readFunc(SSLConnectionRef connection, void *data, size_t *dataLength)
{
	bool incomplete;
	size_t length;

	@try {
		length = [((OFTLSStream *)connection).wrappedStream
	    readIntoBuffer: data
		    length: *dataLength];
	} @catch (OFReadFailedException *e) {
		if (e.errNo == EWOULDBLOCK) {
			*dataLength = 0;
			return errSSLWouldBlock;
		}

		@throw e;
	}

	incomplete = (length < *dataLength);
	*dataLength = length;

	return (incomplete ? errSSLWouldBlock : noErr);
}