Adjust to ObjFW changes
This commit is contained in:
parent
5af409d4a5
commit
10d492a94a
1 changed files with 11 additions and 7 deletions
|
@ -355,20 +355,24 @@ locking_callback(int mode, int n, const char *file, int line)
|
|||
- (void)lowlevelWriteBuffer: (const void *)buffer
|
||||
length: (size_t)length
|
||||
{
|
||||
if (length > INT_MAX)
|
||||
@throw [OFOutOfRangeException exception];
|
||||
int bytesWritten;
|
||||
|
||||
if (_socket == INVALID_SOCKET)
|
||||
@throw [OFNotOpenException exceptionWithObject: self];
|
||||
|
||||
if (_atEndOfStream)
|
||||
@throw [OFWriteFailedException exceptionWithObject: self
|
||||
requestedLength: length
|
||||
errNo: ENOTCONN];
|
||||
if (length > INT_MAX)
|
||||
@throw [OFOutOfRangeException exception];
|
||||
|
||||
if (SSL_write(_SSL, buffer, (int)length) < length)
|
||||
if ((bytesWritten = SSL_write(_SSL, buffer, (int)length)) < 0)
|
||||
@throw [OFWriteFailedException exceptionWithObject: self
|
||||
requestedLength: length
|
||||
bytesWritten: 0
|
||||
errNo: 0];
|
||||
|
||||
if ((size_t)bytesWritten != length)
|
||||
@throw [OFWriteFailedException exceptionWithObject: self
|
||||
requestedLength: length
|
||||
bytesWritten: bytesWritten
|
||||
errNo: 0];
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue