ObjFW  Diff

Differences From Artifact [57e457dcdc]:

To Artifact [f380a0e937]:

  • File src/OFDeflateStream.m — part of check-in [8d2a5052fd] at 2014-01-25 17:39:13 on branch trunk — Generalize stream / socket related exceptions

    This is in preparation for adding UDP sockets, as UDP sockets and TCP
    sockets have no common superclass, as one is stream-oriented while the
    other is packet-oriented.

    Read and write exceptions are for any object now, as they are useful for
    a lot more than just for streams, while the others (bind, listen, etc.)
    are for any socket now (the type is id in this case, though, as there is
    no common superclass). (user: js, size: 18085) [annotate] [blame] [check-ins using]


294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
	uint_fast16_t bits, i, tmp;
	uint16_t value;
	size_t bytesWritten = 0;
	uint8_t *slidingWindow;
	uint_fast16_t slidingWindowIndex;

	if (_atEndOfStream)
		@throw [OFReadFailedException exceptionWithStream: self
						  requestedLength: length];

start:
	switch (_state) {
	case BLOCK_HEADER:
		if OF_UNLIKELY (_inLastBlock) {
			[_stream unreadFromBuffer: _buffer + _bufferIndex







|







294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
	uint_fast16_t bits, i, tmp;
	uint16_t value;
	size_t bytesWritten = 0;
	uint8_t *slidingWindow;
	uint_fast16_t slidingWindowIndex;

	if (_atEndOfStream)
		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length];

start:
	switch (_state) {
	case BLOCK_HEADER:
		if OF_UNLIKELY (_inLastBlock) {
			[_stream unreadFromBuffer: _buffer + _bufferIndex