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
|
- (void)lowlevelWriteBuffer: (const void *)buffer
|
||||||
length: (size_t)length
|
length: (size_t)length
|
||||||
{
|
{
|
||||||
if (length > INT_MAX)
|
int bytesWritten;
|
||||||
@throw [OFOutOfRangeException exception];
|
|
||||||
|
|
||||||
if (_socket == INVALID_SOCKET)
|
if (_socket == INVALID_SOCKET)
|
||||||
@throw [OFNotOpenException exceptionWithObject: self];
|
@throw [OFNotOpenException exceptionWithObject: self];
|
||||||
|
|
||||||
if (_atEndOfStream)
|
if (length > INT_MAX)
|
||||||
@throw [OFWriteFailedException exceptionWithObject: self
|
@throw [OFOutOfRangeException exception];
|
||||||
requestedLength: length
|
|
||||||
errNo: ENOTCONN];
|
|
||||||
|
|
||||||
if (SSL_write(_SSL, buffer, (int)length) < length)
|
if ((bytesWritten = SSL_write(_SSL, buffer, (int)length)) < 0)
|
||||||
@throw [OFWriteFailedException exceptionWithObject: self
|
@throw [OFWriteFailedException exceptionWithObject: self
|
||||||
requestedLength: length
|
requestedLength: length
|
||||||
|
bytesWritten: 0
|
||||||
|
errNo: 0];
|
||||||
|
|
||||||
|
if ((size_t)bytesWritten != length)
|
||||||
|
@throw [OFWriteFailedException exceptionWithObject: self
|
||||||
|
requestedLength: length
|
||||||
|
bytesWritten: bytesWritten
|
||||||
errNo: 0];
|
errNo: 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue