Index: .github/workflows/amiga-gcc.yml ================================================================== --- .github/workflows/amiga-gcc.yml +++ .github/workflows/amiga-gcc.yml @@ -3,14 +3,14 @@ jobs: build: runs-on: ubuntu-latest container: amigadev/crosstools:m68k-amigaos steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure --host=m68k-amigaos - name: make run: make -j$(nproc) - name: make install run: make install Index: .github/workflows/dragonflybsd.yml ================================================================== --- .github/workflows/dragonflybsd.yml +++ .github/workflows/dragonflybsd.yml @@ -8,11 +8,11 @@ configure_flags: - - --disable-shared - --with-tls=gnutls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/dragonflybsd-vm@v0 with: usesh: true copyback: false prepare: | Index: .github/workflows/freebsd.yml ================================================================== --- .github/workflows/freebsd.yml +++ .github/workflows/freebsd.yml @@ -8,11 +8,11 @@ configure_flags: - - --disable-shared - --with-tls=gnutls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/freebsd-vm@v0 with: usesh: true copyback: false prepare: | Index: .github/workflows/ios.yml ================================================================== --- .github/workflows/ios.yml +++ .github/workflows/ios.yml @@ -12,11 +12,11 @@ - - --disable-shared steps: - name: Install dependencies run: brew install autoconf automake - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | export IPHONEOS_DEPLOYMENT_TARGET="9.0" Index: .github/workflows/macos-11.yml ================================================================== --- .github/workflows/macos-11.yml +++ .github/workflows/macos-11.yml @@ -16,11 +16,11 @@ - --disable-files - --disable-shared steps: - name: Install dependencies run: brew install autoconf automake - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure ${{ matrix.configure_flags }} - name: make Index: .github/workflows/macos-12.yml ================================================================== --- .github/workflows/macos-12.yml +++ .github/workflows/macos-12.yml @@ -16,11 +16,11 @@ - --disable-files - --disable-shared steps: - name: Install dependencies run: brew install autoconf automake - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure ${{ matrix.configure_flags }} - name: make Index: .github/workflows/macos-13.yml ================================================================== --- .github/workflows/macos-13.yml +++ .github/workflows/macos-13.yml @@ -16,11 +16,11 @@ - --disable-files - --disable-shared steps: - name: Install dependencies run: brew install autoconf automake - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure ${{ matrix.configure_flags }} - name: make Index: .github/workflows/morphos.yml ================================================================== --- .github/workflows/morphos.yml +++ .github/workflows/morphos.yml @@ -3,14 +3,14 @@ jobs: build: runs-on: ubuntu-latest container: amigadev/crosstools:ppc-morphos steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure --host=ppc-morphos - name: make run: make -j$(nproc) - name: make install run: make install Index: .github/workflows/netbsd-gcc.yml ================================================================== --- .github/workflows/netbsd-gcc.yml +++ .github/workflows/netbsd-gcc.yml @@ -8,11 +8,11 @@ configure_flags: - - --disable-shared - --with-tls=gnutls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/netbsd-vm@v0 with: usesh: true copyback: false prepare: | Index: .github/workflows/netbsd.yml ================================================================== --- .github/workflows/netbsd.yml +++ .github/workflows/netbsd.yml @@ -8,11 +8,11 @@ configure_flags: - - --disable-shared - --with-tls=gnutls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/netbsd-vm@v0 with: usesh: true copyback: false prepare: | Index: .github/workflows/nintendo-3ds.yml ================================================================== --- .github/workflows/nintendo-3ds.yml +++ .github/workflows/nintendo-3ds.yml @@ -4,11 +4,11 @@ build: runs-on: ubuntu-latest steps: - name: Install dependencies run: docker pull devkitpro/devkitarm - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | docker run \ Index: .github/workflows/nintendo-ds.yml ================================================================== --- .github/workflows/nintendo-ds.yml +++ .github/workflows/nintendo-ds.yml @@ -4,11 +4,11 @@ build: runs-on: ubuntu-latest steps: - name: Install dependencies run: docker pull devkitpro/devkitarm - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | docker run \ Index: .github/workflows/nintendo-switch.yml ================================================================== --- .github/workflows/nintendo-switch.yml +++ .github/workflows/nintendo-switch.yml @@ -4,11 +4,11 @@ build: runs-on: ubuntu-latest steps: - name: Install dependencies run: docker pull devkitpro/devkita64 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | docker run \ Index: .github/workflows/openbsd.yml ================================================================== --- .github/workflows/openbsd.yml +++ .github/workflows/openbsd.yml @@ -8,11 +8,11 @@ configure_flags: - - --disable-shared - --with-tls=gnutls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/openbsd-vm@v0 with: usesh: true copyback: false prepare: | Index: .github/workflows/ubuntu-20.04-32bit.yml ================================================================== --- .github/workflows/ubuntu-20.04-32bit.yml +++ .github/workflows/ubuntu-20.04-32bit.yml @@ -22,11 +22,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gcc-multilib - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="clang -m32" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-20.04-gcc-32bit.yml ================================================================== --- .github/workflows/ubuntu-20.04-gcc-32bit.yml +++ .github/workflows/ubuntu-20.04-gcc-32bit.yml @@ -22,11 +22,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gcc-multilib gobjc - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="gcc -m32" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-20.04-gcc.yml ================================================================== --- .github/workflows/ubuntu-20.04-gcc.yml +++ .github/workflows/ubuntu-20.04-gcc.yml @@ -24,11 +24,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gobjc libssl-dev gnutls-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="gcc" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-20.04.yml ================================================================== --- .github/workflows/ubuntu-20.04.yml +++ .github/workflows/ubuntu-20.04.yml @@ -24,11 +24,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install libssl-dev gnutls-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-latest-32bit.yml ================================================================== --- .github/workflows/ubuntu-latest-32bit.yml +++ .github/workflows/ubuntu-latest-32bit.yml @@ -22,11 +22,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gcc-multilib - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="clang -m32" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-latest-gcc-32bit.yml ================================================================== --- .github/workflows/ubuntu-latest-gcc-32bit.yml +++ .github/workflows/ubuntu-latest-gcc-32bit.yml @@ -22,11 +22,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gcc-multilib gobjc - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="gcc -m32" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-latest-gcc.yml ================================================================== --- .github/workflows/ubuntu-latest-gcc.yml +++ .github/workflows/ubuntu-latest-gcc.yml @@ -24,11 +24,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install gobjc libssl-dev gnutls-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure OBJC="gcc" ${{ matrix.configure_flags }} - name: make Index: .github/workflows/ubuntu-latest.yml ================================================================== --- .github/workflows/ubuntu-latest.yml +++ .github/workflows/ubuntu-latest.yml @@ -24,11 +24,11 @@ steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install libssl-dev gnutls-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: ./configure ${{ matrix.configure_flags }} - name: make Index: .github/workflows/wii-u.yml ================================================================== --- .github/workflows/wii-u.yml +++ .github/workflows/wii-u.yml @@ -4,11 +4,11 @@ build: runs-on: ubuntu-latest steps: - name: Install dependencies run: docker pull devkitpro/devkitppc - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | docker run \ Index: .github/workflows/wii.yml ================================================================== --- .github/workflows/wii.yml +++ .github/workflows/wii.yml @@ -4,11 +4,11 @@ build: runs-on: ubuntu-latest steps: - name: Install dependencies run: docker pull devkitpro/devkitppc - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: autogen.sh run: ./autogen.sh - name: configure run: | docker run \ Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,10 +1,17 @@ Legend: * Changes of existing features or bugfixes + New features This file only contains the most significant changes. + +ObjFW 1.0.3 -> ObjFW 1.0.4, 2023-10-08 + * Fixes OFFile closing fd 0 when initialization fails + * Fixes -[stringByAppendingPathComponent:] on empty strings + * Fixes +[OFSystemInfo operatingSystemName] and + +[OFSystemInfo operatingSystemVersion] returning nil on some systems + * Adds a license for localizations ObjFW 1.0.2 -> ObjFW 1.0.3, 2023-09-14 * Fixes -[OFConcreteData initWithItemSize:] not setting freeWhenDone to true, which resulted in a memory leak * Fixes -[OFData initWithContentsOfIRI:] freeing the buffer in @catch instead Index: README.md ================================================================== --- README.md +++ README.md @@ -385,20 +385,18 @@ If you have any questions about ObjFW or would like to talk to other ObjFW users, the following venues are available: * The [forum](https://objfw.nil.im/forum) * A [Matrix room](https://matrix.to/#/%23objfw:nil.im) + * A [Discord room](https://objfw.nil.im/discord), bridged to the Matrix + room above + * A [Telegram room](https://t.me/objfw), bridged to the Matrix room above + * A [Slack room](https://objfw.nil.im/slack), bridged to the Matrix room + above * An IRC channel named `#objfw` on `irc.oftc.net` ([Web chat](https://webchat.oftc.net/?channels=%23objfw)), bridged to the Matrix room above - * A [Slack channel](https://objfw.nil.im/slack), bridged to the Matrix room - above - * A [Discord channel](https://objfw.nil.im/discord), bridged to the Matrix - room above - * A [Telegram room](https://t.me/objfw), bridged to the Matrix room above - * A [Gitter room](https://gitter.im/ObjFW/ObjFW), bridged to the Matrix room - above Please don't hesitate to join any or all of those!

Donating

Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,11 +1,11 @@ OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@ OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@ OBJFW_FRAMEWORK = @OBJFW_FRAMEWORK@ OBJFW_LIB_MAJOR = 1 -OBJFW_LIB_MINOR = 0 -OBJFW_LIB_PATCH = 1 +OBJFW_LIB_MINOR = 1 +OBJFW_LIB_PATCH = 0 OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} OBJFWRT_SHARED_LIB = @OBJFWRT_SHARED_LIB@ OBJFWRT_STATIC_LIB = @OBJFWRT_STATIC_LIB@ OBJFWRT_FRAMEWORK = @OBJFWRT_FRAMEWORK@ @@ -24,11 +24,11 @@ OBJFWTLS_SHARED_LIB = @OBJFWTLS_SHARED_LIB@ OBJFWTLS_STATIC_LIB = @OBJFWTLS_STATIC_LIB@ OBJFWTLS_FRAMEWORK = @OBJFWTLS_FRAMEWORK@ OBJFWTLS_LIB_MAJOR = 1 OBJFWTLS_LIB_MINOR = 0 -OBJFWTLS_LIB_PATCH = 1 +OBJFWTLS_LIB_PATCH = 2 BIN_PREFIX = @BIN_PREFIX@ BRIDGE = @BRIDGE@ CVINCLUDE_INLINE_H = @CVINCLUDE_INLINE_H@ ENCODINGS_A = @ENCODINGS_A@ Index: src/OFGZIPStream.m ================================================================== --- src/OFGZIPStream.m +++ src/OFGZIPStream.m @@ -304,17 +304,16 @@ @throw [OFNotOpenException exceptionWithObject: self]; return _stream.atEndOfStream; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { if (_state == OFGZIPStreamStateData) - return (super.hasDataInReadBuffer || - _inflateStream.hasDataInReadBuffer); - - return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer); + return _inflateStream.hasDataInReadBuffer; + else + return _stream.hasDataInReadBuffer; } - (void)close { if (_stream == nil) Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -130,11 +130,11 @@ path = IRI.percentEncodedPath; else path = @"/"; requestString = [OFMutableString stringWithFormat: - @"%s %@", OFHTTPRequestMethodName(method), path]; + @"%@ %@", OFHTTPRequestMethodString(method), path]; if (IRI.query != nil) { [requestString appendString: @"?"]; [requestString appendString: IRI.percentEncodedQuery]; } @@ -1066,13 +1066,13 @@ return ((OFStream *)_stream) .fileDescriptorForReading; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer); + return _stream.hasDataInReadBuffer; } - (void)close { if (_stream == nil) Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -138,16 +138,16 @@ #ifdef __cplusplus extern "C" { #endif /** - * @brief Returns a C string describing the specified request method. + * @brief Returns a string describing the specified request method. * - * @param method The request method which should be described as a C string - * @return A C string describing the specified request method + * @param method The request method which should be described as a string + * @return A string describing the specified request method */ -extern const char *_Nullable OFHTTPRequestMethodName( +extern OFString *_Nullable OFHTTPRequestMethodString( OFHTTPRequestMethod method); /** * @brief Returns the request method for the specified string. * @@ -154,11 +154,35 @@ * @param string The string for which the request method should be returned * @return The request method for the specified string * @throw OFInvalidFormatException The specified string is not a valid HTTP * request method */ -extern OFHTTPRequestMethod OFHTTPRequestMethodParseName(OFString *string); +extern OFHTTPRequestMethod OFHTTPRequestMethodParseString(OFString *string); + +/** + * @brief Returns a C string describing the specified request method. + * + * @deprecated Use @ref OFHTTPRequestMethodString instead. + * + * @param method The request method which should be described as a C string + * @return A C string describing the specified request method + */ +extern const char *_Nullable OFHTTPRequestMethodName(OFHTTPRequestMethod method) + OF_DEPRECATED(ObjFW, 1, 1, "Use OFHTTPRequestMethodString instead"); + +/** + * @brief Returns the request method for the specified string. + * + * @deprecated Use @ref OFHTTPRequestMethodParseString instead. + * + * @param string The string for which the request method should be returned + * @return The request method for the specified string + * @throw OFInvalidFormatException The specified string is not a valid HTTP + * request method + */ +extern OFHTTPRequestMethod OFHTTPRequestMethodParseName(OFString *string) + OF_DEPRECATED(ObjFW, 1, 1, "Use OFHTTPRequestMethodParseString instead"); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -27,37 +27,37 @@ #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "OFUnsupportedVersionException.h" -const char * -OFHTTPRequestMethodName(OFHTTPRequestMethod method) +OFString * +OFHTTPRequestMethodString(OFHTTPRequestMethod method) { switch (method) { case OFHTTPRequestMethodOptions: - return "OPTIONS"; - case OFHTTPRequestMethodGet: - return "GET"; - case OFHTTPRequestMethodHead: - return "HEAD"; - case OFHTTPRequestMethodPost: - return "POST"; - case OFHTTPRequestMethodPut: - return "PUT"; - case OFHTTPRequestMethodDelete: - return "DELETE"; - case OFHTTPRequestMethodTrace: - return "TRACE"; - case OFHTTPRequestMethodConnect: - return "CONNECT"; - } - - return NULL; + return @"OPTIONS"; + case OFHTTPRequestMethodGet: + return @"GET"; + case OFHTTPRequestMethodHead: + return @"HEAD"; + case OFHTTPRequestMethodPost: + return @"POST"; + case OFHTTPRequestMethodPut: + return @"PUT"; + case OFHTTPRequestMethodDelete: + return @"DELETE"; + case OFHTTPRequestMethodTrace: + return @"TRACE"; + case OFHTTPRequestMethodConnect: + return @"CONNECT"; + } + + return nil; } OFHTTPRequestMethod -OFHTTPRequestMethodParseName(OFString *string) +OFHTTPRequestMethodParseString(OFString *string) { if ([string isEqual: @"OPTIONS"]) return OFHTTPRequestMethodOptions; if ([string isEqual: @"GET"]) return OFHTTPRequestMethodGet; @@ -74,10 +74,24 @@ if ([string isEqual: @"CONNECT"]) return OFHTTPRequestMethodConnect; @throw [OFInvalidFormatException exception]; } + +/* Deprecated */ +const char * +OFHTTPRequestMethodName(OFHTTPRequestMethod method) +{ + return OFHTTPRequestMethodString(method).UTF8String; +} + +/* Deprecated */ +OFHTTPRequestMethod +OFHTTPRequestMethodParseName(OFString *string) +{ + return OFHTTPRequestMethodParseString(string); +} @implementation OFHTTPRequest @synthesize IRI = _IRI, method = _method, headers = _headers; + (instancetype)requestWithIRI: (OFIRI *)IRI @@ -241,11 +255,11 @@ } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); - const char *method = OFHTTPRequestMethodName(_method); + OFString *method = OFHTTPRequestMethodString(_method); OFString *indentedHeaders, *remoteAddress, *ret; indentedHeaders = [_headers.description stringByReplacingOccurrencesOfString: @"\n" withString: @"\n\t"]; @@ -255,11 +269,11 @@ else remoteAddress = nil; ret = [[OFString alloc] initWithFormat: @"<%@:\n\tIRI = %@\n" - @"\tMethod = %s\n" + @"\tMethod = %@\n" @"\tHeaders = %@\n" @"\tRemote address = %@\n" @">", self.class, _IRI, method, indentedHeaders, remoteAddress]; Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -380,11 +380,11 @@ if (pos == OFNotFound) return [self sendErrorAndClose: 400]; method = [line substringToIndex: pos]; @try { - _method = OFHTTPRequestMethodParseName(method); + _method = OFHTTPRequestMethodParseString(method); } @catch (OFInvalidArgumentException *e) { return [self sendErrorAndClose: 405]; } @try { @@ -733,13 +733,13 @@ return 0; } } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer); + return _socket.hasDataInReadBuffer; } - (int)fileDescriptorForReading { return _socket.fileDescriptorForReading; Index: src/OFInflateStream.m ================================================================== --- src/OFInflateStream.m +++ src/OFInflateStream.m @@ -672,13 +672,13 @@ { return ((id )_stream) .fileDescriptorForReading; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer || + return (_stream.hasDataInReadBuffer || _bufferLength - _bufferIndex > 0); } - (void)close { Index: src/OFKernelEventObserver.m ================================================================== --- src/OFKernelEventObserver.m +++ src/OFKernelEventObserver.m @@ -206,15 +206,20 @@ { void *pool = objc_autoreleasePoolPush(); bool foundInReadBuffer = false; for (id object in [[_readObjects copy] autorelease]) { - void *pool2 = objc_autoreleasePoolPush(); + void *pool2; + + if (![object isKindOfClass: [OFStream class]]) + continue; + + pool2 = objc_autoreleasePoolPush(); - if ([object isKindOfClass: [OFStream class]] && - [object hasDataInReadBuffer] && - ![(OFStream *)object of_isWaitingForDelimiter]) { + if ([object hasDataInReadBuffer] && + (![object of_isWaitingForDelimiter] || + [object lowlevelHasDataInReadBuffer])) { if ([_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: object]; foundInReadBuffer = true; Index: src/OFLHADecompressingStream.m ================================================================== --- src/OFLHADecompressingStream.m +++ src/OFLHADecompressingStream.m @@ -505,13 +505,13 @@ { return ((id )_stream) .fileDescriptorForReading; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer || + return (_stream.hasDataInReadBuffer || _bufferLength - _bufferIndex > 0); } - (void)close { Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -1389,8 +1389,20 @@ * implementation when subclassing! * * @return Whether the lowlevel is at the end of the stream */ - (bool)lowlevelIsAtEndOfStream; + +/** + * @brief Returns whether the lowlevel has data in the read buffer. + * + * @warning Do not call this directly! + * + * @note Override this method in case your stream can buffer data itself, such + * as when implementing @ref OFTLSStream. If not overridden, it always + * returns false. + * @return Whether the lowlevel has data in the read buffer + */ +- (bool)lowlevelHasDataInReadBuffer; @end OF_ASSUME_NONNULL_END Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -94,24 +94,29 @@ OFFreeMemory(_writeBuffer); [super dealloc]; } -- (bool)lowlevelIsAtEndOfStream -{ - OF_UNRECOGNIZED_SELECTOR -} - - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } + +- (bool)lowlevelIsAtEndOfStream +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (bool)lowlevelHasDataInReadBuffer +{ + return false; +} - (id)copy { return [self retain]; } @@ -1184,11 +1189,11 @@ } } - (bool)hasDataInReadBuffer { - return (_readBufferLength > 0); + return (_readBufferLength > 0 || [self lowlevelHasDataInReadBuffer]); } - (bool)canBlock { return _canBlock; Index: src/OFTLSStream.h ================================================================== --- src/OFTLSStream.h +++ src/OFTLSStream.h @@ -59,17 +59,16 @@ * * This class is a class cluster and returns a suitable OFTLSStream subclass, * if available. * * Subclasses need to override @ref lowlevelReadIntoBuffer:length:, - * @ref lowlevelWriteBuffer:length: and - * @ref asyncPerformClientHandshakeWithHost:runLoopMode:. The method - * @ref hasDataInReadBuffer should be overridden to return `true` if the TLS - * stream has cached unprocessed data internally, while returning - * `self.underlyingStream.hasDataInReadBuffer` if it does not have any - * unprocessed data. In order to get access to the underlying stream, - * @ref underlyingStream can be used. + * @ref lowlevelWriteBuffer:length:, + * @ref lowlevelHasDataInReadBuffer and + * @ref asyncPerformClientHandshakeWithHost:runLoopMode:. + * + * In order to get access to the underlying stream, @ref underlyingStream can + * be used. */ @interface OFTLSStream: OFStream { OFStream @@ -107,11 +106,11 @@ * @param stream The stream to use as underlying stream. Must not be closed * before the TLS stream is closed. * @return A new, autoreleased TLS stream */ + (instancetype)streamWithStream: (OFStream *)stream; + OFReadyForWritingObserving> *)stream; /** * @brief Initializes the TLS stream with the specified stream as its * underlying stream. * @@ -118,11 +117,11 @@ * @param stream The stream to use as underlying stream. Must not be closed * before the TLS stream is closed. * @return An initialized TLS stream */ - (instancetype)initWithStream: (OFStream *)stream + OFReadyForWritingObserving> *)stream OF_DESIGNATED_INITIALIZER; /** * @brief Asynchronously performs the TLS client handshake for the specified * host and calls the delegate afterwards. Index: src/OFTLSStream.m ================================================================== --- src/OFTLSStream.m +++ src/OFTLSStream.m @@ -139,16 +139,10 @@ - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } -- (bool)hasDataInReadBuffer -{ - return (super.hasDataInReadBuffer || - _underlyingStream.hasDataInReadBuffer); -} - - (bool)lowlevelIsAtEndOfStream { return _underlyingStream.atEndOfStream; } Index: src/OFTarArchive.m ================================================================== --- src/OFTarArchive.m +++ src/OFTarArchive.m @@ -360,13 +360,13 @@ @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer); + return _stream.hasDataInReadBuffer; } - (int)fileDescriptorForReading { return ((id )_stream) Index: src/OFZIPArchive.m ================================================================== --- src/OFZIPArchive.m +++ src/OFZIPArchive.m @@ -939,14 +939,13 @@ } return ret; } -- (bool)hasDataInReadBuffer +- (bool)lowlevelHasDataInReadBuffer { - return (super.hasDataInReadBuffer || - [_decompressedStream hasDataInReadBuffer]); + return ((OFStream *)_decompressedStream).hasDataInReadBuffer; } - (int)fileDescriptorForReading { return ((id )_decompressedStream) Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -59,12 +59,12 @@ [super dealloc]; } - (OFString *)description { - const char *method = OFHTTPRequestMethodName(_request.method); + OFString *method = OFHTTPRequestMethodString(_request.method); return [OFString stringWithFormat: - @"An HTTP %s request with IRI %@ failed with code %hd!", method, + @"An HTTP %@ request with IRI %@ failed with code %hd!", method, _request.IRI, _response.statusCode]; } @end Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -289,10 +289,16 @@ # define OF_DESIGNATED_INITIALIZER \ __attribute__((__objc_designated_initializer__)) #else # define OF_DESIGNATED_INITIALIZER #endif + +#ifdef __GNUC__ +# define OF_DEPRECATED(project, major, minor, msg) \ + __attribute__((__deprecated__("Deprecated in " #project " " \ + #major "." #minor ": " msg))) +#endif #if __has_attribute(__objc_boxable__) # define OF_BOXABLE __attribute__((__objc_boxable__)) #else # define OF_BOXABLE Index: src/tls/OFGnuTLSTLSStream.m ================================================================== --- src/tls/OFGnuTLSTLSStream.m +++ src/tls/OFGnuTLSTLSStream.m @@ -17,11 +17,10 @@ #include #import "OFGnuTLSTLSStream.h" #import "OFData.h" -#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" @@ -184,32 +183,14 @@ } return ret; } -- (bool)hasDataInReadBuffer -{ - if (gnutls_record_check_pending(_session) > 0) - return true; - - return super.hasDataInReadBuffer; -} - -- (bool)of_isWaitingForDelimiter -{ - /* FIXME: There should be a non-private API for this. */ - - /* - * If we still have pending data in the session, we haven't processed - * it yet to see if our delimiter is in there. So return false here, as - * that will signal the stream as ready for reading, which in turn will - * cause a read and checking for the delimiter. - */ - if (gnutls_record_check_pending(_session) > 0) - return false; - - return super.of_waitingForDelimiter; +- (bool)lowlevelHasDataInReadBuffer +{ + return (_underlyingStream.hasDataInReadBuffer || + gnutls_record_check_pending(_session) > 0); } - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { Index: src/tls/OFOpenSSLTLSStream.m ================================================================== --- src/tls/OFOpenSSLTLSStream.m +++ src/tls/OFOpenSSLTLSStream.m @@ -17,11 +17,10 @@ #include #import "OFOpenSSLTLSStream.h" #import "OFData.h" -#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" @@ -195,42 +194,14 @@ } return bytesWritten; } -- (bool)hasDataInReadBuffer -{ - if (SSL_pending(_SSL) > 0 || BIO_ctrl_pending(_readBIO) > 0) - return true; - - return super.hasDataInReadBuffer; -} - -- (bool)of_isWaitingForDelimiter -{ - /* FIXME: There should be a non-private API for this. */ - - /* - * If we still have pending data in the SSL connection, we haven't - * processed it yet to see if our delimiter is in there. So return - * false here, as that will signal the stream as ready for reading, - * which in turn will cause a read and checking for the delimiter. - */ - if (SSL_pending(_SSL)) - return false; - - /* - * If we still have data in our read BIO, it hasn't been processed by - * OpenSSL yet. As we have no idea what's in there, return false to - * signal the stream as ready for reading, which in turn will cause a - * read to check for the delimiter and in turn make OpenSSL process the - * data in the read BIO. - */ - if (BIO_ctrl_pending(_readBIO) > 0) - return false; - - return super.of_waitingForDelimiter; +- (bool)lowlevelHasDataInReadBuffer +{ + return (_underlyingStream.hasDataInReadBuffer || + SSL_has_pending(_SSL) || BIO_ctrl_pending(_readBIO) > 0); } - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { Index: src/tls/OFSecureTransportTLSStream.m ================================================================== --- src/tls/OFSecureTransportTLSStream.m +++ src/tls/OFSecureTransportTLSStream.m @@ -16,11 +16,10 @@ #include "config.h" #include #import "OFSecureTransportTLSStream.h" -#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" #import "OFTLSHandshakeFailedException.h" @@ -167,38 +166,17 @@ errNo: 0]; return bytesWritten; } -- (bool)hasDataInReadBuffer -{ - size_t bufferSize; - - if (SSLGetBufferedReadSize(_context, &bufferSize) == noErr && - bufferSize > 0) - return true; - - return super.hasDataInReadBuffer; -} - -- (bool)of_isWaitingForDelimiter -{ - size_t bufferSize; - - /* FIXME: There should be a non-private API for this. */ - - /* - * If we still have pending data in the context, we haven't processed - * it yet to see if our delimiter is in there. So return false here, as - * that will signal the stream as ready for reading, which in turn will - * cause a read and checking for the delimiter. - */ - if (SSLGetBufferedReadSize(_context, &bufferSize) == noErr && - bufferSize > 0) - return false; - - return super.of_waitingForDelimiter; +- (bool)lowlevelHasDataInReadBuffer +{ + size_t bufferSize; + + return (_underlyingStream.hasDataInReadBuffer || + (SSLGetBufferedReadSize(_context, &bufferSize) == noErr && + bufferSize > 0)); } - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { Index: utils/ofarc/localization/de.json ================================================================== --- utils/ofarc/localization/de.json +++ utils/ofarc/localization/de.json @@ -5,15 +5,17 @@ * * Permission to use, copy, modify, and/or distribute this localization for * any purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "usage": [ + usage: [ "Benutzung: %[prog] -[acCfhlnpqtvx] archiv.zip [datei1 datei2 ...]" ], - "full_usage": [ + full_usage: [ "Optionen:\n", " -a --append Zu Archiv hinzufügen\n", " -c --create Archiv erstellen\n", " -C --directory In angegebenes Verzeichnis entpacken\n", " -E --encoding Das Encoding des Archivs (nur tar-Dateien)\n", @@ -36,104 +38,104 @@ "Fehler: -%[shortopt1] / --%[longopt1], -%[shortopt2] / ", "--%[longopt2], -%[shortopt3] / --%[longopt3], ", "-%[shortopt4] / --%[longopt4] und\n", " -%[shortopt5] / --%[longopt5] schließen sich gegenseitig aus!" ], - "option_takes_no_argument": "%[prog]: Option --%[opt] nimmt kein Argument", - "long_option_requires_argument": [ + option_takes_no_argument: "%[prog]: Option --%[opt] nimmt kein Argument", + long_option_requires_argument: [ "%[prog]: Option --%[opt] benötigt ein Argument" ], - "option_requires_argument": "%[prog]: Option -%[opt] benötigt ein Argument", - "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]", - "unknown_option": "%[prog]: Unbekannte Option: -%[opt]", - "invalid_encoding": "%[prog]: Invalid encoding: %[encoding]", - "writing_not_supported": [ + option_requires_argument: "%[prog]: Option -%[opt] benötigt ein Argument", + unknown_long_option: "%[prog]: Unbekannte Option: --%[opt]", + unknown_option: "%[prog]: Unbekannte Option: -%[opt]", + invalid_encoding: "%[prog]: Invalid encoding: %[encoding]", + writing_not_supported: [ "Schreiben von Dateien des Typs %[type] wird (noch) nicht unterstützt!" ], - "failed_to_create_directory": [ + failed_to_create_directory: [ "Fehler beim Erstellen des Verzeichnis %[dir]: %[error]" ], - "failed_to_open_file": "Fehler beim Öffnen der Datei %[file]: %[error]", - "unknown_archive_type": "Unbekannter Archivtyp: %[type]", - "failed_to_read_file": "Fehler beim Lesen der Datei %[file]: %[error]", - "failed_to_write_file": "Fehler beim Schreiben der Datei %[file]: %[error]", - "failed_to_seek_in_file": "Fehler beim Suchen in Datei %[file]: %[error]", - "file_is_not_a_valid_archive": "Datei %[file] ist kein gültiges Archiv!", - "file_skipped": "übersprungen", - "ask_overwrite": "%[file] überschreiben? [ynAN?]", - "ask_overwrite_help": [ + failed_to_open_file: "Fehler beim Öffnen der Datei %[file]: %[error]", + unknown_archive_type: "Unbekannter Archivtyp: %[type]", + failed_to_read_file: "Fehler beim Lesen der Datei %[file]: %[error]", + failed_to_write_file: "Fehler beim Schreiben der Datei %[file]: %[error]", + failed_to_seek_in_file: "Fehler beim Suchen in Datei %[file]: %[error]", + file_is_not_a_valid_archive: "Datei %[file] ist kein gültiges Archiv!", + file_skipped: "übersprungen", + ask_overwrite: "%[file] überschreiben? [ynAN?]", + ask_overwrite_help: [ " y: Ja\n", " n: Nein\n", " A: Immer\n", " N: Nie" ], - "skipping_file": "Überspringe %[file]...", - "extracting_file": "Entpacke %[file]...", - "extracting_file_percent": "Entpacke %[file]... %[percent]%", - "extracting_file_done": "Entpacke %[file]... fertig", - "cannot_list_gz": "Kann Dateien eines .gz-Archivs nicht auflisten!", - "cannot_extract_specific_file_from_gz": [ + skipping_file: "Überspringe %[file]...", + extracting_file: "Entpacke %[file]...", + extracting_file_percent: "Entpacke %[file]... %[percent]%", + extracting_file_done: "Entpacke %[file]... fertig", + cannot_list_gz: "Kann Dateien eines .gz-Archivs nicht auflisten!", + cannot_extract_specific_file_from_gz: [ "Kann keine spezifische Datei aus einem .gz-Archiv entpacken!" ], - "cannot_print_specific_file_from_gz": [ + cannot_print_specific_file_from_gz: [ "Kann keine spezifische Datei aus einem .gz-Archiv ausgeben!" ], - "list_size": [ + list_size: [ "Größe: ", [ {"size == 1": "1 Byte"}, {"": "%[size] Bytes"} ] ], - "list_posix_permissions": "POSIX-Berechtigungen: %[perm]", - "list_owner_account_id": "Besitzerkontennummer: %[id]", - "list_group_owner_account_id": "Gruppenbesitzerkontennummer: %[id]", - "list_owner_account_name": "Besitzerkontenname: %[name]", - "list_group_owner_account_name": "Gruppebesitzerkontenname: %[name]", - "list_header_level": "Header-Level: %[level]", - "list_modification_date": "Änderungsdatum: %[date]", - "list_type_normal": "Typ: Normale Datei", - "list_type_hardlink": "Typ: Harter Link", - "list_type_symlink": "Typ: Symbolischer Link", - "list_link_target": "Zieldateiname: %[target]", - "list_type_character_device": "Typ: Zeichenorientiertes Gerät", - "list_type_block_device": "Typ: Blockorientiertes Gerät", - "list_device_major": "Major-Nummer des Geräts: %[major]", - "list_device_minor": "Minor-Nummer des Geräts: %[minor]", - "list_type_directory": "Typ: Verzeichnis", - "list_type_fifo": "Typ: FIFO", - "list_type_contiguous_file": "Typ: Zusammenhängende Datei", - "list_type_unknown": "Typ: Unbekannt", - "list_compressed_size": [ + list_posix_permissions: "POSIX-Berechtigungen: %[perm]", + list_owner_account_id: "Besitzerkontennummer: %[id]", + list_group_owner_account_id: "Gruppenbesitzerkontennummer: %[id]", + list_owner_account_name: "Besitzerkontenname: %[name]", + list_group_owner_account_name: "Gruppebesitzerkontenname: %[name]", + list_header_level: "Header-Level: %[level]", + list_modification_date: "Änderungsdatum: %[date]", + list_type_normal: "Typ: Normale Datei", + list_type_hardlink: "Typ: Harter Link", + list_type_symlink: "Typ: Symbolischer Link", + list_link_target: "Zieldateiname: %[target]", + list_type_character_device: "Typ: Zeichenorientiertes Gerät", + list_type_block_device: "Typ: Blockorientiertes Gerät", + list_device_major: "Major-Nummer des Geräts: %[major]", + list_device_minor: "Minor-Nummer des Geräts: %[minor]", + list_type_directory: "Typ: Verzeichnis", + list_type_fifo: "Typ: FIFO", + list_type_contiguous_file: "Typ: Zusammenhängende Datei", + list_type_unknown: "Typ: Unbekannt", + list_compressed_size: [ "Komprimierte Größe: ", [ {"size == 1": "1 Byte"}, {"": "%[size] Bytes"} ] ], - "list_uncompressed_size": [ + list_uncompressed_size: [ "Unkomprimierte Größe: ", [ {"size == 1": "1 Byte"}, {"": "%[size] Bytes"} ] ], - "list_compression_method": "Kompressionsmethode: %[method]", - "list_osid": "Betriebssystem-Identifikator: %[osid]", - "list_extensions": "Erweiterungen: %[extensions]", - "list_version_made_by": "Erstellt mit Version: %[version]", - "list_min_version_needed": "Mindestens benötigte Version: %[version]", - "list_general_purpose_bit_flag": "General Purpose Bit Flag: %[gpbf]", - "list_extra_field": "Extra-Feld: %[extra]", - "list_comment": "Kommentar: %[comment]", - "refusing_to_extract_file": "Verweigere Entpacken von %[file]!", - "file_not_in_archive": "Datei %[file] ist nicht im Archiv!", - "print_no_file_specified": [ + list_compression_method: "Kompressionsmethode: %[method]", + list_osid: "Betriebssystem-Identifikator: %[osid]", + list_extensions: "Erweiterungen: %[extensions]", + list_version_made_by: "Erstellt mit Version: %[version]", + list_min_version_needed: "Mindestens benötigte Version: %[version]", + list_general_purpose_bit_flag: "General Purpose Bit Flag: %[gpbf]", + list_extra_field: "Extra-Feld: %[extra]", + list_comment: "Kommentar: %[comment]", + refusing_to_extract_file: "Verweigere Entpacken von %[file]!", + file_not_in_archive: "Datei %[file] ist nicht im Archiv!", + print_no_file_specified: [ "Benötige eine oder mehrere Dateien zum Ausgeben!" ], - "add_no_file_specified": [ + add_no_file_specified: [ "Benötige eine oder mehrere Dateien zum Hinzufügen!" ], - "adding_file": "Füge %[file] hinzu...", - "adding_file_percent": "Füge %[file] hinzu... %[percent]%", - "adding_file_done": "Füge %[file] hinzu... fertig" + adding_file: "Füge %[file] hinzu...", + adding_file_percent: "Füge %[file] hinzu... %[percent]%", + adding_file_done: "Füge %[file] hinzu... fertig", } Index: utils/ofarc/localization/localizations.json ================================================================== --- utils/ofarc/localization/localizations.json +++ utils/ofarc/localization/localizations.json @@ -5,16 +5,18 @@ * * Permission to use, copy, modify, and/or distribute this mapping for any * purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "de": { + de: { "": "de" }, - "deutsch": { + deutsch: { "": "de" }, - "german": { + german: { "": "de" - } + }, } Index: utils/ofdns/localization/de.json ================================================================== --- utils/ofdns/localization/de.json +++ utils/ofdns/localization/de.json @@ -5,24 +5,26 @@ * * Permission to use, copy, modify, and/or distribute this localization for * any purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "usage": "Benutzung: %[prog] -[chst] domain1 [domain2 ...]", - "full_usage": [ + usage: "Benutzung: %[prog] -[chst] domain1 [domain2 ...]", + full_usage: [ "Optionen:\n", " -c --class Die anzufragende DNS-Klasse (standardmäßig IN)\n", " -h --help Diese Hilfe anzeigen\n", " -s --server Der abzufragende Server\n", " -t --type Der anzufragende Record-Typ (standardmäßig ALL,\n", " kann wiederholt werden)\n", " --tcp Benutzung von TCP erzwingen" ], - "long_option_requires_argument": [ + long_option_requires_argument: [ "%[prog]: Option --%[opt] benötigt ein Argument" ], - "option_requires_argument": "%[prog]: Option -%[opt] benötigt ein Argument", - "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]", - "unknown_option": "%[prog]: Unbekannte Option: -%[opt]", - "failed_to_resolve": "Auflösen fehlgeschlagen: %[exception]" + option_requires_argument: "%[prog]: Option -%[opt] benötigt ein Argument", + unknown_long_option: "%[prog]: Unbekannte Option: --%[opt]", + unknown_option: "%[prog]: Unbekannte Option: -%[opt]", + failed_to_resolve: "Auflösen fehlgeschlagen: %[exception]", } Index: utils/ofdns/localization/localizations.json ================================================================== --- utils/ofdns/localization/localizations.json +++ utils/ofdns/localization/localizations.json @@ -5,16 +5,18 @@ * * Permission to use, copy, modify, and/or distribute this mapping for any * purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "de": { + de: { "": "de" }, - "deutsch": { + deutsch: { "": "de" }, - "german": { + german: { "": "de" - } + }, } Index: utils/ofhash/localization/de.json ================================================================== --- utils/ofhash/localization/de.json +++ utils/ofhash/localization/de.json @@ -5,15 +5,17 @@ * * Permission to use, copy, modify, and/or distribute this localization for * any purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "usage": [ + usage: [ "Benutzung: %[prog] [--md5] [--ripemd160] [--sha1] [--sha224] ", "[--sha256] [--sha384] [--sha512] datei1 [datei2 ...]" ], - "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]", - "unknown_option": "%[prog]: Unbekannte Option: -%[opt]", - "failed_to_open_file": "Fehler beim Öffnen der Datei %[file]: %[error]", - "failed_to_read_file": "Fehler beim Lesen der Datei %[file]: %[error]" + unknown_long_option: "%[prog]: Unbekannte Option: --%[opt]", + unknown_option: "%[prog]: Unbekannte Option: -%[opt]", + failed_to_open_file: "Fehler beim Öffnen der Datei %[file]: %[error]", + failed_to_read_file: "Fehler beim Lesen der Datei %[file]: %[error]", } Index: utils/ofhash/localization/localizations.json ================================================================== --- utils/ofhash/localization/localizations.json +++ utils/ofhash/localization/localizations.json @@ -5,16 +5,18 @@ * * Permission to use, copy, modify, and/or distribute this mapping for any * purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "de": { + de: { "": "de" }, - "deutsch": { + deutsch: { "": "de" }, - "german": { + german: { "": "de" - } + }, } Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -371,11 +371,11 @@ void *pool = objc_autoreleasePoolPush(); method = method.uppercaseString; @try { - _method = OFHTTPRequestMethodParseName(method); + _method = OFHTTPRequestMethodParseString(method); } @catch (OFInvalidArgumentException *e) { [OFStdErr writeLine: OF_LOCALIZED(@"invalid_input_method", @"%[prog]: Invalid request method %[method]!", @"prog", [OFApplication programName], @"method", method)]; Index: utils/ofhttp/localization/de.json ================================================================== --- utils/ofhttp/localization/de.json +++ utils/ofhttp/localization/de.json @@ -5,13 +5,15 @@ * * Permission to use, copy, modify, and/or distribute this localization for * any purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "usage": "Benutzung: %[prog] -[cehHmoOPqv] iri1 [iri2 ...]", - "full_usage": [ + usage: "Benutzung: %[prog] -[cehHmoOPqv] iri1 [iri2 ...]", + full_usage: [ "Optionen:\n", " -b --body Angegebene Datei als Body übergeben\n", " (- für Standard-Eingabe)\n", " -c --continue Download von existierender Datei ", "fortsetzen\n", @@ -27,95 +29,95 @@ " -v --verbose Ausführlicher Modus (gibt Header aus)\n", " --insecure TLS-Fehler ignorieren und unsichere\n", " Weiterleitungen erlauben\n", " --ignore-status HTTP Status-Code ignorieren" ], - "invalid_input_header": "%[prog]: Header müssen im Format Name:Wert sein!", - "invalid_input_method": "%[prog]: Ungültige Request-Methode %[method]!", - "invalid_input_proxy": "%[prog]: Proxy muss im Format Host:Port sein!", - "long_argument_missing": "%[prog]: Argument für Option --%[opt] fehlt", - "argument_missing": "%[prog]: Argument für option -%[opt] fehlt", - "option_takes_no_argument": "%[prog]: Option --%[opt] nimmt kein Argument", - "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]", - "unknown_option": "%[prog]: Unbekannte Option: -%[opt]", - "quiet_xor_verbose": [ + invalid_input_header: "%[prog]: Header müssen im Format Name:Wert sein!", + invalid_input_method: "%[prog]: Ungültige Request-Methode %[method]!", + invalid_input_proxy: "%[prog]: Proxy muss im Format Host:Port sein!", + long_argument_missing: "%[prog]: Argument für Option --%[opt] fehlt", + argument_missing: "%[prog]: Argument für option -%[opt] fehlt", + option_takes_no_argument: "%[prog]: Option --%[opt] nimmt kein Argument", + unknown_long_option: "%[prog]: Unbekannte Option: --%[opt]", + unknown_option: "%[prog]: Unbekannte Option: -%[opt]", + quiet_xor_verbose: [ "%[prog]: -q / --quiet und -v / --verbose schließen sich gegenseitig ", "aus!" ], - "output_xor_detect_filename": [ + output_xor_detect_filename: [ "%[prog]: -o / --output und -O / --detect-filename schließen sich ", "gegenseitig aus!" ], - "output_only_with_one_iri": [ + output_only_with_one_iri: [ "%[prog]: -o / --output kann nicht mit mehr als einer IRI benutzt ", "werden!" ], - "download_resolve_host_failed": [ + download_resolve_host_failed: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " Host auflösen fehlgeschlagen: %[exception]" ], - "download_failed_connection_failed": [ + download_failed_connection_failed: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " Verbindung fehlgeschlagen: %[exception]" ], - "download_failed_invalid_server_response": [ + download_failed_invalid_server_response: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " Ungültige Antwort vom Server!" ], - "no_tls_support": [ + no_tls_support: [ "%[prog]: Keine TLS-Unterstützung in ObjFW!\n", " Um via HTTPS runterzuladen müssen Sie entweder ObjFW mit TLS-", "Unterstützung\n", " kompilieren oder eine Bibliothek mittels „preload” laden, welche ", "TLS-Support\n", " zu ObjFW hinzufügt!" ], - "download_failed_tls_handshake_failed": [ + download_failed_tls_handshake_failed: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " TLS-Handshake fehlgeschlagen: %[error]" ], - "download_failed_read_or_write_failed_any": "Lesen oder Schreiben", - "download_failed_read_or_write_failed_read": "Lesen", - "download_failed_read_or_write_failed_write": "Schreiben", - "download_failed_read_or_write_failed": [ + download_failed_read_or_write_failed_any: "Lesen oder Schreiben", + download_failed_read_or_write_failed_read: "Lesen", + download_failed_read_or_write_failed_write: "Schreiben", + download_failed_read_or_write_failed: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " %[error]: %[exception]" ], - "download_failed": [ + download_failed: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " HTTP Status-Code: %[code]" ], - "download_error": "Fehler!", - "download_failed_exception": [ + download_error: "Fehler!", + download_failed_exception: [ "%[prog]: Fehler beim Download von <%[iri]>!\n", " %[exception]" ], - "download_done": "Fertig!", - "invalid_iri": "%[prog]: Ungültige IRI: <%[iri]>!", - "invalid_scheme": "%[prog]: Ungültiges Schema: <%[iri]>!", - "type_unknown": "unbekannt", - "size_gib": "%[num] GiB", - "size_mib": "%[num] MiB", - "size_kib": "%[num] KiB", - "size_bytes": [ + download_done: "Fertig!", + invalid_iri: "%[prog]: Ungültige IRI: <%[iri]>!", + invalid_scheme: "%[prog]: Ungültiges Schema: <%[iri]>!", + type_unknown: "unbekannt", + size_gib: "%[num] GiB", + size_mib: "%[num] MiB", + size_kib: "%[num] KiB", + size_bytes: [ [ {"num == 1": "1 Byte"}, {"": "%[num] Bytes"} ] ], - "size_unknown": "unbekannt", - "info_name_unaligned": "Name: %[name]", - "info_name": "Name: %[name]", - "info_type": "Typ: %[type]", - "info_size": "Größe: %[size]", - "output_already_exists": "%[prog]: Datei %[filename] existiert bereits!", - "failed_to_open_output": [ + size_unknown: "unbekannt", + info_name_unaligned: "Name: %[name]", + info_name: "Name: %[name]", + info_type: "Typ: %[type]", + info_size: "Größe: %[size]", + output_already_exists: "%[prog]: Datei %[filename] existiert bereits!", + failed_to_open_output: [ "%[prog]: Kann Datei %[filename] nicht öffnen: %[exception]" ], - "eta_days": "%[num] t ", - "progress_bytes": [ + eta_days: "%[num] t ", + progress_bytes: [ [ {"num == 1": "1 Byte "}, {"": "%[num] Bytes"} ] - ] + ], } Index: utils/ofhttp/localization/localizations.json ================================================================== --- utils/ofhttp/localization/localizations.json +++ utils/ofhttp/localization/localizations.json @@ -5,16 +5,18 @@ * * Permission to use, copy, modify, and/or distribute this mapping for any * purpose with or without fee is hereby granted. */ +/* vim: se ft=javascript sw=4 et: */ + { - "de": { + de: { "": "de" }, - "deutsch": { + deutsch: { "": "de" }, - "german": { + german: { "": "de" - } + }, } Index: utils/ofhttpd/OFHTTPD.m ================================================================== --- utils/ofhttpd/OFHTTPD.m +++ utils/ofhttpd/OFHTTPD.m @@ -181,12 +181,12 @@ requestBody: (OFStream *)requestBody response: (OFHTTPResponse *)response { OFString *path; - OFLog(@"Handling %s request %@", - OFHTTPRequestMethodName(request.method), request); + OFLog(@"Handling %@ request %@", + OFHTTPRequestMethodString(request.method), request); if (request.method != OFHTTPRequestMethodGet && request.method != OFHTTPRequestMethodHead) { response.statusCode = 405; return;