Differences From Artifact [21bcad8f97]:
- File src/OFStream.m — part of check-in [3dec8ecf2e] at 2019-08-09 23:44:51 on branch trunk — Support sockets on AmigaOS 3 (user: js, size: 40749) [annotate] [blame] [check-ins using]
To Artifact [2c231bfb94]:
- File
src/OFStream.m
— part of check-in
[321fa12f9a]
at
2020-01-07 20:36:33
on branch trunk
— OFStream: Always cancel async requests on close
This avoids accidentally trying to remove a closed file descriptor from
a kernel event observer. (user: js, size: 40812) [annotate] [blame] [check-ins using] [more...]
1 2 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, | | | | 1 2 3 4 5 6 7 8 9 10 11 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, * 2018, 2019, 2020 * Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 | [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = readBuffer; _readBufferLength += length; } - (void)close { [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = NULL; _readBufferLength = 0; [self freeMemory: _writeBuffer]; _writeBuffer = NULL; _writeBufferLength = 0; _writeBuffered = false; _waitingForDelimiter = false; } @end | > > > > | 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 | [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = readBuffer; _readBufferLength += length; } - (void)close { #ifdef OF_HAVE_SOCKETS [self cancelAsyncRequests]; #endif [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = NULL; _readBufferLength = 0; [self freeMemory: _writeBuffer]; _writeBuffer = NULL; _writeBufferLength = 0; _writeBuffered = false; _waitingForDelimiter = false; } @end |