Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package capnproto for openSUSE:Factory checked in at 2023-04-14 13:13:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/capnproto (Old) and /work/SRC/openSUSE:Factory/.capnproto.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "capnproto" Fri Apr 14 13:13:17 2023 rev:10 rq:1079268 version:0.10.4 Changes: -------- --- /work/SRC/openSUSE:Factory/capnproto/capnproto.changes 2022-12-01 16:59:02.595100893 +0100 +++ /work/SRC/openSUSE:Factory/.capnproto.new.19717/capnproto.changes 2023-04-14 13:13:30.835713394 +0200 @@ -1,0 +2,6 @@ +Thu Apr 13 15:05:38 UTC 2023 - Luigi Baldoni <[email protected]> + +- Update to version 0.10.4 + * Clarify doc on absolute path imports + +------------------------------------------------------------------- Old: ---- capnproto-c++-0.10.3.tar.gz New: ---- capnproto-c++-0.10.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ capnproto.spec ++++++ --- /var/tmp/diff_new_pack.DeRnKI/_old 2023-04-14 13:13:31.339716276 +0200 +++ /var/tmp/diff_new_pack.DeRnKI/_new 2023-04-14 13:13:31.343716298 +0200 @@ -1,7 +1,7 @@ # # spec file for package capnproto # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,9 @@ # -%define _libver 0_10_3 +%define _libver 0_10_4 Name: capnproto -Version: 0.10.3 +Version: 0.10.4 Release: 0 Summary: A Data Serialization Format License: MIT ++++++ capnproto-c++-0.10.3.tar.gz -> capnproto-c++-0.10.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/CMakeLists.txt new/capnproto-c++-0.10.4/CMakeLists.txt --- old/capnproto-c++-0.10.3/CMakeLists.txt 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/CMakeLists.txt 2023-04-13 16:14:33.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) project("Cap'n Proto" CXX) -set(VERSION 0.10.3) +set(VERSION 0.10.4) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/configure new/capnproto-c++-0.10.4/configure --- old/capnproto-c++-0.10.3/configure 2022-11-29 17:24:22.000000000 +0100 +++ new/capnproto-c++-0.10.4/configure 2023-04-13 16:14:38.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Capn Proto 0.10.3. +# Generated by GNU Autoconf 2.69 for Capn Proto 0.10.4. # # Report bugs to <[email protected]>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Capn Proto' PACKAGE_TARNAME='capnproto-c++' -PACKAGE_VERSION='0.10.3' -PACKAGE_STRING='Capn Proto 0.10.3' +PACKAGE_VERSION='0.10.4' +PACKAGE_STRING='Capn Proto 0.10.4' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Capn Proto 0.10.3 to adapt to many kinds of systems. +\`configure' configures Capn Proto 0.10.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Capn Proto 0.10.3:";; + short | recursive ) echo "Configuration of Capn Proto 0.10.4:";; esac cat <<\_ACEOF @@ -1569,7 +1569,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Capn Proto configure 0.10.3 +Capn Proto configure 0.10.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2284,7 +2284,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Capn Proto $as_me 0.10.3, which was +It was created by Capn Proto $as_me 0.10.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3157,7 +3157,7 @@ # Define the identity of the package. PACKAGE='capnproto-c++' - VERSION='0.10.3' + VERSION='0.10.4' cat >>confdefs.h <<_ACEOF @@ -18386,7 +18386,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Capn Proto $as_me 0.10.3, which was +This file was extended by Capn Proto $as_me 0.10.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18452,7 +18452,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Capn Proto config.status 0.10.3 +Capn Proto config.status 0.10.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/configure.ac new/capnproto-c++-0.10.4/configure.ac --- old/capnproto-c++-0.10.3/configure.ac 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/configure.ac 2023-04-13 16:14:33.000000000 +0200 @@ -1,6 +1,6 @@ ## Process this file with autoconf to produce configure. -AC_INIT([Capn Proto],[0.10.3],[[email protected]],[capnproto-c++]) +AC_INIT([Capn Proto],[0.10.4],[[email protected]],[capnproto-c++]) AC_CONFIG_SRCDIR([src/capnp/layout.c++]) AC_CONFIG_AUX_DIR([build-aux]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/c++.capnp.h new/capnproto-c++-0.10.4/src/capnp/c++.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/c++.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/c++.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/common.h new/capnproto-c++-0.10.4/src/capnp/common.h --- old/capnproto-c++-0.10.3/src/capnp/common.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/common.h 2023-04-13 16:14:33.000000000 +0200 @@ -48,7 +48,7 @@ #define CAPNP_VERSION_MAJOR 0 #define CAPNP_VERSION_MINOR 10 -#define CAPNP_VERSION_MICRO 3 +#define CAPNP_VERSION_MICRO 4 #define CAPNP_VERSION \ (CAPNP_VERSION_MAJOR * 1000000 + CAPNP_VERSION_MINOR * 1000 + CAPNP_VERSION_MICRO) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/compat/json.capnp.h new/capnproto-c++-0.10.4/src/capnp/compat/json.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/compat/json.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/compat/json.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/compiler/grammar.capnp.h new/capnproto-c++-0.10.4/src/capnp/compiler/grammar.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/compiler/grammar.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/compiler/grammar.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/compiler/lexer.capnp.h new/capnproto-c++-0.10.4/src/capnp/compiler/lexer.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/compiler/lexer.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/compiler/lexer.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/persistent.capnp.h new/capnproto-c++-0.10.4/src/capnp/persistent.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/persistent.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/persistent.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/rpc-twoparty.capnp.h new/capnproto-c++-0.10.4/src/capnp/rpc-twoparty.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/rpc-twoparty.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/rpc-twoparty.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/rpc.capnp.h new/capnproto-c++-0.10.4/src/capnp/rpc.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/rpc.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/rpc.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/schema.capnp.h new/capnproto-c++-0.10.4/src/capnp/schema.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/schema.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/schema.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/capnp/stream.capnp.h new/capnproto-c++-0.10.4/src/capnp/stream.capnp.h --- old/capnproto-c++-0.10.3/src/capnp/stream.capnp.h 2022-11-29 17:24:17.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/capnp/stream.capnp.h 2023-04-13 16:14:33.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10003 +#if CAPNP_VERSION != 10004 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/async-prelude.h new/capnproto-c++-0.10.4/src/kj/async-prelude.h --- old/capnproto-c++-0.10.3/src/kj/async-prelude.h 2022-11-29 17:19:00.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/async-prelude.h 2023-04-06 21:23:31.000000000 +0200 @@ -33,11 +33,12 @@ // TODO(someday): Support coroutines with -fno-exceptions. #if !KJ_NO_EXCEPTIONS #ifdef __has_include -// For now, we only support the Coroutines TS. -// -// TODO(someday): Also support standardized C++20 Coroutines. The latest VS2019 and GCC 10 both have -// support, though MSVC hides it behind /std:c++latest, which brings an ICE with it. -#if __cpp_coroutines && __has_include(<experimental/coroutine>) +#if (__cpp_impl_coroutine >= 201902L) && __has_include(<coroutine>) +// C++20 Coroutines detected. +#include <coroutine> +#define KJ_HAS_COROUTINE 1 +#define KJ_COROUTINE_STD_NAMESPACE std +#elif (__cpp_coroutines >= 201703L) && __has_include(<experimental/coroutine>) // Coroutines TS detected. #include <experimental/coroutine> #define KJ_HAS_COROUTINE 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/compat/readiness-io.h new/capnproto-c++-0.10.4/src/kj/compat/readiness-io.h --- old/capnproto-c++-0.10.3/src/kj/compat/readiness-io.h 2022-11-29 17:19:00.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/compat/readiness-io.h 2023-04-06 21:17:48.000000000 +0200 @@ -45,6 +45,9 @@ kj::Promise<void> whenReady(); // Returns a promise that resolves when read() will return non-null. + bool isAtEnd() { return eof; } + // Returns true if read() would return zero. + private: AsyncInputStream& input; kj::ForkedPromise<void> pumpTask = nullptr; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/compat/tls-test.c++ new/capnproto-c++-0.10.4/src/kj/compat/tls-test.c++ --- old/capnproto-c++-0.10.3/src/kj/compat/tls-test.c++ 2022-11-29 17:19:00.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/compat/tls-test.c++ 2023-04-06 21:17:48.000000000 +0200 @@ -467,6 +467,24 @@ auto server = serverPromise.wait(test.io.waitScope); test.testConnection(*client, *server); + + // Test clean shutdown. + { + auto eofPromise = server->readAllText(); + KJ_EXPECT(!eofPromise.poll(test.io.waitScope)); + client->shutdownWrite(); + KJ_ASSERT(eofPromise.poll(test.io.waitScope)); + KJ_EXPECT(eofPromise.wait(test.io.waitScope) == ""_kj); + } + + // Test UNCLEAN shutdown in other direction. + { + auto eofPromise = client->readAllText(); + KJ_EXPECT(!eofPromise.poll(test.io.waitScope)); + { auto drop = kj::mv(server); } + KJ_EXPECT(eofPromise.poll(test.io.waitScope)); + KJ_EXPECT_THROW(DISCONNECTED, eofPromise.wait(test.io.waitScope)); + } } KJ_TEST("TLS peer identity") { @@ -682,22 +700,29 @@ KJ_EXPECT_THROW_MESSAGE(message, clientPromise.wait(test.io.waitScope)); } +// OpenSSL 3.0 changed error messages +#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(OPENSSL_IS_BORINGSSL) +#define SSL_MESSAGE_DIFFERENT_IN_V3(v11, v30) v30 +#else +#define SSL_MESSAGE_DIFFERENT_IN_V3(v11, v30) v11 +#endif + KJ_TEST("TLS certificate validation") { expectInvalidCert("wrong.com", TlsCertificate(kj::str(VALID_CERT, INTERMEDIATE_CERT)), - "Hostname mismatch"); + SSL_MESSAGE_DIFFERENT_IN_V3("Hostname mismatch", "hostname mismatch")); expectInvalidCert("example.com", TlsCertificate(VALID_CERT), "unable to get local issuer certificate"); expectInvalidCert("example.com", TlsCertificate(kj::str(EXPIRED_CERT, INTERMEDIATE_CERT)), "certificate has expired"); expectInvalidCert("example.com", TlsCertificate(SELF_SIGNED_CERT), - "self signed certificate"); + SSL_MESSAGE_DIFFERENT_IN_V3("self signed certificate", "self-signed certificate")); } // BoringSSL seems to print error messages differently. #ifdef OPENSSL_IS_BORINGSSL -#define SSL_MESSAGE(interesting, boring) boring +#define SSL_MESSAGE_DIFFERENT_IN_BORINGSSL(interesting, boring) boring #else -#define SSL_MESSAGE(interesting, boring) interesting +#define SSL_MESSAGE_DIFFERENT_IN_BORINGSSL(interesting, boring) interesting #endif KJ_TEST("TLS client certificate verification") { @@ -740,14 +765,15 @@ auto serverPromise = test.tlsServer.wrapServer(kj::mv(pipe.ends[1])); KJ_EXPECT_THROW_MESSAGE( - SSL_MESSAGE("peer did not return a certificate", - "PEER_DID_NOT_RETURN_A_CERTIFICATE"), + SSL_MESSAGE_DIFFERENT_IN_BORINGSSL("peer did not return a certificate", + "PEER_DID_NOT_RETURN_A_CERTIFICATE"), serverPromise.wait(test.io.waitScope)); #if !KJ_NO_EXCEPTIONS // if exceptions are disabled, we're now in a bad state because // KJ_EXPECT_THROW_MESSAGE() runs in a forked child process. KJ_EXPECT_THROW_MESSAGE( - SSL_MESSAGE("alert", // "alert handshake failure" or "alert certificate required" - "ALERT"), // "ALERT_HANDSHAKE_FAILURE" or "ALERT_CERTIFICATE_REQUIRED" + SSL_MESSAGE_DIFFERENT_IN_BORINGSSL( + "alert", // "alert handshake failure" or "alert certificate required" + "ALERT"), // "ALERT_HANDSHAKE_FAILURE" or "ALERT_CERTIFICATE_REQUIRED" clientPromise.wait(test.io.waitScope)); #endif } @@ -770,14 +796,14 @@ auto serverPromise = test.tlsServer.wrapServer(kj::mv(pipe.ends[1])); KJ_EXPECT_THROW_MESSAGE( - SSL_MESSAGE("certificate verify failed", - "CERTIFICATE_VERIFY_FAILED"), + SSL_MESSAGE_DIFFERENT_IN_BORINGSSL("certificate verify failed", + "CERTIFICATE_VERIFY_FAILED"), serverPromise.wait(test.io.waitScope)); #if !KJ_NO_EXCEPTIONS // if exceptions are disabled, we're now in a bad state because // KJ_EXPECT_THROW_MESSAGE() runs in a forked child process. KJ_EXPECT_THROW_MESSAGE( - SSL_MESSAGE("alert unknown ca", - "TLSV1_ALERT_UNKNOWN_CA"), + SSL_MESSAGE_DIFFERENT_IN_BORINGSSL("alert unknown ca", + "TLSV1_ALERT_UNKNOWN_CA"), clientPromise.wait(test.io.waitScope)); #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/compat/tls.c++ new/capnproto-c++-0.10.4/src/kj/compat/tls.c++ --- old/capnproto-c++-0.10.3/src/kj/compat/tls.c++ 2022-11-29 17:19:00.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/compat/tls.c++ 2023-04-06 21:18:49.000000000 +0200 @@ -58,6 +58,14 @@ kj::Vector<kj::String> lines; while (unsigned long long error = ERR_get_error()) { +#ifdef SSL_R_UNEXPECTED_EOF_WHILE_READING + // OpenSSL 3.0+ reports unexpected disconnects this way. + if (ERR_GET_REASON(error) == SSL_R_UNEXPECTED_EOF_WHILE_READING) { + kj::throwFatalException(KJ_EXCEPTION(DISCONNECTED, + "peer disconnected without gracefully ending TLS session")); + } +#endif + char message[1024]; ERR_error_string_n(error, message, sizeof(message)); lines.add(kj::heapString(message)); @@ -329,8 +337,12 @@ throwOpensslError(); case SSL_ERROR_SYSCALL: if (result == 0) { + // OpenSSL pre-3.0 reports unexpected disconnects this way. Note that 3.0+ report it + // as SSL_ERROR_SSL with the reason SSL_R_UNEXPECTED_EOF_WHILE_READING, which is + // handled in throwOpensslError(). disconnected = true; - return size_t(0); + return KJ_EXCEPTION(DISCONNECTED, + "peer disconnected without gracefully ending TLS session"); } else { // According to documentation we shouldn't get here, because our BIO never returns an // "error". But in practice we do get here sometimes when the peer disconnects @@ -367,12 +379,20 @@ static long bioCtrl(BIO* b, int cmd, long num, void* ptr) { switch (cmd) { + case BIO_CTRL_EOF: + return reinterpret_cast<TlsConnection*>(BIO_get_data(b))->readBuffer.isAtEnd(); case BIO_CTRL_FLUSH: return 1; case BIO_CTRL_PUSH: case BIO_CTRL_POP: // Informational? return 0; +#ifdef BIO_CTRL_GET_KTLS_SEND + case BIO_CTRL_GET_KTLS_SEND: + case BIO_CTRL_GET_KTLS_RECV: + // TODO(someday): Support kTLS if the underlying stream is a raw socket. + return 0; +#endif default: KJ_LOG(WARNING, "unimplemented bio_ctrl", cmd); return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/string-test.c++ new/capnproto-c++-0.10.4/src/kj/string-test.c++ --- old/capnproto-c++-0.10.3/src/kj/string-test.c++ 2022-11-29 17:19:00.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/string-test.c++ 2023-04-06 21:17:48.000000000 +0200 @@ -24,6 +24,7 @@ #include <string> #include "vector.h" #include <locale.h> +#include <stdint.h> namespace kj { namespace _ { // private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.3/src/kj/string.h new/capnproto-c++-0.10.4/src/kj/string.h --- old/capnproto-c++-0.10.3/src/kj/string.h 2022-11-29 17:08:59.000000000 +0100 +++ new/capnproto-c++-0.10.4/src/kj/string.h 2023-04-06 21:20:29.000000000 +0200 @@ -122,10 +122,14 @@ inline constexpr const char* end() const { return content.end() - 1; } inline constexpr bool operator==(decltype(nullptr)) const { return content.size() <= 1; } +#if !__cpp_impl_three_way_comparison inline constexpr bool operator!=(decltype(nullptr)) const { return content.size() > 1; } +#endif inline bool operator==(const StringPtr& other) const; +#if !__cpp_impl_three_way_comparison inline bool operator!=(const StringPtr& other) const { return !(*this == other); } +#endif inline bool operator< (const StringPtr& other) const; inline bool operator> (const StringPtr& other) const { return other < *this; } inline bool operator<=(const StringPtr& other) const { return !(other < *this); }
