ObjOpenSSL  Check-in [2ee844508a]

Overview
Comment:Adjust to ObjFW changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2ee844508a6ef9e20c71c297a3fd363b64f8cea753874d239f3a34c2cf403db0
User & Date: js on 2017-06-21 21:04:58
Other Links: manifest | tags
Context
2017-07-02
12:22
Adjust to ObjFW changes check-in: 9c2e824983 user: js tags: trunk
2017-06-21
21:04
Adjust to ObjFW changes check-in: 2ee844508a user: js tags: trunk
2017-05-14
00:33
Modernize the code a little check-in: 9355649e3a user: js tags: trunk
Changes

Modified src/SSLConnectionFailedException.m from [d8975e7b34] to [3fe5f58a63].

113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
	  port: (uint16_t)port
	socket: (SSLSocket *)socket
      SSLError: (unsigned long)SSLError
  verifyResult: (long)verifyResult
{
	self = [super initWithHost: host
			      port: port
			    socket: socket];


	_SSLError = SSLError;
	_verifyResult = verifyResult;

	return self;
}








|
>







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
	  port: (uint16_t)port
	socket: (SSLSocket *)socket
      SSLError: (unsigned long)SSLError
  verifyResult: (long)verifyResult
{
	self = [super initWithHost: host
			      port: port
			    socket: socket
			     errNo: 0];

	_SSLError = SSLError;
	_verifyResult = verifyResult;

	return self;
}

Modified src/SSLSocket.m from [4e8d75c76a] to [5841f82ac0].

338
339
340
341
342
343
344
345

346
347
348
349
350
351
352
							    errNo: ENOTCONN];

	if ((ret = SSL_read(_SSL, buffer, (int)length)) < 0) {
		if (SSL_get_error(_SSL, ret) == SSL_ERROR_WANT_READ)
			return 0;

		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length];

	}

	if (ret == 0)
		_atEndOfStream = true;

	return ret;
}







|
>







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
							    errNo: ENOTCONN];

	if ((ret = SSL_read(_SSL, buffer, (int)length)) < 0) {
		if (SSL_get_error(_SSL, ret) == SSL_ERROR_WANT_READ)
			return 0;

		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length
							    errNo: 0];
	}

	if (ret == 0)
		_atEndOfStream = true;

	return ret;
}
363
364
365
366
367
368
369
370

371
372
373
374
375
376
377
	if (_atEndOfStream)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
							     errNo: ENOTCONN];

	if (SSL_write(_SSL, buffer, (int)length) < length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length];

}

- (bool)hasDataInReadBuffer
{
	if (_SSL != NULL && SSL_pending(_SSL) > 0)
		return true;








|
>







364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
	if (_atEndOfStream)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
							     errNo: ENOTCONN];

	if (SSL_write(_SSL, buffer, (int)length) < length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
							     errNo: 0];
}

- (bool)hasDataInReadBuffer
{
	if (_SSL != NULL && SSL_pending(_SSL) > 0)
		return true;