Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -2,10 +2,20 @@ * Changes of existing features or bugfixes + New features This file only contains the most significant changes. +ObjFW 1.0 -> ObjFW 1.0.1, 2023-09-10 + * Hanging connections with OFTLSStream have been fixed when using OpenSSL + * The same fix as for OpenSSL has been applied to GnuTLS and SecureTransport + out of caution, even though there have been no hangs in practice + * The build system has been updated to fix building .frameworks among other + minor changes + * Some headers have been changed to fix compatibility with ObjC++ + * Warnings about empty .o files on x86_64 Darwin have been fixed + * The OFDate documentation has been improved to list supported formats + ObjFW 0.90.2 -> ObjFW 1.0, 2023-08-29 + First stable release with stable API and ABI * Too many changes to list, as it has been almost 6 years since the last release. See commits in the repository for details. Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -26,11 +26,11 @@ release: docs echo "Generating tarball for version ${PACKAGE_VERSION}..." rm -fr objfw-${PACKAGE_VERSION} objfw-${PACKAGE_VERSION}.tar \ objfw-${PACKAGE_VERSION}.tar.gz fossil tarball --name objfw-${PACKAGE_VERSION} current - \ - --exclude '.fossil*,.git*,objfw.spec' | ofarc -ttgz -xq - + --exclude '.fossil*,.git*' | ofarc -ttgz -xq - cp configure config.h.in objfw-${PACKAGE_VERSION}/ ofarc -cq objfw-${PACKAGE_VERSION}.tar objfw-${PACKAGE_VERSION} rm -fr objfw-${PACKAGE_VERSION} gzip -9 objfw-${PACKAGE_VERSION}.tar rm -f objfw-${PACKAGE_VERSION}.tar Index: build-aux/m4/buildsys.m4 ================================================================== --- build-aux/m4/buildsys.m4 +++ build-aux/m4/buildsys.m4 @@ -27,10 +27,14 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_ENABLE(rpath, AS_HELP_STRING([--disable-rpath], [do not use rpath])) + AC_ARG_ENABLE(silent-rules, + AS_HELP_STRING([--disable-silent-rules], + [print executed commands during build])) + case "$build_os" in darwin*) case "$host_os" in darwin*) AC_SUBST(BUILD_AND_HOST_ARE_DARWIN, yes) @@ -125,10 +129,15 @@ "$($TPUT AF 4 2>/dev/null)") AC_SUBST(TERM_SETAF6, "$($TPUT AF 6 2>/dev/null)") fi ]) + + AS_IF([test x"$enable_silent_rules" != x"no"], [ + AC_SUBST(SILENT, '.SILENT:') + AC_SUBST(MAKEFLAGS_SILENT, '-s') + ]) ]) ]) AC_DEFUN([BUILDSYS_CHECK_IOS], [ case "$host_os" in @@ -238,12 +247,12 @@ LIB_CFLAGS='-fPIC -DPIC' LIB_LDFLAGS='-shared -Wl,-soname=$$out.${LIB_MAJOR}' LIB_LDFLAGS_INSTALL_NAME='' LIB_PREFIX='lib' LIB_SUFFIX='.so' - INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' - UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' + INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} ${DESTDIR}${libdir}/$$i' + UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH}' CLEAN_LIB='' ;; hppa*-*-hpux*) AC_MSG_RESULT([HP-UX (PA-RISC)]) LIB_CFLAGS='-fPIC -DPIC' @@ -282,12 +291,12 @@ LIB_PREFIX='lib' LIB_SUFFIX='.so' AS_IF([test x"$enable_rpath" != x"no"], [ LDFLAGS_RPATH='-Wl,-rpath,${libdir}' ]) - INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' - UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' + INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH} ${DESTDIR}${libdir}/$$i' + UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.${LIB_PATCH}' CLEAN_LIB='' ;; esac AC_SUBST(LIB_CFLAGS) Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -121,32 +121,32 @@ ${AMIGA_LIB_OBJS:.o=.dep} \ ${PLUGIN_OBJS:.o=.dep} MO_FILES = ${LOCALES:.po=.mo} -.SILENT: +@SILENT@ .SUFFIXES: .SUFFIXES: .amigalib.o .beam .c .cc .class .cxx .d .erl .lib.o .java .mo .m .mm .o .plugin.o .po .py .pyc .rc .S .xpm .PHONY: all subdirs subdirs-after pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales copy-headers-into-framework ${SUBDIRS} ${SUBDIRS_AFTER} all: - ${MAKE} -s pre-all - ${MAKE} -s subdirs - ${MAKE} -s depend - ${MAKE} -s ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${STATIC_AMIGA_LIB} ${STATIC_AMIGA_LIB_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${FRAMEWORK} ${FRAMEWORK_NOINST} ${AMIGA_LIB} ${AMIGA_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales - ${MAKE} -s subdirs-after - ${MAKE} -s post-all + ${MAKE} @MAKEFLAGS_SILENT@ pre-all + ${MAKE} @MAKEFLAGS_SILENT@ subdirs + ${MAKE} @MAKEFLAGS_SILENT@ depend + ${MAKE} @MAKEFLAGS_SILENT@ ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${STATIC_AMIGA_LIB} ${STATIC_AMIGA_LIB_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${FRAMEWORK} ${FRAMEWORK_NOINST} ${AMIGA_LIB} ${AMIGA_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales + ${MAKE} @MAKEFLAGS_SILENT@ subdirs-after + ${MAKE} @MAKEFLAGS_SILENT@ post-all pre-all post-all: subdirs: ${SUBDIRS} subdirs-after: ${SUBDIRS_AFTER} ${SUBDIRS} ${SUBDIRS_AFTER}: for i in $@; do \ ${DIR_ENTER}; \ - ${MAKE} -s || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ || exit $$?; \ ${DIR_LEAVE}; \ done depend: pre-depend : >.deps @@ -192,11 +192,11 @@ fi ${FRAMEWORK} ${FRAMEWORK_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${LINK_STATUS} out="$@"; \ - if rm -fr $$out && ${MKDIR_P} $$out && ${MAKE} -s COPY_HEADERS_IF_SUBDIR=${includesubdir} COPY_HEADERS_DESTINATION=$$PWD/$@/Headers copy-headers-into-framework && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Info.plist; fi && if test -f module.modulemap; then ${MKDIR_P} $$out/Modules && ${INSTALL} -m 644 module.modulemap $$out/Modules/module.modulemap; fi && ${LD} -o $$out/$${out%.framework} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${FRAMEWORK_LDFLAGS} ${FRAMEWORK_LDFLAGS_INSTALL_NAME} ${LDFLAGS} ${FRAMEWORK_LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} $$out; then \ + if rm -fr $$out && ${MKDIR_P} $$out/Versions/${LIB_MAJOR} && ${LN_S} ${LIB_MAJOR} $@/Versions/Current && ${MAKE} @MAKEFLAGS_SILENT@ COPY_HEADERS_IF_SUBDIR=${includesubdir} COPY_HEADERS_DESTINATION=$$PWD/$@/Versions/${LIB_MAJOR}/Headers copy-headers-into-framework && ${LN_S} Versions/Current/Headers $@/Headers && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Info.plist; fi && if test -f module.modulemap; then ${MKDIR_P} $$out/Versions/${LIB_MAJOR}/Modules && ${INSTALL} -m 644 module.modulemap $$out/Versions/${LIB_MAJOR}/Modules/module.modulemap && ${LN_S} Versions/Current/Modules $@/Modules; fi && ${LD} -o $$out/Versions/${LIB_MAJOR}/$${out%.framework} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${FRAMEWORK_LDFLAGS} ${FRAMEWORK_LDFLAGS_INSTALL_NAME} ${LDFLAGS} ${FRAMEWORK_LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} $$out/Versions/${LIB_MAJOR}/$${out%.framework} && ${LN_S} Versions/Current/$${out%.framework} $@/$${out%.framework}; then \ ${LINK_OK}; \ else \ rm -fr $$out; false; \ ${LINK_FAILED}; \ fi @@ -203,11 +203,11 @@ copy-headers-into-framework: for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ cd $$i || exit 1; \ - ${MAKE} -s copy-headers-into-framework || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ copy-headers-into-framework || exit $$?; \ cd .. || exit 1; \ done if test x"${includesubdir}" = x"${COPY_HEADERS_IF_SUBDIR}"; then \ for i in "" ${INCLUDES}; do \ @@ -652,11 +652,11 @@ install: all install-extra for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} -s install || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ install || exit $$?; \ ${DIR_LEAVE}; \ done for i in "" ${SHARED_LIB}; do \ test x"$$i" = x"" && continue; \ @@ -765,11 +765,11 @@ uninstall: for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} -s uninstall || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ uninstall || exit $$?; \ ${DIR_LEAVE}; \ done for i in "" ${SHARED_LIB}; do \ test x"$$i" = x"" && continue; \ @@ -874,19 +874,19 @@ ${DELETE_FAILED}; \ fi \ fi \ done - ${MAKE} -s uninstall-extra + ${MAKE} @MAKEFLAGS_SILENT@ uninstall-extra uninstall-extra: clean: for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} -s clean || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ clean || exit $$?; \ ${DIR_LEAVE}; \ done : >.deps @@ -903,11 +903,11 @@ distclean: clean for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} -s distclean || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ distclean || exit $$?; \ ${DIR_LEAVE}; \ done for i in "" ${DISTCLEAN} .deps *~; do \ test x"$$i" = x"" && continue; \ @@ -923,11 +923,11 @@ print-hierarchy: for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ echo ${PRINT_HIERARCHY_PREFIX}$$i; \ cd $$i || exit $$?; \ - ${MAKE} -s PRINT_HIERARCHY_PREFIX=$$i/ print-hierarchy || exit $$?; \ + ${MAKE} @MAKEFLAGS_SILENT@ PRINT_HIERARCHY_PREFIX=$$i/ print-hierarchy || exit $$?; \ cd .. || exit $$?; \ done print-var: printf '%s\n' '${${VAR}}' Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -497,10 +497,11 @@ AC_MSG_RESULT($objc_runtime) case "$objc_runtime" in "ObjFW runtime") AC_DEFINE(OF_OBJFW_RUNTIME, 1, [Whether we use the ObjFW runtime]) + AC_SUBST(USE_SRCS_TAGGED_POINTERS, '${SRCS_TAGGED_POINTERS}') AC_MSG_CHECKING([whether -fobjc-runtime=objfw is supported]) old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -Xclang -fobjc-runtime=objfw" Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,26 +1,34 @@ 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 = 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@ OBJFWRT_LIB_MAJOR = 1 OBJFWRT_LIB_MINOR = 0 +OBJFWRT_LIB_PATCH = 0 OBJFWRT_LIB_MAJOR_MINOR = ${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR} OBJFWBRIDGE_SHARED_LIB = @OBJFWBRIDGE_SHARED_LIB@ OBJFWBRIDGE_STATIC_LIB = @OBJFWBRIDGE_STATIC_LIB@ OBJFWBRIDGE_FRAMEWORK = @OBJFWBRIDGE_FRAMEWORK@ +OBJFWBRIDGE_LIB_MAJOR = 1 +OBJFWBRIDGE_LIB_MINOR = 0 +OBJFWBRIDGE_LIB_PATCH = 0 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 BIN_PREFIX = @BIN_PREFIX@ BRIDGE = @BRIDGE@ CVINCLUDE_INLINE_H = @CVINCLUDE_INLINE_H@ ENCODINGS_A = @ENCODINGS_A@ @@ -78,9 +86,10 @@ USE_SRCS_APPLETALK = @USE_SRCS_APPLETALK@ USE_SRCS_FILES = @USE_SRCS_FILES@ USE_SRCS_IPX = @USE_SRCS_IPX@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_SOCKETS = @USE_SRCS_SOCKETS@ +USE_SRCS_TAGGED_POINTERS = @USE_SRCS_TAGGED_POINTERS@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ USE_SRCS_UNIX_SOCKETS = @USE_SRCS_UNIX_SOCKETS@ USE_SRCS_WINDOWS = @USE_SRCS_WINDOWS@ WRAPPER = @WRAPPER@ DELETED objfw.spec Index: objfw.spec ================================================================== --- objfw.spec +++ objfw.spec @@ -1,244 +0,0 @@ -%global libobjfw_major 1 -%global libobjfw_minor 0 -%global libobjfwrt_major 1 -%global libobjfwrt_minor 0 -%global libobjfwtls_major 1 -%global libobjfwtls_minor 0 -%if 0%{?suse_version} -%global libobjfw_pkgname libobjfw%{libobjfw_major} -%global libobjfwrt_pkgname libobjfwrt%{libobjfwrt_major} -%global libobjfwtls_pkgname libobjfwtls%{libobjfwtls_major} -%else -%global libobjfw_pkgname libobjfw -%global libobjfwrt_pkgname libobjfwrt -%global libobjfwtls_pkgname libobjfwtls -%endif - -Name: objfw -Version: 1.0 -Release: 1%{?dist} -Summary: Portable, lightweight framework for the Objective-C language - -%if 0%{?suse_version} -License: QPL-1.0 or GPL-3.0 or GPL-2.0 -Group: Development/Languages/C and C++ -%else -License: QPL or GPLv3 or GPLv2 -%endif -URL: https://objfw.nil.im -Source0: objfw-%{version}.tar.gz - -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: clang -BuildRequires: make -BuildRequires: pkgconfig(openssl) -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfw_pkgname}-devel = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}-devel = %{version}-%{release} -Requires: ofarc%{_isa} = %{version}-%{release} -Requires: ofdns%{_isa} = %{version}-%{release} -Requires: ofhash%{_isa} = %{version}-%{release} -Requires: ofhttp%{_isa} = %{version}-%{release} - -%description -ObjFW is a portable, lightweight framework for the Objective-C language. It -enables you to write an application in Objective-C that will run on any -platform supported by ObjFW without having to worry about differences between -operating systems or various frameworks you would otherwise need if you want to -be portable. - -It supports all modern Objective-C features when using Clang, but is also -compatible with GCC ≥ 4.6 to allow maximum portability. - -ObjFW also comes with its own lightweight and extremely fast Objective-C -runtime, which in real world use cases was found to be significantly faster -than both GNU's and Apple's runtime. - -%package -n %{libobjfw_pkgname} -Summary: ObjFW library -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfw_pkgname} -The %{libobjfw_pkgname} package contains the library needed by programs using -ObjFW. - -%package -n %{libobjfw_pkgname}-devel -Summary: Header files, libraries and tools for %{libobjfw_pkgname} -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}-devel = %{version}-%{release} - -%description -n %{libobjfw_pkgname}-devel -The %{libobjfw_pkgname}-devel package contains the header files, libraries and -tools to develop programs using ObjFW. - -%package -n %{libobjfwrt_pkgname} -Summary: ObjFW Objective-C runtime library - -%description -n %{libobjfwrt_pkgname} -The %{libobjfwrt_pkgname} package contains ObjFW's Objective-C runtime library. - -%package -n %{libobjfwrt_pkgname}-devel -Summary: Header files and libraries for %{libobjfwrt_pkgname} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfwrt_pkgname}-devel -The %{libobjfwrt_pkgname}-devel package contains header files and libraries for -ObjFW's Objective-C runtime library. - -%package -n %{libobjfwtls_pkgname} -Summary: TLS support for ObjFW -Requires: openssl%{_isa} >= 1.1.1 - -%description -n %{libobjfwtls_pkgname} -The %{libobjfwtls_pkgname} package contains TLS support for ObjFW - -%package -n %{libobjfwtls_pkgname}-devel -Summary: Header files and libraries for %{libobjfwtls_pkgname} -Requires: %{libobjfwtls_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfwtls_pkgname}-devel -The %{libobjfwtls_pkgname}-devel package contains header files and libraries -for TLS support for ObjFW. - -%package -n ofarc -Summary: Utility for handling ZIP, Tar and LHA archives -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofarc -ofarc is a multi-format archive utility that allows creating, listing, -extracting and modifying ZIP, Tar and LHA archives using ObjFW's classes for -various archive types. - -%package -n ofdns -Summary: Utility for performing DNS requests on the command line -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofdns -ofdns is an utility for performing DNS requests on the command line using -ObjFW's DNS resolver. - -%package -n ofhash -Summary: Utility to hash files with various cryptographic hash functions -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofhash -ofhash is an utility to hash files with various cryptographic hash functions -(even using different algorithms at once) using ObjFW's classes for various -cryptographic hashes. - -%package -n ofhttp -Summary: Command line downloader for HTTP(S) -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwtls_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofhttp -ofhttp is a command line downloader for HTTP and HTTPS using ObjFW's -OFHTTPClient class. It supports all features one would expect from a modern -command line downloader such as resuming of downloads, using a SOCKS5 proxy, a -modern terminal-based UI, etc. - -%prep -%autosetup -./autogen.sh - -%build -%configure OBJC=clang --disable-rpath -%make_build - -%install -%make_install - -%check -make -C tests run - -%if 0%{?suse_version} -%post -n %{libobjfw_pkgname} -p /sbin/ldconfig -%postun -n %{libobjfw_pkgname} -p /sbin/ldconfig -%post -n %{libobjfwrt_pkgname} -p /sbin/ldconfig -%postun -n %{libobjfwrt_pkgname} -p /sbin/ldconfig -%endif - -%files -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL - -%files -n %{libobjfw_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfw.so.%{libobjfw_major} -%{_libdir}/libobjfw.so.%{libobjfw_major}.%{libobjfw_minor}.0 - -%files -n %{libobjfw_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/objfw-compile -%{_bindir}/objfw-config -%{_bindir}/objfw-embed -%{_bindir}/objfw-new -%{_includedir}/ObjFW -%{_libdir}/libobjfw.so - -%files -n %{libobjfwrt_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfwrt.so.%{libobjfwrt_major} -%{_libdir}/libobjfwrt.so.%{libobjfwrt_major}.%{libobjfwrt_minor}.0 - -%files -n %{libobjfwrt_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_includedir}/ObjFWRT -%{_libdir}/libobjfwrt.so - -%files -n %{libobjfwtls_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfwtls.so.%{libobjfwtls_major} -%{_libdir}/libobjfwtls.so.%{libobjfwtls_major}.%{libobjfwtls_minor}.0 - -%files -n %{libobjfwtls_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_includedir}/ObjFWTLS -%{_libdir}/libobjfwtls.so - -%files -n ofarc -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofarc -%{_datadir}/ofarc - -%files -n ofdns -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofdns -%{_datadir}/ofdns - -%files -n ofhash -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofhash -%{_datadir}/ofhash - -%files -n ofhttp -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofhttp -%{_datadir}/ofhttp Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -7,10 +7,11 @@ SHARED_LIB = ${OBJFW_SHARED_LIB} STATIC_LIB = ${OBJFW_STATIC_LIB} FRAMEWORK = ${OBJFW_FRAMEWORK} LIB_MAJOR = ${OBJFW_LIB_MAJOR} LIB_MINOR = ${OBJFW_LIB_MINOR} +LIB_PATCH = ${OBJFW_LIB_PATCH} SRCS = OFApplication.m \ OFArray.m \ OFBlock.m \ OFCharacterSet.m \ @@ -204,18 +205,16 @@ OFSandbox.m \ OFStrFTime.m \ OFStrPTime.m \ OFSubarray.m \ OFSubdata.m \ - OFTaggedPointerColor.m \ - OFTaggedPointerDate.m \ - OFTaggedPointerNumber.m \ OFUTF8String.m \ ${LIBBASES_M} \ ${RUNTIME_AUTORELEASE_M} \ ${RUNTIME_INSTANCE_M} \ - ${UNICODE_M} + ${UNICODE_M} \ + ${USE_SRCS_TAGGED_POINTERS} SRCS_FILES += OFFileIRIHandler.m SRCS_SOCKETS += OFAsyncIPSocketConnector.m \ OFDNSResolverSettings.m \ ${OF_EPOLL_KERNEL_EVENT_OBSERVER_M} \ OFHTTPIRIHandler.m \ @@ -223,10 +222,13 @@ OFKernelEventObserver.m \ ${OF_KQUEUE_KERNEL_EVENT_OBSERVER_M} \ ${OF_POLL_KERNEL_EVENT_OBSERVER_M} \ ${OF_SELECT_KERNEL_EVENT_OBSERVER_M} \ OFTCPSocketSOCKS5Connector.m +SRCS_TAGGED_POINTERS = OFTaggedPointerColor.m \ + OFTaggedPointerDate.m \ + OFTaggedPointerNumber.m SRCS_WINDOWS += platform/Windows/OFWin32ConsoleStdIOStream.m \ versioninfo.rc OBJS_EXTRA = exceptions/exceptions.a \ encodings/encodings.a \ Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -273,10 +273,14 @@ /** * @brief Creates a string of the date with the specified format. * * See the man page for `strftime` for information on the format. + * + * @warning The format is currently limited to the following format specifiers: + * %%a, %%b, %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%z, %%, %%n and + * %%t. * * @param format The format for the date string * @return A new, autoreleased OFString * @throw OFInvalidFormatException The specified format is invalid */ @@ -284,10 +288,14 @@ /** * @brief Creates a string of the local date with the specified format. * * See the man page for `strftime` for information on the format. + * + * @warning The format is currently limited to the following format specifiers: + * %%a, %%b, %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%z, %%, %%n and + * %%t. * * @param format The format for the date string * @return A new, autoreleased OFString * @throw OFInvalidFormatException The specified format is invalid */ Index: src/OFStream+Private.h ================================================================== --- src/OFStream+Private.h +++ src/OFStream+Private.h @@ -15,12 +15,11 @@ #import "OFStream.h" OF_ASSUME_NONNULL_BEGIN -OF_DIRECT_MEMBERS @interface OFStream () @property (readonly, nonatomic, getter=of_isWaitingForDelimiter) bool of_waitingForDelimiter; @end OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerColor.h ================================================================== --- src/OFTaggedPointerColor.h +++ src/OFTaggedPointerColor.h @@ -15,14 +15,12 @@ #import "OFColor.h" OF_ASSUME_NONNULL_BEGIN -#ifdef OF_OBJFW_RUNTIME @interface OFTaggedPointerColor: OFColor + (OFTaggedPointerColor *)colorWithRed: (uint8_t)red green: (uint8_t)green blue: (uint8_t)blue; @end -#endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerColor.m ================================================================== --- src/OFTaggedPointerColor.m +++ src/OFTaggedPointerColor.m @@ -15,11 +15,10 @@ #include "config.h" #import "OFTaggedPointerColor.h" -#ifdef OF_OBJFW_RUNTIME static int colorTag; @implementation OFTaggedPointerColor + (void)initialize { @@ -50,6 +49,5 @@ *alpha = 1; } OF_SINGLETON_METHODS @end -#endif Index: src/OFTaggedPointerDate.h ================================================================== --- src/OFTaggedPointerDate.h +++ src/OFTaggedPointerDate.h @@ -15,12 +15,12 @@ #import "OFDate.h" OF_ASSUME_NONNULL_BEGIN -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +#if UINTPTR_MAX == UINT64_MAX @interface OFTaggedPointerDate: OFDate + (OFTaggedPointerDate *)dateWithUInt64TimeIntervalSince1970: (uint64_t)value; @end #endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerDate.m ================================================================== --- src/OFTaggedPointerDate.m +++ src/OFTaggedPointerDate.m @@ -13,11 +13,11 @@ * file. */ #import "OFTaggedPointerDate.h" -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +#if UINTPTR_MAX == UINT64_MAX static int dateTag; @implementation OFTaggedPointerDate + (void)initialize { Index: src/OFTaggedPointerNumber.h ================================================================== --- src/OFTaggedPointerNumber.h +++ src/OFTaggedPointerNumber.h @@ -15,13 +15,11 @@ #import "OFNumber.h" OF_ASSUME_NONNULL_BEGIN -#ifdef OF_OBJFW_RUNTIME -# define OFTaggedPointerNumberTagBits 4 +#define OFTaggedPointerNumberTagBits 4 @interface OFTaggedPointerNumber: OFNumber @end -#endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerNumber.m ================================================================== --- src/OFTaggedPointerNumber.m +++ src/OFTaggedPointerNumber.m @@ -17,11 +17,10 @@ #import "OFTaggedPointerNumber.h" #import "OFInvalidFormatException.h" -#ifdef OF_OBJFW_RUNTIME enum Tag { tagChar, tagShort, tagInt, tagLong, @@ -140,11 +139,11 @@ default: @throw [OFInvalidFormatException exception]; } } -# define RETURN_VALUE \ +#define RETURN_VALUE \ uintptr_t value = object_getTaggedPointerValue(self); \ \ switch (value & tagMask) { \ case tagChar: \ return (signed char)(unsigned char) \ @@ -191,10 +190,9 @@ - (double)doubleValue { RETURN_VALUE } -# undef RETURN_VALUE +#undef RETURN_VALUE OF_SINGLETON_METHODS @end -#endif Index: src/bridge/Makefile ================================================================== --- src/bridge/Makefile +++ src/bridge/Makefile @@ -3,12 +3,13 @@ DISTCLEAN = Info.plist SHARED_LIB = ${OBJFWBRIDGE_SHARED_LIB} STATIC_LIB = ${OBJFWBRIDGE_STATIC_LIB} FRAMEWORK = ${OBJFWBRIDGE_FRAMEWORK} -LIB_MAJOR = ${OBJFW_LIB_MAJOR} -LIB_MINOR = ${OBJFW_LIB_MINOR} +LIB_MAJOR = ${OBJFWBRIDGE_LIB_MAJOR} +LIB_MINOR = ${OBJFWBRIDGE_LIB_MINOR} +LIB_PATCH = ${OBJFWBRIDGE_LIB_PATCH} SRCS = OFArray+NSObject.m \ OFEnumerator+NSObject.m \ OFException+Swift.m \ OFDictionary+NSObject.m \ Index: src/forwarding/forwarding-amd64-elf.S ================================================================== --- src/forwarding/forwarding-amd64-elf.S +++ src/forwarding/forwarding-amd64-elf.S @@ -218,8 +218,8 @@ .long 0 .quad 0 module: .quad 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-arm-elf.S ================================================================== --- src/forwarding/forwarding-arm-elf.S +++ src/forwarding/forwarding-arm-elf.S @@ -166,8 +166,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-arm64-elf.S ================================================================== --- src/forwarding/forwarding-arm64-elf.S +++ src/forwarding/forwarding-arm64-elf.S @@ -124,8 +124,8 @@ .long 4 .xword 0 module: .xword 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-mips-elf.S ================================================================== --- src/forwarding/forwarding-mips-elf.S +++ src/forwarding/forwarding-mips-elf.S @@ -322,8 +322,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-powerpc-elf.S ================================================================== --- src/forwarding/forwarding-powerpc-elf.S +++ src/forwarding/forwarding-powerpc-elf.S @@ -355,8 +355,8 @@ .long OFMethodNotFound .Lgot_OFMethodNotFound_stret: .long OFMethodNotFound_stret #endif -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/forwarding/forwarding-sparc-elf.S ================================================================== --- src/forwarding/forwarding-sparc-elf.S +++ src/forwarding/forwarding-sparc-elf.S @@ -188,8 +188,8 @@ .word 0 .word 0 module: .word 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-sparc64-elf.S ================================================================== --- src/forwarding/forwarding-sparc64-elf.S +++ src/forwarding/forwarding-sparc64-elf.S @@ -248,8 +248,8 @@ .word 0 .xword 0 module: .xword 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-x86-elf.S ================================================================== --- src/forwarding/forwarding-x86-elf.S +++ src/forwarding/forwarding-x86-elf.S @@ -193,8 +193,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -358,11 +358,17 @@ OF_STRINGIFY(__LINE__), \ "Failed to ensure condition:\n" #cond); \ } while(0) #else @class OFConstantString; +# ifdef __cplusplus +extern "C" { +# endif extern void OFLog(OFConstantString *_Nonnull, ...); +# ifdef __cplusplus +} +# endif # define OFEnsure(cond) \ do { \ if OF_UNLIKELY (!(cond)) { \ OFLog(@"Failed to ensure condition in " \ @__FILE__ ":%d: " @#cond, __LINE__); \ Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -6,10 +6,11 @@ SHARED_LIB = ${OBJFWRT_SHARED_LIB} STATIC_LIB = ${OBJFWRT_STATIC_LIB} FRAMEWORK = ${OBJFWRT_FRAMEWORK} LIB_MAJOR = ${OBJFWRT_LIB_MAJOR} LIB_MINOR = ${OBJFWRT_LIB_MINOR} +LIB_PATCH = ${OBJFWRT_LIB_PATCH} SRCS = arc.m \ autorelease.m \ category.m \ class.m \ Index: src/runtime/ObjFWRT.h ================================================================== --- src/runtime/ObjFWRT.h +++ src/runtime/ObjFWRT.h @@ -614,14 +614,14 @@ extern void objc_setTaggedPointerSecret(uintptr_t secret); /** * @brief Registers a class for tagged pointers. * - * @param class The class to register for tagged pointers + * @param class_ The class to register for tagged pointers * @return The tagged pointer ID for the registered class */ -extern int objc_registerTaggedPointerClass(Class _Nonnull class); +extern int objc_registerTaggedPointerClass(Class _Nonnull class_); /** * @brief Returns whether the specified object is a tagged pointer. * * @param object The object to inspect @@ -638,15 +638,15 @@ extern uintptr_t object_getTaggedPointerValue(id _Nonnull object); /** * @brief Creates a new tagged pointer. * - * @param class The tag ID for the tagged pointer class to use + * @param class_ The tag ID for the tagged pointer class to use * @param value The value the tagged pointer should have * @return A tagged pointer, or `nil` if it could not be created */ -extern id _Nullable objc_createTaggedPointer(int class, uintptr_t value); +extern id _Nullable objc_createTaggedPointer(int class_, uintptr_t value); /* * Used by the compiler, but can also be called manually. * * These declarations are also required to prevent Clang's implicit Index: src/runtime/lookup-asm/lookup-asm-amd64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-amd64-elf.S +++ src/runtime/lookup-asm/lookup-asm-amd64-elf.S @@ -91,8 +91,8 @@ nilMethod: xorq %rax, %rax ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-arm-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-arm-elf.S +++ src/runtime/lookup-asm/lookup-asm-arm-elf.S @@ -113,8 +113,8 @@ nilMethod: mov r0, #0 bx lr -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-arm64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-arm64-elf.S +++ src/runtime/lookup-asm/lookup-asm-arm64-elf.S @@ -91,8 +91,8 @@ nilMethod: mov x0, #0 ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-mips-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-mips-elf.S +++ src/runtime/lookup-asm/lookup-asm-mips-elf.S @@ -152,8 +152,8 @@ nilMethod: move $v0, $zero jr $ra -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S +++ src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S @@ -132,8 +132,8 @@ nilMethod: move $v0, $zero jr $ra -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-powerpc-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-powerpc-elf.S +++ src/runtime/lookup-asm/lookup-asm-powerpc-elf.S @@ -166,8 +166,8 @@ .long objc_taggedPointerSecret .Lgot_objc_taggedPointerClasses: .long objc_taggedPointerClasses #endif -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S +++ src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S @@ -156,8 +156,8 @@ li %r3, 0 blr .type nilMethod, @function .size nilMethod, .-.Lbegin_nilMethod -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/runtime/lookup-asm/lookup-asm-sparc-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-sparc-elf.S +++ src/runtime/lookup-asm/lookup-asm-sparc-elf.S @@ -142,8 +142,8 @@ nilMethod: retl clr %o0 -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-sparc64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-sparc64-elf.S +++ src/runtime/lookup-asm/lookup-asm-sparc64-elf.S @@ -139,8 +139,8 @@ nilMethod: retl clr %o0 -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-x86-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-x86-elf.S +++ src/runtime/lookup-asm/lookup-asm-x86-elf.S @@ -108,8 +108,8 @@ getEIP: movl (%esp), %eax ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/tls/Makefile ================================================================== --- src/tls/Makefile +++ src/tls/Makefile @@ -3,12 +3,13 @@ DISTCLEAN = Info.plist SHARED_LIB = ${OBJFWTLS_SHARED_LIB} STATIC_LIB = ${OBJFWTLS_STATIC_LIB} FRAMEWORK = ${OBJFWTLS_FRAMEWORK} -LIB_MAJOR = ${OBJFW_LIB_MAJOR} -LIB_MINOR = ${OBJFW_LIB_MINOR} +LIB_MAJOR = ${OBJFWTLS_LIB_MAJOR} +LIB_MINOR = ${OBJFWTLS_LIB_MINOR} +LIB_PATCH = ${OBJFWTLS_LIB_PATCH} INCLUDES := ObjFWTLS.h SRCS = ${OF_GNUTLS_TLS_STREAM_M} \ ${OF_OPENSSL_TLS_STREAM_M} \ ${OF_SECURE_TRANSPORT_TLS_STREAM_M} Index: src/tls/OFGnuTLSTLSStream.m ================================================================== --- src/tls/OFGnuTLSTLSStream.m +++ src/tls/OFGnuTLSTLSStream.m @@ -17,10 +17,11 @@ #include #import "OFGnuTLSTLSStream.h" #import "OFData.h" +#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" @@ -190,10 +191,26 @@ 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; +} - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { static const OFTLSStreamErrorCode initFailedErrorCode = Index: src/tls/OFOpenSSLTLSStream.m ================================================================== --- src/tls/OFOpenSSLTLSStream.m +++ src/tls/OFOpenSSLTLSStream.m @@ -17,10 +17,11 @@ #include #import "OFOpenSSLTLSStream.h" #import "OFData.h" +#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" @@ -201,10 +202,36 @@ 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; +} - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { static const OFTLSStreamErrorCode initFailedErrorCode = Index: src/tls/OFSecureTransportTLSStream.m ================================================================== --- src/tls/OFSecureTransportTLSStream.m +++ src/tls/OFSecureTransportTLSStream.m @@ -16,10 +16,11 @@ #include "config.h" #include #import "OFSecureTransportTLSStream.h" +#import "OFStream+Private.h" #import "OFAlreadyOpenException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" #import "OFTLSHandshakeFailedException.h" @@ -176,10 +177,29 @@ 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; +} - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode { static const OFTLSStreamErrorCode initFailedErrorCode =