ObjFW  Diff

Differences From Artifact [5586c87ef1]:

To Artifact [11398332ce]:


38
39
40
41
42
43
44

45
46
47
48
49
50
51
#import "OFSystemInfo.h"
#import "OFRunLoop.h"
#import "OFRunLoop+Private.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"

#import "OFSetOptionFailedException.h"

#import "macros.h"
#import "of_asprintf.h"

@implementation OFStream
#ifndef _WIN32







>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#import "OFSystemInfo.h"
#import "OFRunLoop.h"
#import "OFRunLoop+Private.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOutOfRangeException.h"
#import "OFSetOptionFailedException.h"

#import "macros.h"
#import "of_asprintf.h"

@implementation OFStream
#ifndef _WIN32
1551
1552
1553
1554
1555
1556
1557















1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569

#ifdef OF_HAVE_SOCKETS
- (void)cancelAsyncRequests
{
	[OFRunLoop OF_cancelAsyncRequestsForStream: self];
}
#endif
















- (void)close
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (bool)OF_isWaitingForDelimiter
{
	return _waitingForDelimiter;
}
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585

#ifdef OF_HAVE_SOCKETS
- (void)cancelAsyncRequests
{
	[OFRunLoop OF_cancelAsyncRequestsForStream: self];
}
#endif

- (void)unreadFromBuffer: (const void*)buffer
		  length: (size_t)length
{
	if (length > SIZE_MAX - _readBufferLength)
		@throw [OFOutOfRangeException exception];

	_readBuffer = [self resizeMemory: _readBuffer
				    size: _readBufferLength + length];

	memmove(_readBuffer + length, _readBuffer, _readBufferLength);
	memcpy(_readBuffer, buffer, length);

	_readBufferLength += length;
}

- (void)close
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (bool)OF_isWaitingForDelimiter
{
	return _waitingForDelimiter;
}
@end