qpid-proton-0.22.0/0000775000000000000000000000000013257152177010751 5ustar qpid-proton-0.22.0/version.txt0000664000000000000000000000000713257152177013174 0ustar 0.22.0 qpid-proton-0.22.0/tools/0000775000000000000000000000000013257152177012111 5ustar qpid-proton-0.22.0/tools/py/0000775000000000000000000000000013257152177012541 5ustar qpid-proton-0.22.0/tools/py/proctest.py0000664000000000000000000001713113257152177014761 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License # """Unit test library to simplify tests that start, monitor, check and report output from sub-processes. Provides safe port allocation for processes that listen on a port. Allows executables to be run under a debugging tool like valgrind. """ import unittest import os, sys, socket, time, re, inspect, errno, threading, tempfile from random import randrange from subprocess import Popen, PIPE, STDOUT from copy import copy import platform from os.path import dirname as dirname DEFAULT_TIMEOUT=10 class ProcError(Exception): """An exception that displays failed process output""" def __init__(self, proc, what="bad exit status"): self.out = proc.out.strip() returncode = getattr(proc, 'returncode') # Can be missing in some cases msg = "%s (exit=%s) command:\n%s" % (what, returncode, " ".join(proc.args)) if self.out: msg += "\nvvvvvvvvvvvvvvvv\n%s\n^^^^^^^^^^^^^^^^" % self.out else: msg += "\n<>" super(ProcError, self, ).__init__(msg) class NotFoundError(ProcError): pass class Proc(Popen): """Subclass of suprocess.Popen that stores its output and can scan it for a 'ready' pattern' Use self.out to access output (combined stdout and stderr). You can't set the Popen stdout and stderr arguments, they will be overwritten. """ @property def out(self): self._out.seek(0) return self._out.read() def __init__(self, args, valgrind=True, helgrind=False, **kwargs): """Start an example process""" self.args = list(args) self.kwargs = kwargs self._out = tempfile.TemporaryFile(mode='w+') valgrind_exe = valgrind and os.getenv("VALGRIND") if valgrind_exe: # run valgrind for speed, not for detailed information vg = [valgrind_exe] if helgrind: vg += ["--tool=helgrind", "--quiet", "--error-exitcode=42"] else: vg += ["--tool=memcheck"] + os.getenv("VALGRIND_ARGS").split(' ') self.args = vg + self.args if os.getenv("PROCTEST_VERBOSE"): sys.stderr.write("\n== running == "+" ".join(self.args)+"\n") try: Popen.__init__(self, self.args, stdout=self._out, stderr=STDOUT, **kwargs) except OSError as e: if e.errno == errno.ENOENT: raise NotFoundError(self, str(e)) raise ProcError(self, str(e)) except Exception as e: raise ProcError(self, str(e)) def kill(self): try: if self.poll() is None: Popen.kill(self) except: pass # Already exited. return self.out def wait_exit(self, timeout=DEFAULT_TIMEOUT, expect=0): """Wait for process to exit, return output. Raise ProcError on failure.""" t = threading.Thread(target=self.wait) t.start() t.join(timeout) if self.poll() is None: # Still running self.kill() raise ProcError(self, "still running after %ss" % timeout) if expect is not None and self.poll() != expect: raise ProcError(self) return self.out def wait_re(self, regexp, timeout=DEFAULT_TIMEOUT): """ Wait for regexp to appear in the output, returns the re.search match result. The target process should flush() important output to ensure it appears. """ if timeout: deadline = time.time() + timeout while timeout is None or time.time() < deadline: match = re.search(regexp, self.out) if match: return match if self.poll() is not None: raise ProcError(self, "process exited while waiting for '%s'" % (regexp)) time.sleep(0.01) # Not very efficient raise ProcError(self, "gave up waiting for '%s' after %ss" % (regexp, timeout)) def _tc_missing(attr): return not hasattr(unittest.TestCase, attr) class ProcTestCase(unittest.TestCase): """TestCase that manages started processes Also roughly provides setUpClass() and tearDownClass() and other features missing in python 2.6. If subclasses override setUp() or tearDown() they *must* call the superclass. """ def setUp(self): super(ProcTestCase, self).setUp() self.procs = [] def tearDown(self): for p in self.procs: p.kill() super(ProcTestCase, self).tearDown() # Default value for valgrind= in proc() function if not explicitly set. # Override by setting a "valgrind" member in subclass or instance. valgrind=True def proc(self, *args, **kwargs): """Return a Proc() that will be automatically killed on teardown""" if 'valgrind' in kwargs: p = Proc(*args, **kwargs) else: p = Proc(*args, valgrind=self.valgrind, **kwargs) self.procs.append(p) return p if _tc_missing('setUpClass') and _tc_missing('tearDownClass'): @classmethod def setUpClass(cls): pass @classmethod def tearDownClass(cls): pass def setUp(self): super(ProcTestCase, self).setUp() cls = type(self) if not hasattr(cls, '_setup_class_count'): # First time def is_test(m): return inspect.ismethod(m) and m.__name__.startswith('test_') cls._setup_class_count = len(inspect.getmembers(cls, predicate=is_test)) cls.setUpClass() self.procs = [] def tearDown(self): self.assertTrue(self._setup_class_count > 0) self._setup_class_count -= 1 if self._setup_class_count == 0: type(self).tearDownClass() for p in self.procs: p.kill() super(ProcTestCase, self).tearDown() if _tc_missing('assertIn'): def assertIn(self, a, b): self.assertTrue(a in b, "%r not in %r" % (a, b)) if _tc_missing('assertMultiLineEqual'): def assertMultiLineEqual(self, a, b): self.assertEqual(a, b) from functools import reduce #### Skip decorators missing in python 2.6 def _id(obj): return obj from functools import wraps def skip(reason): def decorator(test): @wraps(test) def skipper(*args, **kwargs): print("skipped %s: %s" % (test.__name__, reason)) return skipper return decorator def skipIf(cond, reason): if cond: return skip(reason) else: return _id def skipUnless(cond, reason): if not cond: return skip(reason) else: return _id if not hasattr(unittest, 'skip'): unittest.skip = skip if not hasattr(unittest, 'skipIf'): unittest.skipIf = skipIf if not hasattr(unittest, 'skipUnless'): unittest.skipUnless = skipUnless from unittest import main if __name__ == "__main__": main() qpid-proton-0.22.0/tools/cmake/0000775000000000000000000000000013257152177013171 5ustar qpid-proton-0.22.0/tools/cmake/Modules/0000775000000000000000000000000013257152177014601 5ustar qpid-proton-0.22.0/tools/cmake/Modules/WindowsC99SymbolCheck.py0000664000000000000000000000405413257152177021221 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # # Stop cmake build if pn_i_xxx substitute functions aren't used for # the dangerous non-complying [v]snprintf family. A source of # painful bug-hunting. # # Each obj must be checked instead of just the dll since Visual Studio # sometimes inserts references to vsnprintf in DllMainCRTStartup, # causing false positives. # # bad: vsnprintf, __vsnprintf, _imp__vsnprintf, ..., same for snprintf # OK: vsnprintf_s, pn_i_vsnprintf # import sys import os import subprocess import glob import re def symcheck(objfile): symfile = objfile.replace('.obj', '.sym') cmd = ['dumpbin.exe', '/SYMBOLS', objfile, '/OUT:' + symfile] # /dev/null standin junk = open('junk', 'w') p = subprocess.Popen(cmd, stdout=junk) n = p.wait() if n != 0 : raise Exception("dumpbin call failure") f = open(symfile, 'r') for line in f : m = re.search(r'UNDEF.*\b([a-zA-Z_]*snprintf)\b', line) if m : sym = m.group(1) if re.match(r'_*pni_v?snprintf', sym) is None : raise Exception('Unsafe use of C99 violating function in ' + objfile + ' : ' + sym) def main(): os.chdir(sys.argv[1]) objs = glob.glob('*.obj') for obj in glob.glob('*.obj'): symcheck(obj) if __name__ == "__main__": sys.exit(main()) qpid-proton-0.22.0/tools/cmake/Modules/WindowsC99CheckDef.cmake0000664000000000000000000000244013257152177021077 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # # Check qpid-proton.dll after linking for dangerous calls to # Windows functions that suggest but deviate from C99 behavior: # _snprintf, vsnprintf, _vsnprintf # See platform.h for safe wrapper calls. # set(obj_dir ${CMAKE_CURRENT_BINARY_DIR}/qpid-proton.dir/${CMAKE_CFG_INTDIR}) add_custom_command( TARGET qpid-proton PRE_LINK COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_MODULE_PATH}WindowsC99SymbolCheck.py $ COMMENT "Checking for dangerous use of C99-violating functions") qpid-proton-0.22.0/tools/cmake/Modules/FindSWIG.cmake0000664000000000000000000000314313257152177017156 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # include(${CMAKE_ROOT}/Modules/FindSWIG.cmake) if (NOT COMMAND swig_add_library) macro (SWIG_ADD_LIBRARY name) set(options "") set(oneValueArgs LANGUAGE TYPE) set(multiValueArgs SOURCES) cmake_parse_arguments(_SAM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if (NOT DEFINED _SAM_LANGUAGE) message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing LANGUAGE argument") endif () if (NOT DEFINED _SAM_SOURCES) message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing SOURCES argument") endif () if (DEFINED _SAM_TYPE AND NOT _SAM_LANGUAGE STREQUAL "module") message(FATAL_ERROR "SWIG_ADD_LIBRARY: This fallback impl of swig_add_library supports the module type only") endif () swig_add_module(${name} ${_SAM_LANGUAGE} ${_SAM_SOURCES}) endmacro () endif (NOT COMMAND swig_add_library) qpid-proton-0.22.0/tools/cmake/Modules/FindLibuv.cmake0000664000000000000000000000346013257152177017470 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Find libuv include dirs and libraries. # # Sets the following variables: # # LIBUV_FOUND - True if headers and requested libraries were found # Libuv_INCLUDE_DIRS - Libuv include directories # Libuv_LIBRARIES - Link these to use libuv. # # This module reads hints about search locations from variables:: # LIBUV_ROOT - Preferred installation prefix # LIBUV_INCLUDEDIR - Preferred include directory e.g. /include # LIBUV_LIBRARYDIR - Preferred library directory e.g. /lib find_library(Libuv_LIBRARY NAMES uv libuv HINTS ${LIBUV_LIBRARYDIR} ${LIBUV_ROOT}/lib ${CMAKE_INSTALL_PREFIX}/lib) find_path(Libuv_INCLUDE_DIR NAMES uv.h HINTS ${LIBUV_INCLUDEDIR} ${LIBUV_ROOT}/include ${CMAKE_INSTALL_PREFIX}/include PATHS /usr/include) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Libuv REQUIRED_VARS Libuv_LIBRARY Libuv_INCLUDE_DIR) if (LIBUV_FOUND) set(Libuv_INCLUDE_DIRS ${Libuv_INCLUDE_DIR}) set(Libuv_LIBRARIES ${Libuv_LIBRARY}) endif () qpid-proton-0.22.0/tools/cmake/Modules/CheckPythonModule.cmake0000664000000000000000000000374613257152177021202 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # #.rst # CheckPythonModule # ---------------- # # Provides a macro to check if a python module is available # # .. commmand:: CHECK_PYTHON_MODULE # # :: # # CHECK_PYTHON_MODULE( ) # # Check if the given python ```` may be used by the detected # python interpreter and store the result in an internal cache entry # named ````. # # The ``PYTHON_EXECUTABLE`` variable must be set before calling this # macro, usually by using find_package(PythonInterp). macro (CHECK_PYTHON_MODULE MODULE VARIABLE) if (NOT DEFINED "${VARIABLE}" AND DEFINED "PYTHON_EXECUTABLE") execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import sys, pkgutil; sys.exit(0 if pkgutil.find_loader('${MODULE}') else 1)" RESULT_VARIABLE RESULT) if (RESULT EQUAL 0) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for Python module ${MODULE} - found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have Python module ${MODULE}") else() if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for Python module ${MODULE} - not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have Python module ${MODULE}") endif() endif() endmacro() qpid-proton-0.22.0/tools/check_abi/0000775000000000000000000000000013257152177014001 5ustar qpid-proton-0.22.0/tools/check_abi/expand_types.cpp0000664000000000000000000000312413257152177017210 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include void print_type(const char* type, const char* mangled_type) { int status; char* demangled_type = abi::__cxa_demangle(mangled_type, 0, 0, &status); if (demangled_type) { std::cout << "s/" << type << "/" << demangled_type << "/g\n"; } ::free(demangled_type); } #define mangle_name(x) typeid(x).name() #define print_subst(x) print_type(#x, mangle_name(x)) int main() { print_subst(uint64_t); print_subst(uint32_t); print_subst(uint16_t); print_subst(uint8_t); print_subst(size_t); print_subst(int64_t); print_subst(int32_t); print_subst(int16_t); print_subst(int8_t); print_subst(std::string); print_subst(std::vector); } qpid-proton-0.22.0/tools/check_abi/cppabi.cpp0000664000000000000000000000171513257152177015747 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include int main() { #if _GLIBCXX_USE_CXX11_ABI std::cout << "s/\\[abi:cxx11\\]//"; return 0; #else return 1; #endif } qpid-proton-0.22.0/tools/check_abi/check-abi0000775000000000000000000000355213257152177015542 0ustar #!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # MKTEMP="mktemp /tmp/tmp.XXXXXXXXXX" rc=0 syms_desired=$($MKTEMP) syms_library=$($MKTEMP) syms_missing=$($MKTEMP) syms_extra=$($MKTEMP) trap 'rm $syms_desired $syms_library $syms_missing $syms_extra' EXIT if [[ $# -lt 2 ]] ; then echo "Usage:" echo "check_abi object_file expected_symbols_file" exit 1; fi LC_ALL=C export LC_ALL # Extract exported symbols from library nm -DC --defined-only -f s $1 | cut -f1 -d'|' -s | sed -e "$(./cppabi)" -e "s/ *$//" | sort -u > $syms_library # Process API syms (substitute in some typedefs etc.) sed -e " $(./expand_types) /^\$/d /^#.*\$/d " $2 | sort -u > $syms_desired comm -23 $syms_desired $syms_library > $syms_missing comm -13 $syms_desired $syms_library > $syms_extra if [[ -n "$(cat $syms_missing)" ]] ; then (echo "Not exported from library (should be)" echo "=====================================" cat $syms_missing ) 1>&2 rc=1 fi if [[ -n "$(cat $syms_extra)" ]]; then (echo "Exported by library but not in spec" echo "===================================" cat $syms_extra ) 1>&2 fi exit $rc qpid-proton-0.22.0/tools/check_abi/README.md0000664000000000000000000000071713257152177015265 0ustar This is a tool for looking at the ELF symbols exported by a C/C++ shared library. Currently it has some rough edges, but it will take a file of expected symbols and tell you the difference from what is expected. Currently you also need to compile the C++ programs in the same directory to support the script Besides the compiled programs in this directory it also relies on GNU nm to extract the symbols and some standard POSIX utilities for text manipulation.qpid-proton-0.22.0/tests/0000775000000000000000000000000013257152177012113 5ustar qpid-proton-0.22.0/tests/tools/0000775000000000000000000000000013257152177013253 5ustar qpid-proton-0.22.0/tests/tools/soak-check0000775000000000000000000001130513257152177015211 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import sys, optparse from subprocess import Popen,PIPE def run_test(cmd): try: process = Popen(cmd) except OSError: assert False, "Unable to execute command '%s', is it in your PATH?" % cmd[0] return process.wait() def main(argv=None): """ Run a subset of the Proton tests for an extended period of time. """ # tests is a list of test configurations. Each configuration is # represented as a two-element tuple. Tuple[0] is the pattern passed to # proton-test that identifies the test case. Tuple[1] is a list of maps. # Each map contains the parameters for one test. A test (of 'pattern') is # executed for each map in Tuple[1] parser = optparse.OptionParser() parser.add_option("-i", "--iterations", action="store", type="int", default=1, help="# of times to repeat each test.") parser.add_option("-v", "--verbose", action="store_true", help="print extra detail to stdout") opts, extra = parser.parse_args(args=argv) iterations = opts.iterations verbose = opts.verbose tests = [ ("proton_tests.soak.MessengerTests.test_oneway_*", # 104,297 * 7 = 730,079 msgs transferred per iteration [{ "iterations": iterations, "send_count": 104297, "target_count": 7 }]), ("proton_tests.soak.MessengerTests.test_echo_*", # 102,811 * 5 * 2 (send+reply) = 1,028,110 msgs transferred per iteration [{"iterations": iterations, "send_count": 102811, "target_count": 5, "send_batch": 3187}]), ("proton_tests.soak.MessengerTests.test_relay_*", # 102,197 * 4 * 3 (send+reply+forward)= 1,226,364 msgs transferred per iteration [{"iterations": iterations, "send_count": 102197, "target_count": 4, "send_batch": 829, "forward_count": 7}]), ("proton_tests.soak.MessengerTests.test_star_topology_*", # 2 ports * 3 senders = 6 connections per iteration # 6 connections * 7 targets = 42 links per iteration # 42 links * 35419 msg * 2 (send/reply) = 2,975,196 msgs per iteration [{"iterations": iterations, "port_count": 2, "sender_count": 3, "target_count": 7, "send_count": 35419, "send_batch": 311}]), # # Scale up the number of connections and links # ("proton_tests.soak.MessengerTests.test_star_topology_C", # 10 ports * 10 senders = 100 connections per iteration # 100 connections * 11 targets = 1100 links per iteration # 1100 links * 311 msg * 2 (send/reply) = 684,200 msgs per iteration [{"iterations": iterations, "port_count": 10, "sender_count": 10, "target_count": 11, "send_count": 311, "send_batch": 3}]), ("proton_tests.soak.MessengerTests.test_star_topology_C_SSL", # 10 ports * 10 senders = 100 connections per iteration # 100 connections * 11 targets = 1100 links per iteration # 1100 links * 30 msg * 2 (send/reply) = 66000 msgs per iteration [{"iterations": iterations, "port_count": 10, "sender_count": 10, "target_count": 11, "send_count": 30, "send_batch": 3}]) ] for test in tests: pattern = test[0] param_list = test[1] for test_params in param_list: command = ["proton-test"] for (k, v) in test_params.iteritems(): command.append( "-D%s=%s" % (k,v) ) if verbose: command.append( "-Dverbose" ) command.append( pattern ) if verbose: print("command='%s'" % str(command)) run_test(command) return 0 if __name__ == "__main__": sys.exit(main()) qpid-proton-0.22.0/tests/tools/apps/0000775000000000000000000000000013257152177014216 5ustar qpid-proton-0.22.0/tests/tools/apps/c/0000775000000000000000000000000013257152177014440 5ustar qpid-proton-0.22.0/tests/tools/apps/c/reactor-send.c0000664000000000000000000003227513257152177017203 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * Implements a subset of msgr-send.c using reactor events. */ #include "proton/message.h" #include "proton/error.h" #include "proton/types.h" #include "proton/reactor.h" #include "proton/handlers.h" #include "proton/engine.h" #include "proton/url.h" #include "msgr-common.h" #include #include #include #include typedef struct { Addresses_t targets; uint64_t msg_count; uint32_t msg_size; // of body uint32_t send_batch; int outgoing_window; unsigned int report_interval; // in seconds //Addresses_t subscriptions; //Addresses_t reply_tos; int get_replies; int unique_message; // 1 -> create and free a pn_message_t for each send/recv int timeout; // in seconds int incoming_window; int recv_count; const char *name; char *certificate; char *privatekey; // used to sign certificate char *password; // for private key file char *ca_db; // trusted CA database } Options_t; static void usage(int rc) { printf("Usage: reactor-send [OPTIONS] \n" " -a \tThe target address [amqp[s]://domain[/name]]\n" " -c # \tNumber of messages to send before exiting [0=forever]\n" " -b # \tSize of message body in bytes [1024]\n" " -R \tWait for a reply to each sent message\n" " -V \tEnable debug logging\n" ); exit(rc); } typedef struct { Options_t *opts; Statistics_t *stats; uint64_t sent; uint64_t received; pn_message_t *message; pn_message_t *reply_message; pn_atom_t id; char *encoded_data; size_t encoded_data_size; pn_url_t *send_url; pn_string_t *hostname; pn_string_t *container_id; pn_string_t *reply_to; } sender_context_t; void sender_context_init(sender_context_t *sc, Options_t *opts, Statistics_t *stats) { sc->opts = opts; sc->stats = stats; sc->sent = 0; sc->received = 0; sc->id.type = PN_ULONG; // 4096 extra bytes should easily cover the message metadata sc->encoded_data_size = sc->opts->msg_size + 4096; sc->encoded_data = (char *)calloc(1, sc->encoded_data_size); check(sc->encoded_data, "failed to allocate encoding buffer"); sc->container_id = pn_string("reactor-send"); // prefer uuid-like name sc->reply_message = (sc->opts->get_replies) ? pn_message() : 0; sc->message = pn_message(); check(sc->message, "failed to allocate a message"); sc->reply_to = pn_string("amqp://"); pn_string_addf(sc->reply_to, "%s", pn_string_get(sc->container_id)); pn_message_set_reply_to(sc->message, pn_string_get(sc->reply_to)); pn_data_t *body = pn_message_body(sc->message); // borrow the encoding buffer this one time char *data = sc->encoded_data; pn_data_put_binary(body, pn_bytes(sc->opts->msg_size, data)); check(sc->opts->targets.count > 0, "no specified address"); sc->send_url = pn_url_parse(sc->opts->targets.addresses[0]); const char *host = pn_url_get_host(sc->send_url); const char *port = pn_url_get_port(sc->send_url); sc->hostname = pn_string(host); if (port && strlen(port)) pn_string_addf(sc->hostname, ":%s", port); } sender_context_t *sender_context(pn_handler_t *h) { return (sender_context_t *) pn_handler_mem(h); } void sender_cleanup(pn_handler_t *h) { sender_context_t *sc = sender_context(h); pn_message_free(sc->message); pn_message_free(sc->reply_message); pn_url_free(sc->send_url); pn_free(sc->hostname); pn_free(sc->container_id); pn_free(sc->reply_to); free(sc->encoded_data); } pn_handler_t *replyto_handler(sender_context_t *sc); pn_message_t* get_message(sender_context_t *sc, bool sending) { if (sc->opts->unique_message) { pn_message_t *m = pn_message(); check(m, "failed to allocate a message"); if (sending) { pn_message_set_reply_to(m, pn_string_get(sc->reply_to)); // copy the data pn_data_t *body = pn_message_body(m); pn_data_t *template_body = pn_message_body(sc->message); pn_data_put_binary(body, pn_data_get_binary(template_body)); } return m; } else return sending ? sc->message : sc->reply_message; // our simplified "message pool" } void return_message(sender_context_t *sc, pn_message_t *m) { if (sc->opts->unique_message) pn_message_free(m); } void sender_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type) { sender_context_t *sc = sender_context(h); switch (type) { case PN_CONNECTION_INIT: { pn_connection_t *conn = pn_event_connection(event); pn_connection_set_container(conn, pn_string_get(sc->container_id)); pn_connection_set_hostname(conn, pn_string_get(sc->hostname)); pn_connection_open(conn); pn_session_t *ssn = pn_session(conn); pn_session_open(ssn); pn_link_t *snd = pn_sender(ssn, "sender"); const char *path = pn_url_get_path(sc->send_url); if (path && strlen(path)) { pn_terminus_set_address(pn_link_target(snd), path); pn_terminus_set_address(pn_link_source(snd), path); } pn_link_open(snd); } break; case PN_LINK_FLOW: { pn_link_t *snd = pn_event_link(event); while (pn_link_credit(snd) > 0 && sc->sent < sc->opts->msg_count) { if (sc->sent == 0) statistics_start(sc->stats); char tag[8]; void *ptr = &tag; *((uint64_t *) ptr) = sc->sent; pn_delivery_t *dlv = pn_delivery(snd, pn_dtag(tag, 8)); // setup the message to send pn_message_t *msg = get_message(sc, true);; pn_message_set_address(msg, sc->opts->targets.addresses[0]); sc->id.u.as_ulong = sc->sent; pn_message_set_correlation_id(msg, sc->id); pn_message_set_creation_time(msg, msgr_now()); size_t size = sc->encoded_data_size; int err = pn_message_encode(msg, sc->encoded_data, &size); check(err == 0, "message encoding error"); pn_link_send(snd, sc->encoded_data, size); pn_delivery_settle(dlv); sc->sent++; return_message(sc, msg); } if (sc->sent == sc->opts->msg_count && !sc->opts->get_replies) { pn_link_close(snd); pn_connection_t *conn = pn_event_connection(event); pn_connection_close(conn); } } break; case PN_LINK_INIT: { pn_link_t *link = pn_event_link(event); if (pn_link_is_receiver(link)) { // Response messages link. Could manage credit and deliveries in this handler but // a dedicated handler also works. pn_handler_t *replyto = replyto_handler(sc); pn_flowcontroller_t *fc = pn_flowcontroller(1024); pn_handler_add(replyto, fc); pn_decref(fc); pn_handshaker_t *handshaker = pn_handshaker(); pn_handler_add(replyto, handshaker); pn_decref(handshaker); pn_record_t *record = pn_link_attachments(link); pn_record_set_handler(record, replyto); pn_decref(replyto); } } break; case PN_CONNECTION_LOCAL_CLOSE: { statistics_report(sc->stats, sc->sent, sc->received); } break; default: break; } } pn_handler_t *sender_handler(Options_t *opts, Statistics_t *stats) { pn_handler_t *h = pn_handler_new(sender_dispatch, sizeof(sender_context_t), sender_cleanup); sender_context_t *sc = sender_context(h); sender_context_init(sc, opts, stats); return h; } sender_context_t *replyto_sender_context(pn_handler_t *h) { sender_context_t **p = (sender_context_t **) pn_handler_mem(h); return *p; } void replyto_cleanup(pn_handler_t *h) {} void replyto_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type) { sender_context_t *sc = replyto_sender_context(h); switch (type) { case PN_DELIVERY: { check(sc->opts->get_replies, "Unexpected reply message"); pn_link_t *recv_link = pn_event_link(event); pn_delivery_t *dlv = pn_event_delivery(event); if (pn_link_is_receiver(recv_link) && !pn_delivery_partial(dlv)) { size_t encoded_size = pn_delivery_pending(dlv); check(encoded_size <= sc->encoded_data_size, "decoding buffer too small"); ssize_t n = pn_link_recv(recv_link, sc->encoded_data, encoded_size); check(n == (ssize_t)encoded_size, "read fail on reply link"); pn_message_t *msg = get_message(sc, false); int err = pn_message_decode(msg, sc->encoded_data, n); check(err == 0, "message decode error"); statistics_msg_received(sc->stats, msg); sc->received++; pn_delivery_settle(dlv); return_message(sc, msg); } if (sc->received == sc->opts->msg_count) { pn_link_close(recv_link); pn_connection_t *conn = pn_event_connection(event); pn_connection_close(conn); } } break; default: break; } } pn_handler_t *replyto_handler(sender_context_t *sc) { pn_handler_t *h = pn_handler_new(replyto_dispatch, sizeof(sender_context_t *), replyto_cleanup); sender_context_t **p = (sender_context_t **) pn_handler_mem(h); *p = sc; return h; } static void parse_options( int argc, char **argv, Options_t *opts ) { int c; opterr = 0; memset( opts, 0, sizeof(*opts) ); opts->msg_size = 1024; opts->send_batch = 1024; opts->timeout = -1; opts->recv_count = -1; opts->unique_message = 0; addresses_init(&opts->targets); while ((c = getopt(argc, argv, "ua:c:b:p:w:e:l:Rt:W:B:VN:T:C:K:P:")) != -1) { switch(c) { case 'a': { // TODO: multiple addresses? To keep tests happy, accept multiple for now, // but ignore all but the first. addresses_merge( &opts->targets, optarg ); } break; case 'c': if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'b': if (sscanf( optarg, "%u", &opts->msg_size ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'p': if (sscanf( optarg, "%u", &opts->send_batch ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'w': if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'e': if (sscanf( optarg, "%u", &opts->report_interval ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'R': opts->get_replies = 1; break; case 'u': opts->unique_message = 1; break; case 't': if (sscanf( optarg, "%d", &opts->timeout ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } if (opts->timeout > 0) opts->timeout *= 1000; break; case 'W': if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'B': if (sscanf( optarg, "%d", &opts->recv_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'V': enable_logging(); break; case 'N': opts->name = optarg; break; case 'T': opts->ca_db = optarg; break; case 'C': opts->certificate = optarg; break; case 'K': opts->privatekey = optarg; break; case 'P': parse_password( optarg, &opts->password ); break; default: usage(1); } } // default target if none specified if (opts->targets.count == 0) addresses_add( &opts->targets, "amqp://0.0.0.0" ); } int main(int argc, char** argv) { Options_t opts; Statistics_t stats; parse_options( argc, argv, &opts ); pn_reactor_t *reactor = pn_reactor(); pn_handler_t *sh = sender_handler(&opts, &stats); pn_handler_add(sh, pn_handshaker()); pn_reactor_connection(reactor, sh); pn_reactor_run(reactor); pn_reactor_free(reactor); pn_handler_free(sh); addresses_free(&opts.targets); return 0; } qpid-proton-0.22.0/tests/tools/apps/c/reactor-recv.c0000664000000000000000000003324713257152177017211 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * Implements a subset of msgr-recv.c using reactor events. */ #include "proton/message.h" #include "proton/error.h" #include "proton/types.h" #include "proton/reactor.h" #include "proton/handlers.h" #include "proton/engine.h" #include "proton/url.h" #include "msgr-common.h" #include #include #include #include // The exact struct from msgr-recv, mostly fallow. typedef struct { Addresses_t subscriptions; uint64_t msg_count; int recv_count; int incoming_window; int timeout; // seconds unsigned int report_interval; // in seconds int outgoing_window; int reply; const char *name; const char *ready_text; char *certificate; char *privatekey; // used to sign certificate char *password; // for private key file char *ca_db; // trusted CA database } Options_t; static void usage(int rc) { printf("Usage: reactor-recv [OPTIONS] \n" " -c # \tNumber of messages to receive before exiting [0=forever]\n" " -R \tSend reply if 'reply-to' present\n" " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n" " -X \tPrint '\\n' to stdout after all subscriptions are created\n" ); exit(rc); } // Global context for this process typedef struct { Options_t *opts; Statistics_t *stats; uint64_t sent; uint64_t received; pn_message_t *message; pn_acceptor_t *acceptor; char *encoded_data; size_t encoded_data_size; int connections; pn_list_t *active_connections; bool shutting_down; pn_handler_t *listener_handler; int quiesce_count; } global_context_t; // Per connection context typedef struct { global_context_t *global; int connection_id; pn_link_t *recv_link; pn_link_t *reply_link; } connection_context_t; static char *ensure_buffer(char *buf, size_t needed, size_t *actual) { char* new_buf; // Make room for the largest message seen so far, plus extra for slight changes in metadata content if (needed + 1024 <= *actual) return buf; needed += 2048; new_buf = (char *) realloc(buf, needed); if (new_buf != NULL) { buf = new_buf; *actual = buf ? needed : 0; } return buf; } void global_shutdown(global_context_t *gc) { if (gc->shutting_down) return; gc->shutting_down = true; pn_acceptor_close(gc->acceptor); size_t n = pn_list_size(gc->active_connections); for (size_t i = 0; i < n; i++) { pn_connection_t *conn = (pn_connection_t *) pn_list_get(gc->active_connections, i); if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) { pn_connection_close(conn); } } } connection_context_t *connection_context(pn_handler_t *h) { connection_context_t *p = (connection_context_t *) pn_handler_mem(h); return p; } void connection_context_init(connection_context_t *cc, global_context_t *gc) { cc->global = gc; pn_incref(gc->listener_handler); cc->connection_id = gc->connections++; cc->recv_link = 0; cc->reply_link = 0; } void connection_cleanup(pn_handler_t *h) { connection_context_t *cc = connection_context(h); // Undo pn_incref() from connection_context_init() pn_decref(cc->global->listener_handler); } void connection_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type) { connection_context_t *cc = connection_context(h); bool replying = cc->global->opts->reply; switch (type) { case PN_LINK_REMOTE_OPEN: { pn_link_t *link = pn_event_link(event); if (pn_link_is_receiver(link)) { check(cc->recv_link == NULL, "Multiple incoming links on one connection"); cc->recv_link = link; pn_connection_t *conn = pn_event_connection(event); pn_list_add(cc->global->active_connections, conn); if (cc->global->shutting_down) { pn_connection_close(conn); break; } if (replying) { // Set up a reply link and defer granting credit to the incoming link pn_connection_t *conn = pn_session_connection(pn_link_session(link)); pn_session_t *ssn = pn_session(conn); pn_session_open(ssn); char name[100]; // prefer a multiplatform uuid generator sprintf(name, "reply_sender_%d", cc->connection_id); cc->reply_link = pn_sender(ssn, name); pn_link_open(cc->reply_link); } else { pn_flowcontroller_t *fc = pn_flowcontroller(1024); pn_handler_add(h, fc); pn_decref(fc); } } } break; case PN_LINK_FLOW: { if (replying) { pn_link_t *reply_link = pn_event_link(event); // pn_flowcontroller handles the non-reply case check(reply_link == cc->reply_link, "internal error"); // Grant the sender as much credit as just given to us for replies int delta = pn_link_credit(reply_link) - pn_link_credit(cc->recv_link); if (delta > 0) pn_link_flow(cc->recv_link, delta); } } break; case PN_DELIVERY: { pn_link_t *recv_link = pn_event_link(event); pn_delivery_t *dlv = pn_event_delivery(event); if (pn_link_is_receiver(recv_link) && !pn_delivery_partial(dlv)) { if (cc->global->received == 0) statistics_start(cc->global->stats); size_t encoded_size = pn_delivery_pending(dlv); cc->global->encoded_data = ensure_buffer(cc->global->encoded_data, encoded_size, &cc->global->encoded_data_size); check(cc->global->encoded_data, "decoding buffer realloc failure"); ssize_t n = pn_link_recv(recv_link, cc->global->encoded_data, encoded_size); check(n == (ssize_t) encoded_size, "message data read fail"); pn_message_t *msg = cc->global->message; int err = pn_message_decode(msg, cc->global->encoded_data, n); check(err == 0, "message decode error"); cc->global->received++; pn_delivery_settle(dlv); statistics_msg_received(cc->global->stats, msg); if (replying) { const char *reply_addr = pn_message_get_reply_to(msg); if (reply_addr) { pn_link_t *rl = cc->reply_link; check(pn_link_credit(rl) > 0, "message received without corresponding reply credit"); LOG("Replying to: %s\n", reply_addr ); pn_message_set_address(msg, reply_addr); pn_message_set_creation_time(msg, msgr_now()); char tag[8]; void *ptr = &tag; *((uint64_t *) ptr) = cc->global->sent; pn_delivery_t *dlv = pn_delivery(rl, pn_dtag(tag, 8)); size_t size = cc->global->encoded_data_size; int err = pn_message_encode(msg, cc->global->encoded_data, &size); check(err == 0, "message encoding error"); pn_link_send(rl, cc->global->encoded_data, size); pn_delivery_settle(dlv); cc->global->sent++; } } } if (cc->global->received >= cc->global->opts->msg_count) { global_shutdown(cc->global); } } break; case PN_CONNECTION_UNBOUND: { pn_connection_t *conn = pn_event_connection(event); pn_list_remove(cc->global->active_connections, conn); pn_connection_release(conn); } break; default: break; } } pn_handler_t *connection_handler(global_context_t *gc) { pn_handler_t *h = pn_handler_new(connection_dispatch, sizeof(connection_context_t), connection_cleanup); connection_context_t *cc = connection_context(h); connection_context_init(cc, gc); return h; } void start_listener(global_context_t *gc, pn_reactor_t *reactor) { check(gc->opts->subscriptions.count > 0, "no listening address"); pn_url_t *listen_url = pn_url_parse(gc->opts->subscriptions.addresses[0]); const char *host = pn_url_get_host(listen_url); const char *port = pn_url_get_port(listen_url); if (port == 0 || strlen(port) == 0) port = "5672"; if (host == 0 || strlen(host) == 0) host = "0.0.0.0"; if (*host == '~') host++; gc->acceptor = pn_reactor_acceptor(reactor, host, port, NULL); check(gc->acceptor, "acceptor creation failed"); pn_url_free(listen_url); } void global_context_init(global_context_t *gc, Options_t *o, Statistics_t *s) { gc->opts = o; gc->stats = s; gc->sent = 0; gc->received = 0; gc->encoded_data_size = 0; gc->encoded_data = 0; gc->message = pn_message(); check(gc->message, "failed to allocate a message"); gc->connections = 0; gc->active_connections = pn_list(PN_OBJECT, 0); gc->acceptor = 0; gc->shutting_down = false; gc->listener_handler = 0; gc->quiesce_count = 0; } global_context_t *global_context(pn_handler_t *h) { return (global_context_t *) pn_handler_mem(h); } void listener_cleanup(pn_handler_t *h) { global_context_t *gc = global_context(h); pn_message_free(gc->message); free(gc->encoded_data); pn_free(gc->active_connections); } void listener_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type) { global_context_t *gc = global_context(h); if (type == PN_REACTOR_QUIESCED) gc->quiesce_count++; else gc->quiesce_count = 0; switch (type) { case PN_CONNECTION_INIT: { pn_connection_t *connection = pn_event_connection(event); // New incoming connection on listener socket. Give each a separate handler. pn_handler_t *ch = connection_handler(gc); pn_handshaker_t *handshaker = pn_handshaker(); pn_handler_add(ch, handshaker); pn_decref(handshaker); pn_record_t *record = pn_connection_attachments(connection); pn_record_set_handler(record, ch); pn_decref(ch); } break; case PN_REACTOR_QUIESCED: { // Two quiesce in a row means we have been idle for a timeout period if (gc->opts->timeout != -1 && gc->quiesce_count > 1) global_shutdown(gc); } break; case PN_REACTOR_INIT: { pn_reactor_t *reactor = pn_event_reactor(event); start_listener(gc, reactor); // hack to let test scripts know when the receivers are ready (so // that the senders may be started) if (gc->opts->ready_text) { fprintf(stdout, "%s\n", gc->opts->ready_text); fflush(stdout); } if (gc->opts->timeout != -1) pn_reactor_set_timeout(pn_event_reactor(event), gc->opts->timeout); } break; case PN_REACTOR_FINAL: { if (gc->received == 0) statistics_start(gc->stats); statistics_report(gc->stats, gc->sent, gc->received); } break; default: break; } } pn_handler_t *listener_handler(Options_t *opts, Statistics_t *stats) { pn_handler_t *h = pn_handler_new(listener_dispatch, sizeof(global_context_t), listener_cleanup); global_context_t *gc = global_context(h); global_context_init(gc, opts, stats); gc->listener_handler = h; return h; } static void parse_options( int argc, char **argv, Options_t *opts ) { int c; opterr = 0; memset( opts, 0, sizeof(*opts) ); opts->recv_count = -1; opts->timeout = -1; addresses_init( &opts->subscriptions); while ((c = getopt(argc, argv, "a:c:b:w:t:e:RW:F:VN:X:T:C:K:P:")) != -1) { switch (c) { case 'a': { // TODO: multiple addresses? char *comma = strchr(optarg, ','); check(comma == 0, "multiple addresses not implemented"); check(opts->subscriptions.count == 0, "multiple addresses not implemented"); addresses_merge( &opts->subscriptions, optarg ); } break; case 'c': if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 't': if (sscanf( optarg, "%d", &opts->timeout ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } if (opts->timeout > 0) opts->timeout *= 1000; break; case 'R': opts->reply = 1; break; case 'V': enable_logging(); break; case 'X': opts->ready_text = optarg; break; default: usage(1); } } if (opts->subscriptions.count == 0) addresses_add( &opts->subscriptions, "amqp://~0.0.0.0" ); } int main(int argc, char** argv) { Options_t opts; Statistics_t stats; parse_options( argc, argv, &opts ); pn_reactor_t *reactor = pn_reactor(); // set up default handlers for our reactor pn_handler_t *root = pn_reactor_get_handler(reactor); pn_handler_t *lh = listener_handler(&opts, &stats); pn_handler_add(root, lh); pn_handshaker_t *handshaker = pn_handshaker(); pn_handler_add(root, handshaker); // Omit decrefs else segfault. Not sure why they are necessary // to keep valgrind happy for the connection_handler, but not here. // pn_decref(handshaker); // pn_decref(lh); pn_reactor_run(reactor); pn_reactor_free(reactor); addresses_free( &opts.subscriptions ); return 0; } qpid-proton-0.22.0/tests/tools/apps/c/msgr-send.c0000664000000000000000000002611213257152177016505 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "msgr-common.h" #include "proton/message.h" #include "proton/messenger.h" #include "proton/error.h" #include #include #include #include typedef struct { Addresses_t targets; uint64_t msg_count; uint32_t msg_size; // of body uint32_t send_batch; int outgoing_window; unsigned int report_interval; // in seconds //Addresses_t subscriptions; //Addresses_t reply_tos; int get_replies; int timeout; // in seconds int incoming_window; int recv_count; const char *name; char *certificate; char *privatekey; // used to sign certificate char *password; // for private key file char *ca_db; // trusted CA database } Options_t; static void usage(int rc) { printf("Usage: msgr-send [OPTIONS] \n" " -a [,]* \tThe target address [amqp[s]://domain[/name]]\n" " -c # \tNumber of messages to send before exiting [0=forever]\n" " -b # \tSize of message body in bytes [1024]\n" " -p # \tSend batches of # messages (wait for replies before sending next batch if -R) [1024]\n" " -w # \t# outgoing window size [0]\n" " -e # \t# seconds to report statistics, 0 = end of test [0]\n" " -R \tWait for a reply to each sent message\n" " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n" " -W # \tIncoming window size [0]\n" " -B # \tArgument to Messenger::recv(n) [-1]\n" " -N \tSet the container name to \n" " -V \tEnable debug logging\n" " SSL options:\n" " -T \tDatabase of trusted CA certificates for validating peer\n" " -C \tFile containing self-identifying certificate\n" " -K \tFile containing private key used to sign certificate\n" " -P [pass:|path] \tPassword to unlock private key file.\n" ); //printf("-p \t*TODO* Add N sample properties to each message [3]\n"); exit(rc); } static void parse_options( int argc, char **argv, Options_t *opts ) { int c; opterr = 0; memset( opts, 0, sizeof(*opts) ); opts->msg_size = 1024; opts->send_batch = 1024; opts->timeout = -1; opts->recv_count = -1; addresses_init(&opts->targets); while ((c = getopt(argc, argv, "a:c:b:p:w:e:l:Rt:W:B:VN:T:C:K:P:")) != -1) { switch(c) { case 'a': addresses_merge( &opts->targets, optarg ); break; case 'c': if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'b': if (sscanf( optarg, "%u", &opts->msg_size ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'p': if (sscanf( optarg, "%u", &opts->send_batch ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'w': if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'e': if (sscanf( optarg, "%u", &opts->report_interval ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'R': opts->get_replies = 1; break; case 't': if (sscanf( optarg, "%d", &opts->timeout ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } if (opts->timeout > 0) opts->timeout *= 1000; break; case 'W': if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'B': if (sscanf( optarg, "%d", &opts->recv_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'V': enable_logging(); break; case 'N': opts->name = optarg; break; case 'T': opts->ca_db = optarg; break; case 'C': opts->certificate = optarg; break; case 'K': opts->privatekey = optarg; break; case 'P': parse_password( optarg, &opts->password ); break; default: usage(1); } } // default target if none specified if (opts->targets.count == 0) addresses_add( &opts->targets, "amqp://0.0.0.0" ); } // return the # of reply messages received static int process_replies( pn_messenger_t *messenger, pn_message_t *message, Statistics_t *stats, int max_count) { int received = 0; LOG("Calling pn_messenger_recv(%d)\n", max_count); int rc = pn_messenger_recv( messenger, max_count ); check((rc == 0 || rc == PN_TIMEOUT), "pn_messenger_recv() failed"); LOG("Messages on incoming queue: %d\n", pn_messenger_incoming(messenger)); while (pn_messenger_incoming(messenger)) { pn_messenger_get(messenger, message); check_messenger(messenger); received++; // TODO: header decoding? statistics_msg_received( stats, message ); // uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong; } return received; } int main(int argc, char** argv) { Options_t opts; Statistics_t stats; uint64_t sent = 0; uint64_t received = 0; int target_index = 0; int rc; pn_message_t *message = 0; pn_message_t *reply_message = 0; pn_messenger_t *messenger = 0; parse_options( argc, argv, &opts ); messenger = pn_messenger( opts.name ); if (opts.certificate) { rc = pn_messenger_set_certificate(messenger, opts.certificate); check( rc == 0, "Failed to set certificate" ); } if (opts.privatekey) { rc = pn_messenger_set_private_key(messenger, opts.privatekey); check( rc == 0, "Failed to set private key" ); } if (opts.password) { rc = pn_messenger_set_password(messenger, opts.password); check( rc == 0, "Failed to set password" ); } if (opts.ca_db) { rc = pn_messenger_set_trusted_certificates(messenger, opts.ca_db); check( rc == 0, "Failed to set trusted CA database" ); } if (opts.outgoing_window) { pn_messenger_set_outgoing_window( messenger, opts.outgoing_window ); } pn_messenger_set_timeout( messenger, opts.timeout ); pn_messenger_start(messenger); message = pn_message(); check(message, "failed to allocate a message"); pn_message_set_reply_to(message, "~"); pn_data_t *body = pn_message_body(message); char *data = (char *)calloc(1, opts.msg_size); pn_data_put_binary(body, pn_bytes(opts.msg_size, data)); free(data); pn_atom_t id; id.type = PN_ULONG; #if 0 // TODO: how do we effectively benchmark header processing overhead??? pn_data_t *props = pn_message_properties(message); pn_data_put_map(props); pn_data_enter(props); // //pn_data_put_string(props, pn_bytes(6, "string")); //pn_data_put_string(props, pn_bytes(10, "this is awkward")); // //pn_data_put_string(props, pn_bytes(4, "long")); pn_data_put_long(props, 12345); // //pn_data_put_string(props, pn_bytes(9, "timestamp")); pn_data_put_timestamp(props, (pn_timestamp_t) 54321); pn_data_exit(props); #endif const int get_replies = opts.get_replies; if (get_replies) { // disable the timeout so that pn_messenger_recv() won't block reply_message = pn_message(); check(reply_message, "failed to allocate a message"); } statistics_start( &stats ); while (!opts.msg_count || (sent < opts.msg_count)) { // setup the message to send pn_message_set_address(message, opts.targets.addresses[target_index]); target_index = NEXT_ADDRESS(opts.targets, target_index); id.u.as_ulong = sent; pn_message_set_correlation_id( message, id ); pn_message_set_creation_time( message, msgr_now() ); pn_messenger_put(messenger, message); sent++; if (opts.send_batch && (pn_messenger_outgoing(messenger) >= (int)opts.send_batch)) { if (get_replies) { while (received < sent) { // this will also transmit any pending sent messages received += process_replies( messenger, reply_message, &stats, opts.recv_count ); } } else { LOG("Calling pn_messenger_send()\n"); rc = pn_messenger_send(messenger, -1); check((rc == 0 || rc == PN_TIMEOUT), "pn_messenger_send() failed"); } } check_messenger(messenger); } LOG("Messages received=%llu sent=%llu\n", received, sent); if (get_replies) { // wait for the last of the replies while (received < sent) { int count = process_replies( messenger, reply_message, &stats, opts.recv_count ); check( count > 0 || (opts.timeout == 0), "Error: timed out waiting for reply messages\n"); received += count; LOG("Messages received=%llu sent=%llu\n", received, sent); } } else if (pn_messenger_outgoing(messenger) > 0) { LOG("Calling pn_messenger_send()\n"); rc = pn_messenger_send(messenger, -1); check(rc == 0, "pn_messenger_send() failed"); } rc = pn_messenger_stop(messenger); check(rc == 0, "pn_messenger_stop() failed"); check_messenger(messenger); statistics_report( &stats, sent, received ); pn_messenger_free(messenger); pn_message_free(message); if (reply_message) pn_message_free( reply_message ); addresses_free( &opts.targets ); return 0; } qpid-proton-0.22.0/tests/tools/apps/c/msgr-recv.c0000664000000000000000000002354513257152177016522 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "msgr-common.h" #include "proton/message.h" #include "proton/messenger.h" #include "proton/error.h" #include #include #include #include typedef struct { Addresses_t subscriptions; uint64_t msg_count; int recv_count; int incoming_window; int timeout; // seconds unsigned int report_interval; // in seconds int outgoing_window; Addresses_t forwarding_targets; int reply; const char *name; const char *ready_text; char *certificate; char *privatekey; // used to sign certificate char *password; // for private key file char *ca_db; // trusted CA database } Options_t; static void usage(int rc) { printf("Usage: msgr-recv [OPTIONS] \n" " -a [,]* \tAddresses to listen on [amqp://~0.0.0.0]\n" " -c # \tNumber of messages to receive before exiting [0=forever]\n" " -b # \tArgument to Messenger::recv(n) [2048]\n" " -w # \tSize for incoming window [0]\n" " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n" " -e # \t# seconds to report statistics, 0 = end of test [0] *TBD*\n" " -R \tSend reply if 'reply-to' present\n" " -W # \t# outgoing window size [0]\n" " -F [,]* \tAddresses used for forwarding received messages\n" " -N \tSet the container name to \n" " -X \tPrint '\\n' to stdout after all subscriptions are created\n" " -V \tEnable debug logging\n" " SSL options:\n" " -T \tDatabase of trusted CA certificates for validating peer\n" " -C \tFile containing self-identifying certificate\n" " -K \tFile containing private key used to sign certificate\n" " -P [pass:|path] \tPassword to unlock private key file.\n" ); exit(rc); } static void parse_options( int argc, char **argv, Options_t *opts ) { int c; opterr = 0; memset( opts, 0, sizeof(*opts) ); opts->recv_count = -1; opts->timeout = -1; addresses_init(&opts->subscriptions); addresses_init(&opts->forwarding_targets); while ((c = getopt(argc, argv, "a:c:b:w:t:e:RW:F:VN:X:T:C:K:P:")) != -1) { switch (c) { case 'a': addresses_merge( &opts->subscriptions, optarg ); break; case 'c': if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'b': if (sscanf( optarg, "%d", &opts->recv_count ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'w': if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 't': if (sscanf( optarg, "%d", &opts->timeout ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } if (opts->timeout > 0) opts->timeout *= 1000; break; case 'e': if (sscanf( optarg, "%u", &opts->report_interval ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'R': opts->reply = 1; break; case 'W': if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) { fprintf(stderr, "Option -%c requires an integer argument.\n", optopt); usage(1); } break; case 'F': addresses_merge( &opts->forwarding_targets, optarg ); break; case 'V': enable_logging(); break; case 'N': opts->name = optarg; break; case 'X': opts->ready_text = optarg; break; case 'T': opts->ca_db = optarg; break; case 'C': opts->certificate = optarg; break; case 'K': opts->privatekey = optarg; break; case 'P': parse_password( optarg, &opts->password ); break; default: usage(1); } } // default subscription if none specified if (opts->subscriptions.count == 0) addresses_add( &opts->subscriptions, "amqp://~0.0.0.0" ); } int main(int argc, char** argv) { Options_t opts; Statistics_t stats; uint64_t sent = 0; uint64_t received = 0; int forwarding_index = 0; int rc; pn_message_t *message; pn_messenger_t *messenger; parse_options( argc, argv, &opts ); const int forward = opts.forwarding_targets.count != 0; message = pn_message(); messenger = pn_messenger( opts.name ); /* load the various command line options if they're set */ if (opts.certificate) { rc = pn_messenger_set_certificate(messenger, opts.certificate); check_messenger(messenger); check( rc == 0, "Failed to set certificate" ); } if (opts.privatekey) { rc = pn_messenger_set_private_key(messenger, opts.privatekey); check_messenger(messenger); check( rc == 0, "Failed to set private key" ); } if (opts.password) { rc = pn_messenger_set_password(messenger, opts.password); check_messenger(messenger); check( rc == 0, "Failed to set password" ); } if (opts.ca_db) { rc = pn_messenger_set_trusted_certificates(messenger, opts.ca_db); check_messenger(messenger); check( rc == 0, "Failed to set trusted CA database" ); } if (opts.incoming_window) { // RAFI: seems to cause receiver to hang: pn_messenger_set_incoming_window( messenger, opts.incoming_window ); } pn_messenger_set_timeout( messenger, opts.timeout ); pn_messenger_start(messenger); check_messenger(messenger); int i; for (i = 0; i < opts.subscriptions.count; i++) { pn_messenger_subscribe(messenger, opts.subscriptions.addresses[i]); check_messenger(messenger); LOG("Subscribing to '%s'\n", opts.subscriptions.addresses[i]); } // hack to let test scripts know when the receivers are ready (so // that the senders may be started) if (opts.ready_text) { fprintf(stdout, "%s\n", opts.ready_text); fflush(stdout); } while (!opts.msg_count || received < opts.msg_count) { LOG("Calling pn_messenger_recv(%d)\n", opts.recv_count); rc = pn_messenger_recv(messenger, opts.recv_count); check_messenger(messenger); check(rc == 0 || (opts.timeout == 0 && rc == PN_TIMEOUT), "pn_messenger_recv() failed"); // start the timer only after receiving the first msg if (received == 0) statistics_start( &stats ); LOG("Messages on incoming queue: %d\n", pn_messenger_incoming(messenger)); while (pn_messenger_incoming(messenger)) { pn_messenger_get(messenger, message); check_messenger(messenger); received++; // TODO: header decoding? // uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong; statistics_msg_received( &stats, message ); if (opts.reply) { const char *reply_addr = pn_message_get_reply_to( message ); if (reply_addr) { LOG("Replying to: %s\n", reply_addr ); pn_message_set_address( message, reply_addr ); pn_message_set_creation_time( message, msgr_now() ); pn_messenger_put(messenger, message); sent++; } } if (forward) { const char *forward_addr = opts.forwarding_targets.addresses[forwarding_index]; forwarding_index = NEXT_ADDRESS(opts.forwarding_targets, forwarding_index); LOG("Forwarding to: %s\n", forward_addr ); pn_message_set_address( message, forward_addr ); pn_message_set_reply_to( message, NULL ); // else points to origin sender pn_message_set_creation_time( message, msgr_now() ); pn_messenger_put(messenger, message); sent++; } } LOG("Messages received=%llu sent=%llu\n", received, sent); } // this will flush any pending sends if (pn_messenger_outgoing(messenger) > 0) { LOG("Calling pn_messenger_send()\n"); rc = pn_messenger_send(messenger, -1); check_messenger(messenger); check(rc == 0, "pn_messenger_send() failed"); } rc = pn_messenger_stop(messenger); check(rc == 0, "pn_messenger_stop() failed"); check_messenger(messenger); statistics_report( &stats, sent, received ); pn_messenger_free(messenger); pn_message_free(message); addresses_free( &opts.subscriptions ); addresses_free( &opts.forwarding_targets ); return 0; } qpid-proton-0.22.0/tests/tools/apps/c/msgr-common.h0000664000000000000000000000471513257152177017056 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "pncompat/misc_defs.h" #if defined(USE_INTTYPES) #ifdef __cplusplus #define __STDC_FORMAT_MACROS #endif #include #endif #ifdef _MSC_VER #if !defined(PRIu64) #define PRIu64 "I64u" #endif #if !defined(SCNu64) #define SCNu64 "I64u" #endif #endif /* If still not defined, best guess */ #if !defined(SCNu64) #define SCNu64 "ul" #endif #if !defined(PRIu64) #define PRIu64 "ul" #endif #include "proton/types.h" #include "proton/message.h" void msgr_die(const char *file, int line, const char *message); char *msgr_strdup( const char *src ); pn_timestamp_t msgr_now(void); void parse_password( const char *, char ** ); #define check_messenger(m) \ { check(pn_messenger_errno(m) == 0, pn_error_text(pn_messenger_error(m))) } #define check( expression, message ) \ { if (!(expression)) msgr_die(__FILE__,__LINE__, message); } // manage an ordered list of addresses typedef struct { const char **addresses; int size; // room in 'addresses' int count; // # entries } Addresses_t; #define NEXT_ADDRESS(a, i) (((i) + 1) % (a).count) void addresses_init( Addresses_t *a ); void addresses_free( Addresses_t *a ); void addresses_add( Addresses_t *a, const char *addr ); void addresses_merge( Addresses_t *a, const char *list ); // Statistics handling typedef struct { pn_timestamp_t start; uint64_t latency_samples; double latency_total; double latency_min; double latency_max; } Statistics_t; void statistics_start( Statistics_t *s ); void statistics_msg_received( Statistics_t *s, pn_message_t *message ); void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received ); void enable_logging(void); void LOG( const char *fmt, ... ); qpid-proton-0.22.0/tests/tools/apps/c/msgr-common.c0000664000000000000000000001125613257152177017047 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "msgr-common.h" #include #include #include #include #include void msgr_die(const char *file, int line, const char *message) { fprintf(stderr, "%s:%i: %s\n", file, line, message); exit(1); } //sigh - would be nice if proton exported pn_strdup() char *msgr_strdup( const char *src ) { char *r = NULL; if (src) { r = (char *) malloc(sizeof(char) * (strlen(src) + 1)); if (r) strcpy(r,src); } return r; } pn_timestamp_t msgr_now() { // from "pncompat/misc_funcs.inc" return time_now(); } void addresses_init( Addresses_t *a ) { a->size = 10; // whatever a->count = 0; a->addresses = (const char **) calloc( a->size, sizeof(const char *)); check(a->addresses, "malloc failure"); } void addresses_free( Addresses_t *a ) { if (a->addresses) { int i; for (i = 0; i < a->count; i++) if (a->addresses[i]) free( (void *)a->addresses[i] ); free( a->addresses ); a->addresses = NULL; } } void addresses_add( Addresses_t *a, const char *addr ) { if (a->count == a->size) { a->size += 10; a->addresses = (const char **) realloc( a->addresses, a->size * sizeof(const char *) ); check( a->addresses, "malloc failure" ); int i; for (i = a->count; i < a->size; i++) a->addresses[i] = NULL; } a->addresses[a->count] = msgr_strdup(addr); check( a->addresses[a->count], "malloc failure" ); a->count++; } // merge a comma-separated list of addresses void addresses_merge( Addresses_t *a, const char *list ) { char *const l = msgr_strdup(list); check( l, "malloc failure" ); char *addr = l; while (addr && *addr) { char *comma = strchr( addr, ',' ); if (comma) { *comma++ = '\0'; } addresses_add( a, addr ); addr = comma; } free(l); } void statistics_start( Statistics_t *s ) { s->latency_samples = 0; s->latency_total = s->latency_min = s->latency_max = 0.0; s->start = msgr_now(); } void statistics_msg_received( Statistics_t *s, pn_message_t *message ) { pn_timestamp_t ts = pn_message_get_creation_time( message ); if (ts) { double l = (double)(msgr_now() - ts); if (l > 0) { s->latency_total += l; if (++s->latency_samples == 1) { s->latency_min = s->latency_max = l; } else { if (s->latency_min > l) s->latency_min = l; if (s->latency_max < l) s->latency_max = l; } } } } void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received ) { pn_timestamp_t end = msgr_now() - s->start; double secs = end/(double)1000.0; fprintf(stdout, "Messages sent: %" PRIu64 " recv: %" PRIu64 "\n", sent, received ); fprintf(stdout, "Total time: %f sec\n", secs ); fprintf(stdout, "Throughput: %f msgs/sec\n", (secs != 0.0) ? (double)sent/secs : 0); fprintf(stdout, "Latency (sec): %f min %f max %f avg\n", s->latency_min/1000.0, s->latency_max/1000.0, (s->latency_samples) ? (s->latency_total/s->latency_samples)/1000.0 : 0); } void parse_password( const char *input, char **password ) { if (strncmp( input, "pass:", 5 ) == 0) { // password provided on command line (not secure, shows up in 'ps') *password = msgr_strdup( input + 5 ); } else { // input assumed to be file containing password FILE *f = fopen( input, "r" ); check( f, "Cannot open password file\n" ); *password = (char *)malloc(256); // 256 should be enough for anybody! check( *password, "malloc failure" ); int rc = fscanf( f, "%255s", *password ); check( rc == 1, "Cannot read password from file\n" ); fclose(f); } } static int log = 0; void enable_logging() { log = 1; } void LOG( const char *fmt, ... ) { if (log) { va_list ap; va_start(ap, fmt); vfprintf( stdout, fmt, ap ); va_end(ap); } } qpid-proton-0.22.0/tests/tools/apps/c/include/0000775000000000000000000000000013257152177016063 5ustar qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/0000775000000000000000000000000013257152177017704 5ustar qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/misc_funcs.inc0000664000000000000000000000410413257152177022527 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * This file provides the functions for "misc_defs.h" in the form of * included code, as opposed to a separate library or object * dependency. In the absence of portable "pragma weak" compiler * directives, this provides a simple workaround. * * Usage for a single compilation unit: * * #include "pncompat/misc_funcs.inc" * * Usage for multiple combined compilation units: chose one to include * "pncompat/misc_funcs.inc" as above and in each other unit needing the * definitions use * * #include "pncompat/misc_defs.h" * */ #include "misc_defs.h" #if defined(_WIN32) && ! defined(__CYGWIN__) #include "pncompat/internal/getopt.c" #endif #if defined(_WIN32) && ! defined(__CYGWIN__) #include pn_timestamp_t time_now(void) { FILETIME now; ULARGE_INTEGER t; GetSystemTimeAsFileTime(&now); t.u.HighPart = now.dwHighDateTime; t.u.LowPart = now.dwLowDateTime; // Convert to milliseconds and adjust base epoch return t.QuadPart / 10000 - 11644473600000; } #else #include #include #include #include pn_timestamp_t time_now(void) { struct timeval now; if (gettimeofday(&now, NULL)) {fprintf(stderr, "gettimeofday failed\n"); abort();} return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000); } #endif qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/misc_defs.h0000664000000000000000000000264013257152177022013 0ustar #ifndef PNCOMAPT_MISC_DEFS_H #define PNCOMAPT_MISC_DEFS_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #if defined(qpid_proton_EXPORTS) #error This include file is not for use in the main proton library #endif /* * Platform neutral definitions. Only intended for use by Proton * examples and test/debug programs. * * This file and any related support files may change or be removed * at any time. */ // getopt() #include #if defined(__IBMC__) # include #elif !defined(_WIN32) || defined (__CYGWIN__) # include #else # include "internal/getopt.h" #endif pn_timestamp_t time_now(void); #endif /* PNCOMPAT_MISC_DEFS_H */ qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/internal/0000775000000000000000000000000013257152177021520 5ustar qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/internal/getopt.h0000664000000000000000000000403213257152177023172 0ustar /***************************************************************************** * getopt.h - competent and free getopt library. * $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $ * * Copyright (c)2002-2003 Mark K. Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the original author of this software nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #ifndef GETOPT_H_ #define GETOPT_H_ #ifdef __cplusplus extern "C" { #endif extern char* optarg; extern int optind; extern int opterr; extern int optopt; int getopt(int argc, char** argv, char* optstr); #ifdef __cplusplus } #endif #endif /* GETOPT_H_ */ /* vim:ts=3 */ qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/internal/getopt.c0000664000000000000000000001447613257152177023202 0ustar /***************************************************************************** * getopt.c - competent and free getopt library. * $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $ * * Copyright (c)2002-2003 Mark K. Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the original author of this software nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #include #include #include #include "getopt.h" static const char* ID = "$Id: getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $"; char* optarg = NULL; int optind = 0; int opterr = 1; int optopt = '?'; static char** prev_argv = NULL; /* Keep a copy of argv and argc to */ static int prev_argc = 0; /* tell if getopt params change */ static int argv_index = 0; /* Option we're checking */ static int argv_index2 = 0; /* Option argument we're checking */ static int opt_offset = 0; /* Index into compounded "-option" */ static int dashdash = 0; /* True if "--" option reached */ static int nonopt = 0; /* How many nonopts we've found */ static void increment_index() { /* Move onto the next option */ if(argv_index < argv_index2) { while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-' && argv_index < argv_index2+1); } else argv_index++; opt_offset = 1; } /* * Permutes argv[] so that the argument currently being processed is moved * to the end. */ static int permute_argv_once() { /* Movability check */ if(argv_index + nonopt >= prev_argc) return 1; /* Move the current option to the end, bring the others to front */ else { char* tmp = prev_argv[argv_index]; /* Move the data */ memmove(&prev_argv[argv_index], &prev_argv[argv_index+1], sizeof(char**) * (prev_argc - argv_index - 1)); prev_argv[prev_argc - 1] = tmp; nonopt++; return 0; } } int getopt(int argc, char** argv, char* optstr) { int c = 0; /* If we have new argv, reinitialize */ if(prev_argv != argv || prev_argc != argc) { /* Initialize variables */ prev_argv = argv; prev_argc = argc; argv_index = 1; argv_index2 = 1; opt_offset = 1; dashdash = 0; nonopt = 0; } /* Jump point in case we want to ignore the current argv_index */ getopt_top: /* Misc. initializations */ optarg = NULL; /* Dash-dash check */ if(argv[argv_index] && !strcmp(argv[argv_index], "--")) { dashdash = 1; increment_index(); } /* If we're at the end of argv, that's it. */ if(argv[argv_index] == NULL) { c = -1; } /* Are we looking at a string? Single dash is also a string */ else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-")) { /* If we want a string... */ if(optstr[0] == '-') { c = 1; optarg = argv[argv_index]; increment_index(); } /* If we really don't want it (we're in POSIX mode), we're done */ else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT")) { c = -1; /* Everything else is a non-opt argument */ nonopt = argc - argv_index; } /* If we mildly don't want it, then move it back */ else { if(!permute_argv_once()) goto getopt_top; else c = -1; } } /* Otherwise we're looking at an option */ else { char* opt_ptr = NULL; /* Grab the option */ c = argv[argv_index][opt_offset++]; /* Is the option in the optstr? */ if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c); else opt_ptr = strchr(optstr, c); /* Invalid argument */ if(!opt_ptr) { if(opterr) { fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c); } optopt = c; c = '?'; /* Move onto the next option */ increment_index(); } /* Option takes argument */ else if(opt_ptr[1] == ':') { /* ie, -oARGUMENT, -xxxoARGUMENT, etc. */ if(argv[argv_index][opt_offset] != '\0') { optarg = &argv[argv_index][opt_offset]; increment_index(); } /* ie, -o ARGUMENT (only if it's a required argument) */ else if(opt_ptr[2] != ':') { /* One of those "you're not expected to understand this" moment */ if(argv_index2 < argv_index) argv_index2 = argv_index; while(argv[++argv_index2] && argv[argv_index2][0] == '-'); optarg = argv[argv_index2]; /* Don't cross into the non-option argument list */ if(argv_index2 + nonopt >= prev_argc) optarg = NULL; /* Move onto the next option */ increment_index(); } else { /* Move onto the next option */ increment_index(); } /* In case we got no argument for an option with required argument */ if(optarg == NULL && opt_ptr[2] != ':') { optopt = c; c = '?'; if(opterr) { fprintf(stderr,"%s: option requires an argument -- %c\n", argv[0], optopt); } } } /* Option does not take argument */ else { /* Next argv_index */ if(argv[argv_index][opt_offset] == '\0') { increment_index(); } } } /* Calculate optind */ if(c == -1) { optind = argc - nonopt; } else { optind = argv_index; } return c; } /* vim:ts=3 */ qpid-proton-0.22.0/tests/tools/apps/c/include/pncompat/internal/LICENSE0000664000000000000000000000276713257152177022541 0ustar Free Getopt Copyright (c)2002-2003 Mark K. Kim All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the original author of this software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. qpid-proton-0.22.0/tests/tools/apps/c/CMakeLists.txt0000664000000000000000000000376413257152177017212 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # include(CheckIncludeFiles) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) CHECK_INCLUDE_FILES("inttypes.h" INTTYPES_AVAILABLE) if (INTTYPES_AVAILABLE) list(APPEND PLATFORM_DEFINITIONS "USE_INTTYPES") else (INTTYPES_AVAILABLE) if (CMAKE_COMPILER_IS_GNUCC) # since inttypes.h provides portable printf format macros set (COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-format") endif (CMAKE_COMPILER_IS_GNUCC) endif (INTTYPES_AVAILABLE) add_executable(msgr-recv msgr-recv.c msgr-common.c) add_executable(msgr-send msgr-send.c msgr-common.c) add_executable(reactor-recv reactor-recv.c msgr-common.c) add_executable(reactor-send reactor-send.c msgr-common.c) target_link_libraries(msgr-recv qpid-proton) target_link_libraries(msgr-send qpid-proton) target_link_libraries(reactor-recv qpid-proton) target_link_libraries(reactor-send qpid-proton) set_target_properties ( msgr-recv msgr-send reactor-recv reactor-send PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS}" COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}" ) if (BUILD_WITH_CXX) set_source_files_properties (msgr-recv.c msgr-send.c msgr-common.c reactor-recv.c reactor-send.c PROPERTIES LANGUAGE CXX) endif (BUILD_WITH_CXX) qpid-proton-0.22.0/tests/tools/apps/README.txt0000664000000000000000000000103513257152177015713 0ustar This directory contains applications built using proton. These applications are used by the testbed for soak tests. See the "soak.py" file for the tests that utilize these applications. These applications can be used standalone to generate or consume message traffic. Contents: msgr-send - this Messenger-based application generates message traffic, and can be configured to consume responses. msgr-recv - this Messenger-based application consumes message traffic, and can be configured to forward or reply to received messages. qpid-proton-0.22.0/tests/python/0000775000000000000000000000000013257152177013434 5ustar qpid-proton-0.22.0/tests/python/tox-blacklist0000664000000000000000000000110413257152177016133 0ustar # Running *all* the python tests under tox is redundant as this is # already done by the python-test suite. # This file contains a list of the longer running tests that can be # skipped in order to speed up the tox test run proton_tests.soak.* proton_tests.engine.ServerTest.testIdleTimeout proton_tests.engine.ServerTest.testKeepalive proton_tests.messenger.IdleTimeoutTest.testIdleTimeout proton_tests.messenger.MessengerTest.testCreditBlockingRebalance proton_tests.messenger.NBMessengerTest.testCreditReplenish proton_tests.messenger.NBMessengerTest.testRecvBeforeSubscribe qpid-proton-0.22.0/tests/python/proton_tests/0000775000000000000000000000000013257152177016177 5ustar qpid-proton-0.22.0/tests/python/proton_tests/utils.py0000664000000000000000000001617613257152177017724 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os, time, sys from threading import Thread, Event from unittest import TestCase from proton_tests.common import Test, free_tcp_port from copy import copy from proton import Message, Url, generate_uuid, Array, UNDESCRIBED, Data, symbol, ConnectionException, ProtonException from proton.handlers import MessagingHandler from proton.reactor import Container from proton.utils import SyncRequestResponse, BlockingConnection from .common import Skipped, ensureCanTestExtendedSASL CONNECTION_PROPERTIES={u'connection': u'properties'} OFFERED_CAPABILITIES = Array(UNDESCRIBED, Data.SYMBOL, symbol("O_one"), symbol("O_two"), symbol("O_three")) DESIRED_CAPABILITIES = Array(UNDESCRIBED, Data.SYMBOL, symbol("D_one"), symbol("D_two"), symbol("D_three")) ANONYMOUS='ANONYMOUS' EXTERNAL='EXTERNAL' class EchoServer(MessagingHandler, Thread): """ Simple echo server that echos messages to their reply-to. Runs in a thread. Will only accept a single connection and shut down when that connection closes. """ def __init__(self, url, timeout): MessagingHandler.__init__(self) Thread.__init__(self) self.daemon = True self.timeout = timeout self.url = url self.senders = {} self.container = None self.event = Event() def on_start(self, event): self.acceptor = event.container.listen(self.url) self.container = event.container self.event.set() def on_link_opening(self, event): if event.link.is_sender: if event.link.remote_source and event.link.remote_source.dynamic: event.link.source.address = str(generate_uuid()) self.senders[event.link.source.address] = event.link def on_message(self, event): m = event.message sender = self.senders.get(m.reply_to) if sender: reply = Message(address=m.reply_to, body=m.body, correlation_id=m.correlation_id) sender.send(reply) def on_connection_closing(self, event): self.acceptor.close() def on_transport_error(self, event): self.acceptor.close() def run(self): Container(self).run() def wait(self): self.event.wait(self.timeout) class ConnPropertiesServer(EchoServer): def __init__(self, url, timeout): EchoServer.__init__(self, url, timeout) self.properties_received = False self.offered_capabilities_received = False self.desired_capabilities_received = False def on_connection_opening(self, event): conn = event.connection if conn.remote_properties == CONNECTION_PROPERTIES: self.properties_received = True if conn.remote_offered_capabilities == OFFERED_CAPABILITIES: self.offered_capabilities_received = True if conn.remote_desired_capabilities == DESIRED_CAPABILITIES: self.desired_capabilities_received = True class SyncRequestResponseTest(Test): """Test SyncRequestResponse""" def test_request_response(self): ensureCanTestExtendedSASL() def test(name, address="x"): for i in range(5): body="%s%s" % (name, i) response = client.call(Message(address=address, body=body)) self.assertEquals(response.address, client.reply_to) self.assertEquals(response.body, body) server = EchoServer(Url(host="127.0.0.1", port=free_tcp_port()), self.timeout) server.start() server.wait() connection = BlockingConnection(server.url, timeout=self.timeout) client = SyncRequestResponse(connection) try: test("foo") # Simple request/resposne finally: client.connection.close() server.join(timeout=self.timeout) def test_connection_properties(self): ensureCanTestExtendedSASL() server = ConnPropertiesServer(Url(host="127.0.0.1", port=free_tcp_port()), timeout=self.timeout) server.start() server.wait() connection = BlockingConnection(server.url, timeout=self.timeout, properties=CONNECTION_PROPERTIES, offered_capabilities=OFFERED_CAPABILITIES, desired_capabilities=DESIRED_CAPABILITIES) client = SyncRequestResponse(connection) client.connection.close() server.join(timeout=self.timeout) self.assertEquals(server.properties_received, True) self.assertEquals(server.offered_capabilities_received, True) self.assertEquals(server.desired_capabilities_received, True) def test_allowed_mechs_external(self): # All this test does it make sure that if we pass allowed_mechs to BlockingConnection, it is actually used. port = free_tcp_port() server = ConnPropertiesServer(Url(host="127.0.0.1", port=port), timeout=self.timeout) server.start() server.wait() try: # This will cause an exception because we are specifying allowed_mechs as EXTERNAL. The SASL handshake will fail because the server is not setup to handle EXTERNAL connection = BlockingConnection(server.url, timeout=self.timeout, properties=CONNECTION_PROPERTIES, offered_capabilities=OFFERED_CAPABILITIES, desired_capabilities=DESIRED_CAPABILITIES, allowed_mechs=EXTERNAL) self.fail("Expected ConnectionException") except ConnectionException as e: self.assertTrue('amqp:unauthorized-access' in str(e), "expected unauthorized-access") server.join(timeout=self.timeout) def test_allowed_mechs_anonymous(self): # All this test does it make sure that if we pass allowed_mechs to BlockingConnection, it is actually used. server = ConnPropertiesServer(Url(host="127.0.0.1", port=free_tcp_port()), timeout=self.timeout) server.start() server.wait() # An ANONYMOUS allowed_mechs will work, anonymous connections are allowed by ConnPropertiesServer connection = BlockingConnection(server.url, timeout=self.timeout, properties=CONNECTION_PROPERTIES, offered_capabilities=OFFERED_CAPABILITIES, desired_capabilities=DESIRED_CAPABILITIES, allowed_mechs=ANONYMOUS) client = SyncRequestResponse(connection) client.connection.close() server.join(timeout=self.timeout) self.assertEquals(server.properties_received, True) self.assertEquals(server.offered_capabilities_received, True) self.assertEquals(server.desired_capabilities_received, True) qpid-proton-0.22.0/tests/python/proton_tests/url.py0000664000000000000000000001402313257152177017353 0ustar from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from . import common from proton import Url class UrlTest(common.Test): def assertEqual(self, a, b): assert a == b, "%s != %s" % (a, b) def assertNotEqual(self, a, b): assert a != b, "%s == %s" % (a, b) def assertUrl(self, u, scheme, username, password, host, port, path): self.assertEqual((u.scheme, u.username, u.password, u.host, u.port, u.path), (scheme, username, password, host, port, path)) def testUrl(self): url = Url('amqp://me:secret@myhost:1234/foobar') self.assertEqual(str(url), "amqp://me:secret@myhost:1234/foobar") self.assertUrl(url, 'amqp', 'me', 'secret', 'myhost', 1234, 'foobar') self.assertEqual(str(url), "amqp://me:secret@myhost:1234/foobar") def testDefaults(self): # Check that we allow None for scheme, port url = Url(username='me', password='secret', host='myhost', path='foobar', defaults=False) self.assertEqual(str(url), "me:secret@myhost/foobar") self.assertUrl(url, None, 'me', 'secret', 'myhost', None, 'foobar') self.assertEqual(str(Url("amqp://me:secret@myhost/foobar")), "amqp://me:secret@myhost:amqp/foobar") # Empty string vs. None for path self.assertEqual(Url("myhost/").path, "") assert Url("myhost", defaults=False).path is None # Expanding abbreviated url strings. for s, u in [ ("", "amqp://0.0.0.0:amqp"), ("foo", "amqp://foo:amqp"), (":1234", "amqp://0.0.0.0:1234"), ("/path", "amqp://0.0.0.0:amqp/path") ]: self.assertEqual(str(Url(s)), u) def assertPort(self, port, portint, portstr): self.assertEqual((port, port), (portint, portstr)) self.assertEqual((int(port), str(port)), (portint, portstr)) def testPort(self): self.assertPort(Url.Port('amqp'), 5672, 'amqp') self.assertPort(Url.Port(5672), 5672, '5672') self.assertPort(Url.Port(5671), 5671, '5671') self.assertEqual(Url.Port(5671)+1, 5672) # Treat as int self.assertEqual(str(Url.Port(5672)), '5672') self.assertPort(Url.Port(Url.Port('amqp')), 5672, 'amqp') self.assertPort(Url.Port(Url.Port(5672)), 5672, '5672') try: Url.Port('xxx') assert False, "Expected ValueError" except ValueError: pass self.assertEqual(str(Url("host:amqp", defaults=False)), "host:amqp") self.assertEqual(Url("host:amqp", defaults=False).port, 5672) def testArgs(self): u = Url("amqp://u:p@host:amqp/path", scheme='foo', host='bar', port=1234, path='garden', defaults=False) self.assertUrl(u, 'foo', 'u', 'p', 'bar', 1234, 'garden') u = Url(defaults=False) self.assertUrl(u, None, None, None, None, None, None) def assertRaises(self, exception, function, *args, **kwargs): try: function(*args, **kwargs) assert False, "Expected exception %s" % exception.__name__ except exception: pass def testMissing(self): self.assertUrl(Url(defaults=False), None, None, None, None, None, None) self.assertUrl(Url('amqp://', defaults=False), 'amqp', None, None, None, None, None) self.assertUrl(Url('username@', defaults=False), None, 'username', None, None, None, None) self.assertUrl(Url(':pass@', defaults=False), None, '', 'pass', None, None, None) self.assertUrl(Url('host', defaults=False), None, None, None, 'host', None, None) self.assertUrl(Url(':1234', defaults=False), None, None, None, None, 1234, None) self.assertUrl(Url('/path', defaults=False), None, None, None, None, None, 'path') for s in ['amqp://', 'username@', ':pass@', ':1234', '/path']: self.assertEqual(s, str(Url(s, defaults=False))) for s, full in [ ('amqp://', 'amqp://0.0.0.0:amqp'), ('username@', 'amqp://username@0.0.0.0:amqp'), (':pass@', 'amqp://:pass@0.0.0.0:amqp'), (':1234', 'amqp://0.0.0.0:1234'), ('/path', 'amqp://0.0.0.0:amqp/path'), ('foo/path', 'amqp://foo:amqp/path'), (':1234/path', 'amqp://0.0.0.0:1234/path') ]: self.assertEqual(str(Url(s)), full) def testAmqps(self): # Scheme defaults self.assertEqual(str(Url("me:secret@myhost/foobar")), "amqp://me:secret@myhost:amqp/foobar") # Correct port for amqps vs. amqps self.assertEqual(str(Url("amqps://me:secret@myhost/foobar")), "amqps://me:secret@myhost:amqps/foobar") self.assertPort(Url.Port('amqps'), 5671, 'amqps') self.assertEqual(str(Url("host:amqps", defaults=False)), "host:amqps") self.assertEqual(Url("host:amqps", defaults=False).port, 5671) def testEqual(self): self.assertEqual(Url("foo/path"), 'amqp://foo:amqp/path') self.assertEqual('amqp://foo:amqp/path', Url("foo/path")) self.assertEqual(Url("foo/path"), Url("foo/path")) self.assertNotEqual(Url("foo/path"), 'xamqp://foo:amqp/path') self.assertNotEqual('xamqp://foo:amqp/path', Url("foo/path")) self.assertNotEqual(Url("foo/path"), Url("bar/path")) qpid-proton-0.22.0/tests/python/proton_tests/transport.py0000664000000000000000000002570713257152177020620 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os import sys from . import common from proton import * from proton._compat import str2bin class Test(common.Test): pass class ClientTransportTest(Test): def setUp(self): self.transport = Transport() self.peer = Transport() self.conn = Connection() self.peer.bind(self.conn) def tearDown(self): self.transport = None self.peer = None self.conn = None def drain(self): while True: p = self.transport.pending() if p < 0: return elif p > 0: data = self.transport.peek(p) self.peer.push(data) self.transport.pop(len(data)) else: assert False def assert_error(self, name): assert self.conn.remote_container is None, self.conn.remote_container self.drain() # verify that we received an open frame assert self.conn.remote_container is not None, self.conn.remote_container # verify that we received a close frame assert self.conn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_CLOSED, self.conn.state # verify that a framing error was reported assert self.conn.remote_condition.name == name, self.conn.remote_condition def testEOS(self): self.transport.push(str2bin("")) # should be a noop self.transport.close_tail() # should result in framing error self.assert_error(u'amqp:connection:framing-error') def testPartial(self): self.transport.push(str2bin("AMQ")) # partial header self.transport.close_tail() # should result in framing error self.assert_error(u'amqp:connection:framing-error') def testGarbage(self, garbage=str2bin("GARBAGE_")): self.transport.push(garbage) self.assert_error(u'amqp:connection:framing-error') assert self.transport.pending() < 0 self.transport.close_tail() assert self.transport.pending() < 0 def testSmallGarbage(self): self.testGarbage(str2bin("XXX")) def testBigGarbage(self): self.testGarbage(str2bin("GARBAGE_XXX")) def testHeader(self): self.transport.push(str2bin("AMQP\x00\x01\x00\x00")) self.transport.close_tail() self.assert_error(u'amqp:connection:framing-error') def testHeaderBadDOFF1(self): """Verify doff > size error""" self.testGarbage(str2bin("AMQP\x00\x01\x00\x00\x00\x00\x00\x08\x08\x00\x00\x00")) def testHeaderBadDOFF2(self): """Verify doff < 2 error""" self.testGarbage(str2bin("AMQP\x00\x01\x00\x00\x00\x00\x00\x08\x01\x00\x00\x00")) def testHeaderBadSize(self): """Verify size > max_frame_size error""" self.transport.max_frame_size = 512 self.testGarbage(str2bin("AMQP\x00\x01\x00\x00\x00\x00\x02\x01\x02\x00\x00\x00")) def testProtocolNotSupported(self): self.transport.push(str2bin("AMQP\x01\x01\x0a\x00")) p = self.transport.pending() assert p >= 8, p bytes = self.transport.peek(p) assert bytes[:8] == str2bin("AMQP\x00\x01\x00\x00") self.transport.pop(p) self.drain() assert self.transport.closed def testPeek(self): out = self.transport.peek(1024) assert out is not None def testBindAfterOpen(self): conn = Connection() ssn = conn.session() conn.open() ssn.open() conn.container = "test-container" conn.hostname = "test-hostname" trn = Transport() trn.bind(conn) out = trn.peek(1024) assert str2bin("test-container") in out, repr(out) assert str2bin("test-hostname") in out, repr(out) self.transport.push(out) c = Connection() assert c.remote_container == None assert c.remote_hostname == None assert c.session_head(0) == None self.transport.bind(c) assert c.remote_container == "test-container" assert c.remote_hostname == "test-hostname" assert c.session_head(0) != None def testCloseHead(self): n = self.transport.pending() assert n > 0, n try: self.transport.close_head() except TransportException: e = sys.exc_info()[1] assert "aborted" in str(e), str(e) n = self.transport.pending() assert n < 0, n def testCloseTail(self): n = self.transport.capacity() assert n > 0, n try: self.transport.close_tail() except TransportException: e = sys.exc_info()[1] assert "aborted" in str(e), str(e) n = self.transport.capacity() assert n < 0, n def testUnpairedPop(self): conn = Connection() self.transport.bind(conn) conn.hostname = "hostname" conn.open() dat1 = self.transport.peek(1024) ssn = conn.session() ssn.open() dat2 = self.transport.peek(1024) assert dat2[:len(dat1)] == dat1 snd = ssn.sender("sender") snd.open() self.transport.pop(len(dat1)) self.transport.pop(len(dat2) - len(dat1)) dat3 = self.transport.peek(1024) self.transport.pop(len(dat3)) assert self.transport.peek(1024) == str2bin("") self.peer.push(dat1) self.peer.push(dat2[len(dat1):]) self.peer.push(dat3) class ServerTransportTest(Test): def setUp(self): self.transport = Transport(Transport.SERVER) self.peer = Transport() self.conn = Connection() self.peer.bind(self.conn) def tearDOwn(self): self.transport = None self.peer = None self.conn = None def drain(self): while True: p = self.transport.pending() if p < 0: return elif p > 0: bytes = self.transport.peek(p) self.peer.push(bytes) self.transport.pop(len(bytes)) else: assert False def assert_error(self, name): assert self.conn.remote_container is None, self.conn.remote_container self.drain() # verify that we received an open frame assert self.conn.remote_container is not None, self.conn.remote_container # verify that we received a close frame assert self.conn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_CLOSED, self.conn.state # verify that a framing error was reported assert self.conn.remote_condition.name == name, self.conn.remote_condition # TODO: This may no longer be testing anything def testEOS(self): self.transport.push(str2bin("")) # should be a noop self.transport.close_tail() p = self.transport.pending() self.drain() assert self.transport.closed def testPartial(self): self.transport.push(str2bin("AMQ")) # partial header self.transport.close_tail() p = self.transport.pending() assert p >= 8, p bytes = self.transport.peek(p) assert bytes[:8] == str2bin("AMQP\x00\x01\x00\x00") self.transport.pop(p) self.drain() assert self.transport.closed def testGarbage(self, garbage="GARBAGE_"): self.transport.push(str2bin(garbage)) p = self.transport.pending() assert p >= 8, p bytes = self.transport.peek(p) assert bytes[:8] == str2bin("AMQP\x00\x01\x00\x00") self.transport.pop(p) self.drain() assert self.transport.closed def testSmallGarbage(self): self.testGarbage("XXX") def testBigGarbage(self): self.testGarbage("GARBAGE_XXX") def testHeader(self): self.transport.push(str2bin("AMQP\x00\x01\x00\x00")) self.transport.close_tail() self.assert_error(u'amqp:connection:framing-error') def testProtocolNotSupported(self): self.transport.push(str2bin("AMQP\x01\x01\x0a\x00")) p = self.transport.pending() assert p >= 8, p bytes = self.transport.peek(p) assert bytes[:8] == str2bin("AMQP\x00\x01\x00\x00") self.transport.pop(p) self.drain() assert self.transport.closed def testPeek(self): out = self.transport.peek(1024) assert out is not None def testBindAfterOpen(self): conn = Connection() ssn = conn.session() conn.open() ssn.open() conn.container = "test-container" conn.hostname = "test-hostname" trn = Transport() trn.bind(conn) out = trn.peek(1024) assert str2bin("test-container") in out, repr(out) assert str2bin("test-hostname") in out, repr(out) self.transport.push(out) c = Connection() assert c.remote_container == None assert c.remote_hostname == None assert c.session_head(0) == None self.transport.bind(c) assert c.remote_container == "test-container" assert c.remote_hostname == "test-hostname" assert c.session_head(0) != None def testCloseHead(self): n = self.transport.pending() assert n >= 0, n try: self.transport.close_head() except TransportException: e = sys.exc_info()[1] assert "aborted" in str(e), str(e) n = self.transport.pending() assert n < 0, n def testCloseTail(self): n = self.transport.capacity() assert n > 0, n try: self.transport.close_tail() except TransportException: e = sys.exc_info()[1] assert "aborted" in str(e), str(e) n = self.transport.capacity() assert n < 0, n def testUnpairedPop(self): conn = Connection() self.transport.bind(conn) conn.hostname = "hostname" conn.open() dat1 = self.transport.peek(1024) ssn = conn.session() ssn.open() dat2 = self.transport.peek(1024) assert dat2[:len(dat1)] == dat1 snd = ssn.sender("sender") snd.open() self.transport.pop(len(dat1)) self.transport.pop(len(dat2) - len(dat1)) dat3 = self.transport.peek(1024) self.transport.pop(len(dat3)) assert self.transport.peek(1024) == str2bin("") self.peer.push(dat1) self.peer.push(dat2[len(dat1):]) self.peer.push(dat3) def testEOSAfterSASL(self): self.transport.sasl().allowed_mechs('ANONYMOUS') self.peer.sasl().allowed_mechs('ANONYMOUS') # this should send over the sasl header plus a sasl-init set up # for anonymous p = self.peer.pending() self.transport.push(self.peer.peek(p)) self.peer.pop(p) # now we send EOS self.transport.close_tail() # the server may send an error back p = self.transport.pending() while p>0: self.peer.push(self.transport.peek(p)) self.transport.pop(p) p = self.transport.pending() # server closed assert self.transport.pending() < 0 class LogTest(Test): def testTracer(self): t = Transport() assert t.tracer is None messages = [] def tracer(transport, message): messages.append((transport, message)) t.tracer = tracer assert t.tracer is tracer t.log("one") t.log("two") t.log("three") assert messages == [(t, "one"), (t, "two"), (t, "three")], messages qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/0000775000000000000000000000000013257152177017445 5ustar qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server.pkcs120000664000000000000000000000304413257152177022001 0ustar 0‚ 0‚Ú *†H†÷  ‚Ë‚Ç0‚Ã0‚ *†H†÷  ‚ù‚õ0‚ñ0‚í *†H†÷   ‚‚0‚~0( *†H†÷  015ã †=+E“Ô¦øÏã(¢úƒ ‚P1)¿à³H#õ"¶­kr7_+ùgâö°Œ<·tÝ=71ÀÑ´xËΔ°ÅD„¯wPJëÐ/´»Â'ÕŽÉH7¦CìYð”ɬU¢¥«û©%eJÛ-‰iNý4uÞˆ;gϾLRäɇîÏpR1”Jr´ BE{c`Zî0wSI€D‘‚ 3±^7[KÌ¢Kpº¹1ئ»JU ì,é’¤ì#¼^köÜ€× Ä\æ"Úsþ. Àï&^§R¬O0eÊÞ]³ñÒp?“™øÈ.pÄ»Å`‰ìŸâ»CÝÌ&3-—î‚I`oNÄHÛòJ½ZVz¶E…7!ÚCi¶.%Yžë.n­fArs ¯tÜ¿§\TœfrÔˆÓ½º1X03 *†H†÷  1&$server-certificate0! *†H†÷  1Time 15017108166560‚³ *†H†÷  ‚¤0‚ 0‚™ *†H†÷ 0( *†H†÷  0ß`=2†à£j-‰ CÕ‚ª]€‚`'ý·p _»Y{="8×ÿ^K~†ì†z7¡ÈÌ4ƒ”%m½†¤•ȇq(ö¢7ùOý6åGAs­É×Jæž–§À0§ñ]ù¤ÀØ 9íîäÎRêzž– p Â×èHSÛXŸ¡ <û99©_Nóžòå6á6CÔ«þv_ïP6Q9¹’eçUô"gÇ ÙûmˆöÅ“l}_‚HÊVÿ’.±‘Gn‡µ>NÃÆxŸþ'½SCEÖ2²´C—;ã:Ô˜ Ür ¹/x•4‘ú¡¤¯~ÞdrËÃ,8²Žö MVEKµÂŽ „¸ÕÇ]^Ò¢hã¬â%´Ð¨¾; ežcÍT²)e”9ÕéÄ(p¥¤'D´Ø,esý^Œ!âÜ3ý'XˆÉõsi•óúP@¿¯6ë^amãJ]ð¥45ÿbÎŒDøI”’S,Óß ÿbËÖÜI 4(b(p¶Ånò’@\ñÅðZïwEÒE¦í-|;Ð*T7 ø´‹ôËð>¯s¦;›‡|‚Ôæ+qÒ 5´8ÍÔÁ yC¿BsH×Ìb^AÞïMaÅþ!ûÁIïÓÖ ÇÈ5¸µ|¿•§%É0ìUîZ gd:Ö…ÄQ‘Ý»ùf¦õ¾m"Tè‘Î)¡¬™^'ÌRÙNmWÜzàõáÖÎ3è½¶ò–+|ú͆Л°Z¡8¯=cšõøÎpa‚Gëiƒ/u8Œ oTYãPå•”0o.àÎÖ1­—A|ÝO;oy&]ÄËT1õë¹\1"/lv¿ö-cEñ?J;Õ(Ñs‘á7Ó}ÌÔ‚°òê˜+Ÿ Š)²ö ΰhWmH™{óÑÖi! ‹åvõÁ‰úŒ§ÖuµÕ v§®³Cö(õ½”D‹3 ØÈû²­5?Š k½^E r~} Ù_€ïnÞ¶9«Þx ´ϵ_>¹b°YÀ¾ÀÊ/•iï=+ä¿;êøbãÈÞÖ$/î©Ù¦nù)`‰gNjßîwvCz¸‡l͕ʱ®#êôc}!Rn¥[ž‹ÙWÜ£ûŠ´ôªþKF!£y‘*ÏhK0©üêÐt0"Óî6q7sŽ!S|8»+;íóq2zs@‰jE¼­»ñ#ÏK«ŒÄMŸXÈ3Ì ÕtFý’5Ÿ†;˜D¥‡Wî=Àœv«kMZ•U¶°vŸHv-5Er­jX®h{9)ˆå™,­øJäM ÓRûÍC¯VKg!'×äó'÷7iÓÿV›æ cyÐòßž®Â63¦Š„å³Þ/ËXöG‹ìs®¥2s`æ‡ETÁG1Uªàd%Û½é¶B&jÔÂ*1^09 *†H†÷  1,*server-wc-certificate0! *†H†÷  1Time 15017108184930‚ã *†H†÷  ‚Ô0‚Ð0‚É *†H†÷ 0( *†H†÷  03s’à”þ0y¸9VEx2o¾ê|€‚­`…ݦ¦{ úç—®-{=o,Z¿¸C$Yö½cø¤bÏÝx™‚ÖÍüœätóÚÚé ¿qE-Ðezà”J«wöxçŠôg¯ãS ú ÐlèUf }ž¸8u“”•8WañðÒZv£"ÐQ \ßû·s™«áëôÆÇÊ[ÙG9`ŸgÐ+ï‚ EgÖ¶­šYòxÑ´t)†Œ³; »_‰Bòb"/6(nž§/£o·Ñ§ü§ÇBý¡?LG‘‹™\£¬ ‡Ô×>”Âvm%^jæcªGpÚ/>vÑøž'ÿÙ4›ÿ»úÆ é9Ëë~gxé *ìˤ ޱ- ¥ ¨<¦°ß¾ÎD€œmì=7»½Jj’Z¼¢sp*c2Edc$¤6¡+Ï7qLLµv qŽqf>Æ1„Щ=ÝTÁU• B‚2F´ %k:‚M퀎â\ŒH~ê3#ÙúS¾›xºøC}ûP#>i§\u)´d¡˜®çÑ Âüôv[;QØŠlkj,!RL½]g^bÇôÏ·ktòrÅêì•—é²Ìµg{åDÁ[û)Q–\Í×&øM«¹ºÏ ²öêF*ç ëFïq®5IfRd˜Ù¡ˆ™áSt¼ì?n&éugPyZŠ`vÇ? %×M² •k_Ÿ¹iž·»âÆè…T j‚‘«^éûêŠrR™¹xw¹Já¬Yì“ ǘÑ;ž Qgú¾•#Ý«^‹«®-TŽ–þSå]B_mÉÙ £•ÓÓî­q¸¸êNÌOâÖìõPÀ`ϤeÃÍŒµÏI3‚± 3¦!ùœº’`1ñ'Ò¼î©Jxqo#°´BÀý²âéðî/ Bå fè„>© a/‹S|[-8zšg^yÎùÆŒ~gBúšªÅ"¨µz…"Ísñ5ZnE>Q9Ýï?±à/{2fŸP9nj]9f­+âÅ:7¼PËIçÃpL°hÁ¨ðŠÏ\£¾õݯFƒÈ¸ñކipƒ4aPÚ¡¿·™‚ó,›çI]9 äQõóÀ\jíÇ’»øþ@¯_J®Œ,‡”ÜUdÒœ ^Md‹ ÿs»1³‡™öÞª(ì«2Ñĸg’ ñ/±²\Œü>^¤5‚è©-¬ËûÔÉT8\ö -----BEGIN ENCRYPTED PRIVATE KEY----- MIIBljBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIFt9KwMYb/OQCAggA MBQGCCqGSIb3DQMHBAjQ+Hr462sAigSCAVAmqByfn+Ujb9TfpEI0d6mlW7Nyko00 chzSFz61RVA/twfbLImhYvEo7P+UglcqGc1H3DaysDuMjbiNqgP25lDHO6ndhN7r XaeNshI8U3RQfUrhTwcA2pGpHQ6t+TGNKifRuJMbcHxWDNr+Tdod8uUADZt8Ywb+ WQOqIrByNJryx5i2yZT7FphYrz6N0L5cNKVIirNv9/FOlKiyuzzg5c4NmABkpajE ZyT2H1p/qFipz8XeQ7BvFVDWSGn6Jb8vRvcc/swoCNSs8Wukr7tbryie2IbgktES gw7mVOw/Wdw6u26Q8Dz1c+eyy1WPuCiubFKUK12Ul0X9KKYCufVvQPoQBsMGikRM JcvrMd1cZ60pANJhnrogE6VEYE3NQrPC6SNao0NB+g4CW3tOH6m80H5+yHrMdvjo MQNXdlwdNWrCEH6hXJxzuE1qM5Ajc82bfwo= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-wc-certificate.pem0000664000000000000000000000217313257152177024350 0ustar -----BEGIN CERTIFICATE----- MIIDFTCCAtOgAwIBAgIEVTK/cTALBgcqhkjOOAQDBQAwMTEXMBUGA1UEAxMOVHJ1 c3RlZC5DQS5jb20xFjAUBgNVBAoTDVRydXN0IE1lIEluYy4wIBcNMTcwODAyMjE1 MzM4WhgPMjI5MTA1MTcyMTUzMzhaMDAxHTAbBgNVBAMMFCoucHJlZml4Ki5kb21h aW4uY29tMQ8wDQYDVQQKEwZTZXJ2ZXIwggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA /X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow 9subVWzXgTuAHTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7 g/bTxR7DAjVUE1oWkTL2dfOuK2HXKu/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi 64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZV466 1FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L +iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC gYATsU4dSb5vvYkuhnLJPYpiHOEOagLSwwggm8CD4JqA8CC/lzIJBI3LkR7Ve1Mw xYiDbQQPaxGsdCxaDuE+rOHmJcCNxum4gIYxeOOGHLa9eezTXLu2s0kBgsWx3I0U 98lI4E+gRHiU27NXlNiEKvVq3GhzWvKdUqClbtLZ+67gzqN3MHUwHwYDVR0jBBgw FoAUsjZ7PCKVgcZLkxE8xaWJ8cf5jmowMwYDVR0RBCwwKoIWYWx0ZXJuYXRlLm5h bWUub25lLmNvbYIQYW5vdGhlci5uYW1lLmNvbTAdBgNVHQ4EFgQUas7dEjv/R3ig GcCdPRLL5P3HPU8wCwYHKoZIzjgEAwUAAy8AMCwCFFuvuEosI+5a+lSmpEahvhyE 31WUAhR6+NkSdChlT0v6HmjyhBL1hLZYNA== -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-wc-certificate.p120000664000000000000000000000313013257152177024163 0ustar 0‚T0‚ *†H†÷  ‚ ‚0‚0‚÷ *†H†÷  ‚è0‚ä0‚Ý *†H†÷ 0 *†H†÷  0îZ $Lxo×€‚°—¦¨H­ã·5FÙ’ÜÐ/g5(YÉöG>Ñ,5%]ëìk'Ü?R<ø«“À•X•O i©sI &宨Dõ®Á„I9 MOin,Lwp;wK]ÕÍö?ž̳²÷ê{¿5ó¤SÿÌÈÛ«ÌFà·êDV/¬Ÿ¥T)‘\|Nt2’Êß¶É—–£™=êÏTì”›˜¯#gr©hµd¨Ë^² äY\ðM2vüR³j»¡/k…VËÜÛL¸RG8ZR8 Ý"ˆÇG/’ó^Í2w)¤÷€UCcçy*Wº©¾ìêÜ ò€M ÆÂa®u„*±žH¡I´l$ûLµo ç¥ä朎Kç!v¡º„P ÊÛK]­dæãgtêð› 8"®Žå¶Ÿp# ƒïö"™RŸqj9Çõ_­ômÏð|©ÿªGç4ÄHwˆmAG§ås Ñg¿g¸Ì}Ü!cÚäïKÝ‚|aAÄ—ShRJ×ÄLQn2:"Ëéóšéÿ;5Ip ®,i…÷uøeûä8ñvëÎ~áWN•.ú€x+²óStaõø|4×*"r ÆmUÊëPóþ©·+°€q;gôÇ Ôöà0v®ƒ G‹å³»Ú]îÆÜǨ?œf8­Ýw— v–H†’Z";iqZ!è—¼n¸N™ƒÿzR@bÆ´§Fûæ`´Ì÷þE¦ q/G“ö€ÍòößåœGÃ&óÅ€Òüž¸¸°¾@{Mº*¼Mõî²Æª OŸ…°õ\*˜g’-Xð éÿ‘xÛu´ýgÕ%6Ê$´…o !?['É“Òö]9¯A†Œ4wùãçÀà©­¤,©"›Š7ÝSÛwy:*LfúüKúK*~á£`Ηݠ?w…µÃÝ€odt¡[L)Œ\@£[°»‡üºë8|,L”À/†prüζ í áö­æ¢ë‡£Q‘;4S2bø¢§54ûyÒ4E3¶å饨ãG1Å?­êñô†Ø‹ç*åÂÚ@œ#“PÚ!4_µŽ?a öp‡]Yx cNz&ÈþA²ù¨îýý~Ç+˜¥Ë‡¯þ×ëæS“ JG|O e'd¨rtbË¡’ÄÎ6ÊÂÁ&W’cÍ(y%M4O)ÔœA@Óô(.šF[Íp¾Ll$ ?mx`ÃX×+˃½büEe¦8?øICcÏ¿ÖÉÝO G?0‚ *†H†÷  ‚õ‚ñ0‚í0‚é *†H†÷   ‚v0‚r0 *†H†÷  0Þ+\cYåÓ‚PBŠè¿B¸ïbñ0j¿Ê„^éðŸXqå\+QÃpÉU×ÃöÜLn!Ë̸Ò%Ճ㿈%jÐ-(+®Þy&Dž¯JcOt¡ÿÓÕiä]®öxónøSFGyÏše­SäG_‚d×½†µ¸ «D+¥úß—ç2àjÐmÏá­ÿ̽œÒÙäÑ–¶Èš"<5»¥ÜdÙp䕯¨wþ¼bÿrâ¦çUŽ•Nb%§TBÑÕéêZ>ÅéTöœ8wÁ&-9 5£hïÑvŸ©¶¶ð}"»ª¶ÆŽK>¬d—ˆÈ@^ÿ÷>YqÌÞ앾{Cvç§&u0'YÌSøp‹1­G®=¡k ÊLY²&e0/Â\&²åc"×T. ÇxŸŸ¶Xn!e;)ÂJ_>M3t"è<µ{[uYôoÜŒeLŠÇ]ò(r1`0# *†H†÷  1…£Ô, Ô—êk?0äÄŠ2íþ¨S09 *†H†÷  1,*server-wc-certificate010!0 +2Ùæ/°ÐÌ(¤ÜÊûïra “<Ü7ÏÒ«ù)qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-request.pem0000664000000000000000000000164713257152177023154 0ustar -----BEGIN NEW CERTIFICATE REQUEST----- MIICazCCAigCAQAwNTEiMCAGA1UEAxMZQTEuR29vZC5TZXJ2ZXIuZG9tYWluLmNv bTEPMA0GA1UEChMGU2VydmVyMIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4Ed dRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs 14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208Ue wwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BY HPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+Zx BxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx +2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAIRG nLpGuQ0emBdP+4v2A38iDBjuSncjDOvWWuqj4eqbJ0T4LP26o8dXLGNfucdWt3CX vGCyiSLdDKgpytl9MvWhLv2Sh1Ybu3oLI62PYvcoYxR0iWpZ6lnDMIpNatvTtWOm qEyHRCHz4ioSa98L/hRU55z1qVfQ079yQNsgGEhOoDAwLgYJKoZIhvcNAQkOMSEw HzAdBgNVHQ4EFgQUGEQN1wFGqfnAURsBp3nn3KtA8TswCwYHKoZIzjgEAwUAAzAA MC0CFFIXSYKFVq90wR3lH+KCwvL+j0A4AhUAlxeczUtqTQFeGXFsDwIGO+5/uA4= -----END NEW CERTIFICATE REQUEST----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-private-key.pem0000664000000000000000000000142213257152177023713 0ustar Bag Attributes friendlyName: server-certificate localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 36 36 35 36 Key Attributes: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIBljBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI6jwDH/9bZYMCAggA MBQGCCqGSIb3DQMHBAgbIQ8UrRfmAgSCAVDejPh9sT2PMvDjjzXG6xpSmBPNZRiz f2k2a9EaI8L4xadveiZTzOpk2C/nltMCNY2Vwf/LMtbvcLiadBRWM/4Uf5fvL/94 zlKE77wPSWK1R+btZm0KIaA+EPAvnIGcjHlcSU58eQexwVlMXJ9pdeHm9KWbV1D+ PjrlJ+SDq7OSGprTCz9r+gQ7Fy2Oe9OKc92tE29QD2AZXtSodvY9CosXCx4cqXr3 ey+HXmVXJohsL89NycL80TvkxppqZ1hT3DZMkrFg2jFPz505rzE48y62FMoKNCjQ 6HXvsniWYXf7ipr+A4/diSSMBr/zmA+H+ZHKlNO8FJqZ8eI1eqRO+PjO1VV9bbG0 lYoeoFu0Y1xw6V2jLYnFF1mTCC6kegl6kruvnwO7Oy+6kPEvDrejuI6uozW2etej cBq1lUK5QNKSoaB7Qw+2qlyFg/KFwXXDBqk= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-certificate.pem0000664000000000000000000000207113257152177023736 0ustar -----BEGIN CERTIFICATE----- MIIC5jCCAqSgAwIBAgIEX8z6MDALBgcqhkjOOAQDBQAwMTEXMBUGA1UEAxMOVHJ1 c3RlZC5DQS5jb20xFjAUBgNVBAoTDVRydXN0IE1lIEluYy4wIBcNMTcwODAyMjE1 MzM3WhgPMjI5MTA1MTcyMTUzMzdaMDUxIjAgBgNVBAMTGUExLkdvb2QuU2VydmVy LmRvbWFpbi5jb20xDzANBgNVBAoTBlNlcnZlcjCCAbgwggEsBgcqhkjOOAQBMIIB HwKBgQD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR+1k9jVj6 v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb+DtX58ao phUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdgUI8VIwvM spK5gqLrhAvwWBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9B4Jn UVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4rs6Z1 kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+z0kq A4GFAAKBgQCERpy6RrkNHpgXT/uL9gN/IgwY7kp3Iwzr1lrqo+HqmydE+Cz9uqPH VyxjX7nHVrdwl7xgsoki3QyoKcrZfTL1oS79kodWG7t6CyOtj2L3KGMUdIlqWepZ wzCKTWrb07VjpqhMh0Qh8+IqEmvfC/4UVOec9alX0NO/ckDbIBhITqNCMEAwHwYD VR0jBBgwFoAUsjZ7PCKVgcZLkxE8xaWJ8cf5jmowHQYDVR0OBBYEFBhEDdcBRqn5 wFEbAad559yrQPE7MAsGByqGSM44BAMFAAMvADAsAhRuMRxWMKxy3USjfSFn47H4 Z5VIHgIUB2i6+RQi7dHOEQYKKmxdQvAPA9M= -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/server-certificate.p120000664000000000000000000000303213257152177023555 0ustar 0‚0‚Ü *†H†÷  ‚Í‚É0‚Å0‚¿ *†H†÷  ‚°0‚¬0‚¥ *†H†÷ 0 *†H†÷  0§¥aW0“x¢€‚x¼ë(²|nðòDtÖY ·(Ù,Xh&o¹ŽŸÙ›˜ m\oy PË3Ðz Hh2x`g)QUº'êî÷š†æ%é…'ŸÊüîxl“0™NÎr^d®¨”šOs-ëdɶl Ñé'ªµP÷eeÛÖ…æ~U‘á\Þ_©±Ã°^÷”»ÁÀÞ`@SßÑÆ(îTPmß aq`7*­’Žp7æ\ I°E˜Ì]è!éÕM¢—ïQàDöy¹Wïèa-­u£?Zž¤R(iö åNëXŸ…ã’; ‚·‚Þpµ0`LX´ ±.‡9† ê=w$ïWü¯£ÖdÞG‚é{A`xÞU¤zG¤Ñçæͩ°Ïöb¤¹ž”elu³å>,V›æŒxl¶±Òî™ƤZö£ë%\gë8Éú©–èfðš×­:øÍoøIEŒ[¯Õã“’D76Ü+¬¼žë†vñ<ÖÞ¸·¨DEœ5·œõ$úÊçw'Ëfȇ°"©‘|Ì|öÞaI2v¢AîñCWz¶{™´,žýÑQÐÂ|gí ^qáo¶îÓ`ãqø¨—¹âˆìºõG‰Œ”xˆ ’ˆmC:wL¸Ãmš|1~ÞUþ¢lÌcä´íÔnGŸHÞ¢›²Ýðá܇E÷'¢nU]OÖÈQ ?nª/•:^(`·!@D¶»P_½P¬pW0ô­q5Éo';[öÜ$ñÒÁ™ðZ£¥…v ãPɾSQã}®é¾§ .^‡©õ€ÒÃÌäÁMúœëSkÅb,>ýEÈúý…PÍè“ù2ΚAÀ3ÊEa¶ÞÂÄôv ¤È ´ÃÂÀëÉwô Ê›äÅäpXÂb¦DÒ´K"d:•Qú}‘“"¥8ÃöMæ®÷ØE¦{éqV…A^¬žW­÷"Ïoìÿ_Ì5¬•Ô×®ÕwQå ·½…¯™Ýoë 1è!¡­:ÈbãtúÐj¿æ9UË9vnû`ÛcªL$ÈŽÓ¦€Qv‡h–b‚kå>΂™6ipŤvH2È—¸%Þ7j5 Ðr”¯Ž…Ój¥ïŸ­¼üâr³KB;¸Ž¾ôíd.—Ž84Wo­<30žG ¹ëÄ£éñÂ9ý|40‚þ *†H†÷  ‚ï‚ë0‚ç0‚ã *†H†÷   ‚v0‚r0 *†H†÷  0æ‹Æ îX—­‚Pƒ7ò{]›çsy‡ŽÔµô!Tw®y® ƒ¥ãT;TAÑÔw:rF¶¡„ØàNaê+o=äxÈŽ°ÉÒ1‚œüCí;†$í]ã]È-ðÅÀå..ÛxÔòmªF‘s§,¢â¿ñNÿ‹Ь§`oÇFëØe¸¦>Ð0M é`Ü,JRƒOå’›ò…/†ݲHgÿ °!™oíß3¼:Ï2å5P)H¬÷7dik²3kÂ;°1 •1“d+é"â\kæÍZæï²—–Ìä‰riçd‹’9á{ŸZyft©á‹¯…ÜýÒ'R=W3†É­{käSCú¡.úWf£ ÷ª¢±ZAKØêˆrí¹Õ¤ Âw(…ô¡€šiI›2ñN3Bül ±âÆ…\Þ*àA±³Ò€Làzå!"ù§ÙJD(:ħ3=D§Á™1Z0# *†H†÷  1 «Y"Èez·„·“yPm=xÎ03 *†H†÷  1&$server-certificate010!0 +U”î–Ħ£,¨À«‚enÿaÈzJj™mF¦«qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client1.pkcs120000664000000000000000000000315613257152177022036 0ustar 0‚j0‚$ *†H†÷  ‚‚0‚ 0‚  *†H†÷  ‚û‚÷0‚ó0‚ï *†H†÷   ‚‚0‚~0( *†H†÷  0i…²êèvá±-ϲkz¼v‚Pdz[ƒqˆûëÍÀ¢áVÞÀô–4Ïða,d_ûe« 샩ԥÈ.Î@ž.ÈSÒýǪ¼¥,í®!:fËQ}ÎjÉëîÚXÕ…©F®JtÏèËkxw]ü)s{¹æWŸ ߇b’L>QãÖ²;‚ NîæÑLÇWÓœ™ hÍa€MU²Q&oÛ wVcKrÌóI(Þè[Oµè#ß¿ô»¢%ì¿Æù¹¬8`ÝêÁÞ0$T_éD‰°³K…åÖâ|´*·n-â ìÚ$f]΀©ÑžŽwRÌ}f7¾õƒ´CÈð4õH²yUêq3á–þòcD,AE»0ÓguQß°³¶=Aqãq¶ ûØAxa3˜ 6oa%tn=îýU¦·Hhn¹¤\©U\˜tœ[(Âűkåþ$b\1Z05 *†H†÷  1(&client-certificate10! *†H†÷  1Time 15017108177720‚û *†H†÷  ‚ì0‚è0‚á *†H†÷ 0( *†H†÷  0ˆR†’4ïîO<„´Ma耂¨µ®Ý8Û`‹l öÞ0$MÝ{0ÝëY[ðt(tÈø?d·tüàŠ#Ãb¦ æÐ?|„'v«[Å ­X·.3`”¹?ö·ëf©c „ ¤¨*/¸Ìê9Ÿ¦ °$ta 2nÐÀ å[7@Ð:qn°m¾y0Ô†§\rBòh'ò8ÅY<¿à«„\¹Þ&¿ÍV.ªÓ[3¸ÈaÞ,ÖŸ™qŸdÛ§°Ž[&úïPg£ö¨ö'žãveUÔ£¾DaÁTâ1;+­vÀ‘Y«’*p{›áõ‰Ê\šÛV®ö01÷l•þ7ºíEAV7j‚wÊ´LE0fi8çªÌœ€ÆîŠÃÿR©ÃÞC,TÏt@ØÝ7ÂÓà¶#˜ÂSPkß¿¾:Ø)¡ŒRëö†f­qî,3ß/j¾ä74oÙþQžñÿÛ{ùÜéj[ª¶èË –$‹éŽÛqÌœ—²‰×ÛlI-€˜>MeþB³7ô™%‚@Ý­tc\ oƒƒ¬œOc¬p6Ù%º˜ÔïïU¿Ã%Ä™"ðGž‚•©9j4ñ‰ÑÖ›¦ xnÂMG÷ÖƒR·$á •%9‘¾1ß’šñ’íô=y©jôCQ²ip“ÔˆÊRÞªCp|–gf¦v»~ðvW›;AÚÊíÈ'Ú„Žcí ¹Ä6÷âŽ|WÄfðöba]w·­Få7“Û”7˜·´Ð‚«L2ÊÔ( –A%øÿä‡}|¤ }K$WI®D(UUÃÐv‰Ûi‡g«è(u^-¿a˜¹^èгÆ[ÔãøÒ¸YÍÙÑ·‚d‚üŒþø°“$´ØÆ¬kÇ&~Ì?=Q0}B¶Z<± zú}‘/qmqWΤR@Ýá»XÝþ™úÙR-àÄ-㿤7Óz‚ˆ¶Ú˜‹ðQuY(,¬ D¬8÷×KMôIÇ)³>`Óª“n°¶”=t3€ÀHö•K2wAt¹†¬GrÝ f0à zì¢ /B3|sH'ì—*q¶(ÕÑè/€VDô€ëHâ­ÚX|$`sj{A._@ÖoŸmšv±±ÉNu QÀÛze†Ë5×<%ZnìàVÞe(L¯@Û$’ªwÒ\€—6dR×Þí¢í‹2 Ï·+`ÝÞ75ì¯ÂËÌÔ<²ç˜ÐÓRŸ«W —=eªóÈt}(¯åÛñߎ*Ç$°Û9jgàùi—Ëû_0=0!0 +°¸îy¨(\Æ”vὈHI©,6ëh‹†ò¿Ú¾ùætR§ä`ãqqpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client.pkcs120000664000000000000000000000277413257152177021762 0ustar 0‚ø0‚² *†H†÷  ‚£‚Ÿ0‚›0‚ *†H†÷  ‚ù‚õ0‚ñ0‚í *†H†÷   ‚‚0‚~0( *†H†÷  08¸x<Lê:¦ (î·‘p³M‚Pú-nhÖ;üJçNÝÔœlú“_•ñ¦É·&¥¤åÃØm}µE“úûP÷ä°¤Q`Ñ͵ô: ˆmÿ¡€^‚G`—!O|j´ۨuàfðÿßJB2¶Ý—i’¯ÌBë)X =¢6šÕ]8cìß¡YÅcyB”`:2 ±7—84Õÿ*räþ§‹ŒˆÅ ~MÛ2:NäÊ—$} [b Šï“}òʨ}ËÏÈŠ1âZØ´æIs"W‹äÁ—éäRssºð1u¿ j'-D;³9[á«-YÊ §‘Ÿ¿&­}C̽H Ó¸ÚÎ@D±ëC«Í ,˜uîZÙÍ|Õ:1‘*GŸ÷á‰[Ýëbf’ò-£#e9¥K¾Ôíz‹Œ¿0Ðäúcjèk)é’gûóÚ±ÄUOøv.©üééÃð1X03 *†H†÷  1&$client-certificate0! *†H†÷  1Time 15017108172390‚‹ *†H†÷  ‚|0‚x0‚q *†H†÷ 0( *†H†÷  0njÃËpÄHvà[jfÇéà'#š€‚8Qa8®Bpàlñ&{ãi[ÿú‹T¨M‹|õÚ,Ç^\© À›¥C\jh²_cÔeDðˆ]|…#T 0E¢|”€¥”~Ù¨þo8 › gÖ‡_LHÁ“èàM›G ~@^ÂfFkL½ÄöQbñîP—'L¯¡gL­Xð2;n1˜/¸GØí“²{f¶?c€5©Ì%Ó˜‡Ó„ïSø¼a¾=ë^@ûŠnòÂËͱKÃ#&+ cªn†Xÿ𬀡KH¬–%‡æjäŽ8Œ¿fÍêÎt\ jòRÃ>Wöp¨í@J*ŠW×e¢œ!Á€l~ îTBøõ@c5êë ÏN,¶äŽ5uuvñÆÄ>j®Ù`Šý¶4AN §…afµéŽ’ïâ u@¡ l×Fÿ˜´K0![ÁŽÎh—§†§|<$Jklÿ¨Ã–¾‘«€«#bC½ú³ôèÆš~[ò¸©­z³ÚŠyÀ™#E#϶\аïFæ[E'TQ›Yw='CrŸÈVª¿y™ ÐPëgrê£÷`f•c-^íOˆiäH&!©v°¥eÔÕq(—õ¬ ŽwH¦JØæ92QÉ5Ã)Ý_àÛºº©:Š0ÄÖ«BSÊ@83”ÜÂÂØRñLBXÌò "c« RoëGjéœÎynž6Up‰n±šA9%M1ÜÏe¡RD ã9:þ€Bu×1·˜n®N̼ùŸÍÖãRá¸AÍ€u6.‘«ÖÞ]€ÁÅ ol…u T[ÃSã•A‰¹Øï”¨æˆ?À˜/Ñ¥oaÅ•Ý:G ŸZ·×¥«¬EnbIœ²I NúöÒs ^˾Š=5æ¥ ¥ytxÈ{ä¬séOuæ,déïxÜ(¨?8È̈g‚…Ñ'H«F.ËêŒÿžùô©´5DM%%'«S„¨1Âl»} %Óú4Î4›Ý ®Ô5óÙ;yH`p ‡ò”eÒO(¹s˜P÷±Züc¡"ÞZØ÷@ÔzÑÈL‰üÝ‚sMÛÒ8:wýv©Wïj<§‡"J~IhÈwÙÄ)U­1(Ð@,© ÷0=0!0 +8© Cæf,Ôdþënœ7øÕ>Ò{¶pP•ˆ8à¸Á¥}Žhœqpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-request1.pem0000664000000000000000000000173513257152177023203 0ustar -----BEGIN NEW CERTIFICATE REQUEST----- MIICkTCCAk4CAQAwXDEMMAoGA1UECxMDRGV2MQ0wCwYDVQQHEwRDaXR5MQswCQYD VQQIEwJTVDELMAkGA1UEBhMCVVMxEjAQBgNVBAMTCTEyNy4wLjAuMTEPMA0GA1UE ChMGQ2xpZW50MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s 5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/Jm YLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy 9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+Gg hdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj 6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTx vqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAdW66tWrUUXCz8k34 jfJ8DZFWYXCVgkgPzLI72WQcE8EMTR2p8UEXoXefCwKJkXSf+/ih3oy65FKmVXiR kfSM45XDt71wXZE138pqGwimb86rlqiybpbsoMr/EjA3Jb7cMW1MYNM5np6NUyAZ HasAP4USnbLJwkAJAE/Ua1NIVdOgMDAuBgkqhkiG9w0BCQ4xITAfMB0GA1UdDgQW BBTPhzH7M2qwKZakFTZ3DwYc7ff54TALBgcqhkjOOAQDBQADMAAwLQIUFs17HaTm vest72/4Caoo1sH39n0CFQCR680PPwr3lZ5jjEOp+n4htQNUvw== -----END NEW CERTIFICATE REQUEST----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-request.pem0000664000000000000000000000161713257152177023121 0ustar -----BEGIN NEW CERTIFICATE REQUEST----- MIICWTCCAhcCAQAwJTESMBAGA1UEAxMJMTI3LjAuMC4xMQ8wDQYDVQQKEwZDbGll bnQwggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11EilS30qcLuzk5/YRt1I8 70QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZgt2uZUKWk n5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8 q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fP CTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD 3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAACgYAneDWiGkeCjEfdiPRIh+I9xRoz kUizN6YXBDYVmgb8nsyJUjDjjYmF5NH+IQHctiF4cGntOiqFoxg1iJ1zHFTOBkmz fCiteoC5SAN1sNxboCNDiiXIZW3uxf04vZqYyr0EUIi3tKXIMpbwBxzHjof7wF98 x0K7nrLDlZC1ndw8PaAwMC4GCSqGSIb3DQEJDjEhMB8wHQYDVR0OBBYEFCDsVsKW a2tIAcD2VHwTu57GXmnWMAsGByqGSM44BAMFAAMvADAsAhQY5Zy4fQcy/SZOJ2Ix cl3/QfimvQIUVvSdet7NKWzMQoBDhlJTdTzJvE8= -----END NEW CERTIFICATE REQUEST----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-private-key1.pem0000664000000000000000000000142313257152177023745 0ustar Bag Attributes friendlyName: client-certificate1 localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 37 37 37 32 Key Attributes: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIBljBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIg1n9vdGttqoCAggA MBQGCCqGSIb3DQMHBAgRjlrRQfGcLQSCAVChui/M+36/e0WzeM79aJV7YZds/OJY gprtJ2g5Cxb1L9hymwgxJtOAaRUqLUcfLHcKSxA+MaB+Ij+/8TH+miq0zZ9q0jZV BAm56FNgUjW0nPLueTNhWzVVfQU6H9Tj33OuKm1PQo84Af3OPMtE03pvGDPEAPbH a72HUgZyI7WTux4wpxfvUEVkT5OXgBHrFlqXiHHCI+9kqBXMCV3oHgZBcO+dqPKS rlaTY7xoQWLenB6EQeYopMA2GNUVtzB3y6/nX2z0Yp5oHqKPBNOyFlVmwCrENN1/ qnrFfzVbnksWLKhg9O+TPsId1UIZVvBh67y5N5IZRrpuE03qd2BScKM/Tn6vkWNB Eus74Vba5vw9prauRC45FVgDe2YYYoULYPfhXWSiiWHDNKOBlz3l3hGlZsC8wKe5 QlV5bVcOTfGIaBkD7SQyfRjMr8SWj4WMw1M= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-private-key.pem0000664000000000000000000000142213257152177023663 0ustar Bag Attributes friendlyName: client-certificate localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 37 32 33 39 Key Attributes: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIBljBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIHmVKa1dEtm4CAggA MBQGCCqGSIb3DQMHBAgpc0Ay33xL9ASCAVBJ8D5DVRd0d6t3gSvTFBAflpUROv2/ pQlMLGbGlJIoEPyMIc9/GcgS7U19nMdoJjI1TuT/hGwObualnRRjY6KL5cbK2oUQ 371yUs6jGIQxtCeb1WgKpA/FKw9jRO7Tg5ztObItPiSQvkOcssfdRJYI1+W+ovj+ j1BKMkJu197twIChYaz+3ppJzrh3qlqFgdRdE9H04ffWpNaZ6aOIIJHPMuZ8FScu bQyvD9JjI+JWJUaCyp/3dxxxVrZ3vu8i6LmrL6Nm9IkJtFMZOfgPkoRLML2DWKqB 1qLk/Z45/THXDAxrPggFfqMvuctwJmtAGvo3MIbfCi+aewJE6/DjlSHDv6wGvOGB T5golvZ5siahHqwmufSQG8ZTsGcpu/jCA5ipIvcTVgWIxscNc2Yx9FDNWVNzUcTy ctRX6DS+s7rAy9ISjch4BbAtI7yALFt63eU= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-certificate1.pem0000664000000000000000000000215713257152177023774 0ustar -----BEGIN CERTIFICATE----- MIIDDDCCAsqgAwIBAgIEBmzTzzALBgcqhkjOOAQDBQAwMTEXMBUGA1UEAxMOVHJ1 c3RlZC5DQS5jb20xFjAUBgNVBAoTDVRydXN0IE1lIEluYy4wIBcNMTcwODAyMjE1 MzM4WhgPMjI5MTA1MTcyMTUzMzhaMFwxDDAKBgNVBAsTA0RldjENMAsGA1UEBxME Q2l0eTELMAkGA1UECBMCU1QxCzAJBgNVBAYTAlVTMRIwEAYDVQQDEwkxMjcuMC4w LjExDzANBgNVBAoTBkNsaWVudDCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQD9f1OB HXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR+1k9jVj6v8X1ujD2y5tV bNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb+DtX58aophUPBPuD9tPF HsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdgUI8VIwvMspK5gqLrhAvw WBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9B4JnUVlXjrrUWU/m cQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4rs6Z1kW6jfwv6ITVi 8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+z0kqA4GEAAKBgHVu urVq1FFws/JN+I3yfA2RVmFwlYJID8yyO9lkHBPBDE0dqfFBF6F3nwsCiZF0n/v4 od6MuuRSplV4kZH0jOOVw7e9cF2RNd/KahsIpm/Oq5aosm6W7KDK/xIwNyW+3DFt TGDTOZ6ejVMgGR2rAD+FEp2yycJACQBP1GtTSFXTo0IwQDAfBgNVHSMEGDAWgBSy Nns8IpWBxkuTETzFpYnxx/mOajAdBgNVHQ4EFgQUz4cx+zNqsCmWpBU2dw8GHO33 +eEwCwYHKoZIzjgEAwUAAy8AMCwCFCsfHJPB4Tq6qX5U+DZBc3jmLBiXAhRF17Dz fq+AxqyQ9PvTtH3UbFh1hQ== -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-certificate1.p120000664000000000000000000000310413257152177023606 0ustar 0‚@0‚ *†H†÷  ‚÷‚ó0‚ï0‚ç *†H†÷  ‚Ø0‚Ô0‚Í *†H†÷ 0 *†H†÷  0ÁS=ž|a®¶€‚ .°îãxŠjFªi”ÇNƒÏÇÇûAíHEVߎG6N˜Ï\m0pª/ÜšYŸõ’¶nb7;ó1‚.tñK*ïÈGþÇ(Aò_´*еAô!@,¨dæ.i|¹,lÕ%ì~Èk뎲¼¯ê”?;…_Fw/µ¥hßOêÎë£íŸ=ñFš!÷¿‰²U v ð[Ã:I®k/¹ÛÌeŸepÉžfDçêAQmß’.ýÈY*Ñ 0Z€¿RÇïÆ„tÓ”&QueQP7Åæ’øàÛ^œâöˆSw©-bl›qÐ…=kÁmY»iµ)—r‰†êx÷7èß´—¨ñ TM¸pXgJ$`cLÁ5/îÞèeØ6ná,ÚUhµmEMøÖþÊdФÄönîæM׌¡“â÷ŒÜÀ®—µi&ó]’ïd»êõoß<¯e^A›fŒá-‚ @?îˆó’S΀Žß Ögˆ¢}’6Ýd{9»Úr#lnŸžHz lAo”Î& ø Xˆtµ¶ž/jÑ%X“¹ègicÁð1\0# *†H†÷  1÷ì11|!=Ï`| RB­¿x$05 *†H†÷  1(&client-certificate1010!0 +íÌä%93`GûÔ°ïYUCm“yT͈žlùqpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-certificate.pem0000664000000000000000000000204513257152177023707 0ustar -----BEGIN CERTIFICATE----- MIIC1jCCApOgAwIBAgIEeg2f8DALBgcqhkjOOAQDBQAwMTEXMBUGA1UEAxMOVHJ1 c3RlZC5DQS5jb20xFjAUBgNVBAoTDVRydXN0IE1lIEluYy4wIBcNMTcwODAyMjE1 MzM3WhgPMjI5MTA1MTcyMTUzMzdaMCUxEjAQBgNVBAMTCTEyNy4wLjAuMTEPMA0G A1UEChMGQ2xpZW50MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9K nC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00 b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNa FpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA 9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJ FnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7 zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGAJ3g1ohpHgoxH 3Yj0SIfiPcUaM5FIszemFwQ2FZoG/J7MiVIw442JheTR/iEB3LYheHBp7ToqhaMY NYidcxxUzgZJs3worXqAuUgDdbDcW6AjQ4olyGVt7sX9OL2amMq9BFCIt7SlyDKW 8Accx46H+8BffMdCu56yw5WQtZ3cPD2jQjBAMB8GA1UdIwQYMBaAFLI2ezwilYHG S5MRPMWlifHH+Y5qMB0GA1UdDgQWBBQg7FbClmtrSAHA9lR8E7uexl5p1jALBgcq hkjOOAQDBQADMAAwLQIVAIpUbUYyA3DisZyENQwcN0rDQ+FyAhRPcfg9Slb6MfO4 SBFqOiesk+cpqw== -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/client-certificate.p120000664000000000000000000000301213257152177023523 0ustar 0‚0‚Ì *†H†÷  ‚½‚¹0‚µ0‚¯ *†H†÷  ‚ 0‚œ0‚• *†H†÷ 0 *†H†÷  0œë²é5F„\€‚h’ÃÕdª ‹ÓCp‹Y¯cXë,-OÖ„ÙÚ(ØÁ×)R2Ý Z§ÉFN®z%ÓŽG˸`óÈ;]¸?M_P–¿±þÁKBU¨GÏgik®T9ª0"Ï‘KôЬ†÷ù‘ú&ÒàgupJ\WfŽkßy€Ð|c>³w £³²ƒœ/{i¹rI5Ñ-Wn×Ô3ˆ‘‰ 7JŨ…4{f’&z²s Ï߀[X¯uŽg´ùµ*qM§¾×y,|qQVðqŠ_i \õáÚw7Õx²ÜoG½@:œmtZÀ¦ZÜd7é l‘š­3/¨ì U(ówí>‹.'BŽ'øNNc’~ÛI,mñ J©²f—…'ÁmªCM%"beñøDûõˆ‡ó9+¿ñ›poòšpõ­ÈC>ËòqFbR-XX½Ù–A*65¥ùoˆºwMVd4To»k?á$7ªŽ~¿•ã´+í×ÌÝÔˆÊDêV:Q z+[)²8ËV9²§îˆœ›Ã›MнŠPa÷0Ї½¶8¯<ÔKl‡-àçÿS äëóËUôlåE oèHõù¨emc¢6Ühk5™7ÿõõ–)¸1„ ‚{]hNŸöAó¤¨3P W˜O`VwŒý=^¹7•© Ka2ܸY¶mzÁºp¶Šë±óeªƒ™`©X¸×º»V6®tß<Ù+僒IYÍÇÿ”’‡§ò3†w0ÓSb ½–¥™ô)r¬d‚Ix¦nö¯Z’E˶åá_„~žPTŸxbÁ'V­¢—è9ù vB›ŒM”T0y×wu DAòüÏ«ó vtlmIƒ’‘8ZâEˆ¼qÐ%4Ÿù/xÝÐ]óé¿!=V³HVQØÌ;S¯Ñ}…ŸÒ•3g£W@ú Q]×À»RŽ’ÓýÌ:#Ò…;¼übMñ«»á^ŠÏÍ'|6î¢êf£%¡·m4‚?’\›åì¹ù‹5•–ÎÖ›!^qè‹ Fpp˜'TNR$Ó2ÖO6·Ê+SoÄ&:§(èný=Ø*×Ùž‰ ~ ŸÌt‚<®#‹d‹Já°ãšŽiè>¬´‰‘ÉöèË8e¸ÍšCOê"û$=; /G0‚þ *†H†÷  ‚ï‚ë0‚ç0‚ã *†H†÷   ‚v0‚r0 *†H†÷  0}*b}1ðí2‚P1ÞwG‚ÛF‚Õ€³I\w0PÚsÄÓM/¸×Ï¡û_ܯ: _Í,´:ŽØè²BS±4©|L寛ÞûË \ü@h,ZÕi“øÍã ùñͼ¢Ÿ„¡ù`§ÌkVï(«~EúýÜ®˜®bˆJ‡t×5|â( …½„ÿËÆµZ<ñ.¶¶%1xFHë ¸7Ê-öHÙMºÛ£0:ÂjÖç¼O±b ø–`9K™>~©å|8?IÍÝ=žä’>¹-‚ Ê-ШtvéÞÿ5¶R'”il†çCÒœÙþÆUÀ«äßäsÌ}sõ$ ‡þZ‡¾4˜˜HÐ1ôyNšoxª¾ Ž#Šh$•1Gš}¶Ü‰ ¤gý- ïâCéÿDbmÊw‘Å’fÅ#®vá¹bµw鎮ËM£Î~µž«ÀÖ†÷{øcWŠû®Ï1Z0# *†H†÷  1g뢂ü—Åî ÓMuÝ3Ü*ÙµÕ03 *†H†÷  1&$client-certificate010!0 +€bš¡>eûO;ªªÂ%3$¨šØóª†'–iÀœjqpid-proton-0.22.0/tests/python/proton_tests/ssl_db/ca.pkcs120000664000000000000000000000304413257152177021056 0ustar 0‚ 0‚Ú *†H†÷  ‚Ë‚Ç0‚Ã0‚ð *†H†÷  ‚á‚Ý0‚Ù0‚Õ *†H†÷   ‚Š0‚†0( *†H†÷  0%æ¶6TØø(ZÓÊ¥ÛAb‚X-Zp¹ Ɉ^a/jT`ý+P2¥ ¼FÐè‹?²º¡‰p,…çS³IKCîQd»Ð¾°…Ñ~’»eå™^ßXÍ$ Jµ¥ œÛún§”A—¨¿IJé äR:6*ˆO¤PáÛªóÚ¡Æô˜¯ÖøeÖþ‹Ö=Ì™´û•væú 7v§7O %š›ûÙwÚŒK³8j_Áq@ì÷žÄNrlñ5OD½×J.Ó4O=Ð_¡õ'ž»09Ö4¢}ÇÞµˆNßBŽ+4ê´ÔÄí²¨,” ÁÇY‚³ùYÙ+]æ¶XþŽÓs‡½^ ¸ž“180 *†H†÷  1ca0! *†H†÷  1Time 15017108164720‚Ë *†H†÷  ‚¼0‚¸0‚± *†H†÷ 0( *†H†÷  0ÒX_öiÄ•½‚™Ø¾¹„˜û<ñµ€‚xçèL¨ŸkMЩVœ%ŠÑ €šyÈ’6'n5ZÕ¶Ü*â0¢³¦C¡ón3ŸFRŽ5eÔçAÓÑ¢àGŒ[Žl_x eƒ4$/®‰"#ÖIœzßZàUдÃ=²’S³°%´ã’µéß9SÁÆÓËçxÐ'p¦¬}õKÄÔp¥ÝKY"¼ÕÃzråaçï¯Ýp¤IwífBñ@gx*<·ð†õÛ]I= +®ˆd¸§›Ó>@”,½ -å@Ç—çNo•ù£T,Ñ·o{ó$ðÿPI­îñ4ÈD³ ‹&wp´ƒ‚Æä —EöÖ+›@*Iëí´âëÇÔ/‘“h:AÐ~_6W‡q§°YŸÕ;á_ûÛ|+ñ=D"Þª¶¶ Q¬ô|•Ÿ6·±Ìú<4EÖ]Í®·mA°èAgÊ„@U?œSÖèý’†ûQI0Óµ”?ÒèI}GÝ.0zõ;!¢Àœ© ŠDöFKËjú6ÞÙkù}8í•>u=cpª`¾“Ga£÷7FRfHÆmùä \Ý\{®!#òQ”Ùð<ã¥i…8W‰¼ûº©ËŰR¶¬‰šä~œî$,o•£ @£ziW’ˆðœZºy4su„È"Ûs=AiÖY„<°A'lMMÌ„;Î{¦K‰õÄÌåÖʼÉ@—¯¢k¿P» ¶I3 Zù=égÎ °ì®j ±Oñ™” G8ìˆ\íà0BˆyœÓp#Œjþ/kØ4›¡º;¦_a/­KÀ|·ùn¯fñ¸þ)´„¤ÌAÈ®{®)OA,\)—)›-xÁU2ÊP,?¸½®5bÈõ­½C k3–9,ËÌÇ;óGàFlƒq*EFsÍísô/EÓb÷6g›$*ñ eÂÔ©ÙcÝh/Ȇ„´<+w²¡n©ÆÐ…ˆ'»§Š Bd¥µŽ‹ÛŒß1(Ÿ…&Q¾4õ<'06Œz„2âƒÕBrËUç㱉¥¹vm@‘1ð$ÆÊŠé-§à µ ¹»#ßs®«”°£AB…¹ÙʽBÿÞh Ó7ÁéøŸ†Cqž$I”~årpu”™8Í‹ô¤Uº jææŸJ¢›ÿ½"öŽP —Í^Á7øQ’^lÒx¶!>+“ó…i¤ =“™;0=0!0 +|Z°¬…[ìá̬òŒ‹+0~>¿’}dVKâ,6aŠLâkEU¢-­¡qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/ca-certificate.pem0000664000000000000000000000242313257152177023014 0ustar Bag Attributes friendlyName: ca localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 36 34 37 32 subject=/CN=Trusted.CA.com/O=Trust Me Inc. issuer=/CN=Trusted.CA.com/O=Trust Me Inc. -----BEGIN CERTIFICATE----- MIIDBDCCAsKgAwIBAgIEBGGY1zALBgcqhkjOOAQDBQAwMTEXMBUGA1UEAxMOVHJ1 c3RlZC5DQS5jb20xFjAUBgNVBAoTDVRydXN0IE1lIEluYy4wIBcNMTcwODAyMjE1 MzM2WhgPMjI5MTA1MTcyMTUzMzZaMDExFzAVBgNVBAMTDlRydXN0ZWQuQ0EuY29t MRYwFAYDVQQKEw1UcnVzdCBNZSBJbmMuMIIBuDCCASwGByqGSM44BAEwggEfAoGB AP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6 MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E +4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmC ouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeO utRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/ C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUA AoGBALsRT+tH1c+TC78EYtPh+KQ0DosKKtxeSRos4eQ49erdI+tYhzeqN3Ebmeky TWfGjjU64PGRFDNGjpf9l7Yo22jk9U5zIFkFp5gP9DVBHrOrh8mdT+/oBhhVHxI5 rWLqSjI/zXhRzRwueR81p0D3XJlV3g/xlOlWALoRnUWpDAo3o2QwYjASBgNVHRMB Af8ECDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAOBgNV HQ8BAf8EBAMCAoQwHQYDVR0OBBYEFLI2ezwilYHGS5MRPMWlifHH+Y5qMAsGByqG SM44BAMFAAMvADAsAhRxomjEvDfhe1p+D6KLc0IGjDNgtgIUIZXb0/Fpzy6dpCwe Ay+soxvpfMU= -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/ca-certificate.p120000664000000000000000000000174013257152177022636 0ustar 0‚Ü0‚¢ *†H†÷  ‚“‚0‚‹0‚‡ *†H†÷  ‚x0‚t0‚m *†H†÷ 0 *†H†÷  0RÃË\8Å;I€‚@þ9øÒÆ7Ûfì¯wˆ£ãßL2âšÎ Ú÷  J»Q¯6s]$*¸C°ÔСŒy¬šo !Ìb¤Ãÿ»n³QT‹ðZxáÙ@¿ƒÉÓúöÏøo+ÀucÈ(_q¦ÀðQØ`ŠDõàbz&ýc ÿfûéå÷i6jßz3Ãv)”¢`ºb#„«ïß,ÞQ<Ó&Ï{ÜǧTdƒ—D0¯õ—•Ó•ÿß{CìNdl{g©™\xÕÀÄ‚-u{€¶Yì Àßc~óÏØq£)VÜ»ùh9æ’ˆ‘ÎRåfBfzK÷~1ÇÛ,Kj²ÙÑTûn;Ñ—hF˜Z>™–R_5=¸¯mt —Œ…Œö¦ïñšg˜äúdíÆ?S¡ «:¯ÊÁêF¨2}ü:Uþ2A£Ééò‚ÙœŸ® ÖÇH´YÄ+‹´Éž¥xÀd'®|—Ð1CØmá ¼°-pšA çŸ_Tþ4 ¹à©ÁVxk膻IFwè³=9Ó}þ JÖÅ”à£% ‹ WJÌUÿȘƒs…ŠN°ý8Å«ÆøJ¿°µ<¢EÆï‚Ýùs£ËvÔ“S‚“Vó,ÔÉ¿¼ɳÍj!**&úZg´ Ù«-I¥µG[k,{t¥Úw-•\SµÏŸ“ž"–:êUÞ²Ýé$؃Œ%n>]îøvëíùJMŸ1z;×óls?Of+tÙ¤fº·c5y:‹OêÃVx1Î?æDIi#’Aqç´2Q¨5„·?øox¢õg‹É;ÊÕVøÁ[v£{¿t™5ÿñ¢oÓzjxp¢jß$K¤_ Év!÷Ií7»rv3ž,´N…Žlåä(a†…eòHÝúV²ͨpÝ4$mc‘”,´×oGr^Ç1— O" BýÉÞ"ÛY¼ÿ!\ … ÌdžÙy› j¶=‡ ¦_ðÇ9äÕÜ[zè1‘)&}GºmäŒQ8üØ)Öî5ŒÓ1”Dæ¡„Q¡Æò2r_#̵MâY˜  ôÊ á¦Ã˜]^ ò“ÔWŠI+"lCœ³,3Œ¤ÓS :¡Zd:ëèÿ_ ª4Á1’Klá—…Û™7?§ÛU–¥´œ||!(ìéµ8 n‡J¿c‹qL(—D?:?ðQž¶JX:ÌàOQDV í¼Í}~Â2sôWݺ*1H0# *†H†÷  1bad-server0! *†H†÷  1Time 15017108182960‚“ *†H†÷  ‚„0‚€0‚y *†H†÷ 0( *†H†÷  0I$7l¡µÀ“Ã3XòMXÇ\€‚@¢".Ȫ^Ž<蔫i4³¬¹Þ¦$´Ì!œ8þ±æVÀ¤•áZŒÉ$ÚñD(uÜ4ŽÅÔÆ¡¨ Ró-žÕ"ãUeÑQ£¬TZqSŒ¼Ó+¢ØÞ#‘aä¶À”¦íÖÙ.ƒtŒVÓšLò)…Û9@RÚá´]" šˆ«§M¨1òF ü± o” ªÕ (D˜ÃÚÿ4‘„É*7±¶j(¥&Ý+f¡Ìý’ùð³£$eË…V«ßþxïAùp Qï PPGë—²;'ü ¿¦0±ÍÕg13¾@$#t¥ØÚÓÄ)ã¡(Ÿ^¶¦u*ÎR‡ uËòÂOø:ÿè,$A†—É©åò7Wk´›“éðäØ}v1×¾­ê“…GRö{ ãñáXžhvsŸ˜9)0ÙäÙÊÎ…HÁõ³¯Bqò@‰§8Nu<³KV`Mc*ßBižˆˆ‚·ÊŸ'8p7Pœðo'¡w1Uè<‹18¡ÜÖŸ0B©”u[^6Šò’Ô[Éw‚ 3À³qÚlõ—tÝÖ VÚŒ˜NHýim‡äsʆU¼ÆsoÑs·NrðÚAÆ ÂÜèËëHq–¾fÂ;2˜i‰œ>—É,ID}{Óýœíç"(<Úî¼>¡÷‰\¾ÁÑ57z^£P[þèÜâ@{Eâ( f×wûû̽5Ç‘Ö ET hµ]Ø_àlø0‚hj­Æ§‚õá”Nºa¨o& Öå¿l©Ëÿ6«ð³ÍKøïÎ:kC?rÔ¥­TWþŠqÚÕ£¦kÉיּôÔœ ùÙÌ_“"?ºòŸ÷…£ÿ0~]Ÿ#rºÐÄ£ µzæÔÝÊ;jeÿN9‰üC_´¡#ř˅Áb á2¸Mc7«ÅªöÊxb´™–uÏ å ÏÛ]7ù1 °,¸wr)w‚ -öÛ¶™|øfŸ÷N•›a„úó”ØGÇC¨ç>À­ (½z´þ¹Þ(YïDât=ÀQ¯ÆÈ<´†”0ù"N…Z‘ 0=0!0 +tÐdq¢«ÏCmÅÛ˜Œ0þŽq•/Uð …'?ß4Ï0û¿YSŒ–qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/bad-server-private-key.pem0000664000000000000000000000141213257152177024436 0ustar Bag Attributes friendlyName: bad-server localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 38 32 39 36 Key Attributes: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIBljBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIqgLLe7iT+1wCAggA MBQGCCqGSIb3DQMHBAhg98ZJQMtngwSCAVCdhdOMr+VVTNaIPSy4nSwdRTlXIuRa 4wPi+07mToJmEtGfpJ4MPjDF9yRptVQI4RoN/RrLl0WX/HNZ5U4JluL0j68+JB1d MoeSRiRc+Yd2vxey8reBrvx1m1mB3LXvm38oZVDFrQ9FNGK09EtTLN1rqckr1fxQ Imcvb63nu5UZB8WMCVfKqe9Zm9dQlsSlp3M5OCRm296Xsr0eWwe2W1/rJiKMZN7x eJMf4pWVrBHoi6VJHAEA7ZvhRfcHkSbyze5ouDpKbMZS9gq38Hs4d+wkxe9x3emx 6OvppcpBolZhntF1vJXUXMc6D5Pw3mGEsRGwcMJqWCc8XJTkyP0ylNFNyaHaz0oC jSWmUu0s5628K+m8nGY4X7msfOddTA16W6mODjE2ddlTqwTFu2CYBk3WbprBRXo0 ionZQTPTqcM0UR3KyF9CHRZbnQ/d7bk57/w= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/bad-server-certificate.pem0000664000000000000000000000226313257152177024465 0ustar Bag Attributes friendlyName: bad-server localKeyID: 54 69 6D 65 20 31 35 30 31 37 31 30 38 31 38 32 39 36 subject=/CN=127.0.0.1/O=Not Trusted Inc issuer=/CN=127.0.0.1/O=Not Trusted Inc -----BEGIN CERTIFICATE----- MIICuzCCAnmgAwIBAgIELMpW4jALBgcqhkjOOAQDBQAwLjESMBAGA1UEAxMJMTI3 LjAuMC4xMRgwFgYDVQQKEw9Ob3QgVHJ1c3RlZCBJbmMwIBcNMTcwODAyMjE1MzM4 WhgPMjI5MTA1MTcyMTUzMzhaMC4xEjAQBgNVBAMTCTEyNy4wLjAuMTEYMBYGA1UE ChMPTm90IFRydXN0ZWQgSW5jMIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4Ed dRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs 14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208Ue wwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BY HPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+Zx BxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx +2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAK3E 5j/UaiVHJYAf3DAIl5hjTZcChTp57GjODdfDteHeDh85HFyW0kxmXyhpUdODzAgG THhpxy/+Kkd8jmUBVFnU1EXByvGORBfnJkMTkuhmk9veytxlskQ0tQV8gmRNb0Xe hie7T9UT8TQJy9mPS74pSuviFSx0Hz0dKGi0eVUYoyEwHzAdBgNVHQ4EFgQUg2PE qycdV1oxVaA33ULDrVdSjhkwCwYHKoZIzjgEAwUAAy8AMCwCFGybqSwG3TauRJVw XA/xeSxpYbcBAhQ6ylf9XZAvM7tMyQQTcDAkmt+YWQ== -----END CERTIFICATE----- qpid-proton-0.22.0/tests/python/proton_tests/ssl_db/bad-server-certificate.p120000664000000000000000000000272213257152177024306 0ustar 0‚Î0‚” *†H†÷  ‚…‚0‚}0‚‡ *†H†÷  ‚x0‚t0‚m *†H†÷ 0 *†H†÷  0ê†çã'YŸ€‚@ºŸÇ ê³oDN40ýØŠ A°ygS\ÅLÃÛz?)‘/”¾vâúÔá>$ýçÖUÛóïœÅZ1¬AÁAB2ÍÌRgykBªp¦˜×+Æ‚ò ðl6 ]o*ÏÊD,çqMWüÿ×_¸ÉŠÇgìÜ©|™‡A×çÙðnÊD¢Á_H ¹û:[*ÃQÊFʨ/W=zÿª›£äËthúÉ÷Oñ¸mŠt«'}*;¿~#ß|~?Æ&ÌÑ 'åR0Àµ)¬y]ÇGç¨ Kfz ]9GAOû«ÉŸŸêYr³"!c“ø¿ø¼¸Ñýý;0F¬LÔÇVo2ü޵¥£žøÀ{5ª…%,Õ"³·M|Ã&YÐ}SËPæpn$Û1òF1òBžˆæ ñ±±V«:™ûÐçó³$ÞÔD<(Ù žÇ´-5£öÁêòWy·19´¯}e(xTA÷»Mf‡¥Î¥®æ†¦ÄÊí?@ž RˆYQÇGfÈV…§¡Øælö–RlüéTú­½Û&ŒÑ m«æ´m‡k ‘ty«Ô’¥ï“惓™¾œÄ7»/J:d5/¾§vhcd^ú#ùkbÌú’ÒâØqâƒþìÚ˜½i£§ù¶cJ’LúUÂ}ÁV Ë >J´©9$åᎪÁa”`†4ŠãÖ†LÔ¥èЄ‘clƒ].*¯!… X Íé\ÄZ#¦,wúø½”N©1uú)*Õš”U€fí2ôôûá\¤ŽˆîOUÏɹ˜ö-ÐÁËÔ" N25ŽSPÖ5 ÀôË™‘£… ŽØGù€„7(¤»y¥áÍÊŒ_>'~ÉdÄý»NÞ쇜Á<¾éÞ‚o°--¸“Önm­ãÊÉêGËñ„ý¹cÇþ€C_‚h¯P €€ô6>xäXJÊûãSoZ½ìŒÊ…ðr¯ÿ<°ä7`oCÊ®½Z ¿µ0ùÏ/ø2!Û˜/“ÅSh5"%ãNÀ ˜í4bÅR8(¦œ\˜‘Š‚N›ÜÍá1× £‡ ÒÝ]7”ç&H%õ«cK+¤Áíò<¿ØÓVGôU5aãiªxûSKy*¯‚0‚î *†H†÷  ‚ß‚Û0‚×0‚Ó *†H†÷   ‚v0‚r0 *†H†÷  0Éé+O¤Uœ“‚Pš8‹»´~•ú:*»sVØ™9ƒ)î§¡üÄttÚQáüQ€?=ÎèÖGf‹åsqr‘öLn­ûà”ó[¦¢~³k¹w/r¸JU¨†ž<ùÞf±µpØÆ_T$¾OÇ­inàdÁr E…9Ô„ -C¨Fš â-RÊHA¡6_ g’*lzìqZy.&Úãï’‹ÍÞü¶AÔÙ†a, ÑèS+ðPñ>Þ9³_EC€èìhÍ… ÐbV®}Î2nmTRX¦áõMEÃðvÉŒ·ƒ\ɾϫ—!cJÄÃé_J¸I¬Cÿ{šH@ñ™¾ tyH 5†È O]xWÑŸ…gUS˜ÿ¿ñHš½ÓzÝ\öõÈn×sm}\bÕhìå”S2×É÷ÞãL÷{ç`«» •ö*ZC»r_{ÞúŠ/+~eLØ&#÷ÃF–\Z‹1J0# *†H†÷  1bad-server0# *†H†÷  1\Ñ—ø¶û‘4´©O—æâÇÞ010!0 +1Kx ÏrÁïc ¼¯¦XÛýŠDŽ˜—Äã„kqpid-proton-0.22.0/tests/python/proton_tests/ssl_db/README.txt0000664000000000000000000001616713257152177021156 0ustar The following certificate files are used by the SSL unit tests (ssl.py): ca-certificate.pem - contains the public certificate identifying a "trusted" Certificate Authority. This certificate is used to sign the certificates that identify the SSL servers and clients run by the tests. client-certificate.pem - the public certificate used to identify the client. Signed by the CA. client-private-key.pem - encrypted key used to create client-certificate.pem. Password is "client-password" server-certificate.pem - the public certificate used to identify the server. Signed by the CA. The CommonName is "A1.Good.Server.domain.com", and is checked by some unit tests. server-private-key.pem - encrypted key used to create server-certificate.pem. Password is "server-password" bad-server-certificate.pem, bad-server-private-key.pem - a certificate/key that is not trusted by the client, for negative test. server-wc-certificate.pem and server-wc-private-key.pem - similar to server-certificate.pem and server-private-key.pem, but contains Subject Alternate Name entries, and a wildcard CommonName. Used for certificate name checking tests. These certificates have been created using the OpenSSL tool. The following bash script can be used to create these certificates (requires keytool from Java 1.7, and openssl): --8<-- #!/bin/bash #set -x rm -f *.pem *.pkcs12 # Create a self-signed certificate for the CA, and a private key to sign certificate requests: keytool -storetype pkcs12 -keystore ca.pkcs12 -storepass ca-password -alias ca -keypass ca-password -genkey -dname "O=Trust Me Inc.,CN=Trusted.CA.com" -validity 99999 -ext bc:c=ca:true,pathlen:0 -ext ku:c=digitalSignature,keyCertSign -ext ExtendedkeyUsage=serverAuth,clientAuth openssl pkcs12 -nokeys -passin pass:ca-password -in ca.pkcs12 -passout pass:ca-password -out ca-certificate.pem # Create a certificate request for the server certificate. Use the CA's certificate to sign it: keytool -storetype pkcs12 -keystore server.pkcs12 -storepass server-password -alias server-certificate -keypass server-password -genkey -dname "O=Server,CN=A1.Good.Server.domain.com" -validity 99999 keytool -storetype pkcs12 -keystore server.pkcs12 -storepass server-password -alias server-certificate -keypass server-password -certreq -file server-request.pem keytool -storetype pkcs12 -keystore ca.pkcs12 -storepass ca-password -alias ca -keypass ca-password -gencert -rfc -validity 99999 -infile server-request.pem -outfile server-certificate.pem openssl pkcs12 -nocerts -passin pass:server-password -in server.pkcs12 -passout pass:server-password -out server-private-key.pem # Create a certificate request for the client certificate. Use the CA's certificate to sign it: keytool -storetype pkcs12 -keystore client.pkcs12 -storepass client-password -alias client-certificate -keypass client-password -genkey -dname "O=Client,CN=127.0.0.1" -validity 99999 keytool -storetype pkcs12 -keystore client.pkcs12 -storepass client-password -alias client-certificate -keypass client-password -certreq -file client-request.pem keytool -storetype pkcs12 -keystore ca.pkcs12 -storepass ca-password -alias ca -keypass ca-password -gencert -rfc -validity 99999 -infile client-request.pem -outfile client-certificate.pem openssl pkcs12 -nocerts -passin pass:client-password -in client.pkcs12 -passout pass:client-password -out client-private-key.pem # Create another client certificate with a different subject line keytool -storetype pkcs12 -keystore client1.pkcs12 -storepass client-password -alias client-certificate1 -keypass client-password -genkey -dname "O=Client,CN=127.0.0.1,C=US,ST=ST,L=City,OU=Dev" -validity 99999 keytool -storetype pkcs12 -keystore client1.pkcs12 -storepass client-password -alias client-certificate1 -keypass client-password -certreq -file client-request1.pem keytool -storetype pkcs12 -keystore ca.pkcs12 -storepass ca-password -alias ca -keypass ca-password -gencert -rfc -validity 99999 -infile client-request1.pem -outfile client-certificate1.pem openssl pkcs12 -nocerts -passin pass:client-password -in client1.pkcs12 -passout pass:client-password -out client-private-key1.pem # Create a "bad" certificate - not signed by a trusted authority keytool -storetype pkcs12 -keystore bad-server.pkcs12 -storepass server-password -alias bad-server -keypass server-password -genkey -dname "O=Not Trusted Inc,CN=127.0.0.1" -validity 99999 openssl pkcs12 -nocerts -passin pass:server-password -in bad-server.pkcs12 -passout pass:server-password -out bad-server-private-key.pem openssl pkcs12 -nokeys -passin pass:server-password -in bad-server.pkcs12 -passout pass:server-password -out bad-server-certificate.pem # Create a server certificate with several alternate names, including a wildcarded common name: keytool -ext san=dns:alternate.name.one.com,dns:another.name.com -storetype pkcs12 -keystore server-wc.pkcs12 -storepass server-password -alias server-wc-certificate -keypass server-password -genkeypair -dname "O=Server,CN=*.prefix*.domain.com" -validity 99999 keytool -ext san=dns:alternate.name.one.com,dns:another.name.com -storetype pkcs12 -keystore server-wc.pkcs12 -storepass server-password -alias server-wc-certificate -keypass server-password -certreq -file server-wc-request.pem keytool -ext san=dns:alternate.name.one.com,dns:another.name.com -storetype pkcs12 -keystore ca.pkcs12 -storepass ca-password -alias ca -keypass ca-password -gencert -rfc -validity 99999 -infile server-wc-request.pem -outfile server-wc-certificate.pem openssl pkcs12 -nocerts -passin pass:server-password -in server-wc.pkcs12 -passout pass:server-password -out server-wc-private-key.pem # Create pkcs12 versions of the above certificates (for Windows SChannel) # The CA certificate store/DB is created without public keys. # Give the "p12" files the same base name so the tests can just change the extension to switch between platforms. # These certificates might work for OpenSSL <-> SChannel interop tests, but note that the DH cypher suite # overlap is poor between platforms especially for older Windows versions. RSA certificates are better for # interop (or PFS-friendly certificates on newer platforms). openssl pkcs12 -export -out ca-certificate.p12 -in ca-certificate.pem -name ca-certificate -nokeys -passout pass: openssl pkcs12 -export -out server-certificate.p12 -passin pass:server-password -passout pass:server-password -inkey server-private-key.pem -in server-certificate.pem -name server-certificate openssl pkcs12 -export -out client-certificate.p12 -passin pass:client-password -passout pass:client-password -inkey client-private-key.pem -in client-certificate.pem -name client-certificate openssl pkcs12 -export -out client-certificate1.p12 -passin pass:client-password -passout pass:client-password -inkey client-private-key1.pem -in client-certificate1.pem -name client-certificate1 openssl pkcs12 -export -out bad-server-certificate.p12 -passin pass:server-password -passout pass:server-password -inkey bad-server-private-key.pem -in bad-server-certificate.pem -name bad-server openssl pkcs12 -export -out server-wc-certificate.p12 -passin pass:server-password -passout pass:server-password -inkey server-wc-private-key.pem -in server-wc-certificate.pem -name server-wc-certificate qpid-proton-0.22.0/tests/python/proton_tests/ssl.py0000664000000000000000000012524213257152177017360 0ustar from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os from . import common import random import string import subprocess import sys from proton import * from .common import Skipped, pump def _testpath(file): """ Set the full path to the certificate,keyfile, etc. for the test. """ if os.name=="nt": if file.find("private-key")!=-1: # The private key is not in a separate store return None # Substitute pkcs#12 equivalent for the CA/key store if file.endswith(".pem"): file = file[:-4] + ".p12" return os.path.join(os.path.dirname(__file__), "ssl_db/%s" % file) class SslTest(common.Test): def __init__(self, *args): common.Test.__init__(self, *args) self._testpath = _testpath def setUp(self): if not common.isSSLPresent(): raise Skipped("No SSL libraries found.") self.server_domain = SSLDomain(SSLDomain.MODE_SERVER) self.client_domain = SSLDomain(SSLDomain.MODE_CLIENT) def tearDown(self): self.server_domain = None self.client_domain = None class SslTestConnection(object): """ Represents a single SSL connection. """ def __init__(self, domain=None, mode=Transport.CLIENT, session_details=None, conn_hostname=None, ssl_peername=None): if not common.isSSLPresent(): raise Skipped("No SSL libraries found.") self.ssl = None self.domain = domain self.transport = Transport(mode) self.connection = Connection() if conn_hostname: self.connection.hostname = conn_hostname if domain: self.ssl = SSL( self.transport, self.domain, session_details ) if ssl_peername: self.ssl.peer_hostname = ssl_peername # bind last, after all configuration complete: self.transport.bind(self.connection) def _pump(self, ssl_client, ssl_server, buffer_size=1024): pump(ssl_client.transport, ssl_server.transport, buffer_size) def _do_handshake(self, client, server): """ Attempt to connect client to server. Will throw a TransportException if the SSL handshake fails. """ client.connection.open() server.connection.open() self._pump(client, server) if client.transport.closed: return assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump(client, server) def test_defaults(self): if os.name=="nt": raise Skipped("Windows SChannel lacks anonymous cipher support.") """ By default, both the server and the client support anonymous ciphers - they should connect without need for a certificate. """ server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) # check that no SSL connection exists assert not server.ssl.cipher_name() assert not client.ssl.protocol_name() #client.transport.trace(Transport.TRACE_DRV) #server.transport.trace(Transport.TRACE_DRV) client.connection.open() server.connection.open() self._pump( client, server ) # now SSL should be active assert server.ssl.cipher_name() is not None assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_ssl_with_small_buffer(self): self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() small_buffer_size = 1 self._pump( client, server, small_buffer_size ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_server_certificate(self): """ Test that anonymous clients can still connect to a server that has a certificate configured. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_server_authentication(self): """ Simple SSL connection with authentication of the server """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_certificate_fingerprint_and_subfields(self): if os.name=="nt": raise Skipped("Windows support for certificate fingerprint and subfield not implemented yet") self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) # give the client a certificate, but let's not require server authentication self.client_domain.set_credentials(self._testpath("client-certificate1.pem"), self._testpath("client-private-key1.pem"), "client-password") self.client_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) # Test the subject subfields self.assertEqual("Client", server.ssl.get_cert_organization()) self.assertEqual("Dev", server.ssl.get_cert_organization_unit()) self.assertEqual("ST", server.ssl.get_cert_state_or_province()) self.assertEqual("US", server.ssl.get_cert_country()) self.assertEqual("City", server.ssl.get_cert_locality_or_city()) self.assertEqual("O=Server,CN=A1.Good.Server.domain.com", client.ssl.get_cert_subject()) self.assertEqual("O=Client,CN=127.0.0.1,C=US,ST=ST,L=City,OU=Dev", server.ssl.get_cert_subject()) self.assertEqual("f78f03ec31317c213dcf607c095242adbf067824", server.ssl.get_cert_fingerprint_sha1()) self.assertEqual("3836fd0d7bbc155158997ff336de29545cc1ce4137f8419062ceb8b50fd7a6f9", server.ssl.get_cert_fingerprint_sha256()) self.assertEqual("a8390634eb10c7a12ba3ce0837001bc6ae78c7690984f4788cf4430acdb496d5d9e02c8ec39219f5c4dcd908c34861d09481c2faf53b4ccc95dac60e623165c4", server.ssl.get_cert_fingerprint_sha512()) self.assertEqual("32b7bc119f61c71d368caaf9a6bf58b2", server.ssl.get_cert_fingerprint_md5()) # Test the various fingerprint algorithms self.assertEqual("0aab5922c8657a7fb78402b79379506d3d7806ce", client.ssl.get_cert_fingerprint_sha1()) self.assertEqual("de5e0c4097f841815a769ce1a30dbe912b83711438a5aaf50001da23cee5a8a8", client.ssl.get_cert_fingerprint_sha256()) self.assertEqual("d0aceeb68ab9de57c9e1c21a43a4511c54ec94011e770a523a6352b1374f59c8b58adc93d5cad6f25aa125b5934309a61a25e74a5d5e0cb40b07c7468615944c", client.ssl.get_cert_fingerprint_sha512()) self.assertEqual("ae0ebcebc1f970fb696ef9f56e3235da", client.ssl.get_cert_fingerprint_md5()) self.assertEqual(None, client.ssl.get_cert_fingerprint(21, SSL.SHA1)) # Should be at least 41 self.assertEqual(None, client.ssl.get_cert_fingerprint(50, SSL.SHA256)) # Should be at least 65 self.assertEqual(None, client.ssl.get_cert_fingerprint(128, SSL.SHA512)) # Should be at least 129 self.assertEqual(None, client.ssl.get_cert_fingerprint(10, SSL.MD5)) # Should be at least 33 self.assertEqual(None, client.ssl._get_cert_subject_unknown_subfield()) self.assertNotEqual(None, client.ssl.get_cert_fingerprint(50, SSL.SHA1)) # Should be at least 41 self.assertNotEqual(None, client.ssl.get_cert_fingerprint(70, SSL.SHA256)) # Should be at least 65 self.assertNotEqual(None, client.ssl.get_cert_fingerprint(130, SSL.SHA512)) # Should be at least 129 self.assertNotEqual(None, client.ssl.get_cert_fingerprint(35, SSL.MD5)) # Should be at least 33 self.assertEqual(None, client.ssl._get_cert_fingerprint_unknown_hash_alg()) def test_client_authentication(self): """ Force the client to authenticate. """ # note: when requesting client auth, the server _must_ send its # certificate, so make sure we configure one! self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) # give the client a certificate, but let's not require server authentication self.client_domain.set_credentials(self._testpath("client-certificate.pem"), self._testpath("client-private-key.pem"), "client-password") self.client_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_client_authentication_fail_bad_cert(self): """ Ensure that the server can detect a bad client certificate. """ # note: when requesting client auth, the server _must_ send its # certificate, so make sure we configure one! self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) self.client_domain.set_credentials(self._testpath("bad-server-certificate.pem"), self._testpath("bad-server-private-key.pem"), "server-password") self.client_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT def test_client_authentication_fail_no_cert(self): """ Ensure that the server will fail a client that does not provide a certificate. """ # note: when requesting client auth, the server _must_ send its # certificate, so make sure we configure one! self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) self.client_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT def test_client_server_authentication(self): """ Require both client and server to mutually identify themselves. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) self.client_domain.set_credentials(self._testpath("client-certificate.pem"), self._testpath("client-private-key.pem"), "client-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_server_only_authentication(self): """ Client verifies server, but server does not verify client. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) self.client_domain.set_credentials(self._testpath("client-certificate.pem"), self._testpath("client-private-key.pem"), "client-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_bad_server_certificate(self): """ A server with a self-signed certificate that is not trusted by the client. The client should reject the server. """ self.server_domain.set_credentials(self._testpath("bad-server-certificate.pem"), self._testpath("bad-server-private-key.pem"), "server-password") self.server_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT del server del client # now re-try with a client that does not require peer verification self.client_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) client = SslTest.SslTestConnection( self.client_domain ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_allow_unsecured_client_which_connects_unsecured(self): """ Server allows an unsecured client to connect if configured. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) # allow unsecured clients on this connection self.server_domain.allow_unsecured_client() server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) # non-ssl connection client = SslTest.SslTestConnection() client.connection.open() server.connection.open() self._pump( client, server ) assert server.ssl.protocol_name() is None client.connection.close() server.connection.close() self._pump( client, server ) def test_allow_unsecured_client_which_connects_secured(self): """ As per test_allow_unsecured_client_which_connects_unsecured but client actually uses SSL """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) self.client_domain.set_credentials(self._testpath("client-certificate.pem"), self._testpath("client-private-key.pem"), "client-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) # allow unsecured clients on this connection #self.server_domain.allow_unsecured_client() # client uses ssl. Server should detect this. client = SslTest.SslTestConnection( self.client_domain ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client.connection.open() server.connection.open() self._pump( client, server ) assert server.ssl.protocol_name() is not None client.connection.close() server.connection.close() self._pump( client, server ) def test_disallow_unsecured_client(self): """ Non-SSL Client is disallowed from connecting to server. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) # non-ssl connection client = SslTest.SslTestConnection() client.connection.open() server.connection.open() self._pump( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT def test_session_resume(self): """ Test resume of client session. """ if os.name=="nt": raise Skipped("Windows SChannel session resume not yet implemented.") self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_peer_authentication( SSLDomain.ANONYMOUS_PEER ) self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) # details will be used in initial and subsequent connections to allow session to be resumed initial_session_details = SSLSessionDetails("my-session-id") server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain, session_details=initial_session_details ) # bring up the connection and store its state client.connection.open() server.connection.open() self._pump( client, server ) assert client.ssl.protocol_name() is not None # cleanly shutdown the connection client.connection.close() server.connection.close() self._pump( client, server ) # destroy the existing clients del client del server # now create a new set of connections, use last session id server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) # provide the details of the last session, allowing it to be resumed client = SslTest.SslTestConnection( self.client_domain, session_details=initial_session_details ) #client.transport.trace(Transport.TRACE_DRV) #server.transport.trace(Transport.TRACE_DRV) client.connection.open() server.connection.open() self._pump( client, server ) assert server.ssl.protocol_name() is not None if(API_LANGUAGE=="C"): assert client.ssl.resume_status() == SSL.RESUME_REUSED else: # Java gives no way to check whether a previous session has been resumed pass client.connection.close() server.connection.close() self._pump( client, server ) # now try to resume using an unknown session-id, expect resume to fail # and a new session is negotiated del client del server server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain, session_details=SSLSessionDetails("some-other-session-id") ) client.connection.open() server.connection.open() self._pump( client, server ) assert server.ssl.protocol_name() is not None if(API_LANGUAGE=="C"): assert client.ssl.resume_status() == SSL.RESUME_NEW client.connection.close() server.connection.close() self._pump( client, server ) def test_multiple_sessions(self): """ Test multiple simultaneous active SSL sessions with bi-directional certificate verification, shared across two domains. """ self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.server_domain.set_peer_authentication( SSLDomain.VERIFY_PEER, self._testpath("ca-certificate.pem") ) self.client_domain.set_credentials(self._testpath("client-certificate.pem"), self._testpath("client-private-key.pem"), "client-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) max_count = 100 sessions = [(SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ), SslTest.SslTestConnection( self.client_domain )) for x in range(max_count)] for s in sessions: s[0].connection.open() self._pump( s[0], s[1] ) for s in sessions: s[1].connection.open() self._pump( s[1], s[0] ) assert s[0].ssl.cipher_name() is not None assert s[1].ssl.cipher_name() == s[0].ssl.cipher_name() for s in sessions: s[1].connection.close() self._pump( s[0], s[1] ) for s in sessions: s[0].connection.close() self._pump( s[1], s[0] ) def test_server_hostname_authentication(self): """ Test authentication of the names held in the server's certificate against various configured hostnames. """ if os.name=="nt": raise Skipped("PROTON-1057: disable temporarily on Windows.") # Check the CommonName matches (case insensitive). # Assumes certificate contains "CN=A1.Good.Server.domain.com" self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "a1.good.server.domain.com" assert client.ssl.peer_hostname == "a1.good.server.domain.com" self._do_handshake( client, server ) del server del client self.tearDown() # Should fail on CN name mismatch: self.setUp() self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "A1.Good.Server.domain.comX" self._do_handshake( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT del server del client self.tearDown() # Wildcarded Certificate # Assumes: # 1) certificate contains Server Alternate Names: # "alternate.name.one.com" and "another.name.com" # 2) certificate has wildcarded CommonName "*.prefix*.domain.com" # # Pass: match an alternate self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "alternate.Name.one.com" self._do_handshake( client, server ) del client del server self.tearDown() # Pass: match an alternate self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "ANOTHER.NAME.COM" self._do_handshake(client, server) del client del server self.tearDown() # Pass: match the pattern self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "SOME.PREfix.domain.COM" self._do_handshake( client, server ) del client del server self.tearDown() # Pass: match the pattern self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "FOO.PREfixZZZ.domain.com" self._do_handshake( client, server ) del client del server self.tearDown() # Fail: must match prefix on wildcard self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "FOO.PREfi.domain.com" self._do_handshake( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT del server del client self.tearDown() # Fail: leading wildcards are not optional self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) client.ssl.peer_hostname = "PREfix.domain.COM" self._do_handshake( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT self.tearDown() # Pass: ensure that the user can give an alternate name that overrides # the connection's configured hostname self.setUp() self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection(self.server_domain, mode=Transport.SERVER) client = SslTest.SslTestConnection(self.client_domain, conn_hostname="This.Name.Does.not.Match", ssl_peername="alternate.name.one.com") self._do_handshake(client, server) del client del server self.tearDown() # Pass: ensure that the hostname supplied by the connection is used if # none has been specified for the SSL instance self.setUp() self.server_domain.set_credentials(self._testpath("server-certificate.pem"), self._testpath("server-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection(self.server_domain, mode=Transport.SERVER) client = SslTest.SslTestConnection(self.client_domain, conn_hostname="a1.good.server.domain.com") self._do_handshake(client, server) del client del server self.tearDown() def test_server_hostname_authentication_2(self): """Initially separated from test_server_hostname_authentication above to force Windows checking and sidestep PROTON-1057 exclusion. """ # Fail for a null peer name. self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"), self._testpath("server-wc-private-key.pem"), "server-password") self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME ) server = SslTest.SslTestConnection( self.server_domain, mode=Transport.SERVER ) client = SslTest.SslTestConnection( self.client_domain ) # Next line results in an eventual pn_ssl_set_peer_hostname(client.ssl._ssl, None) client.ssl.peer_hostname = None self._do_handshake( client, server ) assert client.transport.closed assert server.transport.closed assert client.connection.state & Endpoint.REMOTE_UNINIT assert server.connection.state & Endpoint.REMOTE_UNINIT self.tearDown() def test_defaults_messenger_app(self): """ Test an SSL connection using the Messenger apps (no certificates) """ if os.name=="nt": raise Skipped("Windows SChannel lacks anonymous cipher support.") port = common.free_tcp_ports()[0] receiver = common.MessengerReceiverC() receiver.subscriptions = ["amqps://~0.0.0.0:%s" % port] receiver.receive_count = 1 receiver.timeout = self.timeout receiver.start() sender = common.MessengerSenderC() sender.targets = ["amqps://0.0.0.0:%s/X" % port] sender.send_count = 1 sender.timeout = self.timeout sender.start() sender.wait() assert sender.status() == 0, "Command '%s' failed" % str(sender.cmdline()) receiver.wait() assert receiver.status() == 0, "Command '%s' failed" % str(receiver.cmdline()) def test_server_authentication_messenger_app(self): """ Test an SSL authentication using the Messenger apps. """ port = common.free_tcp_ports()[0] receiver = common.MessengerReceiverC() receiver.subscriptions = ["amqps://~0.0.0.0:%s" % port] receiver.receive_count = 1 receiver.timeout = self.timeout # Note hack - by default we use the client-certificate for the # _server_ because the client-certificate's common name field # is "127.0.0.1", which will match the target address used by # the sender. receiver.certificate = self._testpath("client-certificate.pem") receiver.privatekey = self._testpath("client-private-key.pem") receiver.password = "client-password" receiver.start() sender = common.MessengerSenderC() sender.targets = ["amqps://127.0.0.1:%s/X" % port] sender.send_count = 1 sender.timeout = self.timeout sender.ca_db = self._testpath("ca-certificate.pem") sender.start() sender.wait() assert sender.status() == 0, "Command '%s' failed" % str(sender.cmdline()) receiver.wait() assert receiver.status() == 0, "Command '%s' failed" % str(receiver.cmdline()) def DISABLED_test_defaults_valgrind(self): """ Run valgrind over a simple SSL connection (no certificates) """ # the openssl libraries produce far too many valgrind errors to be # useful. AFAIK, there is no way to wriate a valgrind suppression # expression that will ignore all errors from a given library. # Until we can, skip this test. port = common.free_tcp_ports()[0] receiver = common.MessengerReceiverValgrind() receiver.subscriptions = ["amqps://~127.0.0.1:%s" % port] receiver.receive_count = 1 receiver.timeout = self.timeout receiver.start() sender = common.MessengerSenderValgrind() sender.targets = ["amqps://127.0.0.1:%s/X" % port] sender.send_count = 1 sender.timeout = self.timeout sender.start() sender.wait() assert sender.status() == 0, "Command '%s' failed" % str(sender.cmdline()) receiver.wait() assert receiver.status() == 0, "Command '%s' failed" % str(receiver.cmdline()) # self.server_domain.set_credentials(self._testpath("client-certificate.pem"), # self._testpath("client-private-key.pem"), # "client-password") # self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem")) # self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER ) def test_singleton(self): """Verify that only a single instance of SSL can exist per Transport""" transport = Transport() ssl1 = SSL(transport, self.client_domain) ssl2 = transport.ssl(self.client_domain) ssl3 = transport.ssl(self.client_domain) assert ssl1 is ssl2 assert ssl1 is ssl3 transport = Transport() ssl1 = transport.ssl(self.client_domain) ssl2 = SSL(transport, self.client_domain) assert ssl1 is ssl2 # catch attempt to re-configure existing SSL try: ssl3 = SSL(transport, self.server_domain) assert False, "Expected error did not occur!" except SSLException: pass qpid-proton-0.22.0/tests/python/proton_tests/soak.py0000664000000000000000000002730113257152177017511 0ustar from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os import sys from .common import Test, Skipped, free_tcp_ports, \ MessengerReceiverC, MessengerSenderC, \ MessengerReceiverValgrind, MessengerSenderValgrind, \ ReactorReceiverC, ReactorSenderC, \ ReactorReceiverValgrind, ReactorSenderValgrind, \ isSSLPresent from proton import * # # Tests that run the apps # class AppTests(Test): def __init__(self, *args): Test.__init__(self, *args) self.is_valgrind = False def default(self, name, value, **kwargs): if self.is_valgrind: default = kwargs.get("valgrind", value) else: default = value return Test.default(self, name, default, **kwargs) @property def iterations(self): return int(self.default("iterations", 2, fast=1, valgrind=2)) @property def send_count(self): return int(self.default("send_count", 17, fast=1, valgrind=2)) @property def target_count(self): return int(self.default("target_count", 5, fast=1, valgrind=2)) @property def send_batch(self): return int(self.default("send_batch", 7, fast=1, valgrind=2)) @property def forward_count(self): return int(self.default("forward_count", 5, fast=1, valgrind=2)) @property def port_count(self): return int(self.default("port_count", 3, fast=1, valgrind=2)) @property def sender_count(self): return int(self.default("sender_count", 3, fast=1, valgrind=2)) def valgrind_test(self): self.is_valgrind = True def setUp(self): self.senders = [] self.receivers = [] def tearDown(self): pass def _do_test(self, iterations=1): verbose = self.verbose for R in self.receivers: R.start( verbose ) for j in range(iterations): for S in self.senders: S.start( verbose ) for S in self.senders: S.wait() #print("SENDER OUTPUT:") #print( S.stdout() ) assert S.status() == 0, ("Command '%s' failed status=%d: '%s' '%s'" % (str(S.cmdline()), S.status(), S.stdout(), S.stderr())) for R in self.receivers: R.wait() #print("RECEIVER OUTPUT") #print( R.stdout() ) assert R.status() == 0, ("Command '%s' failed status=%d: '%s' '%s'" % (str(R.cmdline()), R.status(), R.stdout(), R.stderr())) # # Traffic passing tests based on the Messenger apps # class MessengerTests(AppTests): _timeout = 60 def _ssl_check(self): if not isSSLPresent(): raise Skipped("No SSL libraries found.") if os.name=="nt": raise Skipped("Windows SChannel lacks anonymous cipher support.") def __init__(self, *args): AppTests.__init__(self, *args) def _do_oneway_test(self, receiver, sender, domain="amqp"): """ Send N messages to a receiver. Parameters: iterations - repeat the senders this many times target_count = # of targets to send to. send_count = # messages sent to each target """ iterations = self.iterations send_count = self.send_count target_count = self.target_count send_total = send_count * target_count receive_total = send_total * iterations port = free_tcp_ports()[0] receiver.subscriptions = ["%s://~0.0.0.0:%s" % (domain, port)] receiver.receive_count = receive_total receiver.timeout = MessengerTests._timeout self.receivers.append( receiver ) sender.targets = ["%s://0.0.0.0:%s/X%d" % (domain, port, j) for j in range(target_count)] sender.send_count = send_total sender.timeout = MessengerTests._timeout self.senders.append( sender ) self._do_test(iterations) def _do_echo_test(self, receiver, sender, domain="amqp"): """ Send N messages to a receiver, which responds to each. Parameters: iterations - repeat the senders this many times target_count - # targets to send to send_count = # messages sent to each target send_batch - wait for replies after this many messages sent """ iterations = self.iterations send_count = self.send_count target_count = self.target_count send_batch = self.send_batch send_total = send_count * target_count receive_total = send_total * iterations port = free_tcp_ports()[0] receiver.subscriptions = ["%s://~0.0.0.0:%s" % (domain, port)] receiver.receive_count = receive_total receiver.send_reply = True receiver.timeout = MessengerTests._timeout self.receivers.append( receiver ) sender.targets = ["%s://0.0.0.0:%s/%dY" % (domain, port, j) for j in range(target_count)] sender.send_count = send_total sender.get_reply = True sender.send_batch = send_batch sender.timeout = MessengerTests._timeout self.senders.append( sender ) self._do_test(iterations) def _do_relay_test(self, receiver, relay, sender, domain="amqp"): """ Send N messages to a receiver, which replies to each and forwards each of them to different receiver. Parameters: iterations - repeat the senders this many times target_count - # targets to send to send_count = # messages sent to each target send_batch - wait for replies after this many messages sent forward_count - forward to this many targets """ iterations = self.iterations send_count = self.send_count target_count = self.target_count send_batch = self.send_batch forward_count = self.forward_count send_total = send_count * target_count receive_total = send_total * iterations port = free_tcp_ports()[0] receiver.subscriptions = ["%s://~0.0.0.0:%s" % (domain, port)] receiver.receive_count = receive_total receiver.send_reply = True # forward to 'relay' - uses two links # ## THIS FAILS: # receiver.forwards = ["amqp://Relay/%d" % j for j in range(forward_count)] receiver.forwards = ["%s://Relay" % domain] receiver.timeout = MessengerTests._timeout self.receivers.append( receiver ) relay.subscriptions = ["%s://0.0.0.0:%s" % (domain, port)] relay.name = "Relay" relay.receive_count = receive_total relay.timeout = MessengerTests._timeout self.receivers.append( relay ) # send to 'receiver' sender.targets = ["%s://0.0.0.0:%s/X%dY" % (domain, port, j) for j in range(target_count)] sender.send_count = send_total sender.get_reply = True sender.timeout = MessengerTests._timeout self.senders.append( sender ) self._do_test(iterations) def _do_star_topology_test(self, r_factory, s_factory, domain="amqp"): """ A star-like topology, with a central receiver at the hub, and senders at the spokes. Each sender will connect to each of the ports the receiver is listening on. Each sender will then create N links per each connection. Each sender will send X messages per link, waiting for a response. Parameters: iterations - repeat the senders this many times port_count - # of ports the receiver will listen on. Each sender connects to all ports. sender_count - # of senders target_count - # of targets per connection send_count - # of messages sent to each target send_batch - # of messages to send before waiting for response """ iterations = self.iterations port_count = self.port_count sender_count = self.sender_count target_count = self.target_count send_count = self.send_count send_batch = self.send_batch send_total = port_count * target_count * send_count receive_total = send_total * sender_count * iterations ports = free_tcp_ports(port_count) receiver = r_factory() receiver.subscriptions = ["%s://~0.0.0.0:%s" % (domain, port) for port in ports] receiver.receive_count = receive_total receiver.send_reply = True receiver.timeout = MessengerTests._timeout self.receivers.append( receiver ) for i in range(sender_count): sender = s_factory() sender.targets = ["%s://0.0.0.0:%s/%d" % (domain, port, j) for port in ports for j in range(target_count)] sender.send_count = send_total sender.send_batch = send_batch sender.get_reply = True sender.timeout = MessengerTests._timeout self.senders.append( sender ) self._do_test(iterations) def test_oneway_C(self): self._do_oneway_test(MessengerReceiverC(), MessengerSenderC()) def test_oneway_C_SSL(self): self._ssl_check() self._do_oneway_test(MessengerReceiverC(), MessengerSenderC(), "amqps") def test_oneway_valgrind(self): self.valgrind_test() self._do_oneway_test(MessengerReceiverValgrind(), MessengerSenderValgrind()) def test_echo_C(self): self._do_echo_test(MessengerReceiverC(), MessengerSenderC()) def test_echo_C_SSL(self): self._ssl_check() self._do_echo_test(MessengerReceiverC(), MessengerSenderC(), "amqps") def test_echo_valgrind(self): self.valgrind_test() self._do_echo_test(MessengerReceiverValgrind(), MessengerSenderValgrind()) def test_relay_C(self): self._do_relay_test(MessengerReceiverC(), MessengerReceiverC(), MessengerSenderC()) def test_relay_C_SSL(self): self._ssl_check() self._do_relay_test(MessengerReceiverC(), MessengerReceiverC(), MessengerSenderC(), "amqps") def test_relay_valgrind(self): self.valgrind_test() self._do_relay_test(MessengerReceiverValgrind(), MessengerReceiverValgrind(), MessengerSenderValgrind()) def test_star_topology_C(self): self._do_star_topology_test( MessengerReceiverC, MessengerSenderC ) def test_star_topology_C_SSL(self): self._ssl_check() self._do_star_topology_test( MessengerReceiverC, MessengerSenderC, "amqps" ) def test_star_topology_valgrind(self): self.valgrind_test() self._do_star_topology_test( MessengerReceiverValgrind, MessengerSenderValgrind ) def test_oneway_reactor(self): self._do_oneway_test(ReactorReceiverC(), ReactorSenderC()) def test_oneway_reactor_valgrind(self): self.valgrind_test() self._do_oneway_test(ReactorReceiverValgrind(), ReactorSenderValgrind()) qpid-proton-0.22.0/tests/python/proton_tests/sasl.py0000664000000000000000000004753013257152177017524 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import absolute_import import sys, os from . import common from . import engine from proton import * from .common import pump, Skipped from proton._compat import str2bin def _sslCertpath(file): """ Return the full path to the certificate, keyfile, etc. """ if os.name=="nt": if file.find("private-key")!=-1: # The private key is not in a separate store return None # Substitute pkcs#12 equivalent for the CA/key store if file.endswith(".pem"): file = file[:-4] + ".p12" return os.path.join(os.path.dirname(__file__), "ssl_db/%s" % file) def _testSaslMech(self, mech, clientUser='user@proton', authUser='user@proton', encrypted=False, authenticated=True): self.s1.allowed_mechs(mech) self.c1.open() self.c2.open() pump(self.t1, self.t2, 1024) if encrypted is not None: assert self.t2.encrypted == encrypted, encrypted assert self.t1.encrypted == encrypted, encrypted assert self.t2.authenticated == authenticated, authenticated assert self.t1.authenticated == authenticated, authenticated if authenticated: # Server assert self.t2.user == authUser assert self.s2.user == authUser assert self.s2.mech == mech.strip() assert self.s2.outcome == SASL.OK, self.s2.outcome assert self.c2.state & Endpoint.LOCAL_ACTIVE and self.c2.state & Endpoint.REMOTE_ACTIVE,\ "local_active=%s, remote_active=%s" % (self.c1.state & Endpoint.LOCAL_ACTIVE, self.c1.state & Endpoint.REMOTE_ACTIVE) # Client assert self.t1.user == clientUser assert self.s1.user == clientUser assert self.s1.mech == mech.strip() assert self.s1.outcome == SASL.OK, self.s1.outcome assert self.c1.state & Endpoint.LOCAL_ACTIVE and self.c1.state & Endpoint.REMOTE_ACTIVE,\ "local_active=%s, remote_active=%s" % (self.c1.state & Endpoint.LOCAL_ACTIVE, self.c1.state & Endpoint.REMOTE_ACTIVE) else: # Server assert self.t2.user == None assert self.s2.user == None assert self.s2.outcome != SASL.OK, self.s2.outcome # Client assert self.t1.user == clientUser assert self.s1.user == clientUser assert self.s1.outcome != SASL.OK, self.s1.outcome class Test(common.Test): pass def consumeAllOuput(t): stops = 0 while stops<1: out = t.peek(1024) l = len(out) if out else 0 t.pop(l) if l <= 0: stops += 1 class SaslTest(Test): def setUp(self): self.t1 = Transport() self.s1 = SASL(self.t1) self.t2 = Transport(Transport.SERVER) self.t2.max_frame_size = 65536 self.s2 = SASL(self.t2) def pump(self): pump(self.t1, self.t2, 1024) # We have to generate the client frames manually because proton does not # generate pipelined SASL and AMQP frames together def testIllegalProtocolLayering(self): # Server self.s2.allowed_mechs('ANONYMOUS') c2 = Connection() self.t2.bind(c2) assert self.s2.outcome is None # Push client bytes into server self.t2.push(str2bin( # SASL 'AMQP\x03\x01\x00\x00' # @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous@fuschia"] '\x00\x00\x002\x02\x01\x00\x00\x00SA\xd0\x00\x00\x00"\x00\x00\x00\x02\xa3\x09ANONYMOUS\xa0\x11anonymous@fuschia' # SASL (again illegally) 'AMQP\x03\x01\x00\x00' # @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous@fuschia"] '\x00\x00\x002\x02\x01\x00\x00\x00SA\xd0\x00\x00\x00"\x00\x00\x00\x02\xa3\x09ANONYMOUS\xa0\x11anonymous@fuschia' # AMQP 'AMQP\x00\x01\x00\x00' # @open(16) [container-id="", channel-max=1234] '\x00\x00\x00!\x02\x00\x00\x00\x00S\x10\xd0\x00\x00\x00\x11\x00\x00\x00\x0a\xa1\x00@@`\x04\xd2@@@@@@' )) consumeAllOuput(self.t2) assert self.t2.condition assert self.t2.closed assert not c2.state & Endpoint.REMOTE_ACTIVE def testPipelinedClient(self): # Server self.s2.allowed_mechs('ANONYMOUS') c2 = Connection() self.t2.bind(c2) assert self.s2.outcome is None # Push client bytes into server self.t2.push(str2bin( # SASL 'AMQP\x03\x01\x00\x00' # @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous@fuschia"] '\x00\x00\x002\x02\x01\x00\x00\x00SA\xd0\x00\x00\x00"\x00\x00\x00\x02\xa3\x09ANONYMOUS\xa0\x11anonymous@fuschia' # AMQP 'AMQP\x00\x01\x00\x00' # @open(16) [container-id="", channel-max=1234] '\x00\x00\x00!\x02\x00\x00\x00\x00S\x10\xd0\x00\x00\x00\x11\x00\x00\x00\x0a\xa1\x00@@`\x04\xd2@@@@@@' )) consumeAllOuput(self.t2) assert not self.t2.condition assert self.s2.outcome == SASL.OK assert c2.state & Endpoint.REMOTE_ACTIVE def testPipelinedServer(self): # Client self.s1.allowed_mechs('ANONYMOUS') c1 = Connection() self.t1.bind(c1) assert self.s1.outcome is None # Push server bytes into client # Commented out lines in this test are where the client input processing doesn't # run after output processing even though there is input waiting self.t1.push(str2bin( # SASL 'AMQP\x03\x01\x00\x00' # @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]] '\x00\x00\x00\x1c\x02\x01\x00\x00\x00S@\xc0\x0f\x01\xe0\x0c\x01\xa3\tANONYMOUS' # @sasl-outcome(68) [code=0] '\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00' # AMQP 'AMQP\x00\x01\x00\x00' # @open(16) [container-id="", channel-max=1234] '\x00\x00\x00!\x02\x00\x00\x00\x00S\x10\xd0\x00\x00\x00\x11\x00\x00\x00\x0a\xa1\x00@@`\x04\xd2@@@@@@' )) consumeAllOuput(self.t1) assert self.s1.outcome == SASL.OK assert c1.state & Endpoint.REMOTE_ACTIVE def testPipelined2(self): out1 = self.t1.peek(1024) self.t1.pop(len(out1)) self.t2.push(out1) self.s2.allowed_mechs('ANONYMOUS') c2 = Connection() c2.open() self.t2.bind(c2) out2 = self.t2.peek(1024) self.t2.pop(len(out2)) self.t1.push(out2) out1 = self.t1.peek(1024) assert len(out1) > 0 def testFracturedSASL(self): """ PROTON-235 """ assert self.s1.outcome is None # self.t1.trace(Transport.TRACE_FRM) out = self.t1.peek(1024) self.t1.pop(len(out)) self.t1.push(str2bin("AMQP\x03\x01\x00\x00")) out = self.t1.peek(1024) self.t1.pop(len(out)) self.t1.push(str2bin("\x00\x00\x00")) out = self.t1.peek(1024) self.t1.pop(len(out)) self.t1.push(str2bin("6\x02\x01\x00\x00\x00S@\xc0\x29\x01\xe0\x26\x04\xa3\x05PLAIN\x0aDIGEST-MD5\x09ANONYMOUS\x08CRAM-MD5")) out = self.t1.peek(1024) self.t1.pop(len(out)) self.t1.push(str2bin("\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00")) out = self.t1.peek(1024) self.t1.pop(len(out)) while out: out = self.t1.peek(1024) self.t1.pop(len(out)) assert self.s1.outcome == SASL.OK, self.s1.outcome def test_singleton(self): """Verify that only a single instance of SASL can exist per Transport""" transport = Transport() attr = object() sasl1 = SASL(transport) sasl1.my_attribute = attr sasl2 = transport.sasl() sasl3 = SASL(transport) assert sasl1 == sasl2 assert sasl1 == sasl3 assert sasl1.my_attribute == attr assert sasl2.my_attribute == attr assert sasl3.my_attribute == attr transport = Transport() sasl1 = transport.sasl() sasl1.my_attribute = attr sasl2 = SASL(transport) assert sasl1 == sasl2 assert sasl1.my_attribute == attr assert sasl2.my_attribute == attr def testSaslSkipped(self): """Verify that the server (with SASL) correctly handles a client without SASL""" self.t1 = Transport() self.t2.require_auth(False) self.pump() assert self.s2.outcome == None assert self.t2.condition == None assert self.t2.authenticated == False assert self.s1.outcome == None assert self.t1.condition == None assert self.t1.authenticated == False def testSaslSkippedFail(self): """Verify that the server (with SASL) correctly handles a client without SASL""" self.t1 = Transport() self.t2.require_auth(True) self.pump() assert self.s2.outcome == None assert self.t2.condition != None assert self.s1.outcome == None assert self.t1.condition != None def testMechNotFound(self): self.c1 = Connection() self.c1.open() self.t1.bind(self.c1) self.s1.allowed_mechs('IMPOSSIBLE') self.pump() assert self.t2.authenticated == False assert self.t1.authenticated == False assert self.s1.outcome != SASL.OK assert self.s2.outcome != SASL.OK class SASLMechTest(Test): def setUp(self): self.t1 = Transport() self.s1 = SASL(self.t1) self.t2 = Transport(Transport.SERVER) self.s2 = SASL(self.t2) self.c1 = Connection() self.c1.user = 'user@proton' self.c1.password = 'password' self.c1.hostname = 'localhost' self.c2 = Connection() def testANON(self): self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'ANONYMOUS', authUser='anonymous') def testCRAMMD5(self): common.ensureCanTestExtendedSASL() self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'CRAM-MD5') def testDIGESTMD5(self): common.ensureCanTestExtendedSASL() self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5') # PLAIN shouldn't work without encryption without special setting def testPLAINfail(self): common.ensureCanTestExtendedSASL() self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'PLAIN', authenticated=False) # Client won't accept PLAIN even if offered by server without special setting def testPLAINClientFail(self): common.ensureCanTestExtendedSASL() self.s2.allow_insecure_mechs = True self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'PLAIN', authenticated=False) # PLAIN will only work if both ends are specially set up def testPLAIN(self): common.ensureCanTestExtendedSASL() self.s1.allow_insecure_mechs = True self.s2.allow_insecure_mechs = True self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'PLAIN') # SCRAM not supported before Cyrus SASL 2.1.26 # so not universal and hence need a test for support # to keep it in tests. # def testSCRAMSHA1(self): # common.ensureCanTestExtendedSASL() # # self.t1.bind(self.c1) # self.t2.bind(self.c2) # _testSaslMech(self, 'SCRAM-SHA-1') def _sslConnection(domain, transport, connection): transport.bind(connection) ssl = SSL(transport, domain, None ) return connection class SSLSASLTest(Test): def setUp(self): if not common.isSSLPresent(): raise Skipped("No SSL libraries found.") self.server_domain = SSLDomain(SSLDomain.MODE_SERVER) self.client_domain = SSLDomain(SSLDomain.MODE_CLIENT) self.t1 = Transport() self.s1 = SASL(self.t1) self.t2 = Transport(Transport.SERVER) self.s2 = SASL(self.t2) self.c1 = Connection() self.c2 = Connection() def testSSLPlainSimple(self): if not SASL.extended(): raise Skipped("Simple SASL server does not support PLAIN") common.ensureCanTestExtendedSASL() clientUser = 'user@proton' mech = 'PLAIN' self.c1.user = clientUser self.c1.password = 'password' self.c1.hostname = 'localhost' ssl1 = _sslConnection(self.client_domain, self.t1, self.c1) ssl2 = _sslConnection(self.server_domain, self.t2, self.c2) _testSaslMech(self, mech, encrypted=True) def testSSLPlainSimpleFail(self): if not SASL.extended(): raise Skipped("Simple SASL server does not support PLAIN") common.ensureCanTestExtendedSASL() clientUser = 'usr@proton' mech = 'PLAIN' self.c1.user = clientUser self.c1.password = 'password' self.c1.hostname = 'localhost' ssl1 = _sslConnection(self.client_domain, self.t1, self.c1) ssl2 = _sslConnection(self.server_domain, self.t2, self.c2) _testSaslMech(self, mech, clientUser='usr@proton', encrypted=True, authenticated=False) def testSSLExternalSimple(self): if os.name=="nt": extUser = 'O=Client, CN=127.0.0.1' else: extUser = 'O=Client,CN=127.0.0.1' mech = 'EXTERNAL' self.server_domain.set_credentials(_sslCertpath("server-certificate.pem"), _sslCertpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(_sslCertpath("ca-certificate.pem")) self.server_domain.set_peer_authentication(SSLDomain.VERIFY_PEER, _sslCertpath("ca-certificate.pem") ) self.client_domain.set_credentials(_sslCertpath("client-certificate.pem"), _sslCertpath("client-private-key.pem"), "client-password") self.client_domain.set_trusted_ca_db(_sslCertpath("ca-certificate.pem")) self.client_domain.set_peer_authentication(SSLDomain.VERIFY_PEER) ssl1 = _sslConnection(self.client_domain, self.t1, self.c1) ssl2 = _sslConnection(self.server_domain, self.t2, self.c2) _testSaslMech(self, mech, clientUser=None, authUser=extUser, encrypted=True) def testSSLExternalSimpleFail(self): mech = 'EXTERNAL' self.server_domain.set_credentials(_sslCertpath("server-certificate.pem"), _sslCertpath("server-private-key.pem"), "server-password") self.server_domain.set_trusted_ca_db(_sslCertpath("ca-certificate.pem")) self.server_domain.set_peer_authentication(SSLDomain.VERIFY_PEER, _sslCertpath("ca-certificate.pem") ) self.client_domain.set_trusted_ca_db(_sslCertpath("ca-certificate.pem")) self.client_domain.set_peer_authentication(SSLDomain.VERIFY_PEER) ssl1 = _sslConnection(self.client_domain, self.t1, self.c1) ssl2 = _sslConnection(self.server_domain, self.t2, self.c2) _testSaslMech(self, mech, clientUser=None, authUser=None, encrypted=None, authenticated=False) class SASLEventTest(engine.CollectorTest): def setUp(self): engine.CollectorTest.setUp(self) self.t1 = Transport() self.s1 = SASL(self.t1) self.t2 = Transport(Transport.SERVER) self.s2 = SASL(self.t2) self.c1 = Connection() self.c1.user = 'user@proton' self.c1.password = 'password' self.c1.hostname = 'localhost' self.c2 = Connection() self.collector = Collector() def testNormalAuthenticationClient(self): common.ensureCanTestExtendedSASL() self.c1.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5') self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.CONNECTION_REMOTE_OPEN) def testNormalAuthenticationServer(self): common.ensureCanTestExtendedSASL() self.c2.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5') self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.CONNECTION_REMOTE_OPEN) def testFailedAuthenticationClient(self): common.ensureCanTestExtendedSASL() clientUser = "usr@proton" self.c1.user = clientUser self.c1.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5', clientUser=clientUser, authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testFailedAuthenticationServer(self): common.ensureCanTestExtendedSASL() clientUser = "usr@proton" self.c1.user = clientUser self.c2.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5', clientUser=clientUser, authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testNoMechClient(self): common.ensureCanTestExtendedSASL() self.c1.collect(self.collector) self.s2.allowed_mechs('IMPOSSIBLE') self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testNoMechServer(self): common.ensureCanTestExtendedSASL() self.c2.collect(self.collector) self.s2.allowed_mechs('IMPOSSIBLE') self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'DIGEST-MD5', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_ERROR, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testDisallowedMechClient(self): self.c1.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'IMPOSSIBLE', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testDisallowedMechServer(self): self.c2.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'IMPOSSIBLE', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_ERROR, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testDisallowedPlainClient(self): self.c1.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'PLAIN', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testDisallowedPlainServer(self): self.c2.collect(self.collector) self.t1.bind(self.c1) self.t2.bind(self.c2) _testSaslMech(self, 'PLAIN', authenticated=False) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_ERROR, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) qpid-proton-0.22.0/tests/python/proton_tests/reactor.py0000664000000000000000000003767513257152177020232 0ustar from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import time import sys from .common import Test, SkipTest, TestServer, free_tcp_port, ensureCanTestExtendedSASL from proton.reactor import Container, Reactor, ApplicationEvent, EventInjector from proton.handlers import CHandshaker, MessagingHandler from proton import Handler, Url class Barf(Exception): pass class BarfOnInit: def on_reactor_init(self, event): raise Barf() def on_connection_init(self, event): raise Barf() def on_session_init(self, event): raise Barf() def on_link_init(self, event): raise Barf() class BarfOnTask: def on_timer_task(self, event): raise Barf() class BarfOnFinal: init = False def on_reactor_init(self, event): self.init = True def on_reactor_final(self, event): raise Barf() class BarfOnFinalDerived(CHandshaker): init = False def on_reactor_init(self, event): self.init = True def on_reactor_final(self, event): raise Barf() class ExceptionTest(Test): def setUp(self): self.reactor = Reactor() def test_reactor_final(self): self.reactor.global_handler = BarfOnFinal() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_global_set(self): self.reactor.global_handler = BarfOnInit() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_global_add(self): self.reactor.global_handler.add(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_reactor_set(self): self.reactor.handler = BarfOnInit() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_reactor_add(self): self.reactor.handler.add(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_connection(self): self.reactor.connection(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_connection_set(self): c = self.reactor.connection() c.handler = BarfOnInit() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_connection_add(self): c = self.reactor.connection() c.handler = object() c.handler.add(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_session_set(self): c = self.reactor.connection() s = c.session() s.handler = BarfOnInit() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_session_add(self): c = self.reactor.connection() s = c.session() s.handler = object() s.handler.add(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_link_set(self): c = self.reactor.connection() s = c.session() l = s.sender("xxx") l.handler = BarfOnInit() try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_link_add(self): c = self.reactor.connection() s = c.session() l = s.sender("xxx") l.handler = object() l.handler.add(BarfOnInit()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_schedule(self): self.reactor.schedule(0, BarfOnTask()) try: self.reactor.run() assert False, "expected to barf" except Barf: pass def test_schedule_many_nothings(self): class Nothing: results = [] def on_timer_task(self, event): self.results.append(None) num = 12345 for a in range(num): self.reactor.schedule(0, Nothing()) self.reactor.run() assert len(Nothing.results) == num def test_schedule_many_nothing_refs(self): class Nothing: results = [] def on_timer_task(self, event): self.results.append(None) num = 12345 tasks = [] for a in range(num): tasks.append(self.reactor.schedule(0, Nothing())) self.reactor.run() assert len(Nothing.results) == num def test_schedule_many_nothing_refs_cancel_before_run(self): class Nothing: results = [] def on_timer_task(self, event): self.results.append(None) num = 12345 tasks = [] for a in range(num): tasks.append(self.reactor.schedule(0, Nothing())) for task in tasks: task.cancel() self.reactor.run() assert len(Nothing.results) == 0 def test_schedule_cancel(self): barf = self.reactor.schedule(10, BarfOnTask()) class CancelBarf: def __init__(self, barf): self.barf = barf def on_timer_task(self, event): self.barf.cancel() pass self.reactor.schedule(0, CancelBarf(barf)) now = self.reactor.mark() try: self.reactor.run() elapsed = self.reactor.mark() - now assert elapsed < 10, "expected cancelled task to not delay the reactor by %s" % elapsed except Barf: assert False, "expected barf to be cancelled" def test_schedule_cancel_many(self): num = 12345 barfs = set() for a in range(num): barf = self.reactor.schedule(10*(a+1), BarfOnTask()) class CancelBarf: def __init__(self, barf): self.barf = barf def on_timer_task(self, event): self.barf.cancel() barfs.discard(self.barf) pass self.reactor.schedule(0, CancelBarf(barf)) barfs.add(barf) now = self.reactor.mark() try: self.reactor.run() elapsed = self.reactor.mark() - now assert elapsed < num, "expected cancelled task to not delay the reactor by %s" % elapsed assert not barfs, "expected all barfs to be discarded" except Barf: assert False, "expected barf to be cancelled" class ApplicationEventTest(Test): """Test application defined events and handlers.""" class MyTestServer(TestServer): def __init__(self): super(ApplicationEventTest.MyTestServer, self).__init__() class MyHandler(Handler): def __init__(self, test): super(ApplicationEventTest.MyHandler, self).__init__() self._test = test def on_hello(self, event): # verify PROTON-1056 self._test.hello_rcvd = str(event) def on_goodbye(self, event): self._test.goodbye_rcvd = str(event) def setUp(self): import os if not hasattr(os, 'pipe'): # KAG: seems like Jython doesn't have an os.pipe() method raise SkipTest() if os.name=="nt": # Correct implementation on Windows is complicated raise SkipTest("PROTON-1071") self.server = ApplicationEventTest.MyTestServer() self.server.reactor.handler.add(ApplicationEventTest.MyHandler(self)) self.event_injector = EventInjector() self.hello_event = ApplicationEvent("hello") self.goodbye_event = ApplicationEvent("goodbye") self.server.reactor.selectable(self.event_injector) self.hello_rcvd = None self.goodbye_rcvd = None self.server.start() def tearDown(self): self.server.stop() def _wait_for(self, predicate, timeout=10.0): deadline = time.time() + timeout while time.time() < deadline: if predicate(): break time.sleep(0.1) assert predicate() def test_application_events(self): self.event_injector.trigger(self.hello_event) self._wait_for(lambda: self.hello_rcvd is not None) self.event_injector.trigger(self.goodbye_event) self._wait_for(lambda: self.goodbye_rcvd is not None) class AuthenticationTestHandler(MessagingHandler): def __init__(self): super(AuthenticationTestHandler, self).__init__() port = free_tcp_port() self.url = "localhost:%i" % port self.verified = False def on_start(self, event): self.listener = event.container.listen(self.url) def on_connection_opened(self, event): event.connection.close() def on_connection_opening(self, event): assert event.connection.transport.user == "user@proton" self.verified = True def on_connection_closed(self, event): event.connection.close() self.listener.close() def on_connection_error(self, event): event.connection.close() self.listener.close() class ContainerTest(Test): """Test container subclass of reactor.""" def test_event_has_container_attribute(self): ensureCanTestExtendedSASL() class TestHandler(MessagingHandler): def __init__(self): super(TestHandler, self).__init__() port = free_tcp_port() self.url = "localhost:%i" % port def on_start(self, event): self.listener = event.container.listen(self.url) def on_connection_closing(self, event): event.connection.close() self.listener.close() test_handler = TestHandler() container = Container(test_handler) class ConnectionHandler(MessagingHandler): def __init__(self): super(ConnectionHandler, self).__init__() def on_connection_opened(self, event): event.connection.close() assert event.container == event.reactor assert event.container == container container.connect(test_handler.url, handler=ConnectionHandler()) container.run() def test_authentication_via_url(self): ensureCanTestExtendedSASL() test_handler = AuthenticationTestHandler() container = Container(test_handler) container.connect("%s:password@%s" % ("user%40proton", test_handler.url), reconnect=False) container.run() assert test_handler.verified def test_authentication_via_container_attributes(self): ensureCanTestExtendedSASL() test_handler = AuthenticationTestHandler() container = Container(test_handler) container.user = "user@proton" container.password = "password" container.connect(test_handler.url, reconnect=False) container.run() assert test_handler.verified def test_authentication_via_kwargs(self): ensureCanTestExtendedSASL() test_handler = AuthenticationTestHandler() container = Container(test_handler) container.connect(test_handler.url, user="user@proton", password="password", reconnect=False) container.run() assert test_handler.verified class _ServerHandler(MessagingHandler): def __init__(self, host): super(ContainerTest._ServerHandler, self).__init__() self.host = host port = free_tcp_port() self.port = free_tcp_port() self.client_addr = None self.peer_hostname = None def on_start(self, event): self.listener = event.container.listen("%s:%s" % (self.host, self.port)) def on_connection_opened(self, event): self.client_addr = event.reactor.get_connection_address(event.connection) self.peer_hostname = event.connection.remote_hostname def on_connection_closing(self, event): event.connection.close() self.listener.close() class _ClientHandler(MessagingHandler): def __init__(self): super(ContainerTest._ClientHandler, self).__init__() self.server_addr = None def on_connection_opened(self, event): self.server_addr = event.reactor.get_connection_address(event.connection) event.connection.close() def test_numeric_hostname(self): ensureCanTestExtendedSASL() server_handler = ContainerTest._ServerHandler("127.0.0.1") client_handler = ContainerTest._ClientHandler() container = Container(server_handler) container.connect(url=Url(host="127.0.0.1", port=server_handler.port), handler=client_handler) container.run() assert server_handler.client_addr assert client_handler.server_addr assert server_handler.peer_hostname == "127.0.0.1", server_handler.peer_hostname assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port) def test_non_numeric_hostname(self): ensureCanTestExtendedSASL() server_handler = ContainerTest._ServerHandler("localhost") client_handler = ContainerTest._ClientHandler() container = Container(server_handler) container.connect(url=Url(host="localhost", port=server_handler.port), handler=client_handler) container.run() assert server_handler.client_addr assert client_handler.server_addr assert server_handler.peer_hostname == "localhost", server_handler.peer_hostname assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port) def test_virtual_host(self): ensureCanTestExtendedSASL() server_handler = ContainerTest._ServerHandler("localhost") container = Container(server_handler) conn = container.connect(url=Url(host="localhost", port=server_handler.port), handler=ContainerTest._ClientHandler(), virtual_host="a.b.c.org") container.run() assert server_handler.peer_hostname == "a.b.c.org", server_handler.peer_hostname def test_no_virtual_host(self): # explicitly setting an empty virtual host should prevent the hostname # field from being sent in the Open performative when using the # Python Container. server_handler = ContainerTest._ServerHandler("localhost") container = Container(server_handler) conn = container.connect(url=Url(host="localhost", port=server_handler.port), handler=ContainerTest._ClientHandler(), virtual_host="") container.run() assert server_handler.peer_hostname is None, server_handler.peer_hostname qpid-proton-0.22.0/tests/python/proton_tests/message.py0000664000000000000000000002156713257152177020210 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os from . import common from proton import * from proton._compat import str2bin try: from uuid import uuid4 except ImportError: from proton import uuid4 class Test(common.Test): def setUp(self): self.msg = Message() def tearDown(self): self.msg = None class AccessorsTest(Test): def _test(self, name, default, values): d = getattr(self.msg, name) assert d == default, (d, default) for v in values: setattr(self.msg, name, v) gotten = getattr(self.msg, name) assert gotten == v, gotten def _test_symbol(self, name): self._test(name, symbol(None), (symbol(u"abc.123.#$%"), symbol(u"hello.world"))) def _test_str(self, name): self._test(name, None, (u"asdf", u"fdsa", u"")) def _test_time(self, name): self._test(name, 0, (0, 123456789, 987654321)) def testId(self): self._test("id", None, ("bytes", None, 123, u"string", uuid4())) def testCorrelationId(self): self._test("correlation_id", None, ("bytes", None, 123, u"string", uuid4())) def testDurable(self): self._test("durable", False, (True, False)) def testPriority(self): self._test("priority", Message.DEFAULT_PRIORITY, range(0, 255)) def testTtl(self): self._test("ttl", 0, range(12345, 54321)) def testFirstAcquirer(self): self._test("first_acquirer", False, (True, False)) def testDeliveryCount(self): self._test("delivery_count", 0, range(0, 1024)) def testUserId(self): self._test("user_id", str2bin(""), (str2bin("asdf"), str2bin("fdsa"), str2bin("asd\x00fdsa"), str2bin(""))) def testAddress(self): self._test_str("address") def testSubject(self): self._test_str("subject") def testReplyTo(self): self._test_str("reply_to") def testContentType(self): self._test_symbol("content_type") def testContentEncoding(self): self._test_symbol("content_encoding") def testExpiryTime(self): self._test_time("expiry_time") def testCreationTime(self): self._test_time("creation_time") def testGroupId(self): self._test_str("group_id") def testGroupSequence(self): self._test("group_sequence", 0, (0, -10, 10, 20, -20)) def testReplyToGroupId(self): self._test_str("reply_to_group_id") class CodecTest(Test): def testRoundTrip(self): self.msg.id = "asdf" self.msg.correlation_id = uuid4() self.msg.ttl = 3 self.msg.priority = 100 self.msg.address = "address" self.msg.subject = "subject" self.msg.body = 'Hello World!' data = self.msg.encode() msg2 = Message() msg2.decode(data) assert self.msg.id == msg2.id, (self.msg.id, msg2.id) assert self.msg.correlation_id == msg2.correlation_id, (self.msg.correlation_id, msg2.correlation_id) assert self.msg.ttl == msg2.ttl, (self.msg.ttl, msg2.ttl) assert self.msg.priority == msg2.priority, (self.msg.priority, msg2.priority) assert self.msg.address == msg2.address, (self.msg.address, msg2.address) assert self.msg.subject == msg2.subject, (self.msg.subject, msg2.subject) assert self.msg.body == msg2.body, (self.msg.body, msg2.body) def testExpiryEncodeAsNull(self): self.msg.group_id = "A" # Force creation and expiry fields to be present data = self.msg.encode() decoder = Data() # Skip past the headers consumed = decoder.decode(data) decoder.clear() data = data[consumed:] decoder.decode(data) dproperties = decoder.get_py_described() # Check we've got the correct described list assert dproperties.descriptor == 0x73, (dproperties.descriptor) properties = dproperties.value assert properties[8] == None, properties[8] def testCreationEncodeAsNull(self): self.msg.group_id = "A" # Force creation and expiry fields to be present data = self.msg.encode() decoder = Data() # Skip past the headers consumed = decoder.decode(data) decoder.clear() data = data[consumed:] decoder.decode(data) dproperties = decoder.get_py_described() # Check we've got the correct described list assert dproperties.descriptor == 0x73, (dproperties.descriptor) properties = dproperties.value assert properties[9] == None, properties[9] def testGroupSequenceEncodeAsNull(self): self.msg.reply_to_group_id = "R" # Force group_id and group_sequence fields to be present data = self.msg.encode() decoder = Data() # Skip past the headers consumed = decoder.decode(data) decoder.clear() data = data[consumed:] decoder.decode(data) dproperties = decoder.get_py_described() # Check we've got the correct described list assert dproperties.descriptor == 0x73, (dproperties.descriptor) properties = dproperties.value assert properties[10] == None, properties[10] assert properties[11] == None, properties[11] def testGroupSequenceEncodeAsNonNull(self): self.msg.group_id = "G" self.msg.reply_to_group_id = "R" # Force group_id and group_sequence fields to be present data = self.msg.encode() decoder = Data() # Skip past the headers consumed = decoder.decode(data) decoder.clear() data = data[consumed:] decoder.decode(data) dproperties = decoder.get_py_described() # Check we've got the correct described list assert dproperties.descriptor == 0x73, (dproperties.descriptor) properties = dproperties.value assert properties[10] == 'G', properties[10] assert properties[11] == 0, properties[11] def testDefaultCreationExpiryDecode(self): # This is a message with everything filled explicitly as null or zero in LIST32 HEADER and PROPERTIES lists data = str2bin('\x00\x53\x70\xd0\x00\x00\x00\x0a\x00\x00\x00\x05\x42\x40\x40\x42\x52\x00\x00\x53\x73\xd0\x00\x00\x00\x12\x00\x00\x00\x0d\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x52\x00\x40') msg2 = Message() msg2.decode(data) assert msg2.expiry_time == 0, (msg2.expiry_time) assert msg2.creation_time == 0, (msg2.creation_time) # The same message with LIST8s instead data = str2bin('\x00\x53\x70\xc0\x07\x05\x42\x40\x40\x42\x52\x00\x00\x53\x73\xc0\x0f\x0d\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x52\x00\x40') msg3 = Message() msg3.decode(data) assert msg2.expiry_time == 0, (msg2.expiry_time) assert msg2.creation_time == 0, (msg2.creation_time) # Minified message with zero length HEADER and PROPERTIES lists data = str2bin('\x00\x53\x70\x45' '\x00\x53\x73\x45') msg4 = Message() msg4.decode(data) assert msg2.expiry_time == 0, (msg2.expiry_time) assert msg2.creation_time == 0, (msg2.creation_time) def testDefaultPriorityEncode(self): assert self.msg.priority == 4, (self.msg.priority) self.msg.ttl = 0.003 # field after priority, so forces priority to be present data = self.msg.encode() decoder = Data() decoder.decode(data) dheaders = decoder.get_py_described() # Check we've got the correct described list assert dheaders.descriptor == 0x70, (dheaders.descriptor) # Check that the priority field (second field) is encoded as null headers = dheaders.value assert headers[1] == None, (headers[1]) def testDefaultPriorityDecode(self): # This is a message with everything filled explicitly as null or zero in LIST32 HEADER and PROPERTIES lists data = str2bin('\x00\x53\x70\xd0\x00\x00\x00\x0a\x00\x00\x00\x05\x42\x40\x40\x42\x52\x00\x00\x53\x73\xd0\x00\x00\x00\x22\x00\x00\x00\x0d\x40\x40\x40\x40\x40\x40\x40\x40\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00\x40\x52\x00\x40') msg2 = Message() msg2.decode(data) assert msg2.priority == 4, (msg2.priority) # The same message with LIST8s instead data = str2bin('\x00\x53\x70\xc0\x07\x05\x42\x40\x40\x42\x52\x00\x00\x53\x73\xc0\x1f\x0d\x40\x40\x40\x40\x40\x40\x40\x40\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00\x40\x52\x00\x40') msg3 = Message() msg3.decode(data) assert msg3.priority == 4, (msg3.priority) # Minified message with zero length HEADER and PROPERTIES lists data = str2bin('\x00\x53\x70\x45' '\x00\x53\x73\x45') msg4 = Message() msg4.decode(data) assert msg4.priority == 4, (msg4.priority) qpid-proton-0.22.0/tests/python/proton_tests/interop.py0000664000000000000000000001252013257152177020231 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from proton import * import os from . import common from proton._compat import str2bin def find_test_interop_dir(): """Walk up the directory tree to find the tests directory.""" f = os.path.dirname(os.path.abspath(__file__)) while f and os.path.basename(f) != "tests": f = os.path.dirname(f) f = os.path.join(f, "interop") if not os.path.isdir(f): raise Exception("Cannot find test/interop directory from "+__file__) return f test_interop_dir=find_test_interop_dir() class InteropTest(common.Test): def setUp(self): self.data = Data() self.message = Message() def tearDown(self): self.data = None def get_data(self, name): filename = os.path.join(test_interop_dir, name+".amqp") f = open(filename,"rb") try: return f.read() finally: f.close() def decode_data(self, encoded): buffer = encoded while buffer: n = self.data.decode(buffer) buffer = buffer[n:] self.data.rewind() def decode_data_file(self, name): encoded = self.get_data(name) self.decode_data(encoded) encoded_size = self.data.encoded_size() # Re-encode and verify pre-computed and actual encoded size match. reencoded = self.data.encode() assert encoded_size == len(reencoded), "%d != %d" % (encoded_size, len(reencoded)) # verify round trip bytes assert reencoded == encoded, "Value mismatch: %s != %s" % (reencoded, encoded) def decode_message_file(self, name): self.message.decode(self.get_data(name)) body = self.message.body if str(type(body)) == "": body = body.array.tostring() self.decode_data(body) def assert_next(self, type, value): next_type = self.data.next() assert next_type == type, "Type mismatch: %s != %s"%( Data.type_names[next_type], Data.type_names[type]) next_value = self.data.get_object() assert next_value == value, "Value mismatch: %s != %s"%(next_value, value) def test_message(self): self.decode_message_file("message") self.assert_next(Data.STRING, "hello") assert self.data.next() is None def test_primitives(self): self.decode_data_file("primitives") self.assert_next(Data.BOOL, True) self.assert_next(Data.BOOL, False) self.assert_next(Data.UBYTE, 42) self.assert_next(Data.USHORT, 42) self.assert_next(Data.SHORT, -42) self.assert_next(Data.UINT, 12345) self.assert_next(Data.INT, -12345) self.assert_next(Data.ULONG, 12345) self.assert_next(Data.LONG, -12345) self.assert_next(Data.FLOAT, 0.125) self.assert_next(Data.DOUBLE, 0.125) assert self.data.next() is None def test_strings(self): self.decode_data_file("strings") self.assert_next(Data.BINARY, str2bin("abc\0defg")) self.assert_next(Data.STRING, "abcdefg") self.assert_next(Data.SYMBOL, "abcdefg") self.assert_next(Data.BINARY, str2bin("")) self.assert_next(Data.STRING, "") self.assert_next(Data.SYMBOL, "") assert self.data.next() is None def test_described(self): self.decode_data_file("described") self.assert_next(Data.DESCRIBED, Described("foo-descriptor", "foo-value")) self.data.exit() assert self.data.next() == Data.DESCRIBED self.data.enter() self.assert_next(Data.INT, 12) self.assert_next(Data.INT, 13) self.data.exit() assert self.data.next() is None def test_described_array(self): self.decode_data_file("described_array") self.assert_next(Data.ARRAY, Array("int-array", Data.INT, *range(0,10))) def test_arrays(self): self.decode_data_file("arrays") self.assert_next(Data.ARRAY, Array(UNDESCRIBED, Data.INT, *range(0,100))) self.assert_next(Data.ARRAY, Array(UNDESCRIBED, Data.STRING, *["a", "b", "c"])) self.assert_next(Data.ARRAY, Array(UNDESCRIBED, Data.INT)) assert self.data.next() is None def test_lists(self): self.decode_data_file("lists") self.assert_next(Data.LIST, [32, "foo", True]) self.assert_next(Data.LIST, []) assert self.data.next() is None def test_maps(self): self.decode_data_file("maps") self.assert_next(Data.MAP, {"one":1, "two":2, "three":3 }) self.assert_next(Data.MAP, {1:"one", 2:"two", 3:"three"}) self.assert_next(Data.MAP, {}) assert self.data.next() is None qpid-proton-0.22.0/tests/python/proton_tests/handler.py0000664000000000000000000000704213257152177020171 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import absolute_import import os, gc, traceback import sys from . import common from time import time, sleep from proton import * from .common import pump, Skipped from proton.reactor import Reactor CUSTOM = EventType("custom") class HandlerTest(common.Test): def test_reactorHandlerCycling(self, n=0): class CustomHandler(Handler): UNSET = 999999999 def __init__(self): self.offset = len(traceback.extract_stack()) def on_reactor_init(self, event): self.depth = len(traceback.extract_stack()) def reset(self): self.depth = self.UNSET @property def init_depth(self): d = self.depth - self.offset return d custom = CustomHandler() reactor = Reactor() reactor.handler = custom for i in range(n): h = reactor.handler reactor.handler = h custom.reset() reactor.run() assert custom.init_depth < 50, "Unexpectedly long traceback for a simple handler" def test_reactorHandlerCycling10k(self): self.test_reactorHandlerCycling(10000) def test_reactorHandlerCycling100(self): self.test_reactorHandlerCycling(100) def do_customEvent(self, reactor_handler, event_root): class CustomHandler: did_custom = False did_init = False def __init__(self, *handlers): self.handlers = handlers def on_reactor_init(self, event): self.did_init = True def on_custom(self, event): self.did_custom = True class CustomInvoker(CustomHandler): def on_reactor_init(self, event): h = event_root(event) event.dispatch(h, CUSTOM) self.did_init = True child = CustomInvoker() root = CustomHandler(child) reactor = Reactor() reactor_handler(reactor, root) reactor.run() assert root.did_init assert child.did_init assert root.did_custom assert child.did_custom def set_root(self, reactor, root): reactor.handler = root def add_root(self, reactor, root): reactor.handler.add(root) def append_root(self, reactor, root): reactor.handler.handlers.append(root) def event_root(self, event): return event.root def event_reactor_handler(self, event): return event.reactor.handler def test_set_handler(self): self.do_customEvent(self.set_root, self.event_reactor_handler) def test_add_handler(self): self.do_customEvent(self.add_root, self.event_reactor_handler) def test_append_handler(self): self.do_customEvent(self.append_root, self.event_reactor_handler) def test_set_root(self): self.do_customEvent(self.set_root, self.event_root) def test_add_root(self): self.do_customEvent(self.add_root, self.event_root) def test_append_root(self): self.do_customEvent(self.append_root, self.event_root) qpid-proton-0.22.0/tests/python/proton_tests/engine.py0000664000000000000000000023060513257152177020024 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import absolute_import import os, gc import sys from . import common from time import time, sleep from proton import * from .common import pump, Skipped from proton.reactor import Reactor from proton._compat import str2bin # older versions of gc do not provide the garbage list if not hasattr(gc, "garbage"): gc.garbage=[] # future test areas # + different permutations of setup # - creating deliveries and calling input/output before opening the session/link # + shrinking output_size down to something small? should the engine buffer? # + resuming # - locally and remotely created deliveries with the same tag # Jython 2.5 needs this: try: bytes() except: bytes = str # and this... try: bytearray() except: def bytearray(x): return str2bin('\x00') * x OUTPUT_SIZE = 10*1024 class Test(common.Test): def __init__(self, *args): common.Test.__init__(self, *args) self._wires = [] def connection(self): c1 = Connection() c2 = Connection() t1 = Transport() t1.bind(c1) t2 = Transport() t2.bind(c2) self._wires.append((c1, t1, c2, t2)) mask1 = 0 mask2 = 0 for cat in ("TRACE_FRM", "TRACE_RAW"): trc = os.environ.get("PN_%s" % cat) if trc and trc.lower() in ("1", "2", "yes", "true"): mask1 = mask1 | getattr(Transport, cat) if trc == "2": mask2 = mask2 | getattr(Transport, cat) t1.trace(mask1) t2.trace(mask2) return c1, c2 def link(self, name, max_frame=None, idle_timeout=None): c1, c2 = self.connection() if max_frame: c1.transport.max_frame_size = max_frame[0] c2.transport.max_frame_size = max_frame[1] if idle_timeout: # idle_timeout in seconds expressed as float c1.transport.idle_timeout = idle_timeout[0] c2.transport.idle_timeout = idle_timeout[1] c1.open() c2.open() ssn1 = c1.session() ssn1.open() self.pump() ssn2 = c2.session_head(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE) ssn2.open() self.pump() snd = ssn1.sender(name) rcv = ssn2.receiver(name) return snd, rcv def cleanup(self): self._wires = [] def pump(self, buffer_size=OUTPUT_SIZE): for c1, t1, c2, t2 in self._wires: pump(t1, t2, buffer_size) class ConnectionTest(Test): def setUp(self): gc.enable() self.c1, self.c2 = self.connection() def cleanup(self): # release resources created by this class super(ConnectionTest, self).cleanup() self.c1 = None self.c2 = None def tearDown(self): self.cleanup() gc.collect() assert not gc.garbage def test_open_close(self): assert self.c1.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert self.c2.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.c1.open() self.pump() assert self.c1.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT assert self.c2.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE self.c2.open() self.pump() assert self.c1.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.c1.close() self.pump() assert self.c1.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED self.c2.close() self.pump() assert self.c1.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert self.c2.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_simultaneous_open_close(self): assert self.c1.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert self.c2.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.c1.open() self.c2.open() self.pump() assert self.c1.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.c1.close() self.c2.close() self.pump() assert self.c1.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert self.c2.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_capabilities(self): self.c1.offered_capabilities = Array(UNDESCRIBED, Data.SYMBOL, symbol("O_one"), symbol("O_two"), symbol("O_three")) self.c1.desired_capabilities = Array(UNDESCRIBED, Data.SYMBOL, symbol("D_one"), symbol("D_two"), symbol("D_three")) self.c1.open() assert self.c2.remote_offered_capabilities is None assert self.c2.remote_desired_capabilities is None self.pump() assert self.c2.remote_offered_capabilities == self.c1.offered_capabilities, \ (self.c2.remote_offered_capabilities, self.c1.offered_capabilities) assert self.c2.remote_desired_capabilities == self.c1.desired_capabilities, \ (self.c2.remote_desired_capabilities, self.c1.desired_capabilities) def test_condition(self): self.c1.open() self.c2.open() self.pump() assert self.c1.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE cond = Condition("blah:bleh", "this is a description", {symbol("foo"): "bar"}) self.c1.condition = cond self.c1.close() self.pump() assert self.c1.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED rcond = self.c2.remote_condition assert rcond == cond, (rcond, cond) def test_properties(self, p1={symbol("key"): symbol("value")}, p2=None): self.c1.properties = p1 self.c2.properties = p2 self.c1.open() self.c2.open() self.pump() assert self.c2.remote_properties == p1, (self.c2.remote_properties, p1) assert self.c1.remote_properties == p2, (self.c2.remote_properties, p2) # The proton implementation limits channel_max to 32767. # If I set the application's limit lower than that, I should # get my wish. If I set it higher -- not. def test_channel_max_low(self, value=1234): self.c1.transport.channel_max = value self.c1.open() self.pump() assert self.c1.transport.channel_max == value, (self.c1.transport.channel_max, value) def test_channel_max_high(self, value=65535): self.c1.transport.channel_max = value self.c1.open() self.pump() assert self.c1.transport.channel_max == 32767, (self.c1.transport.channel_max, value) def test_channel_max_raise_and_lower(self): upper_limit = 32767 # It's OK to lower the max below upper_limit. self.c1.transport.channel_max = 12345 assert self.c1.transport.channel_max == 12345 # But it won't let us raise the limit above PN_IMPL_CHANNEL_MAX. self.c1.transport.channel_max = 65535 assert self.c1.transport.channel_max == upper_limit # send the OPEN frame self.c1.open() self.pump() # Now it's too late to make any change, because # we have already sent the OPEN frame. try: self.c1.transport.channel_max = 666 assert False, "expected session exception" except: pass assert self.c1.transport.channel_max == upper_limit # TODO: Currently failing test - PROTON-1759 - skip def test_channel_max_limits_sessions(self): raise Skipped('Test fails - PROTON-1759') # This is an index -- so max number of channels should be 1. self.c1.transport.channel_max = 0 self.c1.open() self.c2.open() ssn_0 = self.c2.session() assert ssn_0 != None ssn_0.open() self.pump() try: ssn_1 = self.c2.session() ssn_1.open() self.pump() assert False, "expected session exception" except SessionException: pass def test_cleanup(self): self.c1.open() self.c2.open() self.pump() assert self.c1.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE t1 = self.c1.transport t2 = self.c2.transport c2 = self.c2 self.c1.close() # release all references to C1, except that held by the transport self.cleanup() gc.collect() # transport should flush last state from C1: pump(t1, t2) assert c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED def test_user_config(self): self.c1.user = "vindaloo" self.c1.password = "secret" self.c1.open() self.pump() self.c2.user = "leela" self.c2.password = "trustno1" self.c2.open() self.pump() assert self.c1.user == "vindaloo", self.c1.user assert self.c1.password == None, self.c1.password assert self.c2.user == "leela", self.c2.user assert self.c2.password == None, self.c2.password class SessionTest(Test): def setUp(self): gc.enable() self.c1, self.c2 = self.connection() self.ssn = self.c1.session() self.c1.open() self.c2.open() def cleanup(self): # release resources created by this class super(SessionTest, self).cleanup() self.c1 = None self.c2 = None self.ssn = None def tearDown(self): self.cleanup() gc.collect() assert not gc.garbage def test_open_close(self): assert self.ssn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.ssn.open() assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT self.pump() assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT ssn = self.c2.session_head(Endpoint.REMOTE_ACTIVE | Endpoint.LOCAL_UNINIT) assert ssn != None assert ssn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT ssn.open() assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT self.pump() assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE ssn.close() assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.pump() assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED self.ssn.close() assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED self.pump() assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_simultaneous_close(self): self.ssn.open() self.pump() ssn = self.c2.session_head(Endpoint.REMOTE_ACTIVE | Endpoint.LOCAL_UNINIT) assert ssn != None ssn.open() self.pump() assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.ssn.close() ssn.close() assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE self.pump() assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_closing_connection(self): self.ssn.open() self.pump() self.c1.close() self.pump() self.ssn.close() self.pump() def test_condition(self): self.ssn.open() self.pump() ssn = self.c2.session_head(Endpoint.REMOTE_ACTIVE | Endpoint.LOCAL_UNINIT) assert ssn != None ssn.open() self.pump() assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE cond = Condition("blah:bleh", "this is a description", {symbol("foo"): "bar"}) self.ssn.condition = cond self.ssn.close() self.pump() assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED rcond = ssn.remote_condition assert rcond == cond, (rcond, cond) def test_cleanup(self): snd, rcv = self.link("test-link") snd.open() rcv.open() self.pump() snd_ssn = snd.session rcv_ssn = rcv.session assert rcv_ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.ssn = None snd_ssn.close() snd_ssn.free() del snd_ssn gc.collect() self.pump() assert rcv_ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED def test_reopen_on_same_session_without_free(self): """ confirm that a link is correctly opened when attaching to a previously closed link *that has not been freed yet* on the same session """ self.ssn.open() self.pump() ssn2 = self.c2.session_head(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE) ssn2.open() self.pump() snd = self.ssn.sender("test-link") rcv = ssn2.receiver("test-link") assert snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT snd.open() rcv.open() self.pump() assert snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE snd.close() rcv.close() self.pump() assert snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED snd = self.ssn.sender("test-link") rcv = ssn2.receiver("test-link") assert snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT snd.open() rcv.open() self.pump() assert snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE def test_set_get_outgoing_window(self): assert self.ssn.outgoing_window == 2147483647 self.ssn.outgoing_window = 1024 assert self.ssn.outgoing_window == 1024 class LinkTest(Test): def setUp(self): gc.enable() self.snd, self.rcv = self.link("test-link") def cleanup(self): # release resources created by this class super(LinkTest, self).cleanup() self.snd = None self.rcv = None def tearDown(self): self.cleanup() gc.collect() assert not gc.garbage, gc.garbage def test_open_close(self): assert self.snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.snd.open() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.pump() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE self.rcv.open() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.pump() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.snd.close() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.pump() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED self.rcv.close() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED self.pump() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_simultaneous_open_close(self): assert self.snd.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT self.snd.open() self.rcv.open() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT self.pump() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.snd.close() self.rcv.close() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE self.pump() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED def test_multiple(self): rcv = self.snd.session.receiver("second-rcv") assert rcv.name == "second-rcv" self.snd.open() rcv.open() self.pump() c2 = self.rcv.session.connection l = c2.link_head(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE) while l: l.open() l = l.next(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE) self.pump() assert self.snd assert rcv self.snd.close() rcv.close() ssn = rcv.session conn = ssn.connection ssn.close() conn.close() self.pump() def test_closing_session(self): self.snd.open() self.rcv.open() ssn1 = self.snd.session self.pump() ssn1.close() self.pump() self.snd.close() self.pump() def test_closing_connection(self): self.snd.open() self.rcv.open() ssn1 = self.snd.session c1 = ssn1.connection self.pump() c1.close() self.pump() self.snd.close() self.pump() def assertEqualTermini(self, t1, t2): assert t1.type == t2.type, (t1.type, t2.type) assert t1.address == t2.address, (t1.address, t2.address) assert t1.durability == t2.durability, (t1.durability, t2.durability) assert t1.expiry_policy == t2.expiry_policy, (t1.expiry_policy, t2.expiry_policy) assert t1.timeout == t2.timeout, (t1.timeout, t2.timeout) assert t1.dynamic == t2.dynamic, (t1.dynamic, t2.dynamic) for attr in ["properties", "capabilities", "outcomes", "filter"]: d1 = getattr(t1, attr) d2 = getattr(t2, attr) assert d1.format() == d2.format(), (attr, d1.format(), d2.format()) def _test_source_target(self, config_source, config_target): if config_source is None: self.snd.source.type = Terminus.UNSPECIFIED else: config_source(self.snd.source) if config_target is None: self.snd.target.type = Terminus.UNSPECIFIED else: config_target(self.snd.target) self.snd.open() self.pump() self.assertEqualTermini(self.rcv.remote_source, self.snd.source) self.assertEqualTermini(self.rcv.remote_target, self.snd.target) self.rcv.target.copy(self.rcv.remote_target) self.rcv.source.copy(self.rcv.remote_source) self.rcv.open() self.pump() self.assertEqualTermini(self.snd.remote_target, self.snd.target) self.assertEqualTermini(self.snd.remote_source, self.snd.source) def test_source_target(self): self._test_source_target(TerminusConfig(address="source"), TerminusConfig(address="target")) def test_source(self): self._test_source_target(TerminusConfig(address="source"), None) def test_target(self): self._test_source_target(None, TerminusConfig(address="target")) def test_coordinator(self): self._test_source_target(None, TerminusConfig(type=Terminus.COORDINATOR)) def test_source_target_full(self): self._test_source_target(TerminusConfig(address="source", timeout=3, dist_mode=Terminus.DIST_MODE_MOVE, filter=[("int", 1), ("symbol", "two"), ("string", "three")], capabilities=["one", "two", "three"]), TerminusConfig(address="source", timeout=7, capabilities=[])) def test_distribution_mode(self): self._test_source_target(TerminusConfig(address="source", dist_mode=Terminus.DIST_MODE_COPY), TerminusConfig(address="target")) assert self.rcv.remote_source.distribution_mode == Terminus.DIST_MODE_COPY assert self.rcv.remote_target.distribution_mode == Terminus.DIST_MODE_UNSPECIFIED def test_dynamic_link(self): self._test_source_target(TerminusConfig(address=None, dynamic=True), None) assert self.rcv.remote_source.dynamic assert self.rcv.remote_source.address is None def test_condition(self): self.snd.open() self.rcv.open() self.pump() assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE cond = Condition("blah:bleh", "this is a description", {symbol("foo"): "bar"}) self.snd.condition = cond self.snd.close() self.pump() assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED rcond = self.rcv.remote_condition assert rcond == cond, (rcond, cond) def test_settle_mode(self): self.snd.snd_settle_mode = Link.SND_UNSETTLED assert self.snd.snd_settle_mode == Link.SND_UNSETTLED self.rcv.rcv_settle_mode = Link.RCV_SECOND assert self.rcv.rcv_settle_mode == Link.RCV_SECOND assert self.snd.remote_rcv_settle_mode != Link.RCV_SECOND assert self.rcv.remote_snd_settle_mode != Link.SND_UNSETTLED self.snd.open() self.rcv.open() self.pump() assert self.snd.remote_rcv_settle_mode == Link.RCV_SECOND assert self.rcv.remote_snd_settle_mode == Link.SND_UNSETTLED def test_max_message_size(self): assert self.snd.max_message_size == 0 assert self.rcv.remote_max_message_size == 0 self.snd.max_message_size = 13579 self.snd.open() self.rcv.open() self.pump() assert self.rcv.remote_max_message_size == 13579 def test_cleanup(self): snd, rcv = self.link("test-link") snd.open() rcv.open() self.pump() assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE snd.close() snd.free() del snd gc.collect() self.pump() assert rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED class TerminusConfig: def __init__(self, type=None, address=None, timeout=None, durability=None, filter=None, capabilities=None, dynamic=False, dist_mode=None): self.address = address self.timeout = timeout self.durability = durability self.filter = filter self.capabilities = capabilities self.dynamic = dynamic self.dist_mode = dist_mode self.type = type def __call__(self, terminus): if self.type is not None: terminus.type = self.type if self.address is not None: terminus.address = self.address if self.timeout is not None: terminus.timeout = self.timeout if self.durability is not None: terminus.durability = self.durability if self.capabilities is not None: terminus.capabilities.put_array(False, Data.SYMBOL) terminus.capabilities.enter() for c in self.capabilities: terminus.capabilities.put_symbol(c) if self.filter is not None: terminus.filter.put_map() terminus.filter.enter() for (t, v) in self.filter: setter = getattr(terminus.filter, "put_%s" % t) setter(v) if self.dynamic: terminus.dynamic = True if self.dist_mode is not None: terminus.distribution_mode = self.dist_mode class TransferTest(Test): def setUp(self): gc.enable() self.snd, self.rcv = self.link("test-link") self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() def cleanup(self): # release resources created by this class super(TransferTest, self).cleanup() self.c1 = None self.c2 = None self.snd = None self.rcv = None def tearDown(self): self.cleanup() gc.collect() assert not gc.garbage def test_work_queue(self): assert self.c1.work_head is None self.snd.delivery("tag") assert self.c1.work_head is None self.rcv.flow(1) self.pump() d = self.c1.work_head assert d is not None tag = d.tag assert tag == "tag", tag assert d.writable n = self.snd.send(str2bin("this is a test")) assert self.snd.advance() assert self.c1.work_head is None self.pump() d = self.c2.work_head assert d.tag == "tag" assert d.readable def test_multiframe(self): self.rcv.flow(1) self.snd.delivery("tag") msg = str2bin("this is a test") n = self.snd.send(msg) assert n == len(msg) self.pump() d = self.rcv.current assert d assert d.tag == "tag", repr(d.tag) assert d.readable binary = self.rcv.recv(1024) assert binary == msg, (binary, msg) binary = self.rcv.recv(1024) assert binary == str2bin("") msg = str2bin("this is more") n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() binary = self.rcv.recv(1024) assert binary == msg, (binary, msg) binary = self.rcv.recv(1024) assert binary is None def test_disposition(self): self.rcv.flow(1) self.pump() sd = self.snd.delivery("tag") msg = str2bin("this is a test") n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() rd = self.rcv.current assert rd is not None assert rd.tag == sd.tag rmsg = self.rcv.recv(1024) assert rmsg == msg rd.update(Delivery.ACCEPTED) self.pump() rdisp = sd.remote_state ldisp = rd.local_state assert rdisp == ldisp == Delivery.ACCEPTED, (rdisp, ldisp) assert sd.updated sd.update(Delivery.ACCEPTED) self.pump() assert sd.local_state == rd.remote_state == Delivery.ACCEPTED sd.settle() def test_delivery_id_ordering(self): self.rcv.flow(1024) self.pump(buffer_size=64*1024) #fill up delivery buffer on sender for m in range(1024): sd = self.snd.delivery("tag%s" % m) msg = ("message %s" % m).encode('ascii') n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump(buffer_size=64*1024) #receive a session-windows worth of messages and accept them for m in range(1024): rd = self.rcv.current assert rd is not None, m assert rd.tag == ("tag%s" % m), (rd.tag, m) msg = self.rcv.recv(1024) assert msg == ("message %s" % m).encode('ascii'), (msg, m) rd.update(Delivery.ACCEPTED) rd.settle() self.pump(buffer_size=64*1024) #add some new deliveries for m in range(1024, 1450): sd = self.snd.delivery("tag%s" % m) msg = ("message %s" % m).encode('ascii') n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() #handle all disposition changes to sent messages d = self.c1.work_head while d: next_d = d.work_next if d.updated: d.update(Delivery.ACCEPTED) d.settle() d = next_d #submit some more deliveries for m in range(1450, 1500): sd = self.snd.delivery("tag%s" % m) msg = ("message %s" % m).encode('ascii') n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump(buffer_size=64*1024) self.rcv.flow(1024) self.pump(buffer_size=64*1024) #verify remaining messages can be received and accepted for m in range(1024, 1500): rd = self.rcv.current assert rd is not None, m assert rd.tag == ("tag%s" % m), (rd.tag, m) msg = self.rcv.recv(1024) assert msg == ("message %s" % m).encode('ascii'), (msg, m) rd.update(Delivery.ACCEPTED) rd.settle() def test_cleanup(self): self.rcv.flow(10) self.pump() for x in range(10): self.snd.delivery("tag%d" % x) msg = str2bin("this is a test") n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.snd.close() self.snd.free() self.snd = None gc.collect() self.pump() for x in range(10): rd = self.rcv.current assert rd is not None assert rd.tag == "tag%d" % x rmsg = self.rcv.recv(1024) assert self.rcv.advance() assert rmsg == msg # close of snd should've settled: assert rd.settled rd.settle() class MaxFrameTransferTest(Test): def setUp(self): pass def cleanup(self): # release resources created by this class super(MaxFrameTransferTest, self).cleanup() self.c1 = None self.c2 = None self.snd = None self.rcv = None def tearDown(self): self.cleanup() def message(self, size): parts = [] for i in range(size): parts.append(str(i)) return "/".join(parts)[:size].encode("utf-8") def testMinFrame(self): """ Configure receiver to support minimum max-frame as defined by AMQP-1.0. Verify transfer of messages larger than 512. """ self.snd, self.rcv = self.link("test-link", max_frame=[0,512]) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() assert self.rcv.session.connection.transport.max_frame_size == 512 assert self.snd.session.connection.transport.remote_max_frame_size == 512 self.rcv.flow(1) self.snd.delivery("tag") msg = self.message(513) n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() binary = self.rcv.recv(513) assert binary == msg binary = self.rcv.recv(1024) assert binary == None def testOddFrame(self): """ Test an odd sized max limit with data that will require multiple frames to be transfered. """ self.snd, self.rcv = self.link("test-link", max_frame=[0,521]) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() assert self.rcv.session.connection.transport.max_frame_size == 521 assert self.snd.session.connection.transport.remote_max_frame_size == 521 self.rcv.flow(2) self.snd.delivery("tag") msg = ("X" * 1699).encode('utf-8') n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() binary = self.rcv.recv(1699) assert binary == msg binary = self.rcv.recv(1024) assert binary == None self.rcv.advance() self.snd.delivery("gat") msg = self.message(1426) n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() binary = self.rcv.recv(1426) assert binary == msg self.pump() binary = self.rcv.recv(1024) assert binary == None def testSendQueuedMultiFrameMessages(self, sendSingleFrameMsg = False): """ Test that multiple queued messages on the same link with multi-frame content are sent correctly. Use an odd max frame size, send enough data to use many. """ self.snd, self.rcv = self.link("test-link", max_frame=[0,517]) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() assert self.rcv.session.connection.transport.max_frame_size == 517 assert self.snd.session.connection.transport.remote_max_frame_size == 517 self.rcv.flow(5) self.pump() # Send a delivery with 5 frames, all bytes as X1234 self.snd.delivery("tag") msg = ("X1234" * 425).encode('utf-8') assert 2125 == len(msg) n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() # Send a delivery with 5 frames, all bytes as Y5678 self.snd.delivery("tag2") msg2 = ("Y5678" * 425).encode('utf-8') assert 2125 == len(msg2) n = self.snd.send(msg2) assert n == len(msg2) assert self.snd.advance() self.pump() if sendSingleFrameMsg: # Send a delivery with 1 frame self.snd.delivery("tag3") msg3 = ("Z").encode('utf-8') assert 1 == len(msg3) n = self.snd.send(msg3) assert n == len(msg3) assert self.snd.advance() self.pump() binary = self.rcv.recv(5000) self.assertEqual(binary, msg) self.rcv.advance() binary2 = self.rcv.recv(5000) self.assertEqual(binary2, msg2) self.rcv.advance() if sendSingleFrameMsg: binary3 = self.rcv.recv(5000) self.assertEqual(binary3, msg3) self.rcv.advance() self.pump() def testSendQueuedMultiFrameMessagesThenSingleFrameMessage(self): self.testSendQueuedMultiFrameMessages(sendSingleFrameMsg = True) def testBigMessage(self): """ Test transferring a big message. """ self.snd, self.rcv = self.link("test-link") self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() self.rcv.flow(2) self.snd.delivery("tag") msg = self.message(1024*256) n = self.snd.send(msg) assert n == len(msg) assert self.snd.advance() self.pump() binary = self.rcv.recv(1024*256) assert binary == msg binary = self.rcv.recv(1024) assert binary == None class IdleTimeoutTest(Test): def setUp(self): pass def cleanup(self): # release resources created by this class super(IdleTimeoutTest, self).cleanup() self.snd = None self.rcv = None self.c1 = None self.c2 = None def tearDown(self): self.cleanup() def message(self, size): parts = [] for i in range(size): parts.append(str(i)) return "/".join(parts)[:size] def testGetSet(self): """ Verify the configuration and negotiation of the idle timeout. """ self.snd, self.rcv = self.link("test-link", idle_timeout=[1.0,2.0]) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() # proton advertises 1/2 the configured timeout to the peer: assert self.rcv.session.connection.transport.idle_timeout == 2.0 assert self.rcv.session.connection.transport.remote_idle_timeout == 0.5 assert self.snd.session.connection.transport.idle_timeout == 1.0 assert self.snd.session.connection.transport.remote_idle_timeout == 1.0 def testTimeout(self): """ Verify the AMQP Connection idle timeout. """ # snd will timeout the Connection if no frame is received within 1000 ticks self.snd, self.rcv = self.link("test-link", idle_timeout=[1.0,0]) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() t_snd = self.snd.session.connection.transport t_rcv = self.rcv.session.connection.transport assert t_rcv.idle_timeout == 0.0 # proton advertises 1/2 the timeout (see spec) assert t_rcv.remote_idle_timeout == 0.5 assert t_snd.idle_timeout == 1.0 assert t_snd.remote_idle_timeout == 0.0 sndr_frames_in = t_snd.frames_input rcvr_frames_out = t_rcv.frames_output # at t+1msec, nothing should happen: clock = 0.001 assert t_snd.tick(clock) == 1.001, "deadline for remote timeout" assert t_rcv.tick(clock) == 0.251, "deadline to send keepalive" self.pump() assert sndr_frames_in == t_snd.frames_input, "unexpected received frame" # at one tick from expected idle frame send, nothing should happen: clock = 0.250 assert t_snd.tick(clock) == 1.001, "deadline for remote timeout" assert t_rcv.tick(clock) == 0.251, "deadline to send keepalive" self.pump() assert sndr_frames_in == t_snd.frames_input, "unexpected received frame" # this should cause rcvr to expire and send a keepalive clock = 0.251 assert t_snd.tick(clock) == 1.001, "deadline for remote timeout" assert t_rcv.tick(clock) == 0.501, "deadline to send keepalive" self.pump() sndr_frames_in += 1 rcvr_frames_out += 1 assert sndr_frames_in == t_snd.frames_input, "unexpected received frame" assert rcvr_frames_out == t_rcv.frames_output, "unexpected frame" # since a keepalive was received, sndr will rebase its clock against this tick: # and the receiver should not change its deadline clock = 0.498 assert t_snd.tick(clock) == 1.498, "deadline for remote timeout" assert t_rcv.tick(clock) == 0.501, "deadline to send keepalive" self.pump() assert sndr_frames_in == t_snd.frames_input, "unexpected received frame" # now expire sndr clock = 1.499 t_snd.tick(clock) self.pump() assert self.c2.state & Endpoint.REMOTE_CLOSED assert self.c2.remote_condition.name == "amqp:resource-limit-exceeded" class CreditTest(Test): def setUp(self): self.snd, self.rcv = self.link("test-link", max_frame=(16*1024, 16*1024)) self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() def cleanup(self): # release resources created by this class super(CreditTest, self).cleanup() self.c1 = None self.snd = None self.c2 = None self.rcv2 = None self.snd2 = None def tearDown(self): self.cleanup() def testCreditSender(self, count=1024): credit = self.snd.credit assert credit == 0, credit self.rcv.flow(10) self.pump() credit = self.snd.credit assert credit == 10, credit self.rcv.flow(count) self.pump() credit = self.snd.credit assert credit == 10 + count, credit def testCreditReceiver(self): self.rcv.flow(10) self.pump() assert self.rcv.credit == 10, self.rcv.credit d = self.snd.delivery("tag") assert d assert self.snd.advance() self.pump() assert self.rcv.credit == 10, self.rcv.credit assert self.rcv.queued == 1, self.rcv.queued c = self.rcv.current assert c.tag == "tag", c.tag assert self.rcv.advance() assert self.rcv.credit == 9, self.rcv.credit assert self.rcv.queued == 0, self.rcv.queued def _testBufferingOnClose(self, a, b): for i in range(10): d = self.snd.delivery("tag-%s" % i) assert d d.settle() self.pump() assert self.snd.queued == 10 endpoints = {"connection": (self.c1, self.c2), "session": (self.snd.session, self.rcv.session), "link": (self.snd, self.rcv)} local_a, remote_a = endpoints[a] local_b, remote_b = endpoints[b] remote_b.close() self.pump() assert local_b.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED local_a.close() self.pump() assert remote_a.state & Endpoint.REMOTE_CLOSED assert self.snd.queued == 10 def testBufferingOnCloseLinkLink(self): self._testBufferingOnClose("link", "link") def testBufferingOnCloseLinkSession(self): self._testBufferingOnClose("link", "session") def testBufferingOnCloseLinkConnection(self): self._testBufferingOnClose("link", "connection") def testBufferingOnCloseSessionLink(self): self._testBufferingOnClose("session", "link") def testBufferingOnCloseSessionSession(self): self._testBufferingOnClose("session", "session") def testBufferingOnCloseSessionConnection(self): self._testBufferingOnClose("session", "connection") def testBufferingOnCloseConnectionLink(self): self._testBufferingOnClose("connection", "link") def testBufferingOnCloseConnectionSession(self): self._testBufferingOnClose("connection", "session") def testBufferingOnCloseConnectionConnection(self): self._testBufferingOnClose("connection", "connection") def testFullDrain(self): assert self.rcv.credit == 0 assert self.snd.credit == 0 self.rcv.drain(10) assert self.rcv.draining() assert self.rcv.credit == 10 assert self.snd.credit == 0 self.pump() assert self.rcv.credit == 10 assert self.snd.credit == 10 assert self.rcv.draining() self.snd.drained() assert self.rcv.credit == 10 assert self.snd.credit == 0 assert self.rcv.draining() self.pump() assert self.rcv.credit == 0 assert self.snd.credit == 0 assert not self.rcv.draining() drained = self.rcv.drained() assert drained == 10, drained def testPartialDrain(self): self.rcv.drain(2) assert self.rcv.draining() self.pump() d = self.snd.delivery("tag") assert d assert self.snd.advance() self.snd.drained() assert self.rcv.draining() self.pump() assert not self.rcv.draining() c = self.rcv.current assert self.rcv.queued == 1, self.rcv.queued assert c.tag == d.tag, c.tag assert self.rcv.advance() assert not self.rcv.current assert self.rcv.credit == 0, self.rcv.credit assert not self.rcv.draining() drained = self.rcv.drained() assert drained == 1, drained def testDrainFlow(self): assert self.rcv.credit == 0 assert self.snd.credit == 0 self.rcv.drain(10) assert self.rcv.credit == 10 assert self.snd.credit == 0 self.pump() assert self.rcv.credit == 10 assert self.snd.credit == 10 self.snd.drained() assert self.rcv.credit == 10 assert self.snd.credit == 0 self.pump() assert self.rcv.credit == 0 assert self.snd.credit == 0 self.rcv.flow(10) assert self.rcv.credit == 10 assert self.snd.credit == 0 self.pump() assert self.rcv.credit == 10 assert self.snd.credit == 10 self.snd.drained() assert self.rcv.credit == 10 assert self.snd.credit == 10 self.pump() assert self.rcv.credit == 10 assert self.snd.credit == 10 drained = self.rcv.drained() assert drained == 10, drained def testNegative(self): assert self.snd.credit == 0 d = self.snd.delivery("tag") assert d assert self.snd.advance() self.pump() assert self.rcv.credit == 0 assert self.rcv.queued == 0 self.rcv.flow(1) assert self.rcv.credit == 1 assert self.rcv.queued == 0 self.pump() assert self.rcv.credit == 1 assert self.rcv.queued == 1, self.rcv.queued c = self.rcv.current assert c assert c.tag == "tag" assert self.rcv.advance() assert self.rcv.credit == 0 assert self.rcv.queued == 0 def testDrainZero(self): assert self.snd.credit == 0 assert self.rcv.credit == 0 assert self.rcv.queued == 0 drained = self.rcv.drained() assert drained == 0 self.rcv.flow(10) self.pump() assert self.snd.credit == 10 assert self.rcv.credit == 10 assert self.rcv.queued == 0 self.snd.drained() self.pump() assert self.snd.credit == 10 assert self.rcv.credit == 10 assert self.rcv.queued == 0 drained = self.rcv.drained() assert drained == 0 self.rcv.drain(0) assert self.snd.credit == 10 assert self.rcv.credit == 10 assert self.rcv.queued == 0 self.pump() assert self.snd.credit == 10 assert self.rcv.credit == 10 assert self.rcv.queued == 0 self.snd.drained() assert self.snd.credit == 0 assert self.rcv.credit == 10 assert self.rcv.queued == 0 drained = self.rcv.drained() assert drained == 0 self.pump() assert self.snd.credit == 0 assert self.rcv.credit == 0 assert self.rcv.queued == 0 drained = self.rcv.drained() assert drained == 10 def testDrainOrder(self): """ Verify drain/drained works regardless of ordering. See PROTON-401 """ assert self.snd.credit == 0 assert self.rcv.credit == 0 assert self.rcv.queued == 0 #self.rcv.session.connection.transport.trace(Transport.TRACE_FRM) #self.snd.session.connection.transport.trace(Transport.TRACE_FRM) ## verify that a sender that has reached the drain state will respond ## promptly to a drain issued by the peer. self.rcv.flow(10) self.pump() assert self.snd.credit == 10, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit sd = self.snd.delivery("tagA") assert sd n = self.snd.send(str2bin("A")) assert n == 1 self.pump() self.snd.advance() # done sending, so signal that we are drained: self.snd.drained() self.pump() assert self.snd.credit == 9, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit self.rcv.drain(0) self.pump() assert self.snd.credit == 9, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit data = self.rcv.recv(10) assert data == str2bin("A"), data self.rcv.advance() self.pump() assert self.snd.credit == 9, self.snd.credit assert self.rcv.credit == 9, self.rcv.credit self.snd.drained() self.pump() assert self.snd.credit == 0, self.snd.credit assert self.rcv.credit == 0, self.rcv.credit # verify that a drain requested by the peer is not "acknowledged" until # after the sender has completed sending its pending messages self.rcv.flow(10) self.pump() assert self.snd.credit == 10, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit sd = self.snd.delivery("tagB") assert sd n = self.snd.send(str2bin("B")) assert n == 1 self.snd.advance() self.pump() assert self.snd.credit == 9, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit self.rcv.drain(0) self.pump() assert self.snd.credit == 9, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit sd = self.snd.delivery("tagC") assert sd n = self.snd.send(str2bin("C")) assert n == 1 self.snd.advance() self.pump() assert self.snd.credit == 8, self.snd.credit assert self.rcv.credit == 10, self.rcv.credit # now that the sender has finished sending everything, it can signal # drained self.snd.drained() self.pump() assert self.snd.credit == 0, self.snd.credit assert self.rcv.credit == 2, self.rcv.credit data = self.rcv.recv(10) assert data == str2bin("B"), data self.rcv.advance() data = self.rcv.recv(10) assert data == str2bin("C"), data self.rcv.advance() self.pump() assert self.snd.credit == 0, self.snd.credit assert self.rcv.credit == 0, self.rcv.credit def testPushback(self, count=10): assert self.snd.credit == 0 assert self.rcv.credit == 0 self.rcv.flow(count) self.pump() for i in range(count): d = self.snd.delivery("tag%s" % i) assert d self.snd.advance() assert self.snd.queued == count assert self.rcv.queued == 0 self.pump() assert self.snd.queued == 0 assert self.rcv.queued == count d = self.snd.delivery("extra") self.snd.advance() assert self.snd.queued == 1 assert self.rcv.queued == count self.pump() assert self.snd.queued == 1 assert self.rcv.queued == count def testHeadOfLineBlocking(self): self.snd2 = self.snd.session.sender("link-2") self.rcv2 = self.rcv.session.receiver("link-2") self.snd2.open() self.rcv2.open() self.pump() assert self.snd2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE assert self.rcv2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE self.rcv.flow(5) self.rcv2.flow(10) self.pump() assert self.snd.credit == 5 assert self.snd2.credit == 10 for i in range(10): tag = "test %d" % i self.snd.delivery( tag ) self.snd.send( tag.encode("ascii") ) assert self.snd.advance() self.snd2.delivery( tag ) self.snd2.send( tag.encode("ascii") ) assert self.snd2.advance() self.pump() for i in range(5): b = self.rcv.recv( 512 ) assert self.rcv.advance() b = self.rcv2.recv( 512 ) assert self.rcv2.advance() for i in range(5): b = self.rcv2.recv( 512 ) assert self.rcv2.advance() class SessionCreditTest(Test): def tearDown(self): self.cleanup() def testBuffering(self, count=32, size=1024, capacity=16*1024, max_frame=1024): snd, rcv = self.link("test-link", max_frame=(max_frame, max_frame)) rcv.session.incoming_capacity = capacity snd.open() rcv.open() rcv.flow(count) self.pump() assert count > 0 total_bytes = count * size assert snd.session.outgoing_bytes == 0, snd.session.outgoing_bytes assert rcv.session.incoming_bytes == 0, rcv.session.incoming_bytes assert snd.queued == 0, snd.queued assert rcv.queued == 0, rcv.queued data = bytes(bytearray(size)) idx = 0 while snd.credit: d = snd.delivery("tag%s" % idx) assert d n = snd.send(data) assert n == size, (n, size) assert snd.advance() self.pump() idx += 1 assert idx == count, (idx, count) assert snd.session.outgoing_bytes < total_bytes, (snd.session.outgoing_bytes, total_bytes) assert rcv.session.incoming_bytes < capacity, (rcv.session.incoming_bytes, capacity) assert snd.session.outgoing_bytes + rcv.session.incoming_bytes == total_bytes, \ (snd.session.outgoing_bytes, rcv.session.incoming_bytes, total_bytes) if snd.session.outgoing_bytes > 0: available = rcv.session.incoming_capacity - rcv.session.incoming_bytes assert available < max_frame, (available, max_frame) for i in range(count): d = rcv.current assert d, i pending = d.pending before = rcv.session.incoming_bytes assert rcv.advance() after = rcv.session.incoming_bytes assert before - after == pending, (before, after, pending) snd_before = snd.session.incoming_bytes self.pump() snd_after = snd.session.incoming_bytes assert rcv.session.incoming_bytes < capacity if snd_before > 0: assert capacity - after <= max_frame assert snd_before > snd_after if snd_after > 0: available = rcv.session.incoming_capacity - rcv.session.incoming_bytes assert available < max_frame, available def testBufferingSize16(self): self.testBuffering(size=16) def testBufferingSize256(self): self.testBuffering(size=256) def testBufferingSize512(self): self.testBuffering(size=512) def testBufferingSize2048(self): self.testBuffering(size=2048) def testBufferingSize1025(self): self.testBuffering(size=1025) def testBufferingSize1023(self): self.testBuffering(size=1023) def testBufferingSize989(self): self.testBuffering(size=989) def testBufferingSize1059(self): self.testBuffering(size=1059) def testCreditWithBuffering(self): snd, rcv = self.link("test-link", max_frame=(1024, 1024)) rcv.session.incoming_capacity = 64*1024 snd.open() rcv.open() rcv.flow(128) self.pump() assert snd.credit == 128, snd.credit assert rcv.queued == 0, rcv.queued idx = 0 while snd.credit: d = snd.delivery("tag%s" % idx) snd.send(("x"*1024).encode('ascii')) assert d assert snd.advance() self.pump() idx += 1 assert idx == 128, idx assert rcv.queued < 128, rcv.queued rcv.flow(1) self.pump() assert snd.credit == 1, snd.credit class SettlementTest(Test): def setUp(self): self.snd, self.rcv = self.link("test-link") self.c1 = self.snd.session.connection self.c2 = self.rcv.session.connection self.snd.open() self.rcv.open() self.pump() def cleanup(self): # release resources created by this class super(SettlementTest, self).cleanup() self.c1 = None self.snd = None self.c2 = None self.rcv2 = None self.snd2 = None def tearDown(self): self.cleanup() def testSettleCurrent(self): self.rcv.flow(10) self.pump() assert self.snd.credit == 10, self.snd.credit d = self.snd.delivery("tag") e = self.snd.delivery("tag2") assert d assert e c = self.snd.current assert c.tag == "tag", c.tag c.settle() c = self.snd.current assert c.tag == "tag2", c.tag c.settle() c = self.snd.current assert not c self.pump() c = self.rcv.current assert c assert c.tag == "tag", c.tag assert c.settled c.settle() c = self.rcv.current assert c assert c.tag == "tag2", c.tag assert c.settled c.settle() c = self.rcv.current assert not c def testUnsettled(self): self.rcv.flow(10) self.pump() assert self.snd.unsettled == 0, self.snd.unsettled assert self.rcv.unsettled == 0, self.rcv.unsettled d = self.snd.delivery("tag") assert d assert self.snd.unsettled == 1, self.snd.unsettled assert self.rcv.unsettled == 0, self.rcv.unsettled assert self.snd.advance() self.pump() assert self.snd.unsettled == 1, self.snd.unsettled assert self.rcv.unsettled == 1, self.rcv.unsettled c = self.rcv.current assert c c.settle() assert self.snd.unsettled == 1, self.snd.unsettled assert self.rcv.unsettled == 0, self.rcv.unsettled def testMultipleUnsettled(self, count=1024, size=1024): self.rcv.flow(count) self.pump() assert self.snd.unsettled == 0, self.snd.unsettled assert self.rcv.unsettled == 0, self.rcv.unsettled unsettled = [] for i in range(count): sd = self.snd.delivery("tag%s" % i) assert sd n = self.snd.send(("x"*size).encode('ascii')) assert n == size, n assert self.snd.advance() self.pump() rd = self.rcv.current assert rd, "did not receive delivery %s" % i n = rd.pending b = self.rcv.recv(n) assert len(b) == n, (b, n) rd.update(Delivery.ACCEPTED) assert self.rcv.advance() self.pump() unsettled.append(rd) assert self.rcv.unsettled == count for rd in unsettled: rd.settle() def testMultipleUnsettled2K1K(self): self.testMultipleUnsettled(2048, 1024) def testMultipleUnsettled4K1K(self): self.testMultipleUnsettled(4096, 1024) def testMultipleUnsettled1K2K(self): self.testMultipleUnsettled(1024, 2048) def testMultipleUnsettled2K2K(self): self.testMultipleUnsettled(2048, 2048) def testMultipleUnsettled4K2K(self): self.testMultipleUnsettled(4096, 2048) class PipelineTest(Test): def setUp(self): self.c1, self.c2 = self.connection() def cleanup(self): # release resources created by this class super(PipelineTest, self).cleanup() self.c1 = None self.c2 = None def tearDown(self): self.cleanup() def test(self): ssn = self.c1.session() snd = ssn.sender("sender") self.c1.open() ssn.open() snd.open() for i in range(10): d = snd.delivery("delivery-%s" % i) snd.send(str2bin("delivery-%s" % i)) d.settle() snd.close() ssn.close() self.c1.close() self.pump() state = self.c2.state assert state == (Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE), "%x" % state ssn2 = self.c2.session_head(Endpoint.LOCAL_UNINIT) assert ssn2 state == ssn2.state assert state == (Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE), "%x" % state rcv = self.c2.link_head(Endpoint.LOCAL_UNINIT) assert rcv state = rcv.state assert state == (Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE), "%x" % state self.c2.open() ssn2.open() rcv.open() rcv.flow(10) assert rcv.queued == 0, rcv.queued self.pump() assert rcv.queued == 10, rcv.queued state = rcv.state assert state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED), "%x" % state state = ssn2.state assert state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED), "%x" % state state = self.c2.state assert state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED), "%x" % state for i in range(rcv.queued): d = rcv.current assert d assert d.tag == "delivery-%s" % i d.settle() assert rcv.queued == 0, rcv.queued class ServerTest(Test): def testKeepalive(self): """ Verify that idle frames are sent to keep a Connection alive """ idle_timeout = self.delay server = common.TestServer() server.start() class Program: def on_reactor_init(self, event): self.conn = event.reactor.connection() self.conn.hostname = "%s:%s" % (server.host, server.port) self.conn.open() self.old_count = None event.reactor.schedule(3 * idle_timeout, self) def on_connection_bound(self, event): event.transport.idle_timeout = idle_timeout def on_connection_remote_open(self, event): self.old_count = event.transport.frames_input def on_timer_task(self, event): assert self.conn.state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE), "Connection terminated" assert self.conn.transport.frames_input > self.old_count, "No idle frames received" self.conn.close() Reactor(Program()).run() server.stop() def testIdleTimeout(self): """ Verify that a Connection is terminated properly when Idle frames do not arrive in a timely manner. """ idle_timeout = self.delay server = common.TestServer(idle_timeout=idle_timeout) server.start() class Program: def on_reactor_init(self, event): self.conn = event.reactor.connection() self.conn.hostname = "%s:%s" % (server.host, server.port) self.conn.open() self.remote_condition = None self.old_count = None # verify the connection stays up even if we don't explicitly send stuff # wait up to 3x the idle timeout event.reactor.schedule(3 * idle_timeout, self) def on_connection_bound(self, event): self.transport = event.transport def on_connection_remote_open(self, event): self.old_count = event.transport.frames_output def on_connection_remote_close(self, event): assert self.conn.remote_condition assert self.conn.remote_condition.name == "amqp:resource-limit-exceeded" self.remote_condition = self.conn.remote_condition def on_timer_task(self, event): assert self.conn.state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE), "Connection terminated" assert self.conn.transport.frames_output > self.old_count, "No idle frames sent" # now wait to explicitly cause the other side to expire: suspend_time = 3 * idle_timeout if os.name=="nt": # On windows, the full delay gets too close to the graceful/hard close tipping point suspend_time = 2.5 * idle_timeout sleep(suspend_time) p = Program() Reactor(p).run() assert p.remote_condition assert p.remote_condition.name == "amqp:resource-limit-exceeded" server.stop() class NoValue: def __init__(self): pass def apply(self, dlv): pass def check(self, dlv): assert dlv.data == None assert dlv.section_number == 0 assert dlv.section_offset == 0 assert dlv.condition == None assert dlv.failed == False assert dlv.undeliverable == False assert dlv.annotations == None class RejectValue: def __init__(self, condition): self.condition = condition def apply(self, dlv): dlv.condition = self.condition def check(self, dlv): assert dlv.data == None, dlv.data assert dlv.section_number == 0 assert dlv.section_offset == 0 assert dlv.condition == self.condition, (dlv.condition, self.condition) assert dlv.failed == False assert dlv.undeliverable == False assert dlv.annotations == None class ReceivedValue: def __init__(self, section_number, section_offset): self.section_number = section_number self.section_offset = section_offset def apply(self, dlv): dlv.section_number = self.section_number dlv.section_offset = self.section_offset def check(self, dlv): assert dlv.data == None, dlv.data assert dlv.section_number == self.section_number, (dlv.section_number, self.section_number) assert dlv.section_offset == self.section_offset assert dlv.condition == None assert dlv.failed == False assert dlv.undeliverable == False assert dlv.annotations == None class ModifiedValue: def __init__(self, failed, undeliverable, annotations): self.failed = failed self.undeliverable = undeliverable self.annotations = annotations def apply(self, dlv): dlv.failed = self.failed dlv.undeliverable = self.undeliverable dlv.annotations = self.annotations def check(self, dlv): assert dlv.data == None, dlv.data assert dlv.section_number == 0 assert dlv.section_offset == 0 assert dlv.condition == None assert dlv.failed == self.failed assert dlv.undeliverable == self.undeliverable assert dlv.annotations == self.annotations, (dlv.annotations, self.annotations) class CustomValue: def __init__(self, data): self.data = data def apply(self, dlv): dlv.data = self.data def check(self, dlv): assert dlv.data == self.data, (dlv.data, self.data) assert dlv.section_number == 0 assert dlv.section_offset == 0 assert dlv.condition == None assert dlv.failed == False assert dlv.undeliverable == False assert dlv.annotations == None class DeliveryTest(Test): def tearDown(self): self.cleanup() def testDisposition(self, count=1, tag="tag%i", type=Delivery.ACCEPTED, value=NoValue()): snd, rcv = self.link("test-link") snd.open() rcv.open() snd_deliveries = [] for i in range(count): d = snd.delivery(tag % i) snd_deliveries.append(d) snd.advance() rcv.flow(count) self.pump() rcv_deliveries = [] for i in range(count): d = rcv.current assert d.tag == (tag % i) rcv_deliveries.append(d) rcv.advance() for d in rcv_deliveries: value.apply(d.local) d.update(type) self.pump() for d in snd_deliveries: assert d.remote_state == type assert d.remote.type == type value.check(d.remote) value.apply(d.local) d.update(type) self.pump() for d in rcv_deliveries: assert d.remote_state == type assert d.remote.type == type value.check(d.remote) for d in snd_deliveries: d.settle() self.pump() for d in rcv_deliveries: assert d.settled, d.settled d.settle() def testReceived(self): self.testDisposition(type=Disposition.RECEIVED, value=ReceivedValue(1, 2)) def testRejected(self): self.testDisposition(type=Disposition.REJECTED, value=RejectValue(Condition(symbol("foo")))) def testReleased(self): self.testDisposition(type=Disposition.RELEASED) def testModified(self): self.testDisposition(type=Disposition.MODIFIED, value=ModifiedValue(failed=True, undeliverable=True, annotations={"key": "value"})) def testCustom(self): self.testDisposition(type=0x12345, value=CustomValue([1, 2, 3])) class CollectorTest(Test): def setUp(self): self.collector = Collector() def drain(self): result = [] while True: e = self.collector.peek() if e: result.append(e) self.collector.pop() else: break return result def expect(self, *types): return self.expect_oneof(types) def expect_oneof(self, *sequences): events = self.drain() types = tuple([e.type for e in events]) for alternative in sequences: if types == alternative: if len(events) == 1: return events[0] elif len(events) > 1: return events else: return assert False, "actual events %s did not match any of the expected sequences: %s" % (events, sequences) def expect_until(self, *types): events = self.drain() etypes = tuple([e.type for e in events[-len(types):]]) assert etypes == types, "actual events %s did not end in expect sequence: %s" % (events, types) class EventTest(CollectorTest): def tearDown(self): self.cleanup() def testEndpointEvents(self): c1, c2 = self.connection() c1.collect(self.collector) self.expect(Event.CONNECTION_INIT) self.pump() self.expect() c2.open() self.pump() self.expect(Event.CONNECTION_REMOTE_OPEN) self.pump() self.expect() ssn = c2.session() snd = ssn.sender("sender") ssn.open() snd.open() self.expect() self.pump() self.expect(Event.SESSION_INIT, Event.SESSION_REMOTE_OPEN, Event.LINK_INIT, Event.LINK_REMOTE_OPEN) c1.open() ssn2 = c1.session() ssn2.open() rcv = ssn2.receiver("receiver") rcv.open() self.pump() self.expect(Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.SESSION_INIT, Event.SESSION_LOCAL_OPEN, Event.TRANSPORT, Event.LINK_INIT, Event.LINK_LOCAL_OPEN, Event.TRANSPORT) rcv.close() self.expect(Event.LINK_LOCAL_CLOSE, Event.TRANSPORT) self.pump() rcv.free() del rcv self.expect(Event.LINK_FINAL) ssn2.free() del ssn2 self.pump() c1.free() c1.transport.unbind() self.expect_oneof((Event.SESSION_FINAL, Event.LINK_FINAL, Event.SESSION_FINAL, Event.CONNECTION_UNBOUND, Event.CONNECTION_FINAL), (Event.CONNECTION_UNBOUND, Event.SESSION_FINAL, Event.LINK_FINAL, Event.SESSION_FINAL, Event.CONNECTION_FINAL)) def testConnectionINIT_FINAL(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) c.free() self.expect(Event.CONNECTION_FINAL) def testSessionINIT_FINAL(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) s = c.session() self.expect(Event.SESSION_INIT) s.free() self.expect(Event.SESSION_FINAL) c.free() self.expect(Event.CONNECTION_FINAL) def testLinkINIT_FINAL(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) s = c.session() self.expect(Event.SESSION_INIT) r = s.receiver("asdf") self.expect(Event.LINK_INIT) r.free() self.expect(Event.LINK_FINAL) c.free() self.expect(Event.SESSION_FINAL, Event.CONNECTION_FINAL) def testFlowEvents(self): snd, rcv = self.link("test-link") snd.session.connection.collect(self.collector) rcv.open() rcv.flow(10) self.pump() self.expect(Event.CONNECTION_INIT, Event.SESSION_INIT, Event.LINK_INIT, Event.LINK_REMOTE_OPEN, Event.LINK_FLOW) rcv.flow(10) self.pump() self.expect(Event.LINK_FLOW) return snd, rcv def testDeliveryEvents(self): snd, rcv = self.link("test-link") rcv.session.connection.collect(self.collector) rcv.open() rcv.flow(10) self.pump() self.expect(Event.CONNECTION_INIT, Event.SESSION_INIT, Event.LINK_INIT, Event.LINK_LOCAL_OPEN, Event.TRANSPORT) snd.delivery("delivery") snd.send(str2bin("Hello World!")) snd.advance() self.pump() self.expect() snd.open() self.pump() self.expect(Event.LINK_REMOTE_OPEN, Event.DELIVERY) rcv.session.connection.transport.unbind() rcv.session.connection.free() self.expect(Event.CONNECTION_UNBOUND, Event.TRANSPORT, Event.LINK_FINAL, Event.SESSION_FINAL, Event.CONNECTION_FINAL) def testDeliveryEventsDisp(self): snd, rcv = self.testFlowEvents() snd.open() dlv = snd.delivery("delivery") snd.send(str2bin("Hello World!")) assert snd.advance() self.expect(Event.LINK_LOCAL_OPEN, Event.TRANSPORT) self.pump() self.expect(Event.LINK_FLOW) rdlv = rcv.current assert rdlv != None assert rdlv.tag == "delivery" rdlv.update(Delivery.ACCEPTED) self.pump() event = self.expect(Event.DELIVERY) assert event.context == dlv, (dlv, event.context) def testConnectionBOUND_UNBOUND(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) t = Transport() t.bind(c) self.expect(Event.CONNECTION_BOUND) t.unbind() self.expect(Event.CONNECTION_UNBOUND, Event.TRANSPORT) def testTransportERROR_CLOSE(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) t = Transport() t.bind(c) self.expect(Event.CONNECTION_BOUND) assert t.condition is None t.push(str2bin("asdf")) self.expect(Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED) assert t.condition is not None assert t.condition.name == "amqp:connection:framing-error" assert "AMQP header mismatch" in t.condition.description p = t.pending() assert p > 0 t.pop(p) self.expect(Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testTransportCLOSED(self): c = Connection() c.collect(self.collector) self.expect(Event.CONNECTION_INIT) t = Transport() t.bind(c) c.open() self.expect(Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT) c2 = Connection() t2 = Transport() t2.bind(c2) c2.open() c2.close() pump(t, t2) self.expect(Event.CONNECTION_REMOTE_OPEN, Event.CONNECTION_REMOTE_CLOSE, Event.TRANSPORT_TAIL_CLOSED) c.close() pump(t, t2) self.expect(Event.CONNECTION_LOCAL_CLOSE, Event.TRANSPORT, Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) def testLinkDetach(self): c1 = Connection() c1.collect(self.collector) t1 = Transport() t1.bind(c1) c1.open() s1 = c1.session() s1.open() l1 = s1.sender("asdf") l1.open() l1.detach() self.expect_until(Event.LINK_LOCAL_DETACH, Event.TRANSPORT) c2 = Connection() c2.collect(self.collector) t2 = Transport() t2.bind(c2) pump(t1, t2) self.expect_until(Event.LINK_REMOTE_DETACH) class PeerTest(CollectorTest): def setUp(self): CollectorTest.setUp(self) self.connection = Connection() self.connection.collect(self.collector) self.transport = Transport() self.transport.bind(self.connection) self.peer = Connection() self.peer_transport = Transport() self.peer_transport.bind(self.peer) self.peer_transport.trace(Transport.TRACE_OFF) def pump(self): pump(self.transport, self.peer_transport) class TeardownLeakTest(PeerTest): def doLeak(self, local, remote): self.connection.open() self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT) ssn = self.connection.session() ssn.open() self.expect(Event.SESSION_INIT, Event.SESSION_LOCAL_OPEN, Event.TRANSPORT) snd = ssn.sender("sender") snd.open() self.expect(Event.LINK_INIT, Event.LINK_LOCAL_OPEN, Event.TRANSPORT) self.pump() self.peer.open() self.peer.session_head(0).open() self.peer.link_head(0).open() self.pump() self.expect_oneof((Event.CONNECTION_REMOTE_OPEN, Event.SESSION_REMOTE_OPEN, Event.LINK_REMOTE_OPEN, Event.LINK_FLOW), (Event.CONNECTION_REMOTE_OPEN, Event.SESSION_REMOTE_OPEN, Event.LINK_REMOTE_OPEN)) if local: snd.close() # ha!! self.expect(Event.LINK_LOCAL_CLOSE, Event.TRANSPORT) ssn.close() self.expect(Event.SESSION_LOCAL_CLOSE, Event.TRANSPORT) self.connection.close() self.expect(Event.CONNECTION_LOCAL_CLOSE, Event.TRANSPORT) if remote: self.peer.link_head(0).close() # ha!! self.peer.session_head(0).close() self.peer.close() self.pump() if remote: self.expect(Event.TRANSPORT_HEAD_CLOSED, Event.LINK_REMOTE_CLOSE, Event.SESSION_REMOTE_CLOSE, Event.CONNECTION_REMOTE_CLOSE, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_CLOSED) else: self.expect(Event.TRANSPORT_HEAD_CLOSED, Event.SESSION_REMOTE_CLOSE, Event.CONNECTION_REMOTE_CLOSE, Event.TRANSPORT_TAIL_CLOSED, Event.TRANSPORT_CLOSED) self.connection.free() self.expect(Event.LINK_FINAL, Event.SESSION_FINAL) self.transport.unbind() self.expect(Event.CONNECTION_UNBOUND, Event.CONNECTION_FINAL) def testLocalRemoteLeak(self): self.doLeak(True, True) def testLocalLeak(self): self.doLeak(True, False) def testRemoteLeak(self): self.doLeak(False, True) def testLeak(self): self.doLeak(False, False) class IdleTimeoutEventTest(PeerTest): def half_pump(self): p = self.transport.pending() if p>0: self.transport.pop(p) def testTimeoutWithZombieServer(self, expectOpenCloseFrames=True): self.transport.idle_timeout = self.delay self.connection.open() self.half_pump() t = time() self.transport.tick(t) self.transport.tick(t + self.delay*4) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND, Event.CONNECTION_LOCAL_OPEN, Event.TRANSPORT, Event.TRANSPORT_ERROR, Event.TRANSPORT_TAIL_CLOSED) assert self.transport.capacity() < 0 if expectOpenCloseFrames: assert self.transport.pending() > 0 self.half_pump() self.expect(Event.TRANSPORT_HEAD_CLOSED, Event.TRANSPORT_CLOSED) assert self.transport.pending() < 0 def testTimeoutWithZombieServerAndSASL(self): sasl = self.transport.sasl() self.testTimeoutWithZombieServer(expectOpenCloseFrames=False) class DeliverySegFaultTest(Test): def testDeliveryAfterUnbind(self): conn = Connection() t = Transport() ssn = conn.session() snd = ssn.sender("sender") dlv = snd.delivery("tag") dlv.settle() del dlv t.bind(conn) t.unbind() dlv = snd.delivery("tag") class SaslEventTest(CollectorTest): def testAnonymousNoInitialResponse(self): conn = Connection() conn.collect(self.collector) transport = Transport(Transport.SERVER) transport.bind(conn) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND) transport.push(str2bin('AMQP\x03\x01\x00\x00\x00\x00\x00 \x02\x01\x00\x00\x00SA' '\xd0\x00\x00\x00\x10\x00\x00\x00\x02\xa3\tANONYMOUS@' 'AMQP\x00\x01\x00\x00')) self.expect(Event.TRANSPORT) for i in range(1024): p = transport.pending() self.drain() p = transport.pending() self.expect() def testPipelinedServerReadFirst(self): conn = Connection() conn.collect(self.collector) transport = Transport(Transport.CLIENT) s = transport.sasl() s.allowed_mechs("ANONYMOUS PLAIN") transport.bind(conn) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND) transport.push(str2bin( # SASL 'AMQP\x03\x01\x00\x00' # @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]] '\x00\x00\x00\x1c\x02\x01\x00\x00\x00S@\xc0\x0f\x01\xe0\x0c\x01\xa3\tANONYMOUS' # @sasl-outcome(68) [code=0] '\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00' # AMQP 'AMQP\x00\x01\x00\x00' )) self.expect(Event.TRANSPORT) p = transport.pending() bytes = transport.peek(p) transport.pop(p) server = Transport(Transport.SERVER) server.push(bytes) assert s.outcome == SASL.OK assert server.sasl().outcome == SASL.OK def testPipelinedServerWriteFirst(self): conn = Connection() conn.collect(self.collector) transport = Transport(Transport.CLIENT) s = transport.sasl() s.allowed_mechs("ANONYMOUS") transport.bind(conn) p = transport.pending() bytes = transport.peek(p) transport.pop(p) self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND) transport.push(str2bin( # SASL 'AMQP\x03\x01\x00\x00' # @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]] '\x00\x00\x00\x1c\x02\x01\x00\x00\x00S@\xc0\x0f\x01\xe0\x0c\x01\xa3\tANONYMOUS' # @sasl-outcome(68) [code=0] '\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00' # AMQP 'AMQP\x00\x01\x00\x00' )) self.expect(Event.TRANSPORT) p = transport.pending() bytes = transport.peek(p) transport.pop(p) assert s.outcome == SASL.OK # XXX: the bytes above appear to be correct, but we don't get any # sort of event indicating that the transport is authenticated qpid-proton-0.22.0/tests/python/proton_tests/common.py0000664000000000000000000004067413257152177020054 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from unittest import TestCase try: from unittest import SkipTest except: try: from unittest2 import SkipTest except: class SkipTest(Exception): pass from random import randint from threading import Thread from socket import socket, AF_INET, SOCK_STREAM from subprocess import Popen,PIPE,STDOUT import sys, os, string, subprocess from proton import Connection, Transport, SASL, Endpoint, Delivery, SSL from proton.reactor import Container from proton.handlers import CHandshaker, CFlowController from string import Template if sys.version_info[0] == 2 and sys.version_info[1] < 6: # this is for compatibility, apparently the version of jython we # use doesn't have the next() builtin. # we should remove this when we upgrade to a python 2.6+ compatible version # of jython #_DEF = object() This causes the test loader to fail (why?) class _dummy(): pass _DEF = _dummy def next(iter, default=_DEF): try: return iter.next() except StopIteration: if default is _DEF: raise else: return default # I may goto hell for this: import __builtin__ __builtin__.__dict__['next'] = next def free_tcp_ports(count=1): """ return a list of 'count' TCP ports that are free to used (ie. unbound) """ retry = 0 ports = [] sockets = [] while len(ports) != count: port = randint(49152, 65535) sockets.append( socket( AF_INET, SOCK_STREAM ) ) try: sockets[-1].bind( ("0.0.0.0", port ) ) ports.append( port ) retry = 0 except: retry += 1 assert retry != 100, "No free sockets available for test!" for s in sockets: s.close() return ports def free_tcp_port(): return free_tcp_ports(1)[0] def pump_uni(src, dst, buffer_size=1024): p = src.pending() c = dst.capacity() if c < 0: if p < 0: return False else: src.close_head() return True if p < 0: dst.close_tail() elif p == 0 or c == 0: return False else: binary = src.peek(min(c, buffer_size)) dst.push(binary) src.pop(len(binary)) return True def pump(transport1, transport2, buffer_size=1024): """ Transfer all pending bytes between two Proton engines by repeatedly calling peek/pop and push. Asserts that each engine accepts some bytes every time (unless it's already closed). """ while (pump_uni(transport1, transport2, buffer_size) or pump_uni(transport2, transport1, buffer_size)): pass def findfileinpath(filename, searchpath): """Find filename in the searchpath return absolute path to the file or None """ paths = searchpath.split(os.pathsep) for path in paths: if os.path.exists(os.path.join(path, filename)): return os.path.abspath(os.path.join(path, filename)) return None def isSSLPresent(): return SSL.present() createdSASLDb = False def _cyrusSetup(conf_dir): """Write out simple SASL config. """ saslpasswd = "" if 'SASLPASSWD' in os.environ: saslpasswd = os.environ['SASLPASSWD'] else: saslpasswd = findfileinpath('saslpasswd2', os.getenv('PATH')) or "" if os.path.exists(saslpasswd): t = Template("""sasldb_path: ${db} mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS """) abs_conf_dir = os.path.abspath(conf_dir) subprocess.call(args=['rm','-rf',abs_conf_dir]) os.mkdir(abs_conf_dir) db = os.path.join(abs_conf_dir,'proton.sasldb') conf = os.path.join(abs_conf_dir,'proton-server.conf') f = open(conf, 'w') f.write(t.substitute(db=db)) f.close() cmd_template = Template("echo password | ${saslpasswd} -c -p -f ${db} -u proton user") cmd = cmd_template.substitute(db=db, saslpasswd=saslpasswd) subprocess.call(args=cmd, shell=True) os.environ['PN_SASL_CONFIG_PATH'] = abs_conf_dir global createdSASLDb createdSASLDb = True # Globally initialize Cyrus SASL configuration if SASL.extended(): _cyrusSetup('sasl_conf') def ensureCanTestExtendedSASL(): if not SASL.extended(): raise Skipped('Extended SASL not supported') if not createdSASLDb: raise Skipped("Can't Test Extended SASL: Couldn't create auth db") class DefaultConfig: defines = {} class Test(TestCase): config = DefaultConfig() def __init__(self, name): super(Test, self).__init__(name) self.name = name def configure(self, config): self.config = config def default(self, name, value, **profiles): default = value profile = self.config.defines.get("profile") if profile: default = profiles.get(profile, default) return self.config.defines.get(name, default) @property def delay(self): return float(self.default("delay", "1", fast="0.1")) @property def timeout(self): return float(self.default("timeout", "60", fast="10")) @property def verbose(self): return int(self.default("verbose", 0)) class Skipped(SkipTest): skipped = True class TestServer(object): """ Base class for creating test-specific message servers. """ def __init__(self, **kwargs): self.args = kwargs self.reactor = Container(self) self.host = "127.0.0.1" self.port = 0 if "host" in kwargs: self.host = kwargs["host"] if "port" in kwargs: self.port = kwargs["port"] self.handlers = [CFlowController(10), CHandshaker()] self.thread = Thread(name="server-thread", target=self.run) self.thread.daemon = True self.running = True self.conditions = [] def start(self): self.reactor.start() retry = 0 if self.port == 0: self.port = str(randint(49152, 65535)) retry = 10 while retry > 0: try: self.acceptor = self.reactor.acceptor(self.host, self.port) break except IOError: self.port = str(randint(49152, 65535)) retry -= 1 assert retry > 0, "No free port for server to listen on!" self.thread.start() def stop(self): self.running = False self.reactor.wakeup() self.thread.join() # Note: all following methods all run under the thread: def run(self): self.reactor.timeout = 3.14159265359 while self.reactor.process(): if not self.running: self.acceptor.close() self.reactor.stop() break def on_connection_bound(self, event): if "idle_timeout" in self.args: event.transport.idle_timeout = self.args["idle_timeout"] def on_connection_local_close(self, event): self.conditions.append(event.connection.condition) def on_delivery(self, event): event.delivery.settle() # # Classes that wrap the messenger applications msgr-send and msgr-recv. # These applications reside in the tests/tools/apps directory # class MessengerApp(object): """ Interface to control a MessengerApp """ def __init__(self): self._cmdline = None # options common to Receivers and Senders: self.ca_db = None self.certificate = None self.privatekey = None self.password = None self._output = None def start(self, verbose=False): """ Begin executing the test """ cmd = self.cmdline() self._verbose = verbose if self._verbose: print("COMMAND='%s'" % str(cmd)) #print("ENV='%s'" % str(os.environ.copy())) try: # Handle python launch by replacing script 'filename' with # 'python abspath-to-filename' in cmdline arg list. if cmd[0].endswith('.py'): foundfile = findfileinpath(cmd[0], os.getenv('PATH')) if foundfile is None: msg = "Unable to locate file '%s' in PATH" % cmd[0] raise Skipped("Skipping test - %s" % msg) del cmd[0:1] cmd.insert(0, foundfile) cmd.insert(0, sys.executable) self._process = Popen(cmd, stdout=PIPE, stderr=STDOUT, bufsize=4096, universal_newlines=True) except OSError: e = sys.exc_info()[1] print("ERROR: '%s'" % e) msg = "Unable to execute command '%s', is it in your PATH?" % cmd[0] # NOTE(flaper87): Skip the test if the command is not found. if e.errno == 2: raise Skipped("Skipping test - %s" % msg) assert False, msg self._ready() # wait for it to initialize def stop(self): """ Signal the client to start clean shutdown """ pass def wait(self): """ Wait for client to complete """ self._output = self._process.communicate() if self._verbose: print("OUTPUT='%s'" % self.stdout()) def status(self): """ Return status from client process """ return self._process.returncode def stdout(self): #self._process.communicate()[0] if not self._output or not self._output[0]: return "*** NO STDOUT ***" return self._output[0] def stderr(self): if not self._output or not self._output[1]: return "*** NO STDERR ***" return self._output[1] def cmdline(self): if not self._cmdline: self._build_command() return self._cmdline def _build_command(self): assert False, "_build_command() needs override" def _ready(self): assert False, "_ready() needs override" def _do_common_options(self): """ Common option handling """ if self.ca_db is not None: self._cmdline.append("-T") self._cmdline.append(str(self.ca_db)) if self.certificate is not None: self._cmdline.append("-C") self._cmdline.append(str(self.certificate)) if self.privatekey is not None: self._cmdline.append("-K") self._cmdline.append(str(self.privatekey)) if self.password is not None: self._cmdline.append("-P") self._cmdline.append("pass:" + str(self.password)) class MessengerSender(MessengerApp): """ Interface to configure a sending MessengerApp """ def __init__(self): MessengerApp.__init__(self) self._command = None # @todo make these properties self.targets = [] self.send_count = None self.msg_size = None self.send_batch = None self.outgoing_window = None self.report_interval = None self.get_reply = False self.timeout = None self.incoming_window = None self.recv_count = None self.name = None # command string? def _build_command(self): self._cmdline = self._command self._do_common_options() assert self.targets, "Missing targets, required for sender!" self._cmdline.append("-a") self._cmdline.append(",".join(self.targets)) if self.send_count is not None: self._cmdline.append("-c") self._cmdline.append(str(self.send_count)) if self.msg_size is not None: self._cmdline.append("-b") self._cmdline.append(str(self.msg_size)) if self.send_batch is not None: self._cmdline.append("-p") self._cmdline.append(str(self.send_batch)) if self.outgoing_window is not None: self._cmdline.append("-w") self._cmdline.append(str(self.outgoing_window)) if self.report_interval is not None: self._cmdline.append("-e") self._cmdline.append(str(self.report_interval)) if self.get_reply: self._cmdline.append("-R") if self.timeout is not None: self._cmdline.append("-t") self._cmdline.append(str(self.timeout)) if self.incoming_window is not None: self._cmdline.append("-W") self._cmdline.append(str(self.incoming_window)) if self.recv_count is not None: self._cmdline.append("-B") self._cmdline.append(str(self.recv_count)) if self.name is not None: self._cmdline.append("-N") self._cmdline.append(str(self.name)) def _ready(self): pass class MessengerReceiver(MessengerApp): """ Interface to configure a receiving MessengerApp """ def __init__(self): MessengerApp.__init__(self) self._command = None # @todo make these properties self.subscriptions = [] self.receive_count = None self.recv_count = None self.incoming_window = None self.timeout = None self.report_interval = None self.send_reply = False self.outgoing_window = None self.forwards = [] self.name = None # command string? def _build_command(self): self._cmdline = self._command self._do_common_options() self._cmdline += ["-X", "READY"] assert self.subscriptions, "Missing subscriptions, required for receiver!" self._cmdline.append("-a") self._cmdline.append(",".join(self.subscriptions)) if self.receive_count is not None: self._cmdline.append("-c") self._cmdline.append(str(self.receive_count)) if self.recv_count is not None: self._cmdline.append("-b") self._cmdline.append(str(self.recv_count)) if self.incoming_window is not None: self._cmdline.append("-w") self._cmdline.append(str(self.incoming_window)) if self.timeout is not None: self._cmdline.append("-t") self._cmdline.append(str(self.timeout)) if self.report_interval is not None: self._cmdline.append("-e") self._cmdline.append(str(self.report_interval)) if self.send_reply: self._cmdline.append("-R") if self.outgoing_window is not None: self._cmdline.append("-W") self._cmdline.append(str(self.outgoing_window)) if self.forwards: self._cmdline.append("-F") self._cmdline.append(",".join(self.forwards)) if self.name is not None: self._cmdline.append("-N") self._cmdline.append(str(self.name)) def _ready(self): """ wait for subscriptions to complete setup. """ r = self._process.stdout.readline() assert r.strip() == "READY", "Unexpected input while waiting for receiver to initialize: %s" % r class MessengerSenderC(MessengerSender): def __init__(self): MessengerSender.__init__(self) self._command = ["msgr-send"] def setup_valgrind(self): if "VALGRIND" not in os.environ: raise Skipped("Skipping test - $VALGRIND not set.") super(type(self), self).__init__() self._command = [os.environ["VALGRIND"]] + os.environ["VALGRIND_ARGS"].split(' ') + self._command class MessengerSenderValgrind(MessengerSenderC): """ Run the C sender under Valgrind """ def __init__(self, suppressions=None): setup_valgrind(self) class MessengerReceiverC(MessengerReceiver): def __init__(self): MessengerReceiver.__init__(self) self._command = ["msgr-recv"] class MessengerReceiverValgrind(MessengerReceiverC): """ Run the C receiver under Valgrind """ def __init__(self, suppressions=None): setup_valgrind(self) class ReactorSenderC(MessengerSender): def __init__(self): MessengerSender.__init__(self) self._command = ["reactor-send"] class ReactorSenderValgrind(ReactorSenderC): """ Run the C sender under Valgrind """ def __init__(self, suppressions=None): setup_valgrind(self) class ReactorReceiverC(MessengerReceiver): def __init__(self): MessengerReceiver.__init__(self) self._command = ["reactor-recv"] class ReactorReceiverValgrind(ReactorReceiverC): """ Run the C receiver under Valgrind """ def __init__(self, suppressions=None): setup_valgrind(self) qpid-proton-0.22.0/tests/python/proton_tests/codec.py0000664000000000000000000003067313257152177017637 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import os, sys from . import common from proton import * from proton._compat import raise_, str2unicode, unichar, str2bin try: from uuid import uuid4 except ImportError: from proton import uuid4 class Test(common.Test): def setUp(self): self.data = Data() def tearDown(self): self.data = None class DataTest(Test): def testTopLevelNext(self): assert self.data.next() is None self.data.put_null() self.data.put_bool(False) self.data.put_int(0) assert self.data.next() is None self.data.rewind() assert self.data.next() == Data.NULL assert self.data.next() == Data.BOOL assert self.data.next() == Data.INT assert self.data.next() is None def testNestedNext(self): assert self.data.next() is None self.data.put_null() assert self.data.next() is None self.data.put_list() assert self.data.next() is None self.data.put_bool(False) assert self.data.next() is None self.data.rewind() assert self.data.next() is Data.NULL assert self.data.next() is Data.LIST self.data.enter() assert self.data.next() is None self.data.put_ubyte(0) assert self.data.next() is None self.data.put_uint(0) assert self.data.next() is None self.data.put_int(0) assert self.data.next() is None self.data.exit() assert self.data.next() is Data.BOOL assert self.data.next() is None self.data.rewind() assert self.data.next() is Data.NULL assert self.data.next() is Data.LIST assert self.data.enter() assert self.data.next() is Data.UBYTE assert self.data.next() is Data.UINT assert self.data.next() is Data.INT assert self.data.next() is None assert self.data.exit() assert self.data.next() is Data.BOOL assert self.data.next() is None def testEnterExit(self): assert self.data.next() is None assert not self.data.enter() self.data.put_list() assert self.data.enter() assert self.data.next() is None self.data.put_list() assert self.data.enter() self.data.put_list() assert self.data.enter() assert self.data.exit() assert self.data.get_list() == 0 assert self.data.exit() assert self.data.get_list() == 1 assert self.data.exit() assert self.data.get_list() == 1 assert not self.data.exit() assert self.data.get_list() == 1 assert self.data.next() is None self.data.rewind() assert self.data.next() is Data.LIST assert self.data.get_list() == 1 assert self.data.enter() assert self.data.next() is Data.LIST assert self.data.get_list() == 1 assert self.data.enter() assert self.data.next() is Data.LIST assert self.data.get_list() == 0 assert self.data.enter() assert self.data.next() is None assert self.data.exit() assert self.data.get_list() == 0 assert self.data.exit() assert self.data.get_list() == 1 assert self.data.exit() assert self.data.get_list() == 1 assert not self.data.exit() def put(self, putter, v): """More informative exception from putters, include bad value""" try: putter(v) except Exception: etype, value, trace = sys.exc_info() raise_(etype, etype("%s(%r): %s" % (putter.__name__, v, value)), trace) return putter # (bits, signed) for each integer type INT_TYPES = { "byte": (8, True), "ubyte": (8, False), "short": (16, True), "ushort": (16, False), "int": (32, True), "uint": (32, False), "long": (64, True), "ulong": (64, False) } def int_values(self, dtype): """Set of test values for integer type dtype, include extreme and medial values""" bits, signed = self.INT_TYPES[dtype] values = [0, 1, 2, 5, 42] if signed: min, max = -2**(bits-1), 2**(bits-1)-1 values.append(max // 2) values += [-i for i in values if i] values += [min, max] else: max = 2**(bits) - 1 values += [max // 2, max] return sorted(values) def _testArray(self, dtype, descriptor, atype, *values): if dtype: dTYPE = getattr(self.data, dtype.upper()) aTYPE = getattr(self.data, atype.upper()) self.data.put_array(dtype is not None, aTYPE) self.data.enter() if dtype is not None: putter = getattr(self.data, "put_%s" % dtype) self.put(putter, descriptor) putter = getattr(self.data, "put_%s" % atype) for v in values: self.put(putter, v) self.data.exit() self.data.rewind() assert self.data.next() == Data.ARRAY count, described, type = self.data.get_array() assert count == len(values), count if dtype is None: assert described == False else: assert described == True assert type == aTYPE, type assert self.data.enter() if described: assert self.data.next() == dTYPE getter = getattr(self.data, "get_%s" % dtype) gotten = getter() assert gotten == descriptor, gotten if values: getter = getattr(self.data, "get_%s" % atype) for v in values: assert self.data.next() == aTYPE gotten = getter() assert gotten == v, gotten assert self.data.next() is None assert self.data.exit() def testStringArray(self): self._testArray(None, None, "string", "one", "two", "three") def testDescribedStringArray(self): self._testArray("symbol", "url", "string", "one", "two", "three") def _test_int_array(self, atype): self._testArray(None, None, atype, *self.int_values(atype)) def testByteArray(self): self._test_int_array("byte") def testUbyteArray(self): self._test_int_array("ubyte") def testShortArray(self): self._test_int_array("short") def testUshortArray(self): self._test_int_array("ushort") def testIntArray(self): self._test_int_array("int") def testUintArray(self): self._test_int_array("uint") def testLongArray(self): self._test_int_array("long") def testUlongArray(self): self._test_int_array("ulong") def testUUIDArray(self): self._testArray(None, None, "uuid", uuid4(), uuid4(), uuid4()) def testEmptyArray(self): self._testArray(None, None, "null") def testDescribedEmptyArray(self): self._testArray("long", 0, "null") def _test(self, dtype, *values, **kwargs): eq=kwargs.get("eq", lambda x, y: x == y) ntype = getattr(Data, dtype.upper()) putter = getattr(self.data, "put_%s" % dtype) getter = getattr(self.data, "get_%s" % dtype) for v in values: self.put(putter, v) gotten = getter() assert eq(gotten, v), (gotten, v) self.data.rewind() for v in values: vtype = self.data.next() assert vtype == ntype, vtype gotten = getter() assert eq(gotten, v), (gotten, v) encoded = self.data.encode() copy = Data(0) while encoded: n = copy.decode(encoded) encoded = encoded[n:] copy.rewind() cgetter = getattr(copy, "get_%s" % dtype) for v in values: vtype = copy.next() assert vtype == ntype, vtype gotten = cgetter() assert eq(gotten, v), (gotten, v) def _test_int(self, itype): self._test(itype, *self.int_values(itype)) def testByte(self): self._test_int("byte") def testUbyte(self): self._test_int("ubyte") def testShort(self): self._test_int("short") def testUshort(self): self._test("ushort") def testInt(self): self._test_int("int") def testUint(self): self._test_int("uint") def testLong(self): self._test_int("long") def testUlong(self): self._test_int("ulong") def testString(self): self._test("string", "one", "two", "three", "this is a test", "") def testFloat(self): # we have to use a special comparison here because python # internally only uses doubles and converting between floats and # doubles is imprecise self._test("float", 0, 1, 2, 3, 0.1, 0.2, 0.3, -1, -2, -3, -0.1, -0.2, -0.3, eq=lambda x, y: x - y < 0.000001) def testDouble(self): self._test("double", 0, 1, 2, 3, 0.1, 0.2, 0.3, -1, -2, -3, -0.1, -0.2, -0.3) def testBinary(self): self._test("binary", str2bin("this"), str2bin("is"), str2bin("a"), str2bin("test"), str2bin("of" "b\x00inary")) def testSymbol(self): self._test("symbol", symbol("this is a symbol test"), symbol("bleh"), symbol("blah")) def testTimestamp(self): self._test("timestamp", timestamp(0), timestamp(12345), timestamp(1000000)) def testChar(self): self._test("char", char('a'), char('b'), char('c'), char(unichar(0x20AC))) def testUUID(self): self._test("uuid", uuid4(), uuid4(), uuid4()) def testDecimal32(self): self._test("decimal32", decimal32(0), decimal32(1), decimal32(2), decimal32(3), decimal32(4), decimal32(2**30)) def testDecimal64(self): self._test("decimal64", decimal64(0), decimal64(1), decimal64(2), decimal64(3), decimal64(4), decimal64(2**60)) def testDecimal128(self): self._test("decimal128", decimal128(str2bin("fdsaasdf;lkjjkl;")), decimal128(str2bin("x"*16))) def testCopy(self): self.data.put_described() self.data.enter() self.data.put_ulong(123) self.data.put_map() self.data.enter() self.data.put_string("pi") self.data.put_double(3.14159265359) dst = Data() dst.copy(self.data) copy = dst.format() orig = self.data.format() assert copy == orig, (copy, orig) def testCopyNested(self): nested = [1, 2, 3, [4, 5, 6], 7, 8, 9] self.data.put_object(nested) dst = Data() dst.copy(self.data) assert dst.format() == self.data.format() def testCopyNestedArray(self): nested = [Array(UNDESCRIBED, Data.LIST, ["first", [Array(UNDESCRIBED, Data.INT, 1,2,3)]], ["second", [Array(UNDESCRIBED, Data.INT, 1,2,3)]], ["third", [Array(UNDESCRIBED, Data.INT, 1,2,3)]], ), "end"] self.data.put_object(nested) dst = Data() dst.copy(self.data) assert dst.format() == self.data.format() def testRoundTrip(self): obj = {symbol("key"): timestamp(1234), ulong(123): "blah", char("c"): "bleh", str2unicode("desc"): Described(symbol("url"), str2unicode("http://example.org")), str2unicode("array"): Array(UNDESCRIBED, Data.INT, 1, 2, 3), str2unicode("list"): [1, 2, 3, None, 4], str2unicode("boolean"): True} self.data.put_object(obj) enc = self.data.encode() data = Data() data.decode(enc) data.rewind() assert data.next() copy = data.get_object() assert copy == obj, (copy, obj) def testBuffer(self): try: self.data.put_object(buffer(str2bin("foo"))) except NameError: # python >= 3.0 does not have `buffer` return data = Data() data.decode(self.data.encode()) data.rewind() assert data.next() assert data.type() == Data.BINARY assert data.get_object() == str2bin("foo") def testMemoryView(self): try: self.data.put_object(memoryview(str2bin("foo"))) except NameError: # python <= 2.6 does not have `memoryview` return data = Data() data.decode(self.data.encode()) data.rewind() assert data.next() assert data.type() == Data.BINARY assert data.get_object() == str2bin("foo") def testLookup(self): obj = {symbol("key"): str2unicode("value"), symbol("pi"): 3.14159, symbol("list"): [1, 2, 3, 4]} self.data.put_object(obj) self.data.rewind() self.data.next() self.data.enter() self.data.narrow() assert self.data.lookup("pi") assert self.data.get_object() == 3.14159 self.data.rewind() assert self.data.lookup("key") assert self.data.get_object() == str2unicode("value") self.data.rewind() assert self.data.lookup("list") assert self.data.get_object() == [1, 2, 3, 4] self.data.widen() self.data.rewind() assert not self.data.lookup("pi") qpid-proton-0.22.0/tests/python/proton_tests/__init__.py0000664000000000000000000000212713257152177020312 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import proton_tests.codec import proton_tests.engine import proton_tests.message import proton_tests.handler import proton_tests.reactor import proton_tests.sasl import proton_tests.transport import proton_tests.ssl import proton_tests.interop import proton_tests.soak import proton_tests.url import proton_tests.utils qpid-proton-0.22.0/tests/python/proton-test0000775000000000000000000004710313257152177015665 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # TODO: summarize, test harness preconditions (e.g. broker is alive) import logging, optparse, os, struct, sys, time, traceback, types, cgi from fnmatch import fnmatchcase as match from getopt import GetoptError from logging import getLogger, StreamHandler, Formatter, Filter, \ WARN, DEBUG, ERROR import unittest from proton_tests.common import SkipTest if sys.version_info[0] == 3: CLASS_TYPES = (type,) else: CLASS_TYPES = (type, types.ClassType) levels = { "DEBUG": DEBUG, "WARN": WARN, "ERROR": ERROR } sorted_levels = [(v, k) for k, v in list(levels.items())] sorted_levels.sort() sorted_levels = [v for k, v in sorted_levels] parser = optparse.OptionParser(usage="usage: %prog [options] PATTERN ...", description="Run tests matching the specified PATTERNs.") parser.add_option("-l", "--list", action="store_true", default=False, help="list tests instead of executing them") parser.add_option("-f", "--log-file", metavar="FILE", help="log output to FILE") parser.add_option("-v", "--log-level", metavar="LEVEL", default="WARN", help="only display log messages of LEVEL or higher severity: " "%s (default %%default)" % ", ".join(sorted_levels)) parser.add_option("-c", "--log-category", metavar="CATEGORY", action="append", dest="log_categories", default=[], help="log only categories matching CATEGORY pattern") parser.add_option("-m", "--module", action="append", default=[], dest="modules", help="add module to test search path") parser.add_option("-i", "--ignore", action="append", default=[], help="ignore tests matching IGNORE pattern") parser.add_option("-I", "--ignore-file", metavar="IFILE", action="append", default=[], help="ignore tests matching patterns in IFILE") parser.add_option("-H", "--halt-on-error", action="store_true", default=False, dest="hoe", help="halt if an error is encountered") parser.add_option("-t", "--time", action="store_true", default=False, help="report timing information on test run") parser.add_option("-D", "--define", metavar="DEFINE", dest="defines", action="append", default=[], help="define test parameters") parser.add_option("-x", "--xml", metavar="XML", dest="xml", help="write test results in Junit style xml suitable for use by CI tools etc") parser.add_option("-a", "--always-colorize", action="store_true", dest="always_colorize", default=False, help="always colorize the test results rather than relying on terminal tty detection. Useful when invoked from Jython/Maven.") parser.add_option("-n", metavar="count", dest="count", type=int, default=1, help="run the tests times") parser.add_option("-b", "--bare", action="store_true", default=False, help="Run bare, i.e. don't capture stack traces. This is useful under Jython as " + "captured stack traces do not include the Java portion of the stack," + "whereas non captured stack traces do.") parser.add_option("-j", "--javatrace", action="store_true", default=False, help="Show the full java stack trace. This disables heuristics to eliminate the " + "jython portion of java stack traces.") class Config: def __init__(self): self.defines = {} self.log_file = None self.log_level = WARN self.log_categories = [] opts, args = parser.parse_args() # Known bad tests, skipped unless specifically matched on the command line known_bad = ["proton_tests.messenger.*"] includes = [] excludes = ["*__*__"] config = Config() list_only = opts.list for d in opts.defines: try: idx = d.index("=") name = d[:idx] value = d[idx+1:] config.defines[name] = value except ValueError: config.defines[d] = None config.log_file = opts.log_file config.log_level = levels[opts.log_level.upper()] config.log_categories = opts.log_categories excludes.extend([v.strip() for v in opts.ignore]) for v in opts.ignore_file: f = open(v) for line in f: line = line.strip() if line.startswith("#"): continue excludes.append(line) f.close() for a in args: includes.append(a.strip()) def is_ignored(path): for p in excludes: if match(path, p): return True return False def is_included(path): if is_ignored(path): return False for p in includes: if match(path, p): return True for p in known_bad: if match(path, p): return False return not includes # If includes is empty, include everything def is_smart(): return sys.stdout.isatty() and os.environ.get("TERM", "dumb") != "dumb" try: import fcntl, termios def width(): if is_smart(): s = struct.pack("HHHH", 0, 0, 0, 0) fd_stdout = sys.stdout.fileno() x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s) rows, cols, xpx, ypx = struct.unpack("HHHH", x) return cols else: try: return int(os.environ.get("COLUMNS", "80")) except ValueError: return 80 WIDTH = width() def resize(sig, frm): global WIDTH WIDTH = width() import signal signal.signal(signal.SIGWINCH, resize) except ImportError: WIDTH = 80 def vt100_attrs(*attrs): return "\x1B[%sm" % ";".join(map(str, attrs)) vt100_reset = vt100_attrs(0) KEYWORDS = {"pass": (32,), "skip": (33,), "fail": (31,), "start": (34,), "total": (34,), "ignored": (33,), "selected": (34,), "elapsed": (34,), "average": (34,)} def colorize_word(word, text=None): if text is None: text = word return colorize(text, *KEYWORDS.get(word, ())) def colorize(text, *attrs): if attrs and (is_smart() or opts.always_colorize): return "%s%s%s" % (vt100_attrs(*attrs), text, vt100_reset) else: return text def indent(text): lines = text.split("\n") return " %s" % "\n ".join(lines) # Write a 'minimal' Junit xml style report file suitable for use by CI tools such as Jenkins. class JunitXmlStyleReporter: def __init__(self, file): self.f = open(file, "w"); def begin(self): self.f.write('\n') self.f.write('\n') def report(self, name, result): parts = name.split(".") method = parts[-1] module = '.'.join(parts[0:-1]) self.f.write('\n' % (module, method, result.time)) if result.failed: escaped_type = cgi.escape(str(result.exception_type)) escaped_message = cgi.escape(str(result.exception_message)) self.f.write('\n' % (escaped_type, escaped_message)) self.f.write('\n') self.f.write('\n') if result.skipped: self.f.write('\n') self.f.write('\n') def end(self): self.f.write('\n') self.f.close() class Interceptor: def __init__(self): self.newline = False self.indent = False self.passthrough = True self.dirty = False self.last = None def begin(self): self.newline = True self.indent = True self.passthrough = False self.dirty = False self.last = None def reset(self): self.newline = False self.indent = False self.passthrough = True class StreamWrapper: def __init__(self, interceptor, stream, prefix=" "): self.interceptor = interceptor self.stream = stream self.prefix = prefix def fileno(self): return self.stream.fileno() def isatty(self): return self.stream.isatty() def write(self, s): if self.interceptor.passthrough: self.stream.write(s) return if s: self.interceptor.dirty = True if self.interceptor.newline: self.interceptor.newline = False self.stream.write(" %s\n" % colorize_word("start")) self.interceptor.indent = True if self.interceptor.indent: self.stream.write(self.prefix) if s.endswith("\n"): s = s.replace("\n", "\n%s" % self.prefix)[:-2] self.interceptor.indent = True else: s = s.replace("\n", "\n%s" % self.prefix) self.interceptor.indent = False self.stream.write(s) if s: self.interceptor.last = s[-1] def flush(self): self.stream.flush() interceptor = Interceptor() out_wrp = StreamWrapper(interceptor, sys.stdout) err_wrp = StreamWrapper(interceptor, sys.stderr) out = sys.stdout err = sys.stderr sys.stdout = out_wrp sys.stderr = err_wrp class PatternFilter(Filter): def __init__(self, *patterns): Filter.__init__(self, patterns) self.patterns = patterns def filter(self, record): if not self.patterns: return True for p in self.patterns: if match(record.name, p): return True return False root = getLogger() handler = StreamHandler(sys.stdout) filter = PatternFilter(*config.log_categories) handler.addFilter(filter) handler.setFormatter(Formatter("%(asctime)s %(levelname)s %(message)s")) root.addHandler(handler) root.setLevel(WARN) log = getLogger("proton.test") PASS = "pass" SKIP = "skip" FAIL = "fail" class Runner: def __init__(self): self.exception = None self.exception_phase_name = None self.skip = False def passed(self): return not self.exception def skipped(self): return self.skip def failed(self): return self.exception and not self.skip def halt(self): """determines if the overall test execution should be allowed to continue to the next phase""" return self.exception or self.skip def run(self, phase_name, phase): """invokes a test-phase method (which can be the test method itself or a setUp/tearDown method). If the method raises an exception the exception is examined to see if the exception should be classified as a 'skipped' test""" # we don't try to catch exceptions for jython because currently a # jython bug will prevent the java portion of the stack being # stored with the exception info in the sys module if opts.bare: phase() else: try: phase() except KeyboardInterrupt: raise except: self.exception_phase_name = phase_name self.exception = sys.exc_info() exception_type = self.exception[0] self.skip = getattr(exception_type, "skipped", False) or issubclass(exception_type, SkipTest) def status(self): if self.passed(): return PASS elif self.skipped(): return SKIP elif self.failed(): return FAIL else: return None def get_formatted_exception_trace(self): if self.exception: if self.skip: # format skipped tests without a traceback output = indent("".join(traceback.format_exception_only(*self.exception[:2]))).rstrip() else: output = "Error during %s:" % self.exception_phase_name lines = traceback.format_exception(*self.exception) val = self.exception[1] reflect = False if val and hasattr(val, "getStackTrace"): jlines = [] for frame in val.getStackTrace(): if reflect and frame.getClassName().startswith("org.python."): # this is a heuristic to eliminate the jython portion of # the java stack trace if not opts.javatrace: break jlines.append(" %s\n" % frame.toString()) if frame.getClassName().startswith("java.lang.reflect"): reflect = True else: reflect = False lines.extend(jlines) output += indent("".join(lines)).rstrip() return output def get_exception_type(self): if self.exception: return self.exception[0] else: return None def get_exception_message(self): if self.exception: return self.exception[1] else: return None ST_WIDTH = 8 def run_test(name, test, config): patterns = filter.patterns level = root.level filter.patterns = config.log_categories root.setLevel(config.log_level) parts = name.split(".") line = None output = "" for part in parts: if line: if len(line) + len(part) >= (WIDTH - ST_WIDTH - 1): output += "%s. \\\n" % line line = " %s" % part else: line = "%s.%s" % (line, part) else: line = part if line: output += "%s %s" % (line, (((WIDTH - ST_WIDTH) - len(line))*".")) sys.stdout.write(output) sys.stdout.flush() interceptor.begin() start = time.time() try: runner = test() finally: interceptor.reset() end = time.time() if interceptor.dirty: if interceptor.last != "\n": sys.stdout.write("\n") sys.stdout.write(output) print(" %s" % colorize_word(runner.status())) if runner.failed() or runner.skipped(): print(runner.get_formatted_exception_trace()) root.setLevel(level) filter.patterns = patterns return TestResult(end - start, runner.passed(), runner.skipped(), runner.failed(), runner.get_exception_type(), runner.get_exception_message(), runner.get_formatted_exception_trace()) class TestResult: def __init__(self, time, passed, skipped, failed, exception_type, exception_message, formatted_exception_trace): self.time = time self.passed = passed self.skipped = skipped self.failed = failed self.exception_type = exception_type self.exception_message = exception_message self.formatted_exception_trace = formatted_exception_trace class FunctionTest: def __init__(self, test): self.test = test def name(self): return "%s.%s" % (self.test.__module__, self.test.__name__) def run(self): return run_test(self.name(), self._run, config) def _run(self): runner = Runner() runner.run("test", lambda: self.test(config)) return runner def __repr__(self): return "FunctionTest(%r)" % self.test class MethodTest: def __init__(self, cls, method): self.cls = cls self.method = method def name(self): return "%s.%s.%s" % (self.cls.__module__, self.cls.__name__, self.method) def run(self): return run_test(self.name(), self._run, config) def _run(self): runner = Runner() inst = self.cls(self.method) test = getattr(inst, self.method) if hasattr(inst, "configure"): runner.run("configure", lambda: inst.configure(config)) if runner.halt(): return runner if hasattr(inst, "setUp"): runner.run("setup", inst.setUp) if runner.halt(): return runner runner.run("test", test) if hasattr(inst, "tearDown"): runner.run("teardown", inst.tearDown) return runner def __repr__(self): return "MethodTest(%r, %r)" % (self.cls, self.method) class PatternMatcher: def __init__(self, *patterns): self.patterns = patterns def matches(self, name): for p in self.patterns: if match(name, p): return True return False class FunctionScanner(PatternMatcher): def inspect(self, obj): return type(obj) == types.FunctionType and self.matches(obj.__name__) def descend(self, func): # the None is required for older versions of python return; yield None def extract(self, func): yield FunctionTest(func) class ClassScanner(PatternMatcher): def inspect(self, obj): return type(obj) in CLASS_TYPES and self.matches(obj.__name__) def descend(self, cls): # the None is required for older versions of python return; yield None def extract(self, cls): names = dir(cls) names.sort() for name in names: obj = getattr(cls, name) if hasattr(obj, '__call__') and name.startswith("test"): yield MethodTest(cls, name) class ModuleScanner: def inspect(self, obj): return type(obj) == types.ModuleType def descend(self, obj): names = dir(obj) names.sort() for name in names: yield getattr(obj, name) def extract(self, obj): # the None is required for older versions of python return; yield None class Harness: def __init__(self): self.scanners = [ ModuleScanner(), ClassScanner("*Test", "*Tests", "*TestCase"), FunctionScanner("test_*") ] self.tests = [] self.scanned = [] def scan(self, *roots): objects = list(roots) while objects: obj = objects.pop(0) for s in self.scanners: if s.inspect(obj): self.tests.extend(s.extract(obj)) for child in s.descend(obj): if not (child in self.scanned or child in objects): objects.append(child) self.scanned.append(obj) modules = opts.modules if not modules: modules.extend(["proton_tests"]) h = Harness() for name in modules: m = __import__(name, None, None, ["dummy"]) h.scan(m) filtered = [t for t in h.tests if is_included(t.name())] ignored = [t for t in h.tests if is_ignored(t.name())] total = len(filtered) + len(ignored) if opts.xml and not list_only: xmlr = JunitXmlStyleReporter(opts.xml); xmlr.begin(); else: xmlr = None def runthrough(): passed = 0 failed = 0 skipped = 0 start = time.time() for t in filtered: if list_only: print(t.name()) else: st = t.run() if xmlr: xmlr.report(t.name(), st) if st.passed: passed += 1 elif st.skipped: skipped += 1 elif st.failed: failed += 1 if opts.hoe: break end = time.time() run = passed + failed if not list_only: if passed: _pass = "pass" else: _pass = "fail" if failed: outcome = "fail" else: outcome = "pass" if ignored: ign = "ignored" else: ign = "pass" if skipped: skip = "skip" else: skip = "pass" sys.stdout.write(colorize("Totals: ", 1)) totals = [colorize_word("total", "%s tests" % total), colorize_word(_pass, "%s passed" % passed), colorize_word(skip, "%s skipped" % skipped), colorize_word(ign, "%s ignored" % len(ignored)), colorize_word(outcome, "%s failed" % failed)] sys.stdout.write(", ".join(totals)) if opts.hoe and failed > 0: print(" -- (halted after %s)" % run) else: print("") if opts.time and run > 0: sys.stdout.write(colorize("Timing:", 1)) timing = [colorize_word("elapsed", "%.2fs elapsed" % (end - start)), colorize_word("average", "%.2fs average" % ((end - start)/run))] print(", ".join(timing)) if xmlr: xmlr.end() return failed limit = opts.count count = 0 failures = False while limit == 0 or count < limit: count += 1 if runthrough(): failures = True if count > 1: print(" -- (failures after %s runthroughs)" % count) else: continue if failures: sys.exit(1) else: sys.exit(0) qpid-proton-0.22.0/tests/python/interop-generate0000775000000000000000000000632713257152177016642 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Generate encoded AMQP fragments for interop testing. import logging, optparse, os, struct, sys, time, traceback, types, cgi from proton import * def main(argv): def write(data, filename): f = open(filename+".amqp", 'w') f.write(data.encode()) f.close() # message m = Message() d = Data() d.put_string("hello") m.body = d.encode() write(m, "message") # null d = Data() d.put_null() write(d, "null") # primitive types d = Data() d.put_bool(True) d.put_bool(False) d.put_ubyte(42) d.put_ushort(42) d.put_short(-42) d.put_uint(12345) d.put_int(-12345) d.put_ulong(12345) d.put_long(-12345) d.put_float(0.125) d.put_double(0.125) write(d, "primitives") # string types d = Data() d.put_binary("abc\0defg") d.put_string("abcdefg") d.put_symbol("abcdefg") d.put_binary("") d.put_string("") d.put_symbol("") write(d, "strings") # described types d = Data() d.put_described() d.enter() d.put_symbol("foo-descriptor") d.put_string("foo-value") d.exit() d.put_described() d.enter() d.put_int(12) d.put_int(13) d.exit() write(d, "described") # described array d = Data() d.put_array(True, Data.INT) d.enter() d.put_symbol("int-array") for i in xrange(0,10): d.put_int(i) d.exit() write(d, "described_array") # Arrays # Integer array d = Data() d.put_array(False, Data.INT) d.enter() for i in xrange(0,100): d.put_int(i) d.exit() # String array d.put_array(False, Data.STRING) d.enter() for i in ["a", "b", "c"]: d.put_string(i) d.exit() # empty array d.put_array(False, Data.INT) write(d, "arrays") # List - mixed types d = Data() d.put_list() d.enter() d.put_int(32) d.put_string("foo") d.put_bool(True) d.exit() d.put_list() # Empty list write(d, "lists") # Maps d = Data() d.put_map() d.enter() for k,v in {"one":1, "two":2, "three":3}.items(): d.put_string(k) d.put_int(v) d.exit() d.put_map() d.enter() for k,v in {1:"one", 2:"two", 3:"three"}.items(): d.put_int(k) d.put_string(v) d.exit() d.put_map() # Empty map write(d, "maps") return 0 if __name__ == "__main__": sys.exit(main(sys.argv)) qpid-proton-0.22.0/tests/interop/0000775000000000000000000000000013257152177013573 5ustar qpid-proton-0.22.0/tests/interop/strings.amqp0000664000000000000000000000004213257152177016140 0ustar  abcdefg¡abcdefg£abcdefg ¡£qpid-proton-0.22.0/tests/interop/primitives.amqp0000664000000000000000000000006413257152177016646 0ustar ABP*`*aÿÖp09qÿÿÏÇ€09ÿÿÿÿÿÿÏÇr>‚?Àqpid-proton-0.22.0/tests/interop/null.amqp0000664000000000000000000000000113257152177015414 0ustar @qpid-proton-0.22.0/tests/interop/message.amqp0000664000000000000000000000011113257152177016070 0ustar SpÐ BP@BRSsÐ" @@@@@@@@ƒƒ@R@Sw ¡helloqpid-proton-0.22.0/tests/interop/maps.amqp0000664000000000000000000000011113257152177015404 0ustar Ñ¡threeT¡twoT¡oneTÑT¡oneT¡twoT¡threeÑqpid-proton-0.22.0/tests/interop/lists.amqp0000664000000000000000000000002213257152177015603 0ustar Ð T ¡fooAEqpid-proton-0.22.0/tests/interop/described_array.amqp0000664000000000000000000000007613257152177017600 0ustar ð9 £ int-arrayq qpid-proton-0.22.0/tests/interop/described.amqp0000664000000000000000000000004113257152177016372 0ustar £foo-descriptor¡ foo-valueT T qpid-proton-0.22.0/tests/interop/arrays.amqp0000664000000000000000000000067513257152177015764 0ustar ð•dq  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcð±abcðqqpid-proton-0.22.0/qpid-proton-cpp.syms0000664000000000000000000006265113257152177014734 0ustar # XXX acceptor symbols, but not connector? proton::acceptor::close() proton::acceptor::connection_options() proton::condition::description() const proton::condition::empty() const proton::condition::info() const proton::condition::name() const proton::condition::operator!() const proton::condition::what() const proton::connection::close() proton::connection::container() const proton::connection::container_id() const proton::connection::default_session() proton::connection::host(std::string const&) proton::connection::host() const proton::connection::links() const proton::connection::local_condition() const proton::connection::open() proton::connection::open_receiver(std::string const&, proton::link_options const&) proton::connection::open_sender(std::string const&, proton::link_options const&) proton::connection::open_session() proton::connection::password(std::string const&) proton::connection::release() proton::connection::remote_condition() const proton::connection::sessions() const proton::connection::state() const proton::connection::transport() const proton::connection::user(std::string const&) proton::connection::~connection() proton::connection_driver::can_read() const proton::connection_driver::can_write() const proton::connection_driver::closed() const proton::connection_driver::connection() const proton::connection_driver::connection_driver(proton::handler&, proton::connection_options const&) proton::connection_driver::container::container(std::string const&) proton::connection_driver::container::id() const proton::connection_driver::container::make_options() proton::connection_driver::container::options(proton::connection_options const&) proton::connection_driver::container::~container() proton::connection_driver::dispatch() proton::connection_driver::io_error::io_error(std::string const&) proton::connection_driver::io_error::~io_error() proton::connection_driver::no_opts proton::connection_driver::process(int) proton::connection_driver::try_read() proton::connection_driver::try_write() proton::connection_driver::~connection_driver() proton::connection_options::connection_options() proton::connection_options::connection_options(proton::connection_options const&) proton::connection_options::container_id(std::string const&) proton::connection_options::handler(proton::handler*) proton::connection_options::heartbeat(proton::duration) proton::connection_options::idle_timeout(proton::duration) proton::connection_options::link_prefix(std::string const&) proton::connection_options::max_channels(unsigned short) proton::connection_options::max_frame_size(unsigned int) proton::connection_options::operator=(proton::connection_options const&) proton::connection_options::override(proton::connection_options const&) proton::connection_options::reconnect(proton::reconnect_timer const&) proton::connection_options::sasl_allow_insecure_mechs(bool) proton::connection_options::sasl_allowed_mechs(std::string const&) proton::connection_options::sasl_config_name(std::string const&) proton::connection_options::sasl_config_path(std::string const&) proton::connection_options::sasl_enabled(bool) proton::connection_options::ssl_client_options(proton::ssl_client_options const&) proton::connection_options::ssl_server_options(proton::ssl_server_options const&) proton::connection_options::~connection_options() proton::container::client_connection_options(proton::connection_options const&) proton::container::connect(proton::url const&, proton::connection_options const&) proton::container::container(proton::handler&, std::string const&) proton::container::container(std::string const&) proton::container::id() const proton::container::listen(proton::url const&, proton::connection_options const&) proton::container::open_receiver(proton::url const&, proton::link_options const&, proton::connection_options const&) proton::container::open_sender(proton::url const&, proton::link_options const&, proton::connection_options const&) proton::container::run() proton::container::schedule(int, proton::handler*) proton::container::server_connection_options(proton::connection_options const&) proton::container::~container() proton::conversion_error::conversion_error(std::string const&) proton::conversion_error::~conversion_error() proton::delivery::clear() proton::delivery::link() const proton::delivery::partial() const proton::delivery::pending() const proton::delivery::readable() const proton::delivery::remote_state() const proton::delivery::settle() proton::delivery::settle(proton::delivery::state) proton::delivery::settled() const proton::delivery::update(proton::delivery::state) proton::delivery::updated() const proton::delivery::writable() const proton::duration::FOREVER proton::duration::IMMEDIATE proton::duration::MINUTE proton::duration::SECOND proton::endpoint::LOCAL_ACTIVE proton::endpoint::LOCAL_CLOSED proton::endpoint::LOCAL_MASK proton::endpoint::LOCAL_UNINIT proton::endpoint::REMOTE_ACTIVE proton::endpoint::REMOTE_CLOSED proton::endpoint::REMOTE_MASK proton::endpoint::REMOTE_UNINIT proton::endpoint::~endpoint() proton::error::error(std::string const&) proton::error::~error() proton::handler::handler(int, bool, bool, bool) # XXX Do these default implementations actually need to be exported? # The API user never uses them directly he only overrides virtuals proton::handler::on_connection_close(proton::event&) proton::handler::on_connection_error(proton::event&) proton::handler::on_connection_open(proton::event&) proton::handler::on_delivery_accept(proton::event&) proton::handler::on_delivery_reject(proton::event&) proton::handler::on_delivery_release(proton::event&) proton::handler::on_delivery_settle(proton::event&) proton::handler::on_link_close(proton::event&) proton::handler::on_link_error(proton::event&) proton::handler::on_link_open(proton::event&) proton::handler::on_message(proton::event&) proton::handler::on_sendable(proton::event&) proton::handler::on_session_close(proton::event&) proton::handler::on_session_error(proton::event&) proton::handler::on_session_open(proton::event&) proton::handler::on_start(proton::event&) proton::handler::on_timer(proton::event&) proton::handler::on_transport_close(proton::event&) proton::handler::on_transport_error(proton::event&) proton::handler::on_unhandled(proton::event&) proton::handler::on_unhandled_error(proton::event&, proton::condition const&) proton::handler::~handler() # XXX I wonder how much of these internal symbols can just not be exported proton::internal::assert_map_scope(proton::internal::scope const&) proton::internal::data::append(proton::internal::data) proton::internal::data::appendn(proton::internal::data, int) proton::internal::data::clear() proton::internal::data::copy(proton::internal::data const&) proton::internal::data::create() proton::internal::data::decoder() proton::internal::data::empty() const proton::internal::data::encoder() proton::internal::data::equal(proton::internal::data const&) const proton::internal::data::less(proton::internal::data const&) const proton::internal::data::narrow() proton::internal::data::next() const proton::internal::data::point() const proton::internal::data::restore(unsigned long) proton::internal::data::type() const proton::internal::data::widen() proton::internal::decoder::backup() proton::internal::decoder::check_type(proton::type_id) proton::internal::decoder::decode(char const*, unsigned long) proton::internal::decoder::decode(std::string const&) proton::internal::decoder::more() const proton::internal::decoder::operator>>(bool&) proton::internal::decoder::operator>>(double&) proton::internal::decoder::operator>>(float&) proton::internal::decoder::operator>>(int&) proton::internal::decoder::operator>>(long&) proton::internal::decoder::operator>>(proton::annotation_key&) proton::internal::decoder::operator>>(proton::decimal128&) proton::internal::decoder::operator>>(proton::decimal32&) proton::internal::decoder::operator>>(proton::decimal64&) proton::internal::decoder::operator>>(proton::internal::assert_type) proton::internal::decoder::operator>>(proton::internal::finish) proton::internal::decoder::operator>>(proton::internal::rewind) proton::internal::decoder::operator>>(proton::internal::skip) proton::internal::decoder::operator>>(proton::internal::start&) proton::internal::decoder::operator>>(proton::message_id&) proton::internal::decoder::operator>>(proton::scalar&) proton::internal::decoder::operator>>(proton::timestamp&) proton::internal::decoder::operator>>(proton::uuid&) proton::internal::decoder::operator>>(proton::value&) proton::internal::decoder::operator>>(short&) proton::internal::decoder::operator>>(signed char&) proton::internal::decoder::operator>>(std::string&) proton::internal::decoder::operator>>(unsigned char&) proton::internal::decoder::operator>>(unsigned int&) proton::internal::decoder::operator>>(unsigned long&) proton::internal::decoder::operator>>(unsigned short&) proton::internal::decoder::operator>>(wchar_t&) proton::internal::decoder::rewind() proton::internal::decoder::skip() proton::internal::decoder::type() const proton::internal::encoder::encode(char*, unsigned long&) proton::internal::encoder::encode(std::string&) proton::internal::encoder::encode() proton::internal::encoder::insert(proton::value const&) proton::internal::encoder::operator<<(bool) proton::internal::encoder::operator<<(double) proton::internal::encoder::operator<<(float) proton::internal::encoder::operator<<(int) proton::internal::encoder::operator<<(long) proton::internal::encoder::operator<<(proton::binary const&) proton::internal::encoder::operator<<(proton::decimal128) proton::internal::encoder::operator<<(proton::decimal32) proton::internal::encoder::operator<<(proton::decimal64) proton::internal::encoder::operator<<(proton::internal::finish const&) proton::internal::encoder::operator<<(proton::internal::start const&) proton::internal::encoder::operator<<(proton::scalar const&) proton::internal::encoder::operator<<(proton::symbol const&) proton::internal::encoder::operator<<(proton::timestamp) proton::internal::encoder::operator<<(proton::uuid const&) proton::internal::encoder::operator<<(short) proton::internal::encoder::operator<<(signed char) proton::internal::encoder::operator<<(std::string const&) proton::internal::encoder::operator<<(unsigned char) proton::internal::encoder::operator<<(unsigned int) proton::internal::encoder::operator<<(unsigned long) proton::internal::encoder::operator<<(unsigned short) proton::internal::encoder::operator<<(wchar_t) proton::internal::operator<<(std::ostream&, proton::internal::data const&) proton::internal::operator<<(std::ostream&, proton::internal::encoder const&) proton::internal::pn_ptr_base::decref(void*) proton::internal::pn_ptr_base::incref(void*) proton::internal::ssl_domain::operator=(proton::internal::ssl_domain const&) proton::internal::ssl_domain::ssl_domain(proton::internal::ssl_domain const&) proton::internal::ssl_domain::~ssl_domain() proton::internal::start::array(proton::type_id, bool) proton::internal::start::described() proton::internal::start::list() proton::internal::start::map() proton::internal::start::start(proton::type_id, proton::type_id, bool, unsigned long) # XXX Not sure how much of this should be exposed proton::io::INVALID_DESCRIPTOR proton::io::connect(proton::url const&) proton::io::error_str() proton::io::finalize() proton::io::initialize() proton::io::listener::accept(std::string&, std::string&) proton::io::listener::listener(std::string const&, std::string const&) proton::io::listener::~listener() proton::io::socket_engine::io_close() proton::io::socket_engine::io_read(char*, unsigned long) proton::io::socket_engine::io_write(char const*, unsigned long) proton::io::socket_engine::run() proton::io::socket_engine::socket_engine(long, proton::handler&, proton::connection_options const&) proton::io::socket_engine::socket_engine(proton::url const&, proton::handler&, proton::connection_options const&) proton::io::socket_engine::~socket_engine() proton::link::advance() proton::link::close() proton::link::connection() const proton::link::credit() const proton::link::detach() proton::link::detach_handler() proton::link::drained() proton::link::handler(proton::proton_handler&) proton::link::local_condition() const proton::link::local_source() const proton::link::local_target() const proton::link::name() const proton::link::open(proton::link_options const&) proton::link::queued() proton::link::receiver() proton::link::receiver() const proton::link::receiver_settle_mode() proton::link::receiver_settle_mode(proton::link_options::receiver_settle_mode) proton::link::recv(char*, unsigned long) proton::link::remote_condition() const proton::link::remote_receiver_settle_mode() proton::link::remote_sender_settle_mode() proton::link::remote_source() const proton::link::remote_target() const proton::link::sender() proton::link::sender() const proton::link::sender_settle_mode() proton::link::sender_settle_mode(proton::link_options::sender_settle_mode) proton::link::session() const proton::link::state() const proton::link::unsettled() proton::link::~link() proton::link_iterator::operator++() proton::link_options::browsing(bool) proton::link_options::delivery_mode(proton::link_options::delivery_mode) proton::link_options::distribution_mode(proton::terminus::distribution_mode) proton::link_options::durable_subscription(bool) proton::link_options::dynamic_address(bool) proton::link_options::handler(proton::handler*) proton::link_options::lifetime_policy(proton::link_options::lifetime_policy) proton::link_options::link_options() proton::link_options::link_options(proton::link_options const&) proton::link_options::local_address(std::string const&) proton::link_options::operator=(proton::link_options const&) proton::link_options::override(proton::link_options const&) proton::link_options::selector(std::string const&) proton::link_options::~link_options() proton::message::address(std::string const&) proton::message::address() const proton::message::application_properties() proton::message::application_properties() const proton::message::body() proton::message::body() const proton::message::clear() proton::message::content_encoding(std::string const&) proton::message::content_encoding() const proton::message::content_type(std::string const&) proton::message::content_type() const proton::message::correlation_id() const proton::message::correlation_id(proton::message_id const&) proton::message::creation_time() const proton::message::creation_time(proton::timestamp) proton::message::decode(std::vector > const&) proton::message::delivery_annotations() proton::message::delivery_annotations() const proton::message::delivery_count() const proton::message::delivery_count(unsigned int) proton::message::durable() const proton::message::durable(bool) proton::message::encode() const proton::message::encode(std::vector >&) const proton::message::expiry_time() const proton::message::expiry_time(proton::timestamp) proton::message::first_acquirer() const proton::message::first_acquirer(bool) proton::message::group_id(std::string const&) proton::message::group_id() const proton::message::group_sequence() const proton::message::group_sequence(int) proton::message::id() const proton::message::id(proton::message_id const&) proton::message::inferred() const proton::message::inferred(bool) proton::message::message() proton::message::message(proton::message const&) proton::message::message_annotations() proton::message::message_annotations() const proton::message::operator=(proton::message const&) proton::message::priority() const proton::message::priority(unsigned char) proton::message::reply_to(std::string const&) proton::message::reply_to() const proton::message::reply_to_group_id(std::string const&) proton::message::reply_to_group_id() const proton::message::subject(std::string const&) proton::message::subject() const proton::message::ttl() const proton::message::ttl(proton::duration) proton::message::user_id(std::string const&) proton::message::user_id() const proton::message::~message() proton::operator<(proton::scalar const&, proton::scalar const&) proton::operator<(proton::value const&, proton::value const&) proton::operator<<(std::ostream&, proton::decimal128 const&) proton::operator<<(std::ostream&, proton::decimal32 const&) proton::operator<<(std::ostream&, proton::decimal64 const&) proton::operator<<(std::ostream&, proton::duration) proton::operator<<(std::ostream&, proton::scalar const&) proton::operator<<(std::ostream&, proton::timestamp) proton::operator<<(std::ostream&, proton::type_id) proton::operator<<(std::ostream&, proton::url const&) proton::operator<<(std::ostream&, proton::uuid const&) proton::operator<<(std::ostream&, proton::value const&) proton::operator==(proton::scalar const&, proton::scalar const&) proton::operator==(proton::value const&, proton::value const&) proton::operator>>(std::istream&, proton::url&) proton::receiver::flow(int) proton::receiver::~receiver() proton::reconnect_timer::next_delay(proton::timestamp) proton::reconnect_timer::reconnect_timer(unsigned int, int, unsigned int, bool, int, int) proton::reconnect_timer::reset() proton::sasl::allow_insecure_mechs() proton::sasl::allow_insecure_mechs(bool) proton::sasl::allowed_mechs(std::string const&) proton::sasl::config_name(std::string const&) proton::sasl::config_path(std::string const&) proton::sasl::done(proton::sasl::outcome) proton::sasl::extended() proton::sasl::mech() const proton::sasl::outcome() const proton::sasl::user() const proton::scalar::as_double() const proton::scalar::as_int() const proton::scalar::as_string() const proton::scalar::as_uint() const proton::scalar::empty() const proton::scalar::get(bool&) const proton::scalar::get(double&) const proton::scalar::get(float&) const proton::scalar::get(int&) const proton::scalar::get(long&) const proton::scalar::get(proton::binary&) const proton::scalar::get(proton::decimal128&) const proton::scalar::get(proton::decimal32&) const proton::scalar::get(proton::decimal64&) const proton::scalar::get(proton::symbol&) const proton::scalar::get(proton::timestamp&) const proton::scalar::get(proton::uuid&) const proton::scalar::get(short&) const proton::scalar::get(signed char&) const proton::scalar::get(std::string&) const proton::scalar::get(unsigned char&) const proton::scalar::get(unsigned int&) const proton::scalar::get(unsigned long&) const proton::scalar::get(unsigned short&) const proton::scalar::get(wchar_t&) const proton::scalar::operator=(bool) proton::scalar::operator=(char const*) proton::scalar::operator=(double) proton::scalar::operator=(float) proton::scalar::operator=(int) proton::scalar::operator=(long) proton::scalar::operator=(proton::binary const&) proton::scalar::operator=(proton::decimal128 const&) proton::scalar::operator=(proton::decimal32 const&) proton::scalar::operator=(proton::decimal64 const&) proton::scalar::operator=(proton::scalar const&) proton::scalar::operator=(proton::symbol const&) proton::scalar::operator=(proton::timestamp) proton::scalar::operator=(proton::uuid const&) proton::scalar::operator=(short) proton::scalar::operator=(signed char) proton::scalar::operator=(std::string const&) proton::scalar::operator=(unsigned char) proton::scalar::operator=(unsigned int) proton::scalar::operator=(unsigned long) proton::scalar::operator=(unsigned short) proton::scalar::operator=(wchar_t) proton::scalar::scalar() proton::scalar::scalar(proton::scalar const&) proton::scalar::type() const proton::sender::available() proton::sender::offered(int) proton::sender::send(proton::message const&) proton::sender::~sender() proton::session::connection() const proton::session::create_receiver(std::string const&) proton::session::create_sender(std::string const&) proton::session::links() const proton::session::local_condition() const proton::session::open() proton::session::open_receiver(std::string const&, proton::link_options const&) proton::session::open_sender(std::string const&, proton::link_options const&) proton::session::remote_condition() const proton::session::state() const proton::session::~session() proton::session_iterator::operator++() proton::ssl::cipher() const proton::ssl::peer_hostname(std::string const&) proton::ssl::peer_hostname() const proton::ssl::protocol() const proton::ssl::remote_subject() const proton::ssl::resume_status() const proton::ssl::ssf() const proton::ssl_certificate::ssl_certificate(std::string const&, std::string const&) proton::ssl_certificate::ssl_certificate(std::string const&, std::string const&, std::string const&) proton::ssl_client_options::ssl_client_options() proton::ssl_client_options::ssl_client_options(proton::ssl_certificate&, std::string const&, proton::ssl::verify_mode) proton::ssl_client_options::ssl_client_options(std::string const&, proton::ssl::verify_mode) proton::ssl_server_options::ssl_server_options() proton::ssl_server_options::ssl_server_options(proton::ssl_certificate&) proton::ssl_server_options::ssl_server_options(proton::ssl_certificate&, std::string const&, std::string const&, proton::ssl::verify_mode) proton::swap(proton::message&, proton::message&) proton::swap(proton::value&, proton::value&) proton::task::cancel() proton::terminus::address(std::string const&) proton::terminus::address() const proton::terminus::distribution_mode() const proton::terminus::distribution_mode(proton::terminus::distribution_mode) proton::terminus::durability() proton::terminus::durability(proton::terminus::durability) proton::terminus::dynamic() const proton::terminus::dynamic(bool) proton::terminus::expiry_policy() const proton::terminus::expiry_policy(proton::terminus::expiry_policy) proton::terminus::filter() proton::terminus::filter() const proton::terminus::node_properties() proton::terminus::node_properties() const proton::terminus::timeout() const proton::terminus::timeout(unsigned int) proton::terminus::type() const proton::terminus::type(proton::terminus::type) proton::timeout_error::timeout_error(std::string const&) proton::timeout_error::~timeout_error() proton::timestamp::now() proton::transport::bind(proton::connection&) proton::transport::condition() const proton::transport::connection() const proton::transport::idle_timeout() const proton::transport::max_channels() const proton::transport::max_frame_size() const proton::transport::remote_idle_timeout() const proton::transport::remote_max_channels() const proton::transport::remote_max_frame_size() const proton::transport::sasl() const proton::transport::ssl() const proton::transport::unbind() proton::type_id_is_container(proton::type_id) proton::type_id_is_decimal(proton::type_id) proton::type_id_is_floating_point(proton::type_id) proton::type_id_is_integral(proton::type_id) proton::type_id_is_scalar(proton::type_id) proton::type_id_is_signed(proton::type_id) proton::type_id_is_signed_int(proton::type_id) proton::type_id_is_string_like(proton::type_id) proton::type_id_is_unsigned_int(proton::type_id) # XXX Why is this a free function not a member function? proton::type_name(proton::type_id) proton::url::defaults() proton::url::empty() const proton::url::host(std::string const&) proton::url::host() const proton::url::host_port() const proton::url::operator=(proton::url const&) proton::url::parse(char const*) proton::url::parse(std::string const&) proton::url::password(std::string const&) proton::url::password() const proton::url::path(std::string const&) proton::url::path() const proton::url::port(std::string const&) proton::url::port() const proton::url::port_int() const proton::url::scheme(std::string const&) proton::url::scheme() const proton::url::str() const proton::url::url() proton::url::url(char const*, bool) proton::url::url(proton::url const&) proton::url::url(std::string const&, bool) proton::url::username(std::string const&) proton::url::username() const proton::url::~url() proton::url_error::url_error(std::string const&) proton::url_error::~url_error() proton::uuid::make(char const*) proton::uuid::random() proton::uuid::str() const proton::value::as_double() const proton::value::as_int() const proton::value::as_string() const proton::value::as_uint() const proton::value::clear() proton::value::decode() const proton::value::empty() const proton::value::encode() proton::value::operator=(proton::value const&) proton::value::type() const proton::value::value() proton::value::value(pn_data_t*) proton::value::value(proton::value const&) # Only types with the following info can be thrown across shared abject boundary # Or correctly dynamically cast by user typeinfo for proton::connection typeinfo for proton::connection_driver typeinfo for proton::connection_driver::io_error typeinfo for proton::conversion_error typeinfo for proton::endpoint typeinfo for proton::error typeinfo for proton::handler typeinfo for proton::link typeinfo for proton::receiver typeinfo for proton::sender typeinfo for proton::session typeinfo for proton::timeout_error typeinfo for proton::url_error typeinfo name for proton::connection typeinfo name for proton::connection_driver typeinfo name for proton::connection_driver::io_error typeinfo name for proton::conversion_error typeinfo name for proton::endpoint typeinfo name for proton::error typeinfo name for proton::handler typeinfo name for proton::link typeinfo name for proton::receiver typeinfo name for proton::sender typeinfo name for proton::session typeinfo name for proton::timeout_error typeinfo name for proton::url_error vtable for proton::connection vtable for proton::connection_driver vtable for proton::connection_driver::io_error vtable for proton::conversion_error vtable for proton::endpoint vtable for proton::error vtable for proton::handler vtable for proton::link vtable for proton::receiver vtable for proton::sender vtable for proton::session vtable for proton::timeout_error vtable for proton::url_error qpid-proton-0.22.0/proton-c/0000775000000000000000000000000013257152177012512 5ustar qpid-proton-0.22.0/proton-c/versions.cmake0000664000000000000000000000157513257152177015374 0ustar set(PN_LIB_CORE_MAJOR_VERSION 10) set(PN_LIB_CORE_MINOR_VERSION 3) set(PN_LIB_CORE_PATCH_VERSION 1) set(PN_LIB_CORE_VERSION "${PN_LIB_CORE_MAJOR_VERSION}.${PN_LIB_CORE_MINOR_VERSION}.${PN_LIB_CORE_PATCH_VERSION}") set(PN_LIB_PROACTOR_MAJOR_VERSION 1) set(PN_LIB_PROACTOR_MINOR_VERSION 3) set(PN_LIB_PROACTOR_PATCH_VERSION 0) set(PN_LIB_PROACTOR_VERSION "${PN_LIB_PROACTOR_MAJOR_VERSION}.${PN_LIB_PROACTOR_MINOR_VERSION}.${PN_LIB_PROACTOR_PATCH_VERSION}") set(PN_LIB_LEGACY_MAJOR_VERSION 11) set(PN_LIB_LEGACY_MINOR_VERSION 4) set(PN_LIB_LEGACY_PATCH_VERSION 0) set(PN_LIB_LEGACY_VERSION "${PN_LIB_LEGACY_MAJOR_VERSION}.${PN_LIB_LEGACY_MINOR_VERSION}.${PN_LIB_LEGACY_PATCH_VERSION}") set(PN_LIB_CPP_MAJOR_VERSION 12) set(PN_LIB_CPP_MINOR_VERSION 0) set(PN_LIB_CPP_PATCH_VERSION 0) set(PN_LIB_CPP_VERSION "${PN_LIB_CPP_MAJOR_VERSION}.${PN_LIB_CPP_MINOR_VERSION}.${PN_LIB_CPP_PATCH_VERSION}") qpid-proton-0.22.0/proton-c/tox.ini.in0000664000000000000000000000073613257152177014440 0ustar [tox] envlist = @TOX_ENVLIST@ minversion = 1.4 skipdist = True setupdir = @py_bin@/dist [testenv] usedevelop = False setenv = VIRTUAL_ENV={envdir} DEBUG=True passenv = PKG_CONFIG_PATH CFLAGS SASLPASSWD VALGRIND commands = @CMAKE_SOURCE_DIR@/tests/python/proton-test '{posargs:--ignore-file=@CMAKE_SOURCE_DIR@/tests/python/tox-blacklist}' deps = unittest2 [testenv:pep8] commands = flake8 [testenv:docs] commands = python setup.py build_sphinx qpid-proton-0.22.0/proton-c/src/0000775000000000000000000000000013257152177013301 5ustar qpid-proton-0.22.0/proton-c/src/types.xml0000664000000000000000000001352213257152177015172 0ustar
qpid-proton-0.22.0/proton-c/src/transport.xml0000664000000000000000000002616113257152177016065 0ustar
qpid-proton-0.22.0/proton-c/src/transactions.xml0000664000000000000000000001022113257152177016527 0ustar
qpid-proton-0.22.0/proton-c/src/tests/0000775000000000000000000000000013257152177014443 5ustar qpid-proton-0.22.0/proton-c/src/tests/valgrind.supp0000664000000000000000000000470513257152177017170 0ustar { SSL does a number of uninitialized accesses (expected) 1 Memcheck:Cond fun:BN_bin2bn obj:* obj:* } { SSL does a number of uninitialized accesses (expected) 2 Memcheck:Cond fun:BN_num_bits_word fun:BN_num_bits } { SSL does a number of uninitialized accesses (expected) 3 Memcheck:Value8 fun:BN_num_bits_word fun:BN_num_bits fun:BN_mod_exp_mont_consttime obj:* fun:ssl3_ctx_ctrl } { SSL does a number of uninitialized accesses (expected) 4 Memcheck:Value8 fun:BN_mod_exp_mont_consttime obj:* fun:ssl3_ctx_ctrl } { SSL does a number of uninitialized accesses (FreeBSD version) Memcheck:Value8 fun:BN_num_bits_word fun:BN_num_bits fun:BN_mod_exp_mont_consttime fun:BN_mod_exp_mont obj:*libcrypto.so* fun:ssl3_ctx_ctrl } { SSL does a number of uninitialized accesses (FreeBSD version) Memcheck:Value8 fun:BN_mod_exp_mont_consttime fun:BN_mod_exp_mont obj:*libcrypto.so* fun:ssl3_ctx_ctrl } { SSL does a number of uninitialized accesses (expected) 5 Memcheck:Value4 fun:BN_mod_exp_mont_consttime fun:BN_mod_exp_mont obj:* obj:* } { SSL does a number of uninitialized accesses (expected) 6 Memcheck:Value4 fun:BN_num_bits_word fun:BN_mod_exp_mont_consttime fun:BN_mod_exp_mont obj:* obj:* } { SSL does a number of uninitialized accesses (expected) 7 Memcheck:Cond fun:ASN1_STRING_set fun:ASN1_mbstring_ncopy fun:ASN1_mbstring_copy } { Since we can never safely uninitialize SSL, allow this Memcheck:Leak fun:_vgrZU_libcZdsoZa_realloc fun:CRYPTO_realloc fun:lh_insert obj:/lib64/libcrypto.so.0.9.8e fun:ERR_load_strings fun:ERR_load_X509V3_strings fun:ERR_load_crypto_strings fun:SSL_load_error_strings } { Since we can never safely uninitialize SSL, allow this Memcheck:Leak fun:_vgrZU_libcZdsoZa_malloc fun:CRYPTO_malloc fun:lh_new fun:OBJ_NAME_init fun:OBJ_NAME_add fun:EVP_add_cipher fun:SSL_library_init } { Since we can never safely uninitialize SSL, allow this Memcheck:Leak fun:malloc obj:* fun:CRYPTO_malloc } { Known memory leak in cyrus-sasl (fixed in 2.1.26) Memcheck:Leak fun:malloc fun:* fun:sasl_config_init fun:sasl_server_init } { Known bug in glibc which tries to free ipv6 related static when getaddrinfo used Memcheck:Free fun:free fun:__libc_freeres fun:_vgnU_freeres fun:__run_exit_handlers fun:exit } qpid-proton-0.22.0/proton-c/src/tests/test_tools.h0000664000000000000000000002265013257152177017020 0ustar #ifndef TESTS_TEST_TOOLS_H #define TESTS_TEST_TOOLS_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Handy way to make pn_bytes: PN_BYTES_LITERAL(FOO) => pn_bytes("FOO",3) */ #define PN_BYTES_LITERAL(X) (pn_bytes(sizeof(#X)-1, #X)) /* A struct to collect the results of a test, created by RUN_TEST macro. */ typedef struct test_t { const char* name; int errors; uintptr_t data; /* Test can store some non-error data here */ } test_t; /* Internal, use macros. Print error message and increase the t->errors count. All output from test macros goes to stderr so it interleaves with PN_TRACE logs. */ void test_vlogf_(test_t *t, const char *prefix, const char* expr, const char* file, int line, const char *fmt, va_list ap) { fprintf(stderr, "%s:%d", file, line); if (prefix && *prefix) fprintf(stderr, ": %s", prefix); if (expr && *expr) fprintf(stderr, ": %s", expr); if (fmt && *fmt) { fprintf(stderr, ": "); vfprintf(stderr, fmt, ap); } if (t) fprintf(stderr, " [%s]", t->name); fprintf(stderr, "\n"); fflush(stderr); } void test_logf_(test_t *t, const char *prefix, const char* expr, const char* file, int line, const char *fmt, ...) { va_list ap; va_start(ap, fmt); test_vlogf_(t, prefix, expr, file, line, fmt, ap); va_end(ap); } void test_errorf_(test_t *t, const char* expr, const char* file, int line, const char *fmt, ...) { ++t->errors; va_list ap; va_start(ap, fmt); test_vlogf_(t, "error", expr, file, line, fmt, ap); va_end(ap); } bool test_check_(test_t *t, bool expr, const char *sexpr, const char *file, int line, const char* fmt, ...) { if (!expr) { ++t->errors; va_list ap; va_start(ap, fmt); test_vlogf_(t, "check failed", sexpr, file, line, fmt, ap); va_end(ap); } return expr; } /* Call via TEST_ASSERT macros */ void assert_fail_(const char* expr, const char* file, int line, const char *fmt, ...) { va_list ap; va_start(ap, fmt); test_vlogf_(NULL, "assertion failed", expr, file, line, fmt, ap); va_end(ap); abort(); } /* Unconditional assert (does not depend on NDEBUG) for tests. */ #define TEST_ASSERT(expr) \ ((expr) ? (void)0 : assert_fail_(#expr, __FILE__, __LINE__, NULL)) /* Unconditional assert with printf-style message (does not depend on NDEBUG) for tests. */ #define TEST_ASSERTF(expr, ...) \ ((expr) ? (void)0 : assert_fail_(#expr, __FILE__, __LINE__, __VA_ARGS__)) /* Like TEST_ASSERT but includes errno string for err */ /* TODO aconway 2017-02-16: not thread safe, replace with safe strerror_r or similar */ #define TEST_ASSERT_ERRNO(expr, err) \ TEST_ASSERTF((expr), "%s", strerror(err)) /* Print a message but don't mark the test as having an error */ #define TEST_LOGF(TEST, ...) \ test_logf_((TEST), "info", NULL, __FILE__, __LINE__, __VA_ARGS__) /* Print an error with printf-style message, increment TEST->errors */ #define TEST_ERRORF(TEST, ...) \ test_errorf_((TEST), NULL, __FILE__, __LINE__, __VA_ARGS__) /* If EXPR is false, print and record an error for t including #EXPR */ #define TEST_CHECKF(TEST, EXPR, ...) \ test_check_((TEST), (EXPR), #EXPR, __FILE__, __LINE__, __VA_ARGS__) /* If EXPR is false, print and record an error for t including EXPR */ #define TEST_CHECK(TEST, EXPR) \ test_check_((TEST), (EXPR), #EXPR, __FILE__, __LINE__, "") /* If EXPR is false, print and record an error for t NOT including #EXPR */ #define TEST_CHECKNF(TEST, EXPR, ...) \ test_check_((TEST), (EXPR), NULL, __FILE__, __LINE__, __VA_ARGS__) bool test_etype_equal_(test_t *t, pn_event_type_t want, pn_event_type_t got, const char *file, int line) { return test_check_(t, want == got, NULL, file, line, "want %s got %s", pn_event_type_name(want), pn_event_type_name(got)); } #define TEST_ETYPE_EQUAL(TEST, WANT, GOT) test_etype_equal_((TEST), (WANT), (GOT), __FILE__, __LINE__) bool test_int_equal_(test_t *t, int want, int got, const char *file, int line) { return test_check_(t, want == got, NULL, file, line, "want %d, got %d", want, got); } #define TEST_INT_EQUAL(TEST, WANT, GOT) test_int_equal_((TEST), (WANT), (GOT), __FILE__, __LINE__) bool test_str_equal_(test_t *t, const char* want, const char* got, const char *file, int line) { return test_check_(t, !strcmp(want, got), NULL, file, line, "want '%s', got '%s'", want, got); } #define TEST_STR_EQUAL(TEST, WANT, GOT) test_str_equal_((TEST), (WANT), (GOT), __FILE__, __LINE__) #define TEST_STR_IN(TEST, WANT, GOT) \ test_check_((TEST), strstr((GOT), (WANT)), NULL, __FILE__, __LINE__, "'%s' not in '%s'", (WANT), (GOT)) #define TEST_COND_EMPTY(TEST, C) \ TEST_CHECKNF((TEST), (!(C) || !pn_condition_is_set(C)), "Unexpected condition - %s:%s", \ pn_condition_get_name(C), pn_condition_get_description(C)) #define TEST_COND_DESC(TEST, WANT, C) \ (TEST_CHECKNF(t, pn_condition_is_set((C)), "No condition, expected :%s", (WANT)) ? \ TEST_STR_IN(t, (WANT), pn_condition_get_description(C)) : 0); #define TEST_COND_NAME(TEST, WANT, C) \ (TEST_CHECKNF(t, pn_condition_is_set((C)), "No condition, expected %s:", (WANT)) ? \ TEST_STR_EQUAL(t, (WANT), pn_condition_get_name(C)) : 0); /* T is name of a test_t variable, EXPR is the test expression (which should update T) FAILED is incremented if the test has errors */ #define RUN_TEST(FAILED, T, EXPR) do { \ fprintf(stderr, "TEST: %s\n", #EXPR); \ fflush(stdout); \ test_t T = { #EXPR, 0 }; \ (EXPR); \ if (T.errors) { \ fprintf(stderr, "FAIL: %s (%d errors)\n", #EXPR, T.errors); \ ++(FAILED); \ } \ } while(0) /* Like RUN_TEST but only if one of the argv strings is found in the test EXPR */ #define RUN_ARGV_TEST(FAILED, T, EXPR) do { \ if (argc == 1) { \ RUN_TEST(FAILED, T, EXPR); \ } else { \ for (int i = 1; i < argc; ++i) { \ if (strstr(#EXPR, argv[i])) { \ RUN_TEST(FAILED, T, EXPR); \ break; \ } \ } \ } \ } while(0) /* Ensure buf has at least size bytes, use realloc if need be */ void rwbytes_ensure(pn_rwbytes_t *buf, size_t size) { if (buf->start == NULL || buf->size < size) { buf->start = (char*)realloc(buf->start, size); buf->size = size; } } static const size_t BUF_MIN = 1024; /* Encode message m into buffer buf, return the size. * The buffer is expanded using realloc() if needed. */ size_t message_encode(pn_message_t* m, pn_rwbytes_t *buf) { int err = 0; rwbytes_ensure(buf, BUF_MIN); size_t size = buf->size; while ((err = pn_message_encode(m, buf->start, &size)) != 0) { if (err == PN_OVERFLOW) { rwbytes_ensure(buf, buf->size * 2); size = buf->size; } else { TEST_ASSERTF(err == 0, "encoding: %s %s", pn_code(err), pn_error_text(pn_message_error(m))); } } return size; } /* Decode message from delivery d into message m. * Use buf to hold intermediate message data, expand with realloc() if needed. */ void message_decode(pn_message_t *m, pn_delivery_t *d, pn_rwbytes_t *buf) { pn_link_t *l = pn_delivery_link(d); ssize_t size = pn_delivery_pending(d); rwbytes_ensure(buf, size); TEST_ASSERT(size == pn_link_recv(l, buf->start, size)); pn_message_clear(m); TEST_ASSERTF(!pn_message_decode(m, buf->start, size), "decode: %s", pn_error_text(pn_message_error(m))); } #endif // TESTS_TEST_TOOLS_H qpid-proton-0.22.0/proton-c/src/tests/test_handler.h0000664000000000000000000001374613257152177017303 0ustar #ifndef TESTS_TEST_DRIVER_H #define TESTS_TEST_DRIVER_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_tools.h" #include /* C event handlers for tests */ #define MAX_EVENT_LOG 2048 /* Max number of event types stored per proactor_test */ struct test_handler_t; /* Returns 0 if the test should continue processing events, non-0 if processing should pause here */ typedef pn_event_type_t (*test_handler_fn)(struct test_handler_t*, pn_event_t*); /* A handler that logs event types and delegates to another handler */ typedef struct test_handler_t { test_t *t; test_handler_fn f; pn_event_type_t log[MAX_EVENT_LOG]; /* Log of event types */ size_t log_size; /* Number of events in the log */ void *context; /* Generic test context */ /* Specific context slots for proton objects commonly used by handlers */ pn_connection_t *connection; pn_session_t *session; pn_link_t *link; pn_link_t *sender; pn_link_t *receiver; pn_delivery_t *delivery; pn_ssl_domain_t *ssl_domain; } test_handler_t; void test_handler_init(test_handler_t *th, test_t *t, test_handler_fn f) { memset(th, 0, sizeof(*th)); th->t = t; th->f = f; } /* Save event type in the handler log */ void test_handler_log(test_handler_t *th, pn_event_t *e) { TEST_ASSERT(th->log_size < MAX_EVENT_LOG); th->log[th->log_size++] = pn_event_type(e); } /* Keep at most n events in the handler's log, remove old events if necessary */ void test_handler_clear(test_handler_t *th, size_t n) { if (n == 0) { th->log_size = 0; } else if (n < th->log_size) { memmove(th->log, th->log + th->log_size - n, n * sizeof(pn_event_type_t)); th->log_size = n; } } void test_etypes_expect_(test_t *t, pn_event_type_t *etypes, size_t size, const char* file, int line, ...) { va_list ap; va_start(ap, line); /* ap is null terminated */ pn_event_type_t want = (pn_event_type_t)va_arg(ap, int); size_t i = 0; while (want && i < size && want == etypes[i]) { ++i; want = (pn_event_type_t)va_arg(ap, int); } if (i < size || want) { test_errorf_(t, NULL, file, line, "event mismatch"); fprintf(stderr, "after:"); for (size_t j = 0; j < i; ++j) { /* These events matched */ fprintf(stderr, " %s", pn_event_type_name(etypes[j])); } fprintf(stderr, "\n want:"); for (; want; want = (pn_event_type_t)va_arg(ap, int)) { fprintf(stderr, " %s", pn_event_type_name(want)); } fprintf(stderr, "\n got:"); for (; i < size; ++i) { fprintf(stderr, " %s", pn_event_type_name(etypes[i])); } fprintf(stderr, "\n"); } va_end(ap); } #define TEST_HANDLER_EXPECT(TH, ...) do { \ test_etypes_expect_((TH)->t, (TH)->log, (TH)->log_size, __FILE__, __LINE__, __VA_ARGS__); \ test_handler_clear((TH), 0); \ } while(0) #define TEST_HANDLER_EXPECT_LAST(TH, ETYPE) do { \ test_handler_clear((TH), 1); \ test_etypes_expect_((TH)->t, (TH)->log, (TH)->log_size, __FILE__, __LINE__, ETYPE, 0); \ test_handler_clear((TH), 0); \ } while(0) /* A pn_connection_driver_t with a test_handler */ typedef struct test_connection_driver_t { test_handler_t handler; pn_connection_driver_t driver; } test_connection_driver_t; void test_connection_driver_init(test_connection_driver_t *d, test_t *t, test_handler_fn f, void* context) { test_handler_init(&d->handler, t, f); d->handler.context = context; pn_connection_driver_init(&d->driver, NULL, NULL); } void test_connection_driver_destroy(test_connection_driver_t *d) { pn_connection_driver_destroy(&d->driver); } pn_event_type_t test_connection_driver_handle(test_connection_driver_t *d) { for (pn_event_t *e = pn_connection_driver_next_event(&d->driver); e; e = pn_connection_driver_next_event(&d->driver)) { test_handler_log(&d->handler, e); pn_event_type_t et = d->handler.f ? d->handler.f(&d->handler, e) : PN_EVENT_NONE; if (et) return et; } return PN_EVENT_NONE; } /* Transfer data from one driver to another in memory */ static int test_connection_drivers_xfer(test_connection_driver_t *dst, test_connection_driver_t *src) { pn_bytes_t wb = pn_connection_driver_write_buffer(&src->driver); pn_rwbytes_t rb = pn_connection_driver_read_buffer(&dst->driver); size_t size = rb.size < wb.size ? rb.size : wb.size; if (size) { memcpy(rb.start, wb.start, size); pn_connection_driver_write_done(&src->driver, size); pn_connection_driver_read_done(&dst->driver, size); } return size; } /* Run a pair of test drivers till there is nothing to do or one of their handlers returns non-0 In that case return that driver */ test_connection_driver_t* test_connection_drivers_run(test_connection_driver_t *a, test_connection_driver_t *b) { int data = 0; do { if (test_connection_driver_handle(a)) return a; if (test_connection_driver_handle(b)) return b; data = test_connection_drivers_xfer(a, b) + test_connection_drivers_xfer(b, a); } while (data || pn_connection_driver_has_event(&a->driver) || pn_connection_driver_has_event(&b->driver)); return NULL; } #endif // TESTS_TEST_DRIVER_H qpid-proton-0.22.0/proton-c/src/tests/test_config.h.in0000664000000000000000000000176313257152177017534 0ustar #ifndef TESTS_TEST_CONFIG_H #define TESTS_TEST_CONFIG_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* Make source tree locations available to tests */ #define CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@" #endif // TESTS_TEST_CONFIG_H qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/0000775000000000000000000000000013257152177016444 5ustar qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tserver-private-key.pem0000664000000000000000000000345213257152177023103 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1cT0c2J3GcQCAggA MBQGCCqGSIb3DQMHBAi1hxSX2LJ+EgSCBMheHJ0iXr5A36Natjk/LcAEeKUMT9s+ sMzoQceCWe8qMlQluWksr9iDdZ4JRIE8cpK8dbmx4dLY/SShUzdlhJHCSa4zZBHq 8cZ/jGUF/RF1rqdgjK589eUq+uOl3/gXKzG/SxBqayy6PSn12kX3qnvmlkXCmtwU lg+iBm5wRcJ0MyVHaJkyA8sW8gr186C/VAau6Yu0crQXN7NRo9snrd4ewuYMIEhZ hgaG9XsYQWB1bPhAaKj80CZGxsQbJyTwcbKKkB3IY4WXx8mmhuiNl+vKT3HBJ9Ju YB6tgIjs8CJ4X2P4aU3yNJwG1QldgHSqmFGQ19bcZAw3s3kzwjdzRf4H2V16XOBd zQ5AEs/ffVMzMIAfkb1gYwgunZ2CVwwDJ2mi1RcgkX+Og2aFQc+fxXcVOnDcGLxV 6fuCuZ2lsXfoiIyRh9kj3L75N12GtVUvgBdnMuOc1wPw6XnGQtDwt0acJpdexLMG k0j57r/gcgzTcmF3qNM+y9L/HLssgrJkvVJw2Np5gmtIyfDocsDUWUbClS4dTpYf oTngUTU+vWtHBuaUnb+f5/WJaRS/S7mmR8usbVG3i9WnEr/vlPJpbJFSjW2S6u/H 7cFxKUmmBZsSuEv/EKt9a+Sh62kprOChm4myqfCI1/gvNKfUZC6m0Vp8zf+2LgAq 2RgbMuqysMjWUtV4kDRZT7oCYckUDwsCHdbLES3nmVrtBk2ShMKHBpDp8/GoRuiV jdV7/EjKM/M1kXtFYYe3z7Mxv++lKYIJ7bNwVrQ8nrhce/VwHw6D5emWXNCJXhKZ FW7EM2ZOZ9eaKOlCsIi8sbjV6Yie9IY6HJKKmi3CpO0Tv5kLBdHkru8vGCSFm3O1 n7wz7Ys5FBSlZ19X0NwQSCQX1Q4w+tido6i1SCRX0qJEdTNGuGwVXMHCf4/1zyHV hj8vnxh8fzo79LFrwlTTgwLg1Mr8sEUFFDJ/raJ1AhFXi8n24trtNR8EHxRW8wtD CLCKaqkEqfBiFXK/Yq3RrefCayPHiD+DaNsI8BwefMGpED3vD8YYCjAzXNPh/CSF sc1i1jWMzbJhzOoFSPNXhlfusbUFMFQ/6olatmH47SY6HBBOL3DDP5uQ0jw8P454 QBjlMOpEZmZxO6TcEtJwu0vzgog4rQ5g3NWy6SIpjWehNwTynLt7yM3R5WTI6cZs 0GTv/rqo2/SUoNsFmnGIUwj/DrBe4XOAq1nS2ZlEctxKhBsKH0hMFp6D1rXOzrgl bwcq+oistoB0TLcThShyNgSqzW1znQ1n5SVUk9b5rRhSttJxn3yOMewH0i3v8bPo HOhP5kaGjblPsCYyhlL/SNVF0OXEGTwLNey7FQdWFOwVwTRRXe7k+uGZ2d5hg+Jn It/trDZ1RDYbVmB7/Qy73c16J4mvhOUJ2de5ZciFBjkidbiiUKLj9xnjK9k9Sauo MKhNnDMAEU5VDQM3xNe5BRdX8dFLwfF5H64sU3nROF83aUnDgvfFEowYPnCuPYfm m4aQHfoBSg4j3v1OeOwktcl+Q2TjxPHfWhbWeRBfxOTqQ/suYhnQChuFSK/qyo9K ccgotqghhunRsWMoZT25H7AZM6yKb1sMz/0oyMRIKeGqoYh+ULM5XLY0xNYd4/xU WtQ= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tserver-full.p120000664000000000000000000000465413257152177021433 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  0ùxåÞ`’€‚¨CùÚZ¯­©N(´„ ©éɘõ?Ýè¾DÇ 2íËà0!õºß·uü»fÅ ÷‚¶ò󚓜Néͨ!`öRÎ,Â0F©ò-{¬æû6¤$Âhû1ÍäŸþCn-7bCP³ù®èzݹâæÑoÙÊEKK|̇'§Ka<´¹é‚¶uz¡ˆÆ)Ç£A¶êšÞ6¢§ºƒ«ªhžÄâ:~o¦]Q €q5ËÅ îõd@Í[û„sP-ÏT 2 9F¥©¶ÉÇ3™h¦NÚ¸(ÐÙ[ŽÕ?41*Ϫ°=oÅ­‰í êzµ>=ªYäÂ(ÔÞ¸¤utRû<åÃéè/8*Üà§åâî È)1‚Z[‘AOè•&x¼Ùƒ7ø8Íõ$7W/±¿ƒ¿3ܸzéßli¾!NfÕ–pbQwUpœÚ”ʉ™?Ï‘$·|…ýñ‚ê ¦Is-~, lÔÂêKUq1\iªÊœ Œ¥+>•à‘Eœš9D‡Q:Í4Õcóá IÇ>t¯dÍ3íȉp¢J¢Éþ××F%Ø¢AÀ×IÖyì† `]âÙþäpÚ_Cn›A/Ä€â™Ë7Cá`N>klMì^LV¦ÛjîÒpKÈ„µ²R%ãxœ:7 3¢ÿãÕ=}‚¶8Ná¢X>÷¶8û ))²Ó –"P-…•·aoÖVTùò’BXnõ7íÂq#T¶%C'ˆò‡&|Á®3Y¾GH+U wóñ#I¾…ä¿“öÆzOˆ˜%¥Ú–"›ÙCa‹f‰:1ð¬:âÚa¥fxpzù¥wÄëÐj~óÄä{»=¿Œ“–D¨ pܨ.NêÂ/ç˜a*®±’Û…ù©åÀl[‚•Úç Íyæen’XfÎO×(*1Ù}ãůt \&±®¦ó!ÁÆV_9Q¥£ºº‡r܆­hY¨·x÷Ë"Å…Œöž+nøF²-ê(ÔZïÖ)­À›Y³8u° •¸ó’ôïÇ>ÇÞ?Y†"ƒY†ãö,å™7F•¹ÀØÊ³&G!¥²ít„ ¹Ía/Ûá±j™zF,Ç"²¸¦äíâÌlúòù©ù”˜'Ï©< ~üNy–Ê*¬wT?}dm±¹AÒ3)ÈŽý$…c¼‹E*ö•›Ô7Í[UŒ©£ýð’}FœZC]þt"óÚ7HÔ ”A3 LœÁð\›™DJy0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0ü¿É¹ÂK>‚È"ÛâŠþ»bÊÖþa´eç~ÕGãßo8ÃoŽ—¡›êJ P&°ØÒ(’¸´±ƒX:kHðúƒÏüÐÕçòÝ|ö,†H4Üc£Sôtl]Û»Hò¬¶„ŒkÑ{¤ÜCØmÈSþËwé§ŒGki‚Ü3£¾n&¥NtÛ~•9ÆT2Xåø E׎sæf“VrèÈ»†æ˜)¨ýÀ‚Ðã+«ÙcL‹6dS€OŽÖÕ`"ŽürâE1gÇø\9Ї½‚Øõëï~i·ÿïŽ|CÊCè;ÅÙ¼èêC<>Ž×®àÀßB=.L‚½Û# ,ÁÖ¨Â%©pñ·™çu¢\Ýf|iŽßïTh·áP‡]TmÅ4tÜb?2Q9út­Ä›ª¶Xs¥îqî²Ë#t ` ß8ã zð¿Íð.»‘—ÕðÔ¿I‡‰ë7M Á÷æÛGGºz­G çºbbì’ÁŸYÏ¥=¼«·ðÜÍí¹žõýÍÁÞ%˜×¶bhðëC.iIp…x:&ûª+Ñ0¬ …`Æ&ª’¶Âìé³)T·ºÇ›a9æ€~Q ò¼“¹š}Ú#ÿ»?0¾$,”Rlf-.@~8ÐÜ0ðíø}5îã4Mw¤‡Øöýfzm`<"'×x–Ø]µ4/.ö3k'ü›º!@ð[§?|¤Ñ[=tä›Ã5¶¤×œ"{T $‘íiÙ/Ùö1¶»9/N·"ÃÊè@¿@¾‰¼¬ÛˆGçÏM¹]Ô]l!åW#khüŽ¿¥ mmÚÚ¬%+Ü“.qéŸãѽöb;4flDøñ ²épÕEö%öÒ‡r·^л>Lf7íõZœ¼¯ÉhK‰=ú"ÇGüÆGÝìÍÕÒ²ÛGY'F%¿Ï$›(+óDç²—ƒúÍô âÆà‡lŸ9L¸éFÚ4üOІ|ý`€wÞ®&Å" z>v°ô‡cÈ “ËuÞðÚ\NCÛëòzV¼ŠÈšW½¢5ñŽ˜‰ùý®«'Qëý!®N4ºøÿ€”sH’¸8‹:_¥ÿâû;ð¹éÏVi@ÛaEIówîdݯ7(œÅé[Žö{„{‚-yU -\~¬E«æU·Uáè÷u‡qåppkÉ:.‘¥z4pÛ6¾[GVæ v›j ðšœB5DÚÅ‘fn VPx 7ï’w©ú»d™,Ž´…]71\¬S…c`0(±H´u ‹²‘;eëèyŸä+ÏËÂõ¤ciÇF‚x…·oX âÇþÈ]‚ØL>ô¾2.V^Т~hI?uDÓq{Ò7`dthö:K3®DüýŒàpºgÕ`%ͬtL&ò§¥x,4»‚…ˆ’Za4k3]Mä ß{”Kd[@ã,ƒ’ÀCYï;é7f¨Ûv'+ŽVâ 'st¬|ç "©ä^z[;Ô-qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tserver-certificate.pem0000664000000000000000000000220713257152177023122 0ustar -----BEGIN CERTIFICATE----- MIIDKzCCAhOgAwIBAgIJAPnYOOQCJ3kDMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV BAMMC3Rlc3Rfc2VydmVyMRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3Rfc2VydmVyMRQw EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAKJNB78lgw4KtXDAvXocTLud6mbn6zgfB6ETIF+kcrukOH9DnPxjLBBM4Lig sp1+kmeudFK5/X8riDrvIW52b/rlEBLgLB+oDtI74m6OTbBs9L+FUFYOuxApetQF qoJy2vf9pWfy4uku24vCpeo7eVLi6ypu4lXE3LR+Km3FruHI1NKonHBMhwXSOWqF pYM6/4IZJ4fbV0+eU0Jrx+05s6XHg5vone2BVJKxeSIBje+zWnNnh8+qG0Z70Jgp aMetME5KGnLNgD1okpH0vb3lwjvuqkkx4WswGVZGbLLkSqqBpXPyM9fCFVy5aKSL DBq7IABQtO67O2nBzK3OyigHrUUCAwEAAaNQME4wHQYDVR0OBBYEFGV1PY0FCFbJ gpcDVKI6JGiRTt3kMB8GA1UdIwQYMBaAFGV1PY0FCFbJgpcDVKI6JGiRTt3kMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIx1TOTGWnnbpan4bse7wuvH GYSNDJhoTVS+X1TC63xukJD1JBAsCNTqg/ZV6lN3XEl7vvOXfGoCiyXM6a9XOKUo gSDtMrIr+wTh6Ss1yRO8QcCJmxH5JDXNu1ojtwsjFW/vneI4IL9kwpDsSlMQEX/E EkkQwtAx/Cvfe7pecZL4qSeykJOUMTts9H8fCAZqEiRZBA3ugJxqF8jwLP3DoFVQ 6QZzKDY6CSPqfMnVb5i0MAIYVDpau+e3N9dgQpZD22F/zbua0OVbfAPdiRMnYxML FT4sxLnh+5YVqwpVWbEKp4onHe2Fq6YIvAxUYAJ3SBA2C8O2RAVKWxf1jko3jYI= -----END CERTIFICATE----- qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tserver-certificate.p120000664000000000000000000000201013257152177022733 0ustar 0‚0‚Ê *†H†÷  ‚»‚·0‚³0‚¯ *†H†÷  ‚ 0‚œ0‚• *†H†÷ 0 *†H†÷  0àQÙÙ››€‚håÆ`!ìŸ÷ËÒ˜*®¾Þã…ú*eË%£ðj)F5ugIŸ ýYyÝÐÈq’ÅùŽʰªÐ£ ëD ýù‰_Îæ‰œ¯;-e…:ho_·5ÄMŽàß)~c@¸½é_ØòNQ´sŸ`ÉΫz¢¼y;;We"×Þa Õߤ#É¡ Ù«Îÿ>z8íÑ&Ê YÁµÀÿ ‘ÏúÌ &ÿ°ýÍ&èƒÿ7 y|a»ÉÙŠ„_Ÿ~¤äçVñØý—p®gp#ˆZ<‘:‚ÎKZ]í À,P½k~;3#A3¬I›¿€ÉxëÞûò(–;¸¬Ø-‡ŒI‹é’Z·1=Ê4Ehw<ÿpšE¯ οV¼w‹!ÓŒëÞƒ!ÁD šîáM˜%µF^pôD"û…†l6Ô‚,})5ò© ³TÌžë*ÔÊ,›Ÿs? òÕQpÈoñR$f®šþâ¦åªætÎ'Îé¿NóîÛ¿±P9”!VÓMƒÖ6OG݇h‹†€¶ò(õ¸”Iît±Õ\BÌ-»Ê”$„ÇS²×8ºÅ ¹qÍÿÇU¤RÖqRAó/ZvAõ~ÂõjûvÎe&ׂA™­ëªrOU LBHŠõá^³)ˆû"Ï”OD*£l,v!Mý"·ÍàrÐ&œ˜³žý©GçON-Ρ]͸.¥>‰RE¡°ÌVÊ›‹)žs†Ð(æsÇ3Å=ñi¡ÞÍÂULKSyÎSNÖÑø/cfœ,\:÷BÍ:·±¨€Q™n' ׃.•ånL£7¤I8Vá0emÀ%­ ×/~ÀÕÐ/kìp§3Qm)/â8'µXz‚S©‘Ù0Q°þs!xß´ ('˜ #ÌçÕ}›’rÈœ.]zNÓjDŒ õEz!‡žœY´il÷œ/mÇö>¬þ£1W]–CJþÓ8Á?1ưÙÊÀù¦Gi +SéÒµÔó;Ñf»Š<Úoy<¬ð7‘÷b·g¤†îÀ%“ù‰YxB UJäRŽåÙè÷ø¯%³ëà±uiä»QàVMŠeö–cúô!|ùó?Ê…ÊA7(R„h½OSÑø)LPæ,þ‡R_V“~“ é³¾†ã-Õ^¯øæã«®ßoH010!0 +úŒ àheíløéÇš=·.D{‘<ó¸vàqpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tclient-private-key.pem0000664000000000000000000000345213257152177023053 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQICy6ghWp45z4CAggA MBQGCCqGSIb3DQMHBAiVdDoo4NIghQSCBMixGm1bm/omMxsaKnIPO7zm5dyLexJ+ yTFpmh2KV7kQqmpzCyIOdoG6K8YqFnie2XdFWm3S8faRHoMq54bDmyEWIxfQPq5f I1iYFbIZkbnhUvK53RActsEUMf0locS4xylU7VQK3XTAwp0TVip3Lp3ehEMEdcXL iUWibGsoTPKcY9MIWGXZAJXsEXoeHt6k2hHo1G4E0/Bi6mLW1LY/cxZCjHTGD6qI Kt54SCCDvinqVa+rixw6yX9F14EA6bhALami8e+Ccd3lqHOyYlXcBaSS1ezCg6ig oNK97mC+gEGy1KlkZDKWXclFoOCBXRBe4DByre6Rlq3yeI9L42bvAuSBSmf5QT5g 73Yl8vjEAKR65awBT09dPuKu7t+Fb6vkwF8/t+uyj9IuL+42UuXhMLK3ohf+6DbU 8/zB4y3GXI80QmWM0+Wx4n6khFhPFLHt2q0Sn6V9PG1vtHyiq50oSCoyrPQLaecp hefnMCFBYTcT3JUwmoVGGy0boIAwL7T4aGsMt7QhwOx5tU35tKFxyY7m4fX14AKo 2EIy+TPQwCGkGf3Puy/Pc9VA8IAxB5+WwSrjk+NeCv88eIX7gy43k4rCr+OmD9FF wknr3xoP3KYhNXjdZ4Ep/1UHSK+JAtzzbNLQjDcqN+gQPg/yUX6ih0j5K3Wvh9bK E/DvzbpJroUZPgzR+8z5O68CfsD+OIdpHBFTKqAFmzvUuqpADpr998LdCjD+lW+V xZZgZa8KEblwgiH3fdGbYl46Ho1zrZisf439DbqyybAuBIQB4NSZcL/MAgVGO17k QDpVElWZWYrFm4CFTcvS2HvIzRmbefF5m5oJedsN7Q6WQCp+3gnwYx1xIOknd7pW N4AHNnqjscSj9yACj/EiBVKAKNnC5H7ZGZTsaAjMETZyjLXfI2AZ3Fviz4zFR+oz NkAfFB6WUpRpl7H02FzrzYT7XkkLcXd6H6g+mv2iDa9uKWk/PS2QlqnJt8/dHEHD JKTG331yDK5GHlKAVGF3nP5BwFGgTQMuSoeiOervMXPUwDpQ8OaYkuaRej0cZLgT kAF9sUjqdsoYNcXDFHALp6y5g8qYkfrxrlIbKs82zIsmB5I+dtZbUaD3a0zAUrmW 5Xm3Pc9dVP0EXKwfHz6zqPReEw2yYLisB5IoHd4M2wa3GzHBdra1ij4QTmvd3o7e buGFoX8KJQAcig0zpbYkoDP2gPhIh9rY4unVPQNX1Q8/wRsiJAZZsYvZY+A+SmuZ bwSwk+8ZJRsFzdYYYhQeRytD5cDAIQiClcI5Yj4T9dWQV/gf0N/wIBDNTMp0jJAy 1l7PuXTfGZodNJWZH0oqsrNoWbn/k67NildvvofIKX+h09Nxszr670Pvj0qoHd5/ CWq30lnxoJBUgbikFOz6ZuuHi/ZiCXL+haH+v8hJKN5ptRKnyYJQHchRB/IOGRoT 5lmWxo8a7K+yXhp0VBDHJfw3685ms0xQX8Xj4X3MEuN64zd0fB1JmhtP12ydK85J ABawNKlRQPw5weckwtCviXQX+vX25S/xu3xA6IuqlHyqL/1t3DICzuxeOyT2mZxD tKQxEgNihPvu32vn9m74qA3adEaxuWPRkPZuTeITHOkMTZolvqYX/5olBsSgYwka 7/g= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/proton-c/src/tests/ssl_certs/tclient-full.p120000664000000000000000000000465413257152177021403 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  018µVÀ ûB€‚¨ø±!Š›2d޲@¾˜ï,¼UÈ0Á> Æ•c¸³ŽíŸֱ‹ L8SÉ?ÂÔ'ç®YºG´]ØJd³Ð*b§¿Ì /I µŒv¯ø*§±ªHVnâ·bŸiÃU‹iRLÚ'ŠéÌУS¯¦²†î{Øñ²èÑ~ÇG8 }Ú¨]|ƒ«Ýi|)ä‘ý8žVMÀždÓýN‚ïÛÛžÕ…»{µ9ºßÎoS}¹ÎÔä?²c½1>67)òÁ:ˆ:ïÁÈ/é-_/‡öšˆF 7Š›Jmý/ïßÅ«w¦¼O¡`aW NLJU¡ËÅŸõ=îáÃqJíˆYT)µ‡sõ¯1ã–Dg“ZÇÞR4’/_rs#{0XØG¿—þfËÊSäGÝ„<ÿxe«Ä8ô~Ú :_ðÓ¼`ÿÛ©Kÿ~ Æø-snºØkºÙ[kÐIÔ hû9f“Ÿl9„BˆAU¸¼›ºAoIиNƒZvbzÈ.h„FÑËý«ÓÇù?–2±šªéØ0Ð>;9ëHE%8‹À“ÕÞúÓÕ1bBZ!¢Cx®y&þVŠ4?½]yf%Àå‚l4 *ÔÚÓ)¹ŸÎXr½>’ ›ÛL„“ <9ZŠðÜÿ Š(…íFšM´±ìmäZ½0LŒ‹D¢U«M¸C§Aý‘y!C¡1!ëK6î+—Ñ]XK¦Ì§-v,f<úkÐà>{¶çÄ!¹ùù¦2“Ä`÷EeÜOÐÀÎËA³è|$ºÙÂSéiMöª‘e]¦HÆ,s3%¨{öÜ1Cþ̧òDJ9õÀàÐ5:ý%BÁg2]‘Ý <;‹š…Eòš7ëÖ±·ÊÈŠÚê*)Êó'››87êÝ–ÒŽáaòš>†ÌuÙÓ5½¬Ϩ†‘SµC^t=gÞÿœ"Ê(gêú¶!£çôR_¾àM\芙KXlFÚ^$‹¿kl pSMdMÔ×?yUêÈÓ1 䌓"ÃòߦÖËÑœN:\5§õDﻼhD$Éý¨j ~úùlL ^eÄœ d´Àæíf(€7ÿ½²Aº\²ÍÖ˜˜'i.½Zxßø"¾ ¹ÀO¢øml0³É¡y#U·<ä¸Ö ›Y^.Æi6Ìnì,`lÍ‚tç÷~­æn®ì¢— F¥ö@œ‘##*+þ vsÓ qÌ6QoâÆ ª0€qHP³£VFe|Á¸ Ó_D £0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0MÌ©ŽéË‚È×süUsÉ‹«j¹T6?gb'dʸ܉³ö_frZ‰ÂJ‚Lg‹¨®}R$Z1 °ç2Ô‚õX“5‘d?âåž''µÛàÉÃ3¯¿ýñK-)@ `$  ÿw?H$¤vÞU<}»è£\Öï ÌQ OJ˜`¡Á7㥒L¼á¥L€Êy:yVTF*ñqSßšm£¤¼d+ÄÞ%3œ½ò‚cáÌŸ&l1ª0ï~ÞÁ€'¡¢ç‹WŸª\=ñ…CH¾ë `üäèÜPAW'Iþ™Hˆ: òRÒia­ó,þW^ýžž¾ÆŒ²ɧ‚ð #|ç?{DGh‚ßüÉ',/£ßå±;.ÖÛ}°\›"h­x™·Ošø€d@;Èù*Íffm  ­ñ™ÐÑ€&.¯ ed»µ HŸ7–.å'‹”)¤âR͹kpi‹ÐZ$Îr ÷W"E›N~¯ÓÊ@,R{Óá;-‚̼häÄÌÉ#=¨§äžŸI@Ñ‚·FÁ{Â">•³˜xxg«²ØHBŸ&ñ¡sâ^&¹Z¼Çõ‹}Œ/ÉyÍ5{rp{ ƃH¡³»†’?§$6íHàQ¼foð Àñ² lfôYí´¾SÆe…Ï=‡H=Èô}¬¨ƒãØ<: µ¹™ï:Yk¥ÕT®ý*áˆI’apØuOp|X*o^ûwK­‰{ôL?Ëß±ùEz#ÉD™§é³Çò)lĺѓdW0æá(®–$|·Ñp˜lú^$µ©5ØÉÊ'í» Ø>ŒÃì`u:òàšwò¸“[o™ áÛtMœÐpíJ§è/ üI4Iè’ý(#2æ|‘vÄE†6¡àmÿûܦ\tñ ÝyÎñ"6' ak‚Áb‚¸6nþÿ!IÚžl¸&-¼Úg‡—Üf½ ÀwƒfÊl7ãn}oìy‹*}š´½G'©±k¸½]P áªÓ ë÷GÁ’ù#güfoÑÿý|ÃÕâ÷ì"MýøÞÝRtoR++œzõUÓÞ$š!hŸv}z'妡­%”—Oµ”d*˜V­‰¼ýAËígôBW$´²7~ŽõO÷Œ¼ÂùúŽž¼qÞF2‚­rm€Q¢ÊprI m^íEaD¢'ßà(¼v=퇋òøßö¼…­âXäb¹F CôÛÏçr@ ë —\GÝf\å YGÿÊ#\6³²“êx¢V‰©´êô6Òå_&?”“4¿w?×Ü–l=—ì¨2yáj·3é”}Sï«íeƒ’dÑ_d1=½ë–âûŒWÝL`Õdc„ÕÉŽÜ݇CƒœÇ<1#–аèsJü}÷Ò¬ W;¶ŒX×ô³oÑÚOy Ä/ÿY­ôž²ð†.Í€PâŒä–íŠn³Ïg¶Öž¤®(#ó¿„&¨hÛ,†ö„ÅCç3H1D0 *†H†÷  1tclient0# *†H†÷  1ÅHEF²„±eIŒ¸Å÷ÇU_Ãàp?ÔK3b=sXšã¼Gæž/fsÙ z Æbž-R1J21µ ŸçTY°¬ŸÝÙùY—«Ò&®/ê÷ÛÃPà ŸÎ¹W «×¡~‰R˜_Ðî—vgaõ]+²nSqTó-¹‡Å?ß¾¥ò þ± øÖa(…q¼?À*à®yO R'Ü‹lFìaØVPÇ1ûÅì­%Jj» È&·ñyFï÷ËÓ<€ïH;ùTDT,©FBRcâ)^’¤iÙŸ»¾ï,¯ M’ß,ßÒÎÉNrŒÄ7S'>¶‡¾ñòð~ŒD?_ц"ŒÓO¶ØBL¡3°ñq⣑Æ)ÿ»1ç^}½ë>åM·/ÃיzÓéE´càCüßÑ­ðשj¼ÆØõª,¼ÈÄÆ.¹BI4݋ͥ+­ª‘§bà.•œÛǵ»<‰þZl£©X®öpñ€ÍÀE³¡>eóŒÂÜ13lrDoú Q_R®',*üs¨ã[á+ÚcÝqà{óT›þ˱åÝ ‚É(,:ÕL–0i˜ÕXr§Ù.ãÉ= Æ/RÒlïñõñá0`.¾TŽ8:dUö4š b„Xš\n®@’2è†ôÎS)PïŸø¢åhÜ:Âo“sîa›Þ^[¿Áä´|¼êSe÷L­jËèFÚZ%—vZï.!—6"Kê…Õüêœà]óñ]N„©P×Jß¡Ø ?èò,~¯OÑuØ*Ï «ìzêI ŠDöâ!ÃP—È>ßQñ¦Î™µ0ÝÙ‡éJm[„_ç-óbu„®}Û“Žíû}€GDÌÿ¾‰ÜùÈ |©iÙúœòº`¾à¢o^ÁŽÓds@ä÷]I@hO9CÈ·S›¸(Ä€»ÞU¤WÞ3¦dªK,ŠÞ\+D¤7ÍXÈx¬… ½ÿX؉0ôßÁ%™t¯kÇúW¢G›ÿq2ÂC|¸Ý€þŸâåÀüÑÐbMÈzá·$ú’¡×œ¢¯“Îq  [{A* Ë¶Ù³á;!ÂÍœ®nÑð(Cæô;w Àî"010!0 +Ø*×[. #include "test_tools.h" static void test_ssl_protocols(test_t *t) { pn_ssl_domain_t *sd = pn_ssl_domain(PN_SSL_MODE_CLIENT); // Error no protocol set TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "")==PN_ARG_ERR); // Unknown protocol TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "blah")==PN_ARG_ERR); // Unknown protocol with known protocl prefix TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1.x")==PN_ARG_ERR); // known protocols TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1.1")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1.2")==0); // Multiple protocols TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1 TLSv1.1 TLSv1.2")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1 TLSv1.1")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1.1 TLSv1.2")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1 TLSv1.2")==0); // Illegal separators TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1/TLSv1.1 TLSv1.2")==PN_ARG_ERR); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1-TLSv1.1 TLSv1.2")==PN_ARG_ERR); // Legal separators TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1,TLSv1.1;TLSv1.2 ; ")==0); TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1;TLSv1.1 TLSv1.2,,,,")==0); // Known followed by unknown protocols TEST_CHECK(t, pn_ssl_domain_set_protocols(sd, "TLSv1 TLSv1.x;TLSv1_2")==PN_ARG_ERR); pn_ssl_domain_free(sd); } int main(int argc, char **argv) { int failed = 0; // Don't run these tests if ssl functionality wasn't compiled if (!pn_ssl_present()) { fprintf(stderr, "No SSL implementation to test\n"); return failed; } #if !defined(_WIN32) RUN_ARGV_TEST(failed, t, test_ssl_protocols(&t)); #endif return failed; } qpid-proton-0.22.0/proton-c/src/tests/refcount.c0000664000000000000000000002633013257152177016440 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #define assert(E) ((E) ? 0 : (abort(), 0)) /** * The decref order tests validate that whenever the last pointer to a * child object, e.g. a session or a link, is about to go away, the * parent object takes ownership of that reference if the child object * has not been freed, this avoids reference cycles but allows * navigation from parents to children. **/ #define SETUP_CSL \ pn_connection_t *conn = pn_connection(); \ pn_session_t *ssn = pn_session(conn); \ pn_incref(ssn); \ pn_link_t *lnk = pn_sender(ssn, "sender"); \ pn_incref(lnk); \ \ assert(pn_refcount(conn) == 2); \ assert(pn_refcount(ssn) == 2); \ assert(pn_refcount(lnk) == 1); static void test_decref_order_csl(void) { SETUP_CSL; pn_decref(conn); assert(pn_refcount(conn) == 1); // session keeps alive pn_decref(ssn); assert(pn_refcount(ssn) == 1); // link keeps alive pn_decref(lnk); // all gone now (requires valgrind to validate) } static void test_decref_order_cls(void) { SETUP_CSL; pn_decref(conn); assert(pn_refcount(conn) == 1); // session keeps alive pn_decref(lnk); assert(pn_refcount(lnk) == 1); // session takes over ownership pn_decref(ssn); // all gone now (requires valgrind to validate) } static void test_decref_order_lcs(void) { SETUP_CSL; pn_decref(lnk); assert(pn_refcount(lnk) == 1); // session takes over ownership pn_decref(conn); assert(pn_refcount(conn) == 1); // session keeps alive pn_decref(ssn); // all gone now (requires valgrind to validate) } static void test_decref_order_scl(void) { SETUP_CSL; pn_decref(ssn); assert(pn_refcount(ssn) == 1); // link keeps alive pn_decref(conn); assert(pn_refcount(conn) == 1); // session keeps alive pn_decref(lnk); // all gone now (requires valgrind to validate) } static void test_decref_order_slc(void) { SETUP_CSL; pn_decref(ssn); assert(pn_refcount(ssn) == 1); // link keeps alive pn_decref(lnk); assert(pn_refcount(ssn) == 1); // connection takes over ownership assert(pn_refcount(lnk) == 1); // session takes over ownership pn_decref(conn); // all gone now (requires valgrind to validate) } static void test_decref_order_lsc(void) { SETUP_CSL; pn_decref(lnk); assert(pn_refcount(lnk) == 1); // session takes over ownership assert(pn_refcount(ssn) == 1); pn_decref(ssn); assert(pn_refcount(lnk) == 1); assert(pn_refcount(ssn) == 1); // connection takes over ownership pn_decref(conn); // all gone now (requires valgrind to validate) } /** * The incref order tests verify that once ownership of the last * pointer to a child is taken over by a parent, it is reassigned when * the child is increfed. **/ #define SETUP_INCREF_ORDER \ SETUP_CSL; \ pn_decref(lnk); \ pn_decref(ssn); \ assert(pn_refcount(lnk) == 1); \ assert(pn_refcount(ssn) == 1); \ assert(pn_refcount(conn) == 1); static void test_incref_order_sl(void) { SETUP_INCREF_ORDER; pn_incref(ssn); assert(pn_refcount(conn) == 2); assert(pn_refcount(ssn) == 1); assert(pn_refcount(lnk) == 1); pn_incref(lnk); assert(pn_refcount(conn) == 2); assert(pn_refcount(ssn) == 2); assert(pn_refcount(lnk) == 1); pn_decref(conn); pn_decref(ssn); pn_decref(lnk); } static void test_incref_order_ls(void) { SETUP_INCREF_ORDER; pn_incref(lnk); assert(pn_refcount(conn) == 2); assert(pn_refcount(ssn) == 1); assert(pn_refcount(lnk) == 1); pn_incref(ssn); assert(pn_refcount(conn) == 2); assert(pn_refcount(ssn) == 2); assert(pn_refcount(lnk) == 1); pn_decref(conn); pn_decref(ssn); pn_decref(lnk); } static void swap(int array[], int i, int j) { int a = array[i]; int b = array[j]; array[j] = a; array[i] = b; } static void setup(void **objects) { pn_connection_t *conn = pn_connection(); pn_session_t *ssn = pn_session(conn); pn_incref(ssn); pn_link_t *lnk = pn_sender(ssn, "sender"); pn_incref(lnk); pn_delivery_t *dlv = pn_delivery(lnk, pn_dtag("dtag", 4)); pn_incref(dlv); assert(pn_refcount(conn) == 2); assert(pn_refcount(ssn) == 2); assert(pn_refcount(lnk) == 2); assert(pn_refcount(dlv) == 1); objects[0] = conn; objects[1] = ssn; objects[2] = lnk; objects[3] = dlv; } static bool decreffed(int *indexes, void **objects, int step, void *object) { for (int i = 0; i <= step; i++) { if (object == objects[indexes[i]]) { return true; } } return false; } static bool live_descendent(int *indexes, void **objects, int step, int objidx) { for (int i = objidx + 1; i < 4; i++) { if (!decreffed(indexes, objects, step, objects[i])) { return true; } } return false; } static void assert_refcount(void *object, int expected) { int rc = pn_refcount(object); //printf("pn_refcount(%s) = %d\n", pn_object_reify(object)->name, rc); assert(rc == expected); } static void test_decref_order(int *indexes, void **objects) { setup(objects); //printf("-----------\n"); for (int i = 0; i < 3; i++) { int idx = indexes[i]; void *obj = objects[idx]; //printf("decreffing %s\n", pn_object_reify(obj)->name); pn_decref(obj); for (int j = 0; j <= i; j++) { // everything we've decreffed already should have a refcount of // 1 because it has been preserved by its parent assert_refcount(objects[indexes[j]], 1); } for (int j = i+1; j < 4; j++) { // everything we haven't decreffed yet should have a refcount of // 2 unless it has a descendant that has not been decrefed (or // it has no child) in which case it should have a refcount of 1 int idx = indexes[j]; void *obj = objects[idx]; assert(!decreffed(indexes, objects, i, obj)); if (live_descendent(indexes, objects, i, idx)) { assert_refcount(obj, 2); } else { assert_refcount(obj, 1); } } } void *last = objects[indexes[3]]; //printf("decreffing %s\n", pn_object_reify(last)->name); pn_decref(last); // all should be gone now, need to run with valgrind to check } static void permute(int n, int *indexes, void **objects) { int j; if (n == 1) { test_decref_order(indexes, objects); } else { for (int i = 1; i <= n; i++) { permute(n-1, indexes, objects); if ((n % 2) == 1) { j = 1; } else { j = i; } swap(indexes, j-1, n-1); } } } static void test_decref_permutations(void) { void *objects[4]; int indexes[4] = {0, 1, 2, 3}; permute(4, indexes, objects); } static void test_transport(void) { pn_transport_t *transport = pn_transport(); assert(pn_refcount(transport) == 1); pn_incref(transport); assert(pn_refcount(transport) == 2); pn_decref(transport); assert(pn_refcount(transport) == 1); pn_free(transport); } static void test_connection_transport(void) { pn_connection_t *connection = pn_connection(); assert(pn_refcount(connection) == 1); pn_transport_t *transport = pn_transport(); assert(pn_refcount(transport) == 1); pn_transport_bind(transport, connection); assert(pn_refcount(connection) == 2); pn_decref(transport); assert(pn_refcount(transport) == 1); // preserved by the bind assert(pn_refcount(connection) == 1); pn_free(connection); } static void test_transport_connection(void) { pn_transport_t *transport = pn_transport(); assert(pn_refcount(transport) == 1); pn_connection_t *connection = pn_connection(); assert(pn_refcount(connection) == 1); pn_transport_bind(transport, connection); assert(pn_refcount(connection) == 2); pn_decref(connection); assert(pn_refcount(connection) == 1); assert(pn_refcount(transport) == 1); pn_free(transport); } static void drain(pn_collector_t *collector) { while (pn_collector_next(collector)) ; } static void test_collector_connection_transport(void) { pn_collector_t *collector = pn_collector(); assert(pn_refcount(collector) == 1); pn_connection_t *connection = pn_connection(); assert(pn_refcount(connection) == 1); pn_connection_collect(connection, collector); assert(pn_refcount(collector) == 2); assert(pn_refcount(connection) == 2); drain(collector); assert(pn_refcount(connection) == 1); pn_transport_t *transport = pn_transport(); assert(pn_refcount(transport) == 1); pn_transport_bind(transport, connection); assert(pn_refcount(transport) == 1); assert(pn_refcount(connection) == 3); drain(collector); assert(pn_refcount(connection) == 2); pn_decref(transport); assert(pn_refcount(transport) == 1); // preserved by the bind assert(pn_refcount(connection) == 1); pn_free(connection); assert(pn_refcount(transport) == 1); // events assert(pn_refcount(connection) == 1); // events pn_collector_free(collector); } static void test_collector_transport_connection(void) { pn_collector_t *collector = pn_collector(); assert(pn_refcount(collector) == 1); pn_transport_t *transport = pn_transport(); assert(pn_refcount(transport) == 1); pn_connection_t *connection = pn_connection(); assert(pn_refcount(connection) == 1); pn_connection_collect(connection, collector); assert(pn_refcount(collector) == 2); assert(pn_refcount(connection) == 2); drain(collector); assert(pn_refcount(connection) == 1); pn_transport_bind(transport, connection); assert(pn_refcount(connection) == 3); assert(pn_refcount(transport) == 1); drain(collector); assert(pn_refcount(connection) == 2); assert(pn_refcount(transport) == 1); pn_decref(connection); assert(pn_refcount(connection) == 1); assert(pn_refcount(transport) == 1); pn_free(transport); assert(pn_refcount(connection) == 1); assert(pn_refcount(transport) == 1); pn_collector_free(collector); } int main(int argc, char **argv) { test_decref_order_csl(); test_decref_order_cls(); test_decref_order_lcs(); test_decref_order_scl(); test_decref_order_slc(); test_decref_order_lsc(); test_incref_order_sl(); test_incref_order_ls(); test_decref_permutations(); test_transport(); test_connection_transport(); test_transport_connection(); test_collector_connection_transport(); test_collector_transport_connection(); return 0; } qpid-proton-0.22.0/proton-c/src/tests/reactor.c0000664000000000000000000004350613257152177016256 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include #define assert(E) ((E) ? 0 : (abort(), 0)) static void test_reactor(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_free(reactor); } static void test_reactor_free(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_reactor_free(reactor); } static void test_reactor_run(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); // run should exit if there is nothing left to do pn_reactor_run(reactor); pn_free(reactor); } static void test_reactor_run_free(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); // run should exit if there is nothing left to do pn_reactor_run(reactor); pn_reactor_free(reactor); } typedef struct { pn_reactor_t *reactor; pn_list_t *events; } pni_test_handler_t; pni_test_handler_t *thmem(pn_handler_t *handler) { return (pni_test_handler_t *) pn_handler_mem(handler); } void test_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { pni_test_handler_t *th = thmem(handler); pn_reactor_t *reactor = pn_event_reactor(event); assert(reactor == th->reactor); pn_list_add(th->events, (void *) type); } pn_handler_t *test_handler(pn_reactor_t *reactor, pn_list_t *events) { pn_handler_t *handler = pn_handler_new(test_dispatch, sizeof(pni_test_handler_t), NULL); thmem(handler)->reactor = reactor; thmem(handler)->events = events; return handler; } void root_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { pni_test_handler_t *th = thmem(handler); pn_reactor_t *reactor = pn_event_reactor(event); assert(reactor == th->reactor); pn_list_add(th->events, pn_event_root(event)); } pn_handler_t *test_root(pn_reactor_t *reactor, pn_list_t *events) { pn_handler_t *handler = pn_handler_new(root_dispatch, sizeof(pni_test_handler_t), NULL); thmem(handler)->reactor = reactor; thmem(handler)->events = events; return handler; } #define END PN_EVENT_NONE void expect(pn_list_t *events, ...) { va_list ap; va_start(ap, events); size_t idx = 0; while (true) { pn_event_type_t expected = (pn_event_type_t) va_arg(ap, int); if (expected == END) { assert(idx == pn_list_size(events)); break; } assert(idx < pn_list_size(events)); pn_event_type_t actual = (pn_event_type_t)(size_t) pn_list_get(events, idx++); assert(expected == actual); } va_end(ap); } static void test_reactor_handler(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *handler = pn_reactor_get_handler(reactor); assert(handler); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_t *th = test_handler(reactor, events); pn_handler_add(handler, th); pn_decref(th); pn_free(reactor); expect(events, END); pn_free(events); } static void test_reactor_handler_free(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *handler = pn_reactor_get_handler(reactor); assert(handler); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_add(handler, test_handler(reactor, events)); pn_reactor_free(reactor); expect(events, END); pn_free(events); } static void test_reactor_handler_run(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *handler = pn_reactor_get_handler(reactor); assert(handler); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_t *th = test_handler(reactor, events); pn_handler_add(handler, th); pn_reactor_run(reactor); expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); pn_free(reactor); pn_free(th); pn_free(events); } static void test_reactor_handler_run_free(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *handler = pn_reactor_get_handler(reactor); assert(handler); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_add(handler, test_handler(reactor, events)); pn_reactor_run(reactor); expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); pn_reactor_free(reactor); pn_free(events); } static void test_reactor_event_root(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *handler = pn_reactor_get_handler(reactor); assert(handler); pn_list_t *roots = pn_list(PN_VOID, 0); pn_handler_t *th = test_root(reactor, roots); pn_handler_add(handler, th); pn_reactor_run(reactor); expect(roots, handler, handler, handler, handler, handler, END); pn_free(reactor); pn_free(th); pn_free(roots); } static void test_reactor_connection(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_list_t *cevents = pn_list(PN_VOID, 0); pn_handler_t *tch = test_handler(reactor, cevents); pn_connection_t *connection = pn_reactor_connection(reactor, tch); assert(connection); pn_reactor_set_connection_host(reactor, connection, "127.0.0.1", "5672"); pn_url_t *url = pn_url_parse(pn_reactor_get_connection_address(reactor, connection)); assert(strcmp(pn_url_get_host(url), "127.0.0.1") == 0); assert(strcmp(pn_url_get_port(url), "5672") == 0); pn_decref(url); pn_handler_t *root = pn_reactor_get_handler(reactor); pn_list_t *revents = pn_list(PN_VOID, 0); pn_handler_add(root, test_handler(reactor, revents)); pn_reactor_run(reactor); expect(revents, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); expect(cevents, PN_CONNECTION_INIT, END); pn_reactor_free(reactor); pn_handler_free(tch); pn_free(cevents); pn_free(revents); } static void test_reactor_connection_factory(void) { pn_reactor_t *reactor = pn_reactor(); pn_connection_t *conn; const char *addr; // use host as connection hostname default conn = pn_reactor_connection_to_host(reactor, "a.test.com", "5678", NULL); pn_connection_set_hostname(conn, "virt.host"); addr = pn_reactor_get_connection_address(reactor, conn); assert(addr && strcmp(addr, "a.test.com:5678") == 0); assert(strcmp(pn_connection_get_hostname(conn), "virt.host") == 0); // verify the host address can be changed: pn_reactor_set_connection_host(reactor, conn, "a.different.com", "9999"); addr = pn_reactor_get_connection_address(reactor, conn); assert(addr && strcmp(addr, "a.different.com:9999") == 0); assert(strcmp(pn_connection_get_hostname(conn), "virt.host") == 0); pn_reactor_free(reactor); } static void test_reactor_acceptor(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", NULL); assert(acceptor); pn_reactor_free(reactor); } pn_acceptor_t **tram(pn_handler_t *h) { return (pn_acceptor_t **) pn_handler_mem(h); } static void tra_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { switch (type) { case PN_REACTOR_INIT: { pn_acceptor_t *acceptor = *tram(handler); pn_acceptor_close(acceptor); } break; default: break; } } static pn_handler_t *tra_handler(pn_acceptor_t *acceptor) { pn_handler_t *handler = pn_handler_new(tra_dispatch, sizeof(pn_acceptor_t *), NULL); *tram(handler) = acceptor; return handler; } static void test_reactor_acceptor_run(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *root = pn_reactor_get_handler(reactor); assert(root); pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", NULL); assert(acceptor); pn_handler_add(root, tra_handler(acceptor)); pn_reactor_run(reactor); pn_reactor_free(reactor); } typedef struct { pn_reactor_t *reactor; pn_acceptor_t *acceptor; pn_list_t *events; } server_t; static server_t *smem(pn_handler_t *handler) { return (server_t *) pn_handler_mem(handler); } static void server_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { server_t *srv = smem(handler); pn_list_add(srv->events, (void *) pn_event_type(event)); switch (type) { case PN_CONNECTION_REMOTE_OPEN: pn_connection_open(pn_event_connection(event)); break; case PN_CONNECTION_REMOTE_CLOSE: pn_acceptor_close(srv->acceptor); pn_connection_close(pn_event_connection(event)); pn_connection_release(pn_event_connection(event)); break; default: break; } } typedef struct { pn_list_t *events; } client_t; static client_t *cmem(pn_handler_t *handler) { return (client_t *) pn_handler_mem(handler); } static void client_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { client_t *cli = cmem(handler); pn_list_add(cli->events, (void *) type); pn_connection_t *conn = pn_event_connection(event); switch (pn_event_type(event)) { case PN_CONNECTION_INIT: pn_connection_set_hostname(conn, "some.org"); pn_connection_open(conn); break; case PN_CONNECTION_REMOTE_OPEN: pn_connection_close(conn); break; case PN_CONNECTION_REMOTE_CLOSE: pn_connection_release(conn); break; default: break; } } static void test_reactor_connect(void) { pn_reactor_t *reactor = pn_reactor(); pn_handler_t *sh = pn_handler_new(server_dispatch, sizeof(server_t), NULL); server_t *srv = smem(sh); pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", sh); srv->reactor = reactor; srv->acceptor = acceptor; srv->events = pn_list(PN_VOID, 0); pn_handler_t *ch = pn_handler_new(client_dispatch, sizeof(client_t), NULL); client_t *cli = cmem(ch); cli->events = pn_list(PN_VOID, 0); pn_connection_t *conn = pn_reactor_connection_to_host(reactor, "127.0.0.1", "5678", ch); assert(conn); pn_url_t *url = pn_url_parse(pn_reactor_get_connection_address(reactor, conn)); assert(strcmp(pn_url_get_host(url), "127.0.0.1") == 0); assert(strcmp(pn_url_get_port(url), "5678") == 0); pn_decref(url); pn_reactor_run(reactor); expect(srv->events, PN_CONNECTION_INIT, PN_CONNECTION_BOUND, PN_CONNECTION_REMOTE_OPEN, PN_CONNECTION_LOCAL_OPEN, PN_TRANSPORT, PN_CONNECTION_REMOTE_CLOSE, PN_TRANSPORT_TAIL_CLOSED, PN_CONNECTION_LOCAL_CLOSE, PN_TRANSPORT, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_CONNECTION_UNBOUND, PN_CONNECTION_FINAL, END); pn_free(srv->events); pn_decref(sh); expect(cli->events, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN, PN_CONNECTION_BOUND, PN_CONNECTION_REMOTE_OPEN, PN_CONNECTION_LOCAL_CLOSE, PN_TRANSPORT, PN_TRANSPORT_HEAD_CLOSED, PN_CONNECTION_REMOTE_CLOSE, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_CLOSED, PN_CONNECTION_UNBOUND, PN_CONNECTION_FINAL, END); pn_free(cli->events); pn_decref(ch); pn_reactor_free(reactor); } static void test_reactor_bad_domain(void) { pn_reactor_t *reactor = pn_reactor(); assert(reactor); pn_handler_t *ch = pn_handler_new(client_dispatch, sizeof(client_t), NULL); client_t *cli = cmem(ch); cli->events = pn_list(PN_VOID, 0); pn_connection_t *connection = pn_reactor_connection_to_host(reactor, "somebogusdomain", "5672", ch); assert(connection); pn_reactor_run(reactor); expect(cli->events, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN, PN_CONNECTION_BOUND, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_CONNECTION_UNBOUND, END); pn_free(cli->events); pn_decref(ch); pn_reactor_free(reactor); } typedef struct { int received; } sink_t; static sink_t *sink(pn_handler_t *handler) { return (sink_t *) pn_handler_mem(handler); } void sink_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { sink_t *snk = sink(handler); pn_delivery_t *dlv = pn_event_delivery(event); switch (type) { case PN_DELIVERY: if (!pn_delivery_partial(dlv)) { pn_delivery_settle(dlv); snk->received++; } break; default: break; } } typedef struct { int remaining; } source_t; static source_t *source(pn_handler_t *handler) { return (source_t *) pn_handler_mem(handler); } void source_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { source_t *src = source(handler); pn_connection_t *conn = pn_event_connection(event); switch (type) { case PN_CONNECTION_INIT: { pn_session_t *ssn = pn_session(conn); pn_link_t *snd = pn_sender(ssn, "sender"); pn_connection_open(conn); pn_session_open(ssn); pn_link_open(snd); } break; case PN_LINK_FLOW: { pn_link_t *link = pn_event_link(event); while (pn_link_credit(link) > 0 && src->remaining > 0) { pn_delivery_t *dlv = pn_delivery(link, pn_dtag("", 0)); assert(dlv); pn_delivery_settle(dlv); src->remaining--; } if (!src->remaining) { pn_connection_close(conn); } } break; case PN_CONNECTION_REMOTE_CLOSE: pn_connection_release(conn); break; default: break; } } static void test_reactor_transfer(int count, int window) { pn_reactor_t *reactor = pn_reactor(); pn_handler_t *sh = pn_handler_new(server_dispatch, sizeof(server_t), NULL); server_t *srv = smem(sh); pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", sh); srv->reactor = reactor; srv->acceptor = acceptor; srv->events = pn_list(PN_VOID, 0); pn_handler_add(sh, pn_handshaker()); // XXX: a window of 1 doesn't work unless the flowcontroller is // added after the thing that settles the delivery pn_handler_add(sh, pn_flowcontroller(window)); pn_handler_t *snk = pn_handler_new(sink_dispatch, sizeof(sink_t), NULL); sink(snk)->received = 0; pn_handler_add(sh, snk); pn_handler_t *ch = pn_handler_new(source_dispatch, sizeof(source_t), NULL); source_t *src = source(ch); src->remaining = count; pn_connection_t *conn = NULL; // Using the connection's hostname to set the connection address is // deprecated. Once support is dropped the conditional code can be removed: #if 0 conn = pn_reactor_connection(reactor, ch); assert(conn); pn_reactor_connection_set_address(reactor, conn, "127.0.0.1", "5678"); #else // This is deprecated: conn = pn_reactor_connection(reactor, ch); pn_connection_set_hostname(conn, "127.0.0.1:5678"); #endif pn_reactor_run(reactor); assert(sink(snk)->received == count); pn_free(srv->events); pn_reactor_free(reactor); pn_handler_free(sh); pn_handler_free(ch); } static void test_reactor_schedule(void) { pn_reactor_t *reactor = pn_reactor(); pn_handler_t *root = pn_reactor_get_handler(reactor); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_add(root, test_handler(reactor, events)); pn_reactor_schedule(reactor, 0, NULL); pn_reactor_run(reactor); pn_reactor_free(reactor); expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_REACTOR_QUIESCED, PN_TIMER_TASK, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); pn_free(events); } static void test_reactor_schedule_handler(void) { pn_reactor_t *reactor = pn_reactor(); pn_handler_t *root = pn_reactor_get_handler(reactor); pn_list_t *events = pn_list(PN_VOID, 0); pn_list_t *tevents = pn_list(PN_VOID, 0); pn_handler_add(root, test_handler(reactor, events)); pn_handler_t *th = test_handler(reactor, tevents); pn_reactor_schedule(reactor, 0, th); pn_reactor_run(reactor); pn_reactor_free(reactor); pn_handler_free(th); expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_REACTOR_QUIESCED, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); expect(tevents, PN_TIMER_TASK, END); pn_free(events); pn_free(tevents); } static void test_reactor_schedule_cancel(void) { pn_reactor_t *reactor = pn_reactor(); pn_handler_t *root = pn_reactor_get_handler(reactor); pn_list_t *events = pn_list(PN_VOID, 0); pn_handler_add(root, test_handler(reactor, events)); pn_task_t *task = pn_reactor_schedule(reactor, 0, NULL); pn_task_cancel(task); pn_reactor_run(reactor); pn_reactor_free(reactor); expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END); pn_free(events); } int main(int argc, char **argv) { test_reactor_event_root(); test_reactor(); test_reactor_free(); test_reactor_run(); test_reactor_run_free(); test_reactor_handler(); test_reactor_handler_free(); test_reactor_handler_run(); test_reactor_handler_run_free(); test_reactor_connection(); test_reactor_connection_factory(); test_reactor_bad_domain(); test_reactor_acceptor(); test_reactor_acceptor_run(); test_reactor_connect(); for (int i = 0; i < 64; i++) { test_reactor_transfer(i, 2); } test_reactor_transfer(1024, 64); test_reactor_transfer(4*1024, 1024); test_reactor_schedule(); test_reactor_schedule_handler(); test_reactor_schedule_cancel(); return 0; } qpid-proton-0.22.0/proton-c/src/tests/proactor.c0000664000000000000000000012267213257152177016452 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_tools.h" #include "test_handler.h" #include "test_config.h" #include "../proactor/proactor-internal.h" #include #include #include #include #include #include #include #include #include #include #include #include #define ARRAYLEN(A) (sizeof(A)/sizeof((A)[0])) /* Proactor and handler that take part in a test */ typedef struct test_proactor_t { test_handler_t handler; pn_proactor_t *proactor; } test_proactor_t; static test_proactor_t test_proactor(test_t *t, test_handler_fn f) { test_proactor_t tp; test_handler_init(&tp.handler, t, f); tp.proactor = pn_proactor(); TEST_ASSERT(tp.proactor); return tp; } static void test_proactor_destroy(test_proactor_t *tp) { pn_proactor_free(tp->proactor); } /* Set this to a pn_condition() to save condition data */ pn_condition_t *last_condition = NULL; static void save_condition(pn_event_t *e) { if (last_condition) { pn_condition_t *cond = NULL; if (pn_event_listener(e)) { cond = pn_listener_condition(pn_event_listener(e)); } else { cond = pn_event_condition(e); } if (cond) { pn_condition_copy(last_condition, cond); } else { pn_condition_clear(last_condition); } } } /* Process events on a proactor array until a handler returns an event, or * all proactors return NULL */ static pn_event_type_t test_proactors_get(test_proactor_t *tps, size_t n) { if (last_condition) pn_condition_clear(last_condition); while (true) { bool busy = false; for (test_proactor_t *tp = tps; tp < tps + n; ++tp) { pn_event_batch_t *eb = pn_proactor_get(tp->proactor); if (eb) { busy = true; pn_event_type_t ret = PN_EVENT_NONE; for (pn_event_t* e = pn_event_batch_next(eb); e; e = pn_event_batch_next(eb)) { test_handler_log(&tp->handler, e); save_condition(e); ret = tp->handler.f(&tp->handler, e); if (ret) break; } pn_proactor_done(tp->proactor, eb); if (ret) return ret; } } if (!busy) { return PN_EVENT_NONE; } } } /* Run an array of proactors till a handler returns an event. */ static pn_event_type_t test_proactors_run(test_proactor_t *tps, size_t n) { pn_event_type_t e; while ((e = test_proactors_get(tps, n)) == PN_EVENT_NONE) ; return e; } /* Run an array of proactors till a handler returns the desired event. */ void test_proactors_run_until(test_proactor_t *tps, size_t n, pn_event_type_t want) { while (test_proactors_get(tps, n) != want) ; } /* Drain and discard outstanding events from an array of proactors */ static void test_proactors_drain(test_proactor_t *tps, size_t n) { while (test_proactors_get(tps, n)) ; } #define TEST_PROACTORS_GET(A) test_proactors_get((A), ARRAYLEN(A)) #define TEST_PROACTORS_RUN(A) test_proactors_run((A), ARRAYLEN(A)) #define TEST_PROACTORS_RUN_UNTIL(A, WANT) test_proactors_run_until((A), ARRAYLEN(A), WANT) #define TEST_PROACTORS_DRAIN(A) test_proactors_drain((A), ARRAYLEN(A)) #define TEST_PROACTORS_DESTROY(A) do { \ for (size_t i = 0; i < ARRAYLEN(A); ++i) \ test_proactor_destroy((A)+i); \ } while (0) #define MAX_STR 256 struct addrinfo { char host[MAX_STR]; char port[MAX_STR]; char connect[MAX_STR]; char host_port[MAX_STR]; }; struct addrinfo listener_info(pn_listener_t *l) { struct addrinfo ai = {{0}}; const pn_netaddr_t *na = pn_listener_addr(l); TEST_ASSERT(0 == pn_netaddr_host_port(na, ai.host, sizeof(ai.host), ai.port, sizeof(ai.port))); for (na = pn_netaddr_next(na); na; na = pn_netaddr_next(na)) { /* Check that ports are consistent */ char port[MAX_STR]; TEST_ASSERT(0 == pn_netaddr_host_port(na, NULL, 0, port, sizeof(port))); TEST_ASSERTF(0 == strcmp(port, ai.port), "%s != %s", port, ai.port); } (void)pn_proactor_addr(ai.connect, sizeof(ai.connect), "", ai.port); /* Address for connecting */ (void)pn_netaddr_str(na, ai.host_port, sizeof(ai.host_port)); /* host:port listening address */ return ai; } /* Return a pn_listener_t*, raise errors if not successful */ pn_listener_t *test_listen(test_proactor_t *tp, const char *host) { char addr[1024]; pn_listener_t *l = pn_listener(); (void)pn_proactor_addr(addr, sizeof(addr), host, "0"); pn_proactor_listen(tp->proactor, l, addr, 4); TEST_ETYPE_EQUAL(tp->handler.t, PN_LISTENER_OPEN, test_proactors_run(tp, 1)); TEST_COND_EMPTY(tp->handler.t, last_condition); return l; } /* Wait for the next single event, return its type */ static pn_event_type_t wait_next(pn_proactor_t *proactor) { pn_event_batch_t *events = pn_proactor_wait(proactor); pn_event_type_t etype = pn_event_type(pn_event_batch_next(events)); pn_proactor_done(proactor, events); return etype; } /* Test that interrupt and timeout events cause pn_proactor_wait() to return. */ static void test_interrupt_timeout(test_t *t) { pn_proactor_t *p = pn_proactor(); TEST_CHECK(t, pn_proactor_get(p) == NULL); /* idle */ pn_proactor_interrupt(p); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INTERRUPT, wait_next(p)); TEST_CHECK(t, pn_proactor_get(p) == NULL); /* idle */ /* Set an immediate timeout */ pn_proactor_set_timeout(p, 0); TEST_ETYPE_EQUAL(t, PN_PROACTOR_TIMEOUT, wait_next(p)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, wait_next(p)); /* Inactive because timeout expired */ /* Set a (very short) timeout */ pn_proactor_set_timeout(p, 1); TEST_ETYPE_EQUAL(t, PN_PROACTOR_TIMEOUT, wait_next(p)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, wait_next(p)); /* Set and cancel a timeout, make sure we don't get the timeout event */ pn_proactor_set_timeout(p, 10000000); pn_proactor_cancel_timeout(p); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, wait_next(p)); TEST_CHECK(t, pn_proactor_get(p) == NULL); /* idle */ pn_proactor_free(p); } /* Save the last connection accepted by the common_handler */ pn_connection_t *last_accepted = NULL; /* Common handler for simple client/server interactions, */ static pn_event_type_t common_handler(test_handler_t *th, pn_event_t *e) { pn_connection_t *c = pn_event_connection(e); pn_listener_t *l = pn_event_listener(e); switch (pn_event_type(e)) { /* Stop on these events */ case PN_TRANSPORT_CLOSED: case PN_PROACTOR_INACTIVE: case PN_PROACTOR_TIMEOUT: case PN_LISTENER_OPEN: return pn_event_type(e); case PN_LISTENER_ACCEPT: last_accepted = pn_connection(); pn_listener_accept2(l, last_accepted, NULL); pn_listener_close(l); /* Only accept one connection */ return PN_EVENT_NONE; case PN_CONNECTION_REMOTE_OPEN: pn_connection_open(c); /* Return the open (no-op if already open) */ return PN_EVENT_NONE; case PN_SESSION_REMOTE_OPEN: pn_session_open(pn_event_session(e)); return PN_EVENT_NONE; case PN_LINK_REMOTE_OPEN: pn_link_open(pn_event_link(e)); return PN_EVENT_NONE; case PN_CONNECTION_REMOTE_CLOSE: pn_connection_close(c); /* Return the close */ return PN_EVENT_NONE; /* Ignore these events */ case PN_CONNECTION_BOUND: case PN_CONNECTION_INIT: case PN_CONNECTION_LOCAL_CLOSE: case PN_CONNECTION_LOCAL_OPEN: case PN_LINK_INIT: case PN_LINK_LOCAL_OPEN: case PN_LISTENER_CLOSE: case PN_SESSION_INIT: case PN_SESSION_LOCAL_OPEN: case PN_TRANSPORT: case PN_TRANSPORT_ERROR: case PN_TRANSPORT_HEAD_CLOSED: case PN_TRANSPORT_TAIL_CLOSED: return PN_EVENT_NONE; default: TEST_ERRORF(th->t, "unexpected event %s", pn_event_type_name(pn_event_type(e))); return PN_EVENT_NONE; /* Fail the test but keep going */ } } /* Like common_handler but does not auto-close the listener after one accept, and returns on LISTENER_CLOSE */ static pn_event_type_t listen_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_LISTENER_ACCEPT: /* No automatic listener close/free for tests that accept multiple connections */ last_accepted = pn_connection(); pn_listener_accept2(pn_event_listener(e), last_accepted, NULL); /* No automatic close */ return PN_EVENT_NONE; case PN_LISTENER_CLOSE: return PN_LISTENER_CLOSE; default: return common_handler(th, e); } } /* close a connection when it is remote open */ static pn_event_type_t open_close_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_REMOTE_OPEN: pn_connection_close(pn_event_connection(e)); return PN_EVENT_NONE; /* common_handler will finish on TRANSPORT_CLOSED */ default: return common_handler(th, e); } } /* Test simple client/server connection with 2 proactors */ static void test_client_server(test_t *t) { test_proactor_t tps[] ={ test_proactor(t, open_close_handler), test_proactor(t, common_handler) }; pn_listener_t *l = test_listen(&tps[1], ""); /* Connect and wait for close at both ends */ pn_proactor_connect2(tps[0].proactor, NULL, NULL, listener_info(l).connect); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); TEST_PROACTORS_DESTROY(tps); } /* Return on connection open, close and return on wake */ static pn_event_type_t open_wake_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_REMOTE_OPEN: return pn_event_type(e); case PN_CONNECTION_WAKE: pn_connection_close(pn_event_connection(e)); return pn_event_type(e); default: return common_handler(th, e); } } /* Test waking up a connection that is idle */ static void test_connection_wake(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor; pn_listener_t *l = test_listen(&tps[1], ""); pn_connection_t *c = pn_connection(); pn_incref(c); /* Keep a reference for wake() after free */ pn_proactor_connect2(client, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_CHECK(t, pn_proactor_get(client) == NULL); /* Should be idle */ pn_connection_wake(c); TEST_ETYPE_EQUAL(t, PN_CONNECTION_WAKE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* Both ends */ /* The pn_connection_t is still valid so wake is legal but a no-op */ TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_EVENT_NONE, TEST_PROACTORS_GET(tps)); /* No more wake */ /* Verify we don't get a wake after close even if they happen together */ pn_connection_t *c2 = pn_connection(); pn_proactor_connect2(client, c2, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_connection_wake(c2); pn_proactor_disconnect(client, NULL); pn_connection_wake(c2); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, test_proactors_run(&tps[0], 1)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, test_proactors_run(&tps[0], 1)); TEST_ETYPE_EQUAL(t, PN_EVENT_NONE, test_proactors_get(&tps[0], 1)); /* No late wake */ TEST_PROACTORS_DESTROY(tps); /* The pn_connection_t is still valid so wake is legal but a no-op */ pn_connection_wake(c); pn_decref(c); } /* Close the transport to abort a connection, i.e. close the socket without an AMQP close */ static pn_event_type_t listen_abort_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_REMOTE_OPEN: /* Close the transport - abruptly closes the socket */ pn_transport_close_tail(pn_connection_transport(pn_event_connection(e))); pn_transport_close_head(pn_connection_transport(pn_event_connection(e))); return PN_EVENT_NONE; default: /* Don't auto-close the listener to keep the event sequences simple */ return listen_handler(th, e); } } /* Verify that pn_transport_close_head/tail aborts a connection without an AMQP protocol close */ static void test_abort(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_close_handler), test_proactor(t, listen_abort_handler) }; pn_proactor_t *client = tps[0].proactor; pn_listener_t *l = test_listen(&tps[1], ""); pn_proactor_connect2(client, NULL, NULL, listener_info(l).connect); /* server transport closes */ if (TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps))) { TEST_COND_NAME(t, "amqp:connection:framing-error",last_condition); TEST_COND_DESC(t, "abort", last_condition); } /* client transport closes */ if (TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps))) { TEST_COND_NAME(t, "amqp:connection:framing-error", last_condition); TEST_COND_DESC(t, "abort", last_condition); } pn_listener_close(l); while (TEST_PROACTORS_RUN(tps) != PN_PROACTOR_INACTIVE) {} while (TEST_PROACTORS_RUN(tps) != PN_PROACTOR_INACTIVE) {} /* Verify expected event sequences, no unexpected events */ TEST_HANDLER_EXPECT( &tps[0].handler, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN, PN_CONNECTION_BOUND, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_PROACTOR_INACTIVE, 0); TEST_HANDLER_EXPECT( &tps[1].handler, PN_LISTENER_OPEN, PN_LISTENER_ACCEPT, PN_CONNECTION_INIT, PN_CONNECTION_BOUND, PN_CONNECTION_REMOTE_OPEN, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_LISTENER_CLOSE, PN_PROACTOR_INACTIVE, 0); TEST_PROACTORS_DESTROY(tps); } /* Refuse a connection: abort before the AMQP open sequence begins. */ static pn_event_type_t listen_refuse_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_BOUND: /* Close the transport - abruptly closes the socket */ pn_transport_close_tail(pn_connection_transport(pn_event_connection(e))); pn_transport_close_head(pn_connection_transport(pn_event_connection(e))); return PN_EVENT_NONE; default: /* Don't auto-close the listener to keep the event sequences simple */ return listen_handler(th, e); } } /* Verify that pn_transport_close_head/tail aborts a connection without an AMQP protocol close */ static void test_refuse(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_close_handler), test_proactor(t, listen_refuse_handler) }; pn_proactor_t *client = tps[0].proactor; pn_listener_t *l = test_listen(&tps[1], ""); pn_proactor_connect2(client, NULL, NULL, listener_info(l).connect); /* client transport closes */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* client */ TEST_COND_NAME(t, "amqp:connection:framing-error", last_condition); pn_listener_close(l); while (TEST_PROACTORS_RUN(tps) != PN_PROACTOR_INACTIVE) {} while (TEST_PROACTORS_RUN(tps) != PN_PROACTOR_INACTIVE) {} /* Verify expected event sequences, no unexpected events */ TEST_HANDLER_EXPECT( &tps[0].handler, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN, PN_CONNECTION_BOUND, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_PROACTOR_INACTIVE, 0); TEST_HANDLER_EXPECT( &tps[1].handler, PN_LISTENER_OPEN, PN_LISTENER_ACCEPT, PN_CONNECTION_INIT, PN_CONNECTION_BOUND, PN_TRANSPORT_TAIL_CLOSED, PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED, PN_LISTENER_CLOSE, PN_PROACTOR_INACTIVE, 0); TEST_PROACTORS_DESTROY(tps); } /* Test that INACTIVE event is generated when last connections/listeners closes. */ static void test_inactive(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor, *server = tps[1].proactor; /* Listen, connect, disconnect */ pn_listener_t *l = test_listen(&tps[1], ""); pn_connection_t *c = pn_connection(); pn_proactor_connect2(client, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_connection_wake(c); TEST_ETYPE_EQUAL(t, PN_CONNECTION_WAKE, TEST_PROACTORS_RUN(tps)); /* Expect TRANSPORT_CLOSED from client and server, INACTIVE from client */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Immediate timer generates INACTIVE on client (no connections) */ pn_proactor_set_timeout(client, 0); TEST_ETYPE_EQUAL(t, PN_PROACTOR_TIMEOUT, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Connect, set-timer, disconnect */ pn_proactor_set_timeout(client, 1000000); c = pn_connection(); pn_proactor_connect2(client, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_connection_wake(c); TEST_ETYPE_EQUAL(t, PN_CONNECTION_WAKE, TEST_PROACTORS_RUN(tps)); /* Expect TRANSPORT_CLOSED from client and server */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* No INACTIVE till timer is cancelled */ TEST_CHECK(t, pn_proactor_get(server) == NULL); pn_proactor_cancel_timeout(client); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Server won't be INACTIVE until listener is closed */ TEST_CHECK(t, pn_proactor_get(server) == NULL); pn_listener_close(l); TEST_ETYPE_EQUAL(t, PN_LISTENER_CLOSE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); TEST_PROACTORS_DESTROY(tps); } /* Tests for error handling */ static void test_errors(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor, *server = tps[1].proactor; /* Invalid connect/listen service name */ pn_connection_t *c = pn_connection(); pn_proactor_connect2(client, c, NULL, "127.0.0.1:xxx"); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_COND_DESC(t, "xxx", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); pn_proactor_listen(server, pn_listener(), "127.0.0.1:xxx", 1); TEST_PROACTORS_RUN(tps); TEST_HANDLER_EXPECT(&tps[1].handler, PN_LISTENER_CLOSE, 0); /* CLOSE only, no OPEN */ TEST_COND_DESC(t, "xxx", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Invalid connect/listen host name */ c = pn_connection(); pn_proactor_connect2(client, c, NULL, "nosuch.example.com:"); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_COND_DESC(t, "nosuch", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); test_handler_clear(&tps[1].handler, 0); pn_proactor_listen(server, pn_listener(), "nosuch.example.com:", 1); TEST_PROACTORS_RUN(tps); TEST_HANDLER_EXPECT(&tps[1].handler, PN_LISTENER_CLOSE, 0); /* CLOSE only, no OPEN */ TEST_COND_DESC(t, "nosuch", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Listen on a port already in use */ pn_listener_t *l = pn_listener(); pn_proactor_listen(server, l, ":0", 1); TEST_ETYPE_EQUAL(t, PN_LISTENER_OPEN, TEST_PROACTORS_RUN(tps)); test_handler_clear(&tps[1].handler, 0); struct addrinfo laddr = listener_info(l); pn_proactor_listen(server, pn_listener(), laddr.connect, 1); /* Busy */ TEST_PROACTORS_RUN(tps); TEST_HANDLER_EXPECT(&tps[1].handler, PN_LISTENER_CLOSE, 0); /* CLOSE only, no OPEN */ TEST_COND_NAME(t, "proton:io", last_condition); pn_listener_close(l); TEST_ETYPE_EQUAL(t, PN_LISTENER_CLOSE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Connect with no listener */ c = pn_connection(); pn_proactor_connect2(client, c, NULL, laddr.connect); if (TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps))) { TEST_COND_DESC(t, "refused", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); } TEST_PROACTORS_DESTROY(tps); } /* Closing the connection during PN_TRANSPORT_ERROR should be a no-op * Regression test for: https://issues.apache.org/jira/browse/PROTON-1586 */ static pn_event_type_t transport_close_connection_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_TRANSPORT_ERROR: pn_connection_close(pn_event_connection(e)); break; default: return open_wake_handler(th, e); } return PN_EVENT_NONE; } /* Closing the connection during PN_TRANSPORT_ERROR due to connection failure should be a no-op * Regression test for: https://issues.apache.org/jira/browse/PROTON-1586 */ static void test_proton_1586(test_t *t) { test_proactor_t tps[] = { test_proactor(t, transport_close_connection_handler) }; pn_proactor_connect2(tps[0].proactor, NULL, NULL, ":yyy"); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_COND_DESC(t, ":yyy", last_condition); test_handler_clear(&tps[0].handler, 0); /* Clear events */ /* There should be no events generated after PN_TRANSPORT_CLOSED */ TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); TEST_HANDLER_EXPECT(&tps[0].handler,PN_PROACTOR_INACTIVE, 0); TEST_PROACTORS_DESTROY(tps); } /* Test that we can control listen/select on ipv6/v4 and listen on both by default */ static void test_ipv4_ipv6(test_t *t) { test_proactor_t tps[] ={ test_proactor(t, open_close_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor, *server = tps[1].proactor; /* Listen on all interfaces for IPv4 only. */ pn_listener_t *l4 = test_listen(&tps[1], "0.0.0.0"); TEST_PROACTORS_DRAIN(tps); /* Empty address listens on both IPv4 and IPv6 on all interfaces */ pn_listener_t *l = test_listen(&tps[1], ""); TEST_PROACTORS_DRAIN(tps); #define EXPECT_CONNECT(LISTENER, HOST) do { \ char addr[1024]; \ pn_proactor_addr(addr, sizeof(addr), HOST, listener_info(LISTENER).port); \ pn_proactor_connect2(client, NULL, NULL, addr); \ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); \ TEST_COND_EMPTY(t, last_condition); \ TEST_PROACTORS_DRAIN(tps); \ } while(0) EXPECT_CONNECT(l4, "127.0.0.1"); /* v4->v4 */ EXPECT_CONNECT(l4, ""); /* local->v4*/ EXPECT_CONNECT(l, "127.0.0.1"); /* v4->all */ EXPECT_CONNECT(l, ""); /* local->all */ /* Listen on ipv6 loopback, if it fails skip ipv6 tests. NOTE: Don't use the unspecified address "::" here - ipv6-disabled platforms may allow listening on "::" without complaining. However they won't have a local ipv6 loopback configured, so "::1" will force an error. */ TEST_PROACTORS_DRAIN(tps); pn_listener_t *l6 = pn_listener(); pn_proactor_listen(server, l6, "::1:0", 4); pn_event_type_t e = TEST_PROACTORS_RUN(tps); if (e == PN_LISTENER_OPEN && !pn_condition_is_set(last_condition)) { TEST_PROACTORS_DRAIN(tps); EXPECT_CONNECT(l6, "::1"); /* v6->v6 */ EXPECT_CONNECT(l6, ""); /* local->v6 */ EXPECT_CONNECT(l, "::1"); /* v6->all */ pn_listener_close(l6); } else { const char *d = pn_condition_get_description(last_condition); TEST_LOGF(t, "skip IPv6 tests: %s %s", pn_event_type_name(e), d ? d : "no condition"); } pn_listener_close(l); pn_listener_close(l4); TEST_PROACTORS_DESTROY(tps); } /* Make sure we clean up released connections and open sockets correctly */ static void test_release_free(test_t *t) { test_proactor_t tps[] = { test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor; pn_listener_t *l = test_listen(&tps[1], ""); /* leave one connection to the proactor */ pn_proactor_connect2(client, NULL, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); /* release c1 and free immediately */ pn_connection_t *c1 = pn_connection(); pn_proactor_connect2(client, c1, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_proactor_release_connection(c1); /* We free but socket should still be cleaned up */ pn_connection_free(c1); TEST_CHECK(t, pn_proactor_get(client) == NULL); /* Should be idle */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* Server closed */ /* release c2 and but don't free till after proactor free */ pn_connection_t *c2 = pn_connection(); pn_proactor_connect2(client, c2, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_proactor_release_connection(c2); TEST_CHECK(t, pn_proactor_get(client) == NULL); /* Should be idle */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* Server closed */ TEST_PROACTORS_DESTROY(tps); pn_connection_free(c2); /* Check freeing a listener or connection that was never given to a proactor */ pn_listener_free(pn_listener()); pn_connection_free(pn_connection()); } #define SSL_FILE(NAME) CMAKE_CURRENT_SOURCE_DIR "/ssl_certs/" NAME #define SSL_PW "tserverpw" /* Windows vs. OpenSSL certificates */ #if defined(_WIN32) # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.p12") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, SSL_FILE(NAME "-full.p12"), "", SSL_PW) #else # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.pem") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, CERTIFICATE(NAME), SSL_FILE(NAME "-private-key.pem"), SSL_PW) #endif static pn_event_type_t ssl_handler(test_handler_t *h, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_BOUND: TEST_CHECK(h->t, 0 == pn_ssl_init(pn_ssl(pn_event_transport(e)), h->ssl_domain, NULL)); return PN_EVENT_NONE; case PN_CONNECTION_REMOTE_OPEN: { pn_ssl_t *ssl = pn_ssl(pn_event_transport(e)); TEST_CHECK(h->t, ssl); char protocol[256]; TEST_CHECK(h->t, pn_ssl_get_protocol_name(ssl, protocol, sizeof(protocol))); TEST_STR_IN(h->t, "TLS", protocol); return PN_CONNECTION_REMOTE_OPEN; } default: return PN_EVENT_NONE; } } static pn_event_type_t ssl_server_handler(test_handler_t *h, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_BOUND: return ssl_handler(h, e); case PN_CONNECTION_REMOTE_OPEN: { pn_event_type_t et = ssl_handler(h, e); pn_connection_open(pn_event_connection(e)); return et; } default: return listen_handler(h, e); } } static pn_event_type_t ssl_client_handler(test_handler_t *h, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_BOUND: return ssl_handler(h, e); case PN_CONNECTION_REMOTE_OPEN: { pn_event_type_t et = ssl_handler(h, e); pn_connection_close(pn_event_connection(e)); return et; } break; default: return common_handler(h, e); } } /* Test various SSL connections between proactors*/ static void test_ssl(test_t *t) { if (!pn_ssl_present()) { TEST_LOGF(t, "Skip SSL test, no support"); return; } test_proactor_t tps[] ={ test_proactor(t, ssl_client_handler), test_proactor(t, ssl_server_handler) }; test_proactor_t *client = &tps[0], *server = &tps[1]; pn_ssl_domain_t *cd = client->handler.ssl_domain = pn_ssl_domain(PN_SSL_MODE_CLIENT); pn_ssl_domain_t *sd = server->handler.ssl_domain = pn_ssl_domain(PN_SSL_MODE_SERVER); TEST_CHECK(t, 0 == SET_CREDENTIALS(sd, "tserver")); pn_listener_t *l = test_listen(server, ""); /* Basic SSL connection */ pn_proactor_connect2(client->proactor, NULL, NULL, listener_info(l).connect); /* Open ok at both ends */ TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_COND_EMPTY(t, last_condition); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_COND_EMPTY(t, last_condition); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); /* Verify peer with good hostname */ TEST_INT_EQUAL(t, 0, pn_ssl_domain_set_trusted_ca_db(cd, CERTIFICATE("tserver"))); TEST_INT_EQUAL(t, 0, pn_ssl_domain_set_peer_authentication(cd, PN_SSL_VERIFY_PEER_NAME, NULL)); pn_connection_t *c = pn_connection(); pn_connection_set_hostname(c, "test_server"); pn_proactor_connect2(client->proactor, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_COND_EMPTY(t, last_condition); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_COND_EMPTY(t, last_condition); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED); /* Verify peer with bad hostname */ c = pn_connection(); pn_connection_set_hostname(c, "wrongname"); pn_proactor_connect2(client->proactor, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_COND_NAME(t, "amqp:connection:framing-error", last_condition); TEST_COND_DESC(t, "SSL", last_condition); TEST_PROACTORS_DRAIN(tps); pn_ssl_domain_free(cd); pn_ssl_domain_free(sd); TEST_PROACTORS_DESTROY(tps); } static void test_proactor_addr(test_t *t) { /* Test the address formatter */ char addr[PN_MAX_ADDR]; pn_proactor_addr(addr, sizeof(addr), "foo", "bar"); TEST_STR_EQUAL(t, "foo:bar", addr); pn_proactor_addr(addr, sizeof(addr), "foo", ""); TEST_STR_EQUAL(t, "foo:", addr); pn_proactor_addr(addr, sizeof(addr), "foo", NULL); TEST_STR_EQUAL(t, "foo:", addr); pn_proactor_addr(addr, sizeof(addr), "", "bar"); TEST_STR_EQUAL(t, ":bar", addr); pn_proactor_addr(addr, sizeof(addr), NULL, "bar"); TEST_STR_EQUAL(t, ":bar", addr); pn_proactor_addr(addr, sizeof(addr), "1:2:3:4", "5"); TEST_STR_EQUAL(t, "1:2:3:4:5", addr); pn_proactor_addr(addr, sizeof(addr), "1:2:3:4", ""); TEST_STR_EQUAL(t, "1:2:3:4:", addr); pn_proactor_addr(addr, sizeof(addr), "1:2:3:4", NULL); TEST_STR_EQUAL(t, "1:2:3:4:", addr); } static void test_parse_addr(test_t *t) { char buf[1024]; const char *host, *port; TEST_CHECK(t, 0 == pni_parse_addr("foo:bar", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "foo", host); TEST_STR_EQUAL(t, "bar", port); TEST_CHECK(t, 0 == pni_parse_addr("foo:", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "foo", host); TEST_STR_EQUAL(t, "5672", port); TEST_CHECK(t, 0 == pni_parse_addr(":bar", buf, sizeof(buf), &host, &port)); TEST_CHECKF(t, NULL == host, "expected null, got: %s", host); TEST_STR_EQUAL(t, "bar", port); TEST_CHECK(t, 0 == pni_parse_addr(":", buf, sizeof(buf), &host, &port)); TEST_CHECKF(t, NULL == host, "expected null, got: %s", host); TEST_STR_EQUAL(t, "5672", port); TEST_CHECK(t, 0 == pni_parse_addr(":amqps", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "5671", port); TEST_CHECK(t, 0 == pni_parse_addr(":amqp", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "5672", port); TEST_CHECK(t, 0 == pni_parse_addr("::1:2:3", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "::1:2", host); TEST_STR_EQUAL(t, "3", port); TEST_CHECK(t, 0 == pni_parse_addr(":::", buf, sizeof(buf), &host, &port)); TEST_STR_EQUAL(t, "::", host); TEST_STR_EQUAL(t, "5672", port); TEST_CHECK(t, 0 == pni_parse_addr("", buf, sizeof(buf), &host, &port)); TEST_CHECKF(t, NULL == host, "expected null, got: %s", host); TEST_STR_EQUAL(t, "5672", port); } /* Test pn_proactor_addr functions */ static void test_netaddr(test_t *t) { test_proactor_t tps[] ={ test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor; /* Use IPv4 to get consistent results all platforms */ pn_listener_t *l = test_listen(&tps[1], "127.0.0.1"); pn_connection_t *c = pn_connection(); pn_proactor_connect2(client, c, NULL, listener_info(l).connect); if (!TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps))) { TEST_COND_EMPTY(t, last_condition); /* Show the last condition */ return; /* don't continue if connection is closed */ } /* client remote, client local, server remote and server local address strings */ char cr[1024], cl[1024], sr[1024], sl[1024]; pn_transport_t *ct = pn_connection_transport(c); const pn_netaddr_t *na = pn_transport_remote_addr(ct); pn_netaddr_str(na, cr, sizeof(cr)); TEST_STR_IN(t, listener_info(l).port, cr); /* remote address has listening port */ pn_connection_t *s = last_accepted; /* server side of the connection */ pn_transport_t *st = pn_connection_transport(s); if (!TEST_CHECK(t, st)) return; pn_netaddr_str(pn_transport_local_addr(st), sl, sizeof(sl)); TEST_STR_EQUAL(t, cr, sl); /* client remote == server local */ pn_netaddr_str(pn_transport_local_addr(ct), cl, sizeof(cl)); pn_netaddr_str(pn_transport_remote_addr(st), sr, sizeof(sr)); TEST_STR_EQUAL(t, cl, sr); /* client local == server remote */ char host[MAX_STR] = ""; char serv[MAX_STR] = ""; int err = pn_netaddr_host_port(na, host, sizeof(host), serv, sizeof(serv)); TEST_CHECK(t, 0 == err); TEST_STR_EQUAL(t, "127.0.0.1", host); TEST_STR_EQUAL(t, listener_info(l).port, serv); /* Make sure you can use NULL, 0 to get length of address string without a crash */ size_t len = pn_netaddr_str(pn_transport_local_addr(ct), NULL, 0); TEST_CHECKF(t, strlen(cl) == len, "%d != %d", strlen(cl), len); TEST_PROACTORS_DRAIN(tps); TEST_PROACTORS_DESTROY(tps); } /* Test pn_proactor_disconnect */ static void test_disconnect(test_t *t) { test_proactor_t tps[] ={ test_proactor(t, open_wake_handler), test_proactor(t, listen_handler) }; pn_proactor_t *client = tps[0].proactor, *server = tps[1].proactor; /* Start two listeners */ pn_listener_t *l = test_listen(&tps[1], ""); pn_listener_t *l2 = test_listen(&tps[1], ""); /* Only wait for one connection to remote-open before disconnect */ pn_connection_t *c = pn_connection(); pn_proactor_connect2(client, c, NULL, listener_info(l).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_connection_t *c2 = pn_connection(); pn_proactor_connect2(client, c2, NULL, listener_info(l2).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); TEST_PROACTORS_DRAIN(tps); /* Disconnect the client proactor */ pn_condition_t *cond = pn_condition(); pn_condition_set_name(cond, "test-name"); pn_condition_set_description(cond, "test-description"); pn_proactor_disconnect(client, cond); /* Verify expected client side first */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, test_proactors_run(&tps[0], 1)); TEST_COND_NAME(t, "test-name", last_condition); TEST_COND_DESC(t, "test-description", last_condition); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, test_proactors_run(&tps[0], 1)); TEST_COND_NAME(t, "test-name", last_condition); TEST_COND_DESC(t, "test-description", last_condition); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, test_proactors_run(&tps[0], 1)); /* Now check server sees the disconnects */ TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_TRANSPORT_CLOSED, TEST_PROACTORS_RUN(tps)); /* Now disconnect the server end (the listeners) */ pn_proactor_disconnect(server, cond); pn_condition_free(cond); TEST_ETYPE_EQUAL(t, PN_LISTENER_CLOSE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_LISTENER_CLOSE, TEST_PROACTORS_RUN(tps)); TEST_ETYPE_EQUAL(t, PN_PROACTOR_INACTIVE, TEST_PROACTORS_RUN(tps)); /* Make sure the proactors are still functional */ pn_listener_t *l3 = test_listen(&tps[1], ""); pn_proactor_connect2(client, NULL, NULL, listener_info(l3).connect); TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps)); pn_proactor_disconnect(client, NULL); TEST_PROACTORS_DRAIN(tps); TEST_PROACTORS_DESTROY(tps); } struct message_stream_context { pn_link_t *sender; pn_delivery_t *dlv; pn_rwbytes_t send_buf, recv_buf; ssize_t size, sent, received; bool complete; }; #define FRAME 512 /* Smallest legal frame */ #define CHUNK (FRAME + FRAME/2) /* Chunk overflows frame */ #define BODY (CHUNK*3 + CHUNK/2) /* Body doesn't fit into chunks */ static pn_event_type_t message_stream_handler(test_handler_t *th, pn_event_t *e) { struct message_stream_context *ctx = (struct message_stream_context*)th->context; switch (pn_event_type(e)) { case PN_CONNECTION_BOUND: pn_transport_set_max_frame(pn_event_transport(e), FRAME); return PN_EVENT_NONE; case PN_SESSION_INIT: pn_session_set_incoming_capacity(pn_event_session(e), FRAME); /* Single frame incoming */ pn_session_set_outgoing_window(pn_event_session(e), 1); /* Single frame outgoing */ return PN_EVENT_NONE; case PN_LINK_REMOTE_OPEN: common_handler(th, e); if (pn_link_is_receiver(pn_event_link(e))) { pn_link_flow(pn_event_link(e), 1); } else { ctx->sender = pn_event_link(e); } return PN_EVENT_NONE; case PN_LINK_FLOW: /* Start a delivery */ if (pn_link_is_sender(pn_event_link(e)) && !ctx->dlv) { ctx->dlv = pn_delivery(pn_event_link(e), pn_dtag("x", 1)); } return PN_LINK_FLOW; case PN_CONNECTION_WAKE: { /* Send a chunk */ ssize_t remains = ctx->size - ctx->sent; ssize_t n = (CHUNK < remains) ? CHUNK : remains; TEST_CHECK(th->t, n == pn_link_send(ctx->sender, ctx->send_buf.start + ctx->sent, n)); ctx->sent += n; if (ctx->sent == ctx->size) { TEST_CHECK(th->t, pn_link_advance(ctx->sender)); } return PN_CONNECTION_WAKE; } case PN_DELIVERY: { /* Receive a delivery - smaller than a chunk? */ pn_delivery_t *dlv = pn_event_delivery(e); if (pn_delivery_readable(dlv)) { ssize_t n = pn_delivery_pending(dlv); rwbytes_ensure(&ctx->recv_buf, ctx->received + n); TEST_ASSERT(n == pn_link_recv(pn_event_link(e), ctx->recv_buf.start + ctx->received, n)); ctx->received += n; } ctx->complete = !pn_delivery_partial(dlv); return PN_DELIVERY; } default: return common_handler(th, e); } } /* Test sending/receiving a message in chunks */ static void test_message_stream(test_t *t) { test_proactor_t tps[] ={ test_proactor(t, message_stream_handler), test_proactor(t, message_stream_handler) }; pn_proactor_t *client = tps[0].proactor; pn_listener_t *l = test_listen(&tps[1], ""); struct message_stream_context ctx = { 0 }; tps[0].handler.context = &ctx; tps[1].handler.context = &ctx; /* Encode a large (not very) message to send in chunks */ char *body = (char*)malloc(BODY); memset(body, 'x', BODY); pn_message_t *m = pn_message(); pn_data_put_binary(pn_message_body(m), pn_bytes(BODY, body)); free(body); ctx.size = message_encode(m, &ctx.send_buf); pn_message_free(m); pn_connection_t *c = pn_connection(); pn_proactor_connect2(client, c, NULL, listener_info(l).connect); pn_session_t *ssn = pn_session(c); pn_session_open(ssn); pn_link_t *snd = pn_sender(ssn, "x"); pn_link_open(snd); TEST_PROACTORS_RUN_UNTIL(tps, PN_LINK_FLOW); /* Send and receive the message in chunks */ do { pn_connection_wake(c); /* Initiate send/receive of one chunk */ do { /* May be multiple receives for one send */ TEST_PROACTORS_RUN_UNTIL(tps, PN_DELIVERY); } while (ctx.received < ctx.sent); } while (!ctx.complete); TEST_CHECK(t, ctx.received == ctx.size); TEST_CHECK(t, ctx.sent == ctx.size); TEST_CHECK(t, !memcmp(ctx.send_buf.start, ctx.recv_buf.start, ctx.size)); free(ctx.send_buf.start); free(ctx.recv_buf.start); TEST_PROACTORS_DESTROY(tps); } int main(int argc, char **argv) { int failed = 0; last_condition = pn_condition(); RUN_ARGV_TEST(failed, t, test_inactive(&t)); RUN_ARGV_TEST(failed, t, test_interrupt_timeout(&t)); RUN_ARGV_TEST(failed, t, test_errors(&t)); RUN_ARGV_TEST(failed, t, test_proton_1586(&t)); RUN_ARGV_TEST(failed, t, test_client_server(&t)); RUN_ARGV_TEST(failed, t, test_connection_wake(&t)); RUN_ARGV_TEST(failed, t, test_ipv4_ipv6(&t)); RUN_ARGV_TEST(failed, t, test_release_free(&t)); #if !defined(_WIN32) RUN_ARGV_TEST(failed, t, test_ssl(&t)); #endif RUN_ARGV_TEST(failed, t, test_proactor_addr(&t)); RUN_ARGV_TEST(failed, t, test_parse_addr(&t)); RUN_ARGV_TEST(failed, t, test_netaddr(&t)); RUN_ARGV_TEST(failed, t, test_disconnect(&t)); RUN_ARGV_TEST(failed, t, test_abort(&t)); RUN_ARGV_TEST(failed, t, test_refuse(&t)); RUN_ARGV_TEST(failed, t, test_message_stream(&t)); pn_condition_free(last_condition); return failed; } qpid-proton-0.22.0/proton-c/src/tests/parse-url.c0000664000000000000000000001445213257152177016527 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include "proton/type_compat.h" #include "proton/error.h" #include "proton/url.h" static bool verify(const char* what, const char* want, const char* got) { bool eq = (want == got || (want && got && strcmp(want, got) == 0)); if (!eq) printf(" %s: '%s' != '%s'\n", what, want, got); return eq; } static bool test(const char* url, const char* scheme, const char* user, const char* pass, const char* host, const char* port, const char*path) { pn_url_t *purl = pn_url_parse(url); bool ok = verify("scheme", scheme, pn_url_get_scheme(purl)) && verify("user", user, pn_url_get_username(purl)) && verify("pass", pass, pn_url_get_password(purl)) && verify("host", host, pn_url_get_host(purl)) && verify("port", port, pn_url_get_port(purl)) && verify("path", path, pn_url_get_path(purl)); pn_url_free(purl); return ok; } // Run test and additionally verify the round trip of parse and stringify // matches original string. static bool testrt(const char* url, const char* scheme, const char* user, const char* pass, const char* host, const char* port, const char*path) { bool ok = test(url, scheme, user, pass, host, port, path); pn_url_t *purl = pn_url_parse(url); ok = ok && verify("url", url, pn_url_str(purl)); pn_url_free(purl); return ok; } #define TEST(EXPR) \ do { if (!(EXPR)) { printf("%s:%d: %s\n\n", __FILE__, __LINE__, #EXPR); failed++; } } while(0) int main(int argc, char **argv) { int failed = 0; TEST(testrt("/Foo.bar:90087@somewhere", 0, 0, 0, 0, 0, "Foo.bar:90087@somewhere")); TEST(testrt("host", 0, 0, 0, "host", 0, 0)); TEST(testrt("host:423", 0, 0, 0, "host", "423", 0)); TEST(testrt("user@host", 0, "user", 0, "host", 0, 0)); // Can't round-trip passwords with ':', not strictly legal but the parser allows it. TEST(test("user:1243^&^:pw@host:423", 0, "user", "1243^&^:pw", "host", "423", 0)); TEST(test("user:1243^&^:pw@host:423/Foo.bar:90087", 0, "user", "1243^&^:pw", "host", "423", "Foo.bar:90087")); TEST(test("user:1243^&^:pw@host:423/Foo.bar:90087@somewhere", 0, "user", "1243^&^:pw", "host", "423", "Foo.bar:90087@somewhere")); TEST(testrt("[::1]", 0, 0, 0, "::1", 0, 0)); TEST(testrt("[::1]:amqp", 0, 0, 0, "::1", "amqp", 0)); TEST(testrt("user@[::1]", 0, "user", 0, "::1", 0, 0)); TEST(testrt("user@[::1]:amqp", 0, "user", 0, "::1", "amqp", 0)); // Can't round-trip passwords with ':', not strictly legal but the parser allows it. TEST(test("user:1243^&^:pw@[::1]:amqp", 0, "user", "1243^&^:pw", "::1", "amqp", 0)); TEST(test("user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", "::1", "amqp", "Foo.bar:90087")); TEST(test("user:1243^&^:pw@[::1:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", "[::1", "amqp", "Foo.bar:90087")); TEST(test("user:1243^&^:pw@::1]:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", "::1]", "amqp", "Foo.bar:90087")); TEST(testrt("amqp://user@[::1]", "amqp", "user", 0, "::1", 0, 0)); TEST(testrt("amqp://user@[::1]:amqp", "amqp", "user", 0, "::1", "amqp", 0)); TEST(testrt("amqp://user@[1234:52:0:1260:f2de:f1ff:fe59:8f87]:amqp", "amqp", "user", 0, "1234:52:0:1260:f2de:f1ff:fe59:8f87", "amqp", 0)); // Can't round-trip passwords with ':', not strictly legal but the parser allows it. TEST(test("amqp://user:1243^&^:pw@[::1]:amqp", "amqp", "user", "1243^&^:pw", "::1", "amqp", 0)); TEST(test("amqp://user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", "amqp", "user", "1243^&^:pw", "::1", "amqp", "Foo.bar:90087")); TEST(testrt("amqp://host", "amqp", 0, 0, "host", 0, 0)); TEST(testrt("amqp://user@host", "amqp", "user", 0, "host", 0, 0)); TEST(testrt("amqp://user@host/path:%", "amqp", "user", 0, "host", 0, "path:%")); TEST(testrt("amqp://user@host:5674/path:%", "amqp", "user", 0, "host", "5674", "path:%")); TEST(testrt("amqp://user@host/path:%", "amqp", "user", 0, "host", 0, "path:%")); TEST(testrt("amqp://bigbird@host/queue@host", "amqp", "bigbird", 0, "host", 0, "queue@host")); TEST(testrt("amqp://host/queue@host", "amqp", 0, 0, "host", 0, "queue@host")); TEST(testrt("amqp://host:9765/queue@host", "amqp", 0, 0, "host", "9765", "queue@host")); TEST(test("user:pass%2fword@host", 0, "user", "pass/word", "host", 0, 0)); TEST(testrt("user:pass%2Fword@host", 0, "user", "pass/word", "host", 0, 0)); // Can't round-trip passwords with lowercase hex encoding TEST(test("us%2fer:password@host", 0, "us/er", "password", "host", 0, 0)); TEST(testrt("us%2Fer:password@host", 0, "us/er", "password", "host", 0, 0)); // Can't round-trip passwords with lowercase hex encoding TEST(test("user:pass%2fword%@host", 0, "user", "pass/word%", "host", 0, 0)); TEST(testrt("localhost/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", 0, 0, 0, "localhost", 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0")); TEST(testrt("/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", 0, 0, 0, 0, 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0")); TEST(testrt("amqp://localhost/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", "amqp", 0, 0, "localhost", 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0")); // PROTON-995 TEST(testrt("amqps://%40user%2F%3A:%40pass%2F%3A@example.net/some_topic", "amqps", "@user/:", "@pass/:", "example.net", 0, "some_topic")); TEST(testrt("amqps://user%2F%3A=:pass%2F%3A=@example.net/some_topic", "amqps", "user/:=", "pass/:=", "example.net", 0, "some_topic")); // Really perverse url TEST(testrt("://:@://:", "", "", "", 0, "", "/:")); return failed; } qpid-proton-0.22.0/proton-c/src/tests/object.c0000664000000000000000000006715213257152177016070 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #define assert(E) ((E) ? 0 : (abort(), 0)) static char mem; static void *END = &mem; static pn_list_t *build_list(size_t capacity, ...) { pn_list_t *result = pn_list(PN_OBJECT, capacity); va_list ap; va_start(ap, capacity); while (true) { void *arg = va_arg(ap, void *); if (arg == END) { break; } pn_list_add(result, arg); pn_class_decref(PN_OBJECT, arg); } va_end(ap); return result; } static pn_map_t *build_map(float load_factor, size_t capacity, ...) { pn_map_t *result = pn_map(PN_OBJECT, PN_OBJECT, capacity, load_factor); va_list ap; void *prev = NULL; va_start(ap, capacity); int count = 0; while (true) { void *arg = va_arg(ap, void *); bool last = arg == END; if (arg == END) { arg = NULL; } if (count % 2) { pn_map_put(result, prev, arg); pn_class_decref(PN_OBJECT, prev); pn_class_decref(PN_OBJECT, arg); } else { prev = arg; } if (last) { break; } count++; } va_end(ap); return result; } static void noop(void *o) {} static uintptr_t zero(void *o) { return 0; } static intptr_t delta(void *a, void *b) { return (uintptr_t) b - (uintptr_t) a; } #define CID_noop CID_pn_object #define noop_initialize noop #define noop_finalize noop #define noop_hashcode zero #define noop_compare delta #define noop_inspect NULL static const pn_class_t noop_class = PN_CLASS(noop); static void test_class(const pn_class_t *clazz, size_t size) { void *a = pn_class_new(clazz, size); void *b = pn_class_new(clazz, size); assert(!pn_class_equals(clazz, a, b)); assert(pn_class_equals(clazz, a, a)); assert(pn_class_equals(clazz, b, b)); assert(!pn_class_equals(clazz, a, NULL)); assert(!pn_class_equals(clazz, NULL, a)); int rca = pn_class_refcount(clazz, a); int rcb = pn_class_refcount(clazz, b); assert(rca == -1 || rca == 1); assert(rcb == -1 || rcb == 1); pn_class_incref(clazz, a); rca = pn_class_refcount(clazz, a); assert(rca == -1 || rca == 2); pn_class_decref(clazz, a); rca = pn_class_refcount(clazz, a); assert(rca == -1 || rca == 1); pn_class_free(clazz, a); pn_class_free(clazz, b); } static void test_new(size_t size, const pn_class_t *clazz) { void *obj = pn_class_new(clazz, size); assert(obj); assert(pn_class_refcount(PN_OBJECT, obj) == 1); assert(pn_class(obj) == clazz); char *bytes = (char *) obj; for (size_t i = 0; i < size; i++) { // touch everything for valgrind bytes[i] = i; } pn_free(obj); } static void finalizer(void *object) { int **called = (int **) object; (**called)++; } #define CID_finalizer CID_pn_object #define finalizer_initialize NULL #define finalizer_finalize finalizer #define finalizer_hashcode NULL #define finalizer_compare NULL #define finalizer_inspect NULL static void test_finalize(void) { static pn_class_t clazz = PN_CLASS(finalizer); int **obj = (int **) pn_class_new(&clazz, sizeof(int *)); assert(obj); int called = 0; *obj = &called; pn_free(obj); assert(called == 1); } static void test_free(void) { // just to make sure it doesn't seg fault or anything pn_free(NULL); } static uintptr_t hashcode(void *obj) { return (uintptr_t) obj; } #define CID_hashcode CID_pn_object #define hashcode_initialize NULL #define hashcode_finalize NULL #define hashcode_compare NULL #define hashcode_hashcode hashcode #define hashcode_inspect NULL static void test_hashcode(void) { static pn_class_t clazz = PN_CLASS(hashcode); void *obj = pn_class_new(&clazz, 0); assert(obj); assert(pn_hashcode(obj) == (uintptr_t) obj); assert(pn_hashcode(NULL) == 0); pn_free(obj); } #define CID_compare CID_pn_object #define compare_initialize NULL #define compare_finalize NULL #define compare_compare delta #define compare_hashcode NULL #define compare_inspect NULL static void test_compare(void) { static pn_class_t clazz = PN_CLASS(compare); void *a = pn_class_new(&clazz, 0); assert(a); void *b = pn_class_new(&clazz, 0); assert(b); assert(pn_compare(a, b)); assert(!pn_equals(a, b)); assert(!pn_compare(a, a)); assert(pn_equals(a, a)); assert(!pn_compare(b, b)); assert(pn_equals(b, b)); assert(pn_compare(a, b) == (intptr_t) ((uintptr_t) b - (uintptr_t) a)); assert(pn_compare(NULL, b)); assert(!pn_equals(NULL, b)); assert(pn_compare(a, NULL)); assert(!pn_equals(a, NULL)); assert(!pn_compare(NULL, NULL)); assert(pn_equals(NULL, NULL)); pn_free(a); pn_free(b); } static void test_refcounting(int refs) { void *obj = pn_class_new(PN_OBJECT, 0); assert(pn_refcount(obj) == 1); for (int i = 0; i < refs; i++) { pn_incref(obj); assert(pn_refcount(obj) == i + 2); } assert(pn_refcount(obj) == refs + 1); for (int i = 0; i < refs; i++) { pn_decref(obj); assert(pn_refcount(obj) == refs - i); } assert(pn_refcount(obj) == 1); pn_free(obj); } static void test_list(size_t capacity) { pn_list_t *list = pn_list(PN_WEAKREF, 0); assert(pn_list_size(list) == 0); assert(!pn_list_add(list, (void *) 0)); assert(!pn_list_add(list, (void *) 1)); assert(!pn_list_add(list, (void *) 2)); assert(!pn_list_add(list, (void *) 3)); assert(pn_list_get(list, 0) == (void *) 0); assert(pn_list_get(list, 1) == (void *) 1); assert(pn_list_get(list, 2) == (void *) 2); assert(pn_list_get(list, 3) == (void *) 3); assert(pn_list_size(list) == 4); pn_list_del(list, 1, 2); assert(pn_list_size(list) == 2); assert(pn_list_get(list, 0) == (void *) 0); assert(pn_list_get(list, 1) == (void *) 3); pn_decref(list); } static void test_list_refcount(size_t capacity) { void *one = pn_class_new(PN_OBJECT, 0); void *two = pn_class_new(PN_OBJECT, 0); void *three = pn_class_new(PN_OBJECT, 0); void *four = pn_class_new(PN_OBJECT, 0); pn_list_t *list = pn_list(PN_OBJECT, 0); assert(!pn_list_add(list, one)); assert(!pn_list_add(list, two)); assert(!pn_list_add(list, three)); assert(!pn_list_add(list, four)); assert(pn_list_get(list, 0) == one); assert(pn_list_get(list, 1) == two); assert(pn_list_get(list, 2) == three); assert(pn_list_get(list, 3) == four); assert(pn_list_size(list) == 4); assert(pn_refcount(one) == 2); assert(pn_refcount(two) == 2); assert(pn_refcount(three) == 2); assert(pn_refcount(four) == 2); pn_list_del(list, 1, 2); assert(pn_list_size(list) == 2); assert(pn_refcount(one) == 2); assert(pn_refcount(two) == 1); assert(pn_refcount(three) == 1); assert(pn_refcount(four) == 2); assert(pn_list_get(list, 0) == one); assert(pn_list_get(list, 1) == four); assert(!pn_list_add(list, one)); assert(pn_list_size(list) == 3); assert(pn_refcount(one) == 3); pn_decref(list); assert(pn_refcount(one) == 1); assert(pn_refcount(two) == 1); assert(pn_refcount(three) == 1); assert(pn_refcount(four) == 1); pn_decref(one); pn_decref(two); pn_decref(three); pn_decref(four); } static void check_list_index(pn_list_t *list, void *value, ssize_t idx) { assert(pn_list_index(list, value) == idx); } static void test_list_index(void) { pn_list_t *l = pn_list(PN_WEAKREF, 0); void *one = pn_string("one"); void *two = pn_string("two"); void *three = pn_string("three"); void *dup1 = pn_string("dup"); void *dup2 = pn_string("dup"); void *last = pn_string("last"); pn_list_add(l, one); pn_list_add(l, two); pn_list_add(l, three); pn_list_add(l, dup1); pn_list_add(l, dup2); pn_list_add(l, last); check_list_index(l, one, 0); check_list_index(l, two, 1); check_list_index(l, three, 2); check_list_index(l, dup1, 3); check_list_index(l, dup2, 3); check_list_index(l, last, 5); void *nonexistent = pn_string("nonexistent"); check_list_index(l, nonexistent, -1); pn_free(l); pn_free(one); pn_free(two); pn_free(three); pn_free(dup1); pn_free(dup2); pn_free(last); pn_free(nonexistent); } static bool pn_strequals(const char *a, const char *b) { return !strcmp(a, b); } static void test_build_list(void) { pn_list_t *l = build_list(0, pn_string("one"), pn_string("two"), pn_string("three"), END); assert(pn_list_size(l) == 3); assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 0)), "one")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 1)), "two")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 2)), "three")); pn_free(l); } static void test_build_map(void) { pn_map_t *m = build_map(0.75, 0, pn_string("key"), pn_string("value"), pn_string("key2"), pn_string("value2"), END); assert(pn_map_size(m) == 2); pn_string_t *key = pn_string(NULL); pn_string_set(key, "key"); assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)), "value")); pn_string_set(key, "key2"); assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)), "value2")); pn_free(m); pn_free(key); } static void test_build_map_odd(void) { pn_map_t *m = build_map(0.75, 0, pn_string("key"), pn_string("value"), pn_string("key2"), pn_string("value2"), pn_string("key3"), END); assert(pn_map_size(m) == 3); pn_string_t *key = pn_string(NULL); pn_string_set(key, "key"); assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)), "value")); pn_string_set(key, "key2"); assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)), "value2")); pn_string_set(key, "key3"); assert(pn_map_get(m, key) == NULL); pn_free(m); pn_free(key); } static void test_map(void) { void *one = pn_class_new(PN_OBJECT, 0); void *two = pn_class_new(PN_OBJECT, 0); void *three = pn_class_new(PN_OBJECT, 0); pn_map_t *map = pn_map(PN_OBJECT, PN_OBJECT, 4, 0.75); assert(pn_map_size(map) == 0); pn_string_t *key = pn_string("key"); pn_string_t *dup = pn_string("key"); pn_string_t *key1 = pn_string("key1"); pn_string_t *key2 = pn_string("key2"); assert(!pn_map_put(map, key, one)); assert(pn_map_size(map) == 1); assert(!pn_map_put(map, key1, two)); assert(pn_map_size(map) == 2); assert(!pn_map_put(map, key2, three)); assert(pn_map_size(map) == 3); assert(pn_map_get(map, dup) == one); assert(!pn_map_put(map, dup, one)); assert(pn_map_size(map) == 3); assert(!pn_map_put(map, dup, two)); assert(pn_map_size(map) == 3); assert(pn_map_get(map, dup) == two); assert(pn_refcount(key) == 2); assert(pn_refcount(dup) == 1); assert(pn_refcount(key1) == 2); assert(pn_refcount(key2) == 2); assert(pn_refcount(one) == 1); assert(pn_refcount(two) == 3); assert(pn_refcount(three) == 2); pn_map_del(map, key1); assert(pn_map_size(map) == 2); assert(pn_refcount(key) == 2); assert(pn_refcount(dup) == 1); assert(pn_refcount(key1) == 1); assert(pn_refcount(key2) == 2); assert(pn_refcount(one) == 1); assert(pn_refcount(two) == 2); assert(pn_refcount(three) == 2); pn_decref(one); pn_decref(two); pn_decref(three); pn_decref(key); pn_decref(dup); pn_decref(key1); pn_decref(key2); pn_decref(map); } static void test_hash(void) { void *one = pn_class_new(PN_OBJECT, 0); void *two = pn_class_new(PN_OBJECT, 0); void *three = pn_class_new(PN_OBJECT, 0); pn_hash_t *hash = pn_hash(PN_OBJECT, 4, 0.75); pn_hash_put(hash, 0, NULL); pn_hash_put(hash, 1, one); pn_hash_put(hash, 2, two); pn_hash_put(hash, 3, three); pn_hash_put(hash, 4, one); pn_hash_put(hash, 5, two); pn_hash_put(hash, 6, three); pn_hash_put(hash, 7, one); pn_hash_put(hash, 8, two); pn_hash_put(hash, 9, three); pn_hash_put(hash, 10, one); pn_hash_put(hash, 11, two); pn_hash_put(hash, 12, three); pn_hash_put(hash, 18, one); assert(pn_hash_get(hash, 2) == two); assert(pn_hash_get(hash, 5) == two); assert(pn_hash_get(hash, 18) == one); assert(pn_hash_get(hash, 0) == NULL); assert(pn_hash_size(hash) == 14); pn_hash_del(hash, 5); assert(pn_hash_get(hash, 5) == NULL); assert(pn_hash_size(hash) == 13); pn_hash_del(hash, 18); assert(pn_hash_get(hash, 18) == NULL); assert(pn_hash_size(hash) == 12); pn_decref(hash); pn_decref(one); pn_decref(two); pn_decref(three); } // collider class: all objects have same hash, no two objects compare equal static intptr_t collider_compare(void *a, void *b) { if (a == b) return 0; return (a > b) ? 1 : -1; } static uintptr_t collider_hashcode(void *obj) { return 23; } #define CID_collider CID_pn_object #define collider_initialize NULL #define collider_finalize NULL #define collider_inspect NULL static void test_map_links(void) { const pn_class_t collider_clazz = PN_CLASS(collider); void *keys[3]; for (int i = 0; i < 3; i++) keys[i] = pn_class_new(&collider_clazz, 0); // test deleting a head, middle link, tail for (int delete_idx=0; delete_idx < 3; delete_idx++) { pn_map_t *map = pn_map(PN_WEAKREF, PN_WEAKREF, 0, 0.75); // create a chain of entries that have same head (from identical key hashcode) for (int i = 0; i < 3; i++) { pn_map_put(map, keys[i], keys[i]); } pn_map_del(map, keys[delete_idx]); for (int i = 0; i < 3; i++) { void *value = (i == delete_idx) ? NULL : keys[i]; assert (pn_map_get(map, keys[i]) == value); } pn_free(map); } for (int i = 0; i < 3; i++) pn_free(keys[i]); } static bool equals(const char *a, const char *b) { if (a == NULL && b == NULL) { return true; } if (a == NULL || b == NULL) { return false; } return !strcmp(a, b); } static void test_string(const char *value) { size_t size = value ? strlen(value) : 0; pn_string_t *str = pn_string(value); assert(equals(pn_string_get(str), value)); assert(pn_string_size(str) == size); pn_string_t *strn = pn_stringn(value, size); assert(equals(pn_string_get(strn), value)); assert(pn_string_size(strn) == size); pn_string_t *strset = pn_string(NULL); pn_string_set(strset, value); assert(equals(pn_string_get(strset), value)); assert(pn_string_size(strset) == size); pn_string_t *strsetn = pn_string(NULL); pn_string_setn(strsetn, value, size); assert(equals(pn_string_get(strsetn), value)); assert(pn_string_size(strsetn) == size); assert(pn_hashcode(str) == pn_hashcode(strn)); assert(pn_hashcode(str) == pn_hashcode(strset)); assert(pn_hashcode(str) == pn_hashcode(strsetn)); assert(!pn_compare(str, str)); assert(!pn_compare(str, strn)); assert(!pn_compare(str, strset)); assert(!pn_compare(str, strsetn)); pn_free(str); pn_free(strn); pn_free(strset); pn_free(strsetn); } static void test_stringn(const char *value, size_t size) { pn_string_t *strn = pn_stringn(value, size); assert(equals(pn_string_get(strn), value)); assert(pn_string_size(strn) == size); pn_string_t *strsetn = pn_string(NULL); pn_string_setn(strsetn, value, size); assert(equals(pn_string_get(strsetn), value)); assert(pn_string_size(strsetn) == size); assert(pn_hashcode(strn) == pn_hashcode(strsetn)); assert(!pn_compare(strn, strsetn)); pn_free(strn); pn_free(strsetn); } static void test_string_format(void) { pn_string_t *str = pn_string(""); assert(str); int err = pn_string_format(str, "%s", "this is a string that should be long " "enough to force growth but just in case we'll " "tack this other really long string on for the " "heck of it"); assert(err == 0); pn_free(str); } static void test_string_addf(void) { pn_string_t *str = pn_string("hello "); assert(str); int err = pn_string_addf(str, "%s", "this is a string that should be long " "enough to force growth but just in case we'll " "tack this other really long string on for the " "heck of it"); assert(err == 0); pn_free(str); } static void test_map_iteration(int n) { pn_list_t *pairs = pn_list(PN_OBJECT, 2*n); for (int i = 0; i < n; i++) { void *key = pn_class_new(PN_OBJECT, 0); void *value = pn_class_new(PN_OBJECT, 0); pn_list_add(pairs, key); pn_list_add(pairs, value); pn_decref(key); pn_decref(value); } pn_map_t *map = pn_map(PN_OBJECT, PN_OBJECT, 0, 0.75); assert(pn_map_head(map) == 0); for (int i = 0; i < n; i++) { pn_map_put(map, pn_list_get(pairs, 2*i), pn_list_get(pairs, 2*i + 1)); } for (pn_handle_t entry = pn_map_head(map); entry; entry = pn_map_next(map, entry)) { void *key = pn_map_key(map, entry); void *value = pn_map_value(map, entry); ssize_t idx = pn_list_index(pairs, key); assert(idx >= 0); assert(pn_list_get(pairs, idx) == key); assert(pn_list_get(pairs, idx + 1) == value); pn_list_del(pairs, idx, 2); } assert(pn_list_size(pairs) == 0); pn_decref(map); pn_decref(pairs); } void test_inspect(void *o, const char *expected) { pn_string_t *dst = pn_string(NULL); pn_inspect(o, dst); assert(pn_strequals(pn_string_get(dst), expected)); pn_free(dst); } void test_list_inspect(void) { pn_list_t *l = build_list(0, END); test_inspect(l, "[]"); pn_free(l); l = build_list(0, pn_string("one"), END); test_inspect(l, "[\"one\"]"); pn_free(l); l = build_list(0, pn_string("one"), pn_string("two"), END); test_inspect(l, "[\"one\", \"two\"]"); pn_free(l); l = build_list(0, pn_string("one"), pn_string("two"), pn_string("three"), END); test_inspect(l, "[\"one\", \"two\", \"three\"]"); pn_free(l); } void test_map_inspect(void) { // note that when there is more than one entry in a map, the order // of the entries is dependent on the hashes involved, it will be // deterministic though pn_map_t *m = build_map(0.75, 0, END); test_inspect(m, "{}"); pn_free(m); m = build_map(0.75, 0, pn_string("key"), pn_string("value"), END); test_inspect(m, "{\"key\": \"value\"}"); pn_free(m); m = build_map(0.75, 0, pn_string("k1"), pn_string("v1"), pn_string("k2"), pn_string("v2"), END); test_inspect(m, "{\"k1\": \"v1\", \"k2\": \"v2\"}"); pn_free(m); m = build_map(0.75, 0, pn_string("k1"), pn_string("v1"), pn_string("k2"), pn_string("v2"), pn_string("k3"), pn_string("v3"), END); test_inspect(m, "{\"k3\": \"v3\", \"k1\": \"v1\", \"k2\": \"v2\"}"); pn_free(m); } void test_map_coalesced_chain(void) { pn_hash_t *map = pn_hash(PN_OBJECT, 16, 0.75); pn_string_t *values[9] = { pn_string("a"), pn_string("b"), pn_string("c"), pn_string("d"), pn_string("e"), pn_string("f"), pn_string("g"), pn_string("h"), pn_string("i") }; //add some items: pn_hash_put(map, 1, values[0]); pn_hash_put(map, 2, values[1]); pn_hash_put(map, 3, values[2]); //use up all non-addressable elements: pn_hash_put(map, 14, values[3]); pn_hash_put(map, 15, values[4]); pn_hash_put(map, 16, values[5]); //use an addressable element for a key that doesn't map to it: pn_hash_put(map, 4, values[6]); pn_hash_put(map, 17, values[7]); assert(pn_hash_size(map) == 8); //free up one non-addressable entry: pn_hash_del(map, 16); assert(pn_hash_get(map, 16) == NULL); assert(pn_hash_size(map) == 7); //add a key whose addressable slot is already taken (by 17), //generating a coalesced chain: pn_hash_put(map, 12, values[8]); //remove an entry from the coalesced chain: pn_hash_del(map, 4); assert(pn_hash_get(map, 4) == NULL); //test lookup of all entries: assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 1)), "a")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 2)), "b")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 3)), "c")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 14)), "d")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 15)), "e")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 17)), "h")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 12)), "i")); assert(pn_hash_size(map) == 7); //cleanup: for (pn_handle_t i = pn_hash_head(map); i; i = pn_hash_head(map)) { pn_hash_del(map, pn_hash_key(map, i)); } assert(pn_hash_size(map) == 0); for (size_t i = 0; i < 9; ++i) { pn_free(values[i]); } pn_free(map); } void test_map_coalesced_chain2(void) { pn_hash_t *map = pn_hash(PN_OBJECT, 16, 0.75); pn_string_t *values[10] = { pn_string("a"), pn_string("b"), pn_string("c"), pn_string("d"), pn_string("e"), pn_string("f"), pn_string("g"), pn_string("h"), pn_string("i"), pn_string("j") }; //add some items: pn_hash_put(map, 1, values[0]);//a pn_hash_put(map, 2, values[1]);//b pn_hash_put(map, 3, values[2]);//c //use up all non-addressable elements: pn_hash_put(map, 14, values[3]);//d pn_hash_put(map, 15, values[4]);//e pn_hash_put(map, 16, values[5]);//f //take slot from addressable region pn_hash_put(map, 29, values[6]);//g, goes into slot 12 //free up one non-addressable entry: pn_hash_del(map, 14); assert(pn_hash_get(map, 14) == NULL); //add a key whose addressable slot is already taken (by 29), //generating a coalesced chain: pn_hash_put(map, 12, values[7]);//h assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 12)), "h")); //delete from tail of coalesced chain: pn_hash_del(map, 12); assert(pn_hash_get(map, 12) == NULL); //extend chain into cellar again, then coalesce again extending back //into addressable region pn_hash_put(map, 42, values[8]);//i pn_hash_put(map, 25, values[9]);//j //delete entry from coalesced chain, where next element in chain is //in cellar: assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 29)), "g")); pn_hash_del(map, 29); //test lookup of all entries: assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 1)), "a")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 2)), "b")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 3)), "c")); //d was deleted assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 15)), "e")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 16)), "f")); //g was deleted, h was deleted assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 42)), "i")); assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 25)), "j")); assert(pn_hash_size(map) == 7); //cleanup: for (pn_handle_t i = pn_hash_head(map); i; i = pn_hash_head(map)) { pn_hash_del(map, pn_hash_key(map, i)); } assert(pn_hash_size(map) == 0); for (size_t i = 0; i < 10; ++i) { pn_free(values[i]); } pn_free(map); } void test_list_compare(void) { pn_list_t *a = pn_list(PN_OBJECT, 0); pn_list_t *b = pn_list(PN_OBJECT, 0); assert(pn_equals(a, b)); void *one = pn_class_new(PN_OBJECT, 0); void *two = pn_class_new(PN_OBJECT, 0); void *three = pn_class_new(PN_OBJECT, 0); pn_list_add(a, one); assert(!pn_equals(a, b)); pn_list_add(b, one); assert(pn_equals(a, b)); pn_list_add(b, two); assert(!pn_equals(a, b)); pn_list_add(a, two); assert(pn_equals(a, b)); pn_list_add(a, three); assert(!pn_equals(a, b)); pn_list_add(b, three); assert(pn_equals(a, b)); pn_free(a); pn_free(b); pn_free(one); pn_free(two); pn_free(three); } typedef struct { pn_list_t *list; size_t index; } pn_it_state_t; static void *pn_it_next(void *state) { pn_it_state_t *it = (pn_it_state_t *) state; if (it->index < pn_list_size(it->list)) { return pn_list_get(it->list, it->index++); } else { return NULL; } } void test_iterator(void) { pn_list_t *list = build_list(0, pn_string("one"), pn_string("two"), pn_string("three"), pn_string("four"), END); pn_iterator_t *it = pn_iterator(); pn_it_state_t *state = (pn_it_state_t *) pn_iterator_start (it, pn_it_next, sizeof(pn_it_state_t)); state->list = list; state->index = 0; void *obj; int index = 0; while ((obj = pn_iterator_next(it))) { assert(obj == pn_list_get(list, index)); ++index; } assert(index == 4); pn_free(list); pn_free(it); } void test_heap(int seed, int size) { srand(seed); pn_list_t *list = pn_list(PN_VOID, 0); intptr_t min = 0; intptr_t max = 0; for (int i = 0; i < size; i++) { intptr_t r = rand(); if (i == 0) { min = r; max = r; } else { if (r < min) { min = r; } if (r > max) { max = r; } } pn_list_minpush(list, (void *) r); } intptr_t prev = (intptr_t) pn_list_minpop(list); assert(prev == min); assert(pn_list_size(list) == (size_t)(size - 1)); int count = 0; while (pn_list_size(list)) { intptr_t r = (intptr_t) pn_list_minpop(list); assert(r >= prev); prev = r; count++; } assert(count == size - 1); assert(prev == max); pn_free(list); } int main(int argc, char **argv) { for (size_t i = 0; i < 128; i++) { test_class(PN_OBJECT, i); test_class(PN_VOID, i); test_class(&noop_class, i); } for (size_t i = 0; i < 128; i++) { test_new(i, PN_OBJECT); test_new(i, &noop_class); } test_finalize(); test_free(); test_hashcode(); test_compare(); for (int i = 0; i < 1024; i++) { test_refcounting(i); } for (size_t i = 0; i < 4; i++) { test_list(i); } for (size_t i = 0; i < 4; i++) { test_list_refcount(i); } test_list_index(); test_map(); test_map_links(); test_hash(); test_string(NULL); test_string(""); test_string("this is a test"); test_string("012345678910111213151617181920212223242526272829303132333435363" "738394041424344454647484950515253545556575859606162636465666768"); test_string("this has an embedded \000 in it"); test_stringn("this has an embedded \000 in it", 28); test_string_format(); test_string_addf(); test_build_list(); test_build_map(); test_build_map_odd(); for (int i = 0; i < 64; i++) { test_map_iteration(i); } test_list_inspect(); test_map_inspect(); test_list_compare(); test_iterator(); for (int seed = 0; seed < 64; seed++) { for (int size = 1; size <= 64; size++) { test_heap(seed, size); } } test_map_coalesced_chain(); test_map_coalesced_chain2(); return 0; } qpid-proton-0.22.0/proton-c/src/tests/message.c0000664000000000000000000000247013257152177016236 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #define assert(E) ((E) ? 0 : (abort(), 0)) static void test_overflow_error(void) { pn_message_t *message = pn_message(); char buf[6]; size_t size = 6; int err = pn_message_encode(message, buf, &size); assert(err == PN_OVERFLOW); assert(pn_message_errno(message) == 0); pn_message_free(message); } int main(int argc, char **argv) { test_overflow_error(); return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/0000775000000000000000000000000013257152177015441 5ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/libFuzzingEngine.h0000664000000000000000000000224413257152177021065 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef _LIB_FUZZING_ENGINE_H_ #define _LIB_FUZZING_ENGINE_H_ #include #include // This header defines `extern "C"` for the fuzzing interface functions #ifdef __cplusplus extern "C" #endif int LLVMFuzzerInitialize(int *argc, char ***argv); #ifdef __cplusplus extern "C" #endif int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); #endif qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/0000775000000000000000000000000013257152177017237 5ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/0000775000000000000000000000000013257152177020552 5ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/f8f0a1c8c38849a8cb90d6a25c3a6b5470edad620000664000000000000000000000000513257152177026271 0ustar þØû[@qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/f7cc1d38fd7b192f28a362a877a1d53ad79406bb0000664000000000000000000000000513257152177026215 0ustar ( :@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/f185a7ab956dd09408c8793fcb26bfeb7a7a00540000664000000000000000000000000613257152177026221 0ustar :( @ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/f00342f757c5af05591a5d42ee9916dd6ef545650000664000000000000000000000000613257152177026010 0ustar %( :@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/e7302f330c4db513e0f7cb0d767746a4eac475d80000664000000000000000000000000413257152177026123 0ustar %ÿ@(qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/e326e7be665bd0f552732520c7ca9d22024c3bfb0000664000000000000000000000007313257152177026120 0ustar ÿÿÿÿÿÿÿÿ* : ÿÿÿÿÿÿÿ@ÿÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/d7626f11b06cead4db1a1cf2b1fe875f5c44b6850000664000000000000000000000010013257152177026336 0ustar :²²%ÿÿÿÿÿÿÿÿÿÿÿ(ÿÿÿÿ%%²W%%%%²W%%%²Wÿÿ²%%%²%²Wÿÿ²%%%²W@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/d54e31950fd932313bd00a04c8d90e1d5e6de7da0000664000000000000000000000010013257152177026170 0ustar ÿÿÿÿ%ÿ:²²%ÿ¿ÿÿÿÿÿÿÿÿcÿÿÿÿÿ%%@ÿÿÿÿÆÆÆÆÆÆÆÆÆÆ²²²²[]øÿ:/ÿ²W%%ÿ@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/ce833849b34e49c4cb726ddf5c9e510abc59a1de0000664000000000000000000000000413257152177026360 0ustar %@@(qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/ccadb470d4a822e09e66f01ccc5232b796794f910000664000000000000000000000010013257152177026127 0ustar : :ÿÿ@ /@²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/c665703ea06c6dee15638636f1c74a736f5add3b0000664000000000000000000000006013257152177026136 0ustar : ÿ@ÿ ²²²²W² qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/be96b7c50460e86874d25a99955c8ddef226d8600000664000000000000000000000000613257152177026032 0ustar :(ÿ%@(qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/bc5e252c1cc9e9d8b85072ae4f8fc2bd4cd62fa60000664000000000000000000000010013257152177026511 0ustar : :ÿÿ:// / ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/b6f15f85ac531feede3023244bb2c06de2d1db050000664000000000000000000000000613257152177026321 0ustar :%ÿ(@(qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/b34d641362e22b76c0ed938bed27a7b3580ee09e0000664000000000000000000000005313257152177026133 0ustar * : @ÿÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/b0cf4daa4fd8a68a0c1625714ed488c642e75e620000664000000000000000000000010013257152177026205 0ustar :²%ÿàÿÿÿÿÿÿÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-%%%%%²ÿÿ@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/a9be32d60f75ae52915d7ff2c2666fea4496962c0000664000000000000000000000003413257152177026156 0ustar ×:ÿ://ÿÿÿÿÿ%ÿ²%;²W%@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/a33213bbeb2e8b6dc86e7b78961d7ce5459c1b000000664000000000000000000000010013257152177026204 0ustar ://‡@ÿÿ/ ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/a2507f04c1978d0237abd771d0e6e869424235430000664000000000000000000000006013257152177025551 0ustar : @ÿÿ ²²²²W² qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/9db58d8ba95a214f78520e489306d2f5c312847a0000664000000000000000000000000613257152177025726 0ustar :(%ÿ@(qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/9c866fe84b83c718cc4139cc75423adae8eef6950000664000000000000000000000005713257152177026256 0ustar ²²%%%²W²²²²@²²²² : ²²²W²²²²²² ÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/9c3c32fcecc173c2b40f3ad85cca65329c55670e0000664000000000000000000000010013257152177026256 0ustar ://ÿÿ‡@:/// ²²²²­²²² ²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/9a121ead6ea22fdc57acc601ecf51776f7555bb20000664000000000000000000000007713257152177026351 0ustar ²²%:ÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%²ÿÿ@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/97d170e1550eee4afc0af065b78cda302a97674c0000664000000000000000000000000213257152177026202 0ustar []qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/968ef28ba6acb1f6c1950322c8c821b3f5cedda80000664000000000000000000000000613257152177026353 0ustar ( :@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/94bdac0074860e6f0d41703436cde71c56ad093b0000664000000000000000000000010013257152177026031 0ustar ²²%ÿàÿÿÿÿÿÿÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%²ÿÿ@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/8f744690ba08cd357cfe407e40d1a7de4ed34d7c0000664000000000000000000000010013257152177026272 0ustar ¿%%²%ÿÿÿÿÿÿÿÿÿÿ(ÿ'ÿÿÿÿÿÿÿÿÿÿ%%²W%%%²Wÿÿ²%%%²W@ÿÿÿÿ ²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/847a0564a49e1729364956e10dff9a28975706170000664000000000000000000000010013257152177025441 0ustar ¿%%²%ÿ:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%²ÿ%%%%%%%%%%²ÿÿ@ÿÿ%%qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/795ef610b15cacfed9cd6dbc5073a40586e8ebe40000664000000000000000000000010013257152177026433 0ustar : @ÿÿ  /: ²²²²/ ²²²W² ²²² :ÿÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/6e0e5ea9642f19e727f428cdd97919d4106721910000664000000000000000000000004413257152177025664 0ustar  :::qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/6b8b310bf6b10124f2db5b848e223ae27486de0c0000664000000000000000000000010013257152177026103 0ustar :* : @ÿÿ ²²²²W² qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/61a0ebb15ea15fb8f9ead4760dad565af9894b4d0000664000000000000000000000006313257152177026440 0ustar ²²%:ÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%(%%%%%%%%%%%%@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/43a9bd2be057b72fbe85369386646ebf73581f120000664000000000000000000000005613257152177026017 0ustar :²²%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ%%²W²²²²ÿÿÿÿ²%%W%²@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/42785d880a52ccdf0c57d7eb884f952ee8d134420000664000000000000000000000007313257152177026101 0ustar ×:ÿ://ÿÿÿÿÿÿ;ÿÿÿÿÿ;%²%ÿ;%²%ÿ;%²%ÿ;%²%ÿ;%²W%@ÿW%@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/42099b4af021e53fd8fd4e056c2568d7c2e3ffa80000664000000000000000000000000113257152177026215 0ustar /qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/41e20424dc21cc830d85e5d4d0b14edffc7b3f720000664000000000000000000000010013257152177026245 0ustar ÿ²²%:ÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%: %%%%%%²%ÿ;%²W%@ÿW%@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/3ff81fba3fb1936764095e5ff385f957def0ad7c0000664000000000000000000000010013257152177026320 0ustar ² :* * : @ÿÿ²²²²²W²²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/3921b48407b585d4423597bf57be565f178b1c550000664000000000000000000000005613257152177025600 0ustar :²²%ÿÿÿÿÿÿÿ://ÿÿÿÿÿ%%²W²²²²ÿÿÿÿ²%%W%²@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/358790bd11b9f47c5003c5fccc79efee57268adf0000664000000000000000000000010013257152177026305 0ustar ://ÿÿ‡@/ ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/33fc79c84399370999a0495b77ea6da3bb37eb780000664000000000000000000000005613257152177026040 0ustar :²²%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ%%²W%%%²Wÿÿ²%%%²W@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/33397a80e74cf8ad90817800695cbaf13867f5240000664000000000000000000000000413257152177025651 0ustar û@@@qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/332afd64be61d8bd37c9b0d149b8bcf4d901cc1f0000664000000000000000000000010013257152177026416 0ustar : :ÿÿ / ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/31dc143f3f9090210d4689f05c04b170b3c659b20000664000000000000000000000007513257152177025620 0ustar ²²%%%%%%%%%%%:ÿ%%%%%%%%%%%%%%%%%%%%%%%%%%%%(%%%%%%%%%%%%@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/2987bd88a152ac3b8df9fbb1d3ccd2e5bb4353290000664000000000000000000000005713257152177026361 0ustar ²²%%%²W²²²²²%%%²W²²²²@ÿÿÿÿÿÿÿÿú ²²øÿÿÿ ÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/27beaeb8f02116da66b93685bfbf19f45ae60d2c0000664000000000000000000000002613257152177026352 0ustar ²²²²²W²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/26b4666a36d4834b5c6160f4e96621fa0df5719b0000664000000000000000000000000613257152177025720 0ustar :'JÛ@ÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/21f39c96fb97c02075ef38bf47231fe2060704fc0000664000000000000000000000005513257152177026002 0ustar ²²%ÿÿÆÆ(Æ:ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÿÿÿÿÿÿÿ%²W@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/1f26b8f809da3b8185981ee59803191bcd1a6e350000664000000000000000000000010013257152177026001 0ustar : :ÿÿ‡@/ ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/1e5c2f367f02e47a8c160cda1cd9d91decbac4410000664000000000000000000000000113257152177026406 0ustar [qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/1a80273e637399ff6932494995580ae8b46b906f0000664000000000000000000000003613257152177025541 0ustar :²²%ÿ¿ÿÿÿÿÿÿÿÿcÿÿÿÿÿ%%@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/1685d813c1f5ba76212deef5af686945cac606610000664000000000000000000000010013257152177026053 0ustar ://ÿ@/ ²²²²²²²²W² ²²²²²²²²qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/1467aa7d60a377a3b71fe59fc9c0435765e202d50000664000000000000000000000005613257152177026000 0ustar :²²%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ%%²W²²²²ÿÿÿÿ²%%%²W@ÿÿÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/145318c307476541f07ca9309fdf6242014418000000664000000000000000000000004013257152177025312 0ustar ²²%ÿÿÿÿÿÿÿÿÿ%%²W²²²²²%%%²W@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/0e22f59b4ade4e1f8814cd7865be2851825c60660000664000000000000000000000007013257152177026007 0ustar ²²%ÿÿÆÆÆÆ:ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÿÿÿÿÿÿÿ%%²W²²²²²%%%²W@ÿÿqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/0dcf103a25e39c25fffcaf111282047a449f5bf50000664000000000000000000000000613257152177026174 0ustar :@:/[qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/0cb270538dfb29f83ff30457f8679876444683540000664000000000000000000000000613257152177025534 0ustar : ÿ(@qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/02818ebb22dace48559a1bb390f201016a4fd7fe0000664000000000000000000000010013257152177026162 0ustar ²²²W²²²²@ ²²²²²²²² : ²²²W²²²²²² ÿ qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url/corpus/02696838495969cdd9017584d12e9635359dcc130000664000000000000000000000000213257152177025447 0ustar : qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-url.c0000664000000000000000000000237213257152177017407 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "proton/url.h" #include "libFuzzingEngine.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { // null-terminate the string in Data in case it doesn't contain null already char *str = (char *)malloc(Size + 1); memcpy(str, Data, Size); str[Size] = '\0'; pn_url_t *url = pn_url_parse(str); if (url != NULL) { pn_url_free(url); } free(str); return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-sniff-header.c0000664000000000000000000000215413257152177021136 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include "core/autodetect.h" #include "libFuzzingEngine.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { /* pni_protocol_type_t protocol = */ pni_sniff_header((const char *)Data, Size); return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/0000775000000000000000000000000013257152177021706 5ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/0000775000000000000000000000000013257152177023006 5ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-fe2fe429e56f9165aa0ed7de027670d84638f780qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-fe2fe429e56f9165aa00000664000000000000000000000040113257152177027506 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASûÀ4 ¡ my_receiveiCBPPSueuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-ec60cc5bfe7200f87c223f14fc025a925beab889qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-ec60cc5bfe7200f87c20000664000000000000000000000074313257152177027564 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£soleSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-e79f84d85610d31d1a5f9e981d48833a217a48e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-e79f84d85610d31d1a50000664000000000000000000000046313257152177027354 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-d0005305b9b3466ee96d4783ca6552ac36f61074qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-d0005305b9b3466ee960000664000000000000000000000010013257152177027250 0ustar :ÿ ŽõÇ Žõõ:ÿú././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-cc1826bf81d8896e49411ddb2f38fba435cb93c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-cc1826bf81d8896e4940000664000000000000000000000072413257152177027373 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kzoduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYEDPS(À¡jms.quaue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queu_DELIVEe.example@@@@@RY@Á3£product¡apache-activemq-@aƒrt././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-ca44c8744fe82b46e23fce45d1378eed69452e2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-ca44c8744fe82b46e230000664000000000000000000000115213257152177027427 0ustar AMQPSð?|ü¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"ÿÿÿÿÿÿÿSÀ`RpÿÿÿpÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAAMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-aS£x-opt-jms-ctidestQ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-aef19ef7237d6e63b7e11341ab588430d52079e8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-aef19ef7237d6e63b7e0000664000000000000000000000114213257152177027577 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQAAAAAQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@'@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡coUntTSw¡test message: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-adc83b19e793491b1c6ea0fd8b46cd9f32e592fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-adc83b19e793491b1c60000664000000000000000000000000113257152177027417 0ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-a2d7fde750eae69da66e796f8fd8b20468ab2403qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-a2d7fde750eae69da660000664000000000000000000000026113257152177027652 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0;à1£sole-connection-for-containerDELAYED_DELIVERY@ÁAMQPSÀƒ 3erDELAYED_DELIVERY@Á¡0.0.0.0@pÿY@3Á3££kr././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-970fa3137006ab81db9ff4d30d056ad744544618qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-970fa3137006ab81db90000664000000000000000000000115413257152177027336 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apachAMQPSÀƒ ¡0.e-activ0.0.0@pÿÿÿÿÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[efor-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exa@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% ple], th././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-8bba0e9b22dadb12fdcb9f794ea456a850ccc5d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-8bba0e9b22dadb12fdc0000664000000000000000000000046313257152177027766 0ustar AMQPS ¡ƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-63f74090de3ca9eda2a2a2b9da5591bd529cd94bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-63f74090de3ca9eda2a0000664000000000000000000000046313257152177027563 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCbPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-51b7ac2fd6d34ed907ebb0ceb769871bfe81af78qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-51b7ac2fd6d34ed907e0000664000000000000000000000031513257152177027564 0ustar AMQPSÀƒ ¡0.0.0.0@pÿY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-44ef8add55e4b3df5cf6269bd80765c370ca758eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-44ef8add55e4b3df5cf0000664000000000000000000000062113257152177027732 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-42a83b5231fb00c0eb2ebc58deaaaa1897e8be14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-42a83b5231fb00c0eb20000664000000000000000000000037613257152177027400 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-39152eaba4994d35d774b06714c7d44a6a6d0a20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-39152eaba4994d35d770000664000000000000000000000053113257152177027353 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ438020:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ source address does not exist././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-3837fc49467285923fb03bba6896a467ce2bcda8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/slow-unit-3837fc49467285923fb0000664000000000000000000000115413257152177027231 0ustar AMQPSÀƒ ¡0.AMQP0.0.7@pSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-ÿconnection-for-containerDELAYEqueue.exaÿÿmple@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)ÿ`ÿÿpP;roduceru0 A@r ActiveMQQ-destQSsÀ% @@¡¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrx£Á-opt-jms-destQSsÀ% @pÿÿÿce address does pÿÿASÀ3 ¡ my_receiverCBPPnotS(À exi¡jms.queue.exampleSÿpÿÿASÀ8 ¡ my_receiverCBPPS(0@pÿjms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÿpu0@%qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leaks0000664000000000000000000000233213257152177024030 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27 AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-f1c681da874efe3b168d6bd00e1de53c5a3823eaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-f1c681da874efe3b168d6bd00000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-ccbdfccb91be2e40cebeafb39e6dd9e1ad8edb01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-ccbdfccb91be2e40cebeafb30000664000000000000000000000060213257152177030001 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverC@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-adc83b19e793491b1c6ea0fd8b46cd9f32e592fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-adc83b19e793491b1c6ea0fd0000664000000000000000000000000113257152177027272 0ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-a2981c9688b5e3111a50e4ff36d12a9aeb616f29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-a2981c9688b5e3111a50e4ff0000664000000000000000000000023513257152177027066 0ustar AMQPSÀƒ ¡0.0.AMQP0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`R././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-8d883f1577ca8c334b7c6d75ccb71209d71ced13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-8d883f1577ca8c334b7c6d750000664000000000000000000000000113257152177027075 0ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-46319704047cd1ec92a2e68580f2448e699f705dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/leak-46319704047cd1ec92a2e6850000664000000000000000000000115413257152177026726 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000042,src__000049,op__flip1,pos__25qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000042,src__000049,op__fl0000664000000000000000000000112413257152177027261 0ustar AMQPSÀƒ ¡0>0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£-connection-for-containerDELAYED_DE3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000041,src__000044,op__ext_AO,pos__101qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000041,src__000044,op__ex0000664000000000000000000000102413257152177027265 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3uproduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000040,src__000044,op__int32,pos__364,val___64qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000040,src__000044,op__in0000664000000000000000000000102413257152177027256 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR@SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000039,src__000044,op__int32,pos__333,val___1024qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000039,src__000044,op__in0000664000000000000000000000102413257152177027266 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@Xw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000038,src__000037,op__arith8,pos__158,val___18qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000038,src__000037,op__ar0000664000000000000000000000106213257152177027265 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000037,src__000037,op__arith8,pos__136,val__-33qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000037,src__000037,op__ar0000664000000000000000000000106213257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis‚version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000036,src__000037,op__arith8,pos__17,val__-15qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000036,src__000037,op__ar0000664000000000000000000000106213257152177027263 0ustar AMQPDÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000035,src__000037,op__flip8,pos__256qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000035,src__000037,op__fl0000664000000000000000000000106213257152177027261 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.Žueue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000034,src__000010,op__arith8,pos__446,val__-14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000034,src__000010,op__ar0000664000000000000000000000115413257152177027252 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹S²CR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000033,src__000010,op__arith8,pos__264,val__-33qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000033,src__000010,op__ar0000664000000000000000000000115413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀãCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000032,src__000010,op__arith8,pos__247,val___15qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000032,src__000010,op__ar0000664000000000000000000000115413257152177027250 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)T@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000031,src__000010,op__arith8,pos__176,val__-27qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000031,src__000010,op__ar0000664000000000000000000000115413257152177027247 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿUÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000030,src__000010,op__arith8,pos__166,val___17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000030,src__000010,op__ar0000664000000000000000000000115413257152177027246 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀqRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000029,src__000010,op__arith8,pos__145,val__-29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000029,src__000010,op__ar0000664000000000000000000000115413257152177027256 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version„2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000028,src__000010,op__arith8,pos__50,val___14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000028,src__000010,op__ar0000664000000000000000000000115413257152177027255 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000027,src__000010,op__arith8,pos__32,val___17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000027,src__000010,op__ar0000664000000000000000000000115413257152177027254 0ustar AMQPSÀƒ ¡0.0.0.7@ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000026,src__000010,op__flip4,pos__224qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000026,src__000010,op__fl0000664000000000000000000000115413257152177027252 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000025,src__000010,op__flip4,pos__112qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000025,src__000010,op__fl0000664000000000000000000000115413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡ápache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000024,src__000010,op__flip2,pos__449qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000024,src__000010,op__fl0000664000000000000000000000115413257152177027250 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀ[R 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000023,src__000010,op__flip2,pos__155qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000023,src__000010,op__fl0000664000000000000000000000115413257152177027247 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0!SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000022,src__000010,op__flip1,pos__261qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000022,src__000010,op__fl0000664000000000000000000000115413257152177027246 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000021,src__000010,op__flip1,pos__214qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000021,src__000010,op__fl0000664000000000000000000000115413257152177027245 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCÂPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000020,src__000010,op__flip1,pos__103qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000020,src__000010,op__fl0000664000000000000000000000115413257152177027244 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£‡kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000019,src__000010,op__flip1,pos__17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000019,src__000010,op__fl0000664000000000000000000000115413257152177027254 0ustar AMQPCÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000018,src__000003,op__ext_AO,pos__18qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000018,src__000003,op__ex0000664000000000000000000000027213257152177027270 0ustar AMQPSms.queue.exampleÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000017,src__000003,op__ext_AO,pos__16qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000017,src__000003,op__ex0000664000000000000000000000027213257152177027267 0ustar AMQPQSsÀ% 0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000016,src__000003,op__int32,pos__49,val__be___127qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000016,src__000003,op__in0000664000000000000000000000027213257152177027260 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000015,src__000003,op__int32,pos__19,val___4096qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000015,src__000003,op__in0000664000000000000000000000027213257152177027257 0ustar AMQPS0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000014,src__000003,op__int32,pos__16,val___128qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000014,src__000003,op__in0000664000000000000000000000027213257152177027256 0ustar AMQP€ƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000013,src__000003,op__int32,pos__14,val___32qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000013,src__000003,op__in0000664000000000000000000000027213257152177027255 0ustar AMQP Àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000012,src__000003,op__int16,pos__36,val__be___512qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000012,src__000003,op__in0000664000000000000000000000027213257152177027254 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000011,src__000003,op__arith16,pos__49,val__-11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000011,src__000003,op__ar0000664000000000000000000000027213257152177027247 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1÷sQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000010,src__000003,op__arith16,pos__48,val__be__-13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000010,src__000003,op__ar0000664000000000000000000000027213257152177027246 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à0õtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000009,src__000003,op__arith16,pos__22,val__be__-13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000009,src__000003,op__ar0000664000000000000000000000027213257152177027256 0ustar AMQPSÀƒ  ú0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000008,src__000003,op__arith8,pos__21,val___28qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000008,src__000003,op__ar0000664000000000000000000000027213257152177027255 0ustar AMQPSÀƒ&¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000008,sig__06,src__000010,op__flip2,pos__24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000008,sig__06,src__000010000664000000000000000000000115413257152177027162 0ustar AMQPSÀƒ ¡.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000007,src__000003,op__arith8,pos__17,val___3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000007,src__000003,op__ar0000664000000000000000000000027213257152177027254 0ustar AMQPVÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000021100000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000007,sig__06,src__000003,op__int32,pos__28,val__-2147483648qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000007,sig__06,src__000000000664000000000000000000000027213257152177027160 0ustar AMQPSÀƒ ¡0.0.€pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000006,src__000003,op__arith8,pos__13,val__-12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000006,src__000003,op__ar0000664000000000000000000000027213257152177027253 0ustar AMQPôSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000006,sig__06,src__000003,op__int32,pos__28,val___0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000006,sig__06,src__000000000664000000000000000000000027213257152177027157 0ustar AMQPSÀƒ ¡0.0.pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000005,src__000003,op__arith8,pos__12,val___25qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000005,src__000003,op__ar0000664000000000000000000000027213257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000005,sig__06,src__000003,op__int16,pos__26,val__be___255qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000005,sig__06,src__000000000664000000000000000000000027213257152177027156 0ustar AMQPSÀƒ ¡0.ÿ0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000004,src__000003,op__flip2,pos__60qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000004,src__000003,op__fl0000664000000000000000000000027213257152177027250 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @ ¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000004,sig__06,src__000003,op__int16,pos__23,val___16qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000004,sig__06,src__000000000664000000000000000000000027213257152177027155 0ustar AMQPSÀƒ ¡.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000003,src__000003,op__flip2,pos__17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000003,src__000003,op__fl0000664000000000000000000000027213257152177027247 0ustar AMQP_Àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000003,sig__06,src__000003,op__arith8,pos__23,val___29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000003,sig__06,src__000000000664000000000000000000000027213257152177027154 0ustar AMQPSÀƒ ¡$0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000012,op__int16,pos__214,val__be___255qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000012,op__in0000664000000000000000000000115413257152177027253 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCÿPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000003,op__flip1,pos__50qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000003,op__fl0000664000000000000000000000027213257152177027246 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1|QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000001,op__flip1,pos__52qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,src__000001,op__fl0000664000000000000000000000070013257152177027240 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£Sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,sig__06,src__000003,op__flip2,pos__24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000002,sig__06,src__000000000664000000000000000000000027213257152177027153 0ustar AMQPSÀƒ ¡.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000012,op__int16,pos__213,val__be___100qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000012,op__in0000664000000000000000000000115413257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverdPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000003,op__flip1,pos__19qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000003,op__fl0000664000000000000000000000027213257152177027245 0ustar AMQPSȃ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000001,op__flip1,pos__50qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,src__000001,op__fl0000664000000000000000000000070013257152177027237 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1ãsole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,sig__06,src__000003,op__flip2,pos__23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000001,sig__06,src__000000000664000000000000000000000027213257152177027152 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000012,op__int16,pos__212,val___1000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000012,op__in0000664000000000000000000000115413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveèBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000003,op__flip1,pos__12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000003,op__fl0000664000000000000000000000027213257152177027244 0ustar AMQP SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000001,op__flip1,pos__40qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,src__000001,op__fl0000664000000000000000000000070013257152177027236 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿxu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,sig__06,src__000003,op__flip1,pos__23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/id__000000,sig__06,src__000000000664000000000000000000000027213257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ff37d7a06fd987b4cfdae2b626c04c5226f5574dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ff37d7a06fd987b4cfdae2b0000664000000000000000000000010013257152177027544 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ~././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-fbb3085981ebc0d194be96068d516e5e2321ba65qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-fbb3085981ebc0d194be9600000664000000000000000000000000213257152177027234 0ustar Š;././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f853324a4309042f2a714dd1635b0a8b3bc4e079qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f853324a4309042f2a714dd0000664000000000000000000000004413257152177027007 0ustar 'ÿÿÿÿÿÿÿÿ)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f4f83a88ace6f5b3d0c1d7de00bbd9c064ca9edbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f4f83a88ace6f5b3d0c1d7d0000664000000000000000000000003413257152177027465 0ustar Û¶¶cccc:ccccccccccccccccccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f420baeaf2906485ee5f9b2c2ec711a78d44ee55qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f420baeaf2906485ee5f9b20000664000000000000000000000003013257152177027316 0ustar õ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f2646d2333d4df32baee019b1e827fcb96d6e1a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f2646d2333d4df32baee0190000664000000000000000000000005413257152177027232 0ustar ••;••••••••••••••™ÿÿ•••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f1a9d4866a43735ee624f1266f180ca9c1f9caabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f1a9d4866a43735ee624f120000664000000000000000000000005413257152177027110 0ustar •••••••••••••••••••••••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f02ca7a00ee3c52223dbd66c3a141450dd3d577aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-f02ca7a00ee3c52223dbd660000664000000000000000000000004313257152177027273 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-efb3e39f7ed69e0676e729a49d2aa6f0a5dc6a5aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-efb3e39f7ed69e0676e729a0000664000000000000000000000004613257152177027354 0ustar Çÿÿÿÿÿÿÿÿ(ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-edb2de34472b0418b0dff115ce94dd2300136c59qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-edb2de34472b0418b0dff110000664000000000000000000000010013257152177027272 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ••••••™••¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ebdc2288a14298f5f7adf08e069b39fc42cbd909qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ebdc2288a14298f5f7adf080000664000000000000000000000000113257152177027323 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-eb8d53c64eb21ef01ae418eb97c1cb0912001bebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-eb8d53c64eb21ef01ae418e0000664000000000000000000000007613257152177027377 0ustar Ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-eb65422a78e3882b7a7fee19594e3587949ec10bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-eb65422a78e3882b7a7fee10000664000000000000000000000006413257152177027254 0ustar Û¶¶clccc:cccccccccccccccccé¶¶clccc:ccccccccccccccccc././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e8597e1550c5d6d4e69481efd8cd67937c033d59qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e8597e1550c5d6d4e69481e0000664000000000000000000000006013257152177027124 0ustar ÿÿÿÿÿÿÿÿÿÿÿòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòÿÿÿÿÿ¬¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e7284b3e2da5c87b908a67fdb1aada576c603b8fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e7284b3e2da5c87b908a67f0000664000000000000000000000007613257152177027262 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e7064f0b80f61dbc65915311032d27baa569ae2aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e7064f0b80f61dbc65915310000664000000000000000000000000113257152177027067 0ustar )././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e6fd2484cfb12110eb78a19747c22823d704a64dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e6fd2484cfb12110eb78a190000664000000000000000000000005213257152177027233 0ustar ÿ)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ~././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e6ac6135b9bd1ab927f02dfb68ed43b31ee60db3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e6ac6135b9bd1ab927f02df0000664000000000000000000000002613257152177027373 0ustar ë:././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e5b80225a0d5389068c6596b546340f0a66b6867qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e5b80225a0d5389068c65960000664000000000000000000000005613257152177026755 0ustar Ç ÿÿÿÿÿÿÿÿ(ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e5a73a2b42f61ab34b0a3c44984d94544901786eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e5a73a2b42f61ab34b0a3c40000664000000000000000000000002213257152177027264 0ustar Û¶¶ccccccccc¤cccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e4f381600056647b7b1b2af1efd09e0a34c8fe60qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e4f381600056647b7b1b2af0000664000000000000000000000003413257152177027067 0ustar Û¶¶ccccccccccccccccccccâccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e4707e573f85d6c307cdd6668d5b4ac26c890344qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e4707e573f85d6c307cdd660000664000000000000000000000003413257152177027177 0ustar Û¶¶ccccc:cccccccccccccccccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e358cc6d92d2d23178f2ac945e9195ddb8044658qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e358cc6d92d2d23178f2ac90000664000000000000000000000000513257152177027245 0ustar :¨ÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e34338690f1913e64d0311569745548e9558aadcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e34338690f1913e64d031150000664000000000000000000000000213257152177026650 0ustar Š ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e326f3708fb445dfdceeefea3daa43901871d129qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e326f3708fb445dfdceeefe0000664000000000000000000000000513257152177027551 0ustar É././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e1ca7b892b98f47de39474174568bacee7d54742qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e1ca7b892b98f47de3947410000664000000000000000000000000413257152177027177 0ustar ( ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e0db5ea341e7ed32208db6c9d697cbd290756e3bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e0db5ea341e7ed32208db6c0000664000000000000000000000007313257152177027367 0ustar ::././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e08d18b7d432e0d39ec0806ab89e881221a0dfecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-e08d18b7d432e0d39ec08060000664000000000000000000000005613257152177027162 0ustar ••;••••••••••••••™ÿÿ•••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-db877458a58ea3b859dd622b50f59590e2dcaf77qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-db877458a58ea3b859dd6220000664000000000000000000000001013257152177027173 0ustar :ÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da832dfe9b3f16786a7f15b8a09bad58a628a8a3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da832dfe9b3f16786a7f15b0000664000000000000000000000002313257152177027330 0ustar Žõ'Ç././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da39a3ee5e6b4b0d3255bfef95601890afd80709qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da39a3ee5e6b4b0d3255bfe0000664000000000000000000000000013257152177027443 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da102a9276e8647eff75e51db2c55b270b9e4000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-da102a9276e8647eff75e510000664000000000000000000000006513257152177027176 0ustar ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦4¦¦¦¦¦¦'¦¦¦¦¦¦¦¦¦¦¦&¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d9fbe21a0dffc6296bbbf1ad20e3ca34a3a8ae18qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d9fbe21a0dffc6296bbbf1a0000664000000000000000000000004613257152177027614 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d7f61847c8f56170bbba67f412bd1a49bb3cac26qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d7f61847c8f56170bbba67f0000664000000000000000000000003613257152177027256 0ustar ÿÿÿÿÿÿÿÿ ë:././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d5738a16c48dbd8642dd1bd6ffd7258b0cc592fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d5738a16c48dbd8642dd1bd0000664000000000000000000000004013257152177027317 0ustar ÿÿÿÿÿÿ' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d223ddf607b432e1b284c39da75e2077104c5cc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d223ddf607b432e1b284c390000664000000000000000000000001013257152177027143 0ustar :ÿ:ÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d069846f5438f80a9f395dd52b3392a4806610f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d069846f5438f80a9f395dd0000664000000000000000000000040213257152177027130 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d0005305b9b3466ee96d4783ca6552ac36f61074qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-d0005305b9b3466ee96d4780000664000000000000000000000010013257152177027016 0ustar :ÿ ŽõÇ Žõõ:ÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cd7ec3122df7b135f8a76ab8de7804b5b488e69dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cd7ec3122df7b135f8a76ab0000664000000000000000000000003413257152177027374 0ustar Û¶¶cccccccccccccccccccccccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cd02f51e68f02e5f4cc343e5d3fa5f52c40a01cfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cd02f51e68f02e5f4cc343e0000664000000000000000000000003213257152177027312 0ustar :Š././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cc58f9565061e476beb72e96ac52ae47ed42e12eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cc58f9565061e476beb72e90000664000000000000000000000067513257152177027215 0ustar AMQPSÀƒ ¡0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á4£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà=CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cb5e4b95f4a9512189876d63ef05df3a619a8be0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cb5e4b95f4a9512189876d60000664000000000000000000000005713257152177027130 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-caf3ca3bc1fe19dad15dcecd6c6d531f58e70586qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-caf3ca3bc1fe19dad15dcec0000664000000000000000000000005613257152177027744 0ustar Çÿÿÿÿÿÿÿÿ(ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cacbe90ba41be2fb116697da7a90bfd716812c7bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cacbe90ba41be2fb116697d0000664000000000000000000000113413257152177027447 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cac61db7809257f1dcd70a8ddd40650454884a9eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-cac61db7809257f1dcd70a80000664000000000000000000000010013257152177027311 0ustar õ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ca36820ea5478c5d00514ebf38bc5a324210dcc6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ca36820ea5478c5d00514eb0000664000000000000000000000010013257152177027137 0ustar ¬' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c9e48423c7a92a06febe40dfe07ed4d5b93bbed3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c9e48423c7a92a06febe40d0000664000000000000000000000004113257152177027316 0ustar ÿÿÿ¬'¬ÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c881d4024914f571b4760d47f0b8b05fb02863b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c881d4024914f571b4760d40000664000000000000000000000000513257152177026737 0ustar :ÿâ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c759afd94ebf59a57880ad856f4eef6668e53833qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c759afd94ebf59a57880ad80000664000000000000000000000003013257152177027344 0ustar Û¶¶ccccccccccccccccccccc././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c751f52af463606da8cd815e85b38a17bd229fb2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c751f52af463606da8cd8150000664000000000000000000000003513257152177027163 0ustar ÿÿÿÿ ÿÿÿÿ ÿÿÿ¬¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c7018fc3eed017bd6cd9ea7380529643e0130102qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c7018fc3eed017bd6cd9ea70000664000000000000000000000005613257152177027465 0ustar ••;n•••••••••••••™ÿÿ•••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c580af2a2742b826da44de2ce668303a45174116qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c580af2a2742b826da44de20000664000000000000000000000005613257152177027232 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c4488af0c158e8c2832cb927cfb3ce534104cd1eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c4488af0c158e8c2832cb920000664000000000000000000000000113257152177027157 0ustar Š././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c27e16deceafe949cf5b7bfa75764f5cf6787c96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c27e16deceafe949cf5b7bf0000664000000000000000000000000713257152177027635 0ustar vŽ::././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c21f653c39b12a8061a2dfc3ea4b1714af0f8722qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c21f653c39b12a8061a2dfc0000664000000000000000000000003413257152177027221 0ustar Û¶¶ccccccccccccccccgcâccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c1b6aa9125359ba5003734e215a59a1be9b6c5d5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-c1b6aa9125359ba5003734e0000664000000000000000000000115413257152177027065 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-aruemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`'ÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-actceiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0COSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messaSsÀivemq-a% r@@QSsÀ.queuAMQPe.examp@@@ƒq-artemis£e././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bf412914e5d48f5d22ebaa19c6b6aaeb9e5b3b92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bf412914e5d48f5d22ebaa10000664000000000000000000000005413257152177027311 0ustar ••;••••••••••••••™•••••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bec65b1c7b7f2ef042acc705279f8d1453a393a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bec65b1c7b7f2ef042acc700000664000000000000000000000000213257152177027440 0ustar ©©././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-be52aba28faa13b371ed6685697e211c0c1b7825qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-be52aba28faa13b371ed6680000664000000000000000000000010013257152177027357 0ustar ¬'ÂÝ ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bdceac6aeb24aa30b3331bc6ded602ab13780eebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-bdceac6aeb24aa30b3331bc0000664000000000000000000000001313257152177027554 0ustar ÿÿÿÿÿÿÿÿÿÿŠ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-baff6b8143eb778ac22b92022f4d1b0c0035a2c7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-baff6b8143eb778ac22b9200000664000000000000000000000002513257152177027314 0ustar ¬@'¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-b7e435ea6415b2ef6a8a3cb72669d60c1f8049caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-b7e435ea6415b2ef6a8a3cb0000664000000000000000000000000513257152177027370 0ustar :ÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-b2f158152bd7bd75219d30f373083e60b346e763qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-b2f158152bd7bd75219d30f0000664000000000000000000000001213257152177027147 0ustar ŽõÇ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-adc8b9af934a724824163526497c467f6bcd4df6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-adc8b9af934a724824163520000664000000000000000000000002213257152177027077 0ustar ÉÿÆÇb././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-adc83b19e793491b1c6ea0fd8b46cd9f32e592fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-adc83b19e793491b1c6ea0f0000664000000000000000000000000113257152177027312 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-abb46855f6a0584382a12070764c392d9fd3d91bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-abb46855f6a0584382a12070000664000000000000000000000001613257152177027012 0ustar :Š:Š././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ab9f929aecdc0739948a41159c5da79cafc3f97eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-ab9f929aecdc0739948a4110000664000000000000000000000002213257152177027245 0ustar ÉÿÇb././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-aa882e24e76703a121e31606e94b7f08c4615c7eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-aa882e24e76703a121e31600000664000000000000000000000001513257152177027001 0ustar ÿÿÿÿÿÿÿÿÿÿ¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a7f91a92a5e4fe7f79b4f4595a207e8f55e22e7fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a7f91a92a5e4fe7f79b4f450000664000000000000000000000007113257152177027344 0ustar •••••••••••••••••™•••ÿÿÿÿÿÿÿÿÿÿÿÿÿ••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a5fe442ba4f665062aad8d15ead8bd033456d282qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a5fe442ba4f665062aad8d10000664000000000000000000000007613257152177027315 0ustar Ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a4062c676ea6cc5d8acb7939cf79b3d6e57147afqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a4062c676ea6cc5d8acb7930000664000000000000000000000006713257152177027330 0ustar ¬„'ÂJ ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a2981c9688b5e3111a50e4ff36d12a9aeb616f29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a2981c9688b5e3111a50e4f0000664000000000000000000000023513257152177027104 0ustar AMQPSÀƒ ¡0.0.AMQP0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`R././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a23c26ddf0c1ea68c187a3c735a617681f5f24c7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a23c26ddf0c1ea68c187a3c0000664000000000000000000000001213257152177027360 0ustar :ç././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a1fcee293955f903f791c2a2c01c49fc51c8b5a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-a1fcee293955f903f791c2a0000664000000000000000000000000513257152177027246 0ustar :!././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9f3079ca9cd734b5897edd798bcfa0a1f38f7ddaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9f3079ca9cd734b5897edd70000664000000000000000000000000513257152177027270 0ustar :././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9ec47582245ece2e0d3b8f2ee11364080ea893acqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9ec47582245ece2e0d3b8f20000664000000000000000000000010013257152177027240 0ustar ¬' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9986a9f19d9e1347aaba573574e17a17700a4084qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-9986a9f19d9e1347aaba5730000664000000000000000000000010013257152177027174 0ustar •••••••••••••••••™•••ÿÿÿÿÿÿÿÿÿÿÿÿÿ••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-966991de9bfd1b17e78d7081b8db41eaaed43814qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-966991de9bfd1b17e78d7080000664000000000000000000000005613257152177027217 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-948e23fbab92c1a1d11307704b59882e08cbeb0dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-948e23fbab92c1a1d1130770000664000000000000000000000003313257152177027144 0ustar :Š:ã././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-944453c79282eaaafbcf582a4fc350ff95a23900qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-944453c79282eaaafbcf5820000664000000000000000000000000713257152177027247 0ustar Ž::././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-935fbfcb7c09e72a3a3434edf64126f26e06d983qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-935fbfcb7c09e72a3a3434e0000664000000000000000000000010013257152177027312 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-924b78d04364b2d6e71ca295608825b57d60bb09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-924b78d04364b2d6e71ca290000664000000000000000000000002513257152177027102 0ustar ¬'¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-920f490d1ce522d066f9344d38163e6dea2ff7bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-920f490d1ce522d066f93440000664000000000000000000000000713257152177027021 0ustar õÇ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-903e0621cb5ff244f46b035489ffcd62e6777e35qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-903e0621cb5ff244f46b0350000664000000000000000000000050513257152177027072 0ustar AMQPSÀƒ ¡:0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.exaSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpmple@@@@@my_receiver@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8e83ff3fdf3bea01196109de3aba88abc001136eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8e83ff3fdf3bea01196109d0000664000000000000000000000003313257152177027323 0ustar :Š:s././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8d48b7490a2c419ba5fc530e509853fad9d737faqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8d48b7490a2c419ba5fc5300000664000000000000000000000002213257152177027153 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŠ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8c4c5b8a394c6a4caa2a77518ffc98b507941a92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8c4c5b8a394c6a4caa2a7750000664000000000000000000000002213257152177027313 0ustar Û¶¶ccccc¤cccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8c3269fd0d7810490ecb6cb00f2949a141805851qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8c3269fd0d7810490ecb6cb0000664000000000000000000000000413257152177027237 0ustar  ( ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-89afe17e7b95ee40f8c49420a9fbed9fc470fe44qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-89afe17e7b95ee40f8c49420000664000000000000000000000000313257152177027262 0ustar ( ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8823d060f763a3af69d52d2a8c6025cec4dcb603qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8823d060f763a3af69d52d20000664000000000000000000000000513257152177027101 0ustar :././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-878666e3493929112ad877557d66dd6d955404ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-878666e3493929112ad87750000664000000000000000000000006513257152177026640 0ustar ¬' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-851ca3856a7ae96dffae659fdcbd96a47084d065qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-851ca3856a7ae96dffae6590000664000000000000000000000101613257152177027343 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-84feacf84f41b25849dd03b440b94048338fa025qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-84feacf84f41b25849dd03b0000664000000000000000000000003613257152177027330 0ustar ÿÿÿÿ ÿÿÿÿ ÿÿ¬¬(././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8327cd9dd75b7737b18c79aced596f02fcc0022fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-8327cd9dd75b7737b18c79a0000664000000000000000000000007113257152177027205 0ustar Çÿ¶¶¶¶¶6¶¶¶ÿÿ¶¶¶¶¶6¶¶¶ÿÿjÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-80d22a21e8a9a911571db4fbd004e04321dc99deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-80d22a21e8a9a911571db4f0000664000000000000000000000005313257152177027150 0ustar )(„ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-7de84e54f0822896fc4ed96a1e633c9adf0b3572qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-7de84e54f0822896fc4ed960000664000000000000000000000000313257152177027207 0ustar :!././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-7c338ed2840d2bf55f9f5e4eed04f66c80840eb3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-7c338ed2840d2bf55f9f5e40000664000000000000000000000000313257152177027251 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-77614bda09bb1504a68d985cfcf73b2904bd400dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-77614bda09bb1504a68d9850000664000000000000000000000000413257152177027100 0ustar )(„././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-754b26d5351215092b23c09c606666d4ec30af2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-754b26d5351215092b23c090000664000000000000000000000001513257152177026644 0ustar ÿÇb././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-74fccf506fdd1cbc7ac3cfb80a9485bb75045d37qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-74fccf506fdd1cbc7ac3cfb0000664000000000000000000000005413257152177027675 0ustar Å¡ÿÿÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿ:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-735eb3567553ceb5498eba98a89dbbc2959d0b14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-735eb3567553ceb5498eba90000664000000000000000000000003213257152177027176 0ustar (ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-71e2c615b741fa43d83be1d18ba42b7428f322f4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-71e2c615b741fa43d83be1d0000664000000000000000000000010013257152177027222 0ustar :ÿ ŽõÇ ŽõõAÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-702fad2ec7778507954cd8ea1b8e53372c824a47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-702fad2ec7778507954cd8e0000664000000000000000000000004313257152177027200 0ustar ••;n•••••••••••••™ÿÿ••••••••••Û•././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-6f8b9477b1246aae2d3d3ab1216e56dbaad0f495qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-6f8b9477b1246aae2d3d3ab0000664000000000000000000000001513257152177027314 0ustar ÿÇÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-6dc1bf8eaa3ca50a6c43d9c7fb5cddc7952f6230qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-6dc1bf8eaa3ca50a6c43d9c0000664000000000000000000000005613257152177027531 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-691a9a6ff6cd7297d897da6ca1e9fa4bcc5820e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-691a9a6ff6cd7297d897da60000664000000000000000000000000213257152177027270 0ustar Ð././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-64e43aa99e8df81da7774232b156a1530e67adb0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-64e43aa99e8df81da7774230000664000000000000000000000006413257152177027203 0ustar ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦&¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-64a3e8a63e79a22639e6017c85cbf9a4cab8c800qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-64a3e8a63e79a22639e60170000664000000000000000000000000413257152177027024 0ustar õ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-63bde62f7a8928ca7224e1979d6bf018a2bdd1a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-63bde62f7a8928ca7224e190000664000000000000000000000111413257152177027172 0ustar AMQPSÀƒ ¡SÀƒ ¡0.0.0.0@pÿßÿÿ`ÿÿpu1@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdueMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-630588f2fcc608a775e2417007d858adcac7dec5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-630588f2fcc608a775e24170000664000000000000000000000000213257152177027025 0ustar :Š././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62eb5f4a1fdfd782d1a42986cd67dd139d774dc2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62eb5f4a1fdfd782d1a42980000664000000000000000000000002413257152177027324 0ustar Û¶¶ccccccccccccccccc././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62849da057eaaecfb3994ed188db67b0c9e8c9d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62849da057eaaecfb3994ed0000664000000000000000000000010013257152177027404 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62508694111cff3ee380e00cafc5cb06ec37fe91qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-62508694111cff3ee380e000000664000000000000000000000001013257152177027004 0ustar ±±±±±)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5e44b964ced89ca23090761ec9625fe7bb7fd2d2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5e44b964ced89ca230907610000664000000000000000000000010013257152177027101 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5d9e2fa9e33178ae4fcb7213b4af9479ea8ae701qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5d9e2fa9e33178ae4fcb7210000664000000000000000000000006613257152177027333 0ustar ¬„' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5a54a1ac9c67ae088411f45a75f62bb52b1da6e0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5a54a1ac9c67ae088411f450000664000000000000000000000000513257152177027152 0ustar ::././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-59891d7db811953cf0284270f9c1bf2ec7edd957qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-59891d7db811953cf0284270000664000000000000000000000010013257152177026751 0ustar •••••••••••••••™•••••ÿÿÿÿÿÿÿÿÿÿÿÿÿ••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-593823adb330c78e53ef44c894a3245ca71ca417qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-593823adb330c78e53ef44c0000664000000000000000000000000413257152177027160 0ustar )J„)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-58ce1b2e83c2337aa6f000b68647365c207e0374qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-58ce1b2e83c2337aa6f000b0000664000000000000000000000010013257152177027211 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5868332525019c4b825f4041c36c19c9a92a45d0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5868332525019c4b825f4040000664000000000000000000000002213257152177026577 0ustar ÿÿÿÿÿ ÿÿÿ¬¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-52b28a767e8ffe33ea66a0c0c363166309d63619qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-52b28a767e8ffe33ea66a0c0000664000000000000000000000003413257152177027325 0ustar Û¶¶ccccccccccccccccccgcâccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5261e365224088247d8aa658923ebfe557cb3136qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-5261e365224088247d8aa650000664000000000000000000000000213257152177026655 0ustar „)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-507589d80a0dfa39b41c6daff0fd6d59ee39d129qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-507589d80a0dfa39b41c6da0000664000000000000000000000000513257152177027234 0ustar :ÿ¨././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-4f51b4c667c3dcfab932d2b098c3a3eecffb6256qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-4f51b4c667c3dcfab932d2b0000664000000000000000000000000213257152177027366 0ustar ))././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-49a225ff87eb8b9549905b9788dc90d783edefdcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-49a225ff87eb8b9549905b90000664000000000000000000000002013257152177027125 0ustar ¬'¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-496b5a8d0ed91bd9de2e9e63a842c7a774c2bb9eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-496b5a8d0ed91bd9de2e9e60000664000000000000000000000006313257152177027422 0ustar Û¶¶ccccccccccccccccccccccÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-47f2da90b5629ead1098170575a871135ce577c0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-47f2da90b5629ead10981700000664000000000000000000000005613257152177027104 0ustar Ç ÿÿÿÿÿÿÿÿ(ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿA././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-46fad3426a2dd005e7b84b63b7ab78377917fafcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-46fad3426a2dd005e7b84b60000664000000000000000000000003013257152177027225 0ustar ÇÿÿÿÿÿÿÿÿÿÇÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-40bc3600abe5d4e0711d7c9a17123009eff33e5cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-40bc3600abe5d4e0711d7c90000664000000000000000000000002713257152177027221 0ustar Û¶¶ccccccccccccccccccéö././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3da88ccf646c1dae8fab5bcd0b5a93efc72782d1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3da88ccf646c1dae8fab5bc0000664000000000000000000000003613257152177027622 0ustar ÿÿÿÿ ÿÿÿÿ ÿÿÿ¬¬(././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3a05ee78f2ed84028fc970a449af0ecac0b393f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3a05ee78f2ed84028fc970a0000664000000000000000000000001013257152177027240 0ustar ±±±±±±±)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-39602e463426bc441270f87e7266802d1ef116ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-39602e463426bc441270f870000664000000000000000000000001113257152177026654 0ustar :././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-386da5069756692fbb7ba5c6ef2fe6080812b972qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-386da5069756692fbb7ba5c0000664000000000000000000000061013257152177027174 0ustar AMQPSÀƒ ¡0.ˆ7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿd¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQs%@ ÀS@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-38210335cd79fe12d425cd976055b4af8b6e7346qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-38210335cd79fe12d425cd90000664000000000000000000000010013257152177027072 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3598c6f45c3e1ed8be375036418eedaf84b41f99qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-3598c6f45c3e1ed8be375030000664000000000000000000000007113257152177027173 0ustar Çÿ¶¶¶¶¶6¶¶¶ÿÿ¶¶¶¶¶6¶¶¶ÿÿ*ÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-357b645c7e8edc8dbe63675d2908c3d42e071b3aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-357b645c7e8edc8dbe636750000664000000000000000000000000213257152177027257 0ustar ŠŠ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-34ece36ef99e62b3c3a5056ba8c62f5506a76b4dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-34ece36ef99e62b3c3a50560000664000000000000000000000010013257152177027240 0ustar :ÿ ŽõÇ Žõõ:ÿú././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-346a66c84c9719f5c7621a66b557ac7d56582472qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-346a66c84c9719f5c7621a60000664000000000000000000000115413257152177027042 0ustar AMQPSÀƒ ¡l0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-33dcbf48bafc7b18357bf4ca37483844086c287bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-33dcbf48bafc7b18357bf4c0000664000000000000000000000001513257152177027457 0ustar ÿÇb÷././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-31789ace8fdb0fae2976e8303b614c51d0a139a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-31789ace8fdb0fae2976e830000664000000000000000000000000513257152177027336 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-30b332e85329b3ed7ef6c46d22d84612ab719690qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-30b332e85329b3ed7ef6c460000664000000000000000000000006413257152177027166 0ustar ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦4¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦&¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2f28baeaa7da50ffa118602581d9dd36881781fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2f28baeaa7da50ffa1186020000664000000000000000000000003413257152177027357 0ustar :Š:ë././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2d1a466364c7b9dd97e2c7f0b3c561a6f2d06932qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2d1a466364c7b9dd97e2c7f0000664000000000000000000000027313257152177027261 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@€¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSen)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2cfc212152ffca9abf64304cd4d5c59ae98f4908qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2cfc212152ffca9abf643040000664000000000000000000000006513257152177027305 0ustar ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦4¦¦¦¦¦¦'¦¦¦¦¦¦¦¦¦¦¦&¦¦¦¦¦¦¦¦¢¦¦¦¦¦¦¦)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2ba94da5fbe9e3ef97b04b144df576b9026af64cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2ba94da5fbe9e3ef97b04b10000664000000000000000000000010013257152177027453 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2b8ea1e3273d046280cbc5f24c9b615fbded944fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2b8ea1e3273d046280cbc5f0000664000000000000000000000000413257152177027222 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2a8535ad000133fdf7cfc5bf621e98681b1df92eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2a8535ad000133fdf7cfc5b0000664000000000000000000000003413257152177027301 0ustar Û¶¶cccccccccccccccccccccccéö././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-28d2865f24cfc9a03925253fa554b9dc4d7bd212qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-28d2865f24cfc9a039252530000664000000000000000000000003413257152177027025 0ustar :Šÿÿÿÿÿÿÿÿ:ë././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-24fb83ec0f7a8d60fa2a20e48696d4d66cda980dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-24fb83ec0f7a8d60fa2a20e0000664000000000000000000000002413257152177027364 0ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-227df70a6f454510144eadfe42e92c069543d544qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-227df70a6f454510144eadf0000664000000000000000000000000413257152177027145 0ustar H././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-22405f912a3854621435087ebb40f92d64ad1c23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-22405f912a38546214350870000664000000000000000000000004013257152177026510 0ustar ÿÿÿÿÿÿ' ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2201e36cc483037b88bda3285b2277c64c6f96a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2201e36cc483037b88bda320000664000000000000000000000010013257152177027055 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-210b45b3d7f7489cefaf56723413021a42c608e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-210b45b3d7f7489cefaf5670000664000000000000000000000010013257152177027244 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2010bec8c1d619922a69f38de954c8dddb9a1cc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-2010bec8c1d619922a69f380000664000000000000000000000005613257152177027102 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶¶¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-1f806078655c9b7665aff1d5729767d6f8761c43qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-1f806078655c9b7665aff1d0000664000000000000000000000006413257152177027122 0ustar ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-1eacc46ab4f91a9a17a62972a8076c12529de86fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-1eacc46ab4f91a9a17a62970000664000000000000000000000004513257152177027317 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-19c0b7cd4127738ecc07a289e05c33aa2244cf23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-19c0b7cd4127738ecc07a280000664000000000000000000000000513257152177027153 0ustar )J(„)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-16cad5a28d0be12a4e219c22ea93a3dc37dc0d7aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-16cad5a28d0be12a4e219c20000664000000000000000000000001613257152177027273 0ustar :ŠÆuÿü././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-15dfe2fdb2aaf752af69e2fee836124f553a62cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-15dfe2fdb2aaf752af69e2f0000664000000000000000000000005613257152177027545 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéÿ¶¶¶¶¶6¶¶¶ÿÿÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-15c3a94be91762b8b428e798f951d34055dabe2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-15c3a94be91762b8b428e790000664000000000000000000000005413257152177027116 0ustar •••••••••••••••••™•••••••••••••••••••••••••././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-155ad410177135e106878d46a347967620789872qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-155ad410177135e106878d40000664000000000000000000000003513257152177026654 0ustar ÇÿÿÿÿÿÿÿÿÿÿÿÿÿÇÿ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-140d7b4346643133d554baa2da3b3d43ca91e070qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-140d7b4346643133d554baa0000664000000000000000000000001613257152177027000 0ustar :Š:Šü././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-11f835872cb2a7151ab83cc4300bf3ab6d06dedbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-11f835872cb2a7151ab83cc0000664000000000000000000000003313257152177027145 0ustar :Š:././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-115c07b242f04fa3a4545e1dfe1e42c946b249a5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-115c07b242f04fa3a4545e10000664000000000000000000000002213257152177027050 0ustar ŽõÇ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-0b78aaab29c58541e0b9cc19f1ba9535d9d2a1a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-0b78aaab29c58541e0b9cc10000664000000000000000000000002213257152177027302 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¬¬././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-0ab8318acaf6e678dd02e2b5c343ed41111b393dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-0ab8318acaf6e678dd02e2b0000664000000000000000000000000113257152177027362 0ustar !././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-055bf8d1c45e11c692d043f8f68a1bf1a9141309qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-055bf8d1c45e11c692d043f0000664000000000000000000000000313257152177027146 0ustar J„)././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-03fa738bf368c19631b1e5e39c725e4ff5165cddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-03fa738bf368c19631b1e5e0000664000000000000000000000003413257152177027161 0ustar Û¶¶clccc:cccccccccccccccccé¶././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-03aa026dada18298234e621746023394b044553bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-03aa026dada18298234e6210000664000000000000000000000010013257152177027047 0ustar ¬ ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-035e1f0955f8fa18406e9363277757cac57a27e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-035e1f0955f8fa18406e9360000664000000000000000000000052113257152177027032 0ustar AMQPSÀƒ ¡0.0.0SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@BƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-02b3f71dc08171040e0aa629e9fa6b943e47fed0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/crash/crash-02b3f71dc08171040e0aa620000664000000000000000000000001713257152177027044 0ustar Ûccc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000571,src__000037,op__arith8,pos__50,val___14,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000571,src__000037,op__a0000664000000000000000000000106213257152177027320 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000570,src__000010,op__arith8,pos__446,val__-15,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000570,src__000010,op__a0000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹S±CR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000569,src__000010,op__arith8,pos__363,val___7,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000569,src__000010,op__a0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡0Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000568,src__000010,op__arith8,pos__307,val__-3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000568,src__000010,op__a0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000567,src__000010,op__arith8,pos__261,val__-1,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000567,src__000010,op__a0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000566,src__000010,op__arith8,pos__250,val___19,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000566,src__000010,op__a0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BV¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000565,src__000010,op__arith8,pos__250,val___18,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000565,src__000010,op__a0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BU¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000564,src__000010,op__arith8,pos__246,val___7,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000564,src__000010,op__a0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS0E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000563,src__000010,op__arith8,pos__199,val__-6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000563,src__000010,op__a0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000562,src__000010,op__arith8,pos__196,val___5,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000562,src__000010,op__a0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000561,src__000010,op__arith8,pos__162,val___7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000561,src__000010,op__a0000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000560,src__000010,op__arith8,pos__155,val__-17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000560,src__000010,op__a0000664000000000000000000000115413257152177027307 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000559,src__000010,op__arith8,pos__136,val__-15,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000559,src__000010,op__a0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis”version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000558,src__000010,op__arith8,pos__136,val__-11,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000558,src__000010,op__a0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis˜version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000557,src__000010,op__arith8,pos__103,val___19qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000557,src__000010,op__a0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000556,src__000010,op__arith8,pos__102,val__-33,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000556,src__000010,op__a0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3‚kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000555,src__000010,op__arith8,pos__50,val___13,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000555,src__000010,op__a0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1°sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000554,src__000010,op__arith8,pos__50,val__-11,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000554,src__000010,op__a0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1˜sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000553,src__000010,op__arith8,pos__21,val__-10qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000553,src__000010,op__a0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000552,src__000010,op__arith8,pos__12,val___34qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000552,src__000010,op__a0000664000000000000000000000115413257152177027310 0ustar AMQP$SÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000551,src__000010,op__flip4,pos__271qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000551,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CðSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000550,src__000010,op__flip4,pos__248,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000550,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E°BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000549,src__000010,op__flip4,pos__243,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000549,src__000010,op__f0000664000000000000000000000115413257152177027323 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000548,src__000010,op__flip4,pos__196qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000548,src__000010,op__f0000664000000000000000000000115413257152177027322 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000547,src__000010,op__flip4,pos__160qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000547,src__000010,op__f0000664000000000000000000000115413257152177027321 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"ðSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000546,src__000010,op__flip2,pos__522qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000546,src__000010,op__f0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SðCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000545,src__000010,op__flip2,pos__453,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000545,src__000010,op__f0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR a1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000544,src__000010,op__flip2,pos__446,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000544,src__000010,op__f0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SðCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000543,src__000010,op__flip2,pos__445,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000543,src__000010,op__f0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000542,src__000010,op__flip2,pos__307qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000542,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000541,src__000010,op__flip2,pos__285qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000541,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000540,src__000010,op__flip2,pos__273qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000540,src__000010,op__f0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSsÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000539,src__000010,op__flip2,pos__261,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000539,src__000010,op__f0000664000000000000000000000115413257152177027322 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000538,src__000010,op__flip2,pos__261qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000538,src__000010,op__f0000664000000000000000000000115413257152177027321 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000537,src__000010,op__flip2,pos__254qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000537,src__000010,op__f0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¾SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000536,src__000010,op__flip2,pos__249,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000536,src__000010,op__f0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@‚C¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000535,src__000010,op__flip2,pos__222qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000535,src__000010,op__f0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(ð¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000534,src__000010,op__flip2,pos__214,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000534,src__000010,op__f0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000533,src__000010,op__flip2,pos__155qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000533,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000532,src__000010,op__flip2,pos__50,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000532,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1 sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000531,src__000010,op__flip2,pos__11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000531,src__000010,op__f0000664000000000000000000000115413257152177027312 0ustar AMQP–SÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000530,src__000010,op__flip1,pos__492qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000530,src__000010,op__f0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ%@@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000529,src__000010,op__flip1,pos__490qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000529,src__000010,op__f0000664000000000000000000000115413257152177027321 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsà% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000528,src__000010,op__flip1,pos__470qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000528,src__000010,op__f0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£.x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000527,src__000010,op__flip1,pos__445qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000527,src__000010,op__f0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000526,src__000010,op__flip1,pos__445qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000526,src__000010,op__f0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000525,src__000010,op__flip1,pos__335qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000525,src__000010,op__f0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@£Xw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000524,src__000010,op__flip1,pos__280qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000524,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASsÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000523,src__000010,op__flip1,pos__280qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000523,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASpÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000522,src__000010,op__flip1,pos__280,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000522,src__000010,op__f0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASvÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000521,src__000010,op__flip1,pos__276qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000521,src__000010,op__f0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000520,src__000010,op__flip1,pos__273,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000520,src__000010,op__f0000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSqÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000519,src__000010,op__flip1,pos__273,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000519,src__000010,op__f0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSxÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000518,src__000010,op__flip1,pos__272qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000518,src__000010,op__f0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CÓpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000517,src__000010,op__flip1,pos__265qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000517,src__000010,op__f0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀSC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000516,src__000010,op__flip1,pos__261,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000516,src__000010,op__f0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000515,src__000010,op__flip1,pos__261qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000515,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000514,src__000010,op__flip1,pos__203qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000514,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ mi_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000513,src__000010,op__flip1,pos__197qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000513,src__000010,op__f0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000512,src__000010,op__flip1,pos__196,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000512,src__000010,op__f0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000511,src__000010,op__flip1,pos__196,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000511,src__000010,op__f0000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000510,src__000010,op__flip1,pos__196,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000510,src__000010,op__f0000664000000000000000000000115413257152177027307 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000509,src__000010,op__flip1,pos__190qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000509,src__000010,op__f0000664000000000000000000000115413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA SÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000508,src__000010,op__flip1,pos__163qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000508,src__000010,op__f0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"Sà`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000507,src__000010,op__flip1,pos__145,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000507,src__000010,op__f0000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000506,src__000010,op__flip1,pos__99qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000506,src__000010,op__f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000505,src__000010,op__flip1,pos__50,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000505,src__000010,op__f0000664000000000000000000000115413257152177027313 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1³sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000504,src__000010,op__flip1,pos__22qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000504,src__000010,op__f0000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ  0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000503,src__000010,op__flip1,pos__21qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000503,src__000010,op__f0000664000000000000000000000115413257152177027311 0ustar AMQPSÀƒ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000502,src__000010,op__flip1,pos__18,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000502,src__000010,op__f0000664000000000000000000000115413257152177027310 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000501,src__000010,op__flip1,pos__18,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000501,src__000010,op__f0000664000000000000000000000115413257152177027307 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000500,src__000010,op__flip1,pos__0,_covqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000500,src__000010,op__f0000664000000000000000000000115413257152177027306 0ustar ÁMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000499,src__000003,op__havoc,rep__32qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000499,src__000003,op__h0000664000000000000000000000024413257152177027332 0ustar AMQPSÀƒ ¡0.0.0ms.queuY.exampŒe2555555555555555555555555555555@¡jLs.q w·St¡)@@@@@ƒXw·[QQue], thr], thr@ad= ¸nt¡)PPoducer(0ctiseMS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000351,orig__ca44c8744fe82b46e23fce45d1378eed69452e2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000351,orig__ca44c8744fe0000664000000000000000000000115213257152177027422 0ustar AMQPSð?|ü¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"ÿÿÿÿÿÿÿSÀ`RpÿÿÿpÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAAMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-aS£x-opt-jms-ctidestQ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000350,orig__c9c412ab73132a8d9bf4ad40283fb65060866a30qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000350,orig__c9c412ab7310000664000000000000000000000071513257152177027330 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(Á¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000349,orig__c99ca1b53c78a0cbee593e27ff0fe65a719b4eb2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000349,orig__c99ca1b53c70000664000000000000000000000047313257152177027433 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ols£e-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿpÿÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000348,orig__c9934546277bd1e28753adf4729b7bac5d289f0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000348,orig__c99345462770000664000000000000000000000046313257152177027146 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000347,orig__c8f8bd07151c676639ec5f293a9e2d51f47a105eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000347,orig__c8f8bd071510000664000000000000000000000115413257152177027345 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0Sw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000346,orig__c8bdf2beece7a6ced2bd7f5e4c7154f1b6722c11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000346,orig__c8bdf2beece0000664000000000000000000000115413257152177027724 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·S;ÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000345,orig__c80a9aae8471ef74360ab4085bc4c2dc1be97bc6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000345,orig__c80a9aae8470000664000000000000000000000023613257152177027425 0ustar AMQPSÀƒ ¡0.0.0.;@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY`Á3£product¡a'ache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000344,orig__c730fd31aef6e41f0d1c444e7db2687cb0ae651fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000344,orig__c730fd31aef0000664000000000000000000000115413257152177027474 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000343,orig__c616630e295fa26b932c8c5148821c34cafce3f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000343,orig__c616630e2950000664000000000000000000000113413257152177027200 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000342,orig__c59fc6451ec6db995a0e65a30215a8a7345f6e45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000342,orig__c59fc6451ec0000664000000000000000000000071513257152177027427 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCISÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000341,orig__c580af2a2742b826da44de2ce668303a45174116qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000341,orig__c580af2a2740000664000000000000000000000005613257152177027331 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000340,orig__c573f8c47a34ccc6b9917431684227cf1e07baa0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000340,orig__c573f8c47a30000664000000000000000000000115413257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000339,orig__c3e199707597e95191827ed1b719c521c6727e0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000339,orig__c3e199707590000664000000000000000000000101513257152177027217 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activ!mq-artemis£versio(¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP³(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000338,orig__c363822fd6b6fd404dac44fa95eea7319492cb41qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000338,orig__c363822fd6b0000664000000000000000000000113313257152177027342 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0@@à1£sole-connection-for-containerTELAYED_DELIVERY@Á3£product¡apache-activemq-arteqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:notpu0@@à1£sole-connection-for-containerTELAYED_DELIVERY@Á3£product¡apache-activemq-arteqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmis£version¡1.5.0"SÀ`Rpÿÿÿp-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000337,orig__c361a2b998b608436eff227d329bb449607d509dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000337,orig__c361a2b998b0000664000000000000000000000055013257152177027344 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000336,orig__c30f5beff0fd5b0f767f799ff75dcf3cf0298cd2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000336,orig__c30f5beff0f0000664000000000000000000000066213257152177027563 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ1 ¡ my_receiverCBPPS(À¡jms.queue.exa0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000335,orig__bfc4dab55faa6bcb351e277389c2a36a13daea0eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000335,orig__bfc4dab55fa0000664000000000000000000000111713257152177027633 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reec*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000334,orig__bf78a3eb0af5dc179ee197ae9ea6e58ebd9434b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000334,orig__bf78a3eb0af0000664000000000000000000000115413257152177027555 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStAÁ¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], Ýhread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000333,orig__bf366f6855d36834a7cffb9a69b78e74ca6bbbabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000333,orig__bf366f6855d0000664000000000000000000000115413257152177027354 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP;S(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Pooducer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000332,orig__be8dfd431ccc3fa35a196c2cad7c7c12dbc57471qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000332,orig__be8dfd431cc0000664000000000000000000000115413257152177027555 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡ countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000331,orig__bd99fe90a82d785d4f31797fe7b7ede12c845341qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000331,orig__bd99fe90a820000664000000000000000000000037613257152177027435 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi£sversion¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000330,orig__bba191d9765d818ea1569b5f2e616bad410a9d0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000330,orig__bba191d97650000664000000000000000000000115413257152177027337 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000329,orig__bb866a2f8d475e0cd427c6e99e7bcc88360f6cefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000329,orig__bb866a2f8d40000664000000000000000000000046313257152177027433 0ustar AMQPSÀƒ ¡0.0.0®0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`€Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000328,orig__baedb5aaed2df030c0b2e7ba51080703b43e4ec1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000328,orig__baedb5aaed20000664000000000000000000000026313257152177027707 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡Sge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000327,orig__b92fb34478ff6a96240fe784085361524e966dc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000327,orig__b92fb34478f0000664000000000000000000000115413257152177027353 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connÀction-for-containerDELAYED_DELIVERY@Á3Vø”oduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1C!pÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000326,orig__b7e435ea6415b2ef6a8a3cb72669d60c1f8049caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000326,orig__b7e435ea6410000664000000000000000000000000513257152177027332 0ustar :ÿú././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000325,orig__b7c7b300d6313ed7282b9f09ca21ed2561526f6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000325,orig__b7c7b300d630000664000000000000000000000000513257152177027323 0ustar AMQP././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000324,orig__b7005c27a86327f44ccb0f659985badd25b01bd9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000324,orig__b7005c27a860000664000000000000000000000045313257152177027255 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-ar„„„„„„SsÀ%@ ¡@jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡j-s.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000323,orig__b693900e85dea35d2a512b0616bd39a7496888b4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000323,orig__b693900e85d0000664000000000000000000000036113257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000322,orig__b4f9c2c0a434fd9c7df40072050b6befc3cfcd2cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000322,orig__b4f9c2c0a430000664000000000000000000000043013257152177027402 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿp£sole-connection-for-containerDELAYED_DELIle], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer Aktivest message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000321,orig__b30f4d3bdd5a1b9093cf7f241f9ad076f8c60a01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000321,orig__b30f4d3bdd50000664000000000000000000000115413257152177027465 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000320,orig__b2f158152bd7bd75219d30f373083e60b346e763qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000320,orig__b2f158152bd0000664000000000000000000000001213257152177027315 0ustar ŽõÇ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000319,orig__b2948750248fcd761e3738b55e3d169a721ec903qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000319,orig__b29487502480000664000000000000000000000104613257152177027132 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000318,orig__b25109039fad80cf53505e981a25ccb2e95c7f83qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000318,orig__b25109039fa0000664000000000000000000000071513257152177027256 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_rSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpexampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example¹@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000317,orig__b225d9445ec153a44eb16d7da4c38495b041c2cbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000317,orig__b225d9445ec0000664000000000000000000000113413257152177027340 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000316,orig__b0ab9f6746fb3031807f0ca55cbdaa81db9afcf4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000316,orig__b0ab9f6746f0000664000000000000000000000115413257152177027425 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000315,orig__b09f54d6993758131454c22e255cd6695e64fb8cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000315,orig__b09f54d69930000664000000000000000000000072713257152177027301 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000314,orig__b09450282ecb92d989617fb3fe340474f7508bc8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000314,orig__b09450282ec0000664000000000000000000000057513257152177027260 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000313,orig__af112fc29e65709ef6366fcdb4b9a7c2cbb47961qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000313,orig__af112fc29e60000664000000000000000000000067513257152177027422 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_recece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000312,orig__aef19ef7237d6e63b7e11341ab588430d52079e8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000312,orig__aef19ef72370000664000000000000000000000114213257152177027421 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQAAAAAQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@'@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡coUntTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000311,orig__ae78960cbdf27048497f3e49cafc6416342ae7b6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000311,orig__ae78960cbdf0000664000000000000000000000115413257152177027502 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000310,orig__ae30408c5f04d3ce09cdcb3edcb6c56dda223a41qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000310,orig__ae30408c5f00000664000000000000000000000115413257152177027321 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡3.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀxampleS)E@BC¸SÀCC 0CSpÀAÁeñ‡Òopt-jís-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSeD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.querDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000309,orig__ad22a08f406e82897a8ef227d14ac23a24b08083qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000309,orig__ad22a08f4060000664000000000000000000000101613257152177027325 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-:jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000308,orig__acfe1f9c62e2c5727f2d6ed254f6df2893eba95bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000308,orig__acfe1f9c62e0000664000000000000000000000077613257152177027575 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.exajple@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jmsSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000307,orig__ac08b57708566d32badf153efdb7292552980c8fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000307,orig__ac08b5770850000664000000000000000000000075113257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿmy_receiverASÀ4 ¡ my_rece*verCBPPS(Àoducer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000306,orig__aba6a1642a535762c1a8596676cea54399ee23b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000306,orig__aba6a1642a50000664000000000000000000000115413257152177027401 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPÿÿÿÿS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡conuTtSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQ­Œ?ÚõÈ@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000305,orig__ab941e172fefdf252019c74ead858714926feec9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000305,orig__ab941e172fe0000664000000000000000000000115413257152177027415 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000304,orig__aa90f7481c56bc3a10b16c1c92ed1f352209d8d0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000304,orig__aa90f7481c50000664000000000000000000000115413257152177027336 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000303,orig__a990f9d0f2dd6098767b7375107d36d122271a49qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000303,orig__a990f9d0f2d0000664000000000000000000000057513257152177027430 0ustar AÿÿÿÿÿÿÿÿSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿD_DELI0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000302,orig__a8efddb757a110f1d20fc7ef47bf8e9170e097d1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000302,orig__a8efddb757a0000664000000000000000000000115413257152177027561 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ù¦‹>¾¡ Thremessage: 26¹SÀCReue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000301,orig__a676370b5fef879217a46ee27531478709d43606qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000301,orig__a676370b5fe0000664000000000000000000000115413257152177027336 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messag): 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000300,orig__a5bee715fa934be29d7c0f209ae8e9b17b48035fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000300,orig__a5bee715fa90000664000000000000000000000042413257152177027473 0ustar AMQPÀƒS ¡0.0.0.0@pÿÿÿÿ`ÿÿp*u0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000299,orig__a4c2ebcf7d40684881cba72e043ff9dd91774b0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000299,orig__a4c2ebcf7d40000664000000000000000000000000313257152177027557 0ustar ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000298,orig__a4b4c2295c6028b8def0fb774e6b27fc43335345qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000298,orig__a4b4c2295c60000664000000000000000000000115413257152177027346 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26MSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000297,orig__a401e6db47cd1c7c90257dc9eff32bd357596254qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000297,orig__a401e6db47c0000664000000000000000000000055413257152177027424 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000296,orig__a2d7fde750eae69da66e796f8fd8b20468ab2403qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000296,orig__a2d7fde750e0000664000000000000000000000026113257152177027507 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0;à1£sole-connection-for-containerDELAYED_DELIVERY@ÁAMQPSÀƒ 3erDELAYED_DELIVERY@Á¡0.0.0.0@pÿY@3Á3££kr././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000295,orig__a2981c9688b5e3111a50e4ff36d12a9aeb616f29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000295,orig__a2981c9688b0000664000000000000000000000023513257152177027302 0ustar AMQPSÀƒ ¡0.0.AMQP0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`R././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000294,orig__a219c62c1345b445f0feaf4920a1dfac641b156dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000294,orig__a219c62c1340000664000000000000000000000046313257152177027256 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000293,orig__a1b715c1d05a2638591091d6a1e87a16f630d69cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000293,orig__a1b715c1d050000664000000000000000000000001513257152177027321 0ustar AMQPI././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000292,orig__9fbe6001c34a3cc9d7786cd628bdef116957d0b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000292,orig__9fbe6001c340000664000000000000000000000115413257152177027336 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000291,orig__9f3079ca9cd734b5897edd798bcfa0a1f38f7ddaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000291,orig__9f3079ca9cd0000664000000000000000000000000513257152177027426 0ustar :././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000290,orig__9ed99aaa3c2ac3f11a4a57d7f38a7bceb70e4740qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000290,orig__9ed99aaa3c20000664000000000000000000000115413257152177027504 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@)à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000289,orig__9eaf065411d735d221bdb00d92089a46cb35c78dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000289,orig__9eaf065411d0000664000000000000000000000073713257152177027355 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQ„„„„„„„„„„„„„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000288,orig__9e980a94723bd11013c89bf2e159b00ed1270d12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000288,orig__9e980a947230000664000000000000000000000001213257152177027215 0ustar õÇ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000287,orig__9db33b3178e51da50b72c234f9e19145dfd66971qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000287,orig__9db33b3178e0000664000000000000000000000011613257152177027347 0ustar AMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@à1£sPole-connecti././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000286,orig__9d6d6246bb254ad4e3e64cee81fa5532f95ab80fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000286,orig__9d6d6246bb20000664000000000000000000000076613257152177027361 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qÿÿÿÿÿÿÿÿÿÿÿueue.examplms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qÿÿÿÿÿÿÿÿÿÿÿueue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000285,orig__9cc0934c7a316a81fe78fc05689037939c18dfdfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000285,orig__9cc0934c7a30000664000000000000000000000001513257152177027341 0ustar AMQPÿhh)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000284,orig__9bc993451e55d99a1fee8b9086d2bc419e289021qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000284,orig__9bc993451e50000664000000000000000000000115413257152177027277 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000283,orig__99f8c582d45aac766dc59c6f3e3efe514adcd86bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000283,orig__99f8c582d450000664000000000000000000000115413257152177027306 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS!À4 ¡ my_r!!!eceion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@À ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source addreùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@-containerDELAYED_DEÿÿÿÿx././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000282,orig__9909bc75edb3f5a4417f21c2632fc26924ac2b09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000282,orig__9909bc75edb0000664000000000000000000000103713257152177027435 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpAÿÿSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test meÿÿÿÿssage: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000281,orig__989bd53e85073495e8c9e4f834625e18a3f3508cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000281,orig__989bd53e8500000664000000000000000000000115413257152177027277 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÿÿÿÿSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000280,orig__98756aa837da45035de0bcc0244cd76e6dd5c24bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000280,orig__98756aa837d0000664000000000000000000000001713257152177027274 0ustar AMQPÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000279,orig__98728779491ea0af792a5c9d10d4e671f18205e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000279,orig__987287794910000664000000000000000000000004513257152177027101 0ustar %SSÿÿÿÿ÷÷÷÷÷J÷!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000278,orig__984d1cf71f109696be39c4349f9c418c04bd25a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000278,orig__984d1cf71f10000664000000000000000000000115413257152177027355 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQ: 26¹SÀCR 1(SpÀAXw·StÁA¡ ThreadSent¡)Producer ActiveMuuQeQe[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000277,orig__973970255bcfd7b838bd478cb43becd301130715qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000277,orig__973970255bc0000664000000000000000000000050613257152177027216 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿSÀCCASÀ;£amqp:not-found¡(AMQ071616: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000276,orig__970fa3137006ab81db9ff4d30d056ad744544618qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000276,orig__970fa3137000000664000000000000000000000115413257152177027176 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apachAMQPSÀƒ ¡0.e-activ0.0.0@pÿÿÿÿÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[efor-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exa@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% ple], th././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000275,orig__96f9cd58c2f8ff64a39f72cf786fdfc2abfd9f7cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000275,orig__96f9cd58c2f0000664000000000000000000000064713257152177027453 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acvtiemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BPCSÀCCASÀ;£amqp:not-found¡(AMQ21ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ9009: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000274,orig__96d222ad4394313779329fad9eeccef4d8e3725dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000274,orig__96d222ad4390000664000000000000000000000046313257152177027267 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000273,orig__966991de9bfd1b17e78d7081b8db41eaaed43814qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000273,orig__966991de9bf0000664000000000000000000000005613257152177027370 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000272,orig__95d402fd51c5311982dd146c4b998df5b22e22e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000272,orig__95d402fd51c0000664000000000000000000000050113257152177027333 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCþCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000271,orig__959fe3477fd582b7e86ad3d815ab6f609cc66e76qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000271,orig__959fe3477fd0000664000000000000000000000067513257152177027374 0ustar AMQP€SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000270,orig__954fcd956afc8b0b3c08f2cf8c4ec763a9ef2e64qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000270,orig__954fcd956af0000664000000000000000000000051613257152177027436 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-For-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"S@ê`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampletÁA¡ ThreadSent¡)ProdS(À¡jms.queue.ex:ampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000269,orig__9420b57281efbf467f50036c2bded0efdfb527b7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000269,orig__9420b57281e0000664000000000000000000000111613257152177027206 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000268,orig__930c36b3fb0b80b6d09e13edf7a0a72fb2076a5fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000268,orig__930c36b3fb00000664000000000000000000000067513257152177027346 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000267,orig__91f7f23944c1e932d236c3c00b6d2d40950e59eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000267,orig__91f7f23944c0000664000000000000000000000115413257152177027277 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£tTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡êms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 54././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000266,orig__91c166e81f86d6923f85a71de4d1a65b79ba7f89qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000266,orig__91c166e81f80000664000000000000000000000104613257152177027276 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVµRY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿS)E@BC¸SÀCC 0CSpÀA £:x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueueÚex(ample], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.ehample@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡­ountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000265,orig__9199d92e038ebe0629e219e7bcfe138a5b9e58f7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000265,orig__9199d92e0380000664000000000000000000000115413257152177027222 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000264,orig__9167a386ed5b5872e9f0de9eb99de5a8daf39668qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000264,orig__9167a386ed50000664000000000000000000000115413257152177027275 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000263,orig__9159cb8bcee7fcb95582f140960cdae72788d326qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000263,orig__9159cb8bcee0000664000000000000000000000000213257152177027500 0ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000262,orig__8f294fdf45b98220bae082f7e7f5f9b39d6c0958qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000262,orig__8f294fdf45b0000664000000000000000000000114613257152177027435 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BÛ¶¶ccccccccccccC¸cccccSÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡co././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000261,orig__8ee85b6b086d6b10489f4ad3aecd133f0142f3baqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000261,orig__8ee85b6b0860000664000000000000000000000115413257152177027352 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀA£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000260,orig__8ee08543632ad6248e1d099d35527129d017581bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000260,orig__8ee085436320000664000000000000000000000000613257152177027176 0ustar )././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000259,orig__8e7097a5016bda6b512e1ded4768199443b284edqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000259,orig__8e7097a50160000664000000000000000000000102413257152177027207 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000258,orig__8d10a856e55cd79ac4e92822eeeede818640ce19qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000258,orig__8d10a856e550000664000000000000000000000046313257152177027273 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000257,orig__8cff28eb520d48ace3331fa0863863e22b6f934aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000257,orig__8cff28eb5200000664000000000000000000000115413257152177027427 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message:dPent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000256,orig__8c473e03eeade02778887eaf0a209f8de254bae2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000256,orig__8c473e03eea0000664000000000000000000000103313257152177027417 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000255,orig__8bebeddeae592d53d8d4cf993ee7498f4321945eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000255,orig__8bebeddeae50000664000000000000000000000047313257152177027727 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containevDELAYED_DELIVERY@Á3£kroduct¡apache-actS(À¡jms.queuAMQPe.exampSÀƒleSivemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000254,orig__8bba0e9b22dadb12fdcb9f794ea456a850ccc5d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000254,orig__8bba0e9b22d0000664000000000000000000000046313257152177027474 0ustar AMQPS ¡ƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000253,orig__8a9b5a7f662e4dc7beed98823434472ef09b9cebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000253,orig__8a9b5a7f6620000664000000000000000000000010013257152177027337 0ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000252,orig__8a056e4cfbfb1a3da3733647b616ccc2419ed74eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000252,orig__8a056e4cfbf0000664000000000000000000000115413257152177027501 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡counŒ«åúSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000251,orig__8955e0bbad725f95d1c284c09608a4b9e4d6ccc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000251,orig__8955e0bbad70000664000000000000000000000042413257152177027421 0ustar AMQPSÀƒ ¡000.0.0@pÿY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000250,orig__892c0d1a406743a28c2467fe914b130f610d90a1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000250,orig__892c0d1a4060000664000000000000000000000046413257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEF_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`109505: sourcS)E@BCPSÀCCASÀ;£amqp:not-fQ109505: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000249,orig__88a46a29e00b588e9954b144d29d904d224ea1a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000249,orig__88a46a29e000000664000000000000000000000061013257152177027261 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEqueue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡couîtTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000248,orig__870961674973c483be1ad19fa954514415052ad6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000248,orig__870961674970000664000000000000000000000115413257152177027070 0ustar AMQPSÀƒ ¡0ÜÏÑÏÑÏ¿ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apachAMQPSÀƒ ¡0.e-activ0.0.0@pÿÿÿÿÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[efor-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@¾½¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exa@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% ple], th././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000247,orig__858b87b89b6f1df1b21afc8c76726d19f05b60c3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000247,orig__858b87b89b60000664000000000000000000000072113257152177027307 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡25.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000246,orig__8545fd646ad968de83cb298dd4a54416fa217f20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000246,orig__8545fd646ad0000664000000000000000000000115413257152177027353 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-acTivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQD_DELIVERY@Á1£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000245,orig__853f56b73f5b4004586e169c606741c89916b82bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000245,orig__853f56b73f50000664000000000000000000000000613257152177027270 0ustar )././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000244,orig__8539260cb25742b5e96d1cd61f37e0ea0517b50cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000244,orig__8539260cb250000664000000000000000000000115413257152177027201 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containµrDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000243,orig__849007917f5dc64d0391a1260c084482438fcc0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000243,orig__849007917f50000664000000000000000000000115413257152177027133 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaiAMQPSÀƒ ¡0.nerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£so0"SÀle-`RpÿÿÿpÿÿÿpÿÿSÀ4c onne¡CC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], tgread=0¡counŒ«åú¡jcontainerDELAYED[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQ.7@pÿÿÿÿ`ÿÿpuu0@@à1£sole-connection-for-c0@@à1£osole-con.0.0@pÿÿÿÿ`ÿÿp././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000242,orig__843f338e4b7b29671c9e43e987803e3ba57e72f0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000242,orig__843f338e4b70000664000000000000000000000115413257152177027267 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@B„¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000241,orig__8409c2e19066ca0814d7a561a8d0881935e0568dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000241,orig__8409c2e19060000664000000000000000000000115413257152177027200 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000240,orig__838c12f578e3ed439d7060c9d7c9650315086561qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000240,orig__838c12f578e0000664000000000000000000000001113257152177027257 0ustar ÒÒÒÒÒÒ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000239,orig__82d5b4733db89741107eb7aa0da1b04d11d2dd13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000239,orig__82d5b4733db0000664000000000000000000000115413257152177027344 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000238,orig__813b03ca1d55650bed24b295eb79a4e87ec884e2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000238,orig__813b03ca1d50000664000000000000000000000072313257152177027327 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`'ÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀe: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000237,orig__81054ec667a71518a6fa6a2cc4ef9f30033f2004qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000237,orig__81054ec667a0000664000000000000000000000024613257152177027265 0ustar AMQP"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000236,orig__80ffdfe72b58fc02d71638ec40d2fa95b2ead66bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000236,orig__80ffdfe72b50000664000000000000000000000115413257152177027510 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000235,orig__7f7f10349c764b8d20606a93a203ad3867b1cf0dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000235,orig__7f7f10349c70000664000000000000000000000000513257152177027263 0ustar :././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000234,orig__7ed1eb7ef8ac86756d42d4e313e108eb02dbf2bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000234,orig__7ed1eb7ef8a0000664000000000000000000000047713257152177027575 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000233,orig__7e9291f43778ed49df03a1958ef8323f32e2b3deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000233,orig__7e9291f43770000664000000000000000000000000413257152177027207 0ustar ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000232,orig__7e51d07e16f84d001a8be4a1dedf556b3b16720cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000232,orig__7e51d07e16f0000664000000000000000000000101713257152177027336 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreaÿÿdSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000231,orig__7de84e54f0822896fc4ed96a1e633c9adf0b3572qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000231,orig__7de84e54f080000664000000000000000000000000313257152177027340 0ustar :!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000230,orig__7d0bf68cd9a063d59630b9aa24161808c7d65116qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000230,orig__7d0bf68cd9a0000664000000000000000000000107113257152177027477 0ustar AMQPSÀ£x-opt-jms-destQS{À% @jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡testthread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000229,orig__7c31eb8db4dc730f06f17a7410f54d179765ddefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000229,orig__7c31eb8db4d0000664000000000000000000000115413257152177027502 0ustar A!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000228,orig__7ba2a5f57f1bd5a1da00797e0447e18259d93a50qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000228,orig__7ba2a5f57f10000664000000000000000000000063613257152177027425 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000227,orig__781d4a036057532bf18a918d0e45895eaaeb206dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000227,orig__781d4a036050000664000000000000000000000034413257152177027174 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000226,orig__77b071a4d5ae13ae7142ea8f60f4fc2c126921abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000226,orig__77b071a4d5a0000664000000000000000000000071713257152177027337 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_(ELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000225,orig__77712a9e95bc152b12be6c00b71f3b12960782f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000225,orig__77712a9e95b0000664000000000000000000000115413257152177027272 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[examp'e], thread=0c¡ountTSw¡test message: 26¹?SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-des|QSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000224,orig__771f7dc6b5ecef9c668f3cf9693c6e6fff0ecb96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000224,orig__771f7dc6b5e0000664000000000000000000000023613257152177027427 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000223,orig__76ad6aa80959d9bf0d420d630cea3dc4e5529dbeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000223,orig__76ad6aa80950000664000000000000000000000115413257152177027341 0ustar DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿûpleS)E@BC¸SÀCxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-desÿÿÿÿSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-xample], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀ@@¡j¡jms¸.q././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000222,orig__762d20589d74f46275761bba91ad0755d0d01e92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000222,orig__762d20589d70000664000000000000000000000115413257152177027206 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡4.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000221,orig__76081f984eb460b504d4ef2f5488add22d1bd527qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000221,orig__76081f984eb0000664000000000000000000000004213257152177027262 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000220,orig__75f116308c5f508d9969f053086eddc8b7c3228bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000220,orig__75f116308c50000664000000000000000000000046313257152177027175 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000219,orig__754b26d5351215092b23c09c606666d4ec30af2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000219,orig__754b26d53510000664000000000000000000000001513257152177027175 0ustar ÿÇb././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000218,orig__74968d9f0c567f65b566f1f14a0deff3a4b4e35aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000218,orig__74968d9f0c50000664000000000000000000000007113257152177027277 0ustar ):././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000217,orig__7353d6910f7aba554990c6294860c7c0d2c99c06qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000217,orig__7353d6910f70000664000000000000000000000101613257152177027204 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000216,orig__7238251db1eef6b2428fb8b04abca4460c39bd96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000216,orig__7238251db1e0000664000000000000000000000115413257152177027253 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·qÿ£tÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent±)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000215,orig__6f5026a66e055a056238ffec540a8c03fdc1f843qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000215,orig__6f5026a66e00000664000000000000000000000077613257152177027266 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.exajple@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jmsSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000214,orig__6e59a75876769319afe5acf1ef0ee4ae1a2533ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000214,orig__6e59a7587670000664000000000000000000000115413257152177027223 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reÿÿiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÿÿÿÿSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000213,orig__6dc1bf8eaa3ca50a6c43d9c7fb5cddc7952f6230qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000213,orig__6dc1bf8eaa30000664000000000000000000000005613257152177027550 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000212,orig__6d8b6f003c3cc06c8162680251a6f67261f227cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000212,orig__6d8b6f003c30000664000000000000000000000115413257152177027330 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectiAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.e1£sole-connection-for-containxampleS)E@BC¸SerDELAYED_DELIVERY@Á3£kroduct¡apachÀCC`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.x-opt-queue.ePpÀASrÁ£x-opt-jmC¸ does n2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS£././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000211,orig__6d5dbd2120b12b5064349d2b02e5aced6c77bc39qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000211,orig__6d5dbd2120b0000664000000000000000000000115413257152177027376 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀ÷þASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts—et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000210,orig__6d585320200c890442c31c8a886a6a2159e3f549qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000210,orig__6d5853202000000664000000000000000000000110713257152177027076 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kzoduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.quaue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jmsAMQ.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡P)Producer AktiveMQ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000209,orig__6d0dc8c9d0d80501497c7adf48561660e5aa9b17qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000209,orig__6d0dc8c9d0d0000664000000000000000000000046313257152177027504 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)B@ECPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000208,orig__6c2d33833211c0f74337faf96960663b4f366bc4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000208,orig__6c2d33833210000664000000000000000000000115413257152177027172 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000207,orig__6c2650092e64a9c8189afbfe6b7a84054677c611qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000207,orig__6c2650092e60000664000000000000000000000115413257152177027177 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts¡et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000206,orig__6bbbf3b4170f0f0e19383cb4d0da917cda7583bfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000206,orig__6bbbf3b41700000664000000000000000000000073013257152177027404 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connecti(on-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverPBCPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀ0CCC SpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000205,orig__6baecab4eff6f7484cf05d6bd9b0ef0eee51b0ffqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000205,orig__6baecab4eff0000664000000000000000000000076613257152177027722 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq­artemis£version 2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÀCR 1CSpÀAÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿSrÁ£x-opt-jms-de÷stQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000204,orig__6b1c23c504ac442ef4f3b5a5bf3cd2e14799e53fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000204,orig__6b1c23c504a0000664000000000000000000000115413257152177027316 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC`þϼSpÀA£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000203,orig__6b0883a5dcd776700700c13d34f3659b63613702qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000203,orig__6b0883a5dcd0000664000000000000000000000052313257152177027412 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£aémqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000202,orig__6b06b49b0fd718de0a3a979accb931ab26ca3e0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000202,orig__6b06b49b0fd0000664000000000000000000000115413257152177027407 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaAMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@à1£sPoleinerDELAYED_DELIVERY@Á3£pr-connoduct¡apache-ectactivemq-artemi address does not exisitÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-coemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-dRRRRRRRRRRRRRRRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampr-conte././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000201,orig__6ac030e6f322eaf6fa60ad16e4c0f29308c2d622qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000201,orig__6ac030e6f320000664000000000000000000000046313257152177027322 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coÿÿÿÿÿÿÿÿDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000200,orig__6a40b7966c7507fd6cce04984f87c7d8916d5d6cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000200,orig__6a40b7966c70000664000000000000000000000115413257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTRw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000199,orig__69d48172a598e9fa03cf20a71bb742c464136286qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000199,orig__69d48172a590000664000000000000000000000115413257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts¡et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000198,orig__6948fb655407123f8e1fd7a454d717d88f521bcaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000198,orig__6948fb655400000664000000000000000000000115413257152177027223 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á2£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSent¡)Producer ActiveMQQueue[example], thread=0ue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000197,orig__6874bd2aa1aff684acb7a82974b0f10cdc085183qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000197,orig__6874bd2aa1a0000664000000000000000000000060213257152177027415 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-arteqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000196,orig__677cb3031f3b97e45b7a7b36c5a7a3417488764fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000196,orig__677cb3031f30000664000000000000000000000053613257152177027266 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQAMQPSsÀ% @@¡jms.queue.exaSÀƒ m¡././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000195,orig__67762a0930b14a09fcd95bb645e9400bfda75b6eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000195,orig__67762a0930b0000664000000000000000000000115413257152177027204 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA€SÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-desÿÿÿÿSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000194,orig__66b0d7967399141b541d1c317cf15c8d134ea9ceqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000194,orig__66b0d7967390000664000000000000000000000046313257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Vpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000193,orig__66379f45c7188b211e7529a3a8516f43951556bcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000193,orig__66379f45c710000664000000000000000000000115413257152177027220 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messAge: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000192,orig__661a42eb7a911a46ac85927579597c3df7ea2eb7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000192,orig__661a42eb7a90000664000000000000000000000046313257152177027344 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectoni-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@nS)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000191,orig__63f74090de3ca9eda2a2a2b9da5591bd529cd94bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000191,orig__63f74090de30000664000000000000000000000046313257152177027266 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCbPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000190,orig__636e7f48f2475c614c3432d396abbe02c9f0d787qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000190,orig__636e7f48f240000664000000000000000000000062713257152177027301 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@;à1£sole-connection-for-containerDELAYED_DELIVERY@Á3erDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBP£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP>S(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000189,orig__6351c8b7f91d3cdf0adc9fc01a834d9485091eabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000189,orig__6351c8b7f910000664000000000000000000000115413257152177027277 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @=¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000188,orig__62eb5f4a1fdfd782d1a42986cd67dd139d774dc2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000188,orig__62eb5f4a1fd0000664000000000000000000000002413257152177027500 0ustar Û¶¶ccccccccccccccccc././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000187,orig__62bff08f56df7e0adc2c2af6d79ed0d6996a7ae7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000187,orig__62bff08f56d0000664000000000000000000000115413257152177027435 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000186,orig__6075f1c10207d079dd41f70ee5b3a04dbcc92fabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000186,orig__6075f1c10200000664000000000000000000000115413257152177027170 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@ASÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000185,orig__601ca8db18b6d6bc55d9e6a820a93edc523ad18bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000185,orig__601ca8db18b0000664000000000000000000000115413257152177027414 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message:dSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000184,orig__5fd55121545bb7be707943efffc0ae4868513978qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000184,orig__5fd551215450000664000000000000000000000047313257152177027205 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000183,orig__5e44b964ced89ca23090761ec9625fe7bb7fd2d2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000183,orig__5e44b964ced0000664000000000000000000000010013257152177027417 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000182,orig__5e37d793eb712fbe1964500c237485cd6977a92bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000182,orig__5e37d793eb70000664000000000000000000000105413257152177027355 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containµrDELAYED_DELIVERY@Á3`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r Aktive^QQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000181,orig__5e24fa5825cfa38aeb831d16874b5d3ef3b55b98qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000181,orig__5e24fa5825c0000664000000000000000000000073713257152177027350 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀÿÿÿÿÿÿÿÿ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000180,orig__5e207ca84c26b97cd16d1d2c3881acc371bcaaa1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000180,orig__5e207ca84c20000664000000000000000000000102313257152177027326 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASsÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSple@sÀ% @@¡jms.queue.example@@@@@@ƒent¡)ProdS( À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000179,orig__5dd4e242ce8c071ac08dbff4cb47bb4245b81a24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000179,orig__5dd4e242ce80000664000000000000000000000115413257152177027431 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSwts¡et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000178,orig__5c55e3d00c43f3ddc879f9858e990208c1875444qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000178,orig__5c55e3d00c40000664000000000000000000000000313257152177027327 0ustar #!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000177,orig__5c22701b788902e1b44bcaae7133682092391aa4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000177,orig__5c22701b7880000664000000000000000000000115413257152177027206 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3Vø”oduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000176,orig__5c1afcf6651d7b5e03ef866f074895b094cd02c9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000176,orig__5c1afcf66510000664000000000000000000000112413257152177027420 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.amexpleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-:jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡my_receivercountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000175,orig__5bfcb9ac2da59adb34441593608c78dd07fcea47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000175,orig__5bfcb9ac2da0000664000000000000000000000000313257152177027625 0ustar A!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000174,orig__5beae4d7ee24205aface6d698191ea3ed7073c94qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000174,orig__5beae4d7ee20000664000000000000000000000113213257152177027557 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀ!SrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000173,orig__5be71350ea282e50dc8c17c29dbddda4be856978qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000173,orig__5be71350ea20000664000000000000000000000100613257152177027325 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qtest message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000172,orig__5b4099695250eb6b3a0f5c133fad4b3f839053f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000172,orig__5b4099695250000664000000000000000000000071513257152177027136 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000171,orig__5b25ef094c4817a13a972fe7ce72bdee96d89f2bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000171,orig__5b25ef094c40000664000000000000000000000052713257152177027343 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0@p····································ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£veòsion¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000170,orig__5909466b7611e2ff604eb781aeadb209e0ddadc9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000170,orig__5909466b7610000664000000000000000000000032513257152177027130 0ustar AMQP[Àƒ ¡0.0.0.0@pÿY@Á3£kroduct¡aÿÿÿÿÿÿÿÿpache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000169,orig__58e6b3a414a1e090dfc6029add0f3555ccba127fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000169,orig__58e6b3a414a0000664000000000000000000000000113257152177027330 0ustar e././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000168,orig__5781890cb133098099693a64889eed43ea819598qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000168,orig__5781890cb130000664000000000000000000000113413257152177027206 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000167,orig__5760d2e645e453cf5fedc87f78304dbb422ffa05qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000167,orig__5760d2e645e0000664000000000000000000000115413257152177027271 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-conneoit-cnfor-contaÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùöRtÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹¸SÀCC 5CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXwexampsioÀ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000166,orig__55fd691c59a25808aaf0376857712f3a3d9bef1eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000166,orig__55fd691c59a0000664000000000000000000000103013257152177027346 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á4£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ5 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000165,orig__555f463cfd9a18ad76864d2324523bbce40e0049qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000165,orig__555f463cfd90000664000000000000000000000050213257152177027352 0ustar AMQP0"0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:;ot-found¡(AMQ219°10: source adSÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000164,orig__5559250f3e07f4a4edff8a1255058e733b5ee45dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000164,orig__5559250f3e00000664000000000000000000000001513257152177027175 0ustar AMQPÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000163,orig__541d9b7069d326ce2bdcc4921492d9a0b05d2ee8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000163,orig__541d9b7069d0000664000000000000000000000067513257152177027276 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000162,orig__54143d8d68bd7fcf34fcd9320ea0c5f1f173e440qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000162,orig__54143d8d68b0000664000000000000000000000115413257152177027264 0ustar Aÿÿ¢SÀƒ ¡0.0.0.test message: 26¢¢¢¢e-connection-for-containerDELAYE®!DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ'RpÿÿÿpÿÿÿpÿÿASÀ4 %SSÿÿÿÿ÷÷÷÷÷J÷!exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jmsmy_receiverple@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(Sp'÷÷÷À_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0'÷÷÷÷÷÷÷÷÷÷÷÷J÷!oes ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000161,orig__52e6f0d19f05439b545134daad44bc4610c237bfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000161,orig__52e6f0d19f00000664000000000000000000000103313257152177027332 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀàRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@ƒ@Xw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000160,orig__51b7ac2fd6d34ed907ebb0ceb769871bfe81af78qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000160,orig__51b7ac2fd6d0000664000000000000000000000031513257152177027470 0ustar AMQPSÀƒ ¡0.0.0.0@pÿY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000159,orig__51ad9838a77dc730f0931ce0aca2117f3597cb1eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000159,orig__51ad9838a770000664000000000000000000000000213257152177027266 0ustar :!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000158,orig__519f1d13dbaf9938f638a89fa33eed9e87862009qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000158,orig__519f1d13dba0000664000000000000000000000036013257152177027413 0ustar AMQP"ðSÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: soÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿurce address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000157,orig__5199a3576d1f6f07224fb08f3f3f4c0990c3510cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000157,orig__5199a3576d10000664000000000000000000000115413257152177027212 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-`rtemis£version¡2.5.0"SÀon-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPexample], thr`ad=0¡countTAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roduct¡apache-activemq-artemis£verion¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀSw¡8 ¡ my_test messige:receiverCBPPS(À¡ Sge: 2727nd¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DEntVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000156,orig__5164e583443cdef23ac7e72725576f4e518a8f69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000156,orig__5164e5834430000664000000000000000000000101613257152177027123 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000155,orig__515337a1ce01f06f6cfb5342768958ade4e08743qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000155,orig__515337a1ce00000664000000000000000000000056313257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaAMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@à1£sPoleinerDELASÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-dRRRRRRRRRRRRRRRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampr-conte././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000154,orig__5089b705856f9966655cdf62ceac467804403d85qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000154,orig__5089b7058560000664000000000000000000000067513257152177027142 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000153,orig__505484ea1bec6fd5ef92d5add6132a05ae82d417qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000153,orig__505484ea1be0000664000000000000000000000115413257152177027333 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡conuTtSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000152,orig__4fb29b8d36442c9f13719b4d2b5ce7cd2164ed6cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000152,orig__4fb29b8d3640000664000000000000000000000105413257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[exa-ple], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000151,orig__4f9ebe3ea9697d2760ee07f4c4188d8e171156e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000151,orig__4f9ebe3ea960000664000000000000000000000007313257152177027507 0ustar Aÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000150,orig__4eef2b29eca31ac4dcd0d32145058c57954dbe03qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000150,orig__4eef2b29eca0000664000000000000000000000046613257152177027561 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroducest message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000149,orig__4eac25cdc08ad541dfaebb7c1b7f47e7a88cb0a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000149,orig__4eac25cdc080000664000000000000000000000002613257152177027473 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000148,orig__4e8014b24f7249a6d110868502d36fe6602d8e73qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000148,orig__4e8014b24f70000664000000000000000000000000613257152177027255 0ustar )././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000147,orig__4e71f9d141e291616678d0f729fda69fa5939f39qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000147,orig__4e71f9d141e0000664000000000000000000000064513257152177027351 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@S)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000146,orig__4dead6bafe0302b854290d71976faa686db4fef5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000146,orig__4dead6bafe00000664000000000000000000000115413257152177027633 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000145,orig__4d24cb02d6e4a570be3093c55139ea9d4ab5c6c8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000145,orig__4d24cb02d6e0000664000000000000000000000043613257152177027412 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contai¸SÀCC 0CSpÀùASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue..queue.example¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000144,orig__4cdd04aac8e5ab17aa485f4d67f8ec71f2170322qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000144,orig__4cdd04aac8e0000664000000000000000000000064313257152177027552 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à.0.0@pÿÿÿÿ`ÿÿpu0@@à1£ontainerDELAYED_DELIVERY@Á3£product¡apache-activemq-aÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(e€S)E@BC¸SÀCC 0CSÀpASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)EB@C¸'SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000143,orig__4cdcd6f4ca8d0b3c889aee3a26d41c52679a7cbdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000143,orig__4cdcd6f4ca80000664000000000000000000000071613257152177027563 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCjms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], threxample], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000142,orig__4b2ceacc3d280ae47a5833ace04810bb71fa5904qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000142,orig__4b2ceacc3d20000664000000000000000000000067513257152177027550 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000141,orig__4a73770a109eb907a4b2dd6d50e3d28282c89cf2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000141,orig__4a73770a1090000664000000000000000000000000613257152177027163 0ustar !:ÿú;././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000140,orig__4a6ce72cceb629c8584f2c0599b4ad8a440dc963qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000140,orig__4a6ce72cceb0000664000000000000000000000045313257152177027551 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-ar„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000139,orig__4a2f3836ff9edc424f2097099f4f3cbcd50e399aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000139,orig__4a2f3836ff90000664000000000000000000000115413257152177027355 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000138,orig__496b5a8d0ed91bd9de2e9e63a842c7a774c2bb9eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000138,orig__496b5a8d0ed0000664000000000000000000000006313257152177027424 0ustar Û¶¶ccccccccccccccccccccccÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcé¶././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000137,orig__49678f763310e053c332991e4088723fce9f2992qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000137,orig__49678f763310000664000000000000000000000103413257152177027136 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(àÀ¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000136,orig__495cc796c6c7893c7ab5b70a4f29cecaa50057d4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000136,orig__495cc796c6c0000664000000000000000000000071513257152177027360 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000135,orig__48691abb4f5db1ac03a2d6caa83e1ae4943f6325qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000135,orig__48691abb4f50000664000000000000000000000115413257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`€RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000134,orig__48108044f33758e0fa1e10f9c3b33acce8077ffdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000134,orig__48108044f330000664000000000000000000000071513257152177027115 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000133,orig__480b6a234fe47a1263da086dbbae1fd08b618425qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000133,orig__480b6a234fe0000664000000000000000000000115413257152177027332 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁAdSent¡)Producer ActiveMQQueue[example], thread=0¡ countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ÁktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000132,orig__47ecc0ec86499db8ee6bb327a12be21605144926qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000132,orig__47ecc0ec8640000664000000000000000000000037213257152177027421 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0D_DELIVEÒY@Á3£product¡apache-activemq-artemis£version¡1.5.0QPÿÿÿÿÿÿÿÿ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@À ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ474868: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000131,orig__469d7276214218cc60765d72b0dc66b058a93ca6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000131,orig__469d72762140000664000000000000000000000115413257152177027123 0ustar AMQPSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-o ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000130,orig__464bf6d11aa61053a34786d5b0ddb429d5f8b8f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000130,orig__464bf6d11aa0000664000000000000000000000036113257152177027401 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpzÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000129,orig__4630614b8a0acbd6cf5b821713659542e9f04b9bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000129,orig__4630614b8a00000664000000000000000000000115413257152177027171 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-acthvemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS!À4 ¡ my_r!!!eceion¡2.5ÕÏÿÿÿÝýÿSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@À ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source addreùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£pt-jms-destQSsÀ% @@¡jms.queue.example@@@-containerDELAYED_DEÿÿÿx././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000128,orig__453342523a299d6b91e3b14f620d9b8c55faba0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000128,orig__453342523a20000664000000000000000000000115413257152177027107 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000127,orig__44ef8add55e4b3df5cf6269bd80765c370ca758eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000127,orig__44ef8add55e0000664000000000000000000000062113257152177027505 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000126,orig__449be02162e08de28c1e41467616971b01f0aa14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000126,orig__449be02162e0000664000000000000000000000067413257152177027261 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC`þϼSpÀA£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000125,orig__4345cb1fa27885a8fbfe7c0c830a592cc76a552bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000125,orig__4345cb1fa270000664000000000000000000000000113257152177027316 0ustar %././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000124,orig__433cab8f964757a924d329d8efbc53a01dfd2a6dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000124,orig__433cab8f9640000664000000000000000000000115413257152177027342 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·tAÁùS¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹ms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-dessage: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000123,orig__42ef33b99f4d09d7b9eac8eb198fddba2f8c4c2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000123,orig__42ef33b99f40000664000000000000000000000115413257152177027345 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaAMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@1às£PoleinerDELAYED_DELIVERY@Á3£pr-connoduct¡apache-ectactivemq-artemi address does not exisitÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroSÀƒ ¡0..0.00@pÿÿÿÿ`ÿÿpu0@@à1£sole-coemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀA­>ìý\ñx-opt-jms-dRRRRRRRRRRRRRrRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampr-conte././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000122,orig__42a83b5231fb00c0eb2ebc58deaaaa1897e8be14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000122,orig__42a83b5231f0000664000000000000000000000037613257152177027251 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000121,orig__428d5fec5c313c1a2210357617ae884dfdad12c4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000121,orig__428d5fec5c30000664000000000000000000000061713257152177027421 0ustar AMQPS ¡ƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectiÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿon-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÿÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000120,orig__40e345c2f053e4d8491cd155c46a57caf3131daaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000120,orig__40e345c2f050000664000000000000000000000050213257152177027236 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000119,orig__40bc3600abe5d4e0711d7c9a17123009eff33e5cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000119,orig__40bc3600abe0000664000000000000000000000002713257152177027375 0ustar Û¶¶ccccccccccccccccccéö././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000118,orig__4051a924cb36158a56b79d382cb4e4f0813a5b36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000118,orig__4051a924cb30000664000000000000000000000062513257152177027250 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.;xampleS)E@BC¸SÀCC 0CSpÀA@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000117,orig__40449c9d2a42e5cd173fd4403de5cdcd530f7f51qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000117,orig__40449c9d2a40000664000000000000000000000034413257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cojnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000116,orig__3fc25eecc74fcd77d0a91dcd071ae0173d880a85qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000116,orig__3fc25eecc740000664000000000000000000000115413257152177027500 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000115,orig__3e492a6f3ece660703fc67e31d3594639ed45e02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000115,orig__3e492a6f3ec0000664000000000000000000000015713257152177027422 0ustar AMQPSÀƒ ¡0.0.0.7@p!:ÿÿÿÿ`ÿAMQPMMÿÿÿÿhhÿÿÿ)ÿpu0@@à1£sole-âconnectioÿn-for-cÿo././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000114,orig__3e1c654efd93958b1d82d4e88b7a890e48d34f0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000114,orig__3e1c654efd90000664000000000000000000000055213257152177027424 0ustar AMQPSÀƒ ¡0.0.0.)@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000113,orig__3dd2d0c2eaf43a79df50b5d70f4d68c378f6d93cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000113,orig__3dd2d0c2eaf0000664000000000000000000000031413257152177027536 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPSÀƒ ¡0.0.0."0SÀ`iver@././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000112,orig__3d087dbbf966839a2300a2d588c119a468fe3eecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000112,orig__3d087dbbf960000664000000000000000000000115413257152177027421 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿESÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000111,orig__3bea2eb508ab377df64b6737635a140b4b8f2df4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000111,orig__3bea2eb508a0000664000000000000000000000000413257152177027450 0ustar )././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000110,orig__3bbea5f9987037137a757058d28b0b9b4445ea69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000110,orig__3bbea5f99870000664000000000000000000000065213257152177027427 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-s.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 0CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000109,orig__3af65757895550d858387e0e9d3a0e61e088cfd3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000109,orig__3af657578950000664000000000000000000000034213257152177027220 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000108,orig__3a00af7e932141ed91e5f9021411be4b1e90886dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000108,orig__3a00af7e9320000664000000000000000000000115413257152177027330 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts—et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000107,orig__395a895a3e2e66675351e372760c762d52507ca2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000107,orig__395a895a3e20000664000000000000000000000046313257152177027267 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£productapache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000106,orig__395496a9bceaef26949bf6d4a325a9a6710a7d1bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000106,orig__395496a9bce0000664000000000000000000000046313257152177027353 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000105,orig__3950e5bafadd9de9a33defb1f1a1e0b1049b2d92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000105,orig__3950e5bafad0000664000000000000000000000006313257152177027467 0ustar AMQPMMÿÿÿÿÿÿÿhh)QPMMÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000104,orig__394101928f21e83298a437500dbfd1a2ff6947e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000104,orig__394101928f20000664000000000000000000000063513257152177027117 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ED_DELIVERY@Á3£product¡apache-tivemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-tivemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219011: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000103,orig__3922e1988e08fdf9b6268f2e8c54c1f41c243349qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000103,orig__3922e1988e00000664000000000000000000000046313257152177027204 0ustar AÿÿÿÿÿÿÿÿSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(0: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000102,orig__39152eaba4994d35d774b06714c7d44a6a6d0a20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000102,orig__39152eaba490000664000000000000000000000053113257152177027325 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ438020:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000101,orig__3837fc49467285923fb03bba6896a467ce2bcda8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000101,orig__3837fc494670000664000000000000000000000115413257152177027210 0ustar AMQPSÀƒ ¡0.AMQP0.0.7@pSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-ÿconnection-for-containerDELAYEqueue.exaÿÿmple@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)ÿ`ÿÿpP;roduceru0 A@r ActiveMQQ-destQSsÀ% @@¡¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrx£Á-opt-jms-destQSsÀ% @pÿÿÿce address does pÿÿASÀ3 ¡ my_receiverCBPPnotS(À exi¡jms.queue.exampleSÿpÿÿASÀ8 ¡ my_receiverCBPPS(0@pÿjms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÿpu0@%././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000100,orig__37eef25971d6fadd1fcf7bf66ebc9ab25c01dce2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000100,orig__37eef25971d0000664000000000000000000000115413257152177027341 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000099,orig__37744715487ef57e01dfc0f967c8e9afb5662d2bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000099,orig__377447154870000664000000000000000000000101413257152177027060 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ%@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000098,orig__374c5c7ca9aaf73459a383bf1740cf261264f323qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000098,orig__374c5c7ca9a0000664000000000000000000000115413257152177027431 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Active]QQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000097,orig__3683991900e31967c47c39544d18a25505b97d1bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000097,orig__3683991900e0000664000000000000000000000026513257152177027141 0ustar AMQPSRpÿzzzzzzzzzzzzzzzzzzzÿÿÿpÿÿ)SÀ ¡ my_receÿÿiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000096,orig__364c01159f8e30db18be2c350b6fbad0424f62ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000096,orig__364c01159f80000664000000000000000000000115413257152177027207 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrx£Á-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡tes tmessage: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000095,orig__359b1e9a4c8e1c5807305fb520f18ca6b7e0bfffqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000095,orig__359b1e9a4c80000664000000000000000000000012513257152177027347 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000094,orig__356fbc45f3e309def9c86336743d8385c215e670qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000094,orig__356fbc45f3e0000664000000000000000000000046313257152177027431 0ustar AMQPSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000093,orig__351d276e353979ba3a95ee0749edbb09c8532008qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000093,orig__351d276e3530000664000000000000000000000004113257152177027174 0ustar ÷!%././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000092,orig__33dcbf48bafc7b18357bf4ca37483844086c287bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000092,orig__33dcbf48baf0000664000000000000000000000001513257152177027552 0ustar ÿÇb÷././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000091,orig__33d517435218019697eadc7871b9a7723584c305qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000091,orig__33d517435210000664000000000000000000000046313257152177027114 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectoni-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000090,orig__331265001c901c5b1486773e473ba87f4d6a7fdbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000090,orig__331265001c90000664000000000000000000000115413257152177027104 0ustar AMQPSÀƒ ¡1.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 1CPpÀÁrAS£x-opt-jms-destQUsÀ% @@¡jms.queue.example@@@@@@0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktivuQueeeQM[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000089,orig__32ca2509c6f5c5cd09cb2a69734aabc25252c5e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000089,orig__32ca2509c6f0000664000000000000000000000006313257152177027341 0ustar •••••••••••••••••••••:••••••••••••••••YYYY•••••••!!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000088,orig__3179fb6403a421dc479682a6a2c5c9f43417363eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000088,orig__3179fb6403a0000664000000000000000000000050113257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000087,orig__3138535fee6e745574dae15412f9c5f4378f76aaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000087,orig__3138535fee60000664000000000000000000000115413257152177027273 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000086,orig__30dbdb9bc6b427d2708fa7b7ecb42a37d7e9ff5aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000086,orig__30dbdb9bc6b0000664000000000000000000000001213257152177027545 0ustar  õÇ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000085,orig__30a71225c7843d15a0869f112e1499624eeee9fbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000085,orig__30a71225c780000664000000000000000000000115413257152177027176 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3okr£duct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000084,orig__2f9daf5c887242382661b27a96f0a4be1bb03267qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000084,orig__2f9daf5c8870000664000000000000000000000033513257152177027441 0ustar AMQP"ðSÀ`Rpÿÿÿpÿÿÿp;ÿÿ)SÀ ¡ memq-artemis£versioÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿurce address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000083,orig__2f8b5b77b890fd7dbcf5af38c20fb07248d13c7cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000083,orig__2f8b5b77b890000664000000000000000000000000713257152177027353 0ustar AMQP././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000082,orig__2f3465f0b22aff52623d71542efcaef33cb8fdb3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000082,orig__2f3465f0b220000664000000000000000000000000513257152177027244 0ustar ×ÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000081,orig__2f2d0977ef662f93a18485f45b7159981f77270dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000081,orig__2f2d0977ef60000664000000000000000000000115413257152177027351 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀÿÿÿÿÿÿÿÿ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jQs-mtsdeSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000080,orig__2ef999a20722f105d30afe0a780edc7603a8f1aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000080,orig__2ef999a20720000664000000000000000000000115413257152177027266 0ustar Aÿÿ¢SÀƒ ¡0.0.0.test message: 26¢¢¢¢e-connection-for-containerDELAYE®!DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ'RpÿÿÿpÿÿÿpÿÿASÀ4 %SSÿÿÿÿ÷÷÷÷÷J÷!exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR %SSÿÿÿÿ÷÷÷÷÷J÷!pache-activemq-artemis£version¡1.5.0'÷÷÷÷÷÷÷÷÷÷÷÷J÷!oes ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000079,orig__2e34afd9280a43722b9c38f51cd4c4d40c31446fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000079,orig__2e34afd92800000664000000000000000000000110713257152177027344 0ustar AMQPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[exa-ple], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000078,orig__2d6a717d7e59b60bfd1aae429aac2dbe25f5b0e9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000078,orig__2d6a717d7e50000664000000000000000000000055213257152177027353 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis], thread=1¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampS0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000077,orig__2ce64d50a32e3e72bfdbdf3519ec47f1d50ee816qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000077,orig__2ce64d50a320000664000000000000000000000060113257152177027327 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡3.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.que£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000076,orig__2ca11cc6cf955d9f0adc64f2282ab92d996932deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000076,orig__2ca11cc6cf90000664000000000000000000000103313257152177027471 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@ƒ@Xw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000075,orig__2bb32c7068539de6d2f01aa4605de77aaf1ae23fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000075,orig__2bb32c706850000664000000000000000000000054313257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ersion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£ @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000074,orig__2b511e040b4dce5dce1520e20273f1c4eaab69feqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000074,orig__2b511e040b40000664000000000000000000000004213257152177027232 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000073,orig__2a867d72da38106495b8d28ea749da3e108d5165qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000073,orig__2a867d72da30000664000000000000000000000115413257152177027341 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀ@ÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messAge: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 2s././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000072,orig__29a6b1fdcc2cf2fd8ca4a37f8d232494443f25abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000072,orig__29a6b1fdcc20000664000000000000000000000115413257152177027472 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messAge: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@‚Xw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000071,orig__29475bf54bd89b2b77f7fa3d8cb102a4ff650698qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000071,orig__29475bf54bd0000664000000000000000000000115413257152177027344 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQP1£soÿÿn¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol)SÀ ¡ my_rec`iverCBPP@S)E@BCPP@S)E@BCPSÀCCASÀ;£amPCASÀ;£amqp:not-found¡(AMQ219010:qp:not-found¡(AMQ219010: source address d source addresoes s does nontot exis etxist6¹SÀCR:¡(AMQ219010: source addQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActivrerAMQPÿÿÿÿx././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000070,orig__2919cc28e6b742bb9fc6b5f0855ddd52b484f3daqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000070,orig__2919cc28e6b0000664000000000000000000000115413257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿ`ÿÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000069,orig__27f67e3c9780f6b750347d6165f93131291bb177qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000069,orig__27f67e3c9780000664000000000000000000000001513257152177027303 0ustar AMQPÿhh)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000068,orig__27a7a6fc64aae9cd5996fad0ac0dc84a4585a848qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000068,orig__27a7a6fc64a0000664000000000000000000000115413257152177027424 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000067,orig__2786f0f8f0527ebd0dffd5d802c0c177af2e3f0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000067,orig__2786f0f8f050000664000000000000000000000056713257152177027304 0ustar AMQP#SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVEAMQPSÀƒ ¡0.0.0.0@pÿþRY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0ÿÿ`ÿÿpu0@@à1£sole;connection-for-c"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPontainerDELAS(ÀYED_jms.queue.exaDELIVERY@Á3£kroduct¡apache-ampleSctivemq././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000066,orig__276818e5ef2ec29ca54fa54222ca2606675e6c67qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000066,orig__276818e5ef20000664000000000000000000000115413257152177027275 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBpPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000065,orig__274d4a19d3ea853a241799a47428c495b8e025f5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000065,orig__274d4a19d3e0000664000000000000000000000053413257152177027342 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerSÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ%@@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000064,orig__270f2f22a92e7f99c4a74d2d6ef5afc57611b199qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000064,orig__270f2f22a920000664000000000000000000000002213257152177027244 0ustar ¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000063,orig__270dd12099f51009be69d43068fdb4870f5fc9cfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000063,orig__270dd12099f0000664000000000000000000000073013257152177027256 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSÀpASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000062,orig__26836232642560abf878f5fcb2ef79f5f54c13beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000062,orig__268362326420000664000000000000000000000113413257152177027034 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@B@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁQtSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000061,orig__24d9e09787bdc9724edb95044965cc00c58fa80fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000061,orig__24d9e09787b0000664000000000000000000000047213257152177027274 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpƒƒƒƒƒƒƒƒƒu0@@à1£sole-connecñion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000060,orig__24d82a095f84016d1ecd5c2c5c5d211f0ae8be31qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000060,orig__24d82a095f80000664000000000000000000000000713257152177027255 0ustar AMQPA././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000059,orig__246609ce4c53d6febd7cdddd052c4a3969e7397dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000059,orig__246609ce4c50000664000000000000000000000115413257152177027267 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.examp@@@le@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000058,orig__23db1ff1d0e76da36f427744c3c9aa56d33510c5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000058,orig__23db1ff1d0e0000664000000000000000000000115413257152177027471 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qmy_receivere@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSu¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000057,orig__23cd1ad634d8cae4ccce264ce8425e1114730976qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000057,orig__23cd1ad634d0000664000000000000000000000114513257152177027411 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸ache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCCSÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000056,orig__238bf6f1552ab7559610819331de5b57335afbc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000056,orig__238bf6f15520000664000000000000000000000102713257152177027262 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000055,orig__229ff3519daf0d8d408b548b9078d183408f63e2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000055,orig__229ff3519da0000664000000000000000000000035713257152177027350 0ustar IMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version!¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receivurce address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000054,orig__22341913808d5dbac0fea9042e1d798d717d2fe0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000054,orig__223419138080000664000000000000000000000031513257152177027032 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPSÀƒ ¡0.0.0."0SÀ`iver@././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000053,orig__2201e36cc483037b88bda3285b2277c64c6f96a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000053,orig__2201e36cc480000664000000000000000000000010013257152177027235 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000052,orig__21d50bc41b61f3a52903231924d19c7f1f32b49aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000052,orig__21d50bc41b60000664000000000000000000000104713257152177027320 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERYÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000051,orig__214d03825c57550a88a73197d3fe43170d40d4ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000051,orig__214d03825c50000664000000000000000000000062413257152177027166 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1ÿÿAÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`ÿÿpRÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡t)st mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000050,orig__210b45b3d7f7489cefaf56723413021a42c608e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000050,orig__210b45b3d7f0000664000000000000000000000010013257152177027311 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000049,orig__21084aa2a03248b99a6fdfb00e38b22e890c34f1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000049,orig__21084aa2a030000664000000000000000000000112413257152177027233 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£-connection-for-containerDELAYED_DE3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000048,orig__20960b7fa364202d7dc694ef08718598309b7677qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000048,orig__20960b7fa360000664000000000000000000000115413257152177027260 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£Žx-opt-jms-destQS% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000047,orig__2077b9cf47cbf148f8a91ad579e2aece847f2b11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000047,orig__2077b9cf47c0000664000000000000000000000046313257152177027351 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000046,orig__2010bec8c1d619922a69f38de954c8dddb9a1cc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000046,orig__2010bec8c1d0000664000000000000000000000005613257152177027401 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶¶¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000045,orig__1eacc46ab4f91a9a17a62972a8076c12529de86fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000045,orig__1eacc46ab4f0000664000000000000000000000004513257152177027545 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000044,orig__1d0d3759093e5882f55e5313f1ddd0b8b59256a5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000044,orig__1d0d37590930000664000000000000000000000102413257152177027173 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000043,orig__1cdb00f5afc4a65f8118f080693ba358a0203e09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000043,orig__1cdb00f5afc0000664000000000000000000000041413257152177027536 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000042,orig__1c7a1bb547e0275c767a3ae00d7d46d6d7aa4013qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000042,orig__1c7a1bb547e0000664000000000000000000000013613257152177027405 0ustar AMQPÀÁt¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpƒleS)././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000041,orig__1bbc6bacd0518951bd23a6df26670f109c7d2502qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000041,orig__1bbc6bacd050000664000000000000000000000115413257152177027534 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@àl;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000040,orig__1ad42edc08f4a412489079d4ec404807c9b0bebbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000040,orig__1ad42edc08f0000664000000000000000000000060113257152177027460 0ustar AMQPstQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exmlape,] thread=0¡countTSw¡Sent¡)Producer AktiveMQQueue[example], thread=0¡countTtest message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000039,orig__1a77a184d45ca870c28dcec3a328b18e9951c0c0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000039,orig__1a77a184d450000664000000000000000000000115413257152177027261 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000038,orig__18bbbbad00e9f831cf6dbd78241e9cd6cbfee01bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000038,orig__18bbbbad00e0000664000000000000000000000010013257152177027526 0ustar SSSSSSSSSS!ÿÿÿÿÿÿÿ¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000037,orig__184301cd4188125ee1191ff3b5a3bd3224bc0a66qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000037,orig__184301cd4180000664000000000000000000000106213257152177027167 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000036,orig__179f52d65804f6052e2327e3ffead71fc3d4f738qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000036,orig__179f52d65800000664000000000000000000000076013257152177027212 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000035,orig__173aa840b1d24c516553f4a4a7a21d9f98011c57qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000035,orig__173aa840b1d0000664000000000000000000000115413257152177027322 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000034,orig__15fbd7b5e421c7a194b6cffad1be6d069c5e5c04qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000034,orig__15fbd7b5e420000664000000000000000000000115413257152177027414 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀÿÿÿÿÿÿÿÿ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jQs-mtsdeSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000033,orig__15dc85e8ed51568d7138cbb2b540a1722648c00aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000033,orig__15dc85e8ed50000664000000000000000000000046313257152177027427 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000032,orig__15c3a94be91762b8b428e798f951d34055dabe2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000032,orig__15c3a94be910000664000000000000000000000005413257152177027330 0ustar •••••••••••••••••™•••••••••••••••••••••••••././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000031,orig__15b20832e701fd35249392a69e14d1549a63cf58qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000031,orig__15b20832e700000664000000000000000000000115413257152177027161 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000030,orig__15abe548a5036510add101152d8a7e871dbede72qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000030,orig__15abe548a500000664000000000000000000000006213257152177027317 0ustar )ÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚ:././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000029,orig__14633c79014ef5d9dd28200f179676cf1eb45cfbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000029,orig__14633c790140000664000000000000000000000115413257152177027116 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùöRtÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹¸SÀCC 5CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXwexampsioÀ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000028,orig__14018a8c49decad8e826e5ad487b8757b7989928qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000028,orig__14018a8c49d0000664000000000000000000000053113257152177027255 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product*apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ438020:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000027,orig__14008b0efb5c9de55390c6769496698352e7064eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000027,orig__14008b0efb50000664000000000000000000000010013257152177027312 0ustar AMMMMMÿÿÿÿÿÿèÿhhhhhhhhhhhhhhhhhhhhhhhhhhÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)ÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000026,orig__13cf282005ab8f9ef3d73801ef99a3b5d03bba53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000026,orig__13cf282005a0000664000000000000000000000101013257152177027230 0ustar AMQPSÀƒ ¡ivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000025,orig__13398238ec8b0d1356dc6400ffd97905c2ebf6c0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000025,orig__13398238ec80000664000000000000000000000065013257152177027206 0ustar ÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source ¡apache-activemq-a ActivePSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cÿonnection-for-containÿerDELAYED_DELIVERY@Á3AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡£product¡apache-activemq-artemis£version¡1.a5.0"p././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000024,orig__12e92535e8246ba5f83446fb166b7ec1c46a7e47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000024,orig__12e92535e820000664000000000000000000000115413257152177027177 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0S(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000023,orig__10a716842a57ec0999cabcde6b84e6561006ec90qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000023,orig__10a716842a50000664000000000000000000000046313257152177027165 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3rdo£puct¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000022,orig__0e0d569f4d9172d85d9d4ae5fecf0c318507e2beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000022,orig__0e0d569f4d90000664000000000000000000000115413257152177027342 0ustar AMQPSÀƒ ¡1.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQUsÀ% @@¡jms.queue.example@@@@@@0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktivuQueeeQM[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000021,orig__0dbbfa0675c875cd7751b0f70d93fcd84422816aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000021,orig__0dbbfa0675c0000664000000000000000000000004213257152177027454 0ustar AMQPMMÿÿÿÿhhÿÿÿ)âÿÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000020,orig__0d61500d328a260f40e5ef1ad2b5bc22d4883f65qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000020,orig__0d61500d3280000664000000000000000000000046413257152177027160 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apach:e-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000019,orig__0c4ab17c8269502b22047bf73e9f3745964abeccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000019,orig__0c4ab17c8260000664000000000000000000000073413257152177027334 0ustar AMQPSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSApÀSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x)opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000018,orig__0ba98237bfd777f3b9c0a5aa6895a248d0a959b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000018,orig__0ba98237bfd0000664000000000000000000000046313257152177027421 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-fQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000017,orig__0b47d6a797e14dd4017a2881ba95a76d8b7d118eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000017,orig__0b47d6a797e0000664000000000000000000000106013257152177027342 0ustar AMQPSÀƒ ¡:.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÿÿÁ£x-opt-jms-destQSsÀ% @m¡se.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000016,orig__0ab8318acaf6e678dd02e2b5c343ed41111b393dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000016,orig__0ab8318acaf0000664000000000000000000000000113257152177027451 0ustar !././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000015,orig__0a077959176c83815535114245f78246191b0cf3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000015,orig__0a0779591760000664000000000000000000000067613257152177027134 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––1£sole-connection-for-containerDELAYED_DELIVERY@Á3£\kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000014,orig__09004cd3fcb69883f028e78ddbf5c2c3ecad516fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000014,orig__09004cd3fcb0000664000000000000000000000071313257152177027401 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-aÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ÿÿÿÿÿÿÿÿ£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemiage: 26¹SÀCR 1(SpÀASrue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000013,orig__07cb1af988625f40a043b4408dd0e7b65d32e1b5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000013,orig__07cb1af98860000664000000000000000000000115413257152177027341 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(Àeue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000012,orig__074b9068c78ec6df40064b69a8b6c77ae15c2d80qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000012,orig__074b9068c780000664000000000000000000000115413257152177027203 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000011,orig__0718060785ce19f0601579e5de97efe312c36507qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000011,orig__0718060785c0000664000000000000000000000025613257152177027113 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol)SÀ ¡ my_rec`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000010,orig__06bb37b9d91c7dc521ac22b64ccf8da601ae4946qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000010,orig__06bb37b9d910000664000000000000000000000115413257152177027330 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000009,orig__05f6b27136788a580e207779983be3c2ac3c5075qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000009,orig__05f6b2713670000664000000000000000000000072013257152177027176 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol9e-connection-for-containerDELAYED_DELIVERY@Á2£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rã pÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000008,orig__0586885c058696fbea720a4aba92a13da42da9c8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000008,orig__0586885c0580000664000000000000000000000032313257152177027127 0ustar AMQPSÀƒ ¡0BBBBBBBBBBBBBBBBBBB.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAMQPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBSÀƒ ¡:0.0.0.0@pÿÿBBBBÿ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000007,orig__05448fc21b04f58464b6b7ab20c0127e95cd728fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000007,orig__05448fc21b00000664000000000000000000000053313257152177027244 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DEroducer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000006,orig__04935c57adc38f1bd00edd8223bff34cf7943f10qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000006,orig__04935c57adc0000664000000000000000000000031013257152177027325 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡rsion¡1.5.0"S@`Rp‰ÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000005,orig__042fdec751947c700c94c604c4e5f8c8b2f890dfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000005,orig__042fdec75190000664000000000000000000000073413257152177027340 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000004,orig__041e38e2054e7b09fc9ba139f006d146c4bfa606qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000004,orig__041e38e20540000664000000000000000000000115413257152177027163 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000003,orig__033e31c467de8d7f8ea6c09eee63e674ec272fc0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000003,orig__033e31c467d0000664000000000000000000000027213257152177027244 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000002,orig__01cedfe39e46064f8c67fffc156c5adffa1f34c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000002,orig__01cedfe39e40000664000000000000000000000073013257152177027470 0ustar AMQPSÀƒ ¡0.0.0.7@p%ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_Drtemis£version¡1.5.0"t¡apache-acti£x-opt-jmsÇÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶¶¶¶¶ÿÿÿÿÿÿÿùStÁA¡ ThreadSeCSpÿ`ÿÿpu5@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£versiïn¡2.5.hreadSntTSwoducer AktiveMQQ!eue[examÿ`queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsjÀ% @@¡jms.queue.exa¡emq-././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000001,orig__018d6b4c790c89c30d2bfe93921818e8512f9bafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000001,orig__018d6b4c7900000664000000000000000000000072413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000000,orig__010bab9b627b9bf8cd0b1ff32b19d4669e756e06qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/id__000000,orig__010bab9b6270000664000000000000000000000037113257152177027312 0ustar AMQPSÀƒ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ffaf7e3917bbdc057dfd6ecb658b038b6445f102qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ffaf7e3917bbdc057dfd6ecb658b0000664000000000000000000000101613257152177027516 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff37d7a06fd987b4cfdae2b626c04c5226f5574dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff37d7a06fd987b4cfdae2b626c00000664000000000000000000000010013257152177027342 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ~././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff3598d833900f42c795692a43f03a74f2a37894qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff3598d833900f42c795692a43f00000664000000000000000000000101413257152177026642 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff100d80f889dbffc4f890a88a1322ff0ecc1beeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ff100d80f889dbffc4f890a88a130000664000000000000000000000104713257152177027223 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fece011d0e2c475f15c6bfc5ce9043e6d1a88f59qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fece011d0e2c475f15c6bfc5ce900000664000000000000000000000000613257152177027330 0ustar ):././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fec74bb501489bcdc2750e838b4ae8502beac6c7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fec74bb501489bcdc2750e838b4a0000664000000000000000000000115413257152177027205 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fea1ab1baef05968963c32fa199d8458e0ee5696qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fea1ab1baef05968963c32fa199d0000664000000000000000000000115413257152177027267 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fe623b8aaad870decb13c3d7db1fd07eb3782578qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fe623b8aaad870decb13c3d7db1f0000664000000000000000000000072713257152177027477 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq­artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÀCR 1CSpÀASrÁ£x-opt-jms-de÷stQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fe547eb92dd08501566ae377f8c6e9a6c4411fefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fe547eb92dd08501566ae377f8c60000664000000000000000000000115413257152177027066 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡tes tmessage: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fdef916795b90327e08c4dd1061769339662360fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fdef916795b90327e08c4dd106170000664000000000000000000000103113257152177026772 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fd57a95c6d08213d650dc890c7a853cf5c443ee0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fd57a95c6d08213d650dc890c7a80000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.ue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5er ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fca43536c2d216b951800d052fea3ca06ef9fbebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fca43536c2d216b951800d052fea0000664000000000000000000000000213257152177027014 0ustar !'././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fc3063c90471701998259e0000d92e059d5a93e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fc3063c90471701998259e0000d90000664000000000000000000000110013257152177026454 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqmrea-tis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fc16061bbccd1e90520183f503c7e83a3720b124qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fc16061bbccd1e90520183f503c70000664000000000000000000000077213257152177027030 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Áuct¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BµC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-dTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fb105ed25fe090e73b077b33b1f021381cd5d343qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fb105ed25fe090e73b077b33b1f00000664000000000000000000000001013257152177027074 0ustar A././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fa1a5c3b8ade843af827291c1f01e1d74a873f4cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/fa1a5c3b8ade843af827291c1f010000664000000000000000000000026613257152177027175 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@àapache-activemq-artemis£AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@version¡2.@5.0"SÀ`à1£sole-connection-for-Rpÿc././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f9a7c794f371cf173489d884d85404cd19b4d4c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f9a7c794f371cf173489d884d8540000664000000000000000000000072613257152177026755 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f7f6cdaecbaed3e61a9293aef3c4cad899eec0a5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f7f6cdaecbaed3e61a9293aef3c40000664000000000000000000000043713257152177027571 0ustar AMQPSÀƒ ¡0.ms-destQSsÀ% @@¡jms.queue.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f713f44766e813a31f00635ec8e0894cedd95e1cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f713f44766e813a31f00635ec8e00000664000000000000000000000000213257152177026674 0ustar Û¬././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6fe7ba976dc1e1f6b2e0fc255f73403b7374cadqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6fe7ba976dc1e1f6b2e0fc255f70000664000000000000000000000046313257152177027362 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6cbc0749e205591348d10e747a0b5074ff19626qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6cbc0749e205591348d10e747a00000664000000000000000000000115413257152177026703 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jAMQPSÀƒ@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6bb43b4c87f68cd820cc911a787b06060e85227qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f6bb43b4c87f68cd820cc911a7870000664000000000000000000000000413257152177027131 0ustar !!!!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f5bf3c32b71ed57ccd0222cfa6ce5204943746e8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f5bf3c32b71ed57ccd0222cfa6ce0000664000000000000000000000115413257152177027411 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f5bc7b885493f325f87ee0eb98100d302ea0e5b4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f5bc7b885493f325f87ee0eb98100000664000000000000000000000115413257152177027072 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR rྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f525533db21c073d5c97e7ce5f4b9a5c81d32d7dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f525533db21c073d5c97e7ce5f4b0000664000000000000000000000075413257152177027135 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERntainerDELAYED_DELIVERY@Á3£product¡apache-actiøemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP¢S)E@BCPSÀCCASÀ;£amqp:notY@Á3£product¡apache-actiøemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP¢S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f51eb45a3822e9be9304fdfc039ceadd35a2d597qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f51eb45a3822e9be9304fdfc039c0000664000000000000000000000075013257152177027210 0ustar AMQPSÀƒqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f4e111c239b628a569f26d8bf1fd75cafc7f40caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f4e111c239b628a569f26d8bf1fd0000664000000000000000000000042413257152177027132 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f4236fead497bef9622e9c33d4d240699ff16a6bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f4236fead497bef9622e9c33d4d20000664000000000000000000000046313257152177027224 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f343437aa46cb19c76cb7a91803bd74e40213afaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f343437aa46cb19c76cb7a91803b0000664000000000000000000000102613257152177027037 0ustar AMQPSÀƒ ¡5ÉÏ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-optÖjms-destQmy_receiverSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·S¾tÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1efffd97d15b0760276b9f4db29ab61119b16f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1efffd97d15b0760276b9f4db290000664000000000000000000000027213257152177027224 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1„QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1c681da874efe3b168d6bd00e1de53c5a3823eaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1c681da874efe3b168d6bd00e1d0000664000000000000000000000115413257152177027263 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1a0fe61eeda9c215ebc473379986f1bf62d790eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f1a0fe61eeda9c215ebc473379980000664000000000000000000000115413257152177027215 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@àlsole-connection-for-containerDELAYED_DELIVERY@Á6£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f10d2f2bcb4420e7251c19b53453d1b08dcbb14dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/f10d2f2bcb4420e7251c19b534530000664000000000000000000000115413257152177026741 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@‚C¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef762b7f38d7560d9b5056a6a9687b161e9860e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef762b7f38d7560d9b5056a6a9680000664000000000000000000000115413257152177027014 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apa.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%ASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef7579c9ce5aaea1405c4ca481fee8baf69be120qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef7579c9ce5aaea1405c4ca481fe0000664000000000000000000000101513257152177027345 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef34e4656a6c38023a95cccb58a1aa864d550936qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef34e4656a6c38023a95cccb58a10000664000000000000000000000115413257152177027123 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef1cf420158c400699d606b3ee1a8b5a75b01d40qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ef1cf420158c400699d606b3ee1a0000664000000000000000000000115413257152177027035 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exisAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ED_DELIVERY@Á3£product¡apache-tivemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)£sole-connection\kroduct¡apache-activemq-artemis£version¡2.tapache-tivemq-artemis£version¡1.5.0"Srsion¡0.5ÿÿÿpÿÿÿpÿÿ)ThreadSent¡P././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ee36127976e1ebd48250f43b6bcd783fbac7b9b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ee36127976e1ebd48250f43b6bcd0000664000000000000000000000032113257152177027124 0ustar AMQPSÀƒ ¡0.0.0.0@ptemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ede5e25daddc26285d8b78e3c6fb11fa34b286ccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ede5e25daddc26285d8b78e3c6fb0000664000000000000000000000115413257152177027440 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/edd07ffd3faea3299454c376ccf5bcbde5469720qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/edd07ffd3faea3299454c376ccf50000664000000000000000000000006513257152177027360 0ustar AMQMMMÿÿÿÿÿhhhhhhhhhhhhhhhhhhÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/edb7b9f8fafdecb6766f4db6b329bca10775ffc5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/edb7b9f8fafdecb6766f4db6b3290000664000000000000000000000067313257152177027536 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿ`ÿÿpu0@@à1£'(le-connecti;n-for-containerDELAYED_DELIVERY@Á4£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀ CC0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.quequeue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£pt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ed3837aa5ead9b6635af8665bac871dc427f4136qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ed3837aa5ead9b6635af8665bac80000664000000000000000000000102113257152177027271 0ustar AMQPS¡.ƒ À00.0.ÿp@ÿ0ÿÿ`ÿÿpu0@@à1£sole-conqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`RpÿÿÿpÿÿQPS¡.ƒ À00.0.ÿp@ÿ0ÿÿ`ÿÿpu0@@à1£sole-conqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_recÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ece765784f5a198d08d52e9fa7ddc57e8c818dafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ece765784f5a198d08d52e9fa7dd0000664000000000000000000000027213257152177027237 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ecdb1395825b2381172d544a01d1a007ff597e69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ecdb1395825b2381172d544a01d10000664000000000000000000000115313257152177026664 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0")SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exam:pleS)E@BC¸SÅCC 0CPpÀASrÁ£x-opt-jms-desUSUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúUUUU././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ec809cb48442bb7d2b7229b6264264631c5f6803qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ec809cb48442bb7d2b7229b626420000664000000000000000000000115413257152177026765 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ Thremessage: 26¹SÀCReue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ec60cc5bfe7200f87c223f14fc025a925beab889qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ec60cc5bfe7200f87c223f14fc020000664000000000000000000000074313257152177027173 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£soleSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ebdc2288a14298f5f7adf08e069b39fc42cbd909qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ebdc2288a14298f5f7adf08e069b0000664000000000000000000000000113257152177027206 0ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ebbacdf34938dcba3a5cdb22848ddc733c7507d5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ebbacdf34938dcba3a5cdb22848d0000664000000000000000000000001513257152177027471 0ustar AMQP——Öþÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eba5cf5d9fbd040c1d1ad87fee7e115f62aecb5eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eba5cf5d9fbd040c1d1ad87fee7e0000664000000000000000000000003613257152177027563 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb8d53c64eb21ef01ae418eb97c1cb0912001bebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb8d53c64eb21ef01ae418eb97c10000664000000000000000000000007613257152177027262 0ustar Ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb8998dace6678aeb5ee81e782f249810a1d5e33qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb8998dace6678aeb5ee81e782f20000664000000000000000000000035013257152177027320 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectiAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£on-for-containerDELAYED_DELIVERY@Á3£kroduct¡proapachduct¡e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb65422a78e3882b7a7fee19594e3587949ec10bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb65422a78e3882b7a7fee19594e0000664000000000000000000000006413257152177027071 0ustar Û¶¶clccc:cccccccccccccccccé¶¶clccc:ccccccccccccccccc././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb0305548c1ce54379de1592a36c12580c670670qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eb0305548c1ce54379de1592a36c0000664000000000000000000000101513257152177026757 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·SeadSent¡tÁA¡ ThreadSent¡)Producer AktiveMQQueue[examplet], hr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eaf38761bc93c3a5163eb7c2d115b8f87058be05qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/eaf38761bc93c3a5163eb7c2d1150000664000000000000000000000115413257152177027116 0ustar AMQP×SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ea40fcbc0e2ed1b0bcd64b6658d0670c2dc9d55bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ea40fcbc0e2ed1b0bcd64b6658d00000664000000000000000000000115413257152177027401 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒeue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ea00d2531496198177fa4550ce6b69100d0c93d0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ea00d2531496198177fa4550ce6b0000664000000000000000000000115413257152177026702 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSsÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8df9f132e5a107a7de9b8b7cbf6cb5975f47c74qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8df9f132e5a107a7de9b8b7cbf60000664000000000000000000000026513257152177027363 0ustar AMQPÀÁt¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exa'pSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8cc5e3058c4fe0e964176b2ffb6af45d69e67c9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8cc5e3058c4fe0e964176b2ffb60000664000000000000000000000115413257152177027221 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8b6eb3460ee2e8772c019a439253fb0e76c9370qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e8b6eb3460ee2e8772c019a439250000664000000000000000000000053613257152177026776 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apac:e-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_)eceiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQAMQPSsÀ% @@¡jms.queue.exaSÀƒ m¡././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7c3d536a264a8014f8b064f9d047fef855fd5aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7c3d536a264a8014f8b064f9d040000664000000000000000000000050213257152177026760 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e79f84d85610d31d1a5f9e981d48833a217a48e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e79f84d85610d31d1a5f9e981d480000664000000000000000000000046313257152177027016 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7284b3e2da5c87b908a67fdb1aada576c603b8fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7284b3e2da5c87b908a67fdb1aa0000664000000000000000000000007613257152177027270 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7064f0b80f61dbc65915311032d27baa569ae2aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e7064f0b80f61dbc65915311032d0000664000000000000000000000000113257152177026656 0ustar )././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6f030201d47ec77f0cb12bb484337d8ecaa4917qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6f030201d47ec77f0cb12bb48430000664000000000000000000000110513257152177027021 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ%@¡jms.queue.example@sÀ% @@¡jms.queue.examqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6b1383e0453335f2bf22e81c6b77f899bc3399fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6b1383e0453335f2bf22e81c6b70000664000000000000000000000105413257152177026757 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-ÿÿÿÿÿÿÿÿdestQSsÀ% @@¡jms.queue.example@@@@@@ƒXW·ùStÁA¡ ThreadSent¡)Prÿÿÿ`ÿÿpu0@@à1£sole-cïnnection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e69f97838a8a5b8818049dcbc020c07dc1b21708qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e69f97838a8a5b8818049dcbc0200000664000000000000000000000101613257152177027003 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acpivemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6411a24f1b26a54ee9b115ff3488d6cb16a003aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e6411a24f1b26a54ee9b115ff3480000664000000000000000000000000213257152177027025 0ustar ®!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e625886560102ab866e269c184da06d23b403051qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e625886560102ab866e269c184da0000664000000000000000000000115413257152177026634 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡-Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e591659f8f2ff99061272027c4ba172e8bbaf4e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e591659f8f2ff99061272027c4ba0000664000000000000000000000076413257152177026733 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSple@sÀ% @@¡jms.queue.example@@@@@@ƒent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e549e1c3e759c7e5b4c45ef82136b52e5023178aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e549e1c3e759c7e5b4c45ef821360000664000000000000000000000107513257152177027070 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DLEIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DLEIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSenuntTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e3ef58cbc590a4571bd51bfc2bc8604dc31b2206qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e3ef58cbc590a4571bd51bfc2bc80000664000000000000000000000115413257152177027342 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£Žx-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e3ccd94c3b80f31b0385ca80bf21913f23f8afe5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e3ccd94c3b80f31b0385ca80bf210000664000000000000000000000101213257152177027157 0ustar AMQPSÀƒ ¡5ÉÏ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-optÖjms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e364abc2381c1c54297ccad857039f92f09b6948qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e364abc2381c1c54297ccad857030000664000000000000000000000115413257152177027036 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e326f3708fb445dfdceeefea3daa43901871d129qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e326f3708fb445dfdceeefea3daa0000664000000000000000000000000513257152177027560 0ustar É././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e2ddcd8147193f5e0bf0faa94a8f920a1252ebfcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e2ddcd8147193f5e0bf0faa94a8f0000664000000000000000000000115413257152177027347 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e232d1683da1d4ef3cc01e9f086c9952cca1378dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e232d1683da1d4ef3cc01e9f086c0000664000000000000000000000067313257152177027203 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSðÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e203bc3eb0b3abfc483ee11c31bdb713dbd5c4a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e203bc3eb0b3abfc483ee11c31bd0000664000000000000000000000115413257152177027366 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e15bb2fb15be91abce5398dd7ce4954b6b80778eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e15bb2fb15be91abce5398dd7ce40000664000000000000000000000071513257152177027425 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-For-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"S@ê`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampletÁA¡ ThreadSent¡)ProdS(À¡jms.queue.ex:ampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e0d2d66699106bdb562fb3df007daa426275c2a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e0d2d66699106bdb562fb3df007d0000664000000000000000000000063713257152177027130 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queueSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e01577742966ec70a32164035929dde15ce61478qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/e01577742966ec70a321640359290000664000000000000000000000051013257152177026406 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1AMQPSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`£sole-connection-for-containerDELAYECPSÀCCASÀ;£amqp:not-found¡(AMQRp2190: sourceÿ ÿad././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dfd70851a123d49f63fe9f8830290b354f941c12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dfd70851a123d49f63fe9f8830290000664000000000000000000000107413257152177027007 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU'UUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/df84c5a0849c81a91b6727e57a51c064f3ce9664qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/df84c5a0849c81a91b6727e57a510000664000000000000000000000054713257152177027004 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿdestQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/df44afcb2279e76ce037030be099917ca0e9689aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/df44afcb2279e76ce037030be0990000664000000000000000000000027213257152177027126 0ustar AMQPSÀƒ ¡0.0.0.@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/de306bfe69c36905dba5456d38897ce582acd0ccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/de306bfe69c36905dba5456d38890000664000000000000000000000027213257152177027067 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ƒQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ddea0a89ad07f2b4656ace264441f7ab8dad03f4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ddea0a89ad07f2b4656ace2644410000664000000000000000000000104513257152177027174 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVµRY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿS)E@BC¸SÀCC 0CSpÀA £x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dd494381250cd0442f0eb19383ab2fd4843ef181qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dd494381250cd0442f0eb19383ab0000664000000000000000000000051713257152177026753 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-op"-jmeue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dd04bf1f6c5ced94b85a2679eac9680614e854e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dd04bf1f6c5ced94b85a2679eac90000664000000000000000000000115413257152177027360 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcd49610236e6fd9e1e4b6df531761720ad6a66bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcd49610236e6fd9e1e4b6df53170000664000000000000000000000046313257152177027137 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)B@ECPSÀCCASÀ;not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcca66b28d2cd2f38d9c18ad8c84aa011010868dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcca66b28d2cd2f38d9c18ad8c840000664000000000000000000000067613257152177027364 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcc00ea6548593d86a8dad7822b52d9d2292ecb8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dcc00ea6548593d86a8dad7822b50000664000000000000000000000115413257152177027132 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀCSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dbbafce1283cda7b734935ed8ef6b11c0a5d87a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dbbafce1283cda7b734935ed8ef60000664000000000000000000000027213257152177027433 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dba84b3c91551693b3ee0023c5fe3e159a9fcc45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dba84b3c91551693b3ee0023c5fe0000664000000000000000000000113413257152177027113 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dafeb850e8baa7fe58601b9fc2ef7e01e292d44aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/dafeb850e8baa7fe58601b9fc2ef0000664000000000000000000000115413257152177027513 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da59a60b025b8ce8edd8ec81c8e99e0d48f1e35eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da59a60b025b8ce8edd8ec81c8e90000664000000000000000000000041413257152177027356 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da4628d0922d119c58040b7416c36829a6635597qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da4628d0922d119c58040b7416c30000664000000000000000000000115413257152177026613 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiserCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da26aebb194644c9ad2d982111097ae1bf44a536qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/da26aebb194644c9ad2d982111090000664000000000000000000000047413257152177027041 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààctivemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡£s(le-apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-des‰QSsÀ% @@¡jms.queuexm.paeXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d9c62c15254cc08bcaf830eda98ee4c4c12222a6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d9c62c15254cc08bcaf830eda98e0000664000000000000000000000115413257152177027265 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS'E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d8bd027ae39a115ef2cbaa8d9de144ffeddc67d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d8bd027ae39a115ef2cbaa8d9de10000664000000000000000000000067613257152177027424 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d8aa5fa8ba489f699ff028a4972960d0b9119ebaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d8aa5fa8ba489f699ff028a497290000664000000000000000000000023713257152177027163 0ustar AMQPSRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d86967f8a877f5dc4ccdca9be344878755612e11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d86967f8a877f5dc4ccdca9be3440000664000000000000000000000073713257152177027326 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQ„„„„„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d7761b11b42e0ccd3415684afef4170bd064c1c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d7761b11b42e0ccd3415684afef40000664000000000000000000000115413257152177027115 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsC% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts—et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d72791067fd52e42eb49a8678e9373e46dde8dc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d72791067fd52e42eb49a8678e930000664000000000000000000000067613257152177026746 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQ¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d6eba1e5c60d7df89b423b5c518b6a5ab2f77c97qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d6eba1e5c60d7df89b423b5c518b0000664000000000000000000000115413257152177027265 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d6b57f8b67c60f13bc1ba44e330154b34aca10a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d6b57f8b67c60f13bc1ba44e33010000664000000000000000000000115413257152177027111 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rems-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rems-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d662faeabfb40de68133d1591d9caf21b0ea4b22qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d662faeabfb40de68133d1591d9c0000664000000000000000000000115413257152177027263 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1˜sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d5ebdd563169b07d3c594bee93084774e8253fd5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d5ebdd563169b07d3c594bee93080000664000000000000000000000115413257152177027137 0ustar AMQPSÀƒ ¡AM0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`RpÿAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpverCBPPS(À¡jms.queue.exampleS)Eÿÿpÿÿÿpÿ@BC¸ÿÀ rÁ£x-opt-jms-destQSsÀ% @@VERY@Á3£kroduct¡agacÿÿÿÿÿÿÿÿemq-artemis£version¡2.5.0"SÀ`€RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(ÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qur-containerDELAYED_DEeue.exLIVERamp`RpontainerDELAYED_SÀ ¡ my_recle],././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d515a418f77e1d1c9919c9ace3045ed918c8c715qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d515a418f77e1d1c9919c9ace3040000664000000000000000000000050713257152177027054 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£proEEEEEEEEEEEEEEEEEEEEEEEEEEEpache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCcASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d48aee75343069bf16f19d26e983e3aa57d4f460qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d48aee75343069bf16f19d26e9830000664000000000000000000000027213257152177027010 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1`QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d45fd1eaaca69b74aa83b1ad2f56d83fc2230986qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d45fd1eaaca69b74aa83b1ad2f560000664000000000000000000000071013257152177027410 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀúAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d417f7ca33e9b7382243b185891efb0da7a037bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d417f7ca33e9b7382243b185891e0000664000000000000000000000073013257152177026716 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d22d30d3916483f87e26bb54d8ec7bdd84b77737qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d22d30d3916483f87e26bb54d8ec0000664000000000000000000000055513257152177027060 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d223ddf607b432e1b284c39da75e2077104c5cc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d223ddf607b432e1b284c39da75e0000664000000000000000000000001013257152177027106 0ustar :ÿ:ÿú././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d1c7d7d4bd4c5e898f65df8c8ddf3cad27d6da69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d1c7d7d4bd4c5e898f65df8c8ddf0000664000000000000000000000060113257152177027456 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.e1£sole-connection-for-containxampleS)E@BC¸SerDELAYED_DELIVERY@Á3£kroduct¡apachÀCC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d192931d713b1f4749f16bc33777865fc242b58aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d192931d713b1f4749f16bc337770000664000000000000000000000027213257152177026636 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1”QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d165e53c5b6e9bd880558bf9d24d6a576ade6a52qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d165e53c5b6e9bd880558bf9d24d0000664000000000000000000000061713257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚£sole-connectio’Ò™ÒœŽntainAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroducterDELAYED_DELIVERY@Á3£product¡apa¡apache-activemq-artemis£che-activemq-artemisÿÿÿÿÿÿÿÿ£version¡1.5.0version¡2.5.0""SÀ`SÀR././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d04b90f9028f1b91446bd88f3c8fb5b8c3f55744qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d04b90f9028f1b91446bd88f3c8f0000664000000000000000000000115413257152177027061 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d0005305b9b3466ee96d4783ca6552ac36f61074qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/d0005305b9b3466ee96d4783ca650000664000000000000000000000010013257152177026675 0ustar :ÿ ŽõÇ Žõõ:ÿú././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cff19daad7962773d7b2d2fb2bd9aa72383711f3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cff19daad7962773d7b2d2fb2bd90000664000000000000000000000115413257152177027356 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSxÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf8cba792eab69cab31712341a65532bd771badeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf8cba792eab69cab31712341a650000664000000000000000000000115413257152177027174 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf6fc1829c62f64e00d9f042efb2a04f5ae6c07fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf6fc1829c62f64e00d9f042efb20000664000000000000000000000006013257152177027203 0ustar ÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf3305c826c748d56b5b2562c0dd34343102e094qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf3305c826c748d56b5b2562c0dd0000664000000000000000000000115413257152177027043 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£produst¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf24c640175cac15e73ef5b94761be16d82605b2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf24c640175cac15e73ef5b947610000664000000000000000000000002013257152177027035 0ustar '÷÷÷÷÷÷÷÷÷÷÷÷J÷!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf02929e1c7c8b93b2719c78cbff4462722851efqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cf02929e1c7c8b93b2719c78cbff0000664000000000000000000000067613257152177027234 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce4c51eb6b952d86b9f807fc38534e36a9920c9bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce4c51eb6b952d86b9f807fc38530000664000000000000000000000067513257152177027155 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0ÀPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce0eabb9aa92c0c414cef2bfe5936d16c5d270e4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce0eabb9aa92c0c414cef2bfe5930000664000000000000000000000102513257152177027466 0ustar AMQPSÀƒ .0.0.0¡0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 0()SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueuepxm[eale], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce00ace885ee3471041db9ce16828b682111ff31qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ce00ace885ee3471041db9ce16820000664000000000000000000000046313257152177027122 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Vpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does notsxi et././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cd7ec3122df7b135f8a76ab8de7804b5b488e69dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cd7ec3122df7b135f8a76ab8de780000664000000000000000000000003413257152177027271 0ustar Û¶¶cccccccccccccccccccccccé¶././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cd1230a9612663f2dcbc39f42764ea7a776e88ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cd1230a9612663f2dcbc39f427640000664000000000000000000000046313257152177026762 0ustar AMQPSÀƒ ¡:0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3rdo£puct¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ccdaff4324e5c140394c967733a5cba0a0d0baa0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ccdaff4324e5c140394c967733a50000664000000000000000000000027213257152177027046 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@˜1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ccbdfccb91be2e40cebeafb39e6dd9e1ad8edb01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ccbdfccb91be2e40cebeafb39e6d0000664000000000000000000000060213257152177027772 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverC@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc9557c3cd6cb792b42a1091f59b395aea8cfea8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc9557c3cd6cb792b42a1091f59b0000664000000000000000000000115413257152177027130 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsà% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc1f5327268ce8e2678c65f34eae51cdbff97ffeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc1f5327268ce8e2678c65f34eae0000664000000000000000000000115413257152177027144 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)EBBC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)PAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conn`Rpfor-coÿÿÿÿÿÿÿÿDELAYED_DEroducerL¡(Au0@@à1£sole-connectio does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roducer AktiveMQQueue[example], thÉ0¡countT././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc1826bf81d8896e49411ddb2f38fba435cb93c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cc1826bf81d8896e49411ddb2f380000664000000000000000000000072413257152177027066 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kzoduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYEDPS(À¡jms.quaue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queu_DELIVEe.example@@@@@RY@Á3£product¡apache-activemq-@aƒrt././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cbfcc138e3cbbb953730bf88c31d979938490063qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cbfcc138e3cbbb953730bf88c31d0000664000000000000000000000102013257152177027330 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cbdf4394a0a47969e36a8d426a821f874136f901qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cbdf4394a0a47969e36a8d426a820000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cad16e3feb3b4ed3fc0f5e45ef211dd9af60757eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/cad16e3feb3b4ed3fc0f5e45ef210000664000000000000000000000041513257152177027474 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@;à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP>S(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/caad06fdd1a53cc27d02bb3a83a5fab7a057f75bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/caad06fdd1a53cc27d02bb3a83a50000664000000000000000000000027213257152177027371 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1‚QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ca44c8744fe82b46e23fce45d1378eed69452e2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ca44c8744fe82b46e23fce45d1370000664000000000000000000000115213257152177027131 0ustar AMQPSð?|ü¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"ÿÿÿÿÿÿÿSÀ`RpÿÿÿpÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAAMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-aS£x-opt-jms-ctidestQ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c9c412ab73132a8d9bf4ad40283fb65060866a30qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c9c412ab73132a8d9bf4ad40283f0000664000000000000000000000071513257152177027115 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(Á¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c99ca1b53c78a0cbee593e27ff0fe65a719b4eb2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c99ca1b53c78a0cbee593e27ff0f0000664000000000000000000000047313257152177027356 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ols£e-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿpÿÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c9934546277bd1e28753adf4729b7bac5d289f0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c9934546277bd1e28753adf4729b0000664000000000000000000000046313257152177026731 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c8f8bd07151c676639ec5f293a9e2d51f47a105eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c8f8bd07151c676639ec5f293a9e0000664000000000000000000000115413257152177027071 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0Sw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c8bdf2beece7a6ced2bd7f5e4c7154f1b6722c11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c8bdf2beece7a6ced2bd7f5e4c710000664000000000000000000000115413257152177027651 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·S;ÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c80a9aae8471ef74360ab4085bc4c2dc1be97bc6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c80a9aae8471ef74360ab4085bc40000664000000000000000000000023613257152177027120 0ustar AMQPSÀƒ ¡0.0.0.;@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY`Á3£product¡a'ache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c730fd31aef6e41f0d1c444e7db2687cb0ae651fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c730fd31aef6e41f0d1c444e7db20000664000000000000000000000115413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c616630e295fa26b932c8c5148821c34cafce3f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c616630e295fa26b932c8c5148820000664000000000000000000000113413257152177026631 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c5cffebc6890762c5059e7ae468ee3292704ebfbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c5cffebc6890762c5059e7ae468e0000664000000000000000000000115413257152177027232 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASvÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c5c053c1ce41fe5d782cf29dbef7e111eb303b14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c5c053c1ce41fe5d782cf29dbef70000664000000000000000000000106413257152177027351 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c59fc6451ec6db995a0e65a30215a8a7345f6e45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c59fc6451ec6db995a0e65a302150000664000000000000000000000071513257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCISÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c580af2a2742b826da44de2ce668303a45174116qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c580af2a2742b826da44de2ce6680000664000000000000000000000005613257152177027123 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c573f8c47a34ccc6b9917431684227cf1e07baa0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c573f8c47a34ccc6b991743168420000664000000000000000000000115413257152177026721 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c54537b72ed6efc3e08a617bde6c3dfa1b3825dbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c54537b72ed6efc3e08a617bde6c0000664000000000000000000000027213257152177027272 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1UQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c3e199707597e95191827ed1b719c521c6727e0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c3e199707597e95191827ed1b7190000664000000000000000000000101513257152177026575 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activ!mq-artemis£versio(¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP³(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c363822fd6b6fd404dac44fa95eea7319492cb41qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c363822fd6b6fd404dac44fa95ee0000664000000000000000000000113313257152177027265 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0@@à1£sole-connection-for-containerTELAYED_DELIVERY@Á3£product¡apache-activemq-arteqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:notpu0@@à1£sole-connection-for-containerTELAYED_DELIVERY@Á3£product¡apache-activemq-arteqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmis£version¡1.5.0"SÀ`Rpÿÿÿp-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c361a2b998b608436eff227d329bb449607d509dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c361a2b998b608436eff227d329b0000664000000000000000000000055013257152177026774 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c33a5f78a1514fd57cd88fbd5451cb439d5ebdecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c33a5f78a1514fd57cd88fbd54510000664000000000000000000000104713257152177027135 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERYÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ0//////3ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c30f5beff0fd5b0f767f799ff75dcf3cf0298cd2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c30f5beff0fd5b0f767f799ff75d0000664000000000000000000000066213257152177027401 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ1 ¡ my_receiverCBPPS(À¡jms.queue.exa0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c279e79c937b79d45c1823fe5c0439313c81b5cfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c279e79c937b79d45c1823fe5c040000664000000000000000000000110013257152177027002 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUUUUU././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c1ccdaa3cf50a0690c89ae16049dd96ac3af2226qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c1ccdaa3cf50a0690c89ae16049d0000664000000000000000000000044013257152177027244 0ustar AMQPSÀƒ ¡0.0.0.0@pÿ„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„ÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c07081a3bdb123c30e5718a67528fdf058489850qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c07081a3bdb123c30e5718a675280000664000000000000000000000070013257152177026662 0ustar AMQP€SÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c06f518d891d8f4f4586ac0696b1b345586e3b67qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/c06f518d891d8f4f4586ac0696b10000664000000000000000000000027213257152177027006 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bfc4dab55faa6bcb351e277389c2a36a13daea0eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bfc4dab55faa6bcb351e277389c20000664000000000000000000000111713257152177027337 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reec*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf7e16b4c35b617596e7fa830bd2d3936e2c9e53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf7e16b4c35b617596e7fa830bd20000664000000000000000000000115413257152177027132 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS0E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf78a3eb0af5dc179ee197ae9ea6e58ebd9434b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf78a3eb0af5dc179ee197ae9ea60000664000000000000000000000115413257152177027440 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStAÁ¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], Ýhread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf366f6855d36834a7cffb9a69b78e74ca6bbbabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf366f6855d36834a7cffb9a69b70000664000000000000000000000115413257152177027160 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP;S(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Pooducer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf13634f65d93ef082e02bcadfbb252680dfa674qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bf13634f65d93ef082e02bcadfbb0000664000000000000000000000115413257152177027336 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SðCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be8dfd431ccc3fa35a196c2cad7c7c12dbc57471qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be8dfd431ccc3fa35a196c2cad7c0000664000000000000000000000115413257152177027474 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡ countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be33dd96db031d54ca4eb28e8036e1af25c9f559qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be33dd96db031d54ca4eb28e80360000664000000000000000000000044413257152177027177 0ustar AMQPSÀƒ ¡0.0.TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-co:ntainerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be02333000f17d004a082302b476366df5999badqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/be02333000f17d004a082302b4760000664000000000000000000000115413257152177026477 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis˜version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bdb550726feefc348c4455c24cc7116719a31f02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bdb550726feefc348c4455c24cc70000664000000000000000000000077413257152177027217 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑE@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bd99fe90a82d785d4f31797fe7b7ede12c845341qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bd99fe90a82d785d4f31797fe7b70000664000000000000000000000037613257152177027174 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi£sversion¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bbd6342f859499a9651ce11cec85c4c0d307cb36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bbd6342f859499a9651ce11cec850000664000000000000000000000027213257152177027065 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1qQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bba191d9765d818ea1569b5f2e616bad410a9d0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bba191d9765d818ea1569b5f2e610000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bb866a2f8d475e0cd427c6e99e7bcc88360f6cefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/bb866a2f8d475e0cd427c6e99e7b0000664000000000000000000000046313257152177027232 0ustar AMQPSÀƒ ¡0.0.0®0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`€Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/baedb5aaed2df030c0b2e7ba51080703b43e4ec1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/baedb5aaed2df030c0b2e7ba51080000664000000000000000000000026313257152177027445 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ba9e2d30be1291cad843edd0a7585e24d4961818qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ba9e2d30be1291cad843edd0a7580000664000000000000000000000035213257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b9dc1834a15132a0e0fd05b8aa903ed269b1249eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b9dc1834a15132a0e0fd05b8aa900000664000000000000000000000027213257152177027075 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b976a13a56cbcf02d66ce8210cdc01b2ae1156ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b976a13a56cbcf02d66ce8210cdc0000664000000000000000000000115413257152177027252 0ustar AMQPSÀƒ ¡AM0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`RpÿAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpverCBPPS(À¡jms.queue.exampleS)Eÿÿpÿÿÿpÿ@BC¸ÿÀ rÁ£x-opt-jms-destQSsÀ% @@VERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`€RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(ÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qur-containerDELAYED_DEeue.exLIVERamp`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_recle],././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b92fb34478ff6a96240fe784085361524e966dc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b92fb34478ff6a96240fe78408530000664000000000000000000000115413257152177026731 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connÀction-for-containerDELAYED_DELIVERY@Á3Vø”oduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1C!pÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b84206818dbf10d98d1c4523237a4ceae111c015qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b84206818dbf10d98d1c4523237a0000664000000000000000000000027213257152177026700 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1@QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7f747954813ca4388cef929b41cf2e06df29c4eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7f747954813ca4388cef929b41c0000664000000000000000000000046313257152177027014 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-aãtivemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7e435ea6415b2ef6a8a3cb72669d60c1f8049caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7e435ea6415b2ef6a8a3cb726690000664000000000000000000000000513257152177027123 0ustar :ÿú././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7c7b300d6313ed7282b9f09ca21ed2561526f6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7c7b300d6313ed7282b9f09ca210000664000000000000000000000000513257152177027024 0ustar AMQP././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b77d1cc93f6bcbf59cdae32e133b75ca238f1d8eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b77d1cc93f6bcbf59cdae32e133b0000664000000000000000000000115413257152177027422 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b754ec691ae094043d4ad98c9c0930ecc8533075qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b754ec691ae094043d4ad98c9c090000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E°BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7005c27a86327f44ccb0f659985badd25b01bd9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b7005c27a86327f44ccb0f6599850000664000000000000000000000045313257152177026720 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-ar„„„„„„SsÀ%@ ¡@jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡j-s.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b693900e85dea35d2a512b0616bd39a7496888b4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b693900e85dea35d2a512b0616bd0000664000000000000000000000036113257152177027030 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b4f9c2c0a434fd9c7df40072050b6befc3cfcd2cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b4f9c2c0a434fd9c7df40072050b0000664000000000000000000000043013257152177027104 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿp£sole-connection-for-containerDELAYED_DELIle], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer Aktivest message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b4203e6310166edc8192f3ba7b9c9ed4da466591qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b4203e6310166edc8192f3ba7b9c0000664000000000000000000000027213257152177027034 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1 tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b30f4d3bdd5a1b9093cf7f241f9ad076f8c60a01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b30f4d3bdd5a1b9093cf7f241f9a0000664000000000000000000000115413257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b2f158152bd7bd75219d30f373083e60b346e763qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b2f158152bd7bd75219d30f373080000664000000000000000000000001213257152177026671 0ustar ŽõÇ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b2948750248fcd761e3738b55e3d169a721ec903qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b2948750248fcd761e3738b55e3d0000664000000000000000000000104613257152177026724 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b25109039fad80cf53505e981a25ccb2e95c7f83qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b25109039fad80cf53505e981a250000664000000000000000000000071513257152177026702 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_rSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpexampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example¹@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b225d9445ec153a44eb16d7da4c38495b041c2cbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b225d9445ec153a44eb16d7da4c30000664000000000000000000000113413257152177027111 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b0ab9f6746fb3031807f0ca55cbdaa81db9afcf4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b0ab9f6746fb3031807f0ca55cbd0000664000000000000000000000115413257152177027172 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b09f54d6993758131454c22e255cd6695e64fb8cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b09f54d6993758131454c22e255c0000664000000000000000000000072713257152177026563 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b09450282ecb92d989617fb3fe340474f7508bc8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/b09450282ecb92d989617fb3fe340000664000000000000000000000057513257152177027010 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af89087db1180549aa5fc11bbf334885a04f84b1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af89087db1180549aa5fc11bbf330000664000000000000000000000102713257152177027116 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-fwr-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec›eiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af54ae55193e1a1e0725a876c1f3e22f1acfe065qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af54ae55193e1a1e0725a876c1f30000664000000000000000000000067513257152177027046 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á4£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà=CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af112fc29e65709ef6366fcdb4b9a7c2cbb47961qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/af112fc29e65709ef6366fcdb4b90000664000000000000000000000067513257152177027230 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_recece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aef19ef7237d6e63b7e11341ab588430d52079e8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aef19ef7237d6e63b7e11341ab580000664000000000000000000000114213257152177027125 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQAAAAAQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@'@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡coUntTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aeeb27d92fdafa7cb33df1ee37f253d27b16f74aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aeeb27d92fdafa7cb33df1ee37f20000664000000000000000000000064113257152177027564 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààctivemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡£s(le-apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-des‰QSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae78960cbdf27048497f3e49cafc6416342ae7b6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae78960cbdf27048497f3e49cafc0000664000000000000000000000115413257152177027230 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae30408c5f04d3ce09cdcb3edcb6c56dda223a41qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae30408c5f04d3ce09cdcb3edcb60000664000000000000000000000115413257152177027406 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡3.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀxampleS)E@BC¸SÀCC 0CSpÀAÁeñ‡Òopt-jís-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSeD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.querDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae1b60144d96acb39cecbb7d01d662203321f1e6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ae1b60144d96acb39cecbb7d01d60000664000000000000000000000113413257152177027324 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ad22a08f406e82897a8ef227d14ac23a24b08083qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ad22a08f406e82897a8ef227d14a0000664000000000000000000000101613257152177027043 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-:jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/acfe1f9c62e2c5727f2d6ed254f6df2893eba95bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/acfe1f9c62e2c5727f2d6ed254f60000664000000000000000000000077613257152177027310 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.exajple@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jmsSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ac3bdcae2ff2cd3cdaf336de95fedfa12a2156b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ac3bdcae2ff2cd3cdaf336de95fe0000664000000000000000000000072313257152177027721 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containÀs¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ac08b57708566d32badf153efdb7292552980c8fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ac08b57708566d32badf153efdb70000664000000000000000000000075113257152177027207 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿmy_receiverASÀ4 ¡ my_rece*verCBPPS(Àoducer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aba6a1642a535762c1a8596676cea54399ee23b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aba6a1642a535762c1a8596676ce0000664000000000000000000000115413257152177026765 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPÿÿÿÿS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡conuTtSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQ­Œ?ÚõÈ@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab941e172fefdf252019c74ead858714926feec9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab941e172fefdf252019c74ead850000664000000000000000000000115413257152177027207 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab8331404c256fd327ee4b17d7339e82c8883722qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab8331404c256fd327ee4b17d7330000664000000000000000000000105413257152177026754 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-foroc-ntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab6324e1195565f435f307601a066f1706bf0c73qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab6324e1195565f435f307601a060000664000000000000000000000070013257152177026527 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab2203c149e63da773839ce3928a0c2110b4674eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/ab2203c149e63da773839ce3928a0000664000000000000000000000101713257152177026764 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@ÁÒ3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aa90f7481c56bc3a10b16c1c92ed1f352209d8d0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aa90f7481c56bc3a10b16c1c92ed0000664000000000000000000000115413257152177027165 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aa501555748d7c97260b4b14b79dbf6cd3654388qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/aa501555748d7c97260b4b14b79d0000664000000000000000000000067313257152177026714 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àA QPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.e1£solòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòe-connection-for-containxampleS)E@BC¸SerDELAYED_DELIVERY@Á3£kroduct¡apachÀCC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a9f2f4b18bb9f729db2e211e7f10065ee69c4409qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a9f2f4b18bb9f729db2e211e7f100000664000000000000000000000027213257152177027204 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a990f9d0f2dd6098767b7375107d36d122271a49qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a990f9d0f2dd6098767b7375107d0000664000000000000000000000057513257152177026737 0ustar AÿÿÿÿÿÿÿÿSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿD_DELI0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a8efddb757a110f1d20fc7ef47bf8e9170e097d1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a8efddb757a110f1d20fc7ef47bf0000664000000000000000000000115413257152177027423 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ù¦‹>¾¡ Thremessage: 26¹SÀCReue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a8c51938af7168cacd336d2ba948e896287881a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a8c51938af7168cacd336d2ba9480000664000000000000000000000115413257152177027134 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a6f6e4e44d716db73b883ad61476bb66fbe36b5aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a6f6e4e44d716db73b883ad614760000664000000000000000000000060013257152177027054 0ustar AMQPSÀƒ ¡0.0.0.0@pÿrrrrrrrrrrrrrrrr@@¡jmøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøs.rrrrrrrrrrrrrrrQSsÀ% @@¡jms.queue.example@sÀ% @@¡jmøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøs.queue.example@@@@@@ƒXw·;StÁA¡ Threa§dSent¡)ProdS(À¡jms.queue..queue.exampleÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a6ee4bfdc4e6f25457790070b687c7827bf9d993qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a6ee4bfdc4e6f25457790070b6870000664000000000000000000000115413257152177027062 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-9ontainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸ÓÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a676370b5fef879217a46ee27531478709d43606qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a676370b5fef879217a46ee275310000664000000000000000000000115413257152177026723 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messag): 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a5fcd16190822e5c5cf548b49cdc31674a0067fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a5fcd16190822e5c5cf548b49cdc0000664000000000000000000000027213257152177027211 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a5bee715fa934be29d7c0f209ae8e9b17b48035fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a5bee715fa934be29d7c0f209ae80000664000000000000000000000042413257152177027270 0ustar AMQPÀƒS ¡0.0.0.0@pÿÿÿÿ`ÿÿp*u0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a4c2ebcf7d40684881cba72e043ff9dd91774b0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a4c2ebcf7d40684881cba72e043f0000664000000000000000000000000313257152177027171 0ustar ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a4b4c2295c6028b8def0fb774e6b27fc43335345qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a4b4c2295c6028b8def0fb774e6b0000664000000000000000000000115413257152177027207 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26MSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a401e6db47cd1c7c90257dc9eff32bd357596254qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a401e6db47cd1c7c90257dc9eff30000664000000000000000000000055413257152177027271 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a2d7fde750eae69da66e796f8fd8b20468ab2403qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a2d7fde750eae69da66e796f8fd80000664000000000000000000000026113257152177027401 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0;à1£sole-connection-for-containerDELAYED_DELIVERY@ÁAMQPSÀƒ 3erDELAYED_DELIVERY@Á¡0.0.0.0@pÿY@3Á3££kr././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a2981c9688b5e3111a50e4ff36d12a9aeb616f29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a2981c9688b5e3111a50e4ff36d10000664000000000000000000000023513257152177026765 0ustar AMQPSÀƒ ¡0.0.AMQP0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`R././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a219c62c1345b445f0feaf4920a1dfac641b156dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a219c62c1345b445f0feaf4920a10000664000000000000000000000046313257152177027026 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a1b715c1d05a2638591091d6a1e87a16f630d69cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a1b715c1d05a2638591091d6a1e80000664000000000000000000000001513257152177026663 0ustar AMQPI././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a17d448e065fe75cb6c8fd0f74b6729c381ab194qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a17d448e065fe75cb6c8fd0f74b60000664000000000000000000000073713257152177027227 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a1347188e46f2dc0639732f0d10d9cd9688e02efqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/a1347188e46f2dc0639732f0d10d0000664000000000000000000000074013257152177026700 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.uexample@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9ff48fcc35cccd28eb99c3de7c45a783839766b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9ff48fcc35cccd28eb99c3de7c450000664000000000000000000000063613257152177027457 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jmsUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9fbe6001c34a3cc9d7786cd628bdef116957d0b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9fbe6001c34a3cc9d7786cd628bd0000664000000000000000000000115413257152177027213 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9f3079ca9cd734b5897edd798bcfa0a1f38f7ddaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9f3079ca9cd734b5897edd798bcf0000664000000000000000000000000513257152177027241 0ustar :././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9ed99aaa3c2ac3f11a4a57d7f38a7bceb70e4740qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9ed99aaa3c2ac3f11a4a57d7f38a0000664000000000000000000000115413257152177027341 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@)à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9eaf065411d735d221bdb00d92089a46cb35c78dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9eaf065411d735d221bdb00d92080000664000000000000000000000073713257152177026753 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQ„„„„„„„„„„„„„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9e980a94723bd11013c89bf2e159b00ed1270d12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9e980a94723bd11013c89bf2e1590000664000000000000000000000001213257152177026703 0ustar õÇ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9db33b3178e51da50b72c234f9e19145dfd66971qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9db33b3178e51da50b72c234f9e10000664000000000000000000000011613257152177027034 0ustar AMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@à1£sPole-connecti././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9d6d6246bb254ad4e3e64cee81fa5532f95ab80fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9d6d6246bb254ad4e3e64cee81fa0000664000000000000000000000076613257152177027301 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qÿÿÿÿÿÿÿÿÿÿÿueue.examplms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qÿÿÿÿÿÿÿÿÿÿÿueue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9cc0934c7a316a81fe78fc05689037939c18dfdfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9cc0934c7a316a81fe78fc0568900000664000000000000000000000001513257152177026774 0ustar AMQPÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9bc993451e55d99a1fee8b9086d2bc419e289021qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9bc993451e55d99a1fee8b9086d20000664000000000000000000000115413257152177027077 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9b0ae80a948704017aee81b5b2c973fd9eb516cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9b0ae80a948704017aee81b5b2c90000664000000000000000000000075013257152177027042 0ustar AMQPSàƒqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9a813e245c1f2cf34295ce531cd19b290fda8d3dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9a813e245c1f2cf34295ce531cd10000664000000000000000000000027213257152177027037 0ustar AMQPSÀƒ ¡0.0.0.0pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99f8c582d45aac766dc59c6f3e3efe514adcd86bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99f8c582d45aac766dc59c6f3e3e0000664000000000000000000000115413257152177027237 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS!À4 ¡ my_r!!!eceion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@À ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source addreùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@-containerDELAYED_DEÿÿÿÿx././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99b93654b26e42c53b9e3d6365a189b64851d0ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99b93654b26e42c53b9e3d6365a10000664000000000000000000000115413257152177026720 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9993cbd1f9a2f6cf78ea9a3ef5711732da8ba5ceqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9993cbd1f9a2f6cf78ea9a3ef5710000664000000000000000000000054313257152177027316 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ a0.0.0pÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/998a2d822ceac1ec5a012947439478151fd7b265qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/998a2d822ceac1ec5a01294743940000664000000000000000000000110213257152177026760 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activ!emq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUUUUU././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99573746708cb761034b7bf4b56e97b731c8172aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/99573746708cb761034b7bf4b56e0000664000000000000000000000115413257152177026646 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r¢œš–verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/993efa57a4c52aa81cf5364c1ffc5a9b8e2b2478qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/993efa57a4c52aa81cf5364c1ffc0000664000000000000000000000115413257152177027271 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1°sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/992f8286d42428e7919793b40b4c35983fd6510dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/992f8286d42428e7919793b40b4c0000664000000000000000000000115413257152177026577 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR a1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9909bc75edb3f5a4417f21c2632fc26924ac2b09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9909bc75edb3f5a4417f21c2632f0000664000000000000000000000103713257152177027051 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpAÿÿSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test meÿÿÿÿssage: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/989bd53e85073495e8c9e4f834625e18a3f3508cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/989bd53e85073495e8c9e4f834620000664000000000000000000000115413257152177026671 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÿÿÿÿSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9894afcdfcad19a40895c6fc051489fab8c60db9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9894afcdfcad19a40895c6fc05140000664000000000000000000000115413257152177027217 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/988497cfced73eefec28f3b5b751745e74e6ce26qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/988497cfced73eefec28f3b5b7510000664000000000000000000000115413257152177027321 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/98756aa837da45035de0bcc0244cd76e6dd5c24bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/98756aa837da45035de0bcc0244c0000664000000000000000000000001713257152177027034 0ustar AMQPÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/98728779491ea0af792a5c9d10d4e671f18205e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/98728779491ea0af792a5c9d10d40000664000000000000000000000004513257152177026727 0ustar %SSÿÿÿÿ÷÷÷÷÷J÷!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/984d1cf71f109696be39c4349f9c418c04bd25a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/984d1cf71f109696be39c4349f9c0000664000000000000000000000115413257152177027020 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQ: 26¹SÀCR 1(SpÀAXw·StÁA¡ ThreadSent¡)Producer ActiveMuuQeQe[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/973970255bcfd7b838bd478cb43becd301130715qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/973970255bcfd7b838bd478cb43b0000664000000000000000000000050613257152177027065 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿSÀCCASÀ;£amqp:not-found¡(AMQ071616: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/97321e7b6c7f8d1f1409de312bb93da73417ec80qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/97321e7b6c7f8d1f1409de312bb90000664000000000000000000000027213257152177027053 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/970fa3137006ab81db9ff4d30d056ad744544618qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/970fa3137006ab81db9ff4d30d050000664000000000000000000000115413257152177027032 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apachAMQPSÀƒ ¡0.e-activ0.0.0@pÿÿÿÿÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[efor-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exa@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% ple], th././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96f9cd58c2f8ff64a39f72cf786fdfc2abfd9f7cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96f9cd58c2f8ff64a39f72cf786f0000664000000000000000000000064713257152177027265 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acvtiemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BPCSÀCCASÀ;£amqp:not-found¡(AMQ21ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ9009: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96d222ad4394313779329fad9eeccef4d8e3725dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96d222ad4394313779329fad9eec0000664000000000000000000000046313257152177027005 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96b195f717be655797a684c391a20bf93498d30aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/96b195f717be655797a684c391a20000664000000000000000000000046413257152177026660 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpüu```````````````````````````````````````````````````````````````````````0@@à1£sole-connectoni-for-containerDELAYED_DELIVERY@Á3£produst¡apache-activemq-artemis£versionP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does lot exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/966991de9bfd1b17e78d7081b8db41eaaed43814qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/966991de9bfd1b17e78d7081b8db0000664000000000000000000000005613257152177027155 0ustar ÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/95edf83f46527a71ba9836caa320cb616a76094fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/95edf83f46527a71ba9836caa3200000664000000000000000000000104413257152177027050 0ustar AMQPSÀƒ ¡0.0.0.àààààààààààààààààààààààÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERYÁ@3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jmsversion¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/95d402fd51c5311982dd146c4b998df5b22e22e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/95d402fd51c5311982dd146c4b990000664000000000000000000000050113257152177026705 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCþCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/959fe3477fd582b7e86ad3d815ab6f609cc66e76qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/959fe3477fd582b7e86ad3d815ab0000664000000000000000000000067513257152177027164 0ustar AMQP€SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/954fcd956afc8b0b3c08f2cf8c4ec763a9ef2e64qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/954fcd956afc8b0b3c08f2cf8c4e0000664000000000000000000000051613257152177027361 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-For-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"S@ê`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampletÁA¡ ThreadSent¡)ProdS(À¡jms.queue.ex:ampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/947e404effacf1bff300a233ea52625e16514695qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/947e404effacf1bff300a233ea520000664000000000000000000000067313257152177027255 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/943e5fb29706e7638f8f098402df445a00e95ad6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/943e5fb29706e7638f8f098402df0000664000000000000000000000110113257152177026730 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀSÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9420b57281efbf467f50036c2bded0efdfb527b7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9420b57281efbf467f50036c2bde0000664000000000000000000000111613257152177027042 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/930c36b3fb0b80b6d09e13edf7a0a72fb2076a5fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/930c36b3fb0b80b6d09e13edf7a00000664000000000000000000000067513257152177027177 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91f7f23944c1e932d236c3c00b6d2d40950e59eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91f7f23944c1e932d236c3c00b6d0000664000000000000000000000115413257152177026762 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£tTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡êms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 54././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91c166e81f86d6923f85a71de4d1a65b79ba7f89qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91c166e81f86d6923f85a71de4d10000664000000000000000000000104613257152177027006 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVµRY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿS)E@BC¸SÀCC 0CSpÀA £:x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueueÚex(ample], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.ehample@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡­ountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9199d92e038ebe0629e219e7bcfe138a5b9e58f7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9199d92e038ebe0629e219e7bcfe0000664000000000000000000000115413257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/918ab0c43fe7fbfe6d13a44db798042f23238bb8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/918ab0c43fe7fbfe6d13a44db7980000664000000000000000000000115413257152177027275 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_recei~erCBPPS(À¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-dQestSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 44¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡tesŒßmessage: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9167a386ed5b5872e9f0de9eb99de5a8daf39668qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9167a386ed5b5872e9f0de9eb99d0000664000000000000000000000115413257152177027166 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9159cb8bcee7fcb95582f140960cdae72788d326qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/9159cb8bcee7fcb95582f140960c0000664000000000000000000000000213257152177027133 0ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91299db288976531269ee92efa03dfd954f4caa4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/91299db288976531269ee92efa030000664000000000000000000000115413257152177026656 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/907940a554d9aa0df2bf7614262c6668c6ed1ba8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/907940a554d9aa0df2bf7614262c0000664000000000000000000000115413257152177026762 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹ 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡²ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/901fcb18af686f2eef2ec8b535887786dc6b493bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/901fcb18af686f2eef2ec8b535880000664000000000000000000000115413257152177027226 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡0Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f658b73984757f7d2d151b27589f46655e3bea8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f658b73984757f7d2d151b275890000664000000000000000000000106413257152177026610 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f294fdf45b98220bae082f7e7f5f9b39d6c0958qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f294fdf45b98220bae082f7e7f50000664000000000000000000000114613257152177027150 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BÛ¶¶ccccccccccccC¸cccccSÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡co././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f019378b7a46b430489ea22869d0ae10b8e711fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8f019378b7a46b430489ea22869d0000664000000000000000000000027213257152177026645 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8ee85b6b086d6b10489f4ad3aecd133f0142f3baqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8ee85b6b086d6b10489f4ad3aecd0000664000000000000000000000115413257152177027274 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀA£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8ee08543632ad6248e1d099d35527129d017581bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8ee08543632ad6248e1d099d35520000664000000000000000000000000613257152177026630 0ustar )././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8e7097a5016bda6b512e1ded4768199443b284edqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8e7097a5016bda6b512e1ded47680000664000000000000000000000102413257152177027044 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8e22494b23ade083da0b80a359435f9d624b3e7eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8e22494b23ade083da0b80a359430000664000000000000000000000070213257152177026750 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exaopleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà1CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8d10a856e55cd79ac4e92822eeeede818640ce19qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8d10a856e55cd79ac4e92822eeee0000664000000000000000000000046313257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8cff28eb520d48ace3331fa0863863e22b6f934aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8cff28eb520d48ace3331fa086380000664000000000000000000000115413257152177027126 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message:dPent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8c569d47dc32a9cdecc0684090799ae68d0a7effqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8c569d47dc32a9cdecc0684090790000664000000000000000000000115413257152177027065 0ustar AMQPSÀ0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0tcon¡TuSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8c473e03eeade02778887eaf0a209f8de254bae2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8c473e03eeade02778887eaf0a200000664000000000000000000000103313257152177027123 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8bebeddeae592d53d8d4cf993ee7498f4321945eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8bebeddeae592d53d8d4cf993ee70000664000000000000000000000047313257152177027537 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containevDELAYED_DELIVERY@Á3£kroduct¡apache-actS(À¡jms.queuAMQPe.exampSÀƒleSivemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8bba0e9b22dadb12fdcb9f794ea456a850ccc5d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8bba0e9b22dadb12fdcb9f794ea40000664000000000000000000000046313257152177027501 0ustar AMQPS ¡ƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a9d7cda15f8bdb50f24c2101f786bb9ac2279d1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a9d7cda15f8bdb50f24c2101f780000664000000000000000000000067513257152177027211 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà1CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a9b5a7f662e4dc7beed98823434472ef09b9cebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a9b5a7f662e4dc7beed988234340000664000000000000000000000010013257152177027137 0ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a993f64205898ae2f6f9dcf1de39354bddd597aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a993f64205898ae2f6f9dcf1de30000664000000000000000000000070013257152177027153 0ustar AMQPSÀƒ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a98d97543bfd0a6ba8e44350e7501c660f01ac7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a98d97543bfd0a6ba8e44350e750000664000000000000000000000115413257152177027062 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a835b9c49036476c8212ab22a7d910ce9363b9dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a835b9c49036476c8212ab22a7d0000664000000000000000000000115413257152177026705 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a782b5d0f0f67f41f0a69488e1458ec9188addbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a782b5d0f0f67f41f0a69488e140000664000000000000000000000067613257152177027011 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectio¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a056e4cfbfb1a3da3733647b616ccc2419ed74eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8a056e4cfbfb1a3da3733647b6160000664000000000000000000000115413257152177027116 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡counŒ«åúSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8955e0bbad725f95d1c284c09608a4b9e4d6ccc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8955e0bbad725f95d1c284c096080000664000000000000000000000042413257152177026776 0ustar AMQPSÀƒ ¡000.0.0@pÿY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/892c0d1a406743a28c2467fe914b130f610d90a1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/892c0d1a406743a28c2467fe914b0000664000000000000000000000046413257152177026707 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEF_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`109505: sourcS)E@BCPSÀCCASÀ;£amqp:not-fQ109505: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/88a46a29e00b588e9954b144d29d904d224ea1a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/88a46a29e00b588e9954b144d29d0000664000000000000000000000061013257152177026721 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEqueue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡couîtTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/870961674973c483be1ad19fa954514415052ad6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/870961674973c483be1ad19fa9540000664000000000000000000000115413257152177026651 0ustar AMQPSÀƒ ¡0ÜÏÑÏÑÏ¿ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apachAMQPSÀƒ ¡0.e-activ0.0.0@pÿÿÿÿÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[efor-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@¾½¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exa@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% ple], th././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/869134fc2d650039345513914fd7175302cf0421qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/869134fc2d650039345513914fd70000664000000000000000000000115413257152177026475 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀSC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/858b87b89b6f1df1b21afc8c76726d19f05b60c3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/858b87b89b6f1df1b21afc8c76720000664000000000000000000000072113257152177027146 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡25.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8545fd646ad968de83cb298dd4a54416fa217f20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8545fd646ad968de83cb298dd4a50000664000000000000000000000115413257152177027156 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-acTivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQD_DELIVERY@Á1£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/853f56b73f5b4004586e169c606741c89916b82bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/853f56b73f5b4004586e169c60670000664000000000000000000000000613257152177026557 0ustar )././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8539260cb25742b5e96d1cd61f37e0ea0517b50cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8539260cb25742b5e96d1cd61f370000664000000000000000000000115413257152177026714 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containµrDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/849007917f5dc64d0391a1260c084482438fcc0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/849007917f5dc64d0391a1260c080000664000000000000000000000115413257152177026543 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaiAMQPSÀƒ ¡0.nerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£so0"SÀle-`RpÿÿÿpÿÿÿpÿÿSÀ4c onne¡CC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], tgread=0¡counŒ«åú¡jcontainerDELAYED[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQ.7@pÿÿÿÿ`ÿÿpuu0@@à1£sole-connection-for-c0@@à1£osole-con.0.0@pÿÿÿÿ`ÿÿp././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8466e86db60c366642e08130d28d1ef4821304e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8466e86db60c366642e08130d28d0000664000000000000000000000106313257152177026633 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/843f338e4b7b29671c9e43e987803e3ba57e72f0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/843f338e4b7b29671c9e43e987800000664000000000000000000000115413257152177026661 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@B„¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8409c2e19066ca0814d7a561a8d0881935e0568dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8409c2e19066ca0814d7a561a8d00000664000000000000000000000115413257152177026677 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/838c12f578e3ed439d7060c9d7c9650315086561qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/838c12f578e3ed439d7060c9d7c90000664000000000000000000000001113257152177027003 0ustar ÒÒÒÒÒÒ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/82d5b4733db89741107eb7aa0da1b04d11d2dd13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/82d5b4733db89741107eb7aa0da10000664000000000000000000000115413257152177027033 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8270938cf0b49b50b36846a46a04d5dedbdc1adaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/8270938cf0b49b50b36846a46a040000664000000000000000000000115413257152177026625 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw rྜ„iveMQQueue[example], thread=0¡countTexample], thread=0¡countTSw¡test message: 26¹SÀCR rྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/824895917c84b399e9f04c41ecd05e2cd0c06394qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/824895917c84b399e9f04c41ecd00000664000000000000000000000027213257152177026733 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1sÑSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/813b03ca1d55650bed24b295eb79a4e87ec884e2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/813b03ca1d55650bed24b295eb790000664000000000000000000000072313257152177027036 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`'ÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀe: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/81054ec667a71518a6fa6a2cc4ef9f30033f2004qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/81054ec667a71518a6fa6a2cc4ef0000664000000000000000000000024613257152177027125 0ustar AMQP"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/80ffdfe72b58fc02d71638ec40d2fa95b2ead66bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/80ffdfe72b58fc02d71638ec40d20000664000000000000000000000115413257152177027211 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/806a01e1d090c0c48751992b0d5b2b22d40486e9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/806a01e1d090c0c48751992b0d5b0000664000000000000000000000036713257152177026674 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=:5¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7f7f10349c764b8d20606a93a203ad3867b1cf0dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7f7f10349c764b8d20606a93a2030000664000000000000000000000000513257152177026614 0ustar :././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ee1abe5a379d54368ad94852c63ba6c4a274fe1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ee1abe5a379d54368ad94852c630000664000000000000000000000115413257152177027062 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ed1eb7ef8ac86756d42d4e313e108eb02dbf2bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ed1eb7ef8ac86756d42d4e313e10000664000000000000000000000047713257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7e9291f43778ed49df03a1958ef8323f32e2b3deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7e9291f43778ed49df03a1958ef80000664000000000000000000000000413257152177027017 0ustar ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7e51d07e16f84d001a8be4a1dedf556b3b16720cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7e51d07e16f84d001a8be4a1dedf0000664000000000000000000000101713257152177027253 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreaÿÿdSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7de84e54f0822896fc4ed96a1e633c9adf0b3572qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7de84e54f0822896fc4ed96a1e630000664000000000000000000000000313257152177027064 0ustar :!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d9cd3e6812a6b6ff56ae80aa63980890f7aee11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d9cd3e6812a6b6ff56ae80aa6390000664000000000000000000000112413257152177027215 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ 0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£-connection-for-containerDELAYED_DE3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d2391d4e0385f721734ff3ffa1c361b3925f1eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d2391d4e0385f721734ff3ffa1c0000664000000000000000000000067313257152177027056 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d0bf68cd9a063d59630b9aa24161808c7d65116qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7d0bf68cd9a063d59630b9aa24160000664000000000000000000000107113257152177027042 0ustar AMQPSÀ£x-opt-jms-destQS{À% @jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡testthread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7c31eb8db4dc730f06f17a7410f54d179765ddefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7c31eb8db4dc730f06f17a7410f50000664000000000000000000000115413257152177027116 0ustar A!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ba2a5f57f1bd5a1da00797e0447e18259d93a50qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7ba2a5f57f1bd5a1da00797e04470000664000000000000000000000063613257152177027120 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7afbdcf68acd693446e9e1bd640f1318dbe4bd0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7afbdcf68acd693446e9e1bd640f0000664000000000000000000000070313257152177027360 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1Ñ£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_rece*šrCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7a7b2719a8c26ef55eb18ad2684096c05407ba29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7a7b2719a8c26ef55eb18ad268400000664000000000000000000000027213257152177027052 0ustar AMQPSÀƒ ¡0.0.0.0@°ÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/781d4a036057532bf18a918d0e45895eaaeb206dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/781d4a036057532bf18a918d0e450000664000000000000000000000034413257152177026622 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/781b7bda814bc575307f0dfad677c8a7a349a8b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/781b7bda814bc575307f0dfad6770000664000000000000000000000115413257152177027132 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77cc3586ebf167630df4f52115c311398d2bfa48qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77cc3586ebf167630df4f52115c30000664000000000000000000000115413257152177026772 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£ms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77b071a4d5ae13ae7142ea8f60f4fc2c126921abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77b071a4d5ae13ae7142ea8f60f40000664000000000000000000000071713257152177027120 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_(ELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7786bce72e3548fcba37a97b3151346902f599bdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7786bce72e3548fcba37a97b31510000664000000000000000000000115413257152177027057 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77712a9e95bc152b12be6c00b71f3b12960782f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77712a9e95bc152b12be6c00b71f0000664000000000000000000000115413257152177027033 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[examp'e], thread=0c¡ountTSw¡test message: 26¹?SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-des|QSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77607459e4099861abb900441528d3c10a093aacqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/77607459e4099861abb9004415280000664000000000000000000000040213257152177026414 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/771f7dc6b5ecef9c668f3cf9693c6e6fff0ecb96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/771f7dc6b5ecef9c668f3cf9693c0000664000000000000000000000023613257152177027327 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7716b71e519b4e42228d991694e30f6916919f8bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7716b71e519b4e42228d991694e30000664000000000000000000000075613257152177026575 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààààààààààààààààààààààààààààààààààààààAMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXwààààààààààà0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-c·ùStÁA¡ ThreadSent¡)Proonnecti;nd././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/76ad6aa80959d9bf0d420d630cea3dc4e5529dbeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/76ad6aa80959d9bf0d420d630cea0000664000000000000000000000115413257152177027202 0ustar DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿûpleS)E@BC¸SÀCxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-desÿÿÿÿSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-xample], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀ@@¡j¡jms¸.q././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/767bc881a50241648e0d29d8b0420253b0e83be4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/767bc881a50241648e0d29d8b0420000664000000000000000000000037013257152177026624 0ustar AMQPSÀƒ ¡0.0.0®0@pÿÿPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPÿÿ`ÿÿpu0@@à1£sole-connection-for-cRpÿÿÿpÿÿt-found¡(AMQ2190Ù0: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/762d20589d74f46275761bba91ad0755d0d01e92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/762d20589d74f46275761bba91ad0000664000000000000000000000115413257152177026716 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡4.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/76081f984eb460b504d4ef2f5488add22d1bd527qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/76081f984eb460b504d4ef2f54880000664000000000000000000000004213257152177026720 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/75fa750965179115a844e10eb8c013c2cf064b20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/75fa750965179115a844e10eb8c00000664000000000000000000000115413257152177026630 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1 sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/75f116308c5f508d9969f053086eddc8b7c3228bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/75f116308c5f508d9969f053086e0000664000000000000000000000046313257152177026574 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/754b26d5351215092b23c09c606666d4ec30af2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/754b26d5351215092b23c09c60660000664000000000000000000000001513257152177026446 0ustar ÿÇb././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/754a79a33dd7226dafe69044cc6fa6a6fe2df5d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/754a79a33dd7226dafe69044cc6f0000664000000000000000000000115413257152177027136 0ustar AMQPSÀƒ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/74968d9f0c567f65b566f1f14a0deff3a4b4e35aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/74968d9f0c567f65b566f1f14a0d0000664000000000000000000000007113257152177027006 0ustar ):././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7481191b8b95bfbba9df486aa331d465d39ef3caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7481191b8b95bfbba9df486aa3310000664000000000000000000000067313257152177027135 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7384d33cf760aac3db74bacd1ed31517f4a7e92dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7384d33cf760aac3db74bacd1ed30000664000000000000000000000115413257152177027332 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSqÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7353d6910f7aba554990c6294860c7c0d2c99c06qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7353d6910f7aba554990c62948600000664000000000000000000000101613257152177026556 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/729c0a9f0a1037f3e4b1892692b4cccd8272e387qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/729c0a9f0a1037f3e4b1892692b40000664000000000000000000000026513257152177026706 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1˜sole-cjms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/725f0ec7d15d5d48e9c7975d18fac1e59a147656qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/725f0ec7d15d5d48e9c7975d18fa0000664000000000000000000000073713257152177027161 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððððððð.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0ÿÿÿÿÿÿÿÿ"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7238251db1eef6b2428fb8b04abca4460c39bd96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7238251db1eef6b2428fb8b04abc0000664000000000000000000000115413257152177027173 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·qÿ£tÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent±)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7188823a7edb1e94026e8ce24aac4673c62aa803qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/7188823a7edb1e94026e8ce24aac0000664000000000000000000000024413257152177027126 0ustar AMQPSÀƒ ¡0.0.0ms.queuY.exampŒe2555555555555555555555555555555@¡jLs.q w·St¡)@@@@@ƒXw·[QQue], thr], thr@ad= ¸nt¡)PPoducer(0ctiseMS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6351c8b7f91d3cdf0adc9fc01a834d9485091eabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6351c8b7f91d3cdf0adc9fc01a830000664000000000000000000000115413257152177027262 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @=¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6327d000faad34b05251b0fe63388bcbaa6a023bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6327d000faad34b05251b0fe63380000664000000000000000000000053313257152177026735 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queuxample@@@@@SðCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/62eb5f4a1fdfd782d1a42986cd67dd139d774dc2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/62eb5f4a1fdfd782d1a42986cd670000664000000000000000000000002413257152177027213 0ustar Û¶¶ccccccccccccccccc././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/62bff08f56df7e0adc2c2af6d79ed0d6996a7ae7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/62bff08f56df7e0adc2c2af6d79e0000664000000000000000000000115413257152177027436 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/618dc0c2ebd4b5b6e4b70d3ed95b80405b0968f4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/618dc0c2ebd4b5b6e4b70d3ed95b0000664000000000000000000000115413257152177027337 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"Sà`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6075f1c10207d079dd41f70ee5b3a04dbcc92fabqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/6075f1c10207d079dd41f70ee5b30000664000000000000000000000115413257152177026754 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@ASÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/606feaae42d51a725e610a7a30629b752ee3608cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/606feaae42d51a725e610a7a30620000664000000000000000000000000413257152177027012 0ustar AMQP././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/601ca8db18b6d6bc55d9e6a820a93edc523ad18bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/601ca8db18b6d6bc55d9e6a820a90000664000000000000000000000115413257152177027204 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message:dSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5fd55121545bb7be707943efffc0ae4868513978qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5fd55121545bb7be707943efffc00000664000000000000000000000047313257152177027134 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5faff2715588db5e3cb133a569ce24dba2dba7aaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5faff2715588db5e3cb133a569ce0000664000000000000000000000037313257152177027216 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5fa02f3d83c5c97436612fbad122ab43d0b7ecc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5fa02f3d83c5c97436612fbad1220000664000000000000000000000047213257152177027037 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroducUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5edd14faaf2058f1d24c80ec0b833c4fdaf9b1b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5edd14faaf2058f1d24c80ec0b830000664000000000000000000000115413257152177027251 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e6b33cf94de8449a3a1c014ec61b318634a25e4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e6b33cf94de8449a3a1c014ec610000664000000000000000000000027213257152177027121 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@ð1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e44b964ced89ca23090761ec9625fe7bb7fd2d2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e44b964ced89ca23090761ec9620000664000000000000000000000010013257152177026767 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÇÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶6¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e37d793eb712fbe1964500c237485cd6977a92bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e37d793eb712fbe1964500c23740000664000000000000000000000105413257152177026710 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containµrDELAYED_DELIVERY@Á3`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r Aktive^QQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e24fa5825cfa38aeb831d16874b5d3ef3b55b98qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e24fa5825cfa38aeb831d16874b0000664000000000000000000000073713257152177027136 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀÿÿÿÿÿÿÿÿ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e207ca84c26b97cd16d1d2c3881acc371bcaaa1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5e207ca84c26b97cd16d1d2c38810000664000000000000000000000102313257152177027037 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASsÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSple@sÀ% @@¡jms.queue.example@@@@@@ƒent¡)ProdS( À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5dd4e242ce8c071ac08dbff4cb47bb4245b81a24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5dd4e242ce8c071ac08dbff4cb470000664000000000000000000000115413257152177027337 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSwts¡et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5cae407f148615d45cee96c732a3478f298ea37bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5cae407f148615d45cee96c732a30000664000000000000000000000027213257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1”QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c9d977d4e248d6d7ad6c002c1f321b19c851d48qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c9d977d4e248d6d7ad6c002c1f30000664000000000000000000000115413257152177027135 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"ðSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c55e3d00c43f3ddc879f9858e990208c1875444qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c55e3d00c43f3ddc879f9858e990000664000000000000000000000000313257152177027073 0ustar #!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c4e2f7ff99c2926d1383ef2b1c5406c75591ec2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c4e2f7ff99c2926d1383ef2b1c50000664000000000000000000000027213257152177027143 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c22701b788902e1b44bcaae7133682092391aa4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c22701b788902e1b44bcaae71330000664000000000000000000000115413257152177026746 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3Vø”oduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c1afcf6651d7b5e03ef866f074895b094cd02c9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5c1afcf6651d7b5e03ef866f07480000664000000000000000000000112413257152177027136 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËËÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.amexpleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-:jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡my_receivercountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5bfcb9ac2da59adb34441593608c78dd07fcea47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5bfcb9ac2da59adb34441593608c0000664000000000000000000000000313257152177027171 0ustar A!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5beae4d7ee24205aface6d698191ea3ed7073c94qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5beae4d7ee24205aface6d6981910000664000000000000000000000113213257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀ!SrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5be71350ea282e50dc8c17c29dbddda4be856978qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5be71350ea282e50dc8c17c29dbd0000664000000000000000000000100613257152177027172 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qtest message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5b4099695250eb6b3a0f5c133fad4b3f839053f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5b4099695250eb6b3a0f5c133fad0000664000000000000000000000071513257152177027041 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5b25ef094c4817a13a972fe7ce72bdee96d89f2bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5b25ef094c4817a13a972fe7ce720000664000000000000000000000052713257152177027057 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0@p····································ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£veòsion¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/59dd50a101c7a53880bbc99ee061c824d43abe27qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/59dd50a101c7a53880bbc99ee0610000664000000000000000000000115413257152177027037 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5909466b7611e2ff604eb781aeadb209e0ddadc9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5909466b7611e2ff604eb781aead0000664000000000000000000000032513257152177027052 0ustar AMQP[Àƒ ¡0.0.0.0@pÿY@Á3£kroduct¡aÿÿÿÿÿÿÿÿpache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/58e6b3a414a1e090dfc6029add0f3555ccba127fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/58e6b3a414a1e090dfc6029add0f0000664000000000000000000000000113257152177027156 0ustar e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/58c525153cb48a457c8958e38a5b2c4fcad97abfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/58c525153cb48a457c8958e38a5b0000664000000000000000000000105713257152177026726 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PrdestQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], throducer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5781890cb133098099693a64889eed43ea819598qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5781890cb133098099693a64889e0000664000000000000000000000113413257152177026442 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5760d2e645e453cf5fedc87f78304dbb422ffa05qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5760d2e645e453cf5fedc87f78300000664000000000000000000000115413257152177027070 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-conneoit-cnfor-contaÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùöRtÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹¸SÀCC 5CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXwexampsioÀ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/56ca08a438a1e4d9cae3892e79cead6c42be6aa6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/56ca08a438a1e4d9cae3892e79ce0000664000000000000000000000114013257152177027212 0ustar AMQPSÀƒ ¡0.0.0.àààààààààÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàààctivemq-arte:mis£version¡1.5.0"SÀžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžž`RpÿÿÿpÿÿÿpÿÿAÅSÀ3£product¡£s(le-apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-des‰QSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/569d26bec1eb422e12f1d6fdacee3ba697e15220qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/569d26bec1eb422e12f1d6fdacee0000664000000000000000000000102413257152177027413 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÁA¡ ThreadSent¡t-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/55fd691c59a25808aaf0376857712f3a3d9bef1eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/55fd691c59a25808aaf0376857710000664000000000000000000000103013257152177026636 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á4£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ5 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/555f463cfd9a18ad76864d2324523bbce40e0049qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/555f463cfd9a18ad76864d2324520000664000000000000000000000050213257152177026714 0ustar AMQP0"0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:;ot-found¡(AMQ219°10: source adSÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5559250f3e07f4a4edff8a1255058e733b5ee45dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5559250f3e07f4a4edff8a1255050000664000000000000000000000001513257152177026762 0ustar AMQPÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/541d9b7069d326ce2bdcc4921492d9a0b05d2ee8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/541d9b7069d326ce2bdcc49214920000664000000000000000000000067513257152177026776 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/54143d8d68bd7fcf34fcd9320ea0c5f1f173e440qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/54143d8d68bd7fcf34fcd9320ea00000664000000000000000000000115413257152177027207 0ustar Aÿÿ¢SÀƒ ¡0.0.0.test message: 26¢¢¢¢e-connection-for-containerDELAYE®!DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ'RpÿÿÿpÿÿÿpÿÿASÀ4 %SSÿÿÿÿ÷÷÷÷÷J÷!exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jmsmy_receiverple@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(Sp'÷÷÷À_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0'÷÷÷÷÷÷÷÷÷÷÷÷J÷!oes ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/52e6f0d19f05439b545134daad44bc4610c237bfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/52e6f0d19f05439b545134daad440000664000000000000000000000103313257152177026753 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀàRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@ƒ@Xw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51ea5ed11799f7ffc832bcf2e157f09d4b20d3bcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51ea5ed11799f7ffc832bcf2e1570000664000000000000000000000071613257152177027224 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-op"-jms1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51b7ac2fd6d34ed907ebb0ceb769871bfe81af78qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51b7ac2fd6d34ed907ebb0ceb7690000664000000000000000000000031513257152177027344 0ustar AMQPSÀƒ ¡0.0.0.0@pÿY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.qu;uAMQPeexampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51ad9838a77dc730f0931ce0aca2117f3597cb1eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/51ad9838a77dc730f0931ce0aca20000664000000000000000000000000213257152177027104 0ustar :!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/519f1d13dbaf9938f638a89fa33eed9e87862009qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/519f1d13dbaf9938f638a89fa33e0000664000000000000000000000036013257152177027145 0ustar AMQP"ðSÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: soÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿurce address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5199a3576d1f6f07224fb08f3f3f4c0990c3510cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5199a3576d1f6f07224fb08f3f3f0000664000000000000000000000115413257152177027000 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-`rtemis£version¡2.5.0"SÀon-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPexample], thr`ad=0¡countTAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roduct¡apache-activemq-artemis£verion¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀSw¡8 ¡ my_test messige:receiverCBPPS(À¡ Sge: 2727nd¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DEntVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5164e583443cdef23ac7e72725576f4e518a8f69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5164e583443cdef23ac7e72725570000664000000000000000000000101613257152177026713 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/515337a1ce01f06f6cfb5342768958ade4e08743qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/515337a1ce01f06f6cfb534276890000664000000000000000000000056313257152177026711 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaAMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@à1£sPoleinerDELASÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-dRRRRRRRRRRRRRRRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampr-conte././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5089b705856f9966655cdf62ceac467804403d85qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/5089b705856f9966655cdf62ceac0000664000000000000000000000067513257152177027027 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/505484ea1bec6fd5ef92d5add6132a05ae82d417qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/505484ea1bec6fd5ef92d5add6130000664000000000000000000000115413257152177027266 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡conuTtSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.ÿÿÿÿe.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/503c7100f47e805804b5cea01fc3c62647c744e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/503c7100f47e805804b5cea01fc30000664000000000000000000000027213257152177026743 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQcer AktiveMQQueueue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4fd08ab25362fd584c37af1573ca31c73e8bda98qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4fd08ab25362fd584c37af1573ca0000664000000000000000000000112313257152177027116 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùer ActiveMQQueue[examqle], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4fb29b8d36442c9f13719b4d2b5ce7cd2164ed6cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4fb29b8d36442c9f13719b4d2b5c0000664000000000000000000000105413257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[exa-ple], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f9ebe3ea9697d2760ee07f4c4188d8e171156e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f9ebe3ea9697d2760ee07f4c4180000664000000000000000000000007313257152177027150 0ustar Aÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f8e84586737c60e21665c9ab5e524950ba54709qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f8e84586737c60e21665c9ab5e50000664000000000000000000000023713257152177026734 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f6388d751d31d2bc7dad228c58602e4b4f823fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f6388d751d31d2bc7dad228c5860000664000000000000000000000027213257152177027055 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1@SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f2068edcf829832780fcf4ffc3fc9030fcde503qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4f2068edcf829832780fcf4ffc3f0000664000000000000000000000106313257152177027231 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ,ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4eef2b29eca31ac4dcd0d32145058c57954dbe03qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4eef2b29eca31ac4dcd0d32145050000664000000000000000000000046613257152177027244 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroducest message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4eac25cdc08ad541dfaebb7c1b7f47e7a88cb0a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4eac25cdc08ad541dfaebb7c1b7f0000664000000000000000000000002613257152177027544 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4e8014b24f7249a6d110868502d36fe6602d8e73qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4e8014b24f7249a6d110868502d30000664000000000000000000000000613257152177026532 0ustar )././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4e71f9d141e291616678d0f729fda69fa5939f39qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4e71f9d141e291616678d0f729fd0000664000000000000000000000064513257152177026733 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@S)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4dead6bafe0302b854290d71976faa686db4fef5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4dead6bafe0302b854290d71976f0000664000000000000000000000115413257152177027125 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4da7a8996acce741f9632fe7b1870342aeab4dc2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4da7a8996acce741f9632fe7b1870000664000000000000000000000115413257152177027153 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CðSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4d5ca5b333d111fac332d1f80f75e1bc55d10efaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4d5ca5b333d111fac332d1f80f750000664000000000000000000000115413257152177027103 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BU¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4d24cb02d6e4a570be3093c55139ea9d4ab5c6c8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4d24cb02d6e4a570be3093c551390000664000000000000000000000043613257152177026753 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contai¸SÀCC 0CSpÀùASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue..queue.example¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4cdd04aac8e5ab17aa485f4d67f8ec71f2170322qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4cdd04aac8e5ab17aa485f4d67f80000664000000000000000000000064313257152177027347 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à.0.0@pÿÿÿÿ`ÿÿpu0@@à1£ontainerDELAYED_DELIVERY@Á3£product¡apache-activemq-aÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(e€S)E@BC¸SÀCC 0CSÀpASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)EB@C¸'SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4cdcd6f4ca8d0b3c889aee3a26d41c52679a7cbdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4cdcd6f4ca8d0b3c889aee3a26d40000664000000000000000000000071613257152177027431 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCjms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], threxample], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4bd98a1d83c5528648e2e9c4312b049a74893898qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4bd98a1d83c5528648e2e9c4312b0000664000000000000000000000104413257152177026773 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààààààààààààààààààààààààààààààààààààààààààààààààà0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4b4716215f605e640f3061f3e84e71a0183bcac2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4b4716215f605e640f3061f3e84e0000664000000000000000000000105513257152177026623 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4b2ceacc3d280ae47a5833ace04810bb71fa5904qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4b2ceacc3d280ae47a5833ace0480000664000000000000000000000067513257152177027255 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a776b933cd4f6d49b2476f31460fb5cbc56beafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a776b933cd4f6d49b2476f314600000664000000000000000000000106713257152177026722 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a73770a109eb907a4b2dd6d50e3d28282c89cf2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a73770a109eb907a4b2dd6d50e30000664000000000000000000000000613257152177027026 0ustar !:ÿú;././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a6ce72cceb629c8584f2c0599b4ad8a440dc963qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a6ce72cceb629c8584f2c0599b40000664000000000000000000000045313257152177027143 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-ar„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a2f3836ff9edc424f2097099f4f3cbcd50e399aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4a2f3836ff9edc424f2097099f4f0000664000000000000000000000115413257152177027072 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/496b5a8d0ed91bd9de2e9e63a842c7a774c2bb9eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/496b5a8d0ed91bd9de2e9e63a8420000664000000000000000000000006313257152177027221 0ustar Û¶¶ccccccccccccccccccccccÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcé¶././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/49678f763310e053c332991e4088723fce9f2992qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/49678f763310e053c332991e40880000664000000000000000000000103413257152177026421 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(àÀ¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/49625ec8842deb407b27c67c0fc578ee7e4c2d2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/49625ec8842deb407b27c67c0fc50000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/495cc796c6c7893c7ab5b70a4f29cecaa50057d4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/495cc796c6c7893c7ab5b70a4f290000664000000000000000000000071513257152177027074 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4956ec00394ffd955417be79cf0d158c9cd9be3aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4956ec00394ffd955417be79cf0d0000664000000000000000000000050313257152177027064 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/48691abb4f5db1ac03a2d6caa83e1ae4943f6325qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/48691abb4f5db1ac03a2d6caa83e0000664000000000000000000000115413257152177027324 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`€RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/483ec2ae8306bc9b5249f88e6f8b6407e91b43eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/483ec2ae8306bc9b5249f88e6f8b0000664000000000000000000000115413257152177027151 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis”version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/48108044f33758e0fa1e10f9c3b33acce8077ffdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/48108044f33758e0fa1e10f9c3b30000664000000000000000000000071513257152177026700 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/480b6a234fe47a1263da086dbbae1fd08b618425qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/480b6a234fe47a1263da086dbbae0000664000000000000000000000115413257152177027166 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁAdSent¡)Producer ActiveMQQueue[example], thread=0¡ countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ÁktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47ecc0ec86499db8ee6bb327a12be21605144926qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47ecc0ec86499db8ee6bb327a12b0000664000000000000000000000037213257152177027273 0ustar AMQPÿÿÿÿÿÿÿÿ¡0.0.0.0D_DELIVEÒY@Á3£product¡apache-activemq-artemis£version¡1.5.0QPÿÿÿÿÿÿÿÿ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@À ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ474868: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47bcdc5d34fc13c4a787bfdef3bb6d0ff7301795qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47bcdc5d34fc13c4a787bfdef3bb0000664000000000000000000000027213257152177027504 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47814d190d5cf71b4047e8df440a2990470796b6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/47814d190d5cf71b4047e8df440a0000664000000000000000000000115413257152177026765 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/469d7276214218cc60765d72b0dc66b058a93ca6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/469d7276214218cc60765d72b0dc0000664000000000000000000000115413257152177026627 0ustar AMQPSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-o ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/464bf6d11aa61053a34786d5b0ddb429d5f8b8f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/464bf6d11aa61053a34786d5b0dd0000664000000000000000000000036113257152177027026 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpzÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4630614b8a0acbd6cf5b821713659542e9f04b9bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4630614b8a0acbd6cf5b821713650000664000000000000000000000115413257152177026750 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-acthvemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS!À4 ¡ my_r!!!eceion¡2.5ÕÏÿÿÿÝýÿSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@À ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source addreùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£pt-jms-destQSsÀ% @@¡jms.queue.example@@@-containerDELAYED_DEÿÿÿx././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/45cc928ada35e887c951232bf334461eac25bbd2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/45cc928ada35e887c951232bf3340000664000000000000000000000115413257152177026773 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/453342523a299d6b91e3b14f620d9b8c55faba0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/453342523a299d6b91e3b14f620d0000664000000000000000000000115413257152177026617 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/44ef8add55e4b3df5cf6269bd80765c370ca758eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/44ef8add55e4b3df5cf6269bd8070000664000000000000000000000062113257152177027302 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ*x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/449be02162e08de28c1e41467616971b01f0aa14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/449be02162e08de28c1e414676160000664000000000000000000000067413257152177026631 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC`þϼSpÀA£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4345cb1fa27885a8fbfe7c0c830a592cc76a552bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4345cb1fa27885a8fbfe7c0c830a0000664000000000000000000000000113257152177027172 0ustar %././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/433cab8f964757a924d329d8efbc53a01dfd2a6dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/433cab8f964757a924d329d8efbc0000664000000000000000000000115413257152177027146 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£von¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·tAÁùS¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹ms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=1¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-dessage: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/431ea47a529bf2319941f9931d5f487f5bc7e0c4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/431ea47a529bf2319941f9931d5f0000664000000000000000000000027213257152177026716 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/43198310aa2a1a154460dffac82841e2daa65d23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/43198310aa2a1a154460dffac8280000664000000000000000000000063313257152177026743 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ))S@ãõŠœœ ades not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42ef33b99f4d09d7b9eac8eb198fddba2f8c4c2fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42ef33b99f4d09d7b9eac8eb198f0000664000000000000000000000115413257152177027314 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaAMQPSÀƒ ¡0.0.0.'7AMQ@pÿÿÿÿ`ÿÿpu0@@1às£PoleinerDELAYED_DELIVERY@Á3£pr-connoduct¡apache-ectactivemq-artemi address does not exisitÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroSÀƒ ¡0..0.00@pÿÿÿÿ`ÿÿpu0@@à1£sole-coemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀA­>ìý\ñx-opt-jms-dRRRRRRRRRRRRRrRRRRRRRRRRRRReiCBPPS(À¡jms.queuAMQPe.exampr-conte././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42d7857bc5b53c04ed26977c77c1b0061856e77cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42d7857bc5b53c04ed26977c77c10000664000000000000000000000115413257152177027001 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reAceiverCBPPS(À¡jMQPms.DDDDDDDDDDDDDDDDDDDDDDDDÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSrÁcer AktiveMQQueue[eÿÿÿÿ`ÿÿsu0@@à1@SsÀ% @@¡jms.queue.pi././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42a83b5231fb00c0eb2ebc58deaaaa1897e8be14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/42a83b5231fb00c0eb2ebc58deaa0000664000000000000000000000037613257152177027316 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/428d5fec5c313c1a2210357617ae884dfdad12c4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/428d5fec5c313c1a2210357617ae0000664000000000000000000000061713257152177026750 0ustar AMQPS ¡ƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectiÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿon-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÿÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4231fed9c734acb4701d0b1a36e41ba090bf6ddbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4231fed9c734acb4701d0b1a36e40000664000000000000000000000106013257152177027077 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40e345c2f053e4d8491cd155c46a57caf3131daaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40e345c2f053e4d8491cd155c46a0000664000000000000000000000050213257152177026753 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40bc3600abe5d4e0711d7c9a17123009eff33e5cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40bc3600abe5d4e0711d7c9a17120000664000000000000000000000002713257152177027012 0ustar Û¶¶ccccccccccccccccccéö././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4051a924cb36158a56b79d382cb4e4f0813a5b36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/4051a924cb36158a56b79d382cb40000664000000000000000000000062513257152177026704 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.;xampleS)E@BC¸SÀCC 0CSpÀA@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40449c9d2a42e5cd173fd4403de5cdcd530f7f51qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/40449c9d2a42e5cd173fd4403de50000664000000000000000000000034413257152177027041 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cojnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3fc25eecc74fcd77d0a91dcd071ae0173d880a85qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3fc25eecc74fcd77d0a91dcd071a0000664000000000000000000000115413257152177027420 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3ecf2f634537213ac63d7725a4f4527077f7e39bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3ecf2f634537213ac63d7725a4f40000664000000000000000000000101613257152177026761 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqpÚn0@@à1£sole-connection-for-containerDELAYED_DELIVSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.).0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3ea7a08c4dbe4db94e9434a8db61222f66e28e51qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3ea7a08c4dbe4db94e9434a8db610000664000000000000000000000106113257152177027262 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3e492a6f3ece660703fc67e31d3594639ed45e02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3e492a6f3ece660703fc67e31d350000664000000000000000000000015713257152177027053 0ustar AMQPSÀƒ ¡0.0.0.7@p!:ÿÿÿÿ`ÿAMQPMMÿÿÿÿhhÿÿÿ)ÿpu0@@à1£sole-âconnectioÿn-for-cÿo././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3e1c654efd93958b1d82d4e88b7a890e48d34f0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3e1c654efd93958b1d82d4e88b7a0000664000000000000000000000055213257152177027151 0ustar AMQPSÀƒ ¡0.0.0.)@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3dd2d0c2eaf43a79df50b5d70f4d68c378f6d93cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3dd2d0c2eaf43a79df50b5d70f4d0000664000000000000000000000031413257152177027332 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPSÀƒ ¡0.0.0."0SÀ`iver@././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3dc6cb27227793d1d6573c2b0e464b742cdb6ea5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3dc6cb27227793d1d6573c2b0e460000664000000000000000000000027213257152177026764 0ustar AMQPSÀƒ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3d3a7a0f37d4aa81fb0f98a712748fb0b5ffa3ccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3d3a7a0f37d4aa81fb0f98a712740000664000000000000000000000052313257152177027116 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààààààààààààààààà.0"SÀ`Rpÿÿÿpÿÿÿp;ÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSp.0.0.0@pÿÿÿÿ`ÿÿsS my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC Á0p.S(À¡jms.queue.exampleS)E@BC¸SÀCC Á0p.././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3d087dbbf966839a2300a2d588c119a468fe3eecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3d087dbbf966839a2300a2d588c10000664000000000000000000000115413257152177026767 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿESÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3c5f46b0abf04d6fea404aec161c3d8e45844d94qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3c5f46b0abf04d6fea404aec161c0000664000000000000000000000115413257152177027320 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3bea2eb508ab377df64b6737635a140b4b8f2df4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3bea2eb508ab377df64b6737635a0000664000000000000000000000000413257152177027116 0ustar )././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3be266244612f41540fc387e145669cc7df1d6a2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3be266244612f41540fc387e14560000664000000000000000000000112713257152177026543 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ%@¡jms.queue.example@sÀ% @@¡jms.queue.examÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3bbea5f9987037137a757058d28b0b9b4445ea69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3bbea5f9987037137a757058d28b0000664000000000000000000000065213257152177026725 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-s.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 0CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3af65757895550d858387e0e9d3a0e61e088cfd3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3af65757895550d858387e0e9d3a0000664000000000000000000000034213257152177026660 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3a00af7e932141ed91e5f9021411be4b1e90886dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3a00af7e932141ed91e5f90214110000664000000000000000000000115413257152177026664 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my^receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ Threaroducer ActiveMQQueue[example], thread=0¡countTSwts—et message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/395a895a3e2e66675351e372760c762d52507ca2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/395a895a3e2e66675351e372760c0000664000000000000000000000046313257152177026566 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£productapache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/395496a9bceaef26949bf6d4a325a9a6710a7d1bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/395496a9bceaef26949bf6d4a3250000664000000000000000000000046313257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3950e5bafadd9de9a33defb1f1a1e0b1049b2d92qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3950e5bafadd9de9a33defb1f1a10000664000000000000000000000006313257152177027474 0ustar AMQPMMÿÿÿÿÿÿÿhh)QPMMÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/394101928f21e83298a437500dbfd1a2ff6947e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/394101928f21e83298a437500dbf0000664000000000000000000000063513257152177026550 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ED_DELIVERY@Á3£product¡apache-tivemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-tivemq-artemis£version¡1.5.0"SÀZRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219011: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3922e1988e08fdf9b6268f2e8c54c1f41c243349qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3922e1988e08fdf9b6268f2e8c540000664000000000000000000000046313257152177027024 0ustar AÿÿÿÿÿÿÿÿSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(0: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/39152eaba4994d35d774b06714c7d44a6a6d0a20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/39152eaba4994d35d774b06714c70000664000000000000000000000053113257152177026711 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ438020:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3837fc49467285923fb03bba6896a467ce2bcda8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3837fc49467285923fb03bba68960000664000000000000000000000115413257152177026652 0ustar AMQPSÀƒ ¡0.AMQP0.0.7@pSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-ÿconnection-for-containerDELAYEqueue.exaÿÿmple@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)ÿ`ÿÿpP;roduceru0 A@r ActiveMQQ-destQSsÀ% @@¡¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrx£Á-opt-jms-destQSsÀ% @pÿÿÿce address does pÿÿASÀ3 ¡ my_receiverCBPPnotS(À exi¡jms.queue.exampleSÿpÿÿASÀ8 ¡ my_receiverCBPPS(0@pÿjms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÿpu0@%././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/37eef25971d6fadd1fcf7bf66ebc9ab25c01dce2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/37eef25971d6fadd1fcf7bf66ebc0000664000000000000000000000115413257152177027524 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/37744715487ef57e01dfc0f967c8e9afb5662d2bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/37744715487ef57e01dfc0f967c80000664000000000000000000000101413257152177026731 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ%@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/374c5c7ca9aaf73459a383bf1740cf261264f323qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/374c5c7ca9aaf73459a383bf17400000664000000000000000000000115413257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Active]QQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/36e9ec95d8dac3dea4b684e2704ed9ef3aba41adqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/36e9ec95d8dac3dea4b684e2704e0000664000000000000000000000056713257152177027310 0ustar AMQPSÀƒ ¡0.0.0.0EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE@pÿÿÿÿ`ÿÿpu0@@à1£sole-pu0@@à1£sole-connection-for-contconnection-for-contai¸SÀCC 0CSpÀùASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue..queue.example¸SÀCC 1CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3683991900e31967c47c39544d18a25505b97d1bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3683991900e31967c47c39544d180000664000000000000000000000026513257152177026434 0ustar AMQPSRpÿzzzzzzzzzzzzzzzzzzzÿÿÿpÿÿ)SÀ ¡ my_receÿÿiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/366088a1246029d7538dc8e8285c0fb0609a69caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/366088a1246029d7538dc8e8285c0000664000000000000000000000067513257152177026574 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/364c01159f8e30db18be2c350b6fbad0424f62ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/364c01159f8e30db18be2c350b6f0000664000000000000000000000115413257152177027033 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrx£Á-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡tes tmessage: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/359b1e9a4c8e1c5807305fb520f18ca6b7e0bfffqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/359b1e9a4c8e1c5807305fb520f10000664000000000000000000000012513257152177026756 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/356fbc45f3e309def9c86336743d8385c215e670qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/356fbc45f3e309def9c86336743d0000664000000000000000000000046313257152177027071 0ustar AMQPSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/355a9d0bd3498d3d659428cc623ff93174890a23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/355a9d0bd3498d3d659428cc623f0000664000000000000000000000067313257152177027006 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/351d276e353979ba3a95ee0749edbb09c8532008qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/351d276e353979ba3a95ee0749ed0000664000000000000000000000004113257152177026777 0ustar ÷!%././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/34e711078e6910760423bed5345df884d23e5d42qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/34e711078e6910760423bed5345d0000664000000000000000000000115413257152177026543 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ mi_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33f09ccf4e852bdc0f136396be2a5babfea2715fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33f09ccf4e852bdc0f136396be2a0000664000000000000000000000027213257152177027202 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33dcbf48bafc7b18357bf4ca37483844086c287bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33dcbf48bafc7b18357bf4ca37480000664000000000000000000000001513257152177027263 0ustar ÿÇb÷././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33d517435218019697eadc7871b9a7723584c305qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/33d517435218019697eadc7871b90000664000000000000000000000046313257152177026563 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectoni-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/331265001c901c5b1486773e473ba87f4d6a7fdbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/331265001c901c5b1486773e473b0000664000000000000000000000115413257152177026451 0ustar AMQPSÀƒ ¡1.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 1CPpÀÁrAS£x-opt-jms-destQUsÀ% @@¡jms.queue.example@@@@@@0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktivuQueeeQM[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32ca2509c6f5c5cd09cb2a69734aabc25252c5e7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32ca2509c6f5c5cd09cb2a69734a0000664000000000000000000000006313257152177027115 0ustar •••••••••••••••••••••:••••••••••••••••YYYY•••••••!!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32916497d93cb19b3001b2b6b6d6605587040b79qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32916497d93cb19b3001b2b6b6d60000664000000000000000000000067013257152177026702 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£ve*sion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_ÿÿÿprecei././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/325f9c674fca2b85d133f7d3549dda0b8d33f43eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/325f9c674fca2b85d133f7d3549d0000664000000000000000000000027213257152177027061 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1TQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32174c7f369d05e3e3d3d6475ad95b6e7bc3d61bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32174c7f369d05e3e3d3d6475ad90000664000000000000000000000027213257152177026777 0ustar AMQPS@ƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32173a54975a37fb7c6af462a44bf52f87e2c6a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/32173a54975a37fb7c6af462a44b0000664000000000000000000000027213257152177026764 0ustar AMQP¡SÀƒ 0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jmsmy_receiverple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[ex*mple], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/31cd898efbb293f81faf4136faadc6c827045184qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/31cd898efbb293f81faf4136faad0000664000000000000000000000115413257152177027353 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@£Xw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3179fb6403a421dc479682a6a2c5c9f43417363eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3179fb6403a421dc479682a6a2c50000664000000000000000000000050113257152177026675 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3138535fee6e745574dae15412f9c5f4378f76aaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/3138535fee6e745574dae15412f90000664000000000000000000000115413257152177026721 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30dbdb9bc6b427d2708fa7b7ecb42a37d7e9ff5aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30dbdb9bc6b427d2708fa7b7ecb40000664000000000000000000000001213257152177027330 0ustar  õÇ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30a71225c7843d15a0869f112e1499624eeee9fbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30a71225c7843d15a0869f112e140000664000000000000000000000115413257152177026530 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3okr£duct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30556cb86eada2ccc31ba45091679496eb60273aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/30556cb86eada2ccc31ba45091670000664000000000000000000000027213257152177027107 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f9daf5c887242382661b27a96f0a4be1bb03267qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f9daf5c887242382661b27a96f00000664000000000000000000000033513257152177026722 0ustar AMQP"ðSÀ`Rpÿÿÿpÿÿÿp;ÿÿ)SÀ ¡ memq-artemis£versioÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿurce address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f8b5b77b890fd7dbcf5af38c20fb07248d13c7cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f8b5b77b890fd7dbcf5af38c20f0000664000000000000000000000000713257152177027354 0ustar AMQP././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f3465f0b22aff52623d71542efcaef33cb8fdb3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f3465f0b22aff52623d71542efc0000664000000000000000000000000513257152177027030 0ustar ×ÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f2d0977ef662f93a18485f45b7159981f77270dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2f2d0977ef662f93a18485f45b710000664000000000000000000000115413257152177026730 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀÿÿÿÿÿÿÿÿ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jQs-mtsdeSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ef999a20722f105d30afe0a780edc7603a8f1aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ef999a20722f105d30afe0a780e0000664000000000000000000000115413257152177027036 0ustar Aÿÿ¢SÀƒ ¡0.0.0.test message: 26¢¢¢¢e-connection-for-containerDELAYE®!DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ'RpÿÿÿpÿÿÿpÿÿASÀ4 %SSÿÿÿÿ÷÷÷÷÷J÷!exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR %SSÿÿÿÿ÷÷÷÷÷J÷!pache-activemq-artemis£version¡1.5.0'÷÷÷÷÷÷÷÷÷÷÷÷J÷!oes ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2e34afd9280a43722b9c38f51cd4c4d40c31446fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2e34afd9280a43722b9c38f51cd40000664000000000000000000000110713257152177027041 0ustar AMQPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test SsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[exa-ple], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2d6a717d7e59b60bfd1aae429aac2dbe25f5b0e9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2d6a717d7e59b60bfd1aae429aac0000664000000000000000000000055213257152177027337 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis], thread=1¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampS0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ce64d50a32e3e72bfdbdf3519ec47f1d50ee816qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ce64d50a32e3e72bfdbdf3519ec0000664000000000000000000000060113257152177027333 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡3.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.que£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ca11cc6cf955d9f0adc64f2282ab92d996932deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2ca11cc6cf955d9f0adc64f2282a0000664000000000000000000000103313257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@ƒ@Xw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2bb32c7068539de6d2f01aa4605de77aaf1ae23fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2bb32c7068539de6d2f01aa4605d0000664000000000000000000000054313257152177027032 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ersion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£ @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2b94ac785c30568107005a04a561ca3b67f426a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2b94ac785c30568107005a04a5610000664000000000000000000000067613257152177026535 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCàPC0pÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2b511e040b4dce5dce1520e20273f1c4eaab69feqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2b511e040b4dce5dce1520e202730000664000000000000000000000004213257152177027001 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2a867d72da38106495b8d28ea749da3e108d5165qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2a867d72da38106495b8d28ea7490000664000000000000000000000115413257152177026724 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀ@ÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messAge: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 2s././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/29a6b1fdcc2cf2fd8ca4a37f8d232494443f25abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/29a6b1fdcc2cf2fd8ca4a37f8d230000664000000000000000000000115413257152177027422 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example!@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messAge: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@‚Xw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/29475bf54bd89b2b77f7fa3d8cb102a4ff650698qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/29475bf54bd89b2b77f7fa3d8cb10000664000000000000000000000115413257152177027224 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQP1£soÿÿn¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol)SÀ ¡ my_rec`iverCBPP@S)E@BCPP@S)E@BCPSÀCCASÀ;£amPCASÀ;£amqp:not-found¡(AMQ219010:qp:not-found¡(AMQ219010: source address d source addresoes s does nontot exis etxist6¹SÀCR:¡(AMQ219010: source addQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActivrerAMQPÿÿÿÿx././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2919cc28e6b742bb9fc6b5f0855ddd52b484f3daqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2919cc28e6b742bb9fc6b5f0855d0000664000000000000000000000115413257152177027142 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿ`ÿÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2866f87450387f037bf3e5b3a1b198a91612cfc0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2866f87450387f037bf3e5b3a1b10000664000000000000000000000027213257152177026711 0ustar AMQPÁA¡ ThreadSent¡pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27f7cf431ee2a08aa692a89bbf2067179a955001qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27f7cf431ee2a08aa692a89bbf200000664000000000000000000000115413257152177027201 0ustar AMQPSÀDDDDDDDDDDDDDDDDDDDDDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.ƒ ¡:.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÿÿÁ£x-opt-jms-destQSsÀ% s¡m@e.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27f67e3c9780f6b750347d6165f93131291bb177qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27f67e3c9780f6b750347d6165f90000664000000000000000000000001513257152177026653 0ustar AMQPÿhh)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27a7a6fc64aae9cd5996fad0ac0dc84a4585a848qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/27a7a6fc64aae9cd5996fad0ac0d0000664000000000000000000000115413257152177027426 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2786f0f8f0527ebd0dffd5d802c0c177af2e3f0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2786f0f8f0527ebd0dffd5d802c00000664000000000000000000000056713257152177027217 0ustar AMQP#SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVEAMQPSÀƒ ¡0.0.0.0@pÿþRY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0ÿÿ`ÿÿpu0@@à1£sole;connection-for-c"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPontainerDELAS(ÀYED_jms.queue.exaDELIVERY@Á3£kroduct¡apache-ampleSctivemq././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/276818e5ef2ec29ca54fa54222ca2606675e6c67qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/276818e5ef2ec29ca54fa54222ca0000664000000000000000000000115413257152177027125 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBpPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/274d4a19d3ea853a241799a47428c495b8e025f5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/274d4a19d3ea853a241799a474280000664000000000000000000000053413257152177026635 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerSÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ%@@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/270f2f22a92e7f99c4a74d2d6ef5afc57611b199qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/270f2f22a92e7f99c4a74d2d6ef50000664000000000000000000000002213257152177027133 0ustar ¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/270dd12099f51009be69d43068fdb4870f5fc9cfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/270dd12099f51009be69d43068fd0000664000000000000000000000073013257152177026707 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSÀpASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/26836232642560abf878f5fcb2ef79f5f54c13beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/26836232642560abf878f5fcb2ef0000664000000000000000000000113413257152177026774 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@B@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁQtSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2595790f0441332ffb7f4e396cf758cc59f9a7ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2595790f0441332ffb7f4e396cf70000664000000000000000000000027213257152177026726 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à@@@@@ƒXw·Sms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/25850ea9e2872d456a968a4c9ddce2e32a7307c6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/25850ea9e2872d456a968a4c9ddc0000664000000000000000000000027213257152177027066 0ustar AMQPSÀƒ ¡0.0.0.0@p`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/24d9e09787bdc9724edb95044965cc00c58fa80fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/24d9e09787bdc9724edb950449650000664000000000000000000000047213257152177026741 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpƒƒƒƒƒƒƒƒƒu0@@à1£sole-connecñion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/24d82a095f84016d1ecd5c2c5c5d211f0ae8be31qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/24d82a095f84016d1ecd5c2c5c5d0000664000000000000000000000000713257152177027113 0ustar AMQPA././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2493e0dcff1b2912b45c8a440610e163433a22e4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2493e0dcff1b2912b45c8a4406100000664000000000000000000000033613257152177026746 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jms.queue.exaSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jms.queue.exaample@@@@ue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/246609ce4c53d6febd7cdddd052c4a3969e7397dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/246609ce4c53d6febd7cdddd052c0000664000000000000000000000115413257152177027345 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.examp@@@le@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23dc1d263dd6f67f4a2e5794ba076dcd5716d04cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23dc1d263dd6f67f4a2e5794ba070000664000000000000000000000027213257152177027126 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1€QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23db1ff1d0e76da36f427744c3c9aa56d33510c5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23db1ff1d0e76da36f427744c3c90000664000000000000000000000115413257152177027125 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qmy_receivere@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSu¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23cd1ad634d8cae4ccce264ce8425e1114730976qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/23cd1ad634d8cae4ccce264ce8420000664000000000000000000000114513257152177027334 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸ache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCCSÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/238fe0feaf0a09e3bc3e02b2c53830ccec51e792qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/238fe0feaf0a09e3bc3e02b2c5380000664000000000000000000000044613257152177027251 0ustar AMQPSÀƒ ¡0.0.TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-co:ntainerDELAYED_DELIVERY@Á3£p^roduct¡apache-activemq,artemis£versiod¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/238bf6f1552ab7559610819331de5b57335afbc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/238bf6f1552ab7559610819331de0000664000000000000000000000102713257152177026627 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/232ec22d04d14b6e0269d3a5d7757fa8c78b66a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/232ec22d04d14b6e0269d3a5d7750000664000000000000000000000106513257152177026753 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1àsole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ ìmy_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/229ff3519daf0d8d408b548b9078d183408f63e2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/229ff3519daf0d8d408b548b90780000664000000000000000000000035713257152177027007 0ustar IMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version!¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receivurce address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/22341913808d5dbac0fea9042e1d798d717d2fe0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/22341913808d5dbac0fea9042e1d0000664000000000000000000000031513257152177027023 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-aŽemis£version¡1.5.0AMQPSÀƒ ¡0.0.0."0SÀ`iver@././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2201e36cc483037b88bda3285b2277c64c6f96a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2201e36cc483037b88bda3285b220000664000000000000000000000010013257152177026655 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21e7fee18011f5553e8e5eccf26b9d794a0ecd1dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21e7fee18011f5553e8e5eccf26b0000664000000000000000000000106313257152177027207 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-deSsQtsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21d50bc41b61f3a52903231924d19c7f1f32b49aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21d50bc41b61f3a52903231924d10000664000000000000000000000104713257152177026573 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERYÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/214d03825c57550a88a73197d3fe43170d40d4ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/214d03825c57550a88a73197d3fe0000664000000000000000000000062413257152177026632 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1ÿÿAÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`ÿÿpRÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡t)st mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/210b45b3d7f7489cefaf56723413021a42c608e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/210b45b3d7f7489cefaf567234130000664000000000000000000000010013257152177026756 0ustar ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21084aa2a03248b99a6fdfb00e38b22e890c34f1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/21084aa2a03248b99a6fdfb00e380000664000000000000000000000115413257152177027026 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ my_rec`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/20960b7fa364202d7dc694ef08718598309b7677qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/20960b7fa364202d7dc694ef08710000664000000000000000000000115413257152177026706 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£Žx-opt-jms-destQS% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2077b9cf47cbf148f8a91ad579e2aece847f2b11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2077b9cf47cbf148f8a91ad579e20000664000000000000000000000046313257152177027147 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2010bec8c1d619922a69f38de954c8dddb9a1cc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/2010bec8c1d619922a69f38de9540000664000000000000000000000005613257152177026772 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶¶¶¶¶ÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1ff7ede9f596e5ba7705b7d6e64d05fdf02b85f1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1ff7ede9f596e5ba7705b7d6e64d0000664000000000000000000000067513257152177027326 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà5CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1f938692425000dcd1ada294e2567d032a675840qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1f938692425000dcd1ada294e2560000664000000000000000000000115413257152177026676 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(ð¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1f2e9891f5db8f90e6744ff1cd0c5f7aa2f69314qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1f2e9891f5db8f90e6744ff1cd0c0000664000000000000000000000067613257152177027236 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_rece*šrCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1eacc46ab4f91a9a17a62972a8076c12529de86fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1eacc46ab4f91a9a17a62972a8070000664000000000000000000000004513257152177027116 0ustar Çÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1e958a931a9462315b723f2668b7c1555ecd300dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1e958a931a9462315b723f2668b70000664000000000000000000000027213257152177026560 0ustar AMQP$SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1d40874ec801c552d8f66dd8ad0f2d0b3de0a24bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1d40874ec801c552d8f66dd8ad0f0000664000000000000000000000062013257152177027126 0ustar AMQPSÀƒ ¡0.0.0.0@pÿrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contai¸SÀCC 0CSpÀùASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·;StÁA¡ ThreadSent¡)ProdS(À¡jms.queue..queue.exampleÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1d0d3759093e5882f55e5313f1ddd0b8b59256a5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1d0d3759093e5882f55e5313f1dd0000664000000000000000000000102413257152177026711 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÐCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1cdb00f5afc4a65f8118f080693ba358a0203e09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1cdb00f5afc4a65f8118f080693b0000664000000000000000000000041413257152177027113 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1c7a1bb547e0275c767a3ae00d7d46d6d7aa4013qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1c7a1bb547e0275c767a3ae00d7d0000664000000000000000000000013613257152177027107 0ustar AMQPÀÁt¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpƒleS)././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1bd1eae1b600707902a6e0c27624db8812ead955qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1bd1eae1b600707902a6e0c276240000664000000000000000000000070113257152177026732 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1„„„…„„„„„„„„„„„„„„„AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqmrea-tis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conn„„„„„„„„„AMQPe././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1bbc6bacd0518951bd23a6df26670f109c7d2502qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1bbc6bacd0518951bd23a6df26670000664000000000000000000000115413257152177027172 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@àl;connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1af93631e9018492244e7f4baae02cf838e67d12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1af93631e9018492244e7f4baae00000664000000000000000000000115413257152177026761 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSsÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStAÁ¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1ad42edc08f4a412489079d4ec404807c9b0bebbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1ad42edc08f4a412489079d4ec400000664000000000000000000000060113257152177027033 0ustar AMQPstQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[exmlape,] thread=0¡countTSw¡Sent¡)Producer AktiveMQQueue[example], thread=0¡countTtest message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1abfc78d5ef96abaf96951770b92af717d47b003qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1abfc78d5ef96abaf96951770b920000664000000000000000000000027213257152177027226 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ProdSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1a77a184d45ca870c28dcec3a328b18e9951c0c0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1a77a184d45ca870c28dcec3a3280000664000000000000000000000115413257152177027117 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/18bbbbad00e9f831cf6dbd78241e9cd6cbfee01bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/18bbbbad00e9f831cf6dbd78241e0000664000000000000000000000010013257152177027324 0ustar SSSSSSSSSS!ÿÿÿÿÿÿÿ¢¢¢¢¢¢¢ÿÿÿÿÿÿÿÿÿÿ!ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿÿÿÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/184301cd4188125ee1191ff3b5a3bd3224bc0a66qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/184301cd4188125ee1191ff3b5a30000664000000000000000000000106213257152177026667 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/17e5d22a48b1c712cf7157a83ff0bb7cb3d1aa1fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/17e5d22a48b1c712cf7157a83ff00000664000000000000000000000027213257152177027040 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1SQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/179f52d65804f6052e2327e3ffead71fc3d4f738qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/179f52d65804f6052e2327e3ffea0000664000000000000000000000076013257152177026777 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/173aa840b1d24c516553f4a4a7a21d9f98011c57qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/173aa840b1d24c516553f4a4a7a20000664000000000000000000000115413257152177026740 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15fbd7b5e421c7a194b6cffad1be6d069c5e5c04qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15fbd7b5e421c7a194b6cffad1be0000664000000000000000000000115413257152177027415 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀÿÿÿÿÿÿÿÿ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer Ac£x-opt-jQs-mtsdeSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15dc85e8ed51568d7138cbb2b540a1722648c00aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15dc85e8ed51568d7138cbb2b5400000664000000000000000000000046313257152177027052 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15c3a94be91762b8b428e798f951d34055dabe2eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15c3a94be91762b8b428e798f9510000664000000000000000000000005413257152177026730 0ustar •••••••••••••••••™•••••••••••••••••••••••••././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15b20832e701fd35249392a69e14d1549a63cf58qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15b20832e701fd35249392a69e140000664000000000000000000000115413257152177026541 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15abe548a5036510add101152d8a7e871dbede72qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/15abe548a5036510add101152d8a0000664000000000000000000000006213257152177026725 0ustar )ÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚ:././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1517c410bd6e1c133c5230020a3c40caba98955eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1517c410bd6e1c133c5230020a3c0000664000000000000000000000073613257152177026641 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer AAMQPÀÁctiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR t¡1CSpÀ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14a0bc9eac7978e4a194859e1ba0a134e00d023aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14a0bc9eac7978e4a194859e1ba00000664000000000000000000000115413257152177027127 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14633c79014ef5d9dd28200f179676cf1eb45cfbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14633c79014ef5d9dd28200f17960000664000000000000000000000115413257152177026633 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-contaÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùöRtÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹¸SÀCC 5CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXwexampsioÀ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14018a8c49decad8e826e5ad487b8757b7989928qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14018a8c49decad8e826e5ad487b0000664000000000000000000000053113257152177027213 0ustar AMQPS SƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product*apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ438020:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14008b0efb5c9de55390c6769496698352e7064eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/14008b0efb5c9de55390c67694960000664000000000000000000000010013257152177026710 0ustar AMMMMMÿÿÿÿÿÿèÿhhhhhhhhhhhhhhhhhhhhhhhhhhÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)ÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/13cf282005ab8f9ef3d73801ef99a3b5d03bba53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/13cf282005ab8f9ef3d73801ef990000664000000000000000000000101013257152177027045 0ustar AMQPSÀƒ ¡ivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/13398238ec8b0d1356dc6400ffd97905c2ebf6c0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/13398238ec8b0d1356dc6400ffd90000664000000000000000000000065013257152177026770 0ustar ÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source ¡apache-activemq-a ActivePSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cÿonnection-for-containÿerDELAYED_DELIVERY@Á3AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡£product¡apache-activemq-artemis£version¡1.a5.0"p././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12f2c89bcc4949e4638a2e9e4dda12405bf0fabaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12f2c89bcc4949e4638a2e9e4dda0000664000000000000000000000115413257152177027222 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSencer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12e92535e8246ba5f83446fb166b7ec1c46a7e47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12e92535e8246ba5f83446fb166b0000664000000000000000000000115413257152177026713 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0S(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12b1860ae7a93d9bb86bbec6d80c09467fcf52e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/12b1860ae7a93d9bb86bbec6d80c0000664000000000000000000000115413257152177027262 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_>ELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡3.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/126783a0aca87289d23441ddba5e00ebb178f000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/126783a0aca87289d23441ddba5e0000664000000000000000000000033613257152177027037 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jms.queue.exaample@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/116006a72598e77e67a895e6cfc30223ad8b255eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/116006a72598e77e67a895e6cfc30000664000000000000000000000027213257152177026730 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ÿ€QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/10a716842a57ec0999cabcde6b84e6561006ec90qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/10a716842a57ec0999cabcde6b840000664000000000000000000000046313257152177027132 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3rdo£puct¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1004216e34b9573b85ed3bfdb73d693dbbe75000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/1004216e34b9573b85ed3bfdb73d0000664000000000000000000000067313257152177027044 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0e0d569f4d9172d85d9d4ae5fecf0c318507e2beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0e0d569f4d9172d85d9d4ae5fecf0000664000000000000000000000115413257152177027307 0ustar AMQPSÀƒ ¡1.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQUsÀ% @@¡jms.queue.example@@@@@@0"S`ÀRpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktivuQueeeQM[example], thread=0¡countTSw¡ŒšŒ‹ß’šƒasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0dbbfa0675c875cd7751b0f70d93fcd84422816aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0dbbfa0675c875cd7751b0f70d930000664000000000000000000000004213257152177027121 0ustar AMQPMMÿÿÿÿhhÿÿÿ)âÿÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0d61500d328a260f40e5ef1ad2b5bc22d4883f65qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0d61500d328a260f40e5ef1ad2b50000664000000000000000000000046413257152177027017 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apach:e-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0c7c14123fb0f333c85844c1597fd741d3828d40qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0c7c14123fb0f333c85844c1597f0000664000000000000000000000115413257152177026702 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààAMQPctivemq-artemiuct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.examexampleƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡te`@¡jms.quÿÁ£veMeeuQQu[example],ms-destQ`SpÀQu././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0c4ab17c8269502b22047bf73e9f3745964abeccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0c4ab17c8269502b22047bf73e9f0000664000000000000000000000073413257152177026763 0ustar AMQPSÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQS{À% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSApÀSrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x)opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0ba98237bfd777f3b9c0a5aa6895a248d0a959b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0ba98237bfd777f3b9c0a5aa68950000664000000000000000000000046313257152177027142 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-fQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b73f98d0b2d236b49c57b5aec3ae213d6ef6613qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b73f98d0b2d236b49c57b5aec3a0000664000000000000000000000027213257152177027200 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1aQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b68616d14dc8a6e9375303789dbb91d20386c53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b68616d14dc8a6e9375303789db0000664000000000000000000000027213257152177026721 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1rQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b47d6a797e14dd4017a2881ba95a76d8b7d118eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0b47d6a797e14dd4017a2881ba950000664000000000000000000000106013257152177026762 0ustar AMQPSÀƒ ¡:.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÿÿÁ£x-opt-jms-destQSsÀ% @m¡se.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0ab8318acaf6e678dd02e2b5c343ed41111b393dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0ab8318acaf6e678dd02e2b5c3430000664000000000000000000000000113257152177027161 0ustar !././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0a32ccf79fea402ec9c79ae77a833683d4eb8d4eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0a32ccf79fea402ec9c79ae77a830000664000000000000000000000047313257152177027277 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_reZeiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0a077959176c83815535114245f78246191b0cf3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0a077959176c83815535114245f70000664000000000000000000000067613257152177026347 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––1£sole-connection-for-containerDELAYED_DELIVERY@Á3£\kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/09004cd3fcb69883f028e78ddbf5c2c3ecad516fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/09004cd3fcb69883f028e78ddbf50000664000000000000000000000071313257152177027141 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-aÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ÿÿÿÿÿÿÿÿ£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemiage: 26¹SÀCR 1(SpÀASrue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/07cb1af988625f40a043b4408dd0e7b65d32e1b5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/07cb1af988625f40a043b4408dd00000664000000000000000000000115413257152177026752 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(Àeue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/074b9068c78ec6df40064b69a8b6c77ae15c2d80qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/074b9068c78ec6df40064b69a8b60000664000000000000000000000115413257152177027002 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0718060785ce19f0601579e5de97efe312c36507qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0718060785ce19f0601579e5de970000664000000000000000000000025613257152177026567 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol)SÀ ¡ my_rec`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/070c2076f2b7fcf046b342584119cc88763af68bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/070c2076f2b7fcf046b3425841190000664000000000000000000000115413257152177026616 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSp£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)¯roducer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/06c65470dbadf81f917b1fb1a9a1d6ec2e4233b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/06c65470dbadf81f917b1fb1a9a10000664000000000000000000000115413257152177027174 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3‚kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/06bb37b9d91c7dc521ac22b64ccf8da601ae4946qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/06bb37b9d91c7dc521ac22b64ccf0000664000000000000000000000115413257152177027252 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/05f6b27136788a580e207779983be3c2ac3c5075qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/05f6b27136788a580e207779983b0000664000000000000000000000072013257152177026510 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol9e-connection-for-containerDELAYED_DELIVERY@Á2£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rã pÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0586885c058696fbea720a4aba92a13da42da9c8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0586885c058696fbea720a4aba920000664000000000000000000000032313257152177026771 0ustar AMQPSÀƒ ¡0BBBBBBBBBBBBBBBBBBB.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAMQPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBSÀƒ ¡:0.0.0.0@pÿÿBBBBÿ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/05448fc21b04f58464b6b7ab20c0127e95cd728fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/05448fc21b04f58464b6b7ab20c00000664000000000000000000000053313257152177026745 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DEroducer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0519dc34bc644fe9617438b61df75413ea2bd941qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0519dc34bc644fe9617438b61df70000664000000000000000000000115413257152177026777 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BV¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/04935c57adc38f1bd00edd8223bff34cf7943f10qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/04935c57adc38f1bd00edd8223bf0000664000000000000000000000031013257152177027165 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡rsion¡1.5.0"S@`Rp‰ÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0445e9084cd366adadef0db16b39389a1fbb0b96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0445e9084cd366adadef0db16b390000664000000000000000000000107413257152177027202 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/042fdec751947c700c94c604c4e5f8c8b2f890dfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/042fdec751947c700c94c604c4e50000664000000000000000000000073413257152177026770 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/041e38e2054e7b09fc9ba139f006d146c4bfa606qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/041e38e2054e7b09fc9ba139f0060000664000000000000000000000115413257152177026756 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/033e31c467de8d7f8ea6c09eee63e674ec272fc0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/033e31c467de8d7f8ea6c09eee630000664000000000000000000000027213257152177027221 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0339eecf1be50ea807e7bdf8b544e513d0f48a6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0339eecf1be50ea807e7bdf8b5440000664000000000000000000000027213257152177027267 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/01cedfe39e46064f8c67fffc156c5adffa1f34c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/01cedfe39e46064f8c67fffc156c0000664000000000000000000000073013257152177027302 0ustar AMQPSÀƒ ¡0.0.0.7@p%ÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_Drtemis£version¡1.5.0"t¡apache-acti£x-opt-jmsÇÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶¶¶¶¶¶¶¶¶ÿÿÿÿÿÿÿùStÁA¡ ThreadSeCSpÿ`ÿÿpu5@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£versiïn¡2.5.hreadSntTSwoducer AktiveMQQ!eue[examÿ`queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsjÀ% @@¡jms.queue.exa¡emq-././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/018d6b4c790c89c30d2bfe93921818e8512f9bafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/018d6b4c790c89c30d2bfe9392180000664000000000000000000000072413257152177026777 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/015b054164d0c060dba0ad2c350e12c83f71c129qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/015b054164d0c060dba0ad2c350e0000664000000000000000000000027213257152177026773 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ÁA¡ ThreadSent¡s.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0120a49b45a49483cea235df012c64cbd0441f1aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/0120a49b45a49483cea235df012c0000664000000000000000000000107713257152177026744 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-ctainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-omy_receiverpt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/011724655b0a5e891284003b6c82e9f3f09d719bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/011724655b0a5e891284003b6c820000664000000000000000000000106213257152177026446 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/010bab9b627b9bf8cd0b1ff32b19d4669e756e06qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive/corpus/010bab9b627b9bf8cd0b1ff32b190000664000000000000000000000037113257152177027246 0ustar AMQPSÀƒ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀstqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-proactor-receive.c0000664000000000000000000002330513257152177022055 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libFuzzingEngine.h" // bool VERBOSE = true; bool VERBOSE = false; // bool ERRORS = true; bool ERRORS = false; #define MAX_SIZE 1024 typedef char str[MAX_SIZE]; typedef struct app_data_t { str address; str container_id; pn_rwbytes_t message_buffer; int message_count; int received; pn_proactor_t *proactor; bool finished; } app_data_t; static const int BATCH = 1000; /* Batch size for unlimited receive */ static int exit_code = 0; static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (VERBOSE) printf("beginning check_condition\n"); if (pn_condition_is_set(cond)) { exit_code = 1; if (VERBOSE || ERRORS) fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); } } static void decode_message(pn_delivery_t *dlv) { static char buffer[MAX_SIZE]; ssize_t len; // try to decode the message body if (pn_delivery_pending(dlv) < MAX_SIZE) { // read in the raw data len = pn_link_recv(pn_delivery_link(dlv), buffer, MAX_SIZE); if (len > 0) { // decode it into a proton message pn_message_t *m = pn_message(); if (PN_OK == pn_message_decode(m, buffer, len)) { pn_string_t *s = pn_string(NULL); pn_inspect(pn_message_body(m), s); printf("%s\n", pn_string_get(s)); pn_free(s); } pn_message_free(m); } } } static void handle(app_data_t *app, pn_event_t *event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t *c = pn_event_connection(event); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_t *s = pn_session(c); pn_session_open(s); pn_link_t *l = pn_receiver(s, "my_receiver"); pn_terminus_set_address(pn_link_source(l), app->address); pn_link_open(l); /* cannot receive without granting credit: */ pn_link_flow(l, app->message_count ? app->message_count : BATCH); } break; case PN_DELIVERY: { /* A message has been received */ pn_link_t *link = NULL; pn_delivery_t *dlv = pn_event_delivery(event); if (pn_delivery_readable(dlv) && !pn_delivery_partial(dlv)) { link = pn_delivery_link(dlv); decode_message(dlv); /* Accept the delivery */ pn_delivery_update(dlv, PN_ACCEPTED); /* done with the delivery, move to the next and free it */ pn_link_advance(link); pn_delivery_settle(dlv); /* dlv is now freed */ if (app->message_count == 0) { /* receive forever - see if more credit is needed */ if (pn_link_credit(link) < BATCH / 2) { /* Grant enough credit to bring it up to BATCH: */ pn_link_flow(link, BATCH - pn_link_credit(link)); } } else if (++app->received >= app->message_count) { /* done receiving, close the endpoints */ printf("%d messages received\n", app->received); pn_session_t *ssn = pn_link_session(link); pn_link_close(link); pn_session_close(ssn); pn_connection_close(pn_session_connection(ssn)); } } } break; case PN_TRANSPORT_ERROR: check_condition(event, pn_transport_condition(pn_event_transport(event))); pn_connection_close(pn_event_connection(event)); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; case PN_PROACTOR_INACTIVE: app->finished = true; break; default: break; } } double now(void) { struct timespec spec; if (clock_gettime(CLOCK_MONOTONIC, &spec) != 0) { perror("clock_gettime"); exit(errno); } return (double)spec.tv_sec + (double)spec.tv_nsec / 1000000.0; } int sut(void) { /* Default values for application and connection. */ app_data_t app = {{0}}; app.message_count = 2; snprintf(app.container_id, sizeof(app.container_id), "%s:%d", "fuzz_proactor_recv", getpid()); const char *address = "127.0.0.1:amqp"; strncpy(app.address, "jms.queue.example", sizeof(app.address)); if (VERBOSE) printf("before proactor\n"); /* Create the proactor and connect */ app.proactor = pn_proactor(); pn_proactor_connect(app.proactor, pn_connection(), address); if (VERBOSE) printf("before loop\n"); double thence = now(); do { if (VERBOSE) printf("before set proactor timeout\n"); pn_proactor_set_timeout(app.proactor, 100); if (VERBOSE) printf("before proactor wait\n"); pn_event_batch_t *events = pn_proactor_wait(app.proactor); pn_event_t *e; if (VERBOSE) printf("before proactor next batch\n"); while ((e = pn_event_batch_next(events))) { handle(&app, e); } pn_proactor_done(app.proactor, events); if (VERBOSE) printf("before reloop\n"); double deltat = now() - thence; if (VERBOSE) printf("deltat %f", deltat); if (deltat > 1) { app.finished = true; } } while (!app.finished); if (VERBOSE) printf("after loop\n"); pn_proactor_free(app.proactor); free(app.message_buffer.start); return exit_code; } void serve_data(const uint8_t *Data, size_t Size) { int sockfd; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror("socket"); _Exit(errno); } int reuseaddr = 1; if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr)) == -1) { perror("setsockopt"); _Exit(errno); } struct sockaddr_in self; memset(&self, 0, sizeof(self)); self.sin_family = AF_INET; self.sin_port = htons(5672); self.sin_addr.s_addr = INADDR_ANY; if (bind(sockfd, (struct sockaddr *)&self, sizeof(self)) != 0) { perror("bind"); // Lets unblock the old child that listens by starting new client to read // from it. It breaks the fuzzing somewhat, but it is better to mess up one // than many inputs. if (VERBOSE) printf("unblocking old bound child\n"); kill(getppid(), SIGUSR1); _Exit(errno); } if (VERBOSE) printf("bound\n"); if (listen(sockfd, 1) != 0) { perror("listen"); _Exit(errno); } if (VERBOSE) printf("listened, lets run sut\n"); kill(getppid(), SIGUSR1); struct sockaddr_in client_addr; socklen_t addrlen = sizeof(client_addr); int clientfd = accept(sockfd, (struct sockaddr *)&client_addr, &addrlen); if (VERBOSE) printf("%s:%d connected\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port)); if (VERBOSE) printf("will send\n"); send(clientfd, Data, Size, 0); // sleep(1); close(clientfd); close(sockfd); if (VERBOSE) printf("done serving\n"); } void run_sut(int s) { if (VERBOSE) printf("running sut\n"); sut(); if (VERBOSE) printf("finished running sut\n"); } void signal_callback_handler(int signum) { if (VERBOSE) printf("Caught signal SIGPIPE %d\n", signum); } bool DoInitialization(void) { struct sigaction sa; sa.sa_handler = run_sut; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; /* Restart functions if interrupted by handler */ if (sigaction(SIGUSR1, &sa, NULL) == -1) { perror("sigaction"); exit(2); } sa.sa_handler = signal_callback_handler; if (sigaction(SIGPIPE, &sa, NULL) == -1) { perror("sigaction"); exit(2); } return true; } int LLVMFuzzerInitialize(int *argc, char ***argv) { DoInitialization(); return 0; } int prev_pid = 0; int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { // sometimes, esp. with AFL, but libFuzz too, // the old socket is still bound for new run and // it skips all new runs... if (prev_pid != 0) { kill(SIGKILL, prev_pid); } pid_t pid = fork(); if (pid < 0) { perror("fork"); exit(errno); } if (pid == 0) { // child serve_data(Data, Size); _Exit(0); } else { // parent prev_pid = pid; if (VERBOSE) printf("waiting for child\n"); siginfo_t status; waitid(P_PID, pid, &status, WEXITED); if (VERBOSE) printf("finished waiting for child\n"); } return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/0000775000000000000000000000000013257152177021302 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/minimized-from-6bdd20e31278a9c00b966db0a4e1b2dd412fdfbaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/minimized-from-6bdd20e31278a9c00b966d0000664000000000000000000000000313257152177027205 0ustar à„„qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/crash/0000775000000000000000000000000013257152177022402 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/crash/minimized-from-ac1dd1edf2357b0e4782088fa2bf80fdde832a43qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/crash/minimized-from-ac1dd1edf2357b0e0000664000000000000000000000000213257152177027665 0ustar ð././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/crash/crash-da39a3ee5e6b4b0d3255bfef95601890afd80709qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/crash/crash-da39a3ee5e6b4b0d3255bfef90000664000000000000000000000000013257152177027276 0ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0000775000000000000000000000000013257152177022615 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ffa793877921ab5b9c7a8692732556c8fa4aa0e0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ffa793877921ab5b9c7a86927325560000664000000000000000000000005613257152177026505 0ustar BUUUUBUUUBBBBBBBBBBBBàBBQBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ff13c53c153cd7551dadb15f1fba57292364417eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ff13c53c153cd7551dadb15f1fba570000664000000000000000000000000713257152177027071 0ustar qÿÿÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fe875f4136bff45db151e0870b2d4bb725545e8bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fe875f4136bff45db151e0870b2d4b0000664000000000000000000000006313257152177026747 0ustar °°°°°°°°°°BBBBBBBBBBBBBBBBBBBBBBBBBBBDBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd82dd76af6ab1511daa85fe2b5c72864ee61e81qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd82dd76af6ab1511daa85fe2b5c720000664000000000000000000000007113257152177027161 0ustar BBBBBBBBBBBÁÁ@RBBBRBÄÿÿÿÿÿÿÞ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd5fa3cf00291bf68cbf96affeda5602e01ac245qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd5fa3cf00291bf68cbf96affeda560000664000000000000000000000010013257152177027326 0ustar BBB!'qBBBBBì;!!»»»»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd534f17a91619ee99c7a0342305665fa54d8fdeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd534f17a91619ee99c7a0342305660000664000000000000000000000004013257152177026454 0ustar €€€€€€€€€€€€€€€€€€€€€€BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd2e548ec7d1830dffe571c045376cd0f95b6c2cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fd2e548ec7d1830dffe571c045376c0000664000000000000000000000010013257152177026750 0ustar qÿqqÿÿÿÿ!'qÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fc82b23a0afe154b95f38f0d758e4361d3a6925fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fc82b23a0afe154b95f38f0d758e430000664000000000000000000000010013257152177026742 0ustar €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€BBBBBÿÿÿ½././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fc3096622fd2cf08e50295582e80f65efedf86c5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fc3096622fd2cf08e50295582e80f60000664000000000000000000000010013257152177026532 0ustar BBBBBBBBBBBBBBBBBBBBBÁBBBBBBBBÁÁÁÁÁBBBBÁBBBBBBBBÁBÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fb4cf9f9d349c0fe983f3ffd64f099976e81ea6eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fb4cf9f9d349c0fe983f3ffd64f0990000664000000000000000000000010013257152177027144 0ustar àBBCBBBBBBBBBàBBàBBCBBBBBàBBàBBCBBBBBBBBBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fad53a111e9cd3fde01b922b0eb8fcee450df9bfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fad53a111e9cd3fde01b922b0eb8fc0000664000000000000000000000010013257152177027216 0ustar BÿÿÿÿBBBBBBBBBBBBBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fa4dd1cd6718693b087aaa826d2624f3b1352fbbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/fa4dd1cd6718693b087aaa826d26240000664000000000000000000000007713257152177026674 0ustar BBABBBAAAAAAaAA`B@BBBBBBBBBB`B@BBBBBBBBBB`B@BBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f90128705d855918e85ce914903b2c2c81d398a3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f90128705d855918e85ce914903b2c0000664000000000000000000000010013257152177026377 0ustar BBBBBBBBBBBBBBBBBBBBBBBBÀÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f812a97c3d6cae9cfea908a7f61f2ee817a4865bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f812a97c3d6cae9cfea908a7f61f2e0000664000000000000000000000004513257152177027204 0ustar UBUUBÀÀÀÀBBBBBBBBBBB BB””€€²q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f7c3675aff61a766ceabfde1e3cb4045da12faf6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f7c3675aff61a766ceabfde1e3cb400000664000000000000000000000006513257152177027251 0ustar BBBBBBBtBBBBBBBtBBBBBBBB'BBBBBBBB'././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f7346f558def672a746ea5e71c3a392241707882qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f7346f558def672a746ea5e71c3a390000664000000000000000000000002213257152177026706 0ustar BBBBBBBBBBBBBBBU././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f6b4512f5a4745a024d48921d521528707e90b02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f6b4512f5a4745a024d48921d521520000664000000000000000000000007513257152177026361 0ustar BBBBRBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBRBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f6a0a3ac45a8e7bddb4994a941c6d5803c7df783qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f6a0a3ac45a8e7bddb4994a941c6d50000664000000000000000000000005513257152177027111 0ustar €€€€Bì;!B€€€€€€€€€€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f655e8ad09f5304330a876ac74d2b82d2ef8a572qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f655e8ad09f5304330a876ac74d2b80000664000000000000000000000003713257152177026615 0ustar BBBBBBBBBBBÁÁBBBBBBUBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f5a77aaf1a7aa9671107f9e51385ccaa78d4f7a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f5a77aaf1a7aa9671107f9e51385cc0000664000000000000000000000007713257152177026757 0ustar BBBBBAAAAAAAAAA`B@BBBBBBBBBB`B@BBBBBBBBBB`B@BBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f5970cab91bee5a5b67d0b1d476067410a501364qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f5970cab91bee5a5b67d0b1d4760670000664000000000000000000000003513257152177026747 0ustar ³BBBBBBBBBBBBBBBÁÁ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f57cf776f80688740a5dbac39b6ee997963c6200qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f57cf776f80688740a5dbac39b6ee90000664000000000000000000000007713257152177027010 0ustar q@@BBBB`B@BBBBBBBBBB`B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f38a4b1cbe822e74a69dcd1cf65103ab75b88f8bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f38a4b1cbe822e74a69dcd1cf651030000664000000000000000000000010013257152177027011 0ustar BBBBBBBBBBBBCBÑBBBBBBBBBBBBBBBPBBBBBBBBBBBBBBPBSBBBBBB@BBBBBPÁ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f33f43a1a5023bd1a15bb4e4177de66f93edca24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f33f43a1a5023bd1a15bb4e4177de60000664000000000000000000000010013257152177026711 0ustar BBBBBàBBBBBBBBBBBBBBBBBBBBBÁÁÁÁÁB‚BBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f298d332abb1473e74222524a3713bfbd102e8eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f298d332abb1473e74222524a3713b0000664000000000000000000000007113257152177026430 0ustar BBBBBBBBBBBB‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚BBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f1e1be47b7e2f62c00d38cb48e71534af3169de5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f1e1be47b7e2f62c00d38cb48e71530000664000000000000000000000010013257152177026733 0ustar ƒqÿq:!!!'ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f194672ecf8f5c2baee9a7863b67fe6566bda719qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f194672ecf8f5c2baee9a7863b67fe0000664000000000000000000000007513257152177027143 0ustar àBBCBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f0df6c6c4734375ed0354150403277beb8d61a87qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/f0df6c6c4734375ed03541504032770000664000000000000000000000001113257152177026354 0ustar !././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ef8e2d2094667f5404c86defda5e5bd577ec7b3eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ef8e2d2094667f5404c86defda5e5b0000664000000000000000000000007413257152177027051 0ustar BBBBBBBBBBB””””””””BBBBBBB”””BBBBBBBBBBBBBBBBBBBBBHBBBBÿ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ed81657a17d9c05345b899694119370b90987d2aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ed81657a17d9c05345b899694119370000664000000000000000000000006513257152177026342 0ustar rrrrrrBBBrrBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ed440b89f02d9a199579abd710f1273b388870f3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ed440b89f02d9a199579abd710f1270000664000000000000000000000004613257152177026620 0ustar BBBBBqssssssssssssssUs././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ec76ed951a6495e7f54e8d98af63783950dce8f4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ec76ed951a6495e7f54e8d98af63780000664000000000000000000000005613257152177026742 0ustar BaaaaaaaaaaaaaaaaaBBBBBBBBBBBƒBBBBaaBa././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ec2d9b70669a5a59f75eb0303f9a312518c0c286qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ec2d9b70669a5a59f75eb0303f9a310000664000000000000000000000005513257152177026674 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebe4783cc7c78f42ae54b5aa5e1b2070b7394ca2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebe4783cc7c78f42ae54b5aa5e1b200000664000000000000000000000010013257152177027072 0ustar rrUBUUBÀÀÀÀÀrrrÀBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁ@BB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebce296629fe35ef744efc5a3472a3d7b028435dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebce296629fe35ef744efc5a3472a30000664000000000000000000000010013257152177027034 0ustar àBBCBBBBBBBBBàBBàBBCBBBBBàBBàBBCBBBBBBBBBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebaecc15f295e38d26d56865272d15fbdf1d840aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ebaecc15f295e38d26d56865272d150000664000000000000000000000006513257152177026702 0ustar aaaaÿÿÿÿÿÿÿÿaaaaBBBBBBBBBBB€€€€€€€BBBBBBBBBBB€BBÔÔÔ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e8442a225c41de9dda63ad774b899e326de7dd5eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e8442a225c41de9dda63ad774b899e0000664000000000000000000000010013257152177026753 0ustar BUUUUBUUUBBBBBBBBBBBBàBBqBBBBBBBBBàBBBBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e7547ddb757d4803ac6559d447abd44fd5bca59bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e7547ddb757d4803ac6559d447abd40000664000000000000000000000006513257152177026707 0ustar tÿÿÿÿqÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e57056bc38b859773767405d8ce3a39010f5751dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e57056bc38b859773767405d8ce3a30000664000000000000000000000003713257152177026474 0ustar BBàBBBBBB!!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e517a9d405587abebdca47a9397e5f16292590edqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e517a9d405587abebdca47a9397e5f0000664000000000000000000000001313257152177027040 0ustar ì;:!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e4bd43844adb36e6d3ff1d722f80ee6fd9cea8c6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e4bd43844adb36e6d3ff1d722f80ee0000664000000000000000000000010013257152177027102 0ustar BBBBBàB CBBBBBBBBBàBBBBBàBBBBBBBBBBBBBBBàBbEBBBBBBRcBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e40f5dd677cbe495ba223a7b73f78cfcc2ae8ce0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e40f5dd677cbe495ba223a7b73f78c0000664000000000000000000000005313257152177027037 0ustar BABA`B@BBABBBBBBBBBBBBB`B@BBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e3045319cd0799f9d2ae03c620d9b046cb751cdaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e3045319cd0799f9d2ae03c620d9b00000664000000000000000000000007713257152177026611 0ustar BBBBàBBBQBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e25821dafab3db7303211fe760f50082bd171292qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e25821dafab3db7303211fe760f5000000664000000000000000000000010013257152177026630 0ustar Bì;!Bì;!!»»»»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e19ad1b4fbe3c55240b3c81df69d6202808e8cbbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/e19ad1b4fbe3c55240b3c81df69d620000664000000000000000000000005613257152177027024 0ustar UBUUBÀÀÀCCCBBBBBBBB@BBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dffc0825501dc0eaaa12947bee732f21573656ceqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dffc0825501dc0eaaa12947bee732f0000664000000000000000000000006613257152177027075 0ustar BBBBBBBƒBBBBBBBBBBBBPBBBBBBBPBSBBBBBB@BBBBBPÁ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dfbbd9df40f5ea164ffd24ab67239c2a43d15062qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dfbbd9df40f5ea164ffd24ab67239c0000664000000000000000000000005113257152177027247 0ustar BBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dd9b409a021acf81bad43c3c04702bf31e4f89aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dd9b409a021acf81bad43c3c04702b0000664000000000000000000000007013257152177026771 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBRBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dd7319e2dfe63dfb27797076f974643d2b76992bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dd7319e2dfe63dfb27797076f974640000664000000000000000000000010013257152177026636 0ustar ‚Bì;€€BBBBì;:!B!!BB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dcf31962d2803ce8740925b8bfe6e5142617fb3aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dcf31962d2803ce8740925b8bfe6e50000664000000000000000000000001113257152177026674 0ustar ‚‚‚‚‚‚././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dc03bf604e4ec5ad71441f736f32e42ae23857e9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/dc03bf604e4ec5ad71441f736f32e40000664000000000000000000000000513257152177026734 0ustar BBU././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/db99434402884f3cc19e191a0c3071dde7131d99qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/db99434402884f3cc19e191a0c30710000664000000000000000000000010013257152177026433 0ustar BBBBBBBBBBBBBàBB!BÁÁÁÁÁBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/db8679a7a012cf6c491b37449b84304282f6546dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/db8679a7a012cf6c491b37449b84300000664000000000000000000000007313257152177026535 0ustar BBBBBBBBBBB””””””””BBBBBBBBBBBBBBBBBBBBBBBBBÿÿÿÿÿÿ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d9892fb2d0c711c0311c289a2e7c70cc00c7125eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d9892fb2d0c711c0311c289a2e7c700000664000000000000000000000010013257152177026567 0ustar BBBBBBì;!!»»»»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d982fc5f6b47f74a65de5d9d6455c12f31da4717qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d982fc5f6b47f74a65de5d9d6455c10000664000000000000000000000010013257152177026770 0ustar BBBBBBBBBBBBBBBBBàBBÿÿÿÿ„ÿÿÿÿ¿ÿBBBqBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d85737a59f3ca6c2c289ef9e90053211bf21b973qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d85737a59f3ca6c2c289ef9e9005320000664000000000000000000000007013257152177026627 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d66b8b4533ab9d639e83e687430f02cac1151c9aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d66b8b4533ab9d639e83e687430f020000664000000000000000000000010013257152177026534 0ustar BBBBBBBBBBBÁBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d61eddbedd1818ccdf232800e6ab6fe9b5b30363qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d61eddbedd1818ccdf232800e6ab6f0000664000000000000000000000006213257152177027237 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁÁÁÁBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d5b57e0e643af9133390f29bc63d24bd0bad0966qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d5b57e0e643af9133390f29bc63d240000664000000000000000000000005613257152177026612 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBPBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d5143aaeea6897d4264440017cd47ebc874f4440qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d5143aaeea6897d4264440017cd47e0000664000000000000000000000002413257152177026602 0ustar rrBBBrrBB:rr !././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d4abb3ce9e2575da6a564bebebb7dd89131a4fb3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d4abb3ce9e2575da6a564bebebb7dd0000664000000000000000000000007713257152177027410 0ustar UUUUUUBBBBBBBBBBBBBBBBBBBBBBBUUUUUUBUUUBBBBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d3847668fc8fe1b835cb6afe86e3f1323696db04qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d3847668fc8fe1b835cb6afe86e3f10000664000000000000000000000010013257152177027047 0ustar Bsssss€BBBBBBBBBBàBàBBBBBBBBBBBBBBBBBSSSSSBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d2f4e4ee672701571d58885a45171cfaaec8746cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d2f4e4ee672701571d58885a45171c0000664000000000000000000000010013257152177026451 0ustar BBBBBàBBBBBBBBBBB!UUB‚BBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d2a155fbc3b29d23e94a8c1eb2c57c6810f17edaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d2a155fbc3b29d23e94a8c1eb2c57c0000664000000000000000000000010013257152177027066 0ustar €€€€€€€€€€€€€;BBBBBàB@BBBBBBBBBBBUBàB@BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d06b4b2428d82662d430f7f6551efe1898277d2dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/d06b4b2428d82662d430f7f6551efe0000664000000000000000000000003613257152177026613 0ustar BBBB³B@BBBBBBBBBB`B@BBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ced18ff058ccb7241eba40e2ab210005b43a9c5cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ced18ff058ccb7241eba40e2ab21000000664000000000000000000000005313257152177027052 0ustar UUUUUUBUUUBBBBBBBBBBBBBBBBBBBBBBBBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ce9dbe8768f7fd77c1b31c51463f6ce503b53a9fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ce9dbe8768f7fd77c1b31c51463f6c0000664000000000000000000000007713257152177027060 0ustar BÁBBBBBBÁÁÁÁBBBÁBBBBBBÁÁÁÁÁBÁBBBBBBB(!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd82baa986fbbefddf8fae15c40aa923c44ca69eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd82baa986fbbefddf8fae15c40aa90000664000000000000000000000010013257152177027461 0ustar BUUUUBUUUBBBBBBBBBBBBàBBQBBBBBBBBBàBBBBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd6be761b2ac9439d66c33e338cd25915fe2e7f1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd6be761b2ac9439d66c33e338cd250000664000000000000000000000004213257152177026750 0ustar BBBBBBBCCBBBBCBBBBðBBBB*CCBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd451e0b64f70e7e0ced80be14ff2fc738833cc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cd451e0b64f70e7e0ced80be14ff2f0000664000000000000000000000007313257152177027163 0ustar BBBBBBBBBBBBBBBBBBBBCBBBÁBBBBBBÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cced9a75b91bbdb7eefaa3fd65872e3b4f0f3d9dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cced9a75b91bbdb7eefaa3fd65872e0000664000000000000000000000007713257152177027425 0ustar BBBBBàBBCBBBBBBBBBàBBÂBBBBBBBBBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ccbe0cc34e410c7977617a1514f83169d8bcf502qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ccbe0cc34e410c7977617a1514f8310000664000000000000000000000010013257152177026567 0ustar BBBBBBBBBBBÁBBBBBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ccb6a445ed147802b9d87b97cf4b6e9dd9c23466qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ccb6a445ed147802b9d87b97cf4b6e0000664000000000000000000000010013257152177027033 0ustar €BBEBBBƒBBBB@BBBBBƒBBBB@BBBB‚‚‚‚‚‚‚‚‚‚BBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cc26072890e2a882e031ed9c1e470761d3c9707bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cc26072890e2a882e031ed9c1e47070000664000000000000000000000010013257152177026516 0ustar BàB CBBàaaaaaOOOOOOaaaaaaaaaaaaBàBBCBBBBBBssÀÀÀBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cb8e4fd682740d0a95d9dbaedeab3ff0ea718b6eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cb8e4fd682740d0a95d9dbaedeab3f0000664000000000000000000000004313257152177027330 0ustar '!!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cb4546e99261bf07a2afe8e1ebe92c93de9924f9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cb4546e99261bf07a2afe8e1ebe92c0000664000000000000000000000010013257152177027104 0ustar BBB BBBBBBàBBàBBCBBBBBBàààààààààààààààààààààààààààBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cae880404561ec27196ce7479fd2d1cc2e83c5b6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/cae880404561ec27196ce7479fd2d10000664000000000000000000000000613257152177026615 0ustar aÿïÿ)ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ca6bbd752c8843030997b826e89b27f466042bfaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ca6bbd752c8843030997b826e89b270000664000000000000000000000002113257152177026541 0ustar @././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c9a291fbb67f0dbc9a6855f49a74cba238edae3dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c9a291fbb67f0dbc9a6855f49a74cb0000664000000000000000000000010013257152177027113 0ustar BBÀ¾BBBBBÀÀBBBBBBBBBBBBBBaaaaaaaaaaaBBBB¿½½½½½aqaSÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c94dfc95a5cd2f8473e04473a9d232548eeb52ffqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c94dfc95a5cd2f8473e04473a9d2320000664000000000000000000000005413257152177026700 0ustar ;ÿ'././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c8de858cb6944046cbe99b6cc996772891134ad1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c8de858cb6944046cbe99b6cc996770000664000000000000000000000001113257152177026726 0ustar BBB‚‚././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c8d551c47a85f36201d0028876687325922bb0efqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c8d551c47a85f36201d002887668730000664000000000000000000000001213257152177026313 0ustar ” BBBBBÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c69e2b352bf2430fd7623f4ed685c276a92d5af7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c69e2b352bf2430fd7623f4ed685c20000664000000000000000000000007513257152177026676 0ustar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c5adf7d66afabea31b7b27ef8eeaa8a4c53bef37qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c5adf7d66afabea31b7b27ef8eeaa80000664000000000000000000000007513257152177027472 0ustar UUUUýýýýUUBNUUBBBBýýýýýýý}ýýýýýýBBBBBBBBBBBBBBBBBqBBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c4d3d7749a3ab92eca8559809ae54f04dc4348caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c4d3d7749a3ab92eca8559809ae54f0000664000000000000000000000006713257152177026773 0ustar BBB`BBBÁBBBÁÁÁÁÁBÁBBBBBBBBÁB-BBBBÁÁBàBBQ!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c40b56cb3ff22b63899a853e6e0a013a4419689cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c40b56cb3ff22b63899a853e6e0a010000664000000000000000000000003713257152177026663 0ustar BBBBBBBàBJàBBCoBBBBBBBBB;././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c2d7ae7ccccb92e4ad1644b2a71368b53e9711b2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c2d7ae7ccccb92e4ad1644b2a713680000664000000000000000000000005613257152177027101 0ustar BBBBBBBàBJàBBCoBBBBBBBBBCBBBBBBBàB”B@B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c2395be1a892b1fbaa54ceb64165da07ee9c6769qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c2395be1a892b1fbaa54ceb64165da0000664000000000000000000000007613257152177027077 0ustar BBBBBBBBBBBBBBBàBàBB!(B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c0a0a01ee13fe3fd976e169e9f4072a4d81bee73qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/c0a0a01ee13fe3fd976e169e9f40720000664000000000000000000000010013257152177026736 0ustar Bà~BàBBBBBBBBBqSSSSSSSSSSSSSSSS;SSSÿÿÿÿBBBBBBBBB`B@€€€BBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bfe340b31757f54e896d1516a6af2dc61830f2eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bfe340b31757f54e896d1516a6af2d0000664000000000000000000000007413257152177026675 0ustar ‚‚‚‚BBBBBBBBBB‚‚‚!‚:‚‚‚‚‚‚‚‚‚‚‚RCBB‚‚‚‚RBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bf49b84bd43be3d0b0781c1f8d93200d0a4dc389qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bf49b84bd43be3d0b0781c1f8d93200000664000000000000000000000007413257152177026744 0ustar UU±UUUBUUUB‚BBBBBBBÿÿÿÿÿBBBBBBBBBBBBBBBBBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bce8234e93458e87ab1fb77240564d1565e54b12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bce8234e93458e87ab1fb77240564d0000664000000000000000000000010013257152177026612 0ustar àBBCBBBBBBBBBàBBàBBBBBBàBBàBBCBBBBBBBBBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bade0355f2530781b5d365389d15b49bd5dd372bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/bade0355f2530781b5d365389d15b40000664000000000000000000000003413257152177026522 0ustar Bsssssssssÿÿsssss€BBBBBBsss././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ba786c7a8933f07cc2f685d6f68c8c4326f3bff9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ba786c7a8933f07cc2f685d6f68c8c0000664000000000000000000000003713257152177027003 0ustar BBBBBBBBBBBBCBCBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ba368dc05fb3416f233e5218f26ec841fa5407b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ba368dc05fb3416f233e5218f26ec80000664000000000000000000000010013257152177026655 0ustar BBBBBB€€€€€€€€BÔÔÔÔÔÔÔDBBBBBBBBBBBBBBBBBBBBBBBBB@BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b87d753e01159bc184e132560bcf0a5fba3fc130qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b87d753e01159bc184e132560bcf0a0000664000000000000000000000010013257152177026563 0ustar BBBBBBBB BBBBBBBBBBBBBBBBBBBBBÁÁBBBBBBBBBBBBBBBB£././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b81fdb3b1a760a3cf100333a557ce2904f31bb7fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b81fdb3b1a760a3cf100333a557ce20000664000000000000000000000004113257152177026710 0ustar BBBBBàBBBBBBBBBBBBBðÿBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b7f13e891d3062c91c3a931c8392b9971797a606qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b7f13e891d3062c91c3a931c8392b90000664000000000000000000000001713257152177026533 0ustar UBUUBÀÀÀÀ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b7cc2452730aa9df1a67b36b04e2d31a59f9cd55qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b7cc2452730aa9df1a67b36b04e2d30000664000000000000000000000010013257152177026717 0ustar CCBBBBBBÑÑÑÑBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b727ec18c425ddb43112e2b442c8f26046424fa8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b727ec18c425ddb43112e2b442c8f20000664000000000000000000000007013257152177026650 0ustar BUqBBBBBBBBBBBB@BBBBBPBBBBBBBB@BBBBBPBB@B€€€€BBB‚././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b70b5fbb3fc5a247a67cec18a4eacd3856da8ba2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b70b5fbb3fc5a247a67cec18a4eacd0000664000000000000000000000007713257152177027320 0ustar BBBBBàBBQBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b701c77501ff468b315f93b434d88a7f242fce71qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b701c77501ff468b315f93b434d88a0000664000000000000000000000004013257152177026527 0ustar €€€€€€€€€€€€€€€€€BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b6f0b5f4007e2b87e3af1cae4d47fea69c41d692qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b6f0b5f4007e2b87e3af1cae4d47fe0000664000000000000000000000000613257152177027160 0ustar  )ÿï)././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b4a95ccd16dc97542bd321c54de9f2934dc8fdb6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b4a95ccd16dc97542bd321c54de9f20000664000000000000000000000010013257152177027020 0ustar BBBBBBBBBBBBB@BBBBBPBB@BBBBBBBBBB@BBBBBPBB@Bÿÿÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b47375c8a952e4c686dd5185001e36ba801fb55aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b47375c8a952e4c686dd5185001e360000664000000000000000000000003613257152177026460 0ustar BBBBBBBBBBBÁÁ@BBBBRBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b428b7bc560ec4f732a42870962e7a3e211fa80eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b428b7bc560ec4f732a42870962e7a0000664000000000000000000000006513257152177026613 0ustar BBBBB`B@BBBBBBBBBB`B@BBBBBBBBBB`B@BBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b2c9ce730ecbc3338747b00b3d0c416b9b2df0eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b2c9ce730ecbc3338747b00b3d0c410000664000000000000000000000006713257152177026727 0ustar Bsssssssssssssssssssssssssssssss€€€BBBBBBBBBBB»»././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b0f6bbb424a699799f686ab370cc3dc1e71412e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/b0f6bbb424a699799f686ab370cc3d0000664000000000000000000000007313257152177026763 0ustar UUUUUUBBBUBUUÀ@BBBBBBÀÀBBBBBBBBBBBBBBBÀBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/afa3f5a554988d94da66cef06bc4b7e5720aa624qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/afa3f5a554988d94da66cef06bc4b70000664000000000000000000000010013257152177027114 0ustar VVVVV€€€BB€€€€BBBBBBBBBBBBBBBBBBBBBÌBBUBVVBÿPÁ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/af8af368b2d2b37f8c3f6b7cab808a961fc81b28qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/af8af368b2d2b37f8c3f6b7cab808a0000664000000000000000000000003213257152177027167 0ustar BBBBBqBBBBƒBBBBBBBBBBBBpBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/af16831c02b394e4fb4441ae10a337cdff7ae71dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/af16831c02b394e4fb4441ae10a3370000664000000000000000000000004213257152177026557 0ustar €€€€€€€€BÔÔÔÔÔÔÔBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ae361a63e0750b981bc738f4686b0528cde6c6ebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ae361a63e0750b981bc738f4686b050000664000000000000000000000010013257152177026521 0ustar q@@qÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ab4da1b3e6a7594f89d28b0548cc4f9389e9f70dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/ab4da1b3e6a7594f89d28b0548cc4f0000664000000000000000000000010013257152177027025 0ustar BBBBBBBBBBBBBBBBBBBBBBBBQƒBBBBBBBBCBƒBBBBBBBBBE!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/aa38250804d3bd42c825b3e38a13d23a033ffdf7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/aa38250804d3bd42c825b3e38a13d20000664000000000000000000000010013257152177026553 0ustar BUqÀUÀBBBÀÀÀsssssssssssBBBBrBBBBBBBBBÁÁÁBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a9cbaf8330522713240c45cba9d3c57b25f6d683qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a9cbaf8330522713240c45cba9d3c50000664000000000000000000000005513257152177026647 0ustar BBB BBBBBBUBB BBBBBBUBBBBBBBBBBàBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a95828b7f5be10e12e8190215372725ed5cb2e86qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a95828b7f5be10e12e8190215372720000664000000000000000000000002113257152177026361 0ustar @././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a80d60ba71fbb1704e763aa3d3d41a05c55b571bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a80d60ba71fbb1704e763aa3d3d41a0000664000000000000000000000003713257152177026776 0ustar BBBBBBBBBBBÁÁBBBB'BBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a802e21faa505d53b33d6950c2cb9d8237463af7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a802e21faa505d53b33d6950c2cb9d0000664000000000000000000000003313257152177026723 0ustar BCBBBBBBBBBàBBÀBBB(B!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a79aaac0d78a53e7f08ed58a76a9a4cab2e1049aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a79aaac0d78a53e7f08ed58a76a9a40000664000000000000000000000010013257152177027106 0ustar BB`BBBBBBBBBBqÿÿÿÿ„ÿÿÿÿ¿ÿBBB`B@BBBBBBBBBB`BBB@BBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a634d058e7efb50059324af3aff17de7b5f8b820qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a634d058e7efb50059324af3aff17d0000664000000000000000000000000513257152177026741 0ustar qÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a631cf75e25090abd9584efd80578d0e1c28954dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a631cf75e25090abd9584efd80578d0000664000000000000000000000001513257152177026700 0ustar BB`˜BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a4602b93b4275d424890b2134acf053f1a2987bfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a4602b93b4275d424890b2134acf050000664000000000000000000000010013257152177026417 0ustar BUqÀUÀBÀÀÀÀÀÀÀsssssssssssssBBBBBÁÁÁÁÁÁBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a33a5cae02b786c2060461df8c6764b4c05e9423qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a33a5cae02b786c2060461df8c67640000664000000000000000000000000213257152177026570 0ustar r././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a1fdb056899a04a3e6d85747bca9a2f99a8d5defqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a1fdb056899a04a3e6d85747bca9a20000664000000000000000000000007713257152177026757 0ustar RÁBBBBBBÁÁÁÁÁBÁBBBBBBBBÁBBBBBBÁâÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a1ce734f3696ad0dcfdda76480fa09fd56c7a61dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a1ce734f3696ad0dcfdda76480fa090000664000000000000000000000006013257152177027105 0ustar B BBÿÿÿÿÿÿÿÿBBBBUBEBBBBUBBBBBBBBBàBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a069936ebd25612c949dfa4b88b71d64d1b72251qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a069936ebd25612c949dfa4b88b71d0000664000000000000000000000004213257152177026700 0ustar BBBBBBBBBBUBBBBBBBBBàBUUBÀBBÀ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a0591d111fdcfde6e2f15cf957b4422e463d1ff4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a0591d111fdcfde6e2f15cf957b4420000664000000000000000000000010013257152177027014 0ustar BBBBBBBBBBBBBBBBBBBBBÁBBBBBBBBÁÁÁÁÁBBBBBBBBBBBBBBBBBBÁÒ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a00e6cbb71705b24b5aee133f5890edf7f3f9bcaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/a00e6cbb71705b24b5aee133f5890e0000664000000000000000000000010013257152177026717 0ustar BBBBBàB@BBBBBBBBBBBBBBBBBBBBÁÁÁÁÁB‚BBBBBBBCBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9fbcb2bc35044015d7765cc6e37c6df9ff23ea28qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9fbcb2bc35044015d7765cc6e37c6d0000664000000000000000000000007613257152177026752 0ustar rrBBBrrBBrrrrrBBBrrBBBBBBBBBBBBBBBRBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9f1d16ab7ef0930eb8c579a8560f40ce8923588bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9f1d16ab7ef0930eb8c579a8560f400000664000000000000000000000006713257152177026703 0ustar €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€¡¡¡¡€€€€€€€€€€B¡BBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9f0680631e8bfb84bd27c2c5e769044e1f14250cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9f0680631e8bfb84bd27c2c5e769040000664000000000000000000000007713257152177026630 0ustar BB`ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9e92ccbf69a625d0648a3c8a8fb038f94fed42b5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9e92ccbf69a625d0648a3c8a8fb0380000664000000000000000000000010013257152177026753 0ustar BBBBBBBBBBUBBBBBBBBBàBUUBÀBBÀBBBBBBBBBBBBBBBBBCBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9b67f864b0af104640e9b2b0bc8a84cd3ab65bd2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9b67f864b0af104640e9b2b0bc8a840000664000000000000000000000007613257152177026670 0ustar @BBTBBBBBBoBBBBBBBBBBBBBBBàBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9b1e3233c5c12669ca4e570ce0fafd25a81bc71eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9b1e3233c5c12669ca4e570ce0fafd0000664000000000000000000000010013257152177027007 0ustar BBB„BàBVVVVVVVV@àBBBBBBBBBBBBBBBBBBBBBàBBCBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9a1d0ef597c57680080b68ca04e583f093149703qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9a1d0ef597c57680080b68ca04e5830000664000000000000000000000006013257152177026534 0ustar qÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9976550f025ffa4003b0531c28cf16ef795345a3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9976550f025ffa4003b0531c28cf160000664000000000000000000000010013257152177026430 0ustar BBBBBàB CBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàB¥EBBBBBBRcBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9901e8aea1441bef0dc3965afd7e8078e6d01a6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9901e8aea1441bef0dc3965afd7e800000664000000000000000000000010013257152177027021 0ustar BBBBBBBBBqBBBBBCCCBBBqBBBBBBBUUUUUBUUUB‚BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/98c5f05076743739d488b34629f66fc54554cea4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/98c5f05076743739d488b34629f66f0000664000000000000000000000010013257152177026342 0ustar BBBàBBàBB€€€€€€€€€€€€€€€€€€€BBB@JBBBBBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9833f25de5cfaf8fca7ff63046edd0aca1aa9458qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9833f25de5cfaf8fca7ff63046edd00000664000000000000000000000006513257152177027207 0ustar rrrrrrrrBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/974281364143695380b8dbd110e4fbf24f900616qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/974281364143695380b8dbd110e4fb0000664000000000000000000000010013257152177026360 0ustar €BBBBàBBCBBBBBBBBBUUUUBUUUBBBBBBBBBBBBàBBqBBBBBB‚‚‚././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9707102549bba889b7d54cdfe5afad5dbea83ef4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9707102549bba889b7d54cdfe5afad0000664000000000000000000000007713257152177027046 0ustar BBBBBàBBABBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/96de8f2dbe2c51e4db764ce6762e7e23e83f155aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/96de8f2dbe2c51e4db764ce6762e7e0000664000000000000000000000005213257152177027130 0ustar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/96dcd2f5284451b925066fecb7844bf6c3f8e360qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/96dcd2f5284451b925066fecb7844b0000664000000000000000000000005613257152177026626 0ustar BBBBBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/968edef5f3c77076d179ab728a03e738ffd2612aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/968edef5f3c77076d179ab728a03e70000664000000000000000000000010013257152177026706 0ustar BBBBBBBBBBBBBBBt'!!!!»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9610cf029b659975fe3b934c26e9c6a3d5b8bc6fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9610cf029b659975fe3b934c26e9c60000664000000000000000000000003513257152177026556 0ustar BBBBBBBBBBUBBBBBBBBBBàBUUB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/94d679bedcfc779f97010e4b78c6e1bffe21610aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/94d679bedcfc779f97010e4b78c6e10000664000000000000000000000006513257152177027005 0ustar BBBBàBàBBCBBBBBàBBàBBCBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/94c46dae201a39e73d473ecb0faa02d836429983qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/94c46dae201a39e73d473ecb0faa020000664000000000000000000000005113257152177027004 0ustar BBBBBBBBBBBBBBBBBBBBBBBƒBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/944d8b719fae85d6dc793d8a444e227ffe90c3e0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/944d8b719fae85d6dc793d8a444e220000664000000000000000000000000313257152177026707 0ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/93f6d0ea59c78ccd1b7a7fde41d024d771603c4dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/93f6d0ea59c78ccd1b7a7fde41d0240000664000000000000000000000010013257152177027102 0ustar BBBBBBBBBBB€€€€€€€€€€€€€€€€€€€BBBBBBBBBàBBBBBBBBBÁBÀU././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/92ea46cabad2998a835186b598c7eaa8e48593e6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/92ea46cabad2998a835186b598c7ea0000664000000000000000000000001713257152177026767 0ustar qÿÿÿÿqÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/929fe3aa545031ff96c82b3d6368264f2deaccafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/929fe3aa545031ff96c82b3d6368260000664000000000000000000000010013257152177026534 0ustar UBUUBÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀBBBBBBBBBBB BB””€€q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9022e3bb89c65c34779ee5a6e65ed96bb4cb89e1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/9022e3bb89c65c34779ee5a6e65ed90000664000000000000000000000006413257152177026720 0ustar BBBBBBBBBBBBCCCBBBBBBBBBBBBBBBBCCCBBBBBBBBB¤././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/90119b4cd28f474dc88b786a1fc02b7aaebf74fbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/90119b4cd28f474dc88b786a1fc02b0000664000000000000000000000004713257152177026675 0ustar Q!!!ÿq!!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8fde430412ce28447cc431b09b43c78b94d172e0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8fde430412ce28447cc431b09b43c70000664000000000000000000000006613257152177026603 0ustar BBBBBBBBBBBBBBBBBBBBBBBàBBBBÂBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8fb4526041619ea544694b2b7462d019ff415daaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8fb4526041619ea544694b2b7462d00000664000000000000000000000005613257152177026371 0ustar BBU././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8f0dcc3c0c2881591606a6cfae4d7a40a541395fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8f0dcc3c0c2881591606a6cfae4d7a0000664000000000000000000000002313257152177027017 0ustar BBBàBBàBBCBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8cc9604623a30869971358f3235ce8e960820114qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8cc9604623a30869971358f3235ce80000664000000000000000000000007713257152177026336 0ustar BBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8cb5131ac6337005d3a23efd9d94c2ddf1bd3938qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8cb5131ac6337005d3a23efd9d94c20000664000000000000000000000005413257152177026654 0ustar BBBBBBBBBBBÁÁBBBBÁÁBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/89f612b51ca19b9f0c244fa81845b484bc57d136qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/89f612b51ca19b9f0c244fa81845b40000664000000000000000000000010013257152177026601 0ustar q@@@@qÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/88ee103f9c47212ced1c9f6fd7a20e95c4095f19qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/88ee103f9c47212ced1c9f6fd7a20e0000664000000000000000000000010013257152177027024 0ustar UBUUBÀÀÀÀÀÀàÀÀÐÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀBBBBBBBBBBB BB””€€q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87d98763316419775b8d690327d4e8bf802152f0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87d98763316419775b8d690327d4e80000664000000000000000000000007413257152177026275 0ustar ‚‚‚‚BBBBBBBBBB‚‚‚‚‚:‚‚‚‚‚‚‚‚‚‚‚RBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87d8e50f96c69fddd8f22c32b30582917021a220qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87d8e50f96c69fddd8f22c32b305820000664000000000000000000000007713257152177026717 0ustar BBBBBàBBCBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87462208128c52f83853f4a94c35d1aec237ac45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/87462208128c52f83853f4a94c35d10000664000000000000000000000001213257152177026313 0ustar qÿÿ°ÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/86271842fb128e34a4c1f594aafc3a4bba075366qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/86271842fb128e34a4c1f594aafc3a0000664000000000000000000000010013257152177026653 0ustar àààààBBB!BaaaaaaaaaaaaaaaaaBBBBBBBBÿà~BàBBCBBBBBàBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/85c058abaab38bd420fc55f0817b16124b22346bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/85c058abaab38bd420fc55f0817b160000664000000000000000000000007713257152177026740 0ustar BBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8589d344b9e163f99cdbe8db0c13ad06f692d695qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8589d344b9e163f99cdbe8db0c13ad0000664000000000000000000000006313257152177027045 0ustar €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/84b043799c08c0e3c7406376ab46f0ef9f95604eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/84b043799c08c0e3c7406376ab46f00000664000000000000000000000004013257152177026444 0ustar BBBBBBBBBBBBBBBBBBBBBBBBÁÁ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/82b3c67d8913e923d18c7333b4486f147e277addqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/82b3c67d8913e923d18c7333b4486f0000664000000000000000000000001213257152177026461 0ustar BBBBBÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8036f1bff0cd57ee5590563c2daea89a3a81bce4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/8036f1bff0cd57ee5590563c2daea80000664000000000000000000000005513257152177027033 0ustar BBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7eb30a49404f47f721704004002c21e61567268bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7eb30a49404f47f721704004002c210000664000000000000000000000007013257152177026253 0ustar BBBBBBBBBBEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7e73cf7d1dec840cf43cb47ebfd5999e6895f736qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7e73cf7d1dec840cf43cb47ebfd5990000664000000000000000000000004613257152177027212 0ustar €€‚àààààààààààààààààààààààààààààBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7dcda419a0136b04d1c7b213becfd7cb18c480a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7dcda419a0136b04d1c7b213becfd70000664000000000000000000000007713257152177027067 0ustar €€‚ààààààààààààààààààààààààààààà€‚àààààààààààààààààààààààBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7d5cd17bbe3c6286dcab37300cd5a837968a744bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7d5cd17bbe3c6286dcab37300cd5a80000664000000000000000000000007713257152177027103 0ustar €€‚ààààààààààààààààààààààààààààààà€€ ÿÿÿBQB ÁÁBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7d16ed32a32873542e88d15c0786baadc153ffacqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7d16ed32a32873542e88d15c0786ba0000664000000000000000000000010013257152177026523 0ustar UBUUBÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀì;:!ÀBBBBBBBBBBB BB””€€q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7cee3b310473e18fdc3bca6757d954acd84d5a47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7cee3b310473e18fdc3bca6757d9540000664000000000000000000000004713257152177026756 0ustar qÿq!!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7ac444a8b609d203de51a75dbb502a303ad46af7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7ac444a8b609d203de51a75dbb502a0000664000000000000000000000010013257152177026714 0ustar BBBBBBBàBJàBBCoBBBBBBBBB;sBBBBBBBBBBBBBCCBBBBBBBàB”B@B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7a2301324e675dc426353f1a4b1027e4d36a7576qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7a2301324e675dc426353f1a4b10270000664000000000000000000000005013257152177026336 0ustar BBBàBBàBBCÿÿBBBBBàBBàBECBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/73a3a4a97de05179a8bed2595cea29c865ba0f2bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/73a3a4a97de05179a8bed2595cea290000664000000000000000000000003613257152177026756 0ustar BBBBBBBBBBBÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7388dbec8f224961a872bf027021e45465d61ce2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7388dbec8f224961a872bf027021e40000664000000000000000000000010013257152177026523 0ustar BBBBBBBBBBBÁBBBBBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBBBBqÿÿaÈ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7270ad5e4cae3c3dfc0af09d656df6a18e9753ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/7270ad5e4cae3c3dfc0af09d656df60000664000000000000000000000004013257152177027160 0ustar àBBCBBBBBBBBBBBBCBÑBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6dc5210b21ff6b48b2644c41e603e56d964c7925qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6dc5210b21ff6b48b2644c41e603e50000664000000000000000000000006013257152177026567 0ustar »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d95b2c03f1240a1ff6243efe4316d76112aa1c4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d95b2c03f1240a1ff6243efe4316d0000664000000000000000000000005113257152177026651 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d74b472e0e803d01e7d49622807ac9f82c6282aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d74b472e0e803d01e7d49622807ac0000664000000000000000000000004613257152177026527 0ustar BBBàBBàBBCBBBBBàBBàBBCBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d4cfb1899e549436fffc968ffbe17d1bdb4981fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6d4cfb1899e549436fffc968ffbe170000664000000000000000000000010013257152177027065 0ustar BBBBBBBBBBBBBàBB!BÁÁÁÁÁBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6cc7a6e92cb942661da236fe0bc1a88ce0943e41qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6cc7a6e92cb942661da236fe0bc1a80000664000000000000000000000010013257152177027013 0ustar BBBBBÁÁBBBBBBBBBBBBBBBà~BàBBCBBBBBàBBB@BBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6a91b6b8e52ef56fa3c0f066c7a16f8cf06f4e3eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6a91b6b8e52ef56fa3c0f066c7a16f0000664000000000000000000000010013257152177027022 0ustar ‚‚‚‚BBBBBBBB‚‚‚‚BBBBBBBBBBBBB‚‚‚!‚:‚‚‚!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6a0382df652d013e1edef30798aafd9969c5358cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/6a0382df652d013e1edef30798aafd0000664000000000000000000000004013257152177027015 0ustar BsUsBBBBBBBBBBB@J././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/68d08633981a218f28b74cf75e80cebf92832aadqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/68d08633981a218f28b74cf75e80ce0000664000000000000000000000007613257152177026555 0ustar BBCCCBBBBBBBBBBBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/67f485db7187951d606968d53481975ebdd140cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/67f485db7187951d606968d53481970000664000000000000000000000010013257152177026266 0ustar EBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁB@BBBBBÁÿÿBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/67788e345c59f6380356a18a1b3fdaa3d6bf56e8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/67788e345c59f6380356a18a1b3fda0000664000000000000000000000010013257152177026535 0ustar sssssssrsssssssssssss€€€€€BÔÔÔÔÔÔÔÿÿÿÿÿÿÿÿBBBBBBBBBÿÿÿBBBÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/670503a3ad666ad264d4dfe4204844af2db8b799qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/670503a3ad666ad264d4dfe42048440000664000000000000000000000010013257152177026510 0ustar BBBàBBðBBCBBBBBàBBàBBCBB@BBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/66ddb1915e95ed33c1e7e0afc4d4a50157a3d90dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/66ddb1915e95ed33c1e7e0afc4d4a50000664000000000000000000000010013257152177027077 0ustar €€€€€€€€€€€€€;BBBBBàB @BBBBBBBBBBBUBàB@BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/65bc7fa648ed685df390f496e3c7566aeeae5cfbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/65bc7fa648ed685df390f496e3c7560000664000000000000000000000010013257152177026716 0ustar BBBBBàB CBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBbEBBBBBBRcBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/64c25538da99eda5696c7ab3dce8a36616190099qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/64c25538da99eda5696c7ab3dce8a30000664000000000000000000000006513257152177027047 0ustar BBBBBBBBBpBBBBBBBBBBBBBBBpBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/646ad8588c10052309e585d44f5e663a4c79c81bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/646ad8588c10052309e585d44f5e660000664000000000000000000000002113257152177026400 0ustar @././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/634c2f6388eedc9f0c615b10130ae1860ff658b5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/634c2f6388eedc9f0c615b10130ae10000664000000000000000000000004013257152177026647 0ustar BÁBBBÁÁ ÁÁBÁB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/63368462f916816346fdfe647fd83405550b22e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/63368462f916816346fdfe647fd8340000664000000000000000000000005313257152177026424 0ustar BBBBBBBBBBUBBBBBBBBBBàBUUBBB ÄUUBÀBBÀBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/62ef1e8c0a8478804076a8e7924fc2ab614da0cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/62ef1e8c0a8478804076a8e7924fc20000664000000000000000000000007713257152177026553 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBƒBBBBBBBBBBƒBBBBBBBB¡././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5f8c14264968e6d11ae31690331d536564ac9608qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5f8c14264968e6d11ae31690331d530000664000000000000000000000007513257152177026374 0ustar UUUUUUBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5e04745ab61dd297a367e6aac94acf0dd26bc2b5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5e04745ab61dd297a367e6aac94acf0000664000000000000000000000010013257152177027020 0ustar BBBBBBÁÁBBBBBBBBBBBBBBBB£BBÁÁBBBBBBBBBBBBBBBB£././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5d3657793c87ed5fd6282321679c6ddd2c65c0c9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5d3657793c87ed5fd6282321679c6d0000664000000000000000000000010013257152177026474 0ustar BBBBBBBrBBBBBBBBBBBB³Õ¾B½BBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5d04c3cec60717eafaa3efbb58cfe814b6181fd4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5d04c3cec60717eafaa3efbb58cfe80000664000000000000000000000003113257152177027317 0ustar qSSSSSSSS;SSSÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/59dd49ce085fd124b65173d1076f29396d150c83qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/59dd49ce085fd124b65173d1076f290000664000000000000000000000007713257152177026547 0ustar BBBBBBBàqqqqqqqqBJàBBCBB;././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5994e79a4ad75d00f8da8e6811e34f627473eca9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5994e79a4ad75d00f8da8e6811e34f0000664000000000000000000000010013257152177026702 0ustar BBBB””””””””BBBBBBBAAAAaAA`B@BBBBBBBBBB`B@UUUBBB@BBBBBPÁ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/59583e1ba89250b966f8ef1d1d90de6209c8e6acqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/59583e1ba89250b966f8ef1d1d90de0000664000000000000000000000001113257152177026702 0ustar ;!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/58a4cc7b5e4b680e66dd15e2a550d7c7644d989bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/58a4cc7b5e4b680e66dd15e2a550d70000664000000000000000000000010013257152177026741 0ustar BBBBBBBBBBB€ÿ!BBÄ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/587bd276a0172b5a9069a88f093be999c04deb95qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/587bd276a0172b5a9069a88f093be90000664000000000000000000000003113257152177026540 0ustar qSSSSSS\SSSSSSSSS;SSSÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/57b5dee9133bf8cac8a5297e6ae7e9ad5dc92c5fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/57b5dee9133bf8cac8a5297e6ae7e90000664000000000000000000000002213257152177027127 0ustar @J././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5788dda1108c220de397f3ba70d4e40d22b9e5b1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5788dda1108c220de397f3ba70d4e40000664000000000000000000000005613257152177026666 0ustar UBUUBÀBUUBÀÀÀCBB@BBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/572abdf1c0cb9305fe7fd6c869e79c4c37a3fdcfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/572abdf1c0cb9305fe7fd6c869e79c0000664000000000000000000000010013257152177027117 0ustar qÿq!!!'ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/554e2fc35786a8bc1b1289a99dfd21b1ec0b5abdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/554e2fc35786a8bc1b1289a99dfd210000664000000000000000000000005213257152177026700 0ustar BBBBBBBBBBBBBBBàBàBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5530e01f39e5c0ee60d0349e85ec348be000b4abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/5530e01f39e5c0ee60d0349e85ec340000664000000000000000000000005413257152177026605 0ustar BBBBBBBàBJàBBCoBBBBBBBBB;././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/54abe8fd6506fb93f27dad7bd3b182cab9945f77qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/54abe8fd6506fb93f27dad7bd3b1820000664000000000000000000000003013257152177027105 0ustar qSSSSSSSSSSSSSSSSSSSÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/535d2172016287e13584e38ee448431f1a8d750eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/535d2172016287e13584e38ee448430000664000000000000000000000007313257152177026237 0ustar €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/52026dee1f892c7b10479f41d4f3b7ea1ed885f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/52026dee1f892c7b10479f41d4f3b70000664000000000000000000000002013257152177026604 0ustar BB`BBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/51cac562abbb1a080b6c104ed434b4cccdbe5206qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/51cac562abbb1a080b6c104ed434b40000664000000000000000000000010013257152177026753 0ustar BBBBBBBBBBB€€€€€€€€€BBBBBBBBBBBBàBBBBBBÿÿÿÿÿÿ!ÿB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/505353342b21b1ea75d15c99201061f2ea49d4afqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/505353342b21b1ea75d15c992010610000664000000000000000000000006313257152177026257 0ustar BBBBBBBBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBÐÐÐB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4ebff926f62191194dde0bd73c14af76fc2d6a1aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4ebff926f62191194dde0bd73c14af0000664000000000000000000000010013257152177027021 0ustar BBBBBBBBBBBBB€€€€€€BBBBBBBBBBBBBBCCCBBBBBB” BBBBBÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4d62e4e6686c14eb092933350e96845cd3c3cec5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4d62e4e6686c14eb092933350e96840000664000000000000000000000003613257152177026407 0ustar BB`˜BBBUUUUUUBUUUBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4c52d5b9ae2d610c7297c750d2131434b52ac6abqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4c52d5b9ae2d610c7297c750d213140000664000000000000000000000006413257152177026516 0ustar BBBB`B@BBBBBBBBBB`B@BBBBBBB`B@BBBBBBBBBB`B@BBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4bce78890f5182e32d66dc0811ffef515d14469aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4bce78890f5182e32d66dc0811ffef0000664000000000000000000000007113257152177026763 0ustar BÁBBBBBBÁÁÁÁÁBÁBBBBBBBBÁBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4ae6d6ef405295c5b80ea77160afdcfca03e0f05qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4ae6d6ef405295c5b80ea77160afdc0000664000000000000000000000005013257152177027023 0ustar BÁBBBB'BBÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈüÿÿÿBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4a5769fa5dc7bc785ca1305042f7c1ee1afbfde0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4a5769fa5dc7bc785ca1305042f7c10000664000000000000000000000007513257152177026670 0ustar BBBBBBBBBBBBBBBBBBBBBBBàBBBÂBBBBBBBÂBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4894614a7da785817d8e212afb6c5d33f0493c03qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4894614a7da785817d8e212afb6c5d0000664000000000000000000000004313257152177026622 0ustar qÿÿÿÿ„ÿÿÿÿ¿ÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4722c311eaa1d402a68418b2eb3c4b68cc72f1deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4722c311eaa1d402a68418b2eb3c4b0000664000000000000000000000006613257152177026635 0ustar BBBBBàB CBBàBÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐBBBBàBBCBBBBBBBBBàBBBÂ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/471c2364ab4f308845e1c92c50d5bf946486b7deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/471c2364ab4f308845e1c92c50d5bf0000664000000000000000000000006313257152177026602 0ustar BBBBBBBBBBUBBBBBBBBBBàBUUBBB ÄUUBÀBBÀBBBÀB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/463f92bc3101f67e9cb004fa1373c47aff5df967qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/463f92bc3101f67e9cb004fa1373c40000664000000000000000000000006613257152177026577 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁ@BBÁ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4609d36fbfcb7de62ca4cccbdd0e6b6684619920qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4609d36fbfcb7de62ca4cccbdd0e6b0000664000000000000000000000010013257152177027371 0ustar BBBBBBBBBBBBBBBBBBBBBBCBBBÁBBBBBBÁÁÁÁÁÁBBBBBBBBBƒ€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/41a4feab0faf29274779d280c5b445e4a4f1658dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/41a4feab0faf29274779d280c5b4450000664000000000000000000000007613257152177026673 0ustar BBCCCBBBBBBBBBBBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/41895820a2c3b06c68f00925146cb7b8609b1965qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/41895820a2c3b06c68f00925146cb70000664000000000000000000000010013257152177026352 0ustar BBB„BàBVVVVVVVVVVVVVVBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4149cfb2d28153cb125929406b020dc424ed2874qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/4149cfb2d28153cb125929406b020d0000664000000000000000000000001513257152177026424 0ustar qÿÿqÿÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3e8b1cbbdd7d39f4380215d115876f733691541cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3e8b1cbbdd7d39f4380215d115876f0000664000000000000000000000010013257152177026662 0ustar àBBBBàBBàBBCBBBBBàBBàBBCBBBB*BBBBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3e85bc0cf748c38ccbd99cbf273b5eb491811882qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3e85bc0cf748c38ccbd99cbf273b5e0000664000000000000000000000010013257152177027173 0ustar UBUUBÀÀÀÀÀÀàÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀBBBBBBBBBBB BB””€€q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3dbcfbb72e9aec8027fd59cf5dbb5b7622f4cd10qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3dbcfbb72e9aec8027fd59cf5dbb5b0000664000000000000000000000007113257152177027411 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3daed92488870c9b606dfcb2c0eaf3c5909802beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3daed92488870c9b606dfcb2c0eaf30000664000000000000000000000010013257152177027102 0ustar UBBBBBBBBBBB‚ààtBBBBBBBàBJàBBCBBBBBBBVVBBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3bd8ff9cc41f9d31d13285464f40f85c1e135a64qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3bd8ff9cc41f9d31d13285464f40f80000664000000000000000000000005013257152177026677 0ustar BBB BBBBBBUBBBBBBUBBBBBBBBBàBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3b9c9703417110bf207fa3519bb00dde26a84c16qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3b9c9703417110bf207fa3519bb00d0000664000000000000000000000006313257152177026502 0ustar àBBCBBBBBBBBBà~BàBBCBBBBBàBBàBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3a036c7611cb5c40bfd2878c22e74b1711e9063aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3a036c7611cb5c40bfd2878c22e74b0000664000000000000000000000010013257152177026644 0ustar BBBÀÀÀÀÀÀÀ¼ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀBB`B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/39467cb48ada6c483c25a12460d5a25fad311a20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/39467cb48ada6c483c25a12460d5a20000664000000000000000000000010013257152177026566 0ustar UBUUBÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀSSSSÿÿÀÀÀÀÀBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/391fde26a2984354c7f35af56a2df1c6f9e6d15eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/391fde26a2984354c7f35af56a2df10000664000000000000000000000006113257152177026674 0ustar BBBBBàBBBBBBBBBBBBBðÿBBBBBBBBBBðÿBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/38c82cf568757e43211966e8f6b15d75ca3f6b09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/38c82cf568757e43211966e8f6b15d0000664000000000000000000000007413257152177026501 0ustar BUUUUBUUUBBBBBBBBBBBBàBB¡Q¡¡¡¡¡BBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/380a4b62d096edc0537835f69383e0bba6cbd32cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/380a4b62d096edc0537835f69383e00000664000000000000000000000004713257152177026460 0ustar BBBàBBàBBCBBBBBà¿BBàBBCBBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/36e6bebeca494c35e7e9b99db2b43358b3667e51qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/36e6bebeca494c35e7e9b99db2b4330000664000000000000000000000010013257152177027112 0ustar BBBBBBBBBBBBBBBBBBBÁÁÁÁÁ'!!!!»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/35aabf876225222ede91a664f7e13407f147c5b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/35aabf876225222ede91a664f7e1340000664000000000000000000000004613257152177026610 0ustar BBBBBBBBBBÁBBBBBBBBBBBBBBBBBBÁÒ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/358e0b3f1727f37d1ddf8a370de813fe37e7d425qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/358e0b3f1727f37d1ddf8a370de8130000664000000000000000000000010013257152177026662 0ustar àBrBBBàBBCBBBBBBBBB€€€€BÔÔBBBBBBBBBàBBBÁÁ ÁÁBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3478b2d8bb4032631909490f8d9cd49388b2fb07qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/3478b2d8bb4032631909490f8d9cd40000664000000000000000000000007613257152177026464 0ustar BBBBBBBBtBBBBBBBBBBBBBt!BBBBBBBBBBBBBtBBBBBBBB'B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/346a3f8e8892f5725eb8d4a9c549f114170c3974qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/346a3f8e8892f5725eb8d4a9c549f10000664000000000000000000000007713257152177026650 0ustar BBBBBàBBABBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBBBàBBABBBBBBBBBàBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/32d67f75221011e28628a7cf332a21132ea9c120qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/32d67f75221011e28628a7cf332a210000664000000000000000000000010013257152177026341 0ustar BÁBBBBBBÁÁÁÁÁBÁBBBBBBBBÁBBBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/32c7cc7fcbe994a46ad357bc07cfe5e089c15c0cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/32c7cc7fcbe994a46ad357bc07cfe50000664000000000000000000000010013257152177027166 0ustar BBBBBBàBBàBBCBBBBBàBBBB`B@BBBBBBBBBB`B@BBBBBBBBBBBBBÀBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/319a8a6ee6de1e525d6cc744698e519cc7e821aaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/319a8a6ee6de1e525d6cc744698e510000664000000000000000000000010013257152177026677 0ustar àBBCBBBBBBBBBàBBàBBCBBBBBàBBàBBCBBBB*BBBBBBBCBBBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/30a8e034b3ee1fa1e755e1b4d2754530baebf924qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/30a8e034b3ee1fa1e755e1b4d275450000664000000000000000000000007213257152177026653 0ustar €€‚ààttttttttttttttttttttàààààààààààààààààààààààààààBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/30a491f2eeb07b96a078487bb7793123fb7d5c57qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/30a491f2eeb07b96a078487bb779310000664000000000000000000000006713257152177026542 0ustar UUUUUUBUUUB‚BBBBBBBBBBBBBBBBBBBBBBBBB!B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2fc316f9c2edb0adbd7f8c4caeb54e99cba4170bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2fc316f9c2edb0adbd7f8c4caeb54e0000664000000000000000000000007413257152177027404 0ustar BBðÿBBBBBBBàBBBBBBBBBBBBBðÿBBBBBBBBBBðÿBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2f68b410255b3e261f9e58ce6792c23e68f4c868qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2f68b410255b3e261f9e58ce6792c20000664000000000000000000000007313257152177026541 0ustar BBBBBBBBBBBBBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2ef995b370c23d57ce7be21e3cd022e410d4218eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2ef995b370c23d57ce7be21e3cd0220000664000000000000000000000004213257152177026737 0ustar BBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2eb025cd140dc74a0c49b8d4645abf55e674ac47qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2eb025cd140dc74a0c49b8d4645abf0000664000000000000000000000010013257152177026777 0ustar BqÿqqÿÿÿÿsUsBBBBBBBBBBB@J././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2e6b0c7f71109de0829390e7fa3eed1ba6dd0559qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2e6b0c7f71109de0829390e7fa3eed0000664000000000000000000000003713257152177026754 0ustar BBBBBBBBBBBBCCCBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2d85eadee55e378bcd0a792db5a3ac7cebdf4713qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2d85eadee55e378bcd0a792db5a3ac0000664000000000000000000000003713257152177027246 0ustar q€RRRRRRRRRÿHÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2c32942031cc8e3dedfae51ea0986b319f89940dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2c32942031cc8e3dedfae51ea0986b0000664000000000000000000000002513257152177027015 0ustar '!!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2b6efbdd477e2f4126f8907038e9a70ecc357725qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2b6efbdd477e2f4126f8907038e9a70000664000000000000000000000007713257152177026715 0ustar BBBBÁÁÁÁÁ”BÁBBBBBBBBBBÁBBBBBÁÁÁÁÁ”BÁBBBBBBBBBBÁ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2b524c5dc39ae7c7125050030b9505a3bc7b1225qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2b524c5dc39ae7c7125050030b95050000664000000000000000000000010013257152177026414 0ustar BBàBBàBBCBBBBBBBBBàBBBBBBBÁBBBÁÁ Á!à•BBBUUBÀÀss³B././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/28f63bf2561f38a74deb322df24c67f1795c358bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/28f63bf2561f38a74deb322df24c670000664000000000000000000000000713257152177026672 0ustar ££££££q././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/276989d3a1198a850d6e5fd9faf64ac20a6302a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/276989d3a1198a850d6e5fd9faf64a0000664000000000000000000000010013257152177026707 0ustar BBBBBBBBBBÁBBBBBBì;!!»»»»ÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/26e9dee2f7cf4ac70684f2295234d35d54d4db14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/26e9dee2f7cf4ac70684f2295234d30000664000000000000000000000007413257152177026705 0ustar BBBBBBBBEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/25a07a684179cabbe28beb204487cda411407448qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/25a07a684179cabbe28beb204487cd0000664000000000000000000000006313257152177026741 0ustar ðBBBBBBBBBBBBBBBBBƒBBBÿÿBBBBIBBƒB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2531441ea4a7f9f608f6db62e551761abba8c862qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2531441ea4a7f9f608f6db62e551760000664000000000000000000000003613257152177026536 0ustar BBBBBBBàBJàBBCBBBBBBBBB;././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2491e4d0fed44be84c1e4b1d956f273b969c7b60qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2491e4d0fed44be84c1e4b1d956f270000664000000000000000000000003113257152177026747 0ustar qSSSSSSSSSSSSSSSS;SSSÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/242d86b73ab9111870fa6b796970b6b0012d0df0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/242d86b73ab9111870fa6b796970b60000664000000000000000000000007713257152177026464 0ustar BBBBBBBBCCBBBBCBBBBBBBBBCCBBBBCBBBBBBBCCBBBCBBBCBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/23db969735e59176b37faa318929dcde56c3e58fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/23db969735e59176b37faa318929dc0000664000000000000000000000010013257152177026544 0ustar €€€€€ÿÿÿÿBQBBBBB@BBBBBBBBBBBBBBBÁÁ ÁÁBBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/22ea1c649c82946aa6e479e1ffd321e4a318b1b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/22ea1c649c82946aa6e479e1ffd3210000664000000000000000000000000113257152177026664 0ustar q././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2253e93e12a1c7860b735a928ecd5b16416cf6e0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/2253e93e12a1c7860b735a928ecd5b0000664000000000000000000000007313257152177026606 0ustar BBBBBBBBBBBBÁBBBBBBBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBà././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/21434b73d6364d3614e73736b3102518b7dad11eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/21434b73d6364d3614e73736b310250000664000000000000000000000003613257152177026215 0ustar BBBBBBBBBBBÁÁBBBBBBVB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/21296e8fb7ebb8c1273ea864c6efa25dee66d327qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/21296e8fb7ebb8c1273ea864c6efa20000664000000000000000000000001213257152177027030 0ustar BBB³Bÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1f46a7e933dccab6f21bcf4d8831b92755909ea4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1f46a7e933dccab6f21bcf4d8831b90000664000000000000000000000005613257152177027113 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBB@BBBBBPBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e5c5074bf89dac331144782de6761a2fa4511a4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e5c5074bf89dac331144782de67610000664000000000000000000000007713257152177026540 0ustar BÁBBBBBBÁÁÁÁÁBÁBBBBBBBBÁBBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e4ee6dc56c3a3d8b8ed0c3075fb1b6bf3dd45d2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e4ee6dc56c3a3d8b8ed0c3075fb1b0000664000000000000000000000010013257152177027150 0ustar BBBBBBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBBBBBÁÁBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e08e424559943bec2b96a1509e25596f417222aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1e08e424559943bec2b96a1509e2550000664000000000000000000000004013257152177026447 0ustar BÁBBBÁÁ ÁÁB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1d43044bc952e0b52da5130def9e4b135489c16aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1d43044bc952e0b52da5130def9e4b0000664000000000000000000000004713257152177026730 0ustar BBBBBàB CBBàBBBBBàBBCBBBBBBBBBàBBBÂ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1cc44363cb21dfdfbc125c9e6b3afe2bffdd2136qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1cc44363cb21dfdfbc125c9e6b3afe0000664000000000000000000000007713257152177027237 0ustar BBBBBBBBBBBBBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBCBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1b8f579cb3c66cb74172eb95361ec664bb18594aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1b8f579cb3c66cb74172eb95361ec60000664000000000000000000000007713257152177026707 0ustar BBBBBBBBDBBBBBBàBBBBBBBBBBBBBBBBBBBBBàBBRBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1b7413cdc7c8f642dbaefaa1e212b37b44e5ea09qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1b7413cdc7c8f642dbaefaa1e212b30000664000000000000000000000010013257152177027132 0ustar BBBBBBBrBBBBBBBBBBBBBBBB*BBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1ad2a244ea0e0b87f9983e269bfb85adc93aca67qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1ad2a244ea0e0b87f9983e269bfb850000664000000000000000000000010013257152177026745 0ustar BBBBBBBBBBBBBBBB@BBBBBPBB@BBBBBPBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/19fd189a63f28ff337561ddfa58f74bbb92dda44qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/19fd189a63f28ff337561ddfa58f740000664000000000000000000000007713257152177026725 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBƒBBBBBBBBBBƒBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/194ea0743519e47f0438d84444e82932baaae28bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/194ea0743519e47f0438d84444e8290000664000000000000000000000007713257152177026335 0ustar BB`BBBBBBBBBBÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/173d86f9fd2e5c9d6451b4c593ff42126dd89080qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/173d86f9fd2e5c9d6451b4c593ff420000664000000000000000000000007013257152177026712 0ustar BÁBBBÁÁ ÁÁBBÁBBBÁÁ ÁÁ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1684515a8a6d71a9a9c05a8ab1698df1e03cea78qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1684515a8a6d71a9a9c05a8ab1698d0000664000000000000000000000006113257152177026612 0ustar àBBCBBBBBBBBBà~BàBBCBBBBBàBBàBBBBCBBBBRBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1680421df0f80ea05cdf27362f0e4ec65b8f1c36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1680421df0f80ea05cdf27362f0e4e0000664000000000000000000000007613257152177026660 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/166a395a74a85064813073fdc31723b0c0f79d24qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/166a395a74a85064813073fdc317230000664000000000000000000000010013257152177026274 0ustar BBBBBàBBABBBBBD€€€€€€€€BÔÔBBBBBBBBBàBBBÁÁ ÁÁBBDB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/14abc23f6715b5e6d94a92f8504aa426fd2f75bcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/14abc23f6715b5e6d94a92f8504aa40000664000000000000000000000010013257152177026653 0ustar q@@@qÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/13cb61b1ed1df535fc041afb1be2dce780cda101qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/13cb61b1ed1df535fc041afb1be2dc0000664000000000000000000000007313257152177027213 0ustar @BBBBBBBBBBBB@BBBBBBBBBBBBBB@BBBBBPBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/131fec7386e5c0b5bf8f6bee0b77fe645ca9a062qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/131fec7386e5c0b5bf8f6bee0b77fe0000664000000000000000000000003613257152177027200 0ustar BBBB`B@BBBBBBBBBB`B@BBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/128ed50b2b8c170ab2323d781bc4e50c677f9570qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/128ed50b2b8c170ab2323d781bc4e50000664000000000000000000000002113257152177026636 0ustar !././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/12875399506a971a10358b7a00e6b6760cb0dd85qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/12875399506a971a10358b7a00e6b60000664000000000000000000000007513257152177026311 0ustar BBBBBàBBCBBBBBBBBBàUU±UUUBUUUB‚BBBBBBBÿÿÿÿÿBBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/127872f41efc5aa11a02956ab7fa6bba42da86f1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/127872f41efc5aa11a02956ab7fa6b0000664000000000000000000000001713257152177026732 0ustar tÿÿÿÿqÿÿÿÿÿÿÿ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1210f6b4fc6d509c70c154e605555dcbf3165db4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1210f6b4fc6d509c70c154e605555d0000664000000000000000000000000613257152177026514 0ustar  B‚‚././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1114bf5d187a979f6ce43a4763388a78bcf6cc8cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/1114bf5d187a979f6ce43a4763388a0000664000000000000000000000006113257152177026542 0ustar ðBBBBBBBBBBBBBBBBBBBBBBBBBƒBBBBBBBIBBƒB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/10ad3c9fe4bf2ddbda41f5f643a6d102bf01264eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/10ad3c9fe4bf2ddbda41f5f643a6d10000664000000000000000000000002513257152177027230 0ustar BBBqÿÿÿÿ„ÿÿÿ!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0d6bd457585e78be6a247beb2729556d208e3237qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0d6bd457585e78be6a247beb2729550000664000000000000000000000010013257152177026616 0ustar aaaaaaaaaaaaaaaaBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBÿBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0cb2850b8573eb9475fb95a1e9b4270cf7db2a1dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0cb2850b8573eb9475fb95a1e9b4270000664000000000000000000000007413257152177026622 0ustar CCBBBBBBBBBBBBBBBBBBÁBBBBBBÁÁÁÁÁBÁBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0b887b72973be42d6a66672ee8b11bf67f0684f8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0b887b72973be42d6a66672ee8b11b0000664000000000000000000000005513257152177026621 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBA!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0ac1e39c53f1e99a351f77f043a62753557d56a3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0ac1e39c53f1e99a351f77f043a6270000664000000000000000000000007113257152177026607 0ustar BBBBB`B@BBBBBBBBBB`B@BBBBBBBBB`B@BBBBBBBBBB`B@BBBBBBBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0aaac64d340e9584fcf06e2ca32415937e1b2d07qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0aaac64d340e9584fcf06e2ca324150000664000000000000000000000005513257152177026730 0ustar BBBBBBBBBBBBBBBBBBBBBBBBBpBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0834b6e0d04c7de369f2585778a6f129eb22926eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/0834b6e0d04c7de369f2585778a6f10000664000000000000000000000010013257152177026535 0ustar UBUUBÀÀÀÀÀÀÀÀÀ¼ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀBBBBBBBBBBB BB””€€²q€././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/06b616bedb3aa11311c2d851308d8cb590e6a5d4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/06b616bedb3aa11311c2d851308d8c0000664000000000000000000000006013257152177026632 0ustar BBBBBBBBBBBBBBBBBBBBBBBBÁÁÁÁÁÁÁBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/05ab0013dd39a2f2f3c7f476c9809dd8982b86c2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/05ab0013dd39a2f2f3c7f476c9809d0000664000000000000000000000003213257152177026660 0ustar !!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/02c40790514cb4813bcdd83cd332e890183beae8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/02c40790514cb4813bcdd83cd332e80000664000000000000000000000006513257152177026574 0ustar aaaaaaaa¥žaaaaaaBBBBBBBBBBB€€€€€€€BBBBBBBBBBB€BBÔÔÔ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/02bc5150936836f3220ef90fffc56a93c204ea0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/02bc5150936836f3220ef90fffc56a0000664000000000000000000000007713257152177026612 0ustar BBBBBà´½ABBBBBBBBBàBBBBBB?BBBBBBBBBBBàBBCBBBBBBRBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/028bebff230da9cb58a8e1cb3f823673e927a211qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/028bebff230da9cb58a8e1cb3f82360000664000000000000000000000010013257152177027072 0ustar BBBBÄBBBBBBBàBàBÄBBBBBBBàBàBB!BBBBBàBàBB././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/027fbb87a7755874c847ad653e121d9d8c37d283qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/027fbb87a7755874c847ad653e121d0000664000000000000000000000010013257152177026532 0ustar qÿÿÿÿÿÿÿÿÿ'!qq././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/01f9d85130582f2667270beb8fbff52a8b8e5701qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/01f9d85130582f2667270beb8fbff50000664000000000000000000000005513257152177026621 0ustar BBBBBBBBB'BBBBBBBBBBBBBBBBBBBBBBBBBB!././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/01d433bd6f26c56597e35fae04bfff92185c8d3eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/01d433bd6f26c56597e35fae04bfff0000664000000000000000000000010013257152177027023 0ustar BBBB`B@BBBBBBqsssssssssssssssBBBBBBBBBBB@J././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/018e5918d797c1d91f1b70e21826c75738275e23qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode/corpus/018e5918d797c1d91f1b70e21826c70000664000000000000000000000007613257152177026466 0ustar sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-message-decode.c0000664000000000000000000000242113257152177021445 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include "proton/message.h" #include "libFuzzingEngine.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (Size < 1) { // pn_message_decode would die on assert return 0; } pn_message_t *msg = pn_message(); int ret = pn_message_decode(msg, (const char *)Data, Size); if (ret == 0) { // FUTURE: do something like encode msg and compare again with Data } if (msg != NULL) { pn_message_free(msg); } return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/0000775000000000000000000000000013257152177022065 5ustar qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/0000775000000000000000000000000013257152177023165 5ustar ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/minimized-from-9a77cc2e90542c5aa1e55a86d2c9920febb0ad68qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/minimized-from-9a77cc2e905420000664000000000000000000000023013257152177027657 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-c¡2.0"sion¡2.5.0"DELAYED£kroduct¡apache5.0" n¡2.0"sion¡2.5.0"¡2.50"././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/leak-f1c681da874efe3b168d6bd00e1de53c5a3823eaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/leak-f1c681da874efe3b168d6bd0000664000000000000000000000115413257152177027407 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/leak-ccbdfccb91be2e40cebeafb39e6dd9e1ad8edb01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/leak-ccbdfccb91be2e40cebeafb0000664000000000000000000000060213257152177030075 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverC@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-f4746d4091c93455f5956220b4cac5f564f839b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-f4746d4091c93455f595620000664000000000000000000000060213257152177026776 0ustar AMQPSÀƒ ¡0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverC@@@@@@ƒXw·ùStÁA¡ Threadms-des:QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-db6080532aff930b4fe2a5b10d4e2755602713dcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-db6080532aff930b4fe2a50000664000000000000000000000115413257152177027326 0ustar AMQPSÀƒ ¡0.l7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR a1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-d16ad8ed5bb14a44fd9aaf065b7a0039fe76b045qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-d16ad8ed5bb14a44fd9aaf0000664000000000000000000000067513257152177027640 0ustar AMQPSÀƒ ¡0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-aisemtr£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-cacbe90ba41be2fb116697da7a90bfd716812c7bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-cacbe90ba41be2fb1166970000664000000000000000000000113413257152177027462 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVE*Y@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-c5f02e16faba556f15f25ddb154ba0fa518d7a65qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-c5f02e16faba556f15f25d0000664000000000000000000000057113257152177027413 0ustar AMQPSÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÀƒ ¡0ðð0ðð.ððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-bcc6e7efc2aef15b87941f7b8f094a5f85e3693fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-bcc6e7efc2aef15b87941f0000664000000000000000000000071613257152177027572 0ustar AMQPSÀƒ ¡0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-op"-jms1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-9baa46d068fe1f141f7ca902ff551148b3a67415qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-9baa46d068fe1f141f7ca90000664000000000000000000000047313257152177027424 0ustar AMQPSÀƒ ¡0.0.00@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-8ebe83e102fb91d923086dfc0b7e9d25503108ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-8ebe83e102fb91d923086d0000664000000000000000000000104213257152177027257 0ustar AMQPSÀƒ ¡AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBonqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-actiPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.exampl], thr`ad=0¡nt¡)Producer ActiveMQQueuress does not existueue[eProducer AktiveMQQueÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ.qtam././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-56e7d0e231b042433fb3e3d2fdb0a6c84d6d3230qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-56e7d0e231b042433fb3e30000664000000000000000000000053313257152177027161 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queuxample@@@@@SðR1CC SpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-48480935ddef21d91e40721dc817d0cc1dd362b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-48480935ddef21d91e40720000664000000000000000000000115413257152177027125 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-423d0960fb9e5de8f38648d01496c2b6cc714b5fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-423d0960fb9e5de8f386480000664000000000000000000000023113257152177027214 0ustar AMQPSÀƒ ¡B0BBBBBBBBBBBBBBBBBB.0.0.0@pÿÿÿÿ`ÿÿpu0BAMQPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBSÀƒ ¡:0.0.0.0@pÿÿBBBBÿ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-3ef8525af51bb7baf21094946b4264f96b7911a6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-3ef8525af51bb7baf210940000664000000000000000000000115413257152177027331 0ustar AMQPSÀƒ ¡0l.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£produst¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-3bd47a6ef995c3753f3f64b613be1f493bc14a36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-3bd47a6ef995c3753f3f640000664000000000000000000000111613257152177027277 0ustar AMQPSÀƒ ¡ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERVVVVVVVVVVVVVY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acpivemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-383737d1ae7cb9e2d4b95cc70ba1424192c510b0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-383737d1ae7cb9e2d4b95c0000664000000000000000000000111113257152177027340 0ustar AMQPSÀƒ ¡pÿÿÿÿ`ÿÿpCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCu0@@à1£s(lÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ@@¡jms.quy_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-335cfb1ba6db42c8fa846ed78031489ee29f585aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-335cfb1ba6db42c8fa846e0000664000000000000000000000101413257152177027466 0ustar AMQPSÀƒ ¡0.0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSÿÿAS@4 ¡ my_rece*šrCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: ààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààà27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-29d7bb9da4aed27c6caec297fad33cf880e36a2dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-29d7bb9da4aed27c6caec20000664000000000000000000000027213257152177027634 0ustar AMQPSÀƒ ¡0.0.0@pÿÿÿÿ`ÿÿsu0@@à1”QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-27e1553c53ea537b2af330ba3fbe69977f3dcc62qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-27e1553c53ea537b2af3300000664000000000000000000000067313257152177027170 0ustar AMQPSÀƒ ¡0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á4£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-2742f06be9488858351814016c9987513ceec8b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-2742f06be94888583518140000664000000000000000000000034413257152177026720 0ustar AMQPSÀƒ ¡ä0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cojnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿp€ÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-04747e43010d2356171000758c07324ed284f38eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crash-04747e43010d23561710000000664000000000000000000000026013257152177026563 0ustar AMQPSÀƒ¡RY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000021500000000000011601 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crafted_from_minimized-from-ac1dd1edf2357b0e4782088fa2bf80fdde832a43qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/crash/crafted_from_minimized-from-0000664000000000000000000000042113257152177030623 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCSÀCC 0Cðqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0000775000000000000000000000000013257152177023400 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ffaf7e3917bbdc057dfd6ecb658b038b6445f102qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ffaf7e3917bbdc057dfd6ecb6580000664000000000000000000000101613257152177027533 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ff100d80f889dbffc4f890a88a1322ff0ecc1beeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ff100d80f889dbffc4f890a88a10000664000000000000000000000104713257152177027317 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fec74bb501489bcdc2750e838b4ae8502beac6c7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fec74bb501489bcdc2750e838b40000664000000000000000000000115413257152177027223 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe932c4e4e9399e3c3b006747673b622ac89b1d0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe932c4e4e9399e3c3b006747670000664000000000000000000000115413257152177027024 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1 sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ.7@pÿÿÿÿ`ÿÿpu0@@à1 sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe657adf5907eb90a61e8f361ff12f1f9d38dc6cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe657adf5907eb90a61e8f361ff0000664000000000000000000000055713257152177027327 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-op"-jmeue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe623b8aaad870decb13c3d7db1fd07eb3782578qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fe623b8aaad870decb13c3d7db10000664000000000000000000000072713257152177027510 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq­artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÀCR 1CSpÀASrÁ£x-opt-jms-de÷stQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fca43536c2d216b951800d052fea3ca06ef9fbebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fca43536c2d216b951800d052fe0000664000000000000000000000000213257152177027032 0ustar !'././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fc3063c90471701998259e0000d92e059d5a93e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fc3063c90471701998259e0000d0000664000000000000000000000110013257152177026542 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqmrea-tis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fb105ed25fe090e73b077b33b1f021381cd5d343qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fb105ed25fe090e73b077b33b1f0000664000000000000000000000001013257152177027173 0ustar A././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa9ab7a41d1ffa2c66ad329927fa8eba00bd078aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa9ab7a41d1ffa2c66ad329927f0000664000000000000000000000074013257152177027361 0ustar AMQPSÀƒ ¡0.0.0.àààààààààààààààààààààààààààààààààÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀàààààà`ÿÿpu0@@à1£sole-connectinn-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£versBion¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXwààààààààààà0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-c·ùStÁA¡ ThreadSent¡)Proonnecti;nd././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa2e728c7ef2a4abb17585e41a5bf54e6af42171qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa2e728c7ef2a4abb17585e41a50000664000000000000000000000106313257152177027274 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt/jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡couTntSw¡test messaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡1.5.0"SÀu;cntTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa1a5c3b8ade843af827291c1f01e1d74a873f4cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa1a5c3b8ade843af827291c1f00000664000000000000000000000026613257152177027273 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@àapache-activemq-artemis£AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@version¡2.@5.0"SÀ`à1£sole-connection-for-Rpÿc././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa068d65d297163f7040df98df4d4695d10e3078qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/fa068d65d297163f7040df98df40000664000000000000000000000067313257152177027106 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀC€ 1CSpÀASkÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f9a7c794f371cf173489d884d85404cd19b4d4c1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f9a7c794f371cf173489d884d850000664000000000000000000000072613257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-ÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f7f6cdaecbaed3e61a9293aef3c4cad899eec0a5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f7f6cdaecbaed3e61a9293aef3c0000664000000000000000000000043713257152177027664 0ustar AMQPSÀƒ ¡0.ms-destQSsÀ% @@¡jms.queue.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f713f44766e813a31f00635ec8e0894cedd95e1cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f713f44766e813a31f00635ec8e0000664000000000000000000000000213257152177026773 0ustar Û¬././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f6fe7ba976dc1e1f6b2e0fc255f73403b7374cadqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f6fe7ba976dc1e1f6b2e0fc255f0000664000000000000000000000046313257152177027452 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f6256e2ba31f250bb7298d2cbe6cc74a896dfc02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f6256e2ba31f250bb7298d2cbe60000664000000000000000000000106313257152177027212 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveSÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f5bc7b885493f325f87ee0eb98100d302ea0e5b4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f5bc7b885493f325f87ee0eb9810000664000000000000000000000115413257152177027171 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR rྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f51eb45a3822e9be9304fdfc039ceadd35a2d597qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f51eb45a3822e9be9304fdfc0390000664000000000000000000000075013257152177027224 0ustar AMQPSÀƒqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f4e111c239b628a569f26d8bf1fd75cafc7f40caqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f4e111c239b628a569f26d8bf1f0000664000000000000000000000042413257152177027145 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f434f76708ada6f6d522957e52c4f1ad92a728b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f434f76708ada6f6d522957e52c0000664000000000000000000000053413257152177027100 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queu'xample@@@@@SðCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f343437aa46cb19c76cb7a91803bd74e40213afaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f343437aa46cb19c76cb7a918030000664000000000000000000000102613257152177027054 0ustar AMQPSÀƒ ¡5ÉÏ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-optÖjms-destQmy_receiverSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·S¾tÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f2ade4dcc6a3e0f0c266ef8f8bdf4b032120f76cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f2ade4dcc6a3e0f0c266ef8f8bd0000664000000000000000000000052013257152177027574 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1`QSsÀ% @SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1`QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Prod@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f1efffd97d15b0760276b9f4db29ab61119b16f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/f1efffd97d15b0760276b9f4db20000664000000000000000000000027213257152177027312 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1„QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eec93cdffd07a9f83e5f6a1b541ea290ab4d46faqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eec93cdffd07a9f83e5f6a1b5410000664000000000000000000000067313257152177027456 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eebaa207db81f825e3d562bdbadc47518c495156qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eebaa207db81f825e3d562bdbad0000664000000000000000000000047013257152177027504 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@àÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ1tQSsÀ% @@£jms.queue.example@@@@@@Xƒw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveM], thr`a././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ee7a6f2a296ce72967b6163a9b006c1c26df068cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ee7a6f2a296ce72967b6163a9b00000664000000000000000000000113513257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache%activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrPPPPPPPPPPPPPP„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„PPPPPPPÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ee36127976e1ebd48250f43b6bcd783fbac7b9b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ee36127976e1ebd48250f43b6bc0000664000000000000000000000032113257152177027137 0ustar AMQPSÀƒ ¡0.0.0.0@ptemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/edb7b9f8fafdecb6766f4db6b329bca10775ffc5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/edb7b9f8fafdecb6766f4db6b320000664000000000000000000000067313257152177027624 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿ`ÿÿpu0@@à1£'(le-connecti;n-for-containerDELAYED_DELIVERY@Á4£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀ CC0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.quequeue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£pt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ed3837aa5ead9b6635af8665bac871dc427f4136qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ed3837aa5ead9b6635af8665bac0000664000000000000000000000102113257152177027360 0ustar AMQPS¡.ƒ À00.0.ÿp@ÿ0ÿÿ`ÿÿpu0@@à1£sole-conqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`RpÿÿÿpÿÿQPS¡.ƒ À00.0.ÿp@ÿ0ÿÿ`ÿÿpu0@@à1£sole-conqection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_recÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ece765784f5a198d08d52e9fa7ddc57e8c818dafqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ece765784f5a198d08d52e9fa7d0000664000000000000000000000027213257152177027252 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ecdb1395825b2381172d544a01d1a007ff597e69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ecdb1395825b2381172d544a01d0000664000000000000000000000115313257152177026762 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0")SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exam:pleS)E@BC¸SÅCC 0CPpÀASrÁ£x-opt-jms-desUSUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúUUUU././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eca0d640c5aade9338cf4f0eed5ac6c3e907b29fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eca0d640c5aade9338cf4f0eed50000664000000000000000000000111013257152177027502 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-destQSsÀ%CCà0CPpÀASrÁ£¡-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ebdc2288a14298f5f7adf08e069b39fc42cbd909qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ebdc2288a14298f5f7adf08e0690000664000000000000000000000000113257152177027223 0ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ebbacdf34938dcba3a5cdb22848ddc733c7507d5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ebbacdf34938dcba3a5cdb228480000664000000000000000000000001513257152177027504 0ustar AMQP——Öþÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eba5cf5d9fbd040c1d1ad87fee7e115f62aecb5eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eba5cf5d9fbd040c1d1ad87fee70000664000000000000000000000003613257152177027575 0ustar AMQPMMÿÿÿÿÿÿÿhh)ÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb8998dace6678aeb5ee81e782f249810a1d5e33qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb8998dace6678aeb5ee81e782f0000664000000000000000000000035013257152177027415 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectiAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£on-for-containerDELAYED_DELIVERY@Á3£kroduct¡proapachduct¡e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb65422a78e3882b7a7fee19594e3587949ec10bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb65422a78e3882b7a7fee195940000664000000000000000000000006413257152177027103 0ustar Û¶¶clccc:cccccccccccccccccé¶¶clccc:ccccccccccccccccc././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb0305548c1ce54379de1592a36c12580c670670qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/eb0305548c1ce54379de1592a360000664000000000000000000000101513257152177026773 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·SeadSent¡tÁA¡ ThreadSent¡)Producer AktiveMQQueue[examplet], hr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e91d306c08d393bd467689814fc42cffcf882349qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e91d306c08d393bd467689814fc0000664000000000000000000000067313257152177027026 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSðÀASrÁ£x-opt-jms-destQSóÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 13././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e8df9f132e5a107a7de9b8b7cbf6cb5975f47c74qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e8df9f132e5a107a7de9b8b7cbf0000664000000000000000000000026513257152177027454 0ustar AMQPÀÁt¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exa'pSÀƒleS)././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e7c3d536a264a8014f8b064f9d047fef855fd5aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e7c3d536a264a8014f8b064f9d00000664000000000000000000000050213257152177027053 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e6f030201d47ec77f0cb12bb484337d8ecaa4917qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e6f030201d47ec77f0cb12bb4840000664000000000000000000000110513257152177027115 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£}-opt-jms-destQSsÀ%@¡jms.queue.example@sÀ% @@¡jms.queue.examqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e6b1383e0453335f2bf22e81c6b77f899bc3399fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e6b1383e0453335f2bf22e81c6b0000664000000000000000000000105413257152177027047 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-ÿÿÿÿÿÿÿÿdestQSsÀ% @@¡jms.queue.example@@@@@@ƒXW·ùStÁA¡ ThreadSent¡)Prÿÿÿ`ÿÿpu0@@à1£sole-cïnnection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e69f97838a8a5b8818049dcbc020c07dc1b21708qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e69f97838a8a5b8818049dcbc020000664000000000000000000000101613257152177027102 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acpivemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e591659f8f2ff99061272027c4ba172e8bbaf4e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e591659f8f2ff99061272027c4b0000664000000000000000000000076413257152177026751 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSple@sÀ% @@¡jms.queue.example@@@@@@ƒent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e4d02681dda9c9d17340f66e20f0dc90dcf46661qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e4d02681dda9c9d17340f66e20f0000664000000000000000000000115413257152177027141 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTS7¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e4af89d8b52ad1f6a246cd13179ccf2681a2345dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e4af89d8b52ad1f6a246cd131790000664000000000000000000000027213257152177027224 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1 tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e3ccd94c3b80f31b0385ca80bf21913f23f8afe5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e3ccd94c3b80f31b0385ca80bf20000664000000000000000000000101213257152177027255 0ustar AMQPSÀƒ ¡5ÉÏ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-optÖjms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e3202f275c787b0f1936bc6b06d3d728f46a1013qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e3202f275c787b0f1936bc6b06d0000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-act;vemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receivCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e2ef7ab13de170f3bed1511907fdf0b4b8382d49qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e2ef7ab13de170f3bed1511907f0000664000000000000000000000027713257152177027273 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1 tQSsÀ% @@¡jms.queue.example@@@@×@@ƒXw·StÁA¡ ThreadSent¡)Produÿcer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e2ad93cc62eaaf4e4c806b61f98f80ae54cb6582qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e2ad93cc62eaaf4e4c806b61f980000664000000000000000000000115413257152177027364 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀ CR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw£test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e232d1683da1d4ef3cc01e9f086c9952cca1378dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e232d1683da1d4ef3cc01e9f0860000664000000000000000000000067313257152177027217 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSðÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e15bb2fb15be91abce5398dd7ce4954b6b80778eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e15bb2fb15be91abce5398dd7ce0000664000000000000000000000071513257152177027520 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-For-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡0.5.0"S@ê`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampletÁA¡ ThreadSent¡)ProdS(À¡jms.queue.ex:ampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e0d2d66699106bdb562fb3df007daa426275c2a7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e0d2d66699106bdb562fb3df0070000664000000000000000000000063713257152177027143 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queueSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e01577742966ec70a32164035929dde15ce61478qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/e01577742966ec70a32164035920000664000000000000000000000051013257152177026474 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1AMQPSÿÿÿÿÿÿÿÿ.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`£sole-connection-for-containerDELAYECPSÀCCASÀ;£amqp:not-found¡(AMQRp2190: sourceÿ ÿad././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dfd70851a123d49f63fe9f8830290b354f941c12qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dfd70851a123d49f63fe9f883020000664000000000000000000000107413257152177027075 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU'UUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/df84c5a0849c81a91b6727e57a51c064f3ce9664qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/df84c5a0849c81a91b6727e57a50000664000000000000000000000054713257152177027102 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿdestQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/df44afcb2279e76ce037030be099917ca0e9689aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/df44afcb2279e76ce037030be090000664000000000000000000000027213257152177027214 0ustar AMQPSÀƒ ¡0.0.0.@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/de306bfe69c36905dba5456d38897ce582acd0ccqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/de306bfe69c36905dba5456d3880000664000000000000000000000027213257152177027155 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ƒQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd4d75ce95aa46584a94c307c5514513a504ceebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd4d75ce95aa46584a94c307c550000664000000000000000000000115413257152177027152 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀ CR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queuecountTRw£test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd494381250cd0442f0eb19383ab2fd4843ef181qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd494381250cd0442f0eb19383a0000664000000000000000000000051713257152177026770 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-op"-jmeue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd04bf1f6c5ced94b85a2679eac9680614e854e5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dd04bf1f6c5ced94b85a2679eac0000664000000000000000000000115413257152177027446 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dcd49610236e6fd9e1e4b6df531761720ad6a66bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dcd49610236e6fd9e1e4b6df5310000664000000000000000000000046313257152177027227 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)B@ECPSÀCCASÀ;not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dcca66b28d2cd2f38d9c18ad8c84aa011010868dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dcca66b28d2cd2f38d9c18ad8c80000664000000000000000000000067613257152177027457 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dbbafce1283cda7b734935ed8ef6b11c0a5d87a9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dbbafce1283cda7b734935ed8ef0000664000000000000000000000027213257152177027524 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dba84b3c91551693b3ee0023c5fe3e159a9fcc45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/dba84b3c91551693b3ee0023c5f0000664000000000000000000000113413257152177027125 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da59a60b025b8ce8edd8ec81c8e99e0d48f1e35eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da59a60b025b8ce8edd8ec81c8e0000664000000000000000000000041413257152177027444 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da4628d0922d119c58040b7416c36829a6635597qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da4628d0922d119c58040b7416c0000664000000000000000000000115413257152177026707 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiserCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da26aebb194644c9ad2d982111097ae1bf44a536qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/da26aebb194644c9ad2d98211100000664000000000000000000000047413257152177027127 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààctivemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡£s(le-apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-des‰QSsÀ% @@¡jms.queuexm.paeXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d946e89e9667145a0f91d298fbd3232446e95389qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d946e89e9667145a0f91d298fbd0000664000000000000000000000106213257152177027115 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaopt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d8bd027ae39a115ef2cbaa8d9de144ffeddc67d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d8bd027ae39a115ef2cbaa8d9de0000664000000000000000000000067613257152177027522 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d8aa5fa8ba489f699ff028a4972960d0b9119ebaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d8aa5fa8ba489f699ff028a49720000664000000000000000000000023713257152177027251 0ustar AMQPSRpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿÿÿÿÿSÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d72791067fd52e42eb49a8678e9373e46dde8dc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d72791067fd52e42eb49a8678e90000664000000000000000000000067613257152177027042 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQ¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d662faeabfb40de68133d1591d9caf21b0ea4b22qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d662faeabfb40de68133d1591d90000664000000000000000000000115413257152177027277 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1˜sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d5ebdd563169b07d3c594bee93084774e8253fd5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d5ebdd563169b07d3c594bee9300000664000000000000000000000115413257152177027226 0ustar AMQPSÀƒ ¡AM0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`RpÿAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpverCBPPS(À¡jms.queue.exampleS)Eÿÿpÿÿÿpÿ@BC¸ÿÀ rÁ£x-opt-jms-destQSsÀ% @@VERY@Á3£kroduct¡agacÿÿÿÿÿÿÿÿemq-artemis£version¡2.5.0"SÀ`€RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(ÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qur-containerDELAYED_DEeue.exLIVERamp`RpontainerDELAYED_SÀ ¡ my_recle],././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d5a872855397f5ec8dba280921788fcfbec7bf78qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d5a872855397f5ec8dba28092170000664000000000000000000000115313257152177027021 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-cinerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹´ë?÷û¼­þ 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qtest message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d515a418f77e1d1c9919c9ace3045ed918c8c715qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d515a418f77e1d1c9919c9ace300000664000000000000000000000050713257152177027147 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£proEEEEEEEEEEEEEEEEEEEEEEEEEEEpache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCcASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d48aee75343069bf16f19d26e983e3aa57d4f460qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d48aee75343069bf16f19d26e980000664000000000000000000000027213257152177027104 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1`QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d45fd1eaaca69b74aa83b1ad2f56d83fc2230986qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d45fd1eaaca69b74aa83b1ad2f50000664000000000000000000000071013257152177027501 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀúAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d417f7ca33e9b7382243b185891efb0da7a037bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d417f7ca33e9b7382243b1858910000664000000000000000000000073013257152177026730 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8y_receiverCBPPS(À¡jms.queue.example€S)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀmy_receiverASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d1c7d7d4bd4c5e898f65df8c8ddf3cad27d6da69qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d1c7d7d4bd4c5e898f65df8c8dd0000664000000000000000000000060113257152177027467 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.e1£sole-connection-for-containxampleS)E@BC¸SerDELAYED_DELIVERY@Á3£kroduct¡apachÀCC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d192931d713b1f4749f16bc33777865fc242b58aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d192931d713b1f4749f16bc33770000664000000000000000000000027213257152177026726 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1”QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d165e53c5b6e9bd880558bf9d24d6a576ade6a52qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/d165e53c5b6e9bd880558bf9d240000664000000000000000000000061713257152177027164 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚£sole-connectio’Ò™ÒœŽntainAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroducterDELAYED_DELIVERY@Á3£product¡apa¡apache-activemq-artemis£che-activemq-artemisÿÿÿÿÿÿÿÿ£version¡1.5.0version¡2.5.0""SÀ`SÀR././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cff19daad7962773d7b2d2fb2bd9aa72383711f3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cff19daad7962773d7b2d2fb2bd0000664000000000000000000000115413257152177027444 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSxÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf8cba792eab69cab31712341a65532bd771badeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf8cba792eab69cab31712341a60000664000000000000000000000115413257152177027266 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf3305c826c748d56b5b2562c0dd34343102e094qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf3305c826c748d56b5b2562c0d0000664000000000000000000000115413257152177027056 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£produst¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf24c640175cac15e73ef5b94761be16d82605b2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cf24c640175cac15e73ef5b94760000664000000000000000000000002013257152177027133 0ustar '÷÷÷÷÷÷÷÷÷÷÷÷J÷!././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce8a313c196c2ea7145b51bda95c7c3493dd0986qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce8a313c196c2ea7145b51bda950000664000000000000000000000115413257152177027207 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£ x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCRþ 1CSpÀASrÁ£x-opt-jms-destQSsÀ% G@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ÿœ‹Ÿvemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce4c51eb6b952d86b9f807fc38534e36a9920c9bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce4c51eb6b952d86b9f807fc3850000664000000000000000000000067513257152177027251 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0ÀPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce23f21316c5cfc3e612554644190e8de077e4b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce23f21316c5cfc3e61255464410000664000000000000000000000067313257152177026772 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·q StÁSÀC€ 1CSpÀASkÁ£xo-ptj-ms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce00ace885ee3471041db9ce16828b682111ff31qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ce00ace885ee3471041db9ce1680000664000000000000000000000046313257152177027217 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Vpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does notsxi et././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cd354a9656790b838e2f1e8b4fb83b496e931667qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cd354a9656790b838e2f1e8b4fb0000664000000000000000000000077513257152177027167 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cd1230a9612663f2dcbc39f42764ea7a776e88ddqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cd1230a9612663f2dcbc39f42760000664000000000000000000000046313257152177027055 0ustar AMQPSÀƒ ¡:0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3rdo£puct¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@²)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ccdaff4324e5c140394c967733a5cba0a0d0baa0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ccdaff4324e5c140394c967733a0000664000000000000000000000027213257152177027140 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@˜1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ccbdfccb91be2e40cebeafb39e6dd9e1ad8edb01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ccbdfccb91be2e40cebeafb39e60000664000000000000000000000060213257152177030005 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverC@@@@@@ƒXw·ùStÁA¡ Threadms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r ÇktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cc7d5a753003fc4dc0456dcb2705301c4c694bc7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cc7d5a753003fc4dc0456dcb2700000664000000000000000000000067513257152177027210 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jmtQSsÀ%CCà%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cbfcc138e3cbbb953730bf88c31d979938490063qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cbfcc138e3cbbb953730bf88c310000664000000000000000000000102013257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cb685ebaea43662d6edb107c408a3d9088daeec1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cb685ebaea43662d6edb107c4080000664000000000000000000000036113257152177027271 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cojnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"ÑÑÑÑÑÑÑÑÑÑÑÑÑS@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/caed263c71463cb8628ab54056aae639e4a8ea29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/caed263c71463cb8628ab54056a0000664000000000000000000000076313257152177027135 0ustar AMQPSÀƒ ¡0.0.0.0EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE@pÿÿÿÿ`ÿÿpu0@@à1£sole-pu0@@à1£sole-connection-for-contconnection-for-contai¸SÀCC 0CSpÀùASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue..queue.example¸SÀCC 1CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cad16e3feb3b4ed3fc0f5e45ef211dd9af60757eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/cad16e3feb3b4ed3fc0f5e45ef20000664000000000000000000000041513257152177027572 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@;à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPP>S(À¡jms.queuAMQPe.exampSÀƒleS)././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/caad06fdd1a53cc27d02bb3a83a5fab7a057f75bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/caad06fdd1a53cc27d02bb3a83a0000664000000000000000000000027213257152177027463 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1‚QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c8f8bd07151c676639ec5f293a9e2d51f47a105eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c8f8bd07151c676639ec5f293a90000664000000000000000000000115413257152177027103 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0Sw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c8bdf2beece7a6ced2bd7f5e4c7154f1b6722c11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c8bdf2beece7a6ced2bd7f5e4c70000664000000000000000000000115413257152177027747 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·S;ÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c85d5141b11e247ddca515e8a4b79c2ffde13590qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c85d5141b11e247ddca515e8a4b0000664000000000000000000000101313257152177027175 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASkÁ£x-opt-jms-destQSsÀ% CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c853516ae1838f0a9503e5e3ba2e2a023e00753bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c853516ae1838f0a9503e5e3ba20000664000000000000000000000061513257152177027054 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSðÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c80a9aae8471ef74360ab4085bc4c2dc1be97bc6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c80a9aae8471ef74360ab4085bc0000664000000000000000000000023613257152177027213 0ustar AMQPSÀƒ ¡0.0.0.;@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY`Á3£product¡a'ache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c730fd31aef6e41f0d1c444e7db2687cb0ae651fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c730fd31aef6e41f0d1c444e7db0000664000000000000000000000115413257152177027346 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c72a8fb1861b96e5c25b72f412c02e12466ea87aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c72a8fb1861b96e5c25b72f412c0000664000000000000000000000115313257152177027137 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-cinerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaÿÿÿÿÿÿÿÿaaaaaaaaaaaaaaaXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[exame ],tplhread=0¡countTSw¡test message: 26¹¼­þ 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qtest message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c6f66f355d32a17a63fc4e7847c4fdfa946ddca9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c6f66f355d32a17a63fc4e7847c0000664000000000000000000000104713257152177027155 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á2£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-6opt-jms-destQBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBSsÀ%CCà0CPpÀASrÁ£x-opt-jms-destQ¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c616630e295fa26b932c8c5148821c34cafce3f2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c616630e295fa26b932c8c514880000664000000000000000000000113413257152177026726 0ustar AMQP¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c5cffebc6890762c5059e7ae468ee3292704ebfbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c5cffebc6890762c5059e7ae4680000664000000000000000000000115413257152177027244 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASvÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c5c053c1ce41fe5d782cf29dbef7e111eb303b14qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c5c053c1ce41fe5d782cf29dbef0000664000000000000000000000106413257152177027441 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c59fc6451ec6db995a0e65a30215a8a7345f6e45qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c59fc6451ec6db995a0e65a30210000664000000000000000000000071513257152177027142 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCISÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c588b0b30804281f9b29eacfd66e56dbc93f5885qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c588b0b30804281f9b29eacfd660000664000000000000000000000115413257152177027144 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% G@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c54537b72ed6efc3e08a617bde6c3dfa1b3825dbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c54537b72ed6efc3e08a617bde60000664000000000000000000000027213257152177027306 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1UQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c361a2b998b608436eff227d329bb449607d509dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c361a2b998b608436eff227d3290000664000000000000000000000055013257152177027011 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-conne(tion-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c33a5f78a1514fd57cd88fbd5451cb439d5ebdecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c33a5f78a1514fd57cd88fbd5450000664000000000000000000000104713257152177027233 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERYÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ0//////3ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c30f5beff0fd5b0f767f799ff75dcf3cf0298cd2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c30f5beff0fd5b0f767f799ff750000664000000000000000000000066213257152177027414 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`RpÿÿÿpÿÿÿpÿÿASÀ1 ¡ my_receiverCBPPS(À¡jms.queue.exa0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c279e79c937b79d45c1823fe5c0439313c81b5cfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c279e79c937b79d45c1823fe5c00000664000000000000000000000110013257152177027075 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUUUUU././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c1ccdaa3cf50a0690c89ae16049dd96ac3af2226qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c1ccdaa3cf50a0690c89ae160490000664000000000000000000000044013257152177027257 0ustar AMQPSÀƒ ¡0.0.0.0@pÿ„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„ÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c1c457fbfa07b5855cc27f1e968f00615d13c611qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c1c457fbfa07b5855cc27f1e9680000664000000000000000000000115413257152177027233 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxampleAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverqqqqqqqqqqqqqqqÿÿÿÿÿÿÿÿqqqqqqqqqqqqqqqqqqqqqqqqqqple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQÆQueue[example], thread=0¡countTSw¡teSt message: 27temis£version¡1.5.0"S@`R¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀ-deor-containerDsc././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c07081a3bdb123c30e5718a67528fdf058489850qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c07081a3bdb123c30e5718a67520000664000000000000000000000070013257152177026751 0ustar AMQP€SÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c06f518d891d8f4f4586ac0696b1b345586e3b67qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/c06f518d891d8f4f4586ac0696b0000664000000000000000000000027213257152177027104 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bfc4dab55faa6bcb351e277389c2a36a13daea0eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bfc4dab55faa6bcb351e277389c0000664000000000000000000000111713257152177027434 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁD_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_reec*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bf7e16b4c35b617596e7fa830bd2d3936e2c9e53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bf7e16b4c35b617596e7fa830bd0000664000000000000000000000115413257152177027227 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS0E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/be33dd96db031d54ca4eb28e8036e1af25c9f559qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/be33dd96db031d54ca4eb28e8030000664000000000000000000000044413257152177027270 0ustar AMQPSÀƒ ¡0.0.TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-co:ntainerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/be02333000f17d004a082302b476366df5999badqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/be02333000f17d004a082302b470000664000000000000000000000115413257152177026570 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis˜version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bdb550726feefc348c4455c24cc7116719a31f02qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bdb550726feefc348c4455c24cc0000664000000000000000000000077413257152177027307 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑE@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bd99fe90a82d785d4f31797fe7b7ede12c845341qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bd99fe90a82d785d4f31797fe7b0000664000000000000000000000037613257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi£sversion¡1.5.0"erCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bbd6342f859499a9651ce11cec85c4c0d307cb36qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bbd6342f859499a9651ce11cec80000664000000000000000000000027213257152177027157 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1qQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bb866a2f8d475e0cd427c6e99e7bcc88360f6cefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/bb866a2f8d475e0cd427c6e99e70000664000000000000000000000046313257152177027247 0ustar AMQPSÀƒ ¡0.0.0®0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`€Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/baedb5aaed2df030c0b2e7ba51080703b43e4ec1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/baedb5aaed2df030c0b2e7ba5100000664000000000000000000000026313257152177027534 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1roduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ba9e2d30be1291cad843edd0a7585e24d4961818qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ba9e2d30be1291cad843edd0a750000664000000000000000000000035213257152177027341 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ba6d2ca7061f888a30f4d9c106785e376fdd6e0aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ba6d2ca7061f888a30f4d9c10670000664000000000000000000000112713257152177027136 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 my_receiverCBPPS(À¡jm.uqseue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connectioSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-contain-for-containerDELAYED_DELIVERY@Á3£kroœŠœŽ¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiversUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b9dc1834a15132a0e0fd05b8aa903ed269b1249eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b9dc1834a15132a0e0fd05b8aa90000664000000000000000000000027213257152177027174 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b92fb34478ff6a96240fe784085361524e966dc1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b92fb34478ff6a96240fe7840850000664000000000000000000000115413257152177027025 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connÀction-for-containerDELAYED_DELIVERY@Á3Vø”oduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1C!pÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b9299ef3f4a12daf88095659e744352438025bdbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b9299ef3f4a12daf88095659e740000664000000000000000000000077013257152177027116 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐðÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£prod¡cutapache-activemq-armts£eiversion¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b84206818dbf10d98d1c4523237a4ceae111c015qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b84206818dbf10d98d1c45232370000664000000000000000000000027213257152177026716 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1@QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7f747954813ca4388cef929b41cf2e06df29c4eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7f747954813ca4388cef929b410000664000000000000000000000046313257152177027030 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-aãtivemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7c7b300d6313ed7282b9f09ca21ed2561526f6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7c7b300d6313ed7282b9f09ca20000664000000000000000000000000513257152177027122 0ustar AMQP././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b754ec691ae094043d4ad98c9c0930ecc8533075qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b754ec691ae094043d4ad98c9c00000664000000000000000000000115413257152177027144 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E°BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7005c27a86327f44ccb0f659985badd25b01bd9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b7005c27a86327f44ccb0f659980000664000000000000000000000045313257152177027012 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-ar„„„„„„SsÀ%@ ¡@jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡j-s.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b6c93df4456cad48dff33661ce8c520aad0bf183qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b6c93df4456cad48dff33661ce80000664000000000000000000000040313257152177027312 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððÎððððð.ŒxamSÀƒ ¡0.0Ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xle@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b693900e85dea35d2a512b0616bd39a7496888b4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b693900e85dea35d2a512b0616b0000664000000000000000000000036113257152177027043 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b66e46bf1fdc1ea0b00a6d4c47485d824f6207e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b66e46bf1fdc1ea0b00a6d4c4740000664000000000000000000000101313257152177027332 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASkÁ£x-opt-jms-destQSsÀ% CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b5e224811eb49705c6eb9e4dd98ace74de089aa3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b5e224811eb49705c6eb9e4dd980000664000000000000000000000115213257152177027152 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.uueue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUBBBBBBUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b5b302e54780c17c58b6150ecedfaee30af4d96fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b5b302e54780c17c58b6150eced0000664000000000000000000000110013257152177027117 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@àLIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSsÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStAÁ¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b4f9c2c0a434fd9c7df40072050b6befc3cfcd2cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b4f9c2c0a434fd9c7df400720500000664000000000000000000000043013257152177027121 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿp£sole-connection-for-containerDELAYED_DELIle], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer Aktivest message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b4203e6310166edc8192f3ba7b9c9ed4da466591qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b4203e6310166edc8192f3ba7b90000664000000000000000000000027213257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1 tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b3c2600de44f4f2e6c4b46a68e4b2e0f152732aeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b3c2600de44f4f2e6c4b46a68e40000664000000000000000000000112413257152177027211 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£-connection-for-containerDELAYED_DE3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b30f4d3bdd5a1b9093cf7f241f9ad076f8c60a01qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b30f4d3bdd5a1b9093cf7f241f90000664000000000000000000000115413257152177027275 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b25109039fad80cf53505e981a25ccb2e95c7f83qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b25109039fad80cf53505e981a20000664000000000000000000000071513257152177026774 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_rSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpexampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example¹@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b09f54d6993758131454c22e255cd6695e64fb8cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/b09f54d6993758131454c22e2550000664000000000000000000000072713257152177026577 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af89087db1180549aa5fc11bbf334885a04f84b1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af89087db1180549aa5fc11bbf30000664000000000000000000000102713257152177027212 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-fwr-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec›eiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af621f0def81866d5e75adf95e8df1cc94c18e84qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af621f0def81866d5e75adf95e80000664000000000000000000000100413257152177027317 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸S˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜my_receiver˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜ÀCC 5CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent thr`ad=2¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af54ae55193e1a1e0725a876c1f3e22f1acfe065qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/af54ae55193e1a1e0725a876c1f0000664000000000000000000000067513257152177027142 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á4£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà=CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aeeb27d92fdafa7cb33df1ee37f253d27b16f74aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aeeb27d92fdafa7cb33df1ee37f0000664000000000000000000000064113257152177027661 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààctivemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡£s(le-apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-des‰QSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ad22a08f406e82897a8ef227d14ac23a24b08083qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ad22a08f406e82897a8ef227d140000664000000000000000000000101613257152177027061 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreadSeCSpÀASrÁ£x-opt-:jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ac3bdcae2ff2cd3cdaf336de95fedfa12a2156b8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ac3bdcae2ff2cd3cdaf336de95f0000664000000000000000000000072313257152177027733 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containÀs¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab8331404c256fd327ee4b17d7339e82c8883722qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab8331404c256fd327ee4b17d730000664000000000000000000000105413257152177027050 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-foroc-ntainerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab6324e1195565f435f307601a066f1706bf0c73qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab6324e1195565f435f307601a00000664000000000000000000000070013257152177026620 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab539ba3143f5898cdce6203a27d2260c9f1d831qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab539ba3143f5898cdce6203a270000664000000000000000000000023613257152177027135 0ustar AMQPSÀƒ ¡0.0.0.ààààààAMQPSÀƒ ¡0.0.0.0@[[[[[pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á6£pro!àààààduc././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab2203c149e63da773839ce3928a0c2110b4674eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/ab2203c149e63da773839ce39280000664000000000000000000000101713257152177027002 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not existSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@ÁÒ3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aad86b02e361df3073279ced4c700a87e8ac515cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aad86b02e361df3073279ced4c70000664000000000000000000000107713257152177027221 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kAMQP"ðSÀ`Rpÿÿÿpÿÿÿp;ÿÿroduct¡apache-activemq-artemis£versi)SÀ ¡ memq-artemis£versioÀ`RpÿÿÿpÈÿt-foASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThrestQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], threation-././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aa501555748d7c97260b4b14b79dbf6cd3654388qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/aa501555748d7c97260b4b14b790000664000000000000000000000067313257152177026727 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àA QPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á1£kroduct¡apache-act;vemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿA'SÀ4 ¡ my_receiverCBPPS(À¡j;s.queue.e1£solòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòe-connection-for-containxampleS)E@BC¸SerDELAYED_DELIVERY@Á3£kroduct¡apachÀCC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a9f2f4b18bb9f729db2e211e7f10065ee69c4409qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a9f2f4b18bb9f729db2e211e7f10000664000000000000000000000027213257152177027303 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a990f9d0f2dd6098767b7375107d36d122271a49qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a990f9d0f2dd6098767b73751070000664000000000000000000000057513257152177026752 0ustar AÿÿÿÿÿÿÿÿSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemqÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿD_DELI0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a8c51938af7168cacd336d2ba948e896287881a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a8c51938af7168cacd336d2ba940000664000000000000000000000115413257152177027223 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a6f6e4e44d716db73b883ad61476bb66fbe36b5aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a6f6e4e44d716db73b883ad61470000664000000000000000000000060013257152177027145 0ustar AMQPSÀƒ ¡0.0.0.0@pÿrrrrrrrrrrrrrrrr@@¡jmøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøs.rrrrrrrrrrrrrrrQSsÀ% @@¡jms.queue.example@sÀ% @@¡jmøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøs.queue.example@@@@@@ƒXw·;StÁA¡ Threa§dSent¡)ProdS(À¡jms.queue..queue.exampleÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a5fcd16190822e5c5cf548b49cdc31674a0067fcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a5fcd16190822e5c5cf548b49cd0000664000000000000000000000027213257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a564c13b7d634b687023464a533b778e8a17d52fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a564c13b7d634b687023464a5330000664000000000000000000000101613257152177026627 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASkÁ£x-opt-jms-derrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrstQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a5439e70c11274aeea01d277b123d1afc44205e6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a5439e70c11274aeea01d277b120000664000000000000000000000101713257152177027033 0ustar AMQPSÀƒ ¡0.0.0.0@pƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a4c2ebcf7d40684881cba72e043ff9dd91774b0bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a4c2ebcf7d40684881cba72e0430000664000000000000000000000000313257152177027202 0ustar ÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a401e6db47cd1c7c90257dc9eff32bd357596254qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a401e6db47cd1c7c90257dc9eff0000664000000000000000000000055413257152177027365 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a3fce4e8e1a1409f486860eb9b52ffbc56ece58fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a3fce4e8e1a1409f486860eb9b50000664000000000000000000000101613257152177027225 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address doe} not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe(DELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a38a25b39b2ae352dfd101910f24394fb836ef42qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a38a25b39b2ae352dfd101910f20000664000000000000000000000115313257152177027112 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á4£product¡apache-acti~emq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queuxŒe.ampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.q@@@@@@DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDµDDDDDDDDDDDDueue.example@@@@@@ƒS!SÀ% @@¡jms.queue.example@@@@@@DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDµDDDDDDDDDDDDDDDDDDƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2fb77bcc4a0e65059b44c47581026fcb904e8f5qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2fb77bcc4a0e65059b44c475810000664000000000000000000000042513257152177027135 0ustar AMQPSÀƒ ¡0.0.0.0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jm@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jms.queue.exaample@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2d7fde750eae69da66e796f8fd8b20468ab2403qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2d7fde750eae69da66e796f8fd0000664000000000000000000000026113257152177027470 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿhÿÿpu0;à1£sole-connection-for-containerDELAYED_DELIVERY@ÁAMQPSÀƒ 3erDELAYED_DELIVERY@Á¡0.0.0.0@pÿY@3Á3££kr././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2981c9688b5e3111a50e4ff36d12a9aeb616f29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2981c9688b5e3111a50e4ff36d0000664000000000000000000000023513257152177027063 0ustar AMQPSÀƒ ¡0.0.AMQP0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activeSÀ`R././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a277b565a02f66ef3e427be02606d00bfb87ac87qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a277b565a02f66ef3e427be02600000664000000000000000000000114413257152177027051 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.uueue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2293213be8b935c38659146af04694e8e30bbe4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a2293213be8b935c38659146af00000664000000000000000000000101313257152177026712 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIRV@YEÁ3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 2CSpÀASkÁ£x-opt-jms-destQSsÀ% CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a1b715c1d05a2638591091d6a1e87a16f630d69cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a1b715c1d05a2638591091d6a1e0000664000000000000000000000001513257152177026752 0ustar AMQPI././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a16a72447e065852a69451ab7f569e0675a75728qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a16a72447e065852a69451ab7f50000664000000000000000000000100113257152177026711 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a1347188e46f2dc0639732f0d10d9cd9688e02efqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/a1347188e46f2dc0639732f0d100000664000000000000000000000074013257152177026713 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.uexample@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9ff48fcc35cccd28eb99c3de7c45a783839766b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9ff48fcc35cccd28eb99c3de7c40000664000000000000000000000063613257152177027551 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jmsUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9f9294e9ebce1c3ed00afd047ebb7d2312266814qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9f9294e9ebce1c3ed00afd047eb0000664000000000000000000000106313257152177027443 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent£)Producer ActiveSÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9eaf065411d735d221bdb00d92089a46cb35c78dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9eaf065411d735d221bdb00d9200000664000000000000000000000073713257152177027042 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ8 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQ„„„„„„„„„„„„„„„„„„SsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)ProdS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9d23064074cf8d9502b6e43e57bc355368c97380qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9d23064074cf8d9502b6e43e57b0000664000000000000000000000103313257152177027002 0ustar AMQPSÀƒ ðððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð@ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASkÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9cc0934c7a316a81fe78fc05689037939c18dfdfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9cc0934c7a316a81fe78fc056890000664000000000000000000000001513257152177027073 0ustar AMQPÿhh)ÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9cae386e9b5d3210ed27244d9956405905c6428fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9cae386e9b5d3210ed27244d9950000664000000000000000000000063013257152177027072 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cojnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`RpÿÿÿpÿÿÿpÿÿVERY@Á3£product¡apache-activemq,artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ )S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9b0ae80a948704017aee81b5b2c973fd9eb516cdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9b0ae80a948704017aee81b5b2c0000664000000000000000000000075013257152177027130 0ustar AMQPSàƒqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/99b93654b26e42c53b9e3d6365a189b64851d0ecqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/99b93654b26e42c53b9e3d6365a0000664000000000000000000000115413257152177027016 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9993cbd1f9a2f6cf78ea9a3ef5711732da8ba5ceqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9993cbd1f9a2f6cf78ea9a3ef570000664000000000000000000000054313257152177027414 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ a0.0.0pÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/998a2d822ceac1ec5a012947439478151fd7b265qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/998a2d822ceac1ec5a0129474390000664000000000000000000000110213257152177027053 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activ!emq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸UUUUUUUUUUU././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/99573746708cb761034b7bf4b56e97b731c8172aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/99573746708cb761034b7bf4b560000664000000000000000000000115413257152177026660 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r¢œš–verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/993efa57a4c52aa81cf5364c1ffc5a9b8e2b2478qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/993efa57a4c52aa81cf5364c1ff0000664000000000000000000000115413257152177027305 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1°sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/992f8286d42428e7919793b40b4c35983fd6510dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/992f8286d42428e7919793b40b40000664000000000000000000000115413257152177026613 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR a1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9894afcdfcad19a40895c6fc051489fab8c60db9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9894afcdfcad19a40895c6fc0510000664000000000000000000000115413257152177027312 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCAPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/98756aa837da45035de0bcc0244cd76e6dd5c24bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/98756aa837da45035de0bcc02440000664000000000000000000000001713257152177027050 0ustar AMQPÿÿÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/974d6697ff36a9eb99ae52dc31df076a2bb82a8fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/974d6697ff36a9eb99ae52dc31d0000664000000000000000000000040213257152177027246 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxamSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xle@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/973970255bcfd7b838bd478cb43becd301130715qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/973970255bcfd7b838bd478cb430000664000000000000000000000050613257152177027102 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPÿÿÿÿSÀCCASÀ;£amqp:not-found¡(AMQ071616: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/97321e7b6c7f8d1f1409de312bb93da73417ec80qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/97321e7b6c7f8d1f1409de312bb0000664000000000000000000000027213257152177027141 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/96f9cd58c2f8ff64a39f72cf786fdfc2abfd9f7cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/96f9cd58c2f8ff64a39f72cf7860000664000000000000000000000064713257152177027276 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-acvtiemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BPCSÀCCASÀ;£amqp:not-found¡(AMQ21ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ9009: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/96b195f717be655797a684c391a20bf93498d30aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/96b195f717be655797a684c391a0000664000000000000000000000046413257152177026755 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpüu```````````````````````````````````````````````````````````````````````0@@à1£sole-connectoni-for-containerDELAYED_DELIVERY@Á3£produst¡apache-activemq-artemis£versionP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does lot exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/95edf83f46527a71ba9836caa320cb616a76094fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/95edf83f46527a71ba9836caa320000664000000000000000000000104413257152177027147 0ustar AMQPSÀƒ ¡0.0.0.àààààààààààààààààààààààÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERYÁ@3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3£product¡apache-activemq-artemis£version¡2 ¡ my_receiverCBPPS(À¡jmsversion¡2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@¸¿|ÿXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/959fe3477fd582b7e86ad3d815ab6f609cc66e76qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/959fe3477fd582b7e86ad3d815a0000664000000000000000000000067513257152177027201 0ustar AMQP€SÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/947e404effacf1bff300a233ea52625e16514695qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/947e404effacf1bff300a233ea50000664000000000000000000000067313257152177027352 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/943e5fb29706e7638f8f098402df445a00e95ad6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/943e5fb29706e7638f8f098402d0000664000000000000000000000110113257152177026741 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀSÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/930c36b3fb0b80b6d09e13edf7a0a72fb2076a5fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/930c36b3fb0b80b6d09e13edf7a0000664000000000000000000000067513257152177027276 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9232eb549786621dadb1ba00dd1d68c1291919beqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/9232eb549786621dadb1ba00dd10000664000000000000000000000077713257152177027134 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBP‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚@BC¸SÀCC 0C‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚SpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/91f9d6224d713f5be38010fdbb0f01ab642fa644qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/91f9d6224d713f5be38010fdbb00000664000000000000000000000067313257152177027136 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿ@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exammq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/907940a554d9aa0df2bf7614262c6668c6ed1ba8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/907940a554d9aa0df2bf76142620000664000000000000000000000115413257152177026776 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹ 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡²ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/905ccf8e1b1840349467c5d5e4c8355c4b3ada30qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/905ccf8e1b1840349467c5d5e4c0000664000000000000000000000106513257152177027071 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0C‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚@BC¸SÀCC 0C‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚SpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/901fcb18af686f2eef2ec8b535887786dc6b493bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/901fcb18af686f2eef2ec8b53580000664000000000000000000000115413257152177027315 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡0Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f658b73984757f7d2d151b27589f46655e3bea8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f658b73984757f7d2d151b27580000664000000000000000000000106413257152177026676 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f436eb4b2ee6ce132f6b1aababa1c8f6a9fc31cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f436eb4b2ee6ce132f6b1aabab0000664000000000000000000000071513257152177027503 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apch-caaetivemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address doe} not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1ache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f019378b7a46b430489ea22869d0ae10b8e711fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8f019378b7a46b430489ea228690000664000000000000000000000027213257152177026660 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8e8900d7aaf24e7af85a0676134e28d57943620fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8e8900d7aaf24e7af85a06761340000664000000000000000000000115413257152177027066 0ustar AMQPA!pÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0"SÀ`RpÿÿÿpÿÿÿpCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27ÑÑÑÑÑÑÿÿest sÀ%././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8e7097a5016bda6b512e1ded4768199443b284edqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8e7097a5016bda6b512e1ded4760000664000000000000000000000102413257152177027133 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ SÀCR 1(SpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8c569d47dc32a9cdecc0684090799ae68d0a7effqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8c569d47dc32a9cdecc068409070000664000000000000000000000115413257152177027153 0ustar AMQPSÀ0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producerྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0tcon¡TuSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8bba0e9b22dadb12fdcb9f794ea456a850ccc5d9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8bba0e9b22dadb12fdcb9f794ea0000664000000000000000000000046313257152177027574 0ustar AMQPS ¡ƒÀ0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a9d7cda15f8bdb50f24c2101f786bb9ac2279d1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a9d7cda15f8bdb50f24c2101f70000664000000000000000000000067513257152177027300 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà1CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a993f64205898ae2f6f9dcf1de39354bddd597aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a993f64205898ae2f6f9dcf1de0000664000000000000000000000070013257152177027247 0ustar AMQPSÀƒ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@tQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countT././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a98d97543bfd0a6ba8e44350e7501c660f01ac7qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a98d97543bfd0a6ba8e44350e70000664000000000000000000000115413257152177027154 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a835b9c49036476c8212ab22a7d910ce9363b9dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8a835b9c49036476c8212ab22a70000664000000000000000000000115413257152177026720 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/899bbee9712ac33a09af09a2fc23f8ed0296eadcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/899bbee9712ac33a09af09a2fc20000664000000000000000000000115413257152177027300 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQDDDDDDDDDDDDDDDDDDDDDDDDDDDDSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw‡test message: 26¹SÀCR 1CSpÀASrÁ£x-oainerDELAYED_DELIVERY@Á3£kroduct¡ctiremq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/88a46a29e00b588e9954b144d29d904d224ea1a0qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/88a46a29e00b588e9954b144d290000664000000000000000000000061013257152177026734 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYEqueue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMeeuQQu[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.exampl0¡couîtTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/877aab3a446beab19b354d210b4bced1089e800cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/877aab3a446beab19b354d210b40000664000000000000000000000060713257152177027200 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDduct¡apache-activemq-artemis£versiELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1ƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe(DELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/86ba2885a2d04075b3c025166eb02d70f7d37230qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/86ba2885a2d04075b3c025166eb0000664000000000000000000000101413257152177026760 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸S˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜ÿÿÿÿÿÿÿÿ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜my_receiver˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜ÀCC 5CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent thr`ad=2¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/869134fc2d650039345513914fd7175302cf0421qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/869134fc2d650039345513914fd0000664000000000000000000000115413257152177026565 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀSC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/86201bf7f8e1d5b8bc0fe18815ca9033a47be081qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/86201bf7f8e1d5b8bc0fe18815c0000664000000000000000000000055413257152177027227 0ustar AMQPSÀƒ ¡:.0.0DDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÿÿÁ£x-opt-jms-destQSsÀ% @m¡se.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8545fd646ad968de83cb298dd4a54416fa217f20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8545fd646ad968de83cb298dd4a0000664000000000000000000000115413257152177027250 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-acTivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQD_DELIVERY@Á1£kroduct¡ctivemq-artemis£version¡2.5.0"SÀcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/853f56b73f5b4004586e169c606741c89916b82bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/853f56b73f5b4004586e169c6060000664000000000000000000000000613257152177026647 0ustar )././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8539260cb25742b5e96d1cd61f37e0ea0517b50cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8539260cb25742b5e96d1cd61f30000664000000000000000000000115413257152177027004 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containµrDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(Àj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8466e86db60c366642e08130d28d1ef4821304e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8466e86db60c366642e08130d280000664000000000000000000000106313257152177026646 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-dQetsSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test messaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/838c12f578e3ed439d7060c9d7c9650315086561qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/838c12f578e3ed439d7060c9d7c0000664000000000000000000000001113257152177027071 0ustar ÒÒÒÒÒÒ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/834b7b11f589d0696a72d97eb509e7e8bcddfa8bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/834b7b11f589d0696a72d97eb500000664000000000000000000000051313257152177027014 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-conue.exampleS)E@BC¸S˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜ÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXv·ùStÁ!¡ ThreadSent thr`ad=1¡countTRw¡tesvemq-artemi27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/82d5b4733db89741107eb7aa0da1b04d11d2dd13qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/82d5b4733db89741107eb7aa0da0000664000000000000000000000115413257152177027131 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS:ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8270938cf0b49b50b36846a46a04d5dedbdc1adaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8270938cf0b49b50b36846a46a00000664000000000000000000000115413257152177026720 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw rྜ„iveMQQueue[example], thread=0¡countTexample], thread=0¡countTSw¡test message: 26¹SÀCR rྜ„iveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/824ae98cd2979fc7df005eb99d886091e9f4ed57qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/824ae98cd2979fc7df005eb99d80000664000000000000000000000067313257152177027263 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQS'À% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/824895917c84b399e9f04c41ecd05e2cd0c06394qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/824895917c84b399e9f04c41ecd0000664000000000000000000000027213257152177027032 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1sÑSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/813b03ca1d55650bed24b295eb79a4e87ec884e2qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/813b03ca1d55650bed24b295eb70000664000000000000000000000072313257152177027124 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`'ÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀe: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/81219fc502ccfc0021daf7af559bb2b1e322ffbcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/81219fc502ccfc0021daf7af5590000664000000000000000000000067313257152177027213 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_!ELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@£jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/81054ec667a71518a6fa6a2cc4ef9f30033f2004qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/81054ec667a71518a6fa6a2cc4e0000664000000000000000000000024613257152177027136 0ustar AMQP"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ memq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿt-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/806a01e1d090c0c48751992b0d5b2b22d40486e9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/806a01e1d090c0c48751992b0d50000664000000000000000000000036713257152177026711 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=:5¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8005fbf3510f435ab255328f735c0fba10f6f0bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/8005fbf3510f435ab255328f7350000664000000000000000000000067513257152177026721 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQs:S%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7f7f10349c764b8d20606a93a203ad3867b1cf0dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7f7f10349c764b8d20606a93a200000664000000000000000000000000513257152177026710 0ustar :././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7ee1abe5a379d54368ad94852c63ba6c4a274fe1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7ee1abe5a379d54368ad94852c60000664000000000000000000000115413257152177027156 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7ed1eb7ef8ac86756d42d4e313e108eb02dbf2bbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7ed1eb7ef8ac86756d42d4e313e0000664000000000000000000000047713257152177027323 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BCiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7e9291f43778ed49df03a1958ef8323f32e2b3deqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7e9291f43778ed49df03a1958ef0000664000000000000000000000000413257152177027106 0ustar ÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7e51d07e16f84d001a8be4a1dedf556b3b16720cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7e51d07e16f84d001a8be4a1ded0000664000000000000000000000101713257152177027264 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiveiCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒ·XwùStÁA¡ ThreaÿÿdSeCSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ!eue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7de84e54f0822896fc4ed96a1e633c9adf0b3572qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7de84e54f0822896fc4ed96a1e60000664000000000000000000000000313257152177027160 0ustar :!././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7d9cd3e6812a6b6ff56ae80aa63980890f7aee11qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7d9cd3e6812a6b6ff56ae80aa630000664000000000000000000000112413257152177027303 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@àƒ 0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£-connection-for-containerDELAYED_DE3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPP@S)E@BCPSÀCCASÀ:noound¡(AMQ219010: sÿÿoÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡ mc`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source aueue.example@@@@@@ƒXw·ÁA¡ ThreadSent¡)ProducdteCBPP@S)E@YED_DELIVERY@Á3£krodBSs doo././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7d2391d4e0385f721734ff3ffa1c361b3925f1eeqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7d2391d4e0385f721734ff3ffa10000664000000000000000000000067313257152177027072 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7c31eb8db4dc730f06f17a7410f54d179765ddefqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7c31eb8db4dc730f06f17a7410f0000664000000000000000000000115413257152177027210 0ustar A!././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7b3e7058d58be93fb242a2f01a08ff03f2d9b3fbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7b3e7058d58be93fb242a2f01a00000664000000000000000000000115413257152177027127 0ustar AMQPSÀ) ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_SÀƒ ¡0.0ððððððððððððððððððððððððððð.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£versRY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`£sole-connection-for-containerDELAYECPS£x-opt-jms-ƒ ¡÷!%0.destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA0¡ ThreadSent¡)P.roducer A0c.0rece*verCBPPS(À¡jms.uueue.exampleS)E@BC¸SÀC@@à1tQSsXw·StÁA¡ ThreadSent¡)Producer AktiveMQQ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7afbdcf68acd693446e9e1bd640f1318dbe4bd0fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7afbdcf68acd693446e9e1bd6400000664000000000000000000000070313257152177027371 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1Ñ£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿAS@4 ¡ my_rece*šrCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQsÀS%CCà0CPpÀASrÁ£x-opt-jmÀCC 0CPpÀASrÁ£x;-opt-jms-destQSsÀ%CCà0CPpÀASrÁ£¡ ThreadSent¡)PcountTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7a7b2719a8c26ef55eb18ad2684096c05407ba29qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7a7b2719a8c26ef55eb18ad26840000664000000000000000000000027213257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@°ÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/798976eec5617cca972187eb830f6cbb83ba48fbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/798976eec5617cca972187eb8300000664000000000000000000000115413257152177027034 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw£test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77cc3586ebf167630df4f52115c311398d2bfa48qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77cc3586ebf167630df4f52115c0000664000000000000000000000115413257152177027066 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£ms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7786bce72e3548fcba37a97b3151346902f599bdqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7786bce72e3548fcba37a97b3150000664000000000000000000000115413257152177027155 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77607459e4099861abb900441528d3c10a093aacqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77607459e4099861abb900441520000664000000000000000000000040213257152177026503 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77348105477002ae97fb33b669f6fbdef8b6269cqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/77348105477002ae97fb33b669f0000664000000000000000000000106313257152177026652 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-deSsQtsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùS4ÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=5¡countTSw¡test messaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/771f7dc6b5ecef9c668f3cf9693c6e6fff0ecb96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/771f7dc6b5ecef9c668f3cf96930000664000000000000000000000023613257152177027343 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemi address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7716b71e519b4e42228d991694e30f6916919f8bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7716b71e519b4e42228d991694e0000664000000000000000000000075613257152177026671 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààààààààààààààààààààààààààààààààààààààAMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ%@@¡jms.queue.example@@@@@@ƒXwààààààààààà0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-c·ùStÁA¡ ThreadSent¡)Proonnecti;nd././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/767bc881a50241648e0d29d8b0420253b0e83be4qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/767bc881a50241648e0d29d8b040000664000000000000000000000037013257152177026721 0ustar AMQPSÀƒ ¡0.0.0®0@pÿÿPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPÿÿ`ÿÿpu0@@à1£sole-connection-for-cRpÿÿÿpÿÿt-found¡(AMQ2190Ù0: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7651ae419398d15ae564bc158fbc3db343a06e65qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7651ae419398d15ae564bc158fb0000664000000000000000000000105413257152177027067 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jmsUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThrealSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7626a9cb50bccd0f8a4fa1a79405ab53be885f60qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7626a9cb50bccd0f8a4fa1a79400000664000000000000000000000102713257152177027267 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASkÁ£x-opt-jms-destQSsÀ% CCCCCCCCCCC(CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCsssssssssssCCCCCCCCCCCCCCCCCCCCCCC@@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/75fa750965179115a844e10eb8c013c2cf064b20qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/75fa750965179115a844e10eb8c0000664000000000000000000000115413257152177026727 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1 sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/75f116308c5f508d9969f053086eddc8b7c3228bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/75f116308c5f508d9969f0530860000664000000000000000000000046313257152177026606 0ustar AMQPS¡.ƒ À00.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/74cfd7b7fd44a5c2418afeb87a728b36256043c6qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/74cfd7b7fd44a5c2418afeb87a70000664000000000000000000000106513257152177027373 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0C‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚SpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/74968d9f0c567f65b566f1f14a0deff3a4b4e35aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/74968d9f0c567f65b566f1f14a00000664000000000000000000000007113257152177027021 0ustar ):././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7384d33cf760aac3db74bacd1ed31517f4a7e92dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7384d33cf760aac3db74bacd1ed0000664000000000000000000000115413257152177027426 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSqÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7346a9196db30b9d3f8cf7237a2880071084732dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7346a9196db30b9d3f8cf7237a20000664000000000000000000000073113257152177027071 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-cinerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CaaaaaaaaaaaaaaaaaaaaaXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹´ë?÷û¼­þ 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.qtest message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/72e9425a5e744750f20009ccbb79058cb407c5b3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/72e9425a5e744750f20009ccbb70000664000000000000000000000023713257152177026776 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1tQSsÀ% @@¡jms.xample], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/729c0a9f0a1037f3e4b1892692b4cccd8272e387qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/729c0a9f0a1037f3e4b1892692b0000664000000000000000000000026513257152177027001 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1˜sole-cjms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/725f0ec7d15d5d48e9c7975d18fac1e59a147656qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/725f0ec7d15d5d48e9c7975d18f0000664000000000000000000000073713257152177027177 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððððððððððð.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0ÿÿÿÿÿÿÿÿ"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xÙ-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/72108910283121dbfe830e9ea94fd510aeb5b01dqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/72108910283121dbfe830e9ea940000664000000000000000000000066713257152177026725 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-cnnection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverqqqqqqqqqqqqqqqÿÿÿÿÿÿÿÿqqqqqqqqqqqqqqqqqqqqqqqqqqple@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQÆQueue[example], thread=0¡countTSw¡teSt message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7188823a7edb1e94026e8ce24aac4673c62aa803qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/7188823a7edb1e94026e8ce24aa0000664000000000000000000000024413257152177027142 0ustar AMQPSÀƒ ¡0.0.0ms.queuY.exampŒe2555555555555555555555555555555@¡jLs.q w·St¡)@@@@@ƒXw·[QQue], thr], thr@ad= ¸nt¡)PPoducer(0ctiseM>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/17e5d22a48b1c712cf7157a83ff0bb7cb3d1aa1fqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/17e5d22a48b1c712cf7157a83ff0000664000000000000000000000027213257152177027137 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1SQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/179f52d65804f6052e2327e3ffead71fc3d4f738qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/179f52d65804f6052e2327e3ffe0000664000000000000000000000076013257152177027015 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/15dc85e8ed51568d7138cbb2b540a1722648c00aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/15dc85e8ed51568d7138cbb2b540000664000000000000000000000046313257152177027151 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1517c410bd6e1c133c5230020a3c40caba98955eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1517c410bd6e1c133c5230020a30000664000000000000000000000073613257152177026655 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer AAMQPÀÁctiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR t¡1CSpÀ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/14a0bc9eac7978e4a194859e1ba0a134e00d023aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/14a0bc9eac7978e4a194859e1ba0000664000000000000000000000115413257152177027226 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1432ecb9b1077a6c5107fec20240b20ace72c5cbqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1432ecb9b1077a6c5107fec20240000664000000000000000000000023013257152177027030 0ustar AMQPSÀƒ ¡0.0.0.ààààààAMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á3£proàààààduc././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/13cf282005ab8f9ef3d73801ef99a3b5d03bba53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/13cf282005ab8f9ef3d73801ef90000664000000000000000000000101013257152177027133 0ustar AMQPSÀƒ ¡ivemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thread=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1377c3e549f7cdbc1dbaa6f7b619ef362c8d1c1aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1377c3e549f7cdbc1dbaa6f7b610000664000000000000000000000115413257152177027360 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CðSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@CC 0CðSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSmessage: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12f2c89bcc4949e4638a2e9e4dda12405bf0fabaqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12f2c89bcc4949e4638a2e9e4dd0000664000000000000000000000115413257152177027240 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampldàS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSencer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12b1860ae7a93d9bb86bbec6d80c09467fcf52e3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12b1860ae7a93d9bb86bbec6d800000664000000000000000000000115413257152177027276 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_>ELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQuele], thread=0¡countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ!£x-opt-jms-festQSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡3.5.0"SÀc;untTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12a52a9e0109e0e39974578766a179ee0cb983bcqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/12a52a9e0109e0e39974578766a0000664000000000000000000000041313257152177026646 0ustar AMQPSÀƒ ¡0.0ððððððððððððððððððÎððððð.ŒxamSÀƒ ¡0.0Ððððððððððððððððððððððð.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£xle@@@@@@ƒXw·ùStÁSÀCR 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/126783a0aca87289d23441ddba5e00ebb178f000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/126783a0aca87289d23441ddba50000664000000000000000000000033613257152177027051 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.exsu0@@à1VQSsÀ% @@¡jms.queue.exaample@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/116006a72598e77e67a895e6cfc30223ad8b255eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/116006a72598e77e67a895e6cfc0000664000000000000000000000027213257152177027024 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ÿ€QSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1004216e34b9573b85ed3bfdb73d693dbbe75000qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/1004216e34b9573b85ed3bfdb730000664000000000000000000000067313257152177027057 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt+jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSpÀASrÁ£x-opt-jms-destQSSÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0fe9cdeb2aedda8047ffda8db029001cdb1d1403qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0fe9cdeb2aedda8047ffda8db020000664000000000000000000000115413257152177027652 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁ!¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0countTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=1¡countTRw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0dbbfa0675c875cd7751b0f70d93fcd84422816aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0dbbfa0675c875cd7751b0f70d90000664000000000000000000000004213257152177027215 0ustar AMQPMMÿÿÿÿhhÿÿÿ)âÿÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0c7c14123fb0f333c85844c1597fd741d3828d40qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0c7c14123fb0f333c85844c15970000664000000000000000000000115413257152177026713 0ustar AMQPSÀƒ ¡0.0.0.ààààààààààààAMQPctivemq-artemiuct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.examexampleƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡te`@¡jms.quÿÁ£veMeeuQQu[example],ms-destQ`SpÀQu././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b73f98d0b2d236b49c57b5aec3ae213d6ef6613qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b73f98d0b2d236b49c57b5aec30000664000000000000000000000027213257152177027216 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1aQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b6b5b22bcf425448c219868e69abb00cb6d5410qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b6b5b22bcf425448c219868e690000664000000000000000000000074213257152177027011 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 ¡ my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁSÀCR 1CSðÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·Sge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b68616d14dc8a6e9375303789dbb91d20386c53qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b68616d14dc8a6e9375303789d0000664000000000000000000000027213257152177026736 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1rQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b47d6a797e14dd4017a2881ba95a76d8b7d118eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0b47d6a797e14dd4017a2881ba90000664000000000000000000000106013257152177027054 0ustar AMQPSÀƒ ¡:.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-optpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-d¡test message: 26¹SÿÿÁ£x-opt-jms-destQSsÀ% @m¡se.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a32ccf79fea402ec9c79ae77a833683d4eb8d4eqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a32ccf79fea402ec9c79ae77a80000664000000000000000000000047313257152177027373 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_reZeiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a077959176c83815535114245f78246191b0cf3qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a077959176c83815535114245f0000664000000000000000000000067613257152177026437 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––1£sole-connection-for-containerDELAYED_DELIVERY@Á3£\kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a00327a887eb9a76faba78ff61a605e6642feceqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0a00327a887eb9a76faba78ff610000664000000000000000000000103213257152177027215 0ustar AMQPSÀƒ @ƒXw·ùStÁSÿpu0@@à1£s(le-connecti;n-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ2 my_receiverCBPPS(À¡jms.queue.ŒxampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/08fee9d9371086e488c21d341dd6d9eb0b40afbfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/08fee9d9371086e488c21d341dd0000664000000000000000000000101713257152177027073 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿp50@@à1£sole-connectiog-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address doe} not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe(DELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_recei;verCBPP@S)E@BC././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/07b195901c4cd8746ae4b09db62199ca2a243da1qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/07b195901c4cd8746ae4b09db620000664000000000000000000000115413257152177027057 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r¢œš–verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£ŽÒopt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0718060785ce19f0601579e5de97efe312c36507qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0718060785ce19f0601579e5de90000664000000000000000000000025613257152177026657 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sol)SÀ ¡ my_rec`iverCBPP@S)E@BCPCASÀ;£amqp:not-found¡(AMQ219010: source address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/06c65470dbadf81f917b1fb1a9a1d6ec2e4233b9qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/06c65470dbadf81f917b1fb1a9a0000664000000000000000000000115413257152177027272 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3‚kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0586885c058696fbea720a4aba92a13da42da9c8qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0586885c058696fbea720a4aba90000664000000000000000000000032313257152177027066 0ustar AMQPSÀƒ ¡0BBBBBBBBBBBBBBBBBBB.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-coBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAMQPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBSÀƒ ¡:0.0.0.0@pÿÿBBBBÿ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0519dc34bc644fe9617438b61df75413ea2bd941qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0519dc34bc644fe9617438b61df0000664000000000000000000000115413257152177027067 0ustar AMQPSÀƒ ¡0.0.0.7@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BV¸SÀCC 0CSpÀASrÁ£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0c¡ountTSw¡test message: 26¹SÀCR 1CSpÀASrÁ£x-opt-jms-destUSsÀ% @@¡jms.queue.example@@@@@SÀCR 1CSpÀAÿÿÁ£x-opt-jms-destQSsÀ% @m¡s@j.queue.exampl0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/04d63f6a39107e6e2762fc094c19d1be98a1b677qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/04d63f6a39107e6e2762fc094c10000664000000000000000000000065313257152177027003 0ustar AMQPSÀƒ ¡0.0.0.0@tÿÿÿÿ`ÿÿpu0@@à1”£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"S@`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_receiverCBPP@S)E@BCPSÀCCASÀ;£amqp:not-found¡(AMQ219010: source address doe} not existSÁƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containe(DELAYAMQPED_DELIVERY@Á3£pro././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/04935c57adc38f1bd00edd8223bff34cf7943f10qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/04935c57adc38f1bd00edd8223b0000664000000000000000000000031013257152177027176 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡rsion¡1.5.0"S@`Rp‰ÿÿÿpÿÿÿpÿÿ)S@ãõŠœœ address does not exist././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0445e9084cd366adadef0db16b39389a1fbb0b96qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0445e9084cd366adadef0db16b30000664000000000000000000000107413257152177027270 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_rece*verCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CPpÀASrÁ£x-opt-jms-desUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUtQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡countTSw¡test message: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/042fdec751947c700c94c604c4e5f8c8b2f890dfqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/042fdec751947c700c94c604c4e0000664000000000000000000000073413257152177027062 0ustar AMQPSÀƒ ¡0.0.0.0@pÿþÿÿ`ÿÿpu0@@à1£sole;conlction-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2*5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ3 ¡ my_receiverCBPPS(À¡jms.queue.exampleS)E@BC¸SÀj.¡msqueue.exampleS)E@BC¸SÀCC 0CPpÀÁrAS£x-opt-jms-destQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·ùStÁA¡ ThreadSentu0@@à1£r AktiveMQQueue[example], thread=0¡countTSw¡test mesasge: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0339eecf1be50ea807e7bdf8b544e513d0f48a6aqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/0339eecf1be50ea807e7bdf8b540000664000000000000000000000027213257152177027362 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1VQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/017176f4a9cd5500e6b7ef139cf519d3f113d6ebqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/017176f4a9cd5500e6b7ef139cf0000664000000000000000000000035313257152177027143 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@àÏôVQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡@à1VQSsÀ% @@¡jms.queue.example@@@@@@ƒXw·)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/015b054164d0c060dba0ad2c350e12c83f71c129qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/015b054164d0c060dba0ad2c3500000664000000000000000000000027213257152177027005 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿsu0@@à1ÁA¡ ThreadSent¡s.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer AktiveMQQueue[example], thr`ad=0¡nt¡)Producer ActiveMQQueue[e././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/011724655b0a5e891284003b6c82e9f3f09d719bqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/011724655b0a5e891284003b6c80000664000000000000000000000106213257152177026543 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1±sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_r 0CSpÀASrÁ£x-opt-jms-des(tQSsÀ% @@¡jms.queue.example@sÀ% @@¡jms.queue.example@@@@@@ƒXw·StÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡tmesste sag>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>e: 27././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/010bab9b627b9bf8cd0b1ff32b19d4669e756e06qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/010bab9b627b9bf8cd0b1ff32b10000664000000000000000000000037113257152177027334 0ustar AMQPSÀƒ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£product¡apache-activemq-artemis£version¡1.5.0"SÀ`Rpÿÿÿpÿÿÿpÿÿ)SÀ ¡ my_rec`iverCBPPÑS)E@BCPSÀst././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootqpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/00022848b6f91bd22d74aee65c17c9132934bc98qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver/corpus/00022848b6f91bd22d74aee65c10000664000000000000000000000113513257152177027045 0ustar AMQPSÀƒ ¡0.0.0.0@pÿÿÿÿ`ÿÿpu0@@à1£sole-connection-for-containerDELAYED_DELIVERY@Á3£kroduct¡apache-activemq-artemis£version¡2.5.0"SÀ`RpÿÿÿpÿÿÿpÿÿASÀ4 ¡ my_receiv%rCBPPS(À¡jms.queue.exampleS)E@BC¸SÀCC 0CSpÀAÁ£x-optSsQtsÀ% @@¡jms.queue.gxample@B@@@@ƒXw·ùStÁA¡ ThreadSent¡)Producer ActiveMQQueue[example], thread=0¡countTSw¡test inerDELAYED_DELIVERY@Á3£kroduct¡apachemessaSsÀ% @@¡jcontainerDELAYED_DELIVERY@Á3£kroduct¡ctivemq-artemis£versiÀn¡2.5.0"SÀc;untTSw¡test message: 27qpid-proton-0.22.0/proton-c/src/tests/fuzz/fuzz-connection-driver.c0000664000000000000000000001507513257152177022241 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include "proton/connection_driver.h" #include "proton/engine.h" #include "proton/log.h" #include "proton/message.h" #include "libFuzzingEngine.h" // This fuzzer is a variant of the receive.c proactor example #define MAX_SIZE 1024 typedef char str[MAX_SIZE]; typedef struct app_data_t { str container_id; pn_rwbytes_t message_buffer; int message_count; int received; } app_data_t; static void fdc_write(pn_connection_driver_t *driver); size_t fcd_read(pn_connection_driver_t *driver, uint8_t **data, size_t *size); static void decode_message(pn_delivery_t *dlv); static void handle(app_data_t *app, pn_event_t *event); static void check_condition(pn_event_t *e, pn_condition_t *cond); // const bool VERBOSE = true; const bool VERBOSE = false; // const bool ERRORS = true; const bool ERRORS = false; // I could not get rid of the error messages on stderr in any other way void devnull(pn_transport_t *transport, const char *message) {} int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (VERBOSE) printf("BEGIN LLVMFuzzerTestOneInput\n"); app_data_t app = {{0}}; snprintf(app.container_id, sizeof(app.container_id), "%s:%06x", "fuzz_connection_driver", rand() & 0xffffff); pn_connection_driver_t driver; if (pn_connection_driver_init(&driver, NULL, NULL) != 0) { printf("pn_connection_driver_init\n"); exit(1); } pn_log_enable(false); pn_log_logger(NULL); pn_transport_trace(driver.transport, PN_TRACE_OFF); pn_transport_set_tracer(driver.transport, devnull); uint8_t *data = (uint8_t *)Data; size_t size = Size; fdc_write(&driver); pn_event_t *event; while ((event = pn_connection_driver_next_event(&driver)) != NULL) { handle(&app, event); } fdc_write(&driver); do { fdc_write(&driver); fcd_read(&driver, &data, &size); if (VERBOSE) printf("size is %d, data is %p\n", (int)size, (void *)data); pn_event_t *event; while ((event = pn_connection_driver_next_event(&driver)) != NULL) { handle(&app, event); } } while (size > 0); pn_connection_driver_close(&driver); pn_connection_driver_destroy( &driver); // TODO: documentation says pn_connection_driver_free if (VERBOSE) printf("END LLVMFuzzerTestOneInput\n"); return 0; } static void handle(app_data_t *app, pn_event_t *event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t *c = pn_event_connection(event); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_t *s = pn_session(c); pn_session_open(s); pn_link_t *l = pn_receiver(s, "my_receiver"); pn_terminus_set_address(pn_link_source(l), NULL); pn_link_open(l); pn_link_flow(l, 20); } break; case PN_DELIVERY: { /* A message has been received */ pn_link_t *link = NULL; pn_delivery_t *dlv = pn_event_delivery(event); if (pn_delivery_readable(dlv) && !pn_delivery_partial(dlv)) { link = pn_delivery_link(dlv); decode_message(dlv); /* Accept the delivery */ pn_delivery_update(dlv, PN_ACCEPTED); /* done with the delivery, move to the next and free it */ pn_link_advance(link); pn_delivery_settle(dlv); /* dlv is now freed */ } } break; case PN_TRANSPORT_ERROR: check_condition(event, pn_transport_condition(pn_event_transport(event))); pn_connection_close(pn_event_connection(event)); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; default: break; } } static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (VERBOSE) printf("beginning check_condition\n"); if (pn_condition_is_set(cond)) { if (VERBOSE || ERRORS) fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); } } static void decode_message(pn_delivery_t *dlv) { static char buffer[MAX_SIZE]; ssize_t len; // try to decode the message body if (pn_delivery_pending(dlv) < MAX_SIZE) { // read in the raw data len = pn_link_recv(pn_delivery_link(dlv), buffer, MAX_SIZE); if (len > 0) { // decode it into a proton message pn_message_t *m = pn_message(); if (PN_OK == pn_message_decode(m, buffer, len)) { pn_string_t *s = pn_string(NULL); pn_inspect(pn_message_body(m), s); if (ERRORS) printf("%s\n", pn_string_get(s)); pn_free(s); } pn_message_free(m); } } } // reads up to `size` bytes from `data`, // updates `data` pointer and `size` to the unread portion of original `data`, // returns new value of `size` size_t fcd_read(pn_connection_driver_t *driver, uint8_t **data, size_t *size) { pn_rwbytes_t buf = pn_connection_driver_read_buffer(driver); size_t s = (*size < buf.size) ? *size : buf.size; if (buf.start == NULL) { exit(1); } memcpy(buf.start, *data, s); pn_connection_driver_read_done(driver, s); *data += s; *size -= s; return *size; } // drops the data in the buffer and reports them as written static void fdc_write(pn_connection_driver_t *driver) { pn_bytes_t buffer = pn_connection_driver_write_buffer(driver); pn_connection_driver_write_done(driver, buffer.size); } qpid-proton-0.22.0/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c0000664000000000000000000000316413257152177022534 0ustar /*===- StandaloneFuzzTargetMain.c - standalone main() for fuzz targets. ---===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // This main() function can be linked to a fuzz target (i.e. a library // that exports LLVMFuzzerTestOneInput() and possibly LLVMFuzzerInitialize()) // instead of libFuzzer. This main() function will not perform any fuzzing // but will simply feed all input files one by one to the fuzz target. // // Use this file to provide reproducers for bugs when linking against libFuzzer // or other fuzzing engine is undesirable. //===----------------------------------------------------------------------===*/ #include #include #include extern int LLVMFuzzerInitialize(int *argc, char ***argv); extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size); int main(int argc, char **argv) { fprintf(stderr, "StandaloneFuzzTargetMain: running %d inputs\n", argc - 1); LLVMFuzzerInitialize(&argc, &argv); for (int i = 1; i < argc; i++) { fprintf(stderr, "Running: %s\n", argv[i]); FILE *f = fopen(argv[i], "r"); assert(f); fseek(f, 0, SEEK_END); size_t len = ftell(f); fseek(f, 0, SEEK_SET); unsigned char *buf = (unsigned char*)malloc(len); size_t n_read = fread(buf, 1, len, f); assert(n_read == len); LLVMFuzzerTestOneInput(buf, len); free(buf); fprintf(stderr, "Done: %s: (%zd bytes)\n", argv[i], n_read); } } qpid-proton-0.22.0/proton-c/src/tests/fuzz/StandaloneFuzzTargetInit.c0000664000000000000000000000156213257152177022553 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ int LLVMFuzzerInitialize(int *argc, char ***argv) { return 0; } qpid-proton-0.22.0/proton-c/src/tests/fuzz/README.md0000664000000000000000000000602313257152177016721 0ustar # Fuzz testing for qpid-proton-c ## Dockerfile Easiest way to build and run the fuzzing is using attached Dockerfile. Run the following command from the top directory of the project docker build -f proton-c/src/tests/fuzz/Dockerfile -t qpid-proton-fuzz . Then run the built image and execute a fuzzer to check that all works docker run --cap-add SYS_PTRACE -it qpid-proton-fuzz ./fuzz-url /src/proton-c/src/tests/fuzz/fuzz-url/crash /src/proton-c/src/tests/fuzz/fuzz-url/corpus You can bind a local directory to the container with the `-v local:remote` option. The `--rm` option is also useful. See https://docs.docker.com/engine/reference/run/. The docker image is based on `ossfuzz/basebuilder`, which is Ubuntu 16.04 Xenial with clang 5.0 and libc++. ## Building There are two cmake options to control compilation of fuzzers * `FUZZ_TEST` (default: `OFF`) adds fuzzers to the build and to regression tests * `FUZZING_ENGINE` (default: `OFF`) links fuzzers with `libFuzzingEngine` when `ON` When `FUZZING_ENGINE` is `OFF`, fuzzers are linked with a simple driver suitable only for regression testing. ### with a simple driver There are no special prerequisites and no extra configuration is necessary. ### with libFuzzer 1. Download and compile libFuzzer. Use http://llvm.org/docs/LibFuzzer.html for detailed instructions. 2. Rename/link `libFuzzer.a` (from previous step) to `libFuzzingEngine.a` 3. Build qpid-proton with the following configuration * set `CC` and `CXX` variables to the same compiler you used to build libFuzzer (some recent clang) * set `CFLAGS` and `CXXFLAGS` with the coverage and sanitizer(s) you want to use, see libFuzzer documentation for details * set `LDFLAGS` to add the directory with `libFuzzingEngine.a` to your link path if necessary * set `FUZZ_TEST=ON` and `FUZZING_ENGINE=ON` For example: FLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls" CC=~/third_party/llvm-build/Release+Asserts/bin/clang \ CXX=~/third_party/llvm-build/Release+Asserts/bin/clang++ \ CFLAGS="$FLAGS" \ CXXFLAGS="$FLAGS" \ LDFLAGS="-L/path/to/libFuzzingEngine/directory" \ cmake .. -DCMAKE_BUILD_TYPE=Debug -DFUZZ_TEST=ON -DFUZZING_ENGINE=ON ## Running Execute one of the `fuzz-*` binaries. ### With simple driver When given file paths as command line arguments, it will run the fuzzed function with each of the inputs in turn once and then exit. ### WIth libFuzzer When given a folder as first argument, it will load corpus from the folder and also store newly discovered inputs (that extend code coverage) there. See http://llvm.org/docs/LibFuzzer.html for details. # Justifications The reason for renaming the fuzzing library to `libFuzzingEngine` is to be compatible with https://github.com/google/oss-fuzz. In fuzzing data directories, corpus and crashes are two different subdirectories, because fuzzers can perform corpus minimization. Crashes should not be subjected to corpus minimization, so they need to be kept separately. qpid-proton-0.22.0/proton-c/src/tests/fuzz/Dockerfile0000664000000000000000000000276213257152177017442 0ustar # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ################################################################################ FROM ossfuzz/base-builder MAINTAINER jdanek@redhat.com RUN apt-get install -y \ cmake \ libuv1-dev # (optional) add vim # (optional) customize enviromental variables #ENV FUZZING_ENGINE #ENV SANITIZER_FLAGS # copy qpid-proton from filesystem into the container COPY . ./qpid-proton WORKDIR /src/qpid-proton # refresh the build directory if it exists already RUN rm build -rf || true # /usr/local/bin/compile compiles libFuzzer, then calls /src/build.sh # and sets correct environment variables for it RUN echo cmake .. -DCMAKE_BUILD_TYPE=Debug -DFUZZ_TEST=ON -DFUZZING_ENGINE=ON > /src/build.sh # build it RUN mkdir build WORKDIR /src/qpid-proton/build RUN /usr/local/bin/compile WORKDIR /src/qpid-proton/build/proton-c/src/tests/fuzz RUN make RUN ls # run corpus through fuzzer and irrespective of result start bash ENTRYPOINT make test; bash qpid-proton-0.22.0/proton-c/src/tests/fuzz/CMakeLists.txt0000664000000000000000000000505613257152177020207 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # add_definitions(${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}) option(FUZZ_REGRESSION_TESTS "Run fuzz tests with regression test driver" ON) option(FUZZ_LONG_TESTS "Run fuzz tests that take a long time" OFF) if (FUZZ_REGRESSION_TESTS) set(FUZZING_LIBRARY StandaloneFuzzTargetMain) else () set(FUZZING_LIBRARY FuzzingEngine) endif () add_library (StandaloneFuzzTargetMain STATIC StandaloneFuzzTargetMain.c StandaloneFuzzTargetInit.c) macro (pn_add_fuzz_test test) add_executable (${test} ${ARGN}) target_link_libraries (${test} qpid-proton-core ${FUZZING_LIBRARY}) if (FUZZ_REGRESSION_TESTS) # StandaloneFuzzTargetMain cannot walk directory trees file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${test}/*) add_test (${test} ${memcheck-cmd} ${CMAKE_CURRENT_BINARY_DIR}/${test} ${files}) else () add_test (${test} ${CMAKE_CURRENT_BINARY_DIR}/${test} -runs=1 ${CMAKE_CURRENT_SOURCE_DIR}/${test}) endif () endmacro(pn_add_fuzz_test) # Fuzz tests at the User API level pn_add_fuzz_test (fuzz-connection-driver fuzz-connection-driver.c) pn_add_fuzz_test (fuzz-message-decode fuzz-message-decode.c) # pn_url_parse is not in proton core and is only used by messenger so compile specially pn_add_fuzz_test (fuzz-url fuzz-url.c ${PROJECT_SOURCE_DIR}/proton-c/src/extra/url.c ${PROJECT_SOURCE_DIR}/proton-c/src/core/util.c) # This regression test can take a very long time so don't run by default if(HAS_PROACTOR AND FUZZ_LONG_TESTS) pn_add_fuzz_test (fuzz-proactor-receive fuzz-proactor-receive.c) target_link_libraries(fuzz-proactor-receive qpid-proton-proactor) endif() # Fuzz tests of internals # pni_sniff_header is internal so it has to be compiled specially pn_add_fuzz_test (fuzz-sniff-header fuzz-sniff-header.c ${PROJECT_SOURCE_DIR}/proton-c/src/core/autodetect.c) qpid-proton-0.22.0/proton-c/src/tests/fdlimit.py0000664000000000000000000000633213257152177016451 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License # from __future__ import print_function from proctest import * def wait_listening(proc): m = proc.wait_re("listening on ([0-9]+)$") return m.group(1), m.group(0)+"\n" # Return (port, line) class LimitedBroker(object): def __init__(self, test, fdlimit): self.test = test self.fdlimit = fdlimit def __enter__(self): self.proc = self.test.proc(["broker", "", "0"]) self.port, _ = wait_listening(self.proc) return self def __exit__(self, *args): b = getattr(self, "proc") if b: if b.poll() not in [1, None]: # Broker crashed or got expected connection error raise ProcError(b, "broker crash") b.kill() # Check if we can run prlimit to control resources try: Proc(["prlimit"]).wait_exit() except: print("Skipping test: prlimit not available") sys.exit(0) class FdLimitTest(ProcTestCase): def proc(self, *args, **kwargs): """Skip valgrind for all processes started by this test""" return super(FdLimitTest, self).proc(*args, valgrind=False, **kwargs) def test_fd_limit_broker(self): """Check behaviour when running out of file descriptors on accept""" # Not too many FDs but not too few either, some are used for system purposes. fdlimit = 256 with LimitedBroker(self, fdlimit) as b: receivers = [] # Start enough receivers to use all FDs, make sure the broker logs an error for i in range(fdlimit+1): receivers.append(self.proc(["receive", "", b.port, str(i)])) # Note: libuv silently swallows EMFILE/ENFILE errors so there is no error reporting. # The epoll proactor will close the users connection with the EMFILE/ENFILE error if "TRANSPORT_CLOSED" in b.proc.out: self.assertIn("open files", b.proc.out) # All FDs are now in use, send attempt should fail or hang self.assertIn(self.proc(["send", "", b.port, "x"]).poll(), [1, None]) # Kill receivers to free up FDs for r in receivers: r.kill() for r in receivers: r.wait_exit(expect=None) # send/receive should succeed now self.assertIn("10 messages sent", self.proc(["send", "", b.port]).wait_exit()) self.assertIn("10 messages received", self.proc(["receive", "", b.port]).wait_exit()) if __name__ == "__main__": main() qpid-proton-0.22.0/proton-c/src/tests/event.c0000664000000000000000000000575013257152177015737 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #define assert(E) ((E) ? 0 : (abort(), 0)) static void test_collector(void) { pn_collector_t *collector = pn_collector(); assert(collector); pn_free(collector); } #define SETUP_COLLECTOR \ void *obj = pn_class_new(PN_OBJECT, 0); \ pn_collector_t *collector = pn_collector(); \ assert(collector); \ pn_event_t *event = pn_collector_put(collector, PN_OBJECT, obj, (pn_event_type_t) 0); \ pn_decref(obj); \ static void test_collector_put(void) { SETUP_COLLECTOR; assert(event); assert(pn_event_context(event) == obj); pn_free(collector); } static void test_collector_peek(void) { SETUP_COLLECTOR; pn_event_t *head = pn_collector_peek(collector); assert(head == event); pn_free(collector); } static void test_collector_pop(void) { SETUP_COLLECTOR; pn_event_t *head = pn_collector_peek(collector); assert(head == event); pn_collector_pop(collector); head = pn_collector_peek(collector); assert(!head); pn_free(collector); } static void test_collector_pool(void) { SETUP_COLLECTOR; pn_event_t *head = pn_collector_peek(collector); assert(head == event); pn_collector_pop(collector); head = pn_collector_peek(collector); assert(!head); void *obj2 = pn_class_new(PN_OBJECT, 0); pn_event_t *event2 = pn_collector_put(collector, PN_OBJECT, obj2, (pn_event_type_t) 0); pn_decref(obj2); assert(event == event2); pn_free(collector); } static void test_event_incref(bool eventfirst) { SETUP_COLLECTOR; pn_event_t *head = pn_collector_peek(collector); assert(head == event); pn_incref(head); pn_collector_pop(collector); assert(!pn_collector_peek(collector)); void *obj2 = pn_class_new(PN_OBJECT, 0); pn_event_t *event2 = pn_collector_put(collector, PN_OBJECT, obj2, (pn_event_type_t) 0); pn_decref(obj2); assert(head != event2); if (eventfirst) { pn_decref(head); pn_free(collector); } else { pn_free(collector); pn_decref(head); } } int main(int argc, char **argv) { test_collector(); test_collector_put(); test_collector_peek(); test_collector_pop(); test_collector_pool(); test_event_incref(true); test_event_incref(false); return 0; } qpid-proton-0.22.0/proton-c/src/tests/engine.c0000664000000000000000000002472213257152177016063 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include // never remove 'assert()' #undef NDEBUG #include // push data from one transport to another static int xfer(pn_transport_t *src, pn_transport_t *dest) { ssize_t out = pn_transport_pending(src); if (out > 0) { ssize_t in = pn_transport_capacity(dest); if (in > 0) { size_t count = (size_t)((out < in) ? out : in); pn_transport_push(dest, pn_transport_head(src), count); pn_transport_pop(src, count); return (int)count; } } return 0; } // transfer all available data between two transports static int pump(pn_transport_t *t1, pn_transport_t *t2) { int total = 0; int work; do { work = xfer(t1, t2) + xfer(t2, t1); total += work; } while (work); return total; } // handle state changes of the endpoints static void process_endpoints(pn_connection_t *conn) { pn_session_t *ssn = pn_session_head(conn, PN_LOCAL_UNINIT); while (ssn) { //fprintf(stderr, "Opening session %p\n", (void*)ssn); pn_session_open(ssn); ssn = pn_session_next(ssn, PN_LOCAL_UNINIT); } pn_link_t *link = pn_link_head(conn, PN_LOCAL_UNINIT); while (link) { //fprintf(stderr, "Opening link %p\n", (void*)link); pn_link_open(link); link = pn_link_next(link, PN_LOCAL_UNINIT); } link = pn_link_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); while (link) { //fprintf(stderr, "Closing link %p\n", (void*)link); pn_link_close(link); link = pn_link_next(link, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); } ssn = pn_session_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); while (ssn) { //fprintf(stderr, "Closing session %p\n", (void*)ssn); pn_session_close(ssn); ssn = pn_session_next(ssn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); } } // bring up a session and a link between the two connections static void test_setup(pn_connection_t *c1, pn_transport_t *t1, pn_connection_t *c2, pn_transport_t *t2) { pn_connection_open(c1); pn_connection_open(c2); pn_session_t *s1 = pn_session(c1); pn_session_open(s1); pn_link_t *tx = pn_sender(s1, "sender"); pn_link_open(tx); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } // session and link should be up, c2 should have a receiver link: assert(pn_session_state( s1 ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(pn_link_state( tx ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(rx && pn_link_is_receiver(rx)); } // test that free'ing the connection should free all contained // resources (session, links, deliveries) int test_free_connection(int argc, char **argv) { fprintf(stdout, "test_free_connection\n"); pn_connection_t *c1 = pn_connection(); pn_transport_t *t1 = pn_transport(); pn_transport_bind(t1, c1); pn_connection_t *c2 = pn_connection(); pn_transport_t *t2 = pn_transport(); pn_transport_set_server(t2); pn_transport_bind(t2, c2); //pn_transport_trace(t1, PN_TRACE_FRM); test_setup(c1, t1, c2, t2); pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(tx); pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(rx); // transfer some data across the link: pn_link_flow(rx, 10); pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6)); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } assert(pn_delivery_writable(d1)); pn_link_send(tx, "ABC", 4); pn_link_advance(tx); // now free the connection, but keep processing the transport process_endpoints(c1); pn_connection_free(c1); while (pump(t1, t2)) { process_endpoints(c2); } // delivery should have transfered: assert(pn_link_current(rx) && pn_delivery_readable(pn_link_current(rx))); pn_transport_unbind(t1); pn_transport_free(t1); pn_connection_free(c2); pn_transport_unbind(t2); pn_transport_free(t2); return 0; } int test_free_session(int argc, char **argv) { fprintf(stdout, "test_free_session\n"); pn_connection_t *c1 = pn_connection(); pn_transport_t *t1 = pn_transport(); pn_transport_bind(t1, c1); pn_connection_t *c2 = pn_connection(); pn_transport_t *t2 = pn_transport(); pn_transport_set_server(t2); pn_transport_bind(t2, c2); //pn_transport_trace(t1, PN_TRACE_FRM); test_setup(c1, t1, c2, t2); pn_session_t *ssn = pn_session_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(ssn); pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(tx); pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(rx); // prepare for transfer: request some credit pn_link_flow(rx, 10); pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6)); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } assert(pn_delivery_writable(d1)); // send some data, but also close the session: pn_link_send(tx, "ABC", 4); pn_link_advance(tx); pn_session_close(ssn); pn_session_free(ssn); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } // delivery should have transfered: assert(pn_link_current(rx)); assert(pn_delivery_readable(pn_link_current(rx))); // c2's session should see the close: pn_session_t *ssn2 = pn_session_head(c2, 0); assert(ssn2 && pn_session_state(ssn2) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED)); pn_transport_unbind(t1); pn_transport_free(t1); pn_connection_free(c1); pn_transport_unbind(t2); pn_transport_free(t2); pn_connection_free(c2); return 0; } int test_free_link(int argc, char **argv) { fprintf(stdout, "test_free_link\n"); pn_connection_t *c1 = pn_connection(); pn_transport_t *t1 = pn_transport(); pn_transport_bind(t1, c1); pn_connection_t *c2 = pn_connection(); pn_transport_t *t2 = pn_transport(); pn_transport_set_server(t2); pn_transport_bind(t2, c2); //pn_transport_trace(t1, PN_TRACE_FRM); test_setup(c1, t1, c2, t2); pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(tx); pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(rx); // prepare for transfer: request some credit pn_link_flow(rx, 10); pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6)); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } assert(pn_delivery_writable(d1)); // send some data, then close and destroy the link: pn_link_send(tx, "ABC", 4); pn_link_advance(tx); pn_link_close(tx); pn_link_free(tx); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } // the data transfer will complete and the link close // should have been sent to the peer assert(pn_link_current(rx)); assert(pn_link_state(rx) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED)); pn_transport_unbind(t1); pn_transport_free(t1); pn_connection_free(c1); pn_transport_unbind(t2); pn_transport_free(t2); pn_connection_free(c2); return 0; } // regression test fo PROTON-1466 - confusion between links with prefix names static int test_link_name_prefix(int argc, char **argv) { fprintf(stdout, "test_link_name_prefix\n"); pn_connection_t *c1 = pn_connection(); pn_transport_t *t1 = pn_transport(); pn_transport_bind(t1, c1); pn_connection_t *c2 = pn_connection(); pn_transport_t *t2 = pn_transport(); pn_transport_set_server(t2); pn_transport_bind(t2, c2); pn_connection_open(c1); pn_connection_open(c2); pn_session_t *s1 = pn_session(c1); pn_session_open(s1); pn_link_t *l = pn_receiver(s1, "l"); pn_link_open(l); pn_link_t *lll = pn_receiver(s1, "lll"); pn_link_open(lll); pn_link_t *ll = pn_receiver(s1, "ll"); pn_link_open(ll); while (pump(t1, t2)) { process_endpoints(c1); process_endpoints(c2); } // session and link should be up, c2 should have a receiver link: assert(pn_session_state( s1 ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(pn_link_state( l ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(pn_link_state( lll ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(pn_link_state( ll ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); pn_link_t *r = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(!strcmp(pn_link_name(r), "l")); r = pn_link_next(r, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(!strcmp(pn_link_name(r), "lll")); r = pn_link_next(r, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE)); assert(!strcmp(pn_link_name(r), "ll")); pn_transport_unbind(t1); pn_transport_free(t1); pn_connection_free(c1); pn_transport_unbind(t2); pn_transport_free(t2); pn_connection_free(c2); return 0; } typedef int (*test_ptr_t)(int argc, char **argv); test_ptr_t tests[] = {test_free_connection, test_free_session, test_free_link, test_link_name_prefix, NULL}; int main(int argc, char **argv) { test_ptr_t *test = tests; while (*test) { int rc = (*test++)(argc, argv); if (rc) return rc; } return 0; } qpid-proton-0.22.0/proton-c/src/tests/data.c0000664000000000000000000000325113257152177015521 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #undef NDEBUG /* Make sure that assert() is enabled even in a release build. */ #include #include "core/data.h" #include #include // Make sure we can grow the capacity of a pn_data_t all the way to the max and we stop there. static void test_grow(void) { pn_data_t* data = pn_data(0); while (pn_data_size(data) < PNI_NID_MAX) { int code = pn_data_put_int(data, 1); if (code) fprintf(stderr, "%d: %s", code, pn_error_text(pn_data_error(data))); assert(code == 0); } assert(pn_data_size(data) == PNI_NID_MAX); int code = pn_data_put_int(data, 1); if (code != PN_OUT_OF_MEMORY) fprintf(stderr, "expected PN_OUT_OF_MEMORY, got %s\n", pn_code(code)); assert(code == PN_OUT_OF_MEMORY); assert(pn_data_size(data) == PNI_NID_MAX); pn_data_free(data); } int main(int argc, char **argv) { test_grow(); } qpid-proton-0.22.0/proton-c/src/tests/connection_driver.c0000664000000000000000000003547113257152177020333 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_handler.h" #include #include #include #include #include #include #include /* Handler that replies to REMOTE_OPEN, stores the opened object on the handler */ static pn_event_type_t open_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_REMOTE_OPEN: th->connection = pn_event_connection(e); pn_connection_open(th->connection); break; case PN_SESSION_REMOTE_OPEN: th->session = pn_event_session(e); pn_session_open(th->session); break; case PN_LINK_REMOTE_OPEN: th->link = pn_event_link(e); pn_link_open(th->link); break; default: break; } return PN_EVENT_NONE; } /* Handler that returns control on PN_DELIVERY and stores the delivery on the handler */ static pn_event_type_t delivery_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_DELIVERY: { th->delivery = pn_event_delivery(e); return PN_DELIVERY; } default: return open_handler(th, e); } } /* Blow-by-blow event verification of a single message transfer */ static void test_message_transfer(test_t *t) { test_connection_driver_t client, server; test_connection_driver_init(&client, t, open_handler, NULL); test_connection_driver_init(&server, t, delivery_handler, NULL); pn_transport_set_server(server.driver.transport); pn_connection_open(client.driver.connection); pn_session_t *ssn = pn_session(client.driver.connection); pn_session_open(ssn); pn_link_t *snd = pn_sender(ssn, "x"); pn_link_open(snd); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT( &client.handler, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN, PN_SESSION_INIT, PN_SESSION_LOCAL_OPEN, PN_LINK_INIT, PN_LINK_LOCAL_OPEN, PN_CONNECTION_BOUND, PN_CONNECTION_REMOTE_OPEN, PN_SESSION_REMOTE_OPEN, PN_LINK_REMOTE_OPEN, 0); TEST_HANDLER_EXPECT( &server.handler, PN_CONNECTION_INIT, PN_CONNECTION_BOUND, PN_CONNECTION_REMOTE_OPEN, PN_SESSION_INIT, PN_SESSION_REMOTE_OPEN, PN_LINK_INIT, PN_LINK_REMOTE_OPEN, PN_CONNECTION_LOCAL_OPEN, PN_TRANSPORT, PN_SESSION_LOCAL_OPEN, PN_TRANSPORT, PN_LINK_LOCAL_OPEN, PN_TRANSPORT, 0); pn_link_t *rcv = server.handler.link; TEST_CHECK(t, rcv); TEST_CHECK(t, pn_link_is_receiver(rcv)); pn_link_flow(rcv, 1); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT(&client.handler, PN_LINK_FLOW, 0); /* Encode and send a message */ pn_message_t *m = pn_message(); pn_data_put_string(pn_message_body(m), pn_bytes(4, "abc")); /* Include trailing NULL */ pn_rwbytes_t buf = { 0 }; ssize_t size = message_encode(m, &buf); pn_message_free(m); pn_delivery(snd, PN_BYTES_LITERAL(x)); TEST_INT_EQUAL(t, size, pn_link_send(snd, buf.start, size)); TEST_CHECK(t, pn_link_advance(snd)); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT(&server.handler, PN_TRANSPORT, PN_DELIVERY, 0); /* Receive and decode the message */ pn_delivery_t *dlv = server.handler.delivery; TEST_ASSERT(dlv); pn_message_t *m2 = pn_message(); pn_rwbytes_t buf2 = { 0 }; message_decode(m2, dlv, &buf2); pn_data_t *body = pn_message_body(m2); pn_data_rewind(body); TEST_CHECK(t, pn_data_next(body)); TEST_CHECK(t, PN_STRING == pn_data_type(body)); TEST_CHECK(t, 4 == pn_data_get_string(pn_message_body(m2)).size); TEST_STR_EQUAL(t, "abc", pn_data_get_string(pn_message_body(m2)).start); pn_message_free(m2); free(buf.start); free(buf2.start); test_connection_driver_destroy(&client); test_connection_driver_destroy(&server); } /* Handler that opens a connection and sender link */ pn_event_type_t send_client_handler(test_handler_t *th, pn_event_t *e) { switch (pn_event_type(e)) { case PN_CONNECTION_LOCAL_OPEN: { pn_connection_open(pn_event_connection(e)); pn_session_t *ssn = pn_session(pn_event_connection(e)); pn_session_open(ssn); pn_link_t *snd = pn_sender(ssn, "x"); pn_link_open(snd); break; } case PN_LINK_REMOTE_OPEN: { th->link = pn_event_link(e); return PN_LINK_REMOTE_OPEN; } default: break; } return PN_EVENT_NONE; } /* Send a message in pieces, ensure each can be received before the next is sent */ static void test_message_stream(test_t *t) { /* Set up the link, give credit, start the delivery */ test_connection_driver_t client, server; test_connection_driver_init(&client, t, send_client_handler, NULL); test_connection_driver_init(&server, t, delivery_handler, NULL); pn_transport_set_server(server.driver.transport); pn_connection_open(client.driver.connection); test_connection_drivers_run(&client, &server); pn_link_t *rcv = server.handler.link; pn_link_t *snd = client.handler.link; pn_link_flow(rcv, 1); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT_LAST(&client.handler, PN_LINK_FLOW); TEST_HANDLER_EXPECT_LAST(&server.handler, PN_TRANSPORT); /* Encode a large (not very) message to send in chunks */ pn_message_t *m = pn_message(); char body[1024] = { 0 }; pn_data_put_binary(pn_message_body(m), pn_bytes(sizeof(body), body)); pn_rwbytes_t buf = { 0 }; ssize_t size = message_encode(m, &buf); /* Send and receive the message in chunks */ static const ssize_t CHUNK = 100; pn_delivery(snd, PN_BYTES_LITERAL(x)); pn_rwbytes_t buf2 = { 0 }; ssize_t received = 0; for (ssize_t i = 0; i < size; i += CHUNK) { /* Send a chunk */ ssize_t c = (i+CHUNK < size) ? CHUNK : size - i; TEST_CHECK(t, c == pn_link_send(snd, buf.start + i, c)); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT_LAST(&server.handler, PN_DELIVERY); /* Receive a chunk */ pn_delivery_t *dlv = server.handler.delivery; pn_link_t *l = pn_delivery_link(dlv); ssize_t dsize = pn_delivery_pending(dlv); rwbytes_ensure(&buf2, received+dsize); TEST_ASSERT(dsize == pn_link_recv(l, buf2.start + received, dsize)); received += dsize; } TEST_CHECK(t, pn_link_advance(snd)); TEST_CHECK(t, received == size); TEST_CHECK(t, !memcmp(buf.start, buf2.start, size)); pn_message_free(m); free(buf.start); free(buf2.start); test_connection_driver_destroy(&client); test_connection_driver_destroy(&server); } // Test aborting a delivery static void test_message_abort(test_t *t) { /* Set up the link, give credit, start the delivery */ test_connection_driver_t client, server; test_connection_driver_init(&client, t, send_client_handler, NULL); test_connection_driver_init(&server, t, delivery_handler, NULL); pn_transport_set_server(server.driver.transport); pn_connection_open(client.driver.connection); test_connection_drivers_run(&client, &server); pn_link_t *rcv = server.handler.link; pn_link_t *snd = client.handler.link; char data[100] = {0}; /* Dummy data to send. */ char rbuf[sizeof(data)] = {0}; /* Read buffer for incoming data. */ /* Send 2 frames with data */ pn_link_flow(rcv, 1); TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); test_connection_drivers_run(&client, &server); TEST_INT_EQUAL(t, 1, pn_link_credit(snd)); pn_delivery_t *sd = pn_delivery(snd, PN_BYTES_LITERAL(1)); /* Sender delivery */ for (size_t i = 0; i < 2; ++i) { TEST_INT_EQUAL(t, sizeof(data), pn_link_send(snd, data, sizeof(data))); test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT_LAST(&server.handler, PN_DELIVERY); pn_delivery_t *rd = server.handler.delivery; TEST_CHECK(t, !pn_delivery_aborted(rd)); TEST_CHECK(t, pn_delivery_partial(rd)); TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); TEST_INT_EQUAL(t, sizeof(data), pn_delivery_pending(rd)); TEST_INT_EQUAL(t, sizeof(rbuf), pn_link_recv(pn_delivery_link(rd), rbuf, sizeof(rbuf))); TEST_INT_EQUAL(t, 0, pn_link_recv(pn_delivery_link(rd), rbuf, sizeof(rbuf))); TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); } TEST_INT_EQUAL(t, 1, pn_link_credit(snd)); /* Abort the delivery */ pn_delivery_abort(sd); TEST_INT_EQUAL(t, 0, pn_link_credit(snd)); TEST_CHECK(t, pn_link_current(snd) != sd); /* Settled */ test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT_LAST(&server.handler, PN_DELIVERY); TEST_INT_EQUAL(t, 0, pn_link_credit(snd)); /* Receive the aborted=true frame, should be empty */ pn_delivery_t *rd = server.handler.delivery; TEST_CHECK(t, pn_delivery_aborted(rd)); TEST_CHECK(t, !pn_delivery_partial(rd)); /* Aborted deliveries are never partial */ TEST_CHECK(t, pn_delivery_settled(rd)); /* Aborted deliveries are remote settled */ TEST_INT_EQUAL(t, 1, pn_delivery_pending(rd)); TEST_INT_EQUAL(t, PN_ABORTED, pn_link_recv(pn_delivery_link(rd), rbuf, sizeof(rbuf))); pn_delivery_settle(rd); /* Must be settled locally to free it */ TEST_INT_EQUAL(t, 0, pn_link_credit(snd)); TEST_INT_EQUAL(t, 0, pn_link_credit(rcv)); /* Abort a delivery before any data has been framed, should be dropped. */ pn_link_flow(rcv, 1); TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); test_connection_drivers_run(&client, &server); test_handler_clear(&client.handler, 0); test_handler_clear(&server.handler, 0); sd = pn_delivery(snd, PN_BYTES_LITERAL(x)); TEST_INT_EQUAL(t, sizeof(data), pn_link_send(snd, data, sizeof(data))); pn_delivery_abort(sd); TEST_CHECK(t, pn_link_current(snd) != sd); /* Settled, possibly freed */ test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT(&server.handler, 0); /* Expect no delivery at the server */ /* Client gets transport/flow after abort to ensure other messages are sent */ TEST_HANDLER_EXPECT(&client.handler, PN_TRANSPORT, PN_LINK_FLOW, 0); /* Aborted delivery consumes no credit */ TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); TEST_INT_EQUAL(t, 1, pn_link_credit(snd)); test_connection_driver_destroy(&client); test_connection_driver_destroy(&server); } int send_receive_message(test_t *t, const char* tag, test_connection_driver_t *src, test_connection_driver_t *dst) { int errors = t->errors; char data[100] = {0}; /* Dummy data to send. */ strncpy(data, tag, sizeof(data)); data[99] = 0; /* Ensure terminated as we strcmp this later*/ if (!TEST_CHECK(t, pn_link_credit(src->handler.link))) return 1; pn_delivery_t *sd = pn_delivery(src->handler.link, pn_dtag(tag, strlen(tag))); dst->handler.delivery = NULL; TEST_CHECK(t, pn_delivery_current(sd)); TEST_INT_EQUAL(t, sizeof(data), pn_link_send(src->handler.link, data, sizeof(data))); pn_delivery_settle(sd); test_connection_drivers_run(src, dst); pn_delivery_t *rd = dst->handler.delivery; dst->handler.delivery = NULL; if (!TEST_CHECK(t, rd)) return 1; TEST_CHECK(t, pn_delivery_current(rd)); char rbuf[sizeof(data)] = {0}; /* Read buffer for incoming data. */ TEST_INT_EQUAL(t, sizeof(rbuf), pn_link_recv(pn_delivery_link(rd), rbuf, sizeof(rbuf))); TEST_STR_EQUAL(t, data, rbuf); pn_delivery_settle(rd); return t->errors > errors; } #define SEND_RECEIVE_MESSAGE(T, TAG, SRC, DST) \ TEST_INT_EQUAL(T, 0, send_receive_message(T, TAG, SRC, DST)) // Test mixing aborted and good deliveries, make sure credit is correct. static void test_message_abort_mixed(test_t *t) { /* Set up the link, give credit, start the delivery */ test_connection_driver_t client, server; test_connection_driver_init(&client, t, send_client_handler, NULL); test_connection_driver_init(&server, t, delivery_handler, NULL); pn_transport_set_server(server.driver.transport); pn_connection_open(client.driver.connection); test_connection_drivers_run(&client, &server); pn_link_t *rcv = server.handler.link; pn_link_t *snd = client.handler.link; char data[100] = {0}; /* Dummy data to send. */ char rbuf[sizeof(data)] = {0}; /* Read buffer for incoming data. */ /* We will send 3 good messages, interleaved with aborted ones */ pn_link_flow(rcv, 5); test_connection_drivers_run(&client, &server); SEND_RECEIVE_MESSAGE(t, "one", &client, &server); TEST_INT_EQUAL(t, 4, pn_link_credit(snd)); TEST_INT_EQUAL(t, 4, pn_link_credit(rcv)); pn_delivery_t *sd, *rd; /* Send a frame, then an abort */ sd = pn_delivery(snd, PN_BYTES_LITERAL("x1")); server.handler.delivery = NULL; TEST_INT_EQUAL(t, sizeof(data), pn_link_send(snd, data, sizeof(data))); TEST_INT_EQUAL(t, 4, pn_link_credit(snd)); /* Nothing sent yet */ test_connection_drivers_run(&client, &server); rd = server.handler.delivery; if (!TEST_CHECK(t, rd)) goto cleanup; TEST_INT_EQUAL(t, sizeof(rbuf), pn_link_recv(pn_delivery_link(rd), rbuf, sizeof(rbuf))); pn_delivery_abort(sd); test_connection_drivers_run(&client, &server); TEST_CHECK(t, pn_delivery_aborted(rd)); pn_delivery_settle(rd); /* Abort after sending data consumes credit */ TEST_INT_EQUAL(t, 3, pn_link_credit(snd)); TEST_INT_EQUAL(t, 3, pn_link_credit(rcv)); SEND_RECEIVE_MESSAGE(t, "two", &client, &server); TEST_INT_EQUAL(t, 2, pn_link_credit(snd)); TEST_INT_EQUAL(t, 2, pn_link_credit(rcv)); /* Abort a delivery before any data has been framed, should be dropped. */ test_handler_clear(&server.handler, 0); sd = pn_delivery(snd, PN_BYTES_LITERAL(4)); TEST_INT_EQUAL(t, sizeof(data), pn_link_send(snd, data, sizeof(data))); pn_delivery_abort(sd); TEST_CHECK(t, pn_link_current(snd) != sd); /* Advanced */ test_connection_drivers_run(&client, &server); TEST_HANDLER_EXPECT(&server.handler, PN_TRANSPORT, 0); /* Aborting wit no frames sent should leave credit untouched */ TEST_INT_EQUAL(t, 2, pn_link_credit(snd)); TEST_INT_EQUAL(t, 2, pn_link_credit(rcv)); SEND_RECEIVE_MESSAGE(t, "three", &client, &server); TEST_INT_EQUAL(t, 1, pn_link_credit(rcv)); TEST_INT_EQUAL(t, 1, pn_link_credit(snd)); cleanup: test_connection_driver_destroy(&client); test_connection_driver_destroy(&server); } int main(int argc, char **argv) { int failed = 0; RUN_ARGV_TEST(failed, t, test_message_transfer(&t)); RUN_ARGV_TEST(failed, t, test_message_stream(&t)); RUN_ARGV_TEST(failed, t, test_message_abort(&t)); RUN_ARGV_TEST(failed, t, test_message_abort_mixed(&t)); return failed; } qpid-proton-0.22.0/proton-c/src/tests/condition.c0000664000000000000000000000370713257152177016604 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include static int fail = 0; #define TEST_ASSERT(B) \ if(!(B)) { \ ++fail; \ printf("%s:%d %s\n", __FILE__, __LINE__ , #B); \ } int main(int argc, char **argv) { pn_connection_t *c = pn_connection(); pn_condition_t *cond = pn_connection_condition(c); // Verify empty TEST_ASSERT(!pn_condition_is_set(cond)); TEST_ASSERT(!pn_condition_get_name(cond)); TEST_ASSERT(!pn_condition_get_description(cond)); // Format a condition pn_condition_format(cond, "foo", "hello %d", 42); TEST_ASSERT(pn_condition_is_set(cond)); TEST_ASSERT(strcmp("foo", pn_condition_get_name(cond)) == 0); TEST_ASSERT(strcmp("hello 42", pn_condition_get_description(cond)) == 0); // Clear and verify empty pn_condition_clear(cond); TEST_ASSERT(!pn_condition_is_set(cond)); TEST_ASSERT(!pn_condition_get_name(cond)); TEST_ASSERT(!pn_condition_get_description(cond)); pn_connection_free(c); return fail; } qpid-proton-0.22.0/proton-c/src/tests/CMakeLists.txt0000664000000000000000000000476613257152177017220 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # add_definitions(${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}) configure_file(test_config.h.in test_config.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) macro (pn_add_c_test test) add_executable (${test} ${ARGN}) target_link_libraries (${test} qpid-proton-core ${PLATFORM_LIBS}) if (BUILD_WITH_CXX) set_source_files_properties (${ARGN} PROPERTIES LANGUAGE CXX) endif (BUILD_WITH_CXX) add_test (NAME ${test} COMMAND ${env_py} -- "PATH=$" ${memcheck-cmd} $) endmacro(pn_add_c_test) pn_add_c_test (c-object-tests object.c) pn_add_c_test (c-message-tests message.c) pn_add_c_test (c-engine-tests engine.c) pn_add_c_test (c-refcount-tests refcount.c) pn_add_c_test (c-event-tests event.c) pn_add_c_test (c-data-tests data.c) pn_add_c_test (c-condition-tests condition.c) pn_add_c_test (c-connection-driver-tests connection_driver.c) pn_add_c_test (c-ssl-tests ssl.c) pn_add_c_test (c-parse-url-tests parse-url.c) target_link_libraries (c-parse-url-tests qpid-proton) if(HAS_PROACTOR) pn_add_c_test (c-proactor-tests proactor.c) target_link_libraries (c-proactor-tests qpid-proton-proactor) if(WIN32) set(path "$\\;$") else(WIN32) set(path "$:$ENV{PATH}") endif(WIN32) # Add the tools directory for the 'proctest' module set_search_path(pypath "${CMAKE_SOURCE_DIR}/tools/py" "$ENV{PYTHON_PATH}") add_test(NAME c-fdlimit-tests COMMAND ${env_py} -- "PATH=${path}" "PYTHONPATH=${pypath}" ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/fdlimit.py) endif(HAS_PROACTOR) # fuzz tests: tests/fuzz if (ENABLE_FUZZ_TESTING) add_subdirectory(fuzz) endif (ENABLE_FUZZ_TESTING) qpid-proton-0.22.0/proton-c/src/ssl/0000775000000000000000000000000013257152177014102 5ustar qpid-proton-0.22.0/proton-c/src/ssl/ssl_stub.c0000664000000000000000000000726413257152177016115 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "core/engine-internal.h" /** @file * SSL/TLS support API. * * This file contains stub implementations of the SSL/TLS API. This implementation is * used if there is no SSL/TLS support in the system's environment. */ bool pn_ssl_present(void) { return false; } pn_ssl_t *pn_ssl(pn_transport_t *transport) { return NULL; } int pn_ssl_init(pn_ssl_t *ssl, pn_ssl_domain_t *domain, const char *session_id) { return -1; } void pn_ssl_free( pn_ssl_t *ssl) { } void pn_ssl_trace(pn_ssl_t *ssl, pn_trace_t trace) { } ssize_t pn_ssl_input(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available) { return PN_EOS; } ssize_t pn_ssl_output(pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_size) { return PN_EOS; } const pn_io_layer_t ssl_layer = { pn_ssl_input, pn_ssl_output, NULL, NULL }; bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size) { *buffer = '\0'; return false; } bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size) { *buffer = '\0'; return false; } pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode) { return NULL; } void pn_ssl_domain_free( pn_ssl_domain_t *d ) { } int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain, const char *certificate_file, const char *private_key_file, const char *password) { return -1; } int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain, const char *certificate_db) { return -1; } int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_ssl_verify_mode_t mode, const char *trusted_CAs) { return -1; } int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain) { return -1; } int pn_ssl_domain_set_ciphers(pn_ssl_domain_t *domain, const char *ciphers) { return -1; } int pn_ssl_domain_set_protocols(pn_ssl_domain_t* domain, const char* protocols) { return -1; } bool pn_ssl_allow_unsecured(pn_ssl_t *ssl) { return true; } pn_ssl_resume_status_t pn_ssl_resume_status( pn_ssl_t *s ) { return PN_SSL_RESUME_UNKNOWN; } int pn_ssl_set_peer_hostname( pn_ssl_t *ssl, const char *hostname) { return -1; } int pn_ssl_get_peer_hostname( pn_ssl_t *ssl, char *hostname, size_t *bufsize ) { return -1; } const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl) { return NULL; } int pn_ssl_get_ssf(pn_ssl_t *ssl) { return 0; } int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg) { *fingerprint = '\0'; return -1; } const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field) { return NULL; } qpid-proton-0.22.0/proton-c/src/ssl/ssl-internal.h0000664000000000000000000000221413257152177016665 0ustar #ifndef PROTON_SSL_INTERNAL_H #define PROTON_SSL_INTERNAL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/ssl.h" /** @file * Internal API for SSL/TLS support in the Driver Layer. * * Generic API to abstract the implementation of SSL/TLS from the Driver codebase. * */ // release the SSL context void pn_ssl_free(pn_transport_t *transport); #endif /* ssl-internal.h */ qpid-proton-0.22.0/proton-c/src/ssl/schannel.c0000664000000000000000000023143113257152177016045 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * SChannel is designed to encrypt and decrypt data in place. So a * given buffer is expected to sometimes contain encrypted data, * sometimes decrypted data, and occasionally both. Outgoing buffers * need to reserve space for the TLS header and trailer. Read * operations need to ignore the same headers and trailers from * incoming buffers. Outgoing is simple because we choose record * boundaries. Incoming is complicated by handling incomplete TLS * records, and buffering contiguous data for the app layer that may * span many records. A lazy double buffering system is used for * the latter. */ #include #include #include "core/engine-internal.h" #include "platform/platform.h" #include "core/util.h" #include "core/autodetect.h" #include // security.h needs to see this to distinguish from kernel use. #include #define SECURITY_WIN32 #include #include #include #undef SECURITY_WIN32 /** @file * SSL/TLS support API. * * This file contains an SChannel-based implemention of the SSL/TLS API for Windows platforms. */ static void ssl_log_error(const char *fmt, ...); static void ssl_log(pn_transport_t *transport, const char *fmt, ...); static void ssl_log_error_status(HRESULT status, const char *fmt, ...); static HCERTSTORE open_cert_db(const char *store_name, const char *passwd, int *error); // Thread support. Some SChannel objects are shared or ref-counted. // Consistent with the rest of Proton, we assume a connection (and // therefore its pn_ssl_t) will not be accessed concurrently by // multiple threads. class csguard { public: csguard(CRITICAL_SECTION *cs) : cs_(cs), set_(true) { EnterCriticalSection(cs_); } ~csguard() { if (set_) LeaveCriticalSection(cs_); } void release() { if (set_) { set_ = false; LeaveCriticalSection(cs_); } } private: LPCRITICAL_SECTION cs_; bool set_; }; /* * win_credential_t: SChannel context that must accompany TLS connections. * * SChannel attempts session resumption for shared CredHandle objects. * To mimic openssl behavior, server CredHandle handles must be shared * by derived connections, client CredHandle handles must be unique * when app's session_id is null and tracked for reuse otherwise * (TODO). * * Ref counted by parent ssl_domain_t and each derived connection. */ struct win_credential_t { CRITICAL_SECTION cslock; pn_ssl_mode_t mode; PCCERT_CONTEXT cert_context; // Particulars of the certificate (if any) CredHandle cred_handle; // Bound session parameters, certificate, CAs, verification_mode HCERTSTORE trust_store; // Store of root CAs for validating HCERTSTORE server_CA_certs; // CAs advertised by server (may be a duplicate of the trust_store) char *trust_store_name; }; #define win_credential_compare NULL #define win_credential_inspect NULL #define win_credential_hashcode NULL static void win_credential_initialize(void *object) { win_credential_t *c = (win_credential_t *) object; InitializeCriticalSectionAndSpinCount(&c->cslock, 4000); SecInvalidateHandle(&c->cred_handle); c->cert_context = 0; c->trust_store = 0; c->server_CA_certs = 0; c->trust_store_name = 0; } static void win_credential_finalize(void *object) { win_credential_t *c = (win_credential_t *) object; if (SecIsValidHandle(&c->cred_handle)) FreeCredentialsHandle(&c->cred_handle); if (c->cert_context) CertFreeCertificateContext(c->cert_context); if (c->trust_store) CertCloseStore(c->trust_store, 0); if (c->server_CA_certs) CertCloseStore(c->server_CA_certs, 0); DeleteCriticalSection(&c->cslock); free(c->trust_store_name); } static win_credential_t *win_credential(pn_ssl_mode_t m) { static const pn_cid_t CID_win_credential = CID_pn_void; static const pn_class_t clazz = PN_CLASS(win_credential); win_credential_t *c = (win_credential_t *) pn_class_new(&clazz, sizeof(win_credential_t)); c->mode = m; csguard g(&c->cslock); pn_incref(c); // See next comment regarding refcounting and locks return c; } // Hack strategy for Proton object refcounting. Just hold the lock for incref. // Use the next two functions for decref, one with, the other without the lock. // The refcount is artificially bumped by one in win_credential() so that we // can use refcount == 1 to actually delete (by calling decref one last time). static bool win_credential_decref(win_credential_t *c) { // Call with lock held. Caller MUST call win_credential_delete if this returns true. return pn_decref(c) == 1; } static void win_credential_delete(win_credential_t *c) { // Call without lock held. assert(pn_refcount(c) == 1); pn_decref(c); } static int win_credential_load_cert(win_credential_t *cred, const char *store_name, const char *cert_name, const char *passwd) { if (!store_name) return -2; int ec = 0; HCERTSTORE cert_store = open_cert_db(store_name, passwd, &ec); if (!cert_store) return ec; // find friendly name that matches cert_name, or sole certificate PCCERT_CONTEXT tmpctx = NULL; PCCERT_CONTEXT found_ctx = NULL; int cert_count = 0; int name_len = cert_name ? strlen(cert_name) : 0; char *fn = name_len ? (char *) malloc(name_len + 1) : 0; while (tmpctx = CertEnumCertificatesInStore(cert_store, tmpctx)) { cert_count++; if (cert_name && *cert_name) { DWORD len = CertGetNameString(tmpctx, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, NULL, 0); if (len != name_len + 1) continue; CertGetNameString(tmpctx, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, fn, len); if (!strcmp(cert_name, fn)) { found_ctx = tmpctx; tmpctx= NULL; break; } } else { // Test for single certificate if (cert_count == 1) { found_ctx = CertDuplicateCertificateContext(tmpctx); } else { ssl_log_error("Multiple certificates to choose from certificate store %s\n", store_name); found_ctx = NULL; break; } } } if (tmpctx) { CertFreeCertificateContext(tmpctx); tmpctx = false; } if (!found_ctx && cert_name && cert_count == 1) ssl_log_error("Could not find certificate %s in store %s\n", cert_name, store_name); cred->cert_context = found_ctx; free(fn); CertCloseStore(cert_store, 0); return found_ctx ? 0 : -8; } // call with win_credential lock held static CredHandle win_credential_cred_handle(win_credential_t *cred, pn_ssl_verify_mode_t verify_mode, const char *session_id, SECURITY_STATUS *status) { if (cred->mode == PN_SSL_MODE_SERVER && SecIsValidHandle(&cred->cred_handle)) { *status = SEC_E_OK; return cred->cred_handle; // Server always reuses cached value } // TODO: if (is_client && session_id != NULL) create or use cached value based on // session_id+server_host_name (per domain? reclaimed after X hours?) CredHandle tmp_handle; SecInvalidateHandle(&tmp_handle); TimeStamp expiry; // Not used SCHANNEL_CRED descriptor; memset(&descriptor, 0, sizeof(descriptor)); descriptor.dwVersion = SCHANNEL_CRED_VERSION; descriptor.dwFlags = SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION; if (cred->cert_context != NULL) { // assign the certificate into the credentials descriptor.paCred = &cred->cert_context; descriptor.cCreds = 1; } if (cred->mode == PN_SSL_MODE_SERVER) { descriptor.dwFlags |= SCH_CRED_NO_SYSTEM_MAPPER; if (cred->server_CA_certs) { descriptor.hRootStore = cred->server_CA_certs; } } ULONG direction = (cred->mode == PN_SSL_MODE_SERVER) ? SECPKG_CRED_INBOUND : SECPKG_CRED_OUTBOUND; *status = AcquireCredentialsHandle(NULL, UNISP_NAME, direction, NULL, &descriptor, NULL, NULL, &tmp_handle, &expiry); if (cred->mode == PN_SSL_MODE_SERVER && *status == SEC_E_OK) cred->cred_handle = tmp_handle; return tmp_handle; } static bool win_credential_has_certificate(win_credential_t *cred) { if (!cred) return false; return (cred->cert_context != NULL); } #define SSL_DATA_SIZE 16384 #define SSL_BUF_SIZE (SSL_DATA_SIZE + 5 + 2048 + 32) typedef enum { UNKNOWN_CONNECTION, SSL_CONNECTION, CLEAR_CONNECTION } connection_mode_t; typedef struct pn_ssl_session_t pn_ssl_session_t; struct pn_ssl_domain_t { CRITICAL_SECTION cslock; int ref_count; pn_ssl_mode_t mode; bool has_ca_db; // true when CA database configured pn_ssl_verify_mode_t verify_mode; bool allow_unsecured; win_credential_t *cred; }; typedef enum { CREATED, CLIENT_HELLO, NEGOTIATING, RUNNING, SHUTTING_DOWN, SSL_CLOSED } ssl_state_t; struct pni_ssl_t { pn_ssl_domain_t *domain; const char *session_id; const char *peer_hostname; ssl_state_t state; bool protocol_detected; bool queued_shutdown; bool ssl_closed; // shutdown complete, or SSL error ssize_t app_input_closed; // error code returned by upper layer process input ssize_t app_output_closed; // error code returned by upper layer process output // OpenSSL hides the protocol envelope bytes, SChannel has them in-line. char *sc_outbuf; // SChannel output buffer size_t sc_out_size; size_t sc_out_count; char *network_outp; // network ready bytes within sc_outbuf size_t network_out_pending; char *sc_inbuf; // SChannel input buffer size_t sc_in_size; size_t sc_in_count; bool sc_in_incomplete; char *inbuf_extra; // Still encrypted data from following Record(s) size_t extra_count; char *in_data; // Just the plaintext data part of sc_inbuf, decrypted in place size_t in_data_size; size_t in_data_count; bool decrypting; size_t max_data_size; // computed in the handshake pn_bytes_t app_inbytes; // Virtual decrypted datastream, presented to app layer pn_buffer_t *inbuf2; // Second input buf if longer contiguous bytes needed bool double_buffered; bool sc_input_shutdown; CredHandle cred_handle; CtxtHandle ctxt_handle; SecPkgContext_StreamSizes sc_sizes; pn_ssl_verify_mode_t verify_mode; win_credential_t *cred; char *subject; }; static inline pn_transport_t *get_transport_internal(pn_ssl_t *ssl) { // The external pn_sasl_t is really a pointer to the internal pni_transport_t return ((pn_transport_t *)ssl); } static inline pni_ssl_t *get_ssl_internal(pn_ssl_t *ssl) { // The external pn_sasl_t is really a pointer to the internal pni_transport_t return ssl ? ((pn_transport_t *)ssl)->ssl : NULL; } struct pn_ssl_session_t { const char *id; // TODO pn_ssl_session_t *ssn_cache_next; pn_ssl_session_t *ssn_cache_prev; }; static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len); static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *input_data, size_t len); static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len); static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len); static pn_ssl_session_t *ssn_cache_find( pn_ssl_domain_t *, const char * ); static void ssl_session_free( pn_ssl_session_t *); static size_t buffered_output( pn_transport_t *transport ); static void start_ssl_shutdown(pn_transport_t *transport); static void rewind_sc_inbuf(pni_ssl_t *ssl); static bool grow_inbuf2(pn_transport_t *ssl, size_t minimum_size); static HRESULT verify_peer(pni_ssl_t *ssl, HCERTSTORE root_store, const char *server_name, bool tracing); // @todo: used to avoid littering the code with calls to printf... static void ssl_log_error(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } // @todo: used to avoid littering the code with calls to printf... static void ssl_log(pn_transport_t *transport, const char *fmt, ...) { if (PN_TRACE_DRV & transport->trace) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } } static void ssl_log_error_status(HRESULT status, const char *fmt, ...) { char buf[512]; va_list ap; if (fmt) { va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); } if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, 0, status, 0, buf, sizeof(buf), 0)) ssl_log_error(" : %s\n", buf); else fprintf(stderr, "pn internal Windows error: %x for %x\n", GetLastError(), status); fflush(stderr); } static void ssl_log_clear_data(pn_transport_t *transport, const char *data, size_t len) { if (PN_TRACE_RAW & transport->trace) { fprintf(stderr, "SSL decrypted data: \""); pn_fprint_data( stderr, data, len ); fprintf(stderr, "\"\n"); } } static size_t _pni_min(size_t a, size_t b) { return (a < b) ? a : b; } // unrecoverable SSL failure occured, notify transport and generate error code. static int ssl_failed(pn_transport_t *transport, const char *reason) { char buf[512] = "Unknown error."; if (!reason) { HRESULT status = GetLastError(); FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, 0, status, 0, buf, sizeof(buf), 0); reason = buf; } pni_ssl_t *ssl = transport->ssl; ssl->ssl_closed = true; ssl->app_input_closed = ssl->app_output_closed = PN_EOS; ssl->state = SSL_CLOSED; pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: %s", reason); return PN_EOS; } static pn_ssl_session_t *ssn_cache_find( pn_ssl_domain_t *domain, const char *id ) { // TODO: return NULL; } static void ssl_session_free( pn_ssl_session_t *ssn) { if (ssn) { if (ssn->id) free( (void *)ssn->id ); free( ssn ); } } /** Public API - visible to application code */ bool pn_ssl_present(void) { return true; } pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode ) { pn_ssl_domain_t *domain = (pn_ssl_domain_t *) calloc(1, sizeof(pn_ssl_domain_t)); if (!domain) return NULL; InitializeCriticalSectionAndSpinCount(&domain->cslock, 4000); csguard(&domain->cslock); domain->ref_count = 1; domain->mode = mode; switch(mode) { case PN_SSL_MODE_CLIENT: case PN_SSL_MODE_SERVER: break; default: ssl_log_error("Invalid mode for pn_ssl_mode_t: %d\n", mode); free(domain); return NULL; } domain->cred = win_credential(mode); return domain; } // call with no locks void pn_ssl_domain_free( pn_ssl_domain_t *domain ) { if (!domain) return; { csguard g(&domain->cslock); if (--domain->ref_count) return; } { csguard g2(&domain->cred->cslock); if (win_credential_decref(domain->cred)) { g2.release(); win_credential_delete(domain->cred); } } DeleteCriticalSection(&domain->cslock); free(domain); } int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain, const char *certificate_file, const char *private_key_file, const char *password) { if (!domain) return -1; csguard g(&domain->cslock); csguard g2(&domain->cred->cslock); if (win_credential_has_certificate(domain->cred)) { // Need a new win_credential_t to hold new certificate if (win_credential_decref(domain->cred)) { g2.release(); win_credential_delete(domain->cred); } domain->cred = win_credential(domain->mode); if (!domain->cred) return -1; } return win_credential_load_cert(domain->cred, certificate_file, private_key_file, password); } int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain, const char *certificate_db) { if (!domain || !certificate_db) return -1; csguard g(&domain->cslock); int ec = 0; HCERTSTORE store = open_cert_db(certificate_db, NULL, &ec); if (!store) return ec; if (domain->has_ca_db) { csguard g2(&domain->cred->cslock); win_credential_t *new_cred = win_credential(domain->mode); if (!new_cred) { CertCloseStore(store, 0); return -1; } new_cred->cert_context = CertDuplicateCertificateContext(domain->cred->cert_context); if (win_credential_decref(domain->cred)) { g2.release(); win_credential_delete(domain->cred); } domain->cred = new_cred; } csguard g3(&domain->cred->cslock); domain->cred->trust_store = store; domain->cred->trust_store_name = pn_strdup(certificate_db); domain->has_ca_db = true; return 0; } int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_ssl_verify_mode_t mode, const char *trusted_CAs) { if (!domain) return -1; csguard g(&domain->cslock); csguard g2(&domain->cred->cslock); if (!domain->has_ca_db && (mode == PN_SSL_VERIFY_PEER || mode == PN_SSL_VERIFY_PEER_NAME)) { ssl_log_error("Error: cannot verify peer without a trusted CA configured.\n" " Use pn_ssl_domain_set_trusted_ca_db()\n"); return -1; } HCERTSTORE store = 0; bool changed = domain->verify_mode && mode != domain->verify_mode; switch (mode) { case PN_SSL_VERIFY_PEER: case PN_SSL_VERIFY_PEER_NAME: if (domain->mode == PN_SSL_MODE_SERVER) { if (!trusted_CAs) { ssl_log_error("Error: a list of trusted CAs must be provided."); return -1; } if (!win_credential_has_certificate(domain->cred)) { ssl_log_error("Error: Server cannot verify peer without configuring a certificate.\n" " Use pn_ssl_domain_set_credentials()"); return -1; } int ec = 0; if (!strcmp(trusted_CAs, domain->cred->trust_store_name)) { changed = true; store = open_cert_db(trusted_CAs, NULL, &ec); if (!store) return ec; } } break; case PN_SSL_ANONYMOUS_PEER: // hippie free love mode... :) break; default: ssl_log_error("Invalid peer authentication mode given.\n"); return -1; } if (changed) { win_credential_t *new_cred = win_credential(domain->mode); if (!new_cred) { if (store) CertCloseStore(store, 0); return -1; } new_cred->cert_context = CertDuplicateCertificateContext(domain->cred->cert_context); new_cred->trust_store = CertDuplicateStore(domain->cred->trust_store); new_cred->trust_store_name = pn_strdup(domain->cred->trust_store_name); if (win_credential_decref(domain->cred)) { g2.release(); win_credential_delete(domain->cred); } domain->cred = new_cred; domain->cred->server_CA_certs = store; } domain->verify_mode = mode; return 0; } int pn_ssl_domain_set_ciphers(pn_ssl_domain_t *domain, const char *ciphers) { return PN_ERR; } int pn_ssl_domain_set_protocols(pn_ssl_domain_t *domain, const char *protocols) { return PN_ERR; } const pn_io_layer_t ssl_layer = { process_input_ssl, process_output_ssl, NULL, NULL, buffered_output }; const pn_io_layer_t ssl_input_closed_layer = { process_input_done, process_output_ssl, NULL, NULL, buffered_output }; const pn_io_layer_t ssl_output_closed_layer = { process_input_ssl, process_output_done, NULL, NULL, buffered_output }; const pn_io_layer_t ssl_closed_layer = { process_input_done, process_output_done, NULL, NULL, buffered_output }; int pn_ssl_init(pn_ssl_t *ssl0, pn_ssl_domain_t *domain, const char *session_id) { pn_transport_t *transport = get_transport_internal(ssl0); pni_ssl_t *ssl = transport->ssl; if (!ssl || !domain || ssl->domain) return -1; if (ssl->state != CREATED) return -1; csguard g(&domain->cslock); csguard g2(&domain->cred->cslock); ssl->domain = domain; domain->ref_count++; if (session_id && domain->mode == PN_SSL_MODE_CLIENT) ssl->session_id = pn_strdup(session_id); // If SSL doesn't specifically allow skipping encryption, require SSL // TODO: This is a probably a stop-gap until allow_unsecured is removed if (!domain->allow_unsecured) transport->encryption_required = true; ssl->cred = domain->cred; pn_incref(domain->cred); SECURITY_STATUS status = SEC_E_OK; ssl->cred_handle = win_credential_cred_handle(ssl->cred, ssl->verify_mode, ssl->session_id, &status); if (status != SEC_E_OK) { ssl_log_error_status(status, "Credentials handle failure"); return -1; } ssl->state = (domain->mode == PN_SSL_MODE_CLIENT) ? CLIENT_HELLO : NEGOTIATING; ssl->verify_mode = domain->verify_mode; return 0; } int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain) { if (!domain) return -1; if (domain->mode != PN_SSL_MODE_SERVER) { ssl_log_error("Cannot permit unsecured clients - not a server.\n"); return -1; } domain->allow_unsecured = true; return 0; } // TODO: This is just an untested guess int pn_ssl_get_ssf(pn_ssl_t *ssl0) { SecPkgContext_ConnectionInfo info; pni_ssl_t *ssl = get_ssl_internal(ssl0); if (ssl && ssl->state == RUNNING && SecIsValidHandle(&ssl->ctxt_handle) && QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) { return info.dwCipherStrength; } return 0; } bool pn_ssl_get_cipher_name(pn_ssl_t *ssl0, char *buffer, size_t size ) { pni_ssl_t *ssl = get_ssl_internal(ssl0); *buffer = '\0'; if (ssl->state != RUNNING || !SecIsValidHandle(&ssl->ctxt_handle)) return false; SecPkgContext_ConnectionInfo info; if (QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) { // TODO: come up with string for all permutations? pni_snprintf( buffer, size, "%x_%x:%x_%x:%x_%x", info.aiExch, info.dwExchStrength, info.aiCipher, info.dwCipherStrength, info.aiHash, info.dwHashStrength); return true; } return false; } bool pn_ssl_get_protocol_name(pn_ssl_t *ssl0, char *buffer, size_t size ) { pni_ssl_t *ssl = get_ssl_internal(ssl0); *buffer = '\0'; if (ssl->state != RUNNING || !SecIsValidHandle(&ssl->ctxt_handle)) return false; SecPkgContext_ConnectionInfo info; if (QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) { if (info.dwProtocol & (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER)) pni_snprintf(buffer, size, "%s", "TLSv1"); // TLSV1.1 and TLSV1.2 are supported as of XP-SP3, but not defined until VS2010 else if ((info.dwProtocol & 0x300)) pni_snprintf(buffer, size, "%s", "TLSv1.1"); else if ((info.dwProtocol & 0xC00)) pni_snprintf(buffer, size, "%s", "TLSv1.2"); else { ssl_log_error("unexpected protocol %x\n", info.dwProtocol); return false; } return true; } return false; } void pn_ssl_free( pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; if (!ssl) return; ssl_log( transport, "SSL socket freed.\n" ); // clean up Windows per TLS session data before releasing the domain count csguard g(&ssl->domain->cslock); csguard g2(&ssl->cred->cslock); if (SecIsValidHandle(&ssl->ctxt_handle)) DeleteSecurityContext(&ssl->ctxt_handle); if (ssl->cred) { if (ssl->domain->mode == PN_SSL_MODE_CLIENT && ssl->session_id == NULL) { // Responsible for unshared handle if (SecIsValidHandle(&ssl->cred_handle)) FreeCredentialsHandle(&ssl->cred_handle); } if (win_credential_decref(ssl->cred)) { g2.release(); win_credential_delete(ssl->cred); } } g2.release(); g.release(); pn_ssl_domain_free(ssl->domain); if (ssl->session_id) free((void *)ssl->session_id); if (ssl->peer_hostname) free((void *)ssl->peer_hostname); if (ssl->sc_inbuf) free((void *)ssl->sc_inbuf); if (ssl->sc_outbuf) free((void *)ssl->sc_outbuf); if (ssl->inbuf2) pn_buffer_free(ssl->inbuf2); if (ssl->subject) free(ssl->subject); free(ssl); } pn_ssl_t *pn_ssl(pn_transport_t *transport) { if (!transport) return NULL; if (transport->ssl) return (pn_ssl_t *)transport; pni_ssl_t *ssl = (pni_ssl_t *) calloc(1, sizeof(pni_ssl_t)); if (!ssl) return NULL; ssl->sc_out_size = ssl->sc_in_size = SSL_BUF_SIZE; ssl->sc_outbuf = (char *)malloc(ssl->sc_out_size); if (!ssl->sc_outbuf) { free(ssl); return NULL; } ssl->sc_inbuf = (char *)malloc(ssl->sc_in_size); if (!ssl->sc_inbuf) { free(ssl->sc_outbuf); free(ssl); return NULL; } ssl->inbuf2 = pn_buffer(0); if (!ssl->inbuf2) { free(ssl->sc_inbuf); free(ssl->sc_outbuf); free(ssl); return NULL; } transport->ssl = ssl; // Set up hostname from any bound connection if (transport->connection) { if (pn_string_size(transport->connection->hostname)) { pn_ssl_set_peer_hostname((pn_ssl_t *) transport, pn_string_get(transport->connection->hostname)); } } SecInvalidateHandle(&ssl->cred_handle); SecInvalidateHandle(&ssl->ctxt_handle); ssl->state = CREATED; ssl->decrypting = true; return (pn_ssl_t *)transport; } pn_ssl_resume_status_t pn_ssl_resume_status( pn_ssl_t *ssl ) { // TODO return PN_SSL_RESUME_UNKNOWN; } int pn_ssl_set_peer_hostname( pn_ssl_t *ssl0, const char *hostname ) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl) return -1; if (ssl->peer_hostname) free((void *)ssl->peer_hostname); ssl->peer_hostname = NULL; if (hostname) { ssl->peer_hostname = pn_strdup(hostname); if (!ssl->peer_hostname) return -2; } return 0; } int pn_ssl_get_peer_hostname( pn_ssl_t *ssl0, char *hostname, size_t *bufsize ) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl) return -1; if (!ssl->peer_hostname) { *bufsize = 0; if (hostname) *hostname = '\0'; return 0; } unsigned len = strlen(ssl->peer_hostname); if (hostname) { if (len >= *bufsize) return -1; strcpy( hostname, ssl->peer_hostname ); } *bufsize = len; return 0; } const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl0) { // RFC 2253 compliant, but differs from openssl's subject string with space separators and // ordering of multicomponent RDNs. Made to work as similarly as possible with choice of flags. pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl || !SecIsValidHandle(&ssl->ctxt_handle)) return NULL; if (!ssl->subject) { SECURITY_STATUS status; PCCERT_CONTEXT peer_cc = 0; status = QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &peer_cc); if (status != SEC_E_OK) { ssl_log_error_status(status, "can't obtain remote certificate subject"); return NULL; } DWORD flags = CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG; DWORD strlen = CertNameToStr(peer_cc->dwCertEncodingType, &peer_cc->pCertInfo->Subject, flags, NULL, 0); if (strlen > 0) { ssl->subject = (char*) malloc(strlen); if (ssl->subject) { DWORD len = CertNameToStr(peer_cc->dwCertEncodingType, &peer_cc->pCertInfo->Subject, flags, ssl->subject, strlen); if (len != strlen) { free(ssl->subject); ssl->subject = NULL; ssl_log_error("pn_ssl_get_remote_subject failure in CertNameToStr"); } } } CertFreeCertificateContext(peer_cc); } return ssl->subject; } /** SChannel specific: */ const char *tls_version_check(pni_ssl_t *ssl) { SecPkgContext_ConnectionInfo info; QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info); // Ascending bit patterns denote newer SSL/TLS protocol versions. // SP_PROT_TLS1_0_SERVER is not defined until VS2010. return (info.dwProtocol < SP_PROT_TLS1_SERVER) ? "peer does not support TLS 1.0 security" : NULL; } static void ssl_encrypt(pn_transport_t *transport, char *app_data, size_t count) { pni_ssl_t *ssl = transport->ssl; // Get SChannel to encrypt exactly one Record. SecBuffer buffs[4]; buffs[0].cbBuffer = ssl->sc_sizes.cbHeader; buffs[0].BufferType = SECBUFFER_STREAM_HEADER; buffs[0].pvBuffer = ssl->sc_outbuf; buffs[1].cbBuffer = count; buffs[1].BufferType = SECBUFFER_DATA; buffs[1].pvBuffer = app_data; buffs[2].cbBuffer = ssl->sc_sizes.cbTrailer; buffs[2].BufferType = SECBUFFER_STREAM_TRAILER; buffs[2].pvBuffer = &app_data[count]; buffs[3].cbBuffer = 0; buffs[3].BufferType = SECBUFFER_EMPTY; buffs[3].pvBuffer = 0; SecBufferDesc buff_desc; buff_desc.ulVersion = SECBUFFER_VERSION; buff_desc.cBuffers = 4; buff_desc.pBuffers = buffs; SECURITY_STATUS status = EncryptMessage(&ssl->ctxt_handle, 0, &buff_desc, 0); assert(status == SEC_E_OK); // EncryptMessage encrypts the data in place. The header and trailer // areas were reserved previously and must now be included in the updated // count of bytes to write to the peer. ssl->sc_out_count = buffs[0].cbBuffer + buffs[1].cbBuffer + buffs[2].cbBuffer; ssl->network_outp = ssl->sc_outbuf; ssl->network_out_pending = ssl->sc_out_count; ssl_log(transport, "ssl_encrypt %d network bytes\n", ssl->network_out_pending); } // Returns true if decryption succeeded (even for empty content) static bool ssl_decrypt(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; // Get SChannel to decrypt input. May have an incomplete Record, // exactly one, or more than one. Check also for session ending, // session renegotiation. SecBuffer recv_buffs[4]; recv_buffs[0].cbBuffer = ssl->sc_in_count; recv_buffs[0].BufferType = SECBUFFER_DATA; recv_buffs[0].pvBuffer = ssl->sc_inbuf; recv_buffs[1].BufferType = SECBUFFER_EMPTY; recv_buffs[2].BufferType = SECBUFFER_EMPTY; recv_buffs[3].BufferType = SECBUFFER_EMPTY; SecBufferDesc buff_desc; buff_desc.ulVersion = SECBUFFER_VERSION; buff_desc.cBuffers = 4; buff_desc.pBuffers = recv_buffs; SECURITY_STATUS status = DecryptMessage(&ssl->ctxt_handle, &buff_desc, 0, NULL); if (status == SEC_E_INCOMPLETE_MESSAGE) { // Less than a full Record, come back later with more network data ssl->sc_in_incomplete = true; return false; } ssl->decrypting = false; if (status != SEC_E_OK) { rewind_sc_inbuf(ssl); switch (status) { case SEC_I_CONTEXT_EXPIRED: // TLS shutdown alert record. Ignore all subsequent input. ssl->state = SHUTTING_DOWN; ssl->sc_input_shutdown = true; return false; case SEC_I_RENEGOTIATE: ssl_log_error("unexpected TLS renegotiation\n"); // TODO. Fall through for now. default: ssl_failed(transport, 0); return false; } } ssl->decrypting = false; // have a decrypted Record and possible (still-encrypted) data of // one (or more) later Recordss. Adjust pointers accordingly. for (int i = 0; i < 4; i++) { switch (recv_buffs[i].BufferType) { case SECBUFFER_DATA: ssl->in_data = (char *) recv_buffs[i].pvBuffer; ssl->in_data_size = ssl->in_data_count = recv_buffs[i].cbBuffer; break; case SECBUFFER_EXTRA: ssl->inbuf_extra = (char *)recv_buffs[i].pvBuffer; ssl->extra_count = recv_buffs[i].cbBuffer; break; default: // SECBUFFER_STREAM_HEADER: // SECBUFFER_STREAM_TRAILER: break; } } return true; } static void client_handshake_init(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; // Tell SChannel to create the first handshake token (ClientHello) // and place it in sc_outbuf SEC_CHAR *host = (SEC_CHAR *)(ssl->peer_hostname); ULONG ctxt_requested = ISC_REQ_STREAM | ISC_REQ_USE_SUPPLIED_CREDS | ISC_REQ_EXTENDED_ERROR; ULONG ctxt_attrs; SecBuffer send_buffs[2]; send_buffs[0].cbBuffer = ssl->sc_out_size; send_buffs[0].BufferType = SECBUFFER_TOKEN; send_buffs[0].pvBuffer = ssl->sc_outbuf; send_buffs[1].cbBuffer = 0; send_buffs[1].BufferType = SECBUFFER_EMPTY; send_buffs[1].pvBuffer = 0; SecBufferDesc send_buff_desc; send_buff_desc.ulVersion = SECBUFFER_VERSION; send_buff_desc.cBuffers = 2; send_buff_desc.pBuffers = send_buffs; csguard g(&ssl->cred->cslock); SECURITY_STATUS status = InitializeSecurityContext(&ssl->cred_handle, NULL, host, ctxt_requested, 0, 0, NULL, 0, &ssl->ctxt_handle, &send_buff_desc, &ctxt_attrs, NULL); if (status == SEC_I_CONTINUE_NEEDED) { ssl->sc_out_count = send_buffs[0].cbBuffer; ssl->network_out_pending = ssl->sc_out_count; // the token is the whole quantity to send ssl->network_outp = ssl->sc_outbuf; ssl_log(transport, "Sending client hello %d bytes\n", ssl->network_out_pending); } else { ssl_log_error_status(status, "InitializeSecurityContext failed"); ssl_failed(transport, 0); } } static void client_handshake( pn_transport_t* transport) { pni_ssl_t *ssl = transport->ssl; // Feed SChannel ongoing responses from the server until the handshake is complete. SEC_CHAR *host = (SEC_CHAR *)(ssl->peer_hostname); ULONG ctxt_requested = ISC_REQ_STREAM | ISC_REQ_USE_SUPPLIED_CREDS; ULONG ctxt_attrs; size_t max = 0; // token_buffs describe the buffer that's coming in. It should have // a token from the SSL server, or empty if sending final shutdown alert. bool shutdown = ssl->state == SHUTTING_DOWN; SecBuffer token_buffs[2]; token_buffs[0].cbBuffer = shutdown ? 0 : ssl->sc_in_count; token_buffs[0].BufferType = SECBUFFER_TOKEN; token_buffs[0].pvBuffer = shutdown ? 0 : ssl->sc_inbuf; token_buffs[1].cbBuffer = 0; token_buffs[1].BufferType = SECBUFFER_EMPTY; token_buffs[1].pvBuffer = 0; SecBufferDesc token_buff_desc; token_buff_desc.ulVersion = SECBUFFER_VERSION; token_buff_desc.cBuffers = 2; token_buff_desc.pBuffers = token_buffs; // send_buffs will hold information to forward to the peer. SecBuffer send_buffs[2]; send_buffs[0].cbBuffer = ssl->sc_out_size; send_buffs[0].BufferType = SECBUFFER_TOKEN; send_buffs[0].pvBuffer = ssl->sc_outbuf; send_buffs[1].cbBuffer = 0; send_buffs[1].BufferType = SECBUFFER_EMPTY; send_buffs[1].pvBuffer = 0; SecBufferDesc send_buff_desc; send_buff_desc.ulVersion = SECBUFFER_VERSION; send_buff_desc.cBuffers = 2; send_buff_desc.pBuffers = send_buffs; SECURITY_STATUS status; { csguard g(&ssl->cred->cslock); status = InitializeSecurityContext(&ssl->cred_handle, &ssl->ctxt_handle, host, ctxt_requested, 0, 0, &token_buff_desc, 0, NULL, &send_buff_desc, &ctxt_attrs, NULL); } switch (status) { case SEC_E_INCOMPLETE_MESSAGE: // Not enough - get more data from the server then try again. // Leave input buffers untouched. ssl_log(transport, "client handshake: incomplete record\n"); ssl->sc_in_incomplete = true; return; case SEC_I_CONTINUE_NEEDED: // Successful handshake step, requiring data to be sent to peer. ssl->sc_out_count = send_buffs[0].cbBuffer; // the token is the whole quantity to send ssl->network_out_pending = ssl->sc_out_count; ssl->network_outp = ssl->sc_outbuf; ssl_log(transport, "client handshake token %d bytes\n", ssl->network_out_pending); break; case SEC_E_OK: // Handshake complete. if (shutdown) { if (send_buffs[0].cbBuffer > 0) { ssl->sc_out_count = send_buffs[0].cbBuffer; // the token is the whole quantity to send ssl->network_out_pending = ssl->sc_out_count; ssl->network_outp = ssl->sc_outbuf; ssl_log(transport, "client shutdown token %d bytes\n", ssl->network_out_pending); } else { ssl->state = SSL_CLOSED; } // we didn't touch sc_inbuf, no need to reset return; } if (send_buffs[0].cbBuffer != 0) { ssl_failed(transport, "unexpected final server token"); break; } if (const char *err = tls_version_check(ssl)) { ssl_failed(transport, err); break; } if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME) { bool tracing = PN_TRACE_DRV & transport->trace; HRESULT ec = verify_peer(ssl, ssl->cred->trust_store, ssl->peer_hostname, tracing); if (ec) { if (ssl->peer_hostname) ssl_log_error_status(ec, "certificate verification failed for host %s\n", ssl->peer_hostname); else ssl_log_error_status(ec, "certificate verification failed\n"); ssl_failed(transport, "TLS certificate verification error"); break; } } if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0) { // This seems to work but not documented, plus logic differs from decrypt message // since the pvBuffer value is not set. Grrr. ssl->extra_count = token_buffs[1].cbBuffer; ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count); } QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_STREAM_SIZES, &ssl->sc_sizes); max = ssl->sc_sizes.cbMaximumMessage + ssl->sc_sizes.cbHeader + ssl->sc_sizes.cbTrailer; if (max > ssl->sc_out_size) { ssl_log_error("Buffer size mismatch have %d, need %d\n", (int) ssl->sc_out_size, (int) max); ssl->state = SHUTTING_DOWN; ssl->app_input_closed = ssl->app_output_closed = PN_ERR; start_ssl_shutdown(transport); pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: buffer size"); break; } ssl->state = RUNNING; ssl->max_data_size = max - ssl->sc_sizes.cbHeader - ssl->sc_sizes.cbTrailer; ssl_log(transport, "client handshake successful %d max record size\n", max); break; case SEC_I_CONTEXT_EXPIRED: // ended before we got going default: ssl_log(transport, "client handshake failed %d\n", (int) status); ssl_failed(transport, 0); break; } if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0 && !ssl->ssl_closed) { // remaining data after the consumed TLS record(s) ssl->extra_count = token_buffs[1].cbBuffer; ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count); } ssl->decrypting = false; rewind_sc_inbuf(ssl); } static void server_handshake(pn_transport_t* transport) { pni_ssl_t *ssl = transport->ssl; if (!ssl->protocol_detected) { // SChannel fails less aggressively than openssl on client hello, causing hangs // waiting for more bytes. Help out here. pni_protocol_type_t type = pni_sniff_header(ssl->sc_inbuf, ssl->sc_in_count); if (type == PNI_PROTOCOL_INSUFFICIENT) { ssl_log(transport, "server handshake: incomplete record\n"); ssl->sc_in_incomplete = true; return; } else { ssl->protocol_detected = true; if (type != PNI_PROTOCOL_SSL) { ssl_failed(transport, "bad client hello"); ssl->decrypting = false; rewind_sc_inbuf(ssl); return; } } } // Feed SChannel ongoing handshake records from the client until the handshake is complete. ULONG ctxt_requested = ASC_REQ_STREAM | ASC_REQ_EXTENDED_ERROR; if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME) ctxt_requested |= ASC_REQ_MUTUAL_AUTH; ULONG ctxt_attrs; size_t max = 0; // token_buffs describe the buffer that's coming in. It should have // a token from the SSL client except if shutting down or renegotiating. bool shutdown = ssl->state == SHUTTING_DOWN; SecBuffer token_buffs[2]; token_buffs[0].cbBuffer = shutdown ? 0 : ssl->sc_in_count; token_buffs[0].BufferType = SECBUFFER_TOKEN; token_buffs[0].pvBuffer = shutdown ? 0 : ssl->sc_inbuf; token_buffs[1].cbBuffer = 0; token_buffs[1].BufferType = SECBUFFER_EMPTY; token_buffs[1].pvBuffer = 0; SecBufferDesc token_buff_desc; token_buff_desc.ulVersion = SECBUFFER_VERSION; token_buff_desc.cBuffers = 2; token_buff_desc.pBuffers = token_buffs; // send_buffs will hold information to forward to the peer. SecBuffer send_buffs[2]; send_buffs[0].cbBuffer = ssl->sc_out_size; send_buffs[0].BufferType = SECBUFFER_TOKEN; send_buffs[0].pvBuffer = ssl->sc_outbuf; send_buffs[1].cbBuffer = 0; send_buffs[1].BufferType = SECBUFFER_EMPTY; send_buffs[1].pvBuffer = 0; SecBufferDesc send_buff_desc; send_buff_desc.ulVersion = SECBUFFER_VERSION; send_buff_desc.cBuffers = 2; send_buff_desc.pBuffers = send_buffs; PCtxtHandle ctxt_handle_ptr = (SecIsValidHandle(&ssl->ctxt_handle)) ? &ssl->ctxt_handle : 0; SECURITY_STATUS status; { csguard g(&ssl->cred->cslock); status = AcceptSecurityContext(&ssl->cred_handle, ctxt_handle_ptr, &token_buff_desc, ctxt_requested, 0, &ssl->ctxt_handle, &send_buff_desc, &ctxt_attrs, NULL); } bool outbound_token = false; switch(status) { case SEC_E_INCOMPLETE_MESSAGE: // Not enough - get more data from the client then try again. // Leave input buffers untouched. ssl_log(transport, "server handshake: incomplete record\n"); ssl->sc_in_incomplete = true; return; case SEC_I_CONTINUE_NEEDED: outbound_token = true; break; case SEC_E_OK: // Handshake complete. if (shutdown) { if (send_buffs[0].cbBuffer > 0) { ssl->sc_out_count = send_buffs[0].cbBuffer; // the token is the whole quantity to send ssl->network_out_pending = ssl->sc_out_count; ssl->network_outp = ssl->sc_outbuf; ssl_log(transport, "server shutdown token %d bytes\n", ssl->network_out_pending); } else { ssl->state = SSL_CLOSED; } // we didn't touch sc_inbuf, no need to reset return; } if (const char *err = tls_version_check(ssl)) { ssl_failed(transport, err); break; } // Handshake complete. if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME) { bool tracing = PN_TRACE_DRV & transport->trace; HRESULT ec = verify_peer(ssl, ssl->cred->trust_store, NULL, tracing); if (ec) { ssl_log_error_status(ec, "certificate verification failed\n"); ssl_failed(transport, "certificate verification error"); break; } } QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_STREAM_SIZES, &ssl->sc_sizes); max = ssl->sc_sizes.cbMaximumMessage + ssl->sc_sizes.cbHeader + ssl->sc_sizes.cbTrailer; if (max > ssl->sc_out_size) { ssl_log_error("Buffer size mismatch have %d, need %d\n", (int) ssl->sc_out_size, (int) max); ssl->state = SHUTTING_DOWN; ssl->app_input_closed = ssl->app_output_closed = PN_ERR; start_ssl_shutdown(transport); pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: buffer size"); break; } if (send_buffs[0].cbBuffer != 0) outbound_token = true; ssl->state = RUNNING; ssl->max_data_size = max - ssl->sc_sizes.cbHeader - ssl->sc_sizes.cbTrailer; ssl_log(transport, "server handshake successful %d max record size\n", max); break; case SEC_I_CONTEXT_EXPIRED: // ended before we got going default: ssl_log(transport, "server handshake failed %d\n", (int) status); ssl_failed(transport, 0); break; } if (outbound_token) { // Successful handshake step, requiring data to be sent to peer. assert(ssl->network_out_pending == 0); ssl->sc_out_count = send_buffs[0].cbBuffer; // the token is the whole quantity to send ssl->network_out_pending = ssl->sc_out_count; ssl->network_outp = ssl->sc_outbuf; ssl_log(transport, "server handshake token %d bytes\n", ssl->network_out_pending); } if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0 && !ssl->ssl_closed) { // remaining data after the consumed TLS record(s) ssl->extra_count = token_buffs[1].cbBuffer; ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count); } ssl->decrypting = false; rewind_sc_inbuf(ssl); } static void ssl_handshake(pn_transport_t* transport) { if (transport->ssl->domain->mode == PN_SSL_MODE_CLIENT) client_handshake(transport); else { server_handshake(transport); } } static bool grow_inbuf2(pn_transport_t *transport, size_t minimum_size) { pni_ssl_t *ssl = transport->ssl; size_t old_capacity = pn_buffer_capacity(ssl->inbuf2); size_t new_capacity = old_capacity ? old_capacity * 2 : 1024; while (new_capacity < minimum_size) new_capacity *= 2; uint32_t max_frame = pn_transport_get_max_frame(transport); if (max_frame != 0) { if (old_capacity >= max_frame) { // already big enough ssl_log(transport, "Application expecting %d bytes (> negotiated maximum frame)\n", new_capacity); ssl_failed(transport, "TLS: transport maximum frame size error"); return false; } } size_t extra_bytes = new_capacity - pn_buffer_size(ssl->inbuf2); int err = pn_buffer_ensure(ssl->inbuf2, extra_bytes); if (err) { ssl_log(transport, "TLS memory allocation failed for %d bytes\n", max_frame); ssl_failed(transport, "TLS memory allocation failed"); return false; } return true; } // Peer initiated a session end by sending us a shutdown alert (and we should politely // reciprocate), or else we are initiating the session end (and will not bother to wait // for the peer shutdown alert). Stop processing input immediately, and stop processing // output once this is sent. static void start_ssl_shutdown(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; assert(ssl->network_out_pending == 0); if (ssl->queued_shutdown) return; ssl->queued_shutdown = true; ssl_log(transport, "Shutting down SSL connection...\n"); DWORD shutdown = SCHANNEL_SHUTDOWN; SecBuffer shutBuff; shutBuff.cbBuffer = sizeof(DWORD); shutBuff.BufferType = SECBUFFER_TOKEN; shutBuff.pvBuffer = &shutdown; SecBufferDesc desc; desc.ulVersion = SECBUFFER_VERSION; desc.cBuffers = 1; desc.pBuffers = &shutBuff; ApplyControlToken(&ssl->ctxt_handle, &desc); // Next handshake will generate the shutdown alert token ssl_handshake(transport); } static void rewind_sc_inbuf(pni_ssl_t *ssl) { // Decrypted bytes have been drained or double buffered. Prepare for the next SSL Record. assert(ssl->in_data_count == 0); if (ssl->decrypting) return; ssl->decrypting = true; if (ssl->inbuf_extra) { // A previous read picked up more than one Record. Move it to the beginning. memmove(ssl->sc_inbuf, ssl->inbuf_extra, ssl->extra_count); ssl->sc_in_count = ssl->extra_count; ssl->inbuf_extra = 0; ssl->extra_count = 0; } else { ssl->sc_in_count = 0; } } static void app_inbytes_add(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; if (!ssl->app_inbytes.start) { ssl->app_inbytes.start = ssl->in_data; ssl->app_inbytes.size = ssl->in_data_count; return; } if (ssl->double_buffered) { if (pn_buffer_available(ssl->inbuf2) == 0) { if (!grow_inbuf2(transport, 1024)) // could not add room return; } size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2)); pn_buffer_append(ssl->inbuf2, ssl->in_data, count); ssl->in_data += count; ssl->in_data_count -= count; ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2); } else { assert(ssl->app_inbytes.size == 0); ssl->app_inbytes.start = ssl->in_data; ssl->app_inbytes.size = ssl->in_data_count; } } static void app_inbytes_progress(pn_transport_t *transport, size_t minimum) { pni_ssl_t *ssl = transport->ssl; // Make more decrypted data available, if possible. Otherwise, move // unread bytes to front of inbuf2 to make room for next bulk decryption. // SSL may have chopped up data that app layer expects to be // contiguous. Start, continue or stop double buffering here. if (ssl->double_buffered) { if (ssl->app_inbytes.size == 0) { // no straggler bytes, optimistically stop for now ssl->double_buffered = false; pn_buffer_clear(ssl->inbuf2); ssl->app_inbytes.start = ssl->in_data; ssl->app_inbytes.size = ssl->in_data_count; } else { pn_bytes_t ib2 = pn_buffer_bytes(ssl->inbuf2); assert(ssl->app_inbytes.size <= ib2.size); size_t consumed = ib2.size - ssl->app_inbytes.size; if (consumed > 0) { memmove((void *)ib2.start, ib2.start + consumed, ssl->app_inbytes.size); pn_buffer_trim(ssl->inbuf2, 0, consumed); } if (!pn_buffer_available(ssl->inbuf2)) { if (!grow_inbuf2(transport, minimum)) // could not add room return; } size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2)); pn_buffer_append(ssl->inbuf2, ssl->in_data, count); ssl->in_data += count; ssl->in_data_count -= count; ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2); } } else { if (ssl->app_inbytes.size) { // start double buffering the left over bytes ssl->double_buffered = true; pn_buffer_clear(ssl->inbuf2); if (!pn_buffer_available(ssl->inbuf2)) { if (!grow_inbuf2(transport, minimum)) // could not add room return; } size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2)); pn_buffer_append(ssl->inbuf2, ssl->in_data, count); ssl->in_data += count; ssl->in_data_count -= count; ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2); } else { // already pointing at all available bytes until next decrypt } } if (ssl->in_data_count == 0) rewind_sc_inbuf(ssl); } static void app_inbytes_advance(pn_transport_t *transport, size_t consumed) { pni_ssl_t *ssl = transport->ssl; if (consumed == 0) { // more contiguous bytes required app_inbytes_progress(transport, ssl->app_inbytes.size + 1); return; } assert(consumed <= ssl->app_inbytes.size); ssl->app_inbytes.start += consumed; ssl->app_inbytes.size -= consumed; if (!ssl->double_buffered) { ssl->in_data += consumed; ssl->in_data_count -= consumed; } if (ssl->app_inbytes.size == 0) app_inbytes_progress(transport, 0); } static void read_closed(pn_transport_t *transport, unsigned int layer, ssize_t error) { pni_ssl_t *ssl = transport->ssl; if (ssl->app_input_closed) return; if (ssl->state == RUNNING && !error) { // Signal end of stream ssl->app_input_closed = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->app_inbytes.start, 0); } if (!ssl->app_input_closed) ssl->app_input_closed = error ? error : PN_ERR; if (ssl->app_output_closed) { // both sides of app closed, and no more app output pending: ssl->state = SHUTTING_DOWN; if (ssl->network_out_pending == 0 && !ssl->queued_shutdown) { start_ssl_shutdown(transport); } } } // Read up to "available" bytes from the network, decrypt it and pass plaintext to application. static ssize_t process_input_ssl(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t available) { pni_ssl_t *ssl = transport->ssl; ssl_log( transport, "process_input_ssl( data size=%d )\n",available ); ssize_t consumed = 0; ssize_t forwarded = 0; bool new_app_input; if (available == 0) { // No more inbound network data read_closed(transport, layer, 0); return 0; } do { if (ssl->sc_input_shutdown) { // TLS protocol shutdown detected on input, so we are done. read_closed(transport, layer, 0); return PN_EOS; } // sc_inbuf should be ready for new or additional network encrypted bytes. // i.e. no straggling decrypted bytes pending. assert(ssl->in_data_count == 0 && ssl->decrypting); new_app_input = false; size_t count; if (ssl->state != RUNNING) { count = _pni_min(ssl->sc_in_size - ssl->sc_in_count, available); } else { // look for TLS record boundaries if (ssl->sc_in_count < 5) { ssl->sc_in_incomplete = true; size_t hc = _pni_min(available, 5 - ssl->sc_in_count); memmove(ssl->sc_inbuf + ssl->sc_in_count, input_data, hc); ssl->sc_in_count += hc; input_data += hc; available -= hc; consumed += hc; if (ssl->sc_in_count < 5 || available == 0) break; } // Top up sc_inbuf from network input_data hoping for a complete TLS Record // We try to guess the length as an optimization, but let SChannel // ultimately decide if there is spoofing going on. unsigned char low = (unsigned char) ssl->sc_inbuf[4]; unsigned char high = (unsigned char) ssl->sc_inbuf[3]; size_t rec_len = high * 256 + low + 5; if (rec_len < 5 || rec_len == ssl->sc_in_count || rec_len > ssl->sc_in_size) rec_len = ssl->sc_in_size; count = _pni_min(rec_len - ssl->sc_in_count, available); } if (count > 0) { memmove(ssl->sc_inbuf + ssl->sc_in_count, input_data, count); ssl->sc_in_count += count; input_data += count; available -= count; consumed += count; ssl->sc_in_incomplete = false; } // Try to decrypt another TLS Record. if (ssl->sc_in_count > 0 && ssl->state <= SHUTTING_DOWN) { if (ssl->state == NEGOTIATING) { ssl_handshake(transport); } else { if (ssl_decrypt(transport)) { // Ignore TLS Record with 0 length data (does not mean EOS) if (ssl->in_data_size > 0) { new_app_input = true; app_inbytes_add(transport); } else { assert(ssl->decrypting == false); rewind_sc_inbuf(ssl); } } ssl_log(transport, "Next decryption, %d left over\n", available); } } if (ssl->state == SHUTTING_DOWN) { if (ssl->network_out_pending == 0 && !ssl->queued_shutdown) { start_ssl_shutdown(transport); } } else if (ssl->state == SSL_CLOSED) { return PN_EOS; } // Consume or discard the decrypted bytes if (new_app_input && (ssl->state == RUNNING || ssl->state == SHUTTING_DOWN)) { // present app_inbytes to io_next only if it has new content while (ssl->app_inbytes.size > 0) { if (!ssl->app_input_closed) { ssize_t count = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->app_inbytes.start, ssl->app_inbytes.size); if (count > 0) { forwarded += count; // advance() can increase app_inbytes.size if double buffered app_inbytes_advance(transport, count); ssl_log(transport, "Application consumed %d bytes from peer\n", (int) count); } else if (count == 0) { size_t old_size = ssl->app_inbytes.size; app_inbytes_advance(transport, 0); if (ssl->app_inbytes.size == old_size) { break; // no additional contiguous decrypted data available, get more network data } } else { // count < 0 ssl_log(transport, "Application layer closed its input, error=%d (discarding %d bytes)\n", (int) count, (int)ssl->app_inbytes.size); app_inbytes_advance(transport, ssl->app_inbytes.size); // discard read_closed(transport, layer, count); } } else { ssl_log(transport, "Input closed discard %d bytes\n", (int)ssl->app_inbytes.size); app_inbytes_advance(transport, ssl->app_inbytes.size); // discard } } } } while (available || (ssl->sc_in_count && !ssl->sc_in_incomplete)); if (ssl->state >= SHUTTING_DOWN) { if (ssl->app_input_closed || ssl->sc_input_shutdown) { // Next layer doesn't want more bytes, or it can't process without more data than it has seen so far // but the ssl stream has ended consumed = ssl->app_input_closed ? ssl->app_input_closed : PN_EOS; if (transport->io_layers[layer]==&ssl_output_closed_layer) { transport->io_layers[layer] = &ssl_closed_layer; } else { transport->io_layers[layer] = &ssl_input_closed_layer; } } } ssl_log(transport, "process_input_ssl() returning %d, forwarded %d\n", (int) consumed, (int) forwarded); return consumed; } static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_len) { pni_ssl_t *ssl = transport->ssl; if (!ssl) return PN_EOS; ssl_log( transport, "process_output_ssl( max_len=%d )\n",max_len ); ssize_t written = 0; ssize_t total_app_bytes = 0; bool work_pending; if (ssl->state == CLIENT_HELLO) { // output buffers eclusively for internal handshake use until negotiation complete client_handshake_init(transport); if (ssl->state == SSL_CLOSED) return PN_EOS; ssl->state = NEGOTIATING; } do { work_pending = false; if (ssl->network_out_pending > 0) { size_t wcount = _pni_min(ssl->network_out_pending, max_len); memmove(buffer, ssl->network_outp, wcount); ssl->network_outp += wcount; ssl->network_out_pending -= wcount; buffer += wcount; max_len -= wcount; written += wcount; } if (ssl->network_out_pending == 0 && ssl->state == RUNNING && !ssl->app_output_closed) { // refill the buffer with app data and encrypt it char *app_data = ssl->sc_outbuf + ssl->sc_sizes.cbHeader; char *app_outp = app_data; size_t remaining = ssl->max_data_size; ssize_t app_bytes; do { app_bytes = transport->io_layers[layer+1]->process_output(transport, layer+1, app_outp, remaining); if (app_bytes > 0) { app_outp += app_bytes; remaining -= app_bytes; ssl_log( transport, "Gathered %d bytes from app to send to peer\n", app_bytes ); } else { if (app_bytes < 0) { ssl_log(transport, "Application layer closed its output, error=%d (%d bytes pending send)\n", (int) app_bytes, (int) ssl->network_out_pending); ssl->app_output_closed = app_bytes; if (ssl->app_input_closed) ssl->state = SHUTTING_DOWN; } else if (total_app_bytes == 0 && ssl->app_input_closed) { // We've drained all the App layer can provide ssl_log(transport, "Application layer blocked on input, closing\n"); ssl->state = SHUTTING_DOWN; ssl->app_output_closed = PN_ERR; } } } while (app_bytes > 0); if (app_outp > app_data) { work_pending = (max_len > 0); ssl_encrypt(transport, app_data, app_outp - app_data); } } if (ssl->network_out_pending == 0) { if (ssl->state == SHUTTING_DOWN) { if (!ssl->queued_shutdown) { start_ssl_shutdown(transport); work_pending = true; } else { ssl->state = SSL_CLOSED; } } else if (ssl->state == NEGOTIATING && ssl->app_input_closed) { ssl->app_output_closed = PN_EOS; ssl->state = SSL_CLOSED; } } } while (work_pending); if (written == 0 && ssl->state == SSL_CLOSED) { written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS; if (transport->io_layers[layer]==&ssl_input_closed_layer) { transport->io_layers[layer] = &ssl_closed_layer; } else { transport->io_layers[layer] = &ssl_output_closed_layer; } } ssl_log(transport, "process_output_ssl() returning %d\n", (int) written); return written; } static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len) { return PN_EOS; } static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len) { return PN_EOS; } // return # output bytes sitting in this layer static size_t buffered_output(pn_transport_t *transport) { size_t count = 0; pni_ssl_t *ssl = transport->ssl; if (ssl) { count += ssl->network_out_pending; if (count == 0 && ssl->state == SHUTTING_DOWN && ssl->queued_shutdown) count++; } return count; } static HCERTSTORE open_cert_db(const char *store_name, const char *passwd, int *error) { *error = 0; DWORD sys_store_type = 0; HCERTSTORE cert_store = 0; if (store_name) { if (strncmp(store_name, "ss:", 3) == 0) { store_name += 3; sys_store_type = CERT_SYSTEM_STORE_CURRENT_USER; } else if (strncmp(store_name, "lmss:", 5) == 0) { store_name += 5; sys_store_type = CERT_SYSTEM_STORE_LOCAL_MACHINE; } } if (sys_store_type) { // Opening a system store, names are not case sensitive. // Map confusing GUI name to actual registry store name. if (!pn_strcasecmp(store_name, "personal")) store_name= "my"; cert_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, NULL, CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | sys_store_type, store_name); if (!cert_store) { ssl_log_error_status(GetLastError(), "Failed to open system certificate store %s", store_name); *error = -3; return NULL; } } else { // PKCS#12 file HANDLE cert_file = CreateFile(store_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (INVALID_HANDLE_VALUE == cert_file) { HRESULT status = GetLastError(); ssl_log_error_status(status, "Failed to open the file holding the private key: %s", store_name); *error = -4; return NULL; } DWORD nread = 0L; const DWORD file_size = GetFileSize(cert_file, NULL); char *buf = NULL; if (INVALID_FILE_SIZE != file_size) buf = (char *) malloc(file_size); if (!buf || !ReadFile(cert_file, buf, file_size, &nread, NULL) || file_size != nread) { HRESULT status = GetLastError(); CloseHandle(cert_file); free(buf); ssl_log_error_status(status, "Reading the private key from file failed %s", store_name); *error = -5; return NULL; } CloseHandle(cert_file); CRYPT_DATA_BLOB blob; blob.cbData = nread; blob.pbData = (BYTE *) buf; wchar_t *pwUCS2 = NULL; int pwlen = 0; if (passwd) { // convert passwd to null terminated wchar_t (Windows UCS2) pwlen = strlen(passwd); pwUCS2 = (wchar_t *) calloc(pwlen + 1, sizeof(wchar_t)); int nwc = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, passwd, pwlen, &pwUCS2[0], pwlen); if (!nwc) { ssl_log_error_status(GetLastError(), "Error converting password from UTF8"); free(buf); free(pwUCS2); *error = -6; return NULL; } } cert_store = PFXImportCertStore(&blob, pwUCS2, 0); if (pwUCS2) { SecureZeroMemory(pwUCS2, pwlen * sizeof(wchar_t)); free(pwUCS2); } if (cert_store == NULL) { ssl_log_error_status(GetLastError(), "Failed to import the file based certificate store"); free(buf); *error = -7; return NULL; } free(buf); } return cert_store; } static bool store_contains(HCERTSTORE store, PCCERT_CONTEXT cert) { DWORD find_type = CERT_FIND_EXISTING; // Require exact match PCCERT_CONTEXT tcert = CertFindCertificateInStore(store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, find_type, cert, 0); if (tcert) { CertFreeCertificateContext(tcert); return true; } return false; } /* Match the DNS name pattern from the peer certificate against our configured peer hostname */ static bool match_dns_pattern(const char *hostname, const char *pattern, int plen) { int slen = (int) strlen(hostname); if (memchr( pattern, '*', plen ) == NULL) return (plen == slen && pn_strncasecmp( pattern, hostname, plen ) == 0); /* dns wildcarded pattern - RFC2818 */ char plabel[64]; /* max label length < 63 - RFC1034 */ char slabel[64]; while (plen > 0 && slen > 0) { const char *cptr; int len; cptr = (const char *) memchr( pattern, '.', plen ); len = (cptr) ? cptr - pattern : plen; if (len > (int) sizeof(plabel) - 1) return false; memcpy( plabel, pattern, len ); plabel[len] = 0; if (cptr) ++len; // skip matching '.' pattern += len; plen -= len; cptr = (const char *) memchr( hostname, '.', slen ); len = (cptr) ? cptr - hostname : slen; if (len > (int) sizeof(slabel) - 1) return false; memcpy( slabel, hostname, len ); slabel[len] = 0; if (cptr) ++len; // skip matching '.' hostname += len; slen -= len; char *star = strchr( plabel, '*' ); if (!star) { if (pn_strcasecmp( plabel, slabel )) return false; } else { *star = '\0'; char *prefix = plabel; int prefix_len = strlen(prefix); char *suffix = star + 1; int suffix_len = strlen(suffix); if (prefix_len && pn_strncasecmp( prefix, slabel, prefix_len )) return false; if (suffix_len && pn_strncasecmp( suffix, slabel + (strlen(slabel) - suffix_len), suffix_len )) return false; } } return plen == slen; } // Caller must free the returned buffer static char* wide_to_utf8(LPWSTR wstring) { int len = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, 0, 0, 0, 0); if (!len) { ssl_log_error_status(GetLastError(), "converting UCS2 to UTF8"); return NULL; } char *p = (char *) malloc(len); if (!p) return NULL; if (WideCharToMultiByte(CP_UTF8, 0, wstring, -1, p, len, 0, 0)) return p; ssl_log_error_status(GetLastError(), "converting UCS2 to UTF8"); free (p); return NULL; } static bool server_name_matches(const char *server_name, CERT_EXTENSION *alt_name_ext, PCCERT_CONTEXT cert) { // As for openssl.c: alt names first, then CN bool matched = false; if (alt_name_ext) { CERT_ALT_NAME_INFO* alt_name_info = NULL; DWORD size = 0; if(!CryptDecodeObjectEx(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, szOID_SUBJECT_ALT_NAME2, alt_name_ext->Value.pbData, alt_name_ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, 0, &alt_name_info, &size)) { ssl_log_error_status(GetLastError(), "Alternative name match internal error"); return false; } int name_ct = alt_name_info->cAltEntry; for (int i = 0; !matched && i < name_ct; ++i) { if (alt_name_info->rgAltEntry[i].dwAltNameChoice == CERT_ALT_NAME_DNS_NAME) { char *alt_name = wide_to_utf8(alt_name_info->rgAltEntry[i].pwszDNSName); if (alt_name) { matched = match_dns_pattern(server_name, (const char *) alt_name, strlen(alt_name)); free(alt_name); } } } LocalFree(&alt_name_info); } if (!matched) { PCERT_INFO info = cert->pCertInfo; DWORD len = CertGetNameString(cert, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, 0, 0); char *name = (char *) malloc(len); if (name) { int count = CertGetNameString(cert, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, name, len); if (count) matched = match_dns_pattern(server_name, (const char *) name, strlen(name)); free(name); } } return matched; } const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field) { return NULL; } int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg) { *fingerprint = '\0'; return -1; } static HRESULT verify_peer(pni_ssl_t *ssl, HCERTSTORE root_store, const char *server_name, bool tracing) { // Free/release the following before return: PCCERT_CONTEXT peer_cc = 0; PCCERT_CONTEXT trust_anchor = 0; PCCERT_CHAIN_CONTEXT chain_context = 0; wchar_t *nameUCS2 = 0; if (server_name && strlen(server_name) > 255) { ssl_log_error("invalid server name: %s\n", server_name); return WSAENAMETOOLONG; } // Get peer's certificate. SECURITY_STATUS status; status = QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &peer_cc); if (status != SEC_E_OK) { ssl_log_error_status(status, "can't obtain remote peer certificate information"); return status; } // Build the peer's certificate chain. Multiple chains may be built but we // care about rgpChain[0], which is the best. Custom root stores are not // allowed until W8/server 2012: see CERT_CHAIN_ENGINE_CONFIG. For now, we // manually override to taste. // Chain verification functions give false reports for CRL if the trust anchor // is not in the official root store. We ignore CRL completely if it doesn't // apply to any untrusted certs in the chain, and defer to SChannel's veto // otherwise. To rely on CRL, the CA must be in both the official system // trusted root store and the Proton cred->trust_store. To defeat CRL, the // most distal cert with CRL must be placed in the Proton cred->trust_store. // Similarly, certificate usage checking is overly strict at times. CERT_CHAIN_PARA desc; memset(&desc, 0, sizeof(desc)); desc.cbSize = sizeof(desc); LPSTR usages[] = { szOID_PKIX_KP_SERVER_AUTH }; DWORD n_usages = sizeof(usages) / sizeof(LPSTR); desc.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR; desc.RequestedUsage.Usage.cUsageIdentifier = n_usages; desc.RequestedUsage.Usage.rgpszUsageIdentifier = usages; if(!CertGetCertificateChain(0, peer_cc, 0, peer_cc->hCertStore, &desc, CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT | CERT_CHAIN_CACHE_END_CERT, 0, &chain_context)){ HRESULT st = GetLastError(); ssl_log_error_status(st, "Basic certificate chain check failed"); CertFreeCertificateContext(peer_cc); return st; } if (chain_context->cChain < 1 || chain_context->rgpChain[0]->cElement < 1) { ssl_log_error("empty chain with status %x %x\n", chain_context->TrustStatus.dwErrorStatus, chain_context->TrustStatus.dwInfoStatus); return SEC_E_CERT_UNKNOWN; } int chain_len = chain_context->rgpChain[0]->cElement; PCCERT_CONTEXT leaf_cert = chain_context->rgpChain[0]->rgpElement[0]->pCertContext; PCCERT_CONTEXT trunk_cert = chain_context->rgpChain[0]->rgpElement[chain_len - 1]->pCertContext; if (tracing) // See doc for CERT_CHAIN_POLICY_STATUS for bit field error and info status values ssl_log_error("status for complete chain: error bits %x info bits %x\n", chain_context->TrustStatus.dwErrorStatus, chain_context->TrustStatus.dwInfoStatus); // Supplement with checks against Proton's trusted_ca_db, custom revocation and usage. HRESULT error = 0; do { // Do not return from this do loop. Set error = SEC_E_XXX and break. bool revocable = false; // unless we see any untrusted certs that could be for (int i = 0; i < chain_len; i++) { CERT_CHAIN_ELEMENT *ce = chain_context->rgpChain[0]->rgpElement[i]; PCCERT_CONTEXT cc = ce->pCertContext; if (cc->pCertInfo->dwVersion != CERT_V3) { if (tracing) ssl_log_error("certificate chain element %d is not version 3\n", i); error = SEC_E_CERT_WRONG_USAGE; // A fossil break; } if (!trust_anchor && store_contains(root_store, cc)) trust_anchor = CertDuplicateCertificateContext(cc); int n_ext = cc->pCertInfo->cExtension; for (int ii = 0; ii < n_ext && !revocable && !trust_anchor; ii++) { CERT_EXTENSION *p = &cc->pCertInfo->rgExtension[ii]; // rfc 5280 extensions for revocation if (!strcmp(p->pszObjId, szOID_AUTHORITY_INFO_ACCESS) || !strcmp(p->pszObjId, szOID_CRL_DIST_POINTS) || !strcmp(p->pszObjId, szOID_FRESHEST_CRL)) { revocable = true; } } if (tracing) { char name[512]; const char *is_anchor = (cc == trust_anchor) ? " trust anchor" : ""; if (!CertNameToStr(cc->dwCertEncodingType, &cc->pCertInfo->Subject, CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG, name, sizeof(name))) strcpy(name, "[too long]"); ssl_log_error("element %d (name: %s)%s error bits %x info bits %x\n", i, name, is_anchor, ce->TrustStatus.dwErrorStatus, ce->TrustStatus.dwInfoStatus); } } if (error) break; if (!trust_anchor) { // We don't trust any of the certs in the chain, see if the last cert // is issued by a Proton trusted CA. DWORD flags = CERT_STORE_NO_ISSUER_FLAG || CERT_STORE_SIGNATURE_FLAG || CERT_STORE_TIME_VALIDITY_FLAG; trust_anchor = CertGetIssuerCertificateFromStore(root_store, trunk_cert, 0, &flags); if (trust_anchor) { if (tracing) { if (flags & CERT_STORE_SIGNATURE_FLAG) ssl_log_error("root certificate signature failure\n"); if (flags & CERT_STORE_TIME_VALIDITY_FLAG) ssl_log_error("root certificate time validity failure\n"); } if (flags) { CertFreeCertificateContext(trust_anchor); trust_anchor = 0; } } } if (!trust_anchor) { error = SEC_E_UNTRUSTED_ROOT; break; } bool strict_usage = false; CERT_EXTENSION *leaf_alt_names = 0; if (leaf_cert != trust_anchor) { int n_ext = leaf_cert->pCertInfo->cExtension; for (int ii = 0; ii < n_ext; ii++) { CERT_EXTENSION *p = &leaf_cert->pCertInfo->rgExtension[ii]; if (!strcmp(p->pszObjId, szOID_ENHANCED_KEY_USAGE)) strict_usage = true; if (!strcmp(p->pszObjId, szOID_SUBJECT_ALT_NAME2)) if (p->Value.pbData) leaf_alt_names = p; } } if (server_name) { int len = strlen(server_name); nameUCS2 = (wchar_t *) calloc(len + 1, sizeof(wchar_t)); int nwc = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, server_name, len, &nameUCS2[0], len); if (!nwc) { error = GetLastError(); ssl_log_error_status(error, "Error converting server name from UTF8"); break; } } // SSL-specific parameters (ExtraPolicy below) SSL_EXTRA_CERT_CHAIN_POLICY_PARA ssl_desc; memset(&ssl_desc, 0, sizeof(ssl_desc)); ssl_desc.cbSize = sizeof(ssl_desc); ssl_desc.pwszServerName = nameUCS2; ssl_desc.dwAuthType = nameUCS2 ? AUTHTYPE_SERVER : AUTHTYPE_CLIENT; ssl_desc.fdwChecks = SECURITY_FLAG_IGNORE_UNKNOWN_CA; if (server_name) ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_CERT_CN_INVALID; if (!revocable) ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_REVOCATION; if (!strict_usage) ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_WRONG_USAGE; // General certificate chain parameters CERT_CHAIN_POLICY_PARA chain_desc; memset(&chain_desc, 0, sizeof(chain_desc)); chain_desc.cbSize = sizeof(chain_desc); chain_desc.dwFlags = CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG; if (!revocable) chain_desc.dwFlags |= CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS; if (!strict_usage) chain_desc.dwFlags |= CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG; chain_desc.pvExtraPolicyPara = &ssl_desc; CERT_CHAIN_POLICY_STATUS chain_status; memset(&chain_status, 0, sizeof(chain_status)); chain_status.cbSize = sizeof(chain_status); if (!CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, chain_context, &chain_desc, &chain_status)) { error = GetLastError(); // Failure to complete the check, does not (in)validate the cert. ssl_log_error_status(error, "Supplemental certificate chain check failed"); break; } if (chain_status.dwError) { error = chain_status.dwError; if (tracing) { ssl_log_error_status(chain_status.dwError, "Certificate chain verification error"); if (chain_status.lChainIndex == 0 && chain_status.lElementIndex != -1) { int idx = chain_status.lElementIndex; CERT_CHAIN_ELEMENT *ce = chain_context->rgpChain[0]->rgpElement[idx]; ssl_log_error(" chain failure at %d error/info: %x %x\n", idx, ce->TrustStatus.dwErrorStatus, ce->TrustStatus.dwInfoStatus); } } break; } if (server_name && ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME && !server_name_matches(server_name, leaf_alt_names, leaf_cert)) { error = SEC_E_WRONG_PRINCIPAL; break; } else if (ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME && !server_name) { ssl_log_error("Error: configuration error: PN_SSL_VERIFY_PEER_NAME configured, but no peer hostname set!"); error = SEC_E_WRONG_PRINCIPAL; break; } } while (0); if (tracing && !error) ssl_log_error("peer certificate authenticated\n"); // Lots to clean up. if (peer_cc) CertFreeCertificateContext(peer_cc); if (trust_anchor) CertFreeCertificateContext(trust_anchor); if (chain_context) CertFreeCertificateChain(chain_context); free(nameUCS2); return error; } qpid-proton-0.22.0/proton-c/src/ssl/openssl.c0000664000000000000000000014476513257152177015752 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "platform/platform.h" #include "core/util.h" #include "core/engine-internal.h" #include #include // openssl on windows expects the user to have already included // winsock.h #ifdef _MSC_VER #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #if _WIN32_WINNT < 0x0501 #error "Proton requires Windows API support for XP or later." #endif #include #include #include #endif #include #include #include #include #include #include #include #include /** @file * SSL/TLS support API. * * This file contains an OpenSSL-based implemention of the SSL/TLS API. */ typedef struct pn_ssl_session_t pn_ssl_session_t; static int ssl_ex_data_index; struct pn_ssl_domain_t { SSL_CTX *ctx; char *keyfile_pw; // settings used for all connections char *trusted_CAs; char *ciphers; int ref_count; #if OPENSSL_VERSION_NUMBER >= 0x10100000 int default_seclevel; #endif pn_ssl_mode_t mode; pn_ssl_verify_mode_t verify_mode; bool has_ca_db; // true when CA database configured bool has_certificate; // true when certificate configured bool allow_unsecured; }; struct pni_ssl_t { pn_ssl_domain_t *domain; const char *session_id; const char *peer_hostname; SSL *ssl; BIO *bio_ssl; // i/o from/to SSL socket layer BIO *bio_ssl_io; // SSL "half" of network-facing BIO BIO *bio_net_io; // socket-side "half" of network-facing BIO // buffers for holding I/O from "applications" above SSL #define APP_BUF_SIZE (4*1024) char *outbuf; char *inbuf; ssize_t app_input_closed; // error code returned by upper layer process input ssize_t app_output_closed; // error code returned by upper layer process output size_t out_size; size_t out_count; size_t in_size; size_t in_count; bool ssl_shutdown; // BIO_ssl_shutdown() called on socket. bool ssl_closed; // shutdown complete, or SSL error bool read_blocked; // SSL blocked until more network data is read bool write_blocked; // SSL blocked until data is written to network char *subject; X509 *peer_certificate; }; static inline pn_transport_t *get_transport_internal(pn_ssl_t *ssl) { // The external pn_sasl_t is really a pointer to the internal pni_transport_t return ((pn_transport_t *)ssl); } static inline pni_ssl_t *get_ssl_internal(pn_ssl_t *ssl) { // The external pn_sasl_t is really a pointer to the internal pni_transport_t return ssl ? ((pn_transport_t *)ssl)->ssl : NULL; } // define two sets of allowable ciphers: those that require authentication, and those // that do not require authentication (anonymous). See ciphers(1). #define CIPHERS_AUTHENTICATE "ALL:!aNULL:!eNULL:@STRENGTH" #define CIPHERS_ANONYMOUS "ALL:aNULL:!eNULL:@STRENGTH" /* */ static int keyfile_pw_cb(char *buf, int size, int rwflag, void *userdata); static void handle_error_ssl( pn_transport_t *transport, unsigned int layer); static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len); static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *input_data, size_t len); static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len); static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len); static int init_ssl_socket(pn_transport_t *, pni_ssl_t *); static void release_ssl_socket( pni_ssl_t * ); static size_t buffered_output( pn_transport_t *transport ); static X509 *get_peer_certificate(pni_ssl_t *ssl); static void ssl_vlog(pn_transport_t *transport, const char *fmt, va_list ap) { if (transport) { if (PN_TRACE_DRV & transport->trace) { pn_transport_vlogf(transport, fmt, ap); } } else { pn_transport_vlogf(transport, fmt, ap); } } static void ssl_log(pn_transport_t *transport, const char *fmt, ...) { va_list ap; va_start(ap, fmt); ssl_vlog(transport, fmt, ap); va_end(ap); } static void ssl_log_flush(pn_transport_t* transport) { char buf[128]; // see "man ERR_error_string_n()" unsigned long err = ERR_get_error(); while (err) { ERR_error_string_n(err, buf, sizeof(buf)); ssl_log(transport, "%s", buf); err = ERR_get_error(); } } // log an error and dump the SSL error stack static void ssl_log_error(const char *fmt, ...) { if (fmt) { va_list ap; va_start(ap, fmt); ssl_vlog(NULL, fmt, ap); va_end(ap); } ssl_log_flush(NULL); } static void ssl_log_clear_data(pn_transport_t *transport, const char *data, size_t len) { if (PN_TRACE_RAW & transport->trace) { fprintf(stderr, "SSL decrypted data: \""); pn_fprint_data( stderr, data, len ); fprintf(stderr, "\"\n"); } } // unrecoverable SSL failure occured, notify transport and generate error code. static int ssl_failed(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; SSL_set_shutdown(ssl->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); ssl->ssl_closed = true; ssl->app_input_closed = ssl->app_output_closed = PN_EOS; // fake a shutdown so the i/o processing code will close properly SSL_set_shutdown(ssl->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); // try to grab the first SSL error to add to the failure log char buf[256] = "Unknown error"; unsigned long ssl_err = ERR_get_error(); if (ssl_err) { ERR_error_string_n( ssl_err, buf, sizeof(buf) ); } ssl_log_flush(transport); // spit out any remaining errors to the log file pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: %s", buf); return PN_EOS; } /* match the DNS name pattern from the peer certificate against our configured peer hostname */ static bool match_dns_pattern( const char *hostname, const char *pattern, int plen ) { int slen = (int) strlen(hostname); if (memchr( pattern, '*', plen ) == NULL) return (plen == slen && pn_strncasecmp( pattern, hostname, plen ) == 0); /* dns wildcarded pattern - RFC2818 */ char plabel[64]; /* max label length < 63 - RFC1034 */ char slabel[64]; while (plen > 0 && slen > 0) { const char *cptr; int len; cptr = (const char *) memchr( pattern, '.', plen ); len = (cptr) ? cptr - pattern : plen; if (len > (int) sizeof(plabel) - 1) return false; memcpy( plabel, pattern, len ); plabel[len] = 0; if (cptr) ++len; // skip matching '.' pattern += len; plen -= len; cptr = (const char *) memchr( hostname, '.', slen ); len = (cptr) ? cptr - hostname : slen; if (len > (int) sizeof(slabel) - 1) return false; memcpy( slabel, hostname, len ); slabel[len] = 0; if (cptr) ++len; // skip matching '.' hostname += len; slen -= len; char *star = strchr( plabel, '*' ); if (!star) { if (pn_strcasecmp( plabel, slabel )) return false; } else { *star = '\0'; char *prefix = plabel; int prefix_len = strlen(prefix); char *suffix = star + 1; int suffix_len = strlen(suffix); if (prefix_len && pn_strncasecmp( prefix, slabel, prefix_len )) return false; if (suffix_len && pn_strncasecmp( suffix, slabel + (strlen(slabel) - suffix_len), suffix_len )) return false; } } return plen == slen; } // Certificate chain verification callback: return 1 if verified, // 0 if remote cannot be verified (fail handshake). // static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) { if (!preverify_ok || X509_STORE_CTX_get_error_depth(ctx) != 0) // already failed, or not at peer cert in chain return preverify_ok; X509 *cert = X509_STORE_CTX_get_current_cert(ctx); SSL *ssn = (SSL *) X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); if (!ssn) { pn_transport_logf(NULL, "Error: unexpected error - SSL session info not available for peer verify!"); return 0; // fail connection } pn_transport_t *transport = (pn_transport_t *)SSL_get_ex_data(ssn, ssl_ex_data_index); if (!transport) { pn_transport_logf(NULL, "Error: unexpected error - SSL context info not available for peer verify!"); return 0; // fail connection } pni_ssl_t *ssl = transport->ssl; if (ssl->domain->verify_mode != PN_SSL_VERIFY_PEER_NAME) return preverify_ok; if (!ssl->peer_hostname) { pn_transport_logf(transport, "Error: configuration error: PN_SSL_VERIFY_PEER_NAME configured, but no peer hostname set!"); return 0; // fail connection } ssl_log(transport, "Checking identifying name in peer cert against '%s'", ssl->peer_hostname); bool matched = false; /* first check any SubjectAltName entries, as per RFC2818 */ GENERAL_NAMES *sans = (GENERAL_NAMES *) X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); if (sans) { int name_ct = sk_GENERAL_NAME_num( sans ); int i; for (i = 0; !matched && i < name_ct; ++i) { GENERAL_NAME *name = sk_GENERAL_NAME_value( sans, i ); if (name->type == GEN_DNS) { ASN1_STRING *asn1 = name->d.dNSName; if (asn1 && asn1->data && asn1->length) { unsigned char *str; int len = ASN1_STRING_to_UTF8( &str, asn1 ); if (len >= 0) { ssl_log(transport, "SubjectAltName (dns) from peer cert = '%.*s'", len, str ); matched = match_dns_pattern( ssl->peer_hostname, (const char *)str, len ); OPENSSL_free( str ); } } } } GENERAL_NAMES_free( sans ); } /* if no general names match, try the CommonName from the subject */ X509_NAME *name = X509_get_subject_name(cert); int i = -1; while (!matched && (i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) >= 0) { X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, i); ASN1_STRING *name_asn1 = X509_NAME_ENTRY_get_data(ne); if (name_asn1) { unsigned char *str; int len = ASN1_STRING_to_UTF8( &str, name_asn1); if (len >= 0) { ssl_log(transport, "commonName from peer cert = '%.*s'", len, str); matched = match_dns_pattern( ssl->peer_hostname, (const char *)str, len ); OPENSSL_free(str); } } } if (!matched) { ssl_log(transport, "Error: no name matching %s found in peer cert - rejecting handshake.", ssl->peer_hostname); preverify_ok = 0; #ifdef X509_V_ERR_APPLICATION_VERIFICATION X509_STORE_CTX_set_error( ctx, X509_V_ERR_APPLICATION_VERIFICATION ); #endif } else { ssl_log(transport, "Name from peer cert matched - peer is valid."); } return preverify_ok; } // This was introduced in v1.1 #if OPENSSL_VERSION_NUMBER < 0x10100000 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { dh->p = p; dh->q = q; dh->g = g; return 1; } #endif // this code was generated using the command: // "openssl dhparam -C -2 2048" static DH *get_dh2048(void) { static const unsigned char dhp_2048[]={ 0xAE,0xF7,0xE9,0x66,0x26,0x7A,0xAC,0x0A,0x6F,0x1E,0xCD,0x81, 0xBD,0x0A,0x10,0x7E,0xFA,0x2C,0xF5,0x2D,0x98,0xD4,0xE7,0xD9, 0xE4,0x04,0x8B,0x06,0x85,0xF2,0x0B,0xA3,0x90,0x15,0x56,0x0C, 0x8B,0xBE,0xF8,0x48,0xBB,0x29,0x63,0x75,0x12,0x48,0x9D,0x7E, 0x7C,0x24,0xB4,0x3A,0x38,0x7E,0x97,0x3C,0x77,0x95,0xB0,0xA2, 0x72,0xB6,0xE9,0xD8,0xB8,0xFA,0x09,0x1B,0xDC,0xB3,0x80,0x6E, 0x32,0x0A,0xDA,0xBB,0xE8,0x43,0x88,0x5B,0xAB,0xC3,0xB2,0x44, 0xE1,0x95,0x85,0x0A,0x0D,0x13,0xE2,0x02,0x1E,0x96,0x44,0xCF, 0xA0,0xD8,0x46,0x32,0x68,0x63,0x7F,0x68,0xB3,0x37,0x52,0xCE, 0x3A,0x4E,0x48,0x08,0x7F,0xD5,0x53,0x00,0x59,0xA8,0x2C,0xCB, 0x51,0x64,0x3D,0x5F,0xEF,0x0E,0x5F,0xE6,0xAF,0xD9,0x1E,0xA2, 0x35,0x64,0x37,0xD7,0x4C,0xC9,0x24,0xFD,0x2F,0x75,0xBB,0x3A, 0x15,0x82,0x76,0x4D,0xC2,0x8B,0x1E,0xB9,0x4B,0xA1,0x33,0xCF, 0xAA,0x3B,0x7C,0xC2,0x50,0x60,0x6F,0x45,0x69,0xD3,0x6B,0x88, 0x34,0x9B,0xE4,0xF8,0xC6,0xC7,0x5F,0x10,0xA1,0xBA,0x01,0x8C, 0xDA,0xD1,0xA3,0x59,0x9C,0x97,0xEA,0xC3,0xF6,0x02,0x55,0x5C, 0x92,0x1A,0x39,0x67,0x17,0xE2,0x9B,0x27,0x8D,0xE8,0x5C,0xE9, 0xA5,0x94,0xBB,0x7E,0x16,0x6F,0x53,0x5A,0x6D,0xD8,0x03,0xC2, 0xAC,0x7A,0xCD,0x22,0x98,0x8E,0x33,0x2A,0xDE,0xAB,0x12,0xC0, 0x0B,0x7C,0x0C,0x20,0x70,0xD9,0x0B,0xAE,0x0B,0x2F,0x20,0x9B, 0xA4,0xED,0xFD,0x49,0x0B,0xE3,0x4A,0xF6,0x28,0xB3,0x98,0xB0, 0x23,0x1C,0x09,0x33, }; static const unsigned char dhg_2048[]={ 0x02, }; DH *dh = DH_new(); BIGNUM *dhp_bn, *dhg_bn; if (dh == NULL) return NULL; dhp_bn = BN_bin2bn(dhp_2048, sizeof (dhp_2048), NULL); dhg_bn = BN_bin2bn(dhg_2048, sizeof (dhg_2048), NULL); if (dhp_bn == NULL || dhg_bn == NULL || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) { DH_free(dh); BN_free(dhp_bn); BN_free(dhg_bn); return NULL; } return dh; } typedef struct { char *id; SSL_SESSION *session; } ssl_cache_data; #define SSL_CACHE_SIZE 4 static int ssl_cache_ptr = 0; static ssl_cache_data ssl_cache[SSL_CACHE_SIZE]; static void ssn_init(void) { ssl_cache_data s = {NULL, NULL}; for (int i=0; isession_id) return; for (int i = ssl_cache_ptr;;) { i = (i==0) ? SSL_CACHE_SIZE-1 : i-1; if (ssl_cache[i].id == NULL) return; if (strcmp(ssl_cache[i].id, ssl->session_id) == 0) { ssl_log( transport, "Restoring previous session id=%s", ssl->session_id ); int rc = SSL_set_session( ssl->ssl, ssl_cache[i].session ); if (rc != 1) { ssl_log( transport, "Session restore failed, id=%s", ssl->session_id ); } return; } if (i == ssl_cache_ptr) return; } } static void ssn_save(pn_transport_t *transport, pni_ssl_t *ssl) { if (ssl->session_id) { // Attach the session id to the session before we close the connection // So that if we find it in the cache later we can figure out the session id SSL_SESSION *session = SSL_get1_session( ssl->ssl ); if (session) { ssl_log(transport, "Saving SSL session as %s", ssl->session_id ); // If we're overwriting a value, need to free it free(ssl_cache[ssl_cache_ptr].id); if (ssl_cache[ssl_cache_ptr].session) SSL_SESSION_free(ssl_cache[ssl_cache_ptr].session); char *id = pn_strdup( ssl->session_id ); ssl_cache_data s = {id, session}; ssl_cache[ssl_cache_ptr++] = s; if (ssl_cache_ptr==SSL_CACHE_SIZE) ssl_cache_ptr = 0; } } } /** Public API - visible to application code */ bool pn_ssl_present(void) { return true; } static bool ensure_initialized(void); pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode ) { if (!ensure_initialized()) { ssl_log_error("Unable to initialize OpenSSL library"); return NULL; } pn_ssl_domain_t *domain = (pn_ssl_domain_t *) calloc(1, sizeof(pn_ssl_domain_t)); if (!domain) return NULL; domain->ref_count = 1; domain->mode = mode; // enable all supported protocol versions, then explicitly disable the // known vulnerable ones. This should allow us to use the latest version // of the TLS standard that the installed library supports. switch(mode) { case PN_SSL_MODE_CLIENT: domain->ctx = SSL_CTX_new(SSLv23_client_method()); // and TLSv1+ SSL_CTX_set_session_cache_mode(domain->ctx, SSL_SESS_CACHE_CLIENT); if (!domain->ctx) { ssl_log_error("Unable to initialize OpenSSL context."); free(domain); return NULL; } break; case PN_SSL_MODE_SERVER: domain->ctx = SSL_CTX_new(SSLv23_server_method()); // and TLSv1+ if (!domain->ctx) { ssl_log_error("Unable to initialize OpenSSL context."); free(domain); return NULL; } break; default: pn_transport_logf(NULL, "Invalid value for pn_ssl_mode_t: %d", mode); free(domain); return NULL; } const long reject_insecure = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; SSL_CTX_set_options(domain->ctx, reject_insecure); #ifdef SSL_OP_NO_COMPRESSION // Mitigate the CRIME vulnerability SSL_CTX_set_options(domain->ctx, SSL_OP_NO_COMPRESSION); #endif #if OPENSSL_VERSION_NUMBER >= 0x10100000 domain->default_seclevel = SSL_CTX_get_security_level(domain->ctx); #endif // by default, allow anonymous ciphers so certificates are not required 'out of the box' if (!SSL_CTX_set_cipher_list( domain->ctx, CIPHERS_ANONYMOUS )) { ssl_log_error("Failed to set cipher list to %s", CIPHERS_ANONYMOUS); pn_ssl_domain_free(domain); return NULL; } // ditto: by default do not authenticate the peer (can be done by SASL). if (pn_ssl_domain_set_peer_authentication( domain, PN_SSL_ANONYMOUS_PEER, NULL )) { pn_ssl_domain_free(domain); return NULL; } DH *dh = get_dh2048(); if (dh) { SSL_CTX_set_tmp_dh(domain->ctx, dh); DH_free(dh); SSL_CTX_set_options(domain->ctx, SSL_OP_SINGLE_DH_USE); } return domain; } void pn_ssl_domain_free( pn_ssl_domain_t *domain ) { if (--domain->ref_count == 0) { if (domain->ctx) SSL_CTX_free(domain->ctx); if (domain->keyfile_pw) free(domain->keyfile_pw); if (domain->trusted_CAs) free(domain->trusted_CAs); if (domain->ciphers) free(domain->ciphers); free(domain); } } int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain, const char *certificate_file, const char *private_key_file, const char *password) { if (!domain || !domain->ctx) return -1; if (SSL_CTX_use_certificate_chain_file(domain->ctx, certificate_file) != 1) { ssl_log_error("SSL_CTX_use_certificate_chain_file( %s ) failed", certificate_file); return -3; } if (password) { domain->keyfile_pw = pn_strdup(password); // @todo: obfuscate me!!! SSL_CTX_set_default_passwd_cb(domain->ctx, keyfile_pw_cb); SSL_CTX_set_default_passwd_cb_userdata(domain->ctx, domain->keyfile_pw); } if (SSL_CTX_use_PrivateKey_file(domain->ctx, private_key_file, SSL_FILETYPE_PEM) != 1) { ssl_log_error("SSL_CTX_use_PrivateKey_file( %s ) failed", private_key_file); return -4; } if (SSL_CTX_check_private_key(domain->ctx) != 1) { ssl_log_error("The key file %s is not consistent with the certificate %s", private_key_file, certificate_file); return -5; } domain->has_certificate = true; // bug in older versions of OpenSSL: servers may request client cert even if anonymous // cipher was negotiated. TLSv1 will reject such a request. Hack: once a cert is // configured, allow only authenticated ciphers. if (!domain->ciphers && !SSL_CTX_set_cipher_list( domain->ctx, CIPHERS_AUTHENTICATE )) { ssl_log_error("Failed to set cipher list to %s", CIPHERS_AUTHENTICATE); return -6; } return 0; } int pn_ssl_domain_set_ciphers(pn_ssl_domain_t *domain, const char *ciphers) { if (!SSL_CTX_set_cipher_list(domain->ctx, ciphers)) { ssl_log_error("Failed to set cipher list to %s", ciphers); return -6; } if (domain->ciphers) free(domain->ciphers); domain->ciphers = pn_strdup(ciphers); return 0; } int pn_ssl_domain_set_protocols(pn_ssl_domain_t *domain, const char *protocols) { static const struct { const char *name; const long option; } protocol_options[] = { {"TLSv1", SSL_OP_NO_TLSv1}, {"TLSv1.1", SSL_OP_NO_TLSv1_1}, {"TLSv1.2", SSL_OP_NO_TLSv1_2} }; static const char seps[] = " ,;"; static const long all_prots = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2; // Start with all protocols turned off long options = all_prots; // For each separate token in protocols const char *token = protocols; while (*token!=0) { // Find next separator size_t tsize = strcspn(token, seps); while (tsize==0 && *token!=0) { ++token; tsize = strcspn(token, seps); } if (tsize==0) break; // No more tokens // Linear search the posibilities for the option to set for (size_t i = 0; ictx, all_prots); SSL_CTX_set_options(domain->ctx, options); return 0; } int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain, const char *certificate_db) { if (!domain) return -1; // certificates can be either a file or a directory, which determines how it is passed // to SSL_CTX_load_verify_locations() struct stat sbuf; if (stat( certificate_db, &sbuf ) != 0) { pn_transport_logf(NULL, "stat(%s) failed: %s", certificate_db, strerror(errno)); return -1; } const char *file; const char *dir; if (S_ISDIR(sbuf.st_mode)) { dir = certificate_db; file = NULL; } else { dir = NULL; file = certificate_db; } if (SSL_CTX_load_verify_locations( domain->ctx, file, dir ) != 1) { ssl_log_error("SSL_CTX_load_verify_locations( %s ) failed", certificate_db); return -1; } domain->has_ca_db = true; return 0; } int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_ssl_verify_mode_t mode, const char *trusted_CAs) { if (!domain) return -1; switch (mode) { case PN_SSL_VERIFY_PEER: case PN_SSL_VERIFY_PEER_NAME: #if OPENSSL_VERSION_NUMBER >= 0x10100000 SSL_CTX_set_security_level(domain->ctx, domain->default_seclevel); #endif if (!domain->has_ca_db) { pn_transport_logf(NULL, "Error: cannot verify peer without a trusted CA configured.\n" " Use pn_ssl_domain_set_trusted_ca_db()"); return -1; } if (domain->mode == PN_SSL_MODE_SERVER) { // openssl requires that server connections supply a list of trusted CAs which is // sent to the client if (!trusted_CAs) { pn_transport_logf(NULL, "Error: a list of trusted CAs must be provided."); return -1; } if (!domain->has_certificate) { pn_transport_logf(NULL, "Error: Server cannot verify peer without configuring a certificate.\n" " Use pn_ssl_domain_set_credentials()"); } if (domain->trusted_CAs) free(domain->trusted_CAs); domain->trusted_CAs = pn_strdup( trusted_CAs ); STACK_OF(X509_NAME) *cert_names; cert_names = SSL_load_client_CA_file( domain->trusted_CAs ); if (cert_names != NULL) SSL_CTX_set_client_CA_list(domain->ctx, cert_names); else { pn_transport_logf(NULL, "Error: Unable to process file of trusted CAs: %s", trusted_CAs); return -1; } } SSL_CTX_set_verify( domain->ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, verify_callback); #if (OPENSSL_VERSION_NUMBER < 0x00905100L) SSL_CTX_set_verify_depth(domain->ctx, 1); #endif break; case PN_SSL_ANONYMOUS_PEER: // hippie free love mode... :) #if OPENSSL_VERSION_NUMBER >= 0x10100000 // Must use lowest OpenSSL security level to enable anonymous ciphers. SSL_CTX_set_security_level(domain->ctx, 0); #endif SSL_CTX_set_verify( domain->ctx, SSL_VERIFY_NONE, NULL ); break; default: pn_transport_logf(NULL, "Invalid peer authentication mode given." ); return -1; } domain->verify_mode = mode; return 0; } const pn_io_layer_t ssl_layer = { process_input_ssl, process_output_ssl, handle_error_ssl, NULL, buffered_output }; const pn_io_layer_t ssl_input_closed_layer = { process_input_done, process_output_ssl, handle_error_ssl, NULL, buffered_output }; const pn_io_layer_t ssl_output_closed_layer = { process_input_ssl, process_output_done, handle_error_ssl, NULL, buffered_output }; const pn_io_layer_t ssl_closed_layer = { process_input_done, process_output_done, handle_error_ssl, NULL, buffered_output }; int pn_ssl_init(pn_ssl_t *ssl0, pn_ssl_domain_t *domain, const char *session_id) { pn_transport_t *transport = get_transport_internal(ssl0); pni_ssl_t *ssl = transport->ssl; if (!ssl || !domain || ssl->domain) return -1; ssl->domain = domain; domain->ref_count++; if (session_id && domain->mode == PN_SSL_MODE_CLIENT) ssl->session_id = pn_strdup(session_id); // If SSL doesn't specifically allow skipping encryption, require SSL // TODO: This is a probably a stop-gap until allow_unsecured is removed if (!domain->allow_unsecured) transport->encryption_required = true; return init_ssl_socket(transport, ssl); } int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain) { if (!domain) return -1; if (domain->mode != PN_SSL_MODE_SERVER) { pn_transport_logf(NULL, "Cannot permit unsecured clients - not a server."); return -1; } domain->allow_unsecured = true; return 0; } int pn_ssl_get_ssf(pn_ssl_t *ssl0) { const SSL_CIPHER *c; pni_ssl_t *ssl = get_ssl_internal(ssl0); if (ssl && ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) { return SSL_CIPHER_get_bits(c, NULL); } return 0; } bool pn_ssl_get_cipher_name(pn_ssl_t *ssl0, char *buffer, size_t size ) { const SSL_CIPHER *c; pni_ssl_t *ssl = get_ssl_internal(ssl0); if (buffer && size) *buffer = '\0'; if (ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) { const char *v = SSL_CIPHER_get_name(c); if (buffer && v) { pni_snprintf( buffer, size, "%s", v ); return true; } } return false; } bool pn_ssl_get_protocol_name(pn_ssl_t *ssl0, char *buffer, size_t size ) { const SSL_CIPHER *c; pni_ssl_t *ssl = get_ssl_internal(ssl0); if (buffer && size) *buffer = '\0'; if (ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) { const char *v = SSL_CIPHER_get_version(c); if (buffer && v) { pni_snprintf( buffer, size, "%s", v ); return true; } } return false; } void pn_ssl_free(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; if (!ssl) return; ssl_log(transport, "SSL socket freed." ); release_ssl_socket( ssl ); if (ssl->domain) pn_ssl_domain_free(ssl->domain); if (ssl->session_id) free((void *)ssl->session_id); if (ssl->peer_hostname) free((void *)ssl->peer_hostname); if (ssl->inbuf) free((void *)ssl->inbuf); if (ssl->outbuf) free((void *)ssl->outbuf); if (ssl->subject) free(ssl->subject); if (ssl->peer_certificate) X509_free(ssl->peer_certificate); free(ssl); } pn_ssl_t *pn_ssl(pn_transport_t *transport) { if (!transport) return NULL; if (transport->ssl) return (pn_ssl_t *) transport; pni_ssl_t *ssl = (pni_ssl_t *) calloc(1, sizeof(pni_ssl_t)); if (!ssl) return NULL; ssl->out_size = APP_BUF_SIZE; uint32_t max_frame = pn_transport_get_max_frame(transport); ssl->in_size = max_frame ? max_frame : APP_BUF_SIZE; ssl->outbuf = (char *)malloc(ssl->out_size); if (!ssl->outbuf) { free(ssl); return NULL; } ssl->inbuf = (char *)malloc(ssl->in_size); if (!ssl->inbuf) { free(ssl->outbuf); free(ssl); return NULL; } transport->ssl = ssl; // Set up hostname from any bound connection if (transport->connection) { if (pn_string_size(transport->connection->hostname)) { pn_ssl_set_peer_hostname((pn_ssl_t *) transport, pn_string_get(transport->connection->hostname)); } } return (pn_ssl_t *) transport; } /** Private: */ static int keyfile_pw_cb(char *buf, int size, int rwflag, void *userdata) { strncpy(buf, (char *)userdata, size); // @todo: un-obfuscate me!!! buf[size - 1] = '\0'; return(strlen(buf)); } static int start_ssl_shutdown(pn_transport_t *transport) { pni_ssl_t *ssl = transport->ssl; if (!ssl->ssl_shutdown) { ssl_log(transport, "Shutting down SSL connection..."); ssn_save(transport, ssl); ssl->ssl_shutdown = true; BIO_ssl_shutdown( ssl->bio_ssl ); } return 0; } //////// SSL Connections // take data from the network, and pass it into SSL. Attempt to read decrypted data from // SSL socket and pass it to the application. static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t available) { pni_ssl_t *ssl = transport->ssl; if (ssl->ssl == NULL && init_ssl_socket(transport, ssl)) return PN_EOS; ssl_log( transport, "process_input_ssl( data size=%d )",available ); ssize_t consumed = 0; bool work_pending; bool shutdown_input = (available == 0); // caller is closed do { work_pending = false; ERR_clear_error(); // Write to network bio as much as possible, consuming bytes/available if (available > 0) { int written = BIO_write( ssl->bio_net_io, input_data, available ); if (written > 0) { input_data += written; available -= written; consumed += written; ssl->read_blocked = false; work_pending = (available > 0); ssl_log( transport, "Wrote %d bytes to BIO Layer, %d left over", written, available ); } } else if (shutdown_input) { // lower layer (caller) has closed. Close the WRITE side of the BIO. This will cause // an EOF to be passed to SSL once all pending inbound data has been consumed. ssl_log( transport, "Lower layer closed - shutting down BIO write side"); (void)BIO_shutdown_wr( ssl->bio_net_io ); shutdown_input = false; } // Read all available data from the SSL socket if (!ssl->ssl_closed && ssl->in_count < ssl->in_size) { int read = BIO_read( ssl->bio_ssl, &ssl->inbuf[ssl->in_count], ssl->in_size - ssl->in_count ); if (read > 0) { ssl_log( transport, "Read %d bytes from SSL socket for app", read ); ssl_log_clear_data(transport, &ssl->inbuf[ssl->in_count], read ); ssl->in_count += read; work_pending = true; } else { if (!BIO_should_retry(ssl->bio_ssl)) { int reason = SSL_get_error( ssl->ssl, read ); switch (reason) { case SSL_ERROR_ZERO_RETURN: // SSL closed cleanly ssl_log(transport, "SSL connection has closed"); start_ssl_shutdown(transport); // KAG: not sure - this may not be necessary ssl->ssl_closed = true; break; default: // unexpected error return (ssize_t)ssl_failed(transport); } } else { if (BIO_should_write( ssl->bio_ssl )) { ssl->write_blocked = true; ssl_log(transport, "Detected write-blocked"); } if (BIO_should_read( ssl->bio_ssl )) { ssl->read_blocked = true; ssl_log(transport, "Detected read-blocked"); } } } } // write incoming data to app layer if (!ssl->app_input_closed) { if (ssl->in_count > 0 || ssl->ssl_closed) { /* if ssl_closed, send 0 count */ ssize_t consumed = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->inbuf, ssl->in_count); if (consumed > 0) { ssl->in_count -= consumed; if (ssl->in_count) memmove( ssl->inbuf, ssl->inbuf + consumed, ssl->in_count ); work_pending = true; ssl_log( transport, "Application consumed %d bytes from peer", (int) consumed ); } else if (consumed < 0) { ssl_log(transport, "Application layer closed its input, error=%d (discarding %d bytes)", (int) consumed, (int)ssl->in_count); ssl->in_count = 0; // discard any pending input ssl->app_input_closed = consumed; if (ssl->app_output_closed && ssl->out_count == 0) { // both sides of app closed, and no more app output pending: start_ssl_shutdown(transport); } } else { // app did not consume any bytes, must be waiting for a full frame if (ssl->in_count == ssl->in_size) { // but the buffer is full, not enough room for a full frame. // can we grow the buffer? uint32_t max_frame = pn_transport_get_max_frame(transport); if (!max_frame) max_frame = ssl->in_size * 2; // no limit if (ssl->in_size < max_frame) { // no max frame limit - grow it. size_t newsize = pn_min(max_frame, ssl->in_size * 2); char *newbuf = (char *)realloc( ssl->inbuf, newsize ); if (newbuf) { ssl->in_size = newsize; ssl->inbuf = newbuf; work_pending = true; // can we get more input? } } else { // can't gather any more input, but app needs more? // This is a bug - since SSL can buffer up to max-frame, // the application _must_ have enough data to process. If // this is an oversized frame, the app _must_ handle it // by returning an error code to SSL. pn_transport_log(transport, "Error: application unable to consume input."); } } } } } } while (work_pending); //_log(ssl, "ssl_closed=%d in_count=%d app_input_closed=%d app_output_closed=%d", // ssl->ssl_closed, ssl->in_count, ssl->app_input_closed, ssl->app_output_closed ); // PROTON-82: Instead, close the input side as soon as we've completed enough of the SSL // shutdown handshake to send the close_notify. We're not requiring the response, as // some implementations never reply. // --- // tell transport our input side is closed if the SSL socket cannot be read from any // longer, AND any pending input has been written up to the application (or the // application is closed) //if (ssl->ssl_closed && ssl->app_input_closed) { // consumed = ssl->app_input_closed; //} if (ssl->app_input_closed && (SSL_get_shutdown(ssl->ssl) & SSL_SENT_SHUTDOWN) ) { consumed = ssl->app_input_closed; if (transport->io_layers[layer]==&ssl_output_closed_layer) { transport->io_layers[layer] = &ssl_closed_layer; } else { transport->io_layers[layer] = &ssl_input_closed_layer; } } ssl_log(transport, "process_input_ssl() returning %d", (int) consumed); return consumed; } static void handle_error_ssl(pn_transport_t *transport, unsigned int layer) { transport->io_layers[layer] = &ssl_closed_layer; } static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_len) { pni_ssl_t *ssl = transport->ssl; if (!ssl) return PN_EOS; if (ssl->ssl == NULL && init_ssl_socket(transport, ssl)) return PN_EOS; ssize_t written = 0; bool work_pending; do { work_pending = false; ERR_clear_error(); // first, get any pending application output, if possible if (!ssl->app_output_closed && ssl->out_count < ssl->out_size) { ssize_t app_bytes = transport->io_layers[layer+1]->process_output(transport, layer+1, &ssl->outbuf[ssl->out_count], ssl->out_size - ssl->out_count); if (app_bytes > 0) { ssl->out_count += app_bytes; work_pending = true; ssl_log(transport, "Gathered %d bytes from app to send to peer", app_bytes ); } else { if (app_bytes < 0) { ssl_log(transport, "Application layer closed its output, error=%d (%d bytes pending send)", (int) app_bytes, (int) ssl->out_count); ssl->app_output_closed = app_bytes; } } } // now push any pending app data into the socket if (!ssl->ssl_closed) { char *data = ssl->outbuf; if (ssl->out_count > 0) { int wrote = BIO_write( ssl->bio_ssl, data, ssl->out_count ); if (wrote > 0) { data += wrote; ssl->out_count -= wrote; work_pending = true; ssl_log( transport, "Wrote %d bytes from app to socket", wrote ); } else { if (!BIO_should_retry(ssl->bio_ssl)) { int reason = SSL_get_error( ssl->ssl, wrote ); switch (reason) { case SSL_ERROR_ZERO_RETURN: // SSL closed cleanly ssl_log(transport, "SSL connection has closed"); start_ssl_shutdown(transport); // KAG: not sure - this may not be necessary ssl->out_count = 0; // can no longer write to socket, so erase app output data ssl->ssl_closed = true; break; default: // unexpected error return (ssize_t)ssl_failed(transport); } } else { if (BIO_should_read( ssl->bio_ssl )) { ssl->read_blocked = true; ssl_log(transport, "Detected read-blocked"); } if (BIO_should_write( ssl->bio_ssl )) { ssl->write_blocked = true; ssl_log(transport, "Detected write-blocked"); } } } } if (ssl->out_count == 0) { if (ssl->app_input_closed && ssl->app_output_closed) { // application is done sending/receiving data, and all buffered output data has // been written to the SSL socket start_ssl_shutdown(transport); } } else if (data != ssl->outbuf) { memmove( ssl->outbuf, data, ssl->out_count ); } } // read from the network bio as much as possible, filling the buffer if (max_len) { int available = BIO_read( ssl->bio_net_io, buffer, max_len ); if (available > 0) { max_len -= available; buffer += available; written += available; ssl->write_blocked = false; work_pending = work_pending || max_len > 0; ssl_log(transport, "Read %d bytes from BIO Layer", available ); } } } while (work_pending); //_log(ssl, "written=%d ssl_closed=%d in_count=%d app_input_closed=%d app_output_closed=%d bio_pend=%d", // written, ssl->ssl_closed, ssl->in_count, ssl->app_input_closed, ssl->app_output_closed, BIO_pending(ssl->bio_net_io) ); // PROTON-82: close the output side as soon as we've sent the SSL close_notify. // We're not requiring the response, as some implementations never reply. // ---- // Once no more data is available "below" the SSL socket, tell the transport we are // done. //if (written == 0 && ssl->ssl_closed && BIO_pending(ssl->bio_net_io) == 0) { // written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS; //} if (written == 0 && (SSL_get_shutdown(ssl->ssl) & SSL_SENT_SHUTDOWN) && BIO_pending(ssl->bio_net_io) == 0) { written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS; if (transport->io_layers[layer]==&ssl_input_closed_layer) { transport->io_layers[layer] = &ssl_closed_layer; } else { transport->io_layers[layer] = &ssl_output_closed_layer; } } ssl_log(transport, "process_output_ssl() returning %d", (int) written); return written; } static int init_ssl_socket(pn_transport_t* transport, pni_ssl_t *ssl) { if (ssl->ssl) return 0; if (!ssl->domain) return -1; ssl->ssl = SSL_new(ssl->domain->ctx); if (!ssl->ssl) { pn_transport_logf(transport, "SSL socket setup failure." ); return -1; } // store backpointer to pn_transport_t in SSL object: SSL_set_ex_data(ssl->ssl, ssl_ex_data_index, transport); #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if (ssl->peer_hostname && ssl->domain->mode == PN_SSL_MODE_CLIENT) { SSL_set_tlsext_host_name(ssl->ssl, ssl->peer_hostname); } #endif // restore session, if available ssn_restore(transport, ssl); // now layer a BIO over the SSL socket ssl->bio_ssl = BIO_new(BIO_f_ssl()); if (!ssl->bio_ssl) { pn_transport_log(transport, "BIO setup failure." ); return -1; } (void)BIO_set_ssl(ssl->bio_ssl, ssl->ssl, BIO_NOCLOSE); // create the "lower" BIO "pipe", and attach it below the SSL layer if (!BIO_new_bio_pair(&ssl->bio_ssl_io, 0, &ssl->bio_net_io, 0)) { pn_transport_log(transport, "BIO setup failure." ); return -1; } SSL_set_bio(ssl->ssl, ssl->bio_ssl_io, ssl->bio_ssl_io); if (ssl->domain->mode == PN_SSL_MODE_SERVER) { SSL_set_accept_state(ssl->ssl); BIO_set_ssl_mode(ssl->bio_ssl, 0); // server mode ssl_log( transport, "Server SSL socket created." ); } else { // client mode SSL_set_connect_state(ssl->ssl); BIO_set_ssl_mode(ssl->bio_ssl, 1); // client mode ssl_log( transport, "Client SSL socket created." ); } ssl->subject = NULL; ssl->peer_certificate = NULL; return 0; } static void release_ssl_socket(pni_ssl_t *ssl) { if (ssl->bio_ssl) BIO_free(ssl->bio_ssl); if (ssl->ssl) { SSL_free(ssl->ssl); // will free bio_ssl_io } else { if (ssl->bio_ssl_io) BIO_free(ssl->bio_ssl_io); } if (ssl->bio_net_io) BIO_free(ssl->bio_net_io); ssl->bio_ssl = NULL; ssl->bio_ssl_io = NULL; ssl->bio_net_io = NULL; ssl->ssl = NULL; } pn_ssl_resume_status_t pn_ssl_resume_status(pn_ssl_t *ssl0) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl || !ssl->ssl) return PN_SSL_RESUME_UNKNOWN; switch (SSL_session_reused( ssl->ssl )) { case 0: return PN_SSL_RESUME_NEW; case 1: return PN_SSL_RESUME_REUSED; default: break; } return PN_SSL_RESUME_UNKNOWN; } int pn_ssl_set_peer_hostname(pn_ssl_t *ssl0, const char *hostname) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl) return -1; if (ssl->peer_hostname) free((void *)ssl->peer_hostname); ssl->peer_hostname = NULL; if (hostname) { ssl->peer_hostname = pn_strdup(hostname); if (!ssl->peer_hostname) return -2; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if (ssl->ssl && ssl->domain && ssl->domain->mode == PN_SSL_MODE_CLIENT) { SSL_set_tlsext_host_name(ssl->ssl, ssl->peer_hostname); } #endif } return 0; } int pn_ssl_get_peer_hostname(pn_ssl_t *ssl0, char *hostname, size_t *bufsize) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl) return -1; if (!ssl->peer_hostname) { *bufsize = 0; if (hostname) *hostname = '\0'; return 0; } unsigned len = strlen(ssl->peer_hostname); if (hostname) { if (len >= *bufsize) return -1; strcpy( hostname, ssl->peer_hostname ); } *bufsize = len; return 0; } static X509 *get_peer_certificate(pni_ssl_t *ssl) { // Cache for multiple use and final X509_free if (!ssl->peer_certificate && ssl->ssl) { ssl->peer_certificate = SSL_get_peer_certificate(ssl->ssl); // May still be NULL depending on timing or type of SSL connection } return ssl->peer_certificate; } const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl0) { pni_ssl_t *ssl = get_ssl_internal(ssl0); if (!ssl || !ssl->ssl) return NULL; if (!ssl->subject) { X509 *cert = get_peer_certificate(ssl); if (!cert) return NULL; X509_NAME *subject = X509_get_subject_name(cert); if (!subject) return NULL; BIO *out = BIO_new(BIO_s_mem()); X509_NAME_print_ex(out, subject, 0, XN_FLAG_RFC2253); int len = BIO_number_written(out); ssl->subject = (char*) malloc(len+1); ssl->subject[len] = 0; BIO_read(out, ssl->subject, len); BIO_free(out); } return ssl->subject; } int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg) { const char *digest_name = NULL; size_t min_required_length; // old versions of python expect fingerprint to contain a valid string on // return from this function fingerprint[0] = 0; // Assign the correct digest_name value based on the enum values. switch (hash_alg) { case PN_SSL_SHA1 : min_required_length = 41; // 40 hex characters + 1 '\0' character digest_name = "sha1"; break; case PN_SSL_SHA256 : min_required_length = 65; // 64 hex characters + 1 '\0' character digest_name = "sha256"; break; case PN_SSL_SHA512 : min_required_length = 129; // 128 hex characters + 1 '\0' character digest_name = "sha512"; break; case PN_SSL_MD5 : min_required_length = 33; // 32 hex characters + 1 '\0' character digest_name = "md5"; break; default: ssl_log_error("Unknown or unhandled hash algorithm %i \n", hash_alg); return PN_ERR; } if(fingerprint_length < min_required_length) { ssl_log_error("Insufficient fingerprint_length %i. fingerprint_length must be %i or above for %s digest\n", fingerprint_length, min_required_length, digest_name); return PN_ERR; } const EVP_MD *digest = EVP_get_digestbyname(digest_name); pni_ssl_t *ssl = get_ssl_internal(ssl0); X509 *cert = get_peer_certificate(ssl); if(cert) { unsigned int len; unsigned char bytes[64]; // sha512 uses 64 octets, we will use that as the maximum. if (X509_digest(cert, digest, bytes, &len) != 1) { ssl_log_error("Failed to extract X509 digest\n"); return PN_ERR; } char *cursor = fingerprint; for (size_t i=0; i -1) { X509_NAME_ENTRY *ne = X509_NAME_get_entry(subject_name, index); if(ne) { ASN1_STRING *name_asn1 = X509_NAME_ENTRY_get_data(ne); return (char *) name_asn1->data; } } return NULL; } static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len) { return PN_EOS; } static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len) { return PN_EOS; } // return # output bytes sitting in this layer static size_t buffered_output(pn_transport_t *transport) { size_t count = 0; pni_ssl_t *ssl = transport->ssl; if (ssl) { count += ssl->out_count; if (ssl->bio_net_io) { // pick up any bytes waiting for network io count += BIO_ctrl_pending(ssl->bio_net_io); } } return count; } /* Thread-safe locking and initialization for POSIX and Windows */ static bool init_ok = false; #ifdef _WIN32 typedef CRITICAL_SECTION pni_mutex_t; static inline void pni_mutex_init(pni_mutex_t *m) { InitializeCriticalSection(m); } static inline void pni_mutex_lock(pni_mutex_t *m) { EnterCriticalSection(m); } static inline void pni_mutex_unlock(pni_mutex_t *m) { LeaveCriticalSection(m); } static inline unsigned long id_callback(void) { return (unsigned long)GetCurrentThreadId(); } INIT_ONCE initialize_once = INIT_ONCE_STATIC_INIT; static inline bool ensure_initialized(void) { void* dummy; InitOnceExecuteOnce(&initialize_once, &initialize, NULL, &dummy); return init_ok; } #else /* POSIX */ #include static void initialize(void); typedef pthread_mutex_t pni_mutex_t; static inline int pni_mutex_init(pni_mutex_t *m) { return pthread_mutex_init(m, NULL); } static inline int pni_mutex_lock(pni_mutex_t *m) { return pthread_mutex_lock(m); } static inline int pni_mutex_unlock(pni_mutex_t *m) { return pthread_mutex_unlock(m); } static inline unsigned long id_callback(void) { return (unsigned long)pthread_self(); } static pthread_once_t initialize_once = PTHREAD_ONCE_INIT; static inline bool ensure_initialized(void) { pthread_once(&initialize_once, &initialize); return init_ok; } #endif static pni_mutex_t *locks = NULL; /* Lock array for openssl */ /* Callback function for openssl locking */ static void locking_callback(int mode, int n, const char *file, int line) { if(mode & CRYPTO_LOCK) pni_mutex_lock(&locks[n]); else pni_mutex_unlock(&locks[n]); } static void initialize(void) { int i; SSL_library_init(); SSL_load_error_strings(); OpenSSL_add_all_algorithms(); ssl_ex_data_index = SSL_get_ex_new_index( 0, (void *) "org.apache.qpid.proton.ssl", NULL, NULL, NULL); ssn_init(); locks = (pni_mutex_t*)malloc(CRYPTO_num_locks() * sizeof(pni_mutex_t)); if (!locks) return; for(i = 0; i < CRYPTO_num_locks(); i++) pni_mutex_init(&locks[i]); CRYPTO_set_id_callback(&id_callback); CRYPTO_set_locking_callback(&locking_callback); /* In recent versions of openssl, the set_callback functions are no-op macros, so we need to take steps to stop the compiler complaining about unused functions. */ (void)&id_callback; (void)&locking_callback; init_ok = true; } /* TODO aconway 2017-10-16: There is no opportunity to clean up the locks as proton has no final shut-down call. If it did, we should call this: */ /* static void shutdown(void) { CRYPTO_set_id_callback(NULL); CRYPTO_set_locking_callback(NULL); if(locks) { int i; for(i = 0; i < CRYPTO_num_locks(); i++) pni_mutex_destroy(&locks[i]); free(locks); locks = NULL; } } */ qpid-proton-0.22.0/proton-c/src/ssl/PLATFORM_NOTES.md0000664000000000000000000000677413257152177016636 0ustar Proton SSL/TLS implementations have platform dependent formats for specifying private and public key information. OpenSSL ======= On OpenSSL (POSIX) based systems, certificates and their private keys are specified separately in two files: the public X509 certificate in PEM format and the password protected PKCS#8 encoded private key. `pn_ssl_domain_set_credentials(path_to_public_x509.pem, path_to_private_pkcs8.pem, password_for_pkcs8)` A database of trusted Certificate Authority certificates may be specified as a path to a file or a directory. In the former case, the file consists of one or more X509 certificates in PEM format concatenated together. In the latter case, the directory contains a file for each X509 certificate in PEM format and indexed by (i.e. the file name is derived from) the X509 `-subject_hash` of the certificate's name. See [here](https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.htm) for more details. SChannel ======== On SChannel (Windows) based systems, trust and identity certificates are stored in certificate stores, which may be file based or system/registry based. The former are in PKCS#12 format and the latter are typically managed by the Microsoft graphical management console. The public and private keys are stored together, except in the case of trusted authority certificates which only contain the public key information. To specify a certificate: `pn_ssl_domain_set_credentials(store, certificate_friendly_name, password_for_store)` File based stores are specified by their relative or absolute path names. Registry stores are specified by their names (which are case insensitive) preceded by "ss:" for "Current User" system stores or "lmss:" for "Local Machine" system stores. Examples: "ss:Personal" specifies the Personal store for the Current User. "lmss:AMQP" specifies a registry store called "AMQP" for the Local Machine context. "ss:Root" specifies the Trusted Root Certificate Authorities store for the Current User. If a store contains a single certificate, the friendly name is optional. The password may be null in the case of a registry store that is not password protected. Trusted root certificates must be placed in a store that is not password protected. In the special case that the peer certificate chain being verified requires revocation checking, the trusted root certificate must be present in both the trust store specified to Proton and also in the Windows "Trusted Root Certificate Authorities" system store. Such certificate chains are usually managed by a central corporate network administrator or by a recognized certificate authority in which case the trusted root is often already present in the system store. This requirement can be worked around by creating a special purpose CA database for Proton that includes the target peer's certificate (making it trusted, with the caution that you must consider the security implications of bypassing the revocation check). Existing OpenSSL keys (say `xx_x509.pem` and `xx_private_key.pem`) can be converted to PKCS#12 by the command: `openssl pkcs12 -export -out xx_windows.p12 -passin pass:password \ -passout pass:password -inkey xx_private_key.pem -in xx_x509.pem \ -name xx_friendlyname` To create a PKCS#12 trust store from a Certificate Authority's public X509 certificate with an empty password: `openssl pkcs12 -export -out trust_store.p12 -in ca-certificate.pem \ -name ca-certificate -nokeys -passout pass:` qpid-proton-0.22.0/proton-c/src/security.xml0000664000000000000000000000756713257152177015711 0ustar
qpid-proton-0.22.0/proton-c/src/sasl/0000775000000000000000000000000013257152177014243 5ustar qpid-proton-0.22.0/proton-c/src/sasl/sasl.c0000664000000000000000000007161713257152177015365 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "sasl-internal.h" #include "core/autodetect.h" #include "core/dispatch_actions.h" #include "core/engine-internal.h" #include "core/util.h" #include "protocol.h" #include "proton/ssl.h" #include "proton/types.h" #include // Machinery to allow plugin SASL implementations // Change this to &default_sasl_impl when we change cyrus to opt in static const pnx_sasl_implementation *global_sasl_impl = NULL; //----------------------------------------------------------------------------- // pnx_sasl: API for SASL implementations to use void pnx_sasl_logf(pn_transport_t *logger, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (logger->trace & PN_TRACE_DRV) pn_transport_vlogf(logger, fmt, ap); va_end(ap); } void *pnx_sasl_get_context(pn_transport_t *transport) { return transport->sasl ? transport->sasl->impl_context : NULL; } void pnx_sasl_set_context(pn_transport_t *transport, void *context) { if (transport->sasl) transport->sasl->impl_context = context; } bool pnx_sasl_is_client(pn_transport_t *transport) { return transport->sasl ? transport->sasl->client : false; } bool pnx_sasl_is_transport_encrypted(pn_transport_t *transport) { return transport->sasl ? transport->sasl->external_ssf>0 : false; } bool pnx_sasl_get_allow_insecure_mechs(pn_transport_t *transport) { return transport->sasl ? transport->sasl->allow_insecure_mechs : false; } bool pnx_sasl_get_auth_required(pn_transport_t *transport) { return transport->auth_required; } const char *pnx_sasl_get_username(pn_transport_t *transport) { return transport->sasl ? transport->sasl->username : NULL; } const char *pnx_sasl_get_external_username(pn_transport_t *transport) { return transport->sasl ? transport->sasl->external_auth : NULL; } int pnx_sasl_get_external_ssf(pn_transport_t *transport) { return transport->sasl ? transport->sasl->external_ssf : 0; } const char *pnx_sasl_get_password(pn_transport_t *transport) { return transport->sasl ? transport->sasl->password : NULL; } void pnx_sasl_clear_password(pn_transport_t *transport) { if (transport->sasl) { char *password = transport->sasl->password; free(memset(password, 0, strlen(password))); transport->sasl->password = NULL; } } const char *pnx_sasl_get_remote_fqdn(pn_transport_t *transport) { return transport->sasl ? transport->sasl->remote_fqdn : NULL; } const char *pnx_sasl_get_selected_mechanism(pn_transport_t *transport) { return transport->sasl ? transport->sasl->selected_mechanism : NULL; } void pnx_sasl_set_bytes_out(pn_transport_t *transport, pn_bytes_t bytes) { if (transport->sasl) { transport->sasl->bytes_out = bytes; } } void pnx_sasl_set_selected_mechanism(pn_transport_t *transport, const char *mechanism) { if (transport->sasl) { transport->sasl->selected_mechanism = pn_strdup(mechanism); } } void pnx_sasl_succeed_authentication(pn_transport_t *transport, const char *username) { if (transport->sasl) { transport->sasl->username = username; transport->sasl->outcome = PN_SASL_OK; transport->authenticated = true; } } void pnx_sasl_fail_authentication(pn_transport_t *transport) { if (transport->sasl) { transport->sasl->outcome = PN_SASL_AUTH; } } void pnx_sasl_set_implementation(pn_transport_t *transport, const pnx_sasl_implementation *i, void* context) { transport->sasl->impl = i; transport->sasl->impl_context = context; } void pnx_sasl_set_default_implementation(const pnx_sasl_implementation* impl) { global_sasl_impl = impl; } //----------------------------------------------------------------------------- // pni_sasl_impl: Abstract the entry points to the SASL implementation (virtual function calls) static inline void pni_sasl_impl_free(pn_transport_t *transport) { transport->sasl->impl->free(transport); } static inline const char *pni_sasl_impl_list_mechs(pn_transport_t *transport) { return transport->sasl->impl->list_mechs(transport); } static inline bool pni_sasl_impl_init_server(pn_transport_t *transport) { return transport->sasl->impl->init_server(transport); } static inline void pni_sasl_impl_prepare_write(pn_transport_t *transport) { transport->sasl->impl->prepare_write(transport); } static inline void pni_sasl_impl_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv) { transport->sasl->impl->process_init(transport, mechanism, recv); } static inline void pni_sasl_impl_process_response(pn_transport_t *transport, const pn_bytes_t *recv) { transport->sasl->impl->process_response(transport, recv); } static inline bool pni_sasl_impl_init_client(pn_transport_t *transport) { return transport->sasl->impl->init_client(transport); } static inline bool pni_sasl_impl_process_mechanisms(pn_transport_t *transport, const char *mechs) { return transport->sasl->impl->process_mechanisms(transport, mechs); } static inline void pni_sasl_impl_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv) { transport->sasl->impl->process_challenge(transport, recv); } static inline void pni_sasl_impl_process_outcome(pn_transport_t *transport) { transport->sasl->impl->process_outcome(transport); } static inline bool pni_sasl_impl_can_encrypt(pn_transport_t *transport) { return transport->sasl->impl->can_encrypt(transport); } static inline ssize_t pni_sasl_impl_max_encrypt_size(pn_transport_t *transport) { return transport->sasl->impl->max_encrypt_size(transport); } static inline ssize_t pni_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { return transport->sasl->impl->encode(transport, in, out); } static inline ssize_t pni_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { return transport->sasl->impl->decode(transport, in, out); } //----------------------------------------------------------------------------- // General SASL implementation static inline pni_sasl_t *get_sasl_internal(pn_sasl_t *sasl) { // The external pn_sasl_t is really a pointer to the internal pni_transport_t return sasl ? ((pn_transport_t *)sasl)->sasl : NULL; } static ssize_t pn_input_read_sasl_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available); static ssize_t pn_input_read_sasl(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_input_read_sasl_encrypt(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_output_write_sasl_header(pn_transport_t* transport, unsigned int layer, char* bytes, size_t size); static ssize_t pn_output_write_sasl(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); static ssize_t pn_output_write_sasl_encrypt(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); static void pn_error_sasl(pn_transport_t* transport, unsigned int layer); const pn_io_layer_t sasl_header_layer = { pn_input_read_sasl_header, pn_output_write_sasl_header, pn_error_sasl, NULL, NULL }; const pn_io_layer_t sasl_write_header_layer = { pn_input_read_sasl, pn_output_write_sasl_header, pn_error_sasl, NULL, NULL }; const pn_io_layer_t sasl_read_header_layer = { pn_input_read_sasl_header, pn_output_write_sasl, pn_error_sasl, NULL, NULL }; const pn_io_layer_t sasl_layer = { pn_input_read_sasl, pn_output_write_sasl, pn_error_sasl, NULL, NULL }; const pn_io_layer_t sasl_encrypt_layer = { pn_input_read_sasl_encrypt, pn_output_write_sasl_encrypt, NULL, NULL, NULL }; #define SASL_HEADER ("AMQP\x03\x01\x00\x00") #define SASL_HEADER_LEN 8 static bool pni_sasl_is_server_state(enum pnx_sasl_state state) { return state==SASL_NONE || state==SASL_POSTED_MECHANISMS || state==SASL_POSTED_CHALLENGE || state==SASL_POSTED_OUTCOME || state==SASL_ERROR; } static bool pni_sasl_is_client_state(enum pnx_sasl_state state) { return state==SASL_NONE || state==SASL_POSTED_INIT || state==SASL_POSTED_RESPONSE || state==SASL_RECVED_OUTCOME_SUCCEED || state==SASL_RECVED_OUTCOME_FAIL || state==SASL_ERROR; } static bool pni_sasl_is_final_input_state(pni_sasl_t *sasl) { enum pnx_sasl_state desired_state = sasl->desired_state; return desired_state==SASL_RECVED_OUTCOME_SUCCEED || desired_state==SASL_RECVED_OUTCOME_FAIL || desired_state==SASL_ERROR || desired_state==SASL_POSTED_OUTCOME; } static bool pni_sasl_is_final_output_state(pni_sasl_t *sasl) { enum pnx_sasl_state last_state = sasl->last_state; enum pnx_sasl_state desired_state = sasl->desired_state; return (desired_state==SASL_RECVED_OUTCOME_SUCCEED && last_state>=SASL_POSTED_INIT) || last_state==SASL_RECVED_OUTCOME_SUCCEED || last_state==SASL_RECVED_OUTCOME_FAIL || last_state==SASL_ERROR || last_state==SASL_POSTED_OUTCOME; } static void pni_emit(pn_transport_t *transport) { if (transport->connection && transport->connection->collector) { pn_collector_t *collector = transport->connection->collector; pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT); } } void pnx_sasl_set_desired_state(pn_transport_t *transport, enum pnx_sasl_state desired_state) { pni_sasl_t *sasl = transport->sasl; if (sasl->last_state > desired_state) { if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "Trying to send SASL frame (%d), but illegal: already in later state (%d)", desired_state, sasl->last_state); } else if (sasl->client && !pni_sasl_is_client_state(desired_state)) { if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "Trying to send server SASL frame (%d) on a client", desired_state); } else if (!sasl->client && !pni_sasl_is_server_state(desired_state)) { if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "Trying to send client SASL frame (%d) on a server", desired_state); } else { // If we need to repeat CHALLENGE or RESPONSE frames adjust current state to seem // like they haven't been sent yet if (sasl->last_state==desired_state && desired_state==SASL_POSTED_RESPONSE) { sasl->last_state = SASL_POSTED_INIT; } if (sasl->last_state==desired_state && desired_state==SASL_POSTED_CHALLENGE) { sasl->last_state = SASL_POSTED_MECHANISMS; } bool changed = sasl->desired_state != desired_state; sasl->desired_state = desired_state; // Don't emit transport event on error as there will be a TRANSPORT_ERROR event if (desired_state != SASL_ERROR && changed) pni_emit(transport); } } // Look for symbol in the mech include list - not particularly efficient, // but probably not used enough to matter. // // Note that if there is no inclusion list then every mech is implicitly included. static bool pni_sasl_included_mech(const char *included_mech_list, pn_bytes_t s) { if (!included_mech_list) return true; const char * end_list = included_mech_list+strlen(included_mech_list); size_t len = s.size; const char *c = included_mech_list; while (c!=NULL) { // If there are not enough chars left in the list no matches if ((ptrdiff_t)len > end_list-c) return false; // Is word equal with a space or end of string afterwards? if (pn_strncasecmp(c, s.start, len)==0 && (c[len]==' ' || c[len]==0) ) return true; c = strchr(c, ' '); c = c ? c+1 : NULL; } return false; } // Look for symbol in the mech include list - plugin API version // // Note that if there is no inclusion list then every mech is implicitly included. bool pnx_sasl_is_included_mech(pn_transport_t* transport, pn_bytes_t s) { return pni_sasl_included_mech(transport->sasl->included_mechanisms, s); } // This takes a space separated list and zero terminates it in place // whilst adding pointers to the existing strings in a string array. // This means that you can't free the original storage until you have // finished with the resulting list. static void pni_split_mechs(char *mechlist, const char* included_mechs, char *mechs[], int *count) { char *start = mechlist; char *end = start; while (*end) { if (*end == ' ') { if (start != end) { *end = '\0'; if (pni_sasl_included_mech(included_mechs, pn_bytes(end-start, start))) { mechs[(*count)++] = start; } } end++; start = end; } else { end++; } } if (start != end) { if (pni_sasl_included_mech(included_mechs, pn_bytes(end-start, start))) { mechs[(*count)++] = start; } } } // Post SASL frame static void pni_post_sasl_frame(pn_transport_t *transport) { pni_sasl_t *sasl = transport->sasl; pn_bytes_t out = sasl->bytes_out; enum pnx_sasl_state desired_state = sasl->desired_state; while (sasl->desired_state > sasl->last_state) { switch (desired_state) { case SASL_POSTED_INIT: pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[szS]", SASL_INIT, sasl->selected_mechanism, out.size, out.start, sasl->local_fqdn); pni_emit(transport); break; case SASL_POSTED_MECHANISMS: { // TODO: Hardcoded limit of 16 mechanisms char *mechs[16]; char *mechlist = pn_strdup(pni_sasl_impl_list_mechs(transport)); int count = 0; if (mechlist) { pni_split_mechs(mechlist, sasl->included_mechanisms, mechs, &count); } pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[@T[*s]]", SASL_MECHANISMS, PN_SYMBOL, count, mechs); free(mechlist); pni_emit(transport); break; } case SASL_POSTED_RESPONSE: if (sasl->last_state != SASL_POSTED_RESPONSE) { pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[Z]", SASL_RESPONSE, out.size, out.start); pni_emit(transport); } break; case SASL_POSTED_CHALLENGE: if (sasl->last_state < SASL_POSTED_MECHANISMS) { desired_state = SASL_POSTED_MECHANISMS; continue; } else if (sasl->last_state != SASL_POSTED_CHALLENGE) { pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[Z]", SASL_CHALLENGE, out.size, out.start); pni_emit(transport); } break; case SASL_POSTED_OUTCOME: if (sasl->last_state < SASL_POSTED_MECHANISMS) { desired_state = SASL_POSTED_MECHANISMS; continue; } pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[B]", SASL_OUTCOME, sasl->outcome); pni_emit(transport); if (sasl->outcome!=PN_SASL_OK) { pn_do_error(transport, "amqp:unauthorized-access", "Failed to authenticate client [mech=%s]", transport->sasl->selected_mechanism ? transport->sasl->selected_mechanism : "none"); desired_state = SASL_ERROR; } break; case SASL_RECVED_OUTCOME_SUCCEED: if (sasl->last_state < SASL_POSTED_INIT) { desired_state = SASL_POSTED_INIT; continue; } break; case SASL_RECVED_OUTCOME_FAIL: pn_do_error(transport, "amqp:unauthorized-access", "Authentication failed [mech=%s]", transport->sasl->selected_mechanism ? transport->sasl->selected_mechanism : "none"); desired_state = SASL_ERROR; break; case SASL_ERROR: break; case SASL_NONE: return; } sasl->last_state = desired_state; desired_state = sasl->desired_state; } } static void pn_error_sasl(pn_transport_t* transport, unsigned int layer) { transport->close_sent = true; pnx_sasl_set_desired_state(transport, SASL_ERROR); } static ssize_t pn_input_read_sasl_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available) { bool eos = pn_transport_capacity(transport)==PN_EOS; pni_protocol_type_t protocol = pni_sniff_header(bytes, available); switch (protocol) { case PNI_PROTOCOL_AMQP_SASL: if (transport->io_layers[layer] == &sasl_read_header_layer) { transport->io_layers[layer] = &sasl_layer; } else { transport->io_layers[layer] = &sasl_write_header_layer; } if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " <- %s", "SASL"); pni_sasl_set_external_security(transport, pn_ssl_get_ssf((pn_ssl_t*)transport), pn_ssl_get_remote_subject((pn_ssl_t*)transport)); return SASL_HEADER_LEN; case PNI_PROTOCOL_INSUFFICIENT: if (!eos) return 0; /* Fallthru */ default: break; } char quoted[1024]; pn_quote_data(quoted, 1024, bytes, available); pn_do_error(transport, "amqp:connection:framing-error", "%s header mismatch: %s ['%s']%s", "SASL", pni_protocol_name(protocol), quoted, !eos ? "" : " (connection aborted)"); pn_set_error_layer(transport); return PN_EOS; } static void pni_sasl_start_server_if_needed(pn_transport_t *transport) { pni_sasl_t *sasl = transport->sasl; if (!sasl->client && sasl->desired_statesasl; bool eos = pn_transport_capacity(transport)==PN_EOS; if (eos) { pn_do_error(transport, "amqp:connection:framing-error", "connection aborted"); pn_set_error_layer(transport); return PN_EOS; } pni_sasl_start_server_if_needed(transport); if (!pni_sasl_is_final_input_state(sasl)) { return pn_dispatcher_input(transport, bytes, available, false, &transport->halt); } if (!pni_sasl_is_final_output_state(sasl)) { return pni_passthru_layer.process_input(transport, layer, bytes, available); } if (pni_sasl_impl_can_encrypt(transport)) { sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport); if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "SASL Encryption enabled: buffer=%d", sasl->max_encrypt_size); transport->io_layers[layer] = &sasl_encrypt_layer; } else { transport->io_layers[layer] = &pni_passthru_layer; } return transport->io_layers[layer]->process_input(transport, layer, bytes, available); } static ssize_t pn_input_read_sasl_encrypt(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available) { pn_buffer_t *in = transport->sasl->decoded_buffer; const size_t max_buffer = transport->sasl->max_encrypt_size; for (size_t processed = 0; processed0) { size = pn_buffer_append(in, decoded.start, decoded.size); if (size) return size; } processed += decode_size; } pn_bytes_t decoded = pn_buffer_bytes(in); size_t processed_size = 0; while (processed_size < decoded.size) { ssize_t size = pni_passthru_layer.process_input(transport, layer, decoded.start+processed_size, decoded.size-processed_size); if (size==0) break; if (size<0) return size; pn_buffer_trim(in, size, 0); processed_size += size; } return available; } static ssize_t pn_output_write_sasl_header(pn_transport_t *transport, unsigned int layer, char *bytes, size_t size) { if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " -> %s", "SASL"); assert(size >= SASL_HEADER_LEN); memmove(bytes, SASL_HEADER, SASL_HEADER_LEN); if (transport->io_layers[layer]==&sasl_write_header_layer) { transport->io_layers[layer] = &sasl_layer; } else { transport->io_layers[layer] = &sasl_read_header_layer; } return SASL_HEADER_LEN; } static ssize_t pn_output_write_sasl(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available) { pni_sasl_t *sasl = transport->sasl; // this accounts for when pn_do_error is invoked, e.g. by idle timeout if (transport->close_sent) return PN_EOS; pni_sasl_start_server_if_needed(transport); pni_sasl_impl_prepare_write(transport); pni_post_sasl_frame(transport); if (pn_buffer_size(transport->output_buffer) != 0 || !pni_sasl_is_final_output_state(sasl)) { return pn_dispatcher_output(transport, bytes, available); } if (!pni_sasl_is_final_input_state(sasl)) { return pni_passthru_layer.process_output(transport, layer, bytes, available ); } // We only get here if there is nothing to output and we're in a final state if (sasl->outcome != PN_SASL_OK) { return PN_EOS; } // We know that auth succeeded or we're not in final input state if (pni_sasl_impl_can_encrypt(transport)) { sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport); if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "SASL Encryption enabled: buffer=%d", sasl->max_encrypt_size); transport->io_layers[layer] = &sasl_encrypt_layer; } else { transport->io_layers[layer] = &pni_passthru_layer; } return transport->io_layers[layer]->process_output(transport, layer, bytes, available); } static ssize_t pn_output_write_sasl_encrypt(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available) { ssize_t clear_size = pni_passthru_layer.process_output(transport, layer, bytes, available ); if (clear_size<0) return clear_size; const ssize_t max_buffer = transport->sasl->max_encrypt_size; pn_buffer_t *out = transport->sasl->encoded_buffer; for (ssize_t processed = 0; processed0) { size = pn_buffer_append(out, encoded.start, encoded.size); if (size) return size; } processed += encode_size; } ssize_t size = pn_buffer_get(out, 0, available, bytes); pn_buffer_trim(out, size, 0); return size; } pn_sasl_t *pn_sasl(pn_transport_t *transport) { if (!transport->sasl) { pni_sasl_t *sasl = (pni_sasl_t *) malloc(sizeof(pni_sasl_t)); sasl->impl_context = NULL; // Change this to just global_sasl_impl when we make cyrus opt in sasl->impl = global_sasl_impl ? global_sasl_impl : cyrus_sasl_impl ? cyrus_sasl_impl : &default_sasl_impl; sasl->client = !transport->server; sasl->selected_mechanism = NULL; sasl->included_mechanisms = NULL; sasl->username = NULL; sasl->password = NULL; sasl->remote_fqdn = NULL; sasl->local_fqdn = NULL; sasl->external_auth = NULL; sasl->external_ssf = 0; sasl->outcome = PN_SASL_NONE; sasl->decoded_buffer = pn_buffer(0); sasl->encoded_buffer = pn_buffer(0); sasl->bytes_out.size = 0; sasl->bytes_out.start = NULL; sasl->desired_state = SASL_NONE; sasl->last_state = SASL_NONE; sasl->allow_insecure_mechs = false; transport->sasl = sasl; } // The actual external pn_sasl_t pointer is a pointer to its enclosing pn_transport_t return (pn_sasl_t *)transport; } void pn_sasl_free(pn_transport_t *transport) { if (transport) { pni_sasl_t *sasl = transport->sasl; if (sasl) { free(sasl->selected_mechanism); free(sasl->included_mechanisms); free(sasl->password); free(sasl->external_auth); free(sasl->local_fqdn); if (sasl->impl_context) { pni_sasl_impl_free(transport); } pn_buffer_free(sasl->decoded_buffer); pn_buffer_free(sasl->encoded_buffer); free(sasl); } } } void pni_sasl_set_remote_hostname(pn_transport_t * transport, const char * fqdn) { pni_sasl_t *sasl = transport->sasl; sasl->remote_fqdn = fqdn; } void pnx_sasl_set_local_hostname(pn_transport_t * transport, const char * fqdn) { pni_sasl_t *sasl = transport->sasl; sasl->local_fqdn = pn_strdup(fqdn); } void pni_sasl_set_user_password(pn_transport_t *transport, const char *user, const char *password) { pni_sasl_t *sasl = transport->sasl; sasl->username = user; free(sasl->password); sasl->password = password ? pn_strdup(password) : NULL; } void pni_sasl_set_external_security(pn_transport_t *transport, int ssf, const char *authid) { pni_sasl_t *sasl = transport->sasl; sasl->external_ssf = ssf; free(sasl->external_auth); sasl->external_auth = authid ? pn_strdup(authid) : NULL; } const char *pn_sasl_get_user(pn_sasl_t *sasl0) { pni_sasl_t *sasl = get_sasl_internal(sasl0); return sasl->username; } const char *pn_sasl_get_mech(pn_sasl_t *sasl0) { pni_sasl_t *sasl = get_sasl_internal(sasl0); return sasl->selected_mechanism; } void pn_sasl_allowed_mechs(pn_sasl_t *sasl0, const char *mechs) { pni_sasl_t *sasl = get_sasl_internal(sasl0); free(sasl->included_mechanisms); sasl->included_mechanisms = mechs ? pn_strdup(mechs) : NULL; } void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl0, bool insecure) { pni_sasl_t *sasl = get_sasl_internal(sasl0); sasl->allow_insecure_mechs = insecure; } bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl0) { pni_sasl_t *sasl = get_sasl_internal(sasl0); return sasl->allow_insecure_mechs; } void pn_sasl_done(pn_sasl_t *sasl0, pn_sasl_outcome_t outcome) { pni_sasl_t *sasl = get_sasl_internal(sasl0); if (sasl) { sasl->outcome = outcome; } } pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl0) { pni_sasl_t *sasl = get_sasl_internal(sasl0); return sasl ? sasl->outcome : PN_SASL_NONE; } // Received Server side int pn_do_init(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pni_sasl_t *sasl = transport->sasl; pn_bytes_t mech; pn_bytes_t recv; int err = pn_data_scan(args, "D.[sz]", &mech, &recv); if (err) return err; sasl->selected_mechanism = pn_strndup(mech.start, mech.size); pni_sasl_impl_process_init(transport, sasl->selected_mechanism, &recv); return 0; } // Received client side int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pni_sasl_t *sasl = transport->sasl; // This scanning relies on pn_data_scan leaving the pn_data_t cursors // where they are after finishing the scan pn_string_t *mechs = pn_string(""); // Try array of symbols for mechanism list bool array = false; int err = pn_data_scan(args, "D.[?@[", &array); if (err) return err; if (array) { // Now keep checking for end of array and pull a symbol while(pn_data_next(args)) { pn_bytes_t s = pn_data_get_symbol(args); if (pnx_sasl_is_included_mech(transport, s)) { pn_string_addf(mechs, "%*s ", (int)s.size, s.start); } } if (pn_string_size(mechs)) { pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0; } } else { // No array of symbols; try single symbol pn_data_rewind(args); pn_bytes_t symbol; int err = pn_data_scan(args, "D.[s]", &symbol); if (err) return err; pn_string_setn(mechs, symbol.start, symbol.size); } if (!(pni_sasl_impl_init_client(transport) && pn_string_size(mechs) && pni_sasl_impl_process_mechanisms(transport, pn_string_get(mechs)))) { sasl->outcome = PN_SASL_PERM; pnx_sasl_set_desired_state(transport, SASL_RECVED_OUTCOME_FAIL); } pn_free(mechs); return 0; } // Received client side int pn_do_challenge(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_bytes_t recv; int err = pn_data_scan(args, "D.[z]", &recv); if (err) return err; pni_sasl_impl_process_challenge(transport, &recv); return 0; } // Received server side int pn_do_response(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_bytes_t recv; int err = pn_data_scan(args, "D.[z]", &recv); if (err) return err; pni_sasl_impl_process_response(transport, &recv); return 0; } // Received client side int pn_do_outcome(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { uint8_t outcome; int err = pn_data_scan(args, "D.[B]", &outcome); if (err) return err; pni_sasl_t *sasl = transport->sasl; sasl->outcome = (pn_sasl_outcome_t) outcome; bool authenticated = sasl->outcome==PN_SASL_OK; transport->authenticated = authenticated; pnx_sasl_set_desired_state(transport, authenticated ? SASL_RECVED_OUTCOME_SUCCEED : SASL_RECVED_OUTCOME_FAIL); pni_sasl_impl_process_outcome(transport); return 0; } qpid-proton-0.22.0/proton-c/src/sasl/sasl-internal.h0000664000000000000000000000401313257152177017166 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef PROTON_SASL_INTERNAL_H #define PROTON_SASL_INTERNAL_H 1 #include "core/buffer.h" #include "core/engine-internal.h" #include "proton/types.h" #include "proton/sasl.h" #include "proton/sasl-plugin.h" extern const pnx_sasl_implementation default_sasl_impl; extern const pnx_sasl_implementation * const cyrus_sasl_impl; // SASL APIs used by transport code void pn_sasl_free(pn_transport_t *transport); void pni_sasl_set_user_password(pn_transport_t *transport, const char *user, const char *password); void pni_sasl_set_remote_hostname(pn_transport_t *transport, const char* fqdn); void pni_sasl_set_external_security(pn_transport_t *transport, int ssf, const char *authid); struct pni_sasl_t { void *impl_context; const pnx_sasl_implementation* impl; char *selected_mechanism; char *included_mechanisms; const char *username; char *password; const char *remote_fqdn; char *local_fqdn; char *external_auth; int external_ssf; size_t max_encrypt_size; pn_buffer_t* decoded_buffer; pn_buffer_t* encoded_buffer; pn_bytes_t bytes_out; pn_sasl_outcome_t outcome; enum pnx_sasl_state desired_state; enum pnx_sasl_state last_state; bool allow_insecure_mechs; bool client; }; #endif /* sasl-internal.h */ qpid-proton-0.22.0/proton-c/src/sasl/default_sasl.c0000664000000000000000000002030313257152177017053 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/sasl.h" #include "proton/sasl-plugin.h" #include #include // SASL implementation interface static void default_sasl_prepare(pn_transport_t *transport); static void default_sasl_impl_free(pn_transport_t *transport); static const char *default_sasl_impl_list_mechs(pn_transport_t *transport); static bool default_sasl_init_server(pn_transport_t *transport); static void default_sasl_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv); static void default_sasl_process_response(pn_transport_t *transport, const pn_bytes_t *recv); static bool default_sasl_init_client(pn_transport_t *transport); static bool default_sasl_process_mechanisms(pn_transport_t *transport, const char *mechs); static void default_sasl_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv); static void default_sasl_process_outcome(pn_transport_t *transport); static bool default_sasl_impl_can_encrypt(pn_transport_t *transport); static ssize_t default_sasl_impl_max_encrypt_size(pn_transport_t *transport); static ssize_t default_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); static ssize_t default_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); extern const pnx_sasl_implementation default_sasl_impl; const pnx_sasl_implementation default_sasl_impl = { default_sasl_impl_free, default_sasl_impl_list_mechs, default_sasl_init_server, default_sasl_init_client, default_sasl_prepare, default_sasl_process_init, default_sasl_process_response, default_sasl_process_mechanisms, default_sasl_process_challenge, default_sasl_process_outcome, default_sasl_impl_can_encrypt, default_sasl_impl_max_encrypt_size, default_sasl_impl_encode, default_sasl_impl_decode }; static const char ANONYMOUS[] = "ANONYMOUS"; static const char EXTERNAL[] = "EXTERNAL"; static const char PLAIN[] = "PLAIN"; void default_sasl_prepare(pn_transport_t* transport) { } bool default_sasl_init_server(pn_transport_t* transport) { // Setup to send SASL mechanisms frame pnx_sasl_set_desired_state(transport, SASL_POSTED_MECHANISMS); return true; } bool default_sasl_init_client(pn_transport_t* transport) { return true; } void default_sasl_impl_free(pn_transport_t *transport) { free(pnx_sasl_get_context(transport)); } // Client handles ANONYMOUS or PLAIN mechanisms if offered bool default_sasl_process_mechanisms(pn_transport_t *transport, const char *mechs) { const char *username = pnx_sasl_get_username(transport); const char *password = pnx_sasl_get_password(transport); // Check whether offered EXTERNAL, PLAIN or ANONYMOUS // Look for "EXTERNAL" in mechs const char *found = strstr(mechs, EXTERNAL); // Make sure that string is separated and terminated and allowed if (found && (found==mechs || found[-1]==' ') && (found[8]==0 || found[8]==' ') && pnx_sasl_is_included_mech(transport, pn_bytes(8, found))) { pnx_sasl_set_selected_mechanism(transport, EXTERNAL); if (username) { size_t size = strlen(username); char *iresp = (char *) malloc(size); if (!iresp) return false; pnx_sasl_set_context(transport, iresp); memmove(iresp, username, size); pnx_sasl_set_bytes_out(transport, pn_bytes(size, iresp)); } else { static const char empty[] = ""; pnx_sasl_set_bytes_out(transport, pn_bytes(0, empty)); } pnx_sasl_set_desired_state(transport, SASL_POSTED_INIT); return true; } // Look for "PLAIN" in mechs found = strstr(mechs, PLAIN); // Make sure that string is separated and terminated, allowed // and we have a username and password and connection is encrypted or we allow insecure if (found && (found==mechs || found[-1]==' ') && (found[5]==0 || found[5]==' ') && pnx_sasl_is_included_mech(transport, pn_bytes(5, found)) && (pnx_sasl_is_transport_encrypted(transport) || pnx_sasl_get_allow_insecure_mechs(transport)) && username && password) { pnx_sasl_set_selected_mechanism(transport, PLAIN); size_t usize = strlen(username); size_t psize = strlen(password); size_t size = usize + psize + 2; char *iresp = (char *) malloc(size); if (!iresp) return false; pnx_sasl_set_context(transport, iresp); iresp[0] = 0; memmove(&iresp[1], username, usize); iresp[usize + 1] = 0; memmove(&iresp[usize + 2], password, psize); pnx_sasl_set_bytes_out(transport, pn_bytes(size, iresp)); // Zero out password and dealloc pnx_sasl_clear_password(transport); pnx_sasl_set_desired_state(transport, SASL_POSTED_INIT); return true; } // Look for "ANONYMOUS" in mechs found = strstr(mechs, ANONYMOUS); // Make sure that string is separated and terminated and allowed if (found && (found==mechs || found[-1]==' ') && (found[9]==0 || found[9]==' ') && pnx_sasl_is_included_mech(transport, pn_bytes(9, found))) { pnx_sasl_set_selected_mechanism(transport, ANONYMOUS); if (username) { size_t size = strlen(username); char *iresp = (char *) malloc(size); if (!iresp) return false; pnx_sasl_set_context(transport, iresp); memmove(iresp, username, size); pnx_sasl_set_bytes_out(transport, pn_bytes(size, iresp)); } else { static const char anon[] = "anonymous"; pnx_sasl_set_bytes_out(transport, pn_bytes(sizeof anon-1, anon)); } pnx_sasl_set_desired_state(transport, SASL_POSTED_INIT); return true; } return false; } // Server will offer only ANONYMOUS and EXTERNAL if appropriate const char *default_sasl_impl_list_mechs(pn_transport_t *transport) { // If we have an external authid then we can offer EXTERNAL if (pnx_sasl_get_external_username(transport)) { return "EXTERNAL ANONYMOUS"; } else { return "ANONYMOUS"; } } void default_sasl_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv) { // Check that mechanism is ANONYMOUS and it is allowed if (strcmp(mechanism, ANONYMOUS)==0 && pnx_sasl_is_included_mech(transport, pn_bytes(sizeof(ANONYMOUS)-1, ANONYMOUS))) { pnx_sasl_succeed_authentication(transport, "anonymous"); pnx_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME); return; } // Or maybe EXTERNAL const char *ext_username = pnx_sasl_get_external_username(transport); if (strcmp(mechanism, EXTERNAL)==0 && pnx_sasl_is_included_mech(transport, pn_bytes(sizeof(EXTERNAL)-1, EXTERNAL)) && ext_username) { pnx_sasl_succeed_authentication(transport, ext_username); pnx_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME); return; } // Otherwise authentication failed pnx_sasl_fail_authentication(transport); pnx_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME); } /* The default implementation neither sends nor receives challenges or responses */ void default_sasl_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv) { } void default_sasl_process_response(pn_transport_t *transport, const pn_bytes_t *recv) { } void default_sasl_process_outcome(pn_transport_t* transport) { } bool default_sasl_impl_can_encrypt(pn_transport_t *transport) { return false; } ssize_t default_sasl_impl_max_encrypt_size(pn_transport_t *transport) { return 0; } ssize_t default_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { return 0; } ssize_t default_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { return 0; } qpid-proton-0.22.0/proton-c/src/sasl/cyrus_stub.c0000664000000000000000000000223213257152177016610 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/sasl.h" #include "proton/sasl-plugin.h" extern const pnx_sasl_implementation * const cyrus_sasl_impl; const pnx_sasl_implementation * const cyrus_sasl_impl = NULL; bool pn_sasl_extended(void) { return false; } void pn_sasl_config_name(pn_sasl_t *sasl0, const char *name) { } void pn_sasl_config_path(pn_sasl_t *sasl0, const char *dir) { } qpid-proton-0.22.0/proton-c/src/sasl/cyrus_sasl.c0000664000000000000000000005016513257152177016605 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "proton/sasl.h" #include "proton/sasl-plugin.h" #include "proton/transport.h" #include #include #include #include #include #ifndef CYRUS_SASL_MAX_BUFFSIZE # define CYRUS_SASL_MAX_BUFFSIZE (32768) /* bytes */ #endif // SASL implementation entry points static void cyrus_sasl_prepare(pn_transport_t *transport); static void cyrus_sasl_free(pn_transport_t *transport); static const char *cyrus_sasl_list_mechs(pn_transport_t *transport); static bool cyrus_sasl_init_server(pn_transport_t *transport); static void cyrus_sasl_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv); static void cyrus_sasl_process_response(pn_transport_t *transport, const pn_bytes_t *recv); static bool cyrus_sasl_init_client(pn_transport_t *transport); static bool cyrus_sasl_process_mechanisms(pn_transport_t *transport, const char *mechs); static void cyrus_sasl_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv); static void cyrus_sasl_process_outcome(pn_transport_t *transport); static bool cyrus_sasl_can_encrypt(pn_transport_t *transport); static ssize_t cyrus_sasl_max_encrypt_size(pn_transport_t *transport); static ssize_t cyrus_sasl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); static ssize_t cyrus_sasl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); static const pnx_sasl_implementation sasl_impl = { cyrus_sasl_free, cyrus_sasl_list_mechs, cyrus_sasl_init_server, cyrus_sasl_init_client, cyrus_sasl_prepare, cyrus_sasl_process_init, cyrus_sasl_process_response, cyrus_sasl_process_mechanisms, cyrus_sasl_process_challenge, cyrus_sasl_process_outcome, cyrus_sasl_can_encrypt, cyrus_sasl_max_encrypt_size, cyrus_sasl_encode, cyrus_sasl_decode }; extern const pnx_sasl_implementation * const cyrus_sasl_impl; const pnx_sasl_implementation * const cyrus_sasl_impl = &sasl_impl; // If the version of Cyrus SASL is too early for sasl_client_done()/sasl_server_done() // don't do any global clean up as it's not safe to use just sasl_done() for an // executable that uses both client and server parts of Cyrus SASL, because it can't // be called twice. #if SASL_VERSION_FULL<0x020118 # define sasl_client_done() # define sasl_server_done() #endif static const char *amqp_service = "amqp"; static inline bool pni_check_result(sasl_conn_t *conn, int r, pn_transport_t *logger, const char* condition_name) { if (r==SASL_OK) return true; const char* err = conn ? sasl_errdetail(conn) : sasl_errstring(r, NULL, NULL); pnx_sasl_logf(logger, "sasl error: %s", err); pn_condition_t* c = pn_transport_condition(logger); pn_condition_set_name(c, condition_name); pn_condition_set_description(c, err); return false; } static bool pni_check_io_result(sasl_conn_t *conn, int r, pn_transport_t *logger) { return pni_check_result(conn, r, logger, "proton:io:sasl_error"); } static bool pni_check_sasl_result(sasl_conn_t *conn, int r, pn_transport_t *logger) { return pni_check_result(conn, r, logger, "amqp:unauthorized-access"); } // Cyrus wrappers static void pni_cyrus_interact(pn_transport_t *transport, sasl_interact_t *interact) { for (sasl_interact_t *i = interact; i->id!=SASL_CB_LIST_END; i++) { switch (i->id) { case SASL_CB_USER: i->result = 0; i->len = 0; break; case SASL_CB_AUTHNAME: { const char *username = pnx_sasl_get_username(transport); i->result = username; i->len = strlen(username); break; } case SASL_CB_PASS: { const char *password = pnx_sasl_get_password(transport); i->result = password; i->len = strlen(password); break; } default: fprintf(stderr, "(%s): %s - %s\n", i->challenge, i->prompt, i->defresult); } } } const char *cyrus_sasl_list_mechs(pn_transport_t *transport) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); if (!cyrus_conn) return NULL; int count = 0; const char *result = NULL; int r = sasl_listmech(cyrus_conn, NULL, "", " ", "", &result, NULL, &count); pni_check_sasl_result(cyrus_conn, r, transport); return result; } // Set up callbacks to use interact static const sasl_callback_t pni_user_password_callbacks[] = { {SASL_CB_USER, NULL, NULL}, {SASL_CB_AUTHNAME, NULL, NULL}, {SASL_CB_PASS, NULL, NULL}, {SASL_CB_LIST_END, NULL, NULL}, }; static const sasl_callback_t pni_user_callbacks[] = { {SASL_CB_USER, NULL, NULL}, {SASL_CB_AUTHNAME, NULL, NULL}, {SASL_CB_LIST_END, NULL, NULL}, }; // Machinery to initialise the cyrus library only once even in a multithreaded environment // Relies on pthreads. static const char * const default_config_name = "proton-server"; static char *pni_cyrus_config_dir = NULL; static char *pni_cyrus_config_name = NULL; static pthread_mutex_t pni_cyrus_mutex = PTHREAD_MUTEX_INITIALIZER; static bool pni_cyrus_client_started = false; static bool pni_cyrus_server_started = false; bool pn_sasl_extended(void) { return true; } void pn_sasl_config_name(pn_sasl_t *sasl0, const char *name) { if (!pni_cyrus_config_name) { pni_cyrus_config_name = strdup(name); } } void pn_sasl_config_path(pn_sasl_t *sasl0, const char *dir) { if (!pni_cyrus_config_dir) { pni_cyrus_config_dir = strdup(dir); } } __attribute__((destructor)) static void pni_cyrus_finish(void) { pthread_mutex_lock(&pni_cyrus_mutex); if (pni_cyrus_client_started) sasl_client_done(); if (pni_cyrus_server_started) sasl_server_done(); free(pni_cyrus_config_dir); free(pni_cyrus_config_name); pthread_mutex_unlock(&pni_cyrus_mutex); } static int pni_cyrus_client_init_rc = SASL_OK; static void pni_cyrus_client_once(void) { pthread_mutex_lock(&pni_cyrus_mutex); int result = SASL_OK; if (pni_cyrus_config_dir) { result = sasl_set_path(SASL_PATH_TYPE_CONFIG, pni_cyrus_config_dir); } else { char *config_dir = getenv("PN_SASL_CONFIG_PATH"); if (config_dir) { result = sasl_set_path(SASL_PATH_TYPE_CONFIG, config_dir); } } if (result==SASL_OK) { result = sasl_client_init(NULL); } pni_cyrus_client_started = true; pni_cyrus_client_init_rc = result; pthread_mutex_unlock(&pni_cyrus_mutex); } static int pni_cyrus_server_init_rc = SASL_OK; static void pni_cyrus_server_once(void) { pthread_mutex_lock(&pni_cyrus_mutex); int result = SASL_OK; if (pni_cyrus_config_dir) { result = sasl_set_path(SASL_PATH_TYPE_CONFIG, pni_cyrus_config_dir); } else { char *config_dir = getenv("PN_SASL_CONFIG_PATH"); if (config_dir) { result = sasl_set_path(SASL_PATH_TYPE_CONFIG, config_dir); } } if (result==SASL_OK) { result = sasl_server_init(NULL, pni_cyrus_config_name ? pni_cyrus_config_name : default_config_name); } pni_cyrus_server_started = true; pni_cyrus_server_init_rc = result; pthread_mutex_unlock(&pni_cyrus_mutex); } static pthread_once_t pni_cyrus_client_init = PTHREAD_ONCE_INIT; static void pni_cyrus_client_start(void) { pthread_once(&pni_cyrus_client_init, pni_cyrus_client_once); } static pthread_once_t pni_cyrus_server_init = PTHREAD_ONCE_INIT; static void pni_cyrus_server_start(void) { pthread_once(&pni_cyrus_server_init, pni_cyrus_server_once); } void cyrus_sasl_prepare(pn_transport_t* transport) { } bool cyrus_sasl_init_client(pn_transport_t* transport) { int result; sasl_conn_t *cyrus_conn = NULL; do { pni_cyrus_client_start(); result = pni_cyrus_client_init_rc; if (result!=SASL_OK) break; const sasl_callback_t *callbacks = pnx_sasl_get_username(transport) ? pnx_sasl_get_password(transport) ? pni_user_password_callbacks : pni_user_callbacks : NULL; result = sasl_client_new(amqp_service, pnx_sasl_get_remote_fqdn(transport), NULL, NULL, callbacks, 0, &cyrus_conn); if (result!=SASL_OK) break; pnx_sasl_set_context(transport, cyrus_conn); sasl_security_properties_t secprops = {0}; secprops.security_flags = ( pnx_sasl_get_allow_insecure_mechs(transport) ? 0 : SASL_SEC_NOPLAINTEXT ) | ( pnx_sasl_get_auth_required(transport) ? SASL_SEC_NOANONYMOUS : 0 ) ; secprops.min_ssf = 0; secprops.max_ssf = 2048; secprops.maxbufsize = CYRUS_SASL_MAX_BUFFSIZE; result = sasl_setprop(cyrus_conn, SASL_SEC_PROPS, &secprops); if (result!=SASL_OK) break; sasl_ssf_t ssf = pnx_sasl_get_external_ssf(transport); result = sasl_setprop(cyrus_conn, SASL_SSF_EXTERNAL, &ssf); if (result!=SASL_OK) break; const char *extid = pnx_sasl_get_external_username(transport); if (extid) { result = sasl_setprop(cyrus_conn, SASL_AUTH_EXTERNAL, extid); } } while (false); cyrus_conn = (sasl_conn_t*) pnx_sasl_get_context(transport); return pni_check_sasl_result(cyrus_conn, result, transport); } static int pni_wrap_client_start(pn_transport_t *transport, const char *mechs, const char **mechusing) { int result; sasl_interact_t *client_interact=NULL; const char *out; unsigned outlen; sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); do { result = sasl_client_start(cyrus_conn, mechs, &client_interact, &out, &outlen, mechusing); if (result==SASL_INTERACT) { pni_cyrus_interact(transport, client_interact); } } while (result==SASL_INTERACT); pnx_sasl_set_bytes_out(transport, pn_bytes(outlen, out)); return result; } bool cyrus_sasl_process_mechanisms(pn_transport_t *transport, const char *mechs) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); const char *mech_selected; int result = pni_wrap_client_start(transport, mechs, &mech_selected); switch (result) { case SASL_OK: case SASL_CONTINUE: pnx_sasl_set_selected_mechanism(transport, mech_selected); pnx_sasl_set_desired_state(transport, SASL_POSTED_INIT); return true; case SASL_NOMECH: default: pni_check_sasl_result(cyrus_conn, result, transport); return false; } } static int pni_wrap_client_step(pn_transport_t *transport, const pn_bytes_t *in) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); sasl_interact_t *client_interact=NULL; const char *out; unsigned outlen; int result; do { result = sasl_client_step(cyrus_conn, in->start, in->size, &client_interact, &out, &outlen); if (result==SASL_INTERACT) { pni_cyrus_interact(transport, client_interact); } } while (result==SASL_INTERACT); pnx_sasl_set_bytes_out(transport, pn_bytes(outlen, out)); return result; } void cyrus_sasl_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); int result = pni_wrap_client_step(transport, recv); switch (result) { case SASL_OK: // Authenticated // TODO: Documented that we need to call sasl_client_step() again to be sure!; case SASL_CONTINUE: // Need to send a response pnx_sasl_set_desired_state(transport, SASL_POSTED_RESPONSE); break; default: pni_check_sasl_result(cyrus_conn, result, transport); // Failed somehow - equivalent to failing authentication pnx_sasl_fail_authentication(transport); pnx_sasl_set_desired_state(transport, SASL_RECVED_OUTCOME_FAIL); break; } } void cyrus_sasl_process_outcome(pn_transport_t* transport) { } bool cyrus_sasl_init_server(pn_transport_t* transport) { int result; sasl_conn_t *cyrus_conn = NULL; do { pni_cyrus_server_start(); result = pni_cyrus_server_init_rc; if (result!=SASL_OK) break; result = sasl_server_new(amqp_service, NULL, NULL, NULL, NULL, NULL, 0, &cyrus_conn); if (result!=SASL_OK) break; pnx_sasl_set_context(transport, cyrus_conn); sasl_security_properties_t secprops = {0}; secprops.security_flags = ( pnx_sasl_get_allow_insecure_mechs(transport) ? 0 : SASL_SEC_NOPLAINTEXT ) | ( pnx_sasl_get_auth_required(transport) ? SASL_SEC_NOANONYMOUS : 0 ) ; secprops.min_ssf = 0; secprops.max_ssf = 2048; secprops.maxbufsize = CYRUS_SASL_MAX_BUFFSIZE; result = sasl_setprop(cyrus_conn, SASL_SEC_PROPS, &secprops); if (result!=SASL_OK) break; sasl_ssf_t ssf = pnx_sasl_get_external_ssf(transport); result = sasl_setprop(cyrus_conn, SASL_SSF_EXTERNAL, &ssf); if (result!=SASL_OK) break; const char *extid = pnx_sasl_get_external_username(transport); if (extid) { result = sasl_setprop(cyrus_conn, SASL_AUTH_EXTERNAL, extid); } } while (false); cyrus_conn = (sasl_conn_t*) pnx_sasl_get_context(transport); if (pni_check_sasl_result(cyrus_conn, result, transport)) { // Setup to send SASL mechanisms frame pnx_sasl_set_desired_state(transport, SASL_POSTED_MECHANISMS); return true; } else { return false; } } static int pni_wrap_server_start(pn_transport_t *transport, const char *mech_selected, const pn_bytes_t *in) { int result; const char *out; unsigned outlen; sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); const char *in_bytes = in->start; size_t in_size = in->size; // Interop hack for ANONYMOUS - some of the earlier versions of proton will send and no data // with an anonymous init because it is optional. It seems that Cyrus wants an empty string here // or it will challenge, which the earlier implementation is not prepared for. // However we can't just always use an empty string as the CRAM-MD5 mech won't allow any data in the server start if (!in_bytes && strcmp(mech_selected, "ANONYMOUS")==0) { in_bytes = ""; in_size = 0; } else if (in_bytes && strcmp(mech_selected, "CRAM-MD5")==0) { in_bytes = 0; in_size = 0; } result = sasl_server_start(cyrus_conn, mech_selected, in_bytes, in_size, &out, &outlen); pnx_sasl_set_bytes_out(transport, pn_bytes(outlen, out)); return result; } static void pni_process_server_result(pn_transport_t *transport, int result) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); switch (result) { case SASL_OK: { // Authenticated // Get username from SASL const void* value; sasl_getprop(cyrus_conn, SASL_USERNAME, &value); pnx_sasl_succeed_authentication(transport, (const char*) value); pnx_sasl_logf(transport, "Authenticated user: %s with mechanism %s", pnx_sasl_get_username(transport), pnx_sasl_get_selected_mechanism(transport)); pnx_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME); break; } case SASL_CONTINUE: // Need to send a challenge pnx_sasl_set_desired_state(transport, SASL_POSTED_CHALLENGE); break; default: pni_check_sasl_result(cyrus_conn, result, transport); // Failed to authenticate pnx_sasl_fail_authentication(transport); pnx_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME); break; } } void cyrus_sasl_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv) { int result = pni_wrap_server_start(transport, mechanism, recv); if (result==SASL_OK) { // We need to filter out a supplied mech in in the inclusion list // as the client could have used a mech that we support, but that // wasn't on the list we sent. if (!pnx_sasl_is_included_mech(transport, pn_bytes(strlen(mechanism), mechanism))) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); sasl_seterror(cyrus_conn, 0, "Client mechanism not in mechanism inclusion list."); result = SASL_FAIL; } } pni_process_server_result(transport, result); } static int pni_wrap_server_step(pn_transport_t *transport, const pn_bytes_t *in) { int result; const char *out; unsigned outlen; sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); result = sasl_server_step(cyrus_conn, in->start, in->size, &out, &outlen); pnx_sasl_set_bytes_out(transport, pn_bytes(outlen, out)); return result; } void cyrus_sasl_process_response(pn_transport_t *transport, const pn_bytes_t *recv) { int result = pni_wrap_server_step(transport, recv); pni_process_server_result(transport, result); } bool cyrus_sasl_can_encrypt(pn_transport_t *transport) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); if (!cyrus_conn) return false; // Get SSF to find out if we need to encrypt or not const void* value; int r = sasl_getprop(cyrus_conn, SASL_SSF, &value); if (r != SASL_OK) { // TODO: Should log an error here too, maybe assert here return false; } int ssf = *(int *) value; if (ssf > 0) { return true; } return false; } ssize_t cyrus_sasl_max_encrypt_size(pn_transport_t *transport) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); if (!cyrus_conn) return PN_ERR; const void* value; int r = sasl_getprop(cyrus_conn, SASL_MAXOUTBUF, &value); if (r != SASL_OK) { // TODO: Should log an error here too, maybe assert here return PN_ERR; } int outbuf_size = *(int *) value; return outbuf_size - // XXX: this is a clientside workaround/hack to make GSSAPI work as the Cyrus SASL // GSSAPI plugin seems to return an incorrect value for the buffer size on the client // side, which is greater than the value returned on the server side. Actually using // the entire client side buffer will cause a server side error due to a buffer overrun. (pnx_sasl_is_client(transport)? 60 : 0); } ssize_t cyrus_sasl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { if ( in.size==0 ) return 0; sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); const char *output; unsigned int outlen; int r = sasl_encode(cyrus_conn, in.start, in.size, &output, &outlen); if (outlen==0) return 0; if ( pni_check_io_result(cyrus_conn, r, transport) ) { *out = pn_bytes(outlen, output); return outlen; } return PN_ERR; } ssize_t cyrus_sasl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out) { if ( in.size==0 ) return 0; sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); const char *output; unsigned int outlen; int r = sasl_decode(cyrus_conn, in.start, in.size, &output, &outlen); if (outlen==0) return 0; if ( pni_check_io_result(cyrus_conn, r, transport) ) { *out = pn_bytes(outlen, output); return outlen; } return PN_ERR; } void cyrus_sasl_free(pn_transport_t *transport) { sasl_conn_t *cyrus_conn = (sasl_conn_t*)pnx_sasl_get_context(transport); sasl_dispose(&cyrus_conn); pnx_sasl_set_context(transport, cyrus_conn); } qpid-proton-0.22.0/proton-c/src/reactor/0000775000000000000000000000000013257152177014740 5ustar qpid-proton-0.22.0/proton-c/src/reactor/timer.c0000664000000000000000000001015113257152177016222 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include struct pn_task_t { pn_list_t *pool; pn_record_t *attachments; pn_timestamp_t deadline; bool cancelled; }; void pn_task_initialize(pn_task_t *task) { task->pool = NULL; task->attachments = pn_record(); task->deadline = 0; task->cancelled = false; } void pn_task_finalize(pn_task_t *task) { // if we are the last reference to the pool then don't put ourselves // into it if (task->pool && pn_refcount(task->pool) > 1) { pn_record_clear(task->attachments); pn_list_add(task->pool, task); pn_decref(task->pool); task->pool = NULL; } else { pn_decref(task->pool); pn_decref(task->attachments); } } intptr_t pn_task_compare(pn_task_t *a, pn_task_t *b) { return a->deadline - b->deadline; } #define pn_task_inspect NULL #define pn_task_hashcode NULL PN_CLASSDEF(pn_task) pn_task_t *pn_task(void) { pn_task_t *task = pn_task_new(); return task; } pn_record_t *pn_task_attachments(pn_task_t *task) { assert(task); return task->attachments; } void pn_task_cancel(pn_task_t *task) { assert(task); task->cancelled = true; } // // timer // struct pn_timer_t { pn_list_t *pool; pn_list_t *tasks; pn_collector_t *collector; }; static void pn_timer_initialize(pn_timer_t *timer) { timer->pool = pn_list(PN_OBJECT, 0); timer->tasks = pn_list(PN_OBJECT, 0); } static void pn_timer_finalize(pn_timer_t *timer) { pn_decref(timer->pool); pn_free(timer->tasks); } #define pn_timer_inspect NULL #define pn_timer_compare NULL #define pn_timer_hashcode NULL PN_CLASSDEF(pn_timer) pn_timer_t *pn_timer(pn_collector_t *collector) { pn_timer_t *timer = pn_timer_new(); timer->collector = collector; return timer; } pn_task_t *pn_timer_schedule(pn_timer_t *timer, pn_timestamp_t deadline) { pn_task_t *task = (pn_task_t *) pn_list_pop(timer->pool); if (!task) { task = pn_task(); } task->pool = timer->pool; pn_incref(task->pool); task->deadline = deadline; task->cancelled = false; pn_list_minpush(timer->tasks, task); pn_decref(task); return task; } void pni_timer_flush_cancelled(pn_timer_t *timer) { while (pn_list_size(timer->tasks)) { pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0); if (task->cancelled) { pn_task_t *min = (pn_task_t *) pn_list_minpop(timer->tasks); assert(min == task); pn_decref(min); } else { break; } } } pn_timestamp_t pn_timer_deadline(pn_timer_t *timer) { assert(timer); pni_timer_flush_cancelled(timer); if (pn_list_size(timer->tasks)) { pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0); return task->deadline; } else { return 0; } } void pn_timer_tick(pn_timer_t *timer, pn_timestamp_t now) { assert(timer); while (pn_list_size(timer->tasks)) { pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0); if (now >= task->deadline) { pn_task_t *min = (pn_task_t *) pn_list_minpop(timer->tasks); assert(min == task); if (!min->cancelled) pn_collector_put(timer->collector, PN_OBJECT, min, PN_TIMER_TASK); pn_decref(min); } else { break; } } } int pn_timer_tasks(pn_timer_t *timer) { assert(timer); pni_timer_flush_cancelled(timer); return pn_list_size(timer->tasks); } qpid-proton-0.22.0/proton-c/src/reactor/selector.h0000664000000000000000000000361313257152177016734 0ustar #ifndef PROTON_SELECTOR_H #define PROTON_SELECTOR_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #define PN_READABLE (1) #define PN_WRITABLE (2) #define PN_EXPIRED (4) #define PN_ERROR (8) /** * A ::pn_selector_t provides a selection mechanism that allows * efficient monitoring of a large number of Proton connections and * listeners. * * External (non-Proton) sockets may also be monitored, either solely * for event notification (read, write, and timer) or event * notification and use with pn_io_t interfaces. */ typedef struct pn_selector_t pn_selector_t; pn_selector_t *pni_selector(void); void pn_selector_free(pn_selector_t *selector); void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable); void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable); void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable); size_t pn_selector_size(pn_selector_t *selector); int pn_selector_select(pn_selector_t *select, int timeout); pn_selectable_t *pn_selector_next(pn_selector_t *select, int *events); #endif /* selector.h */ qpid-proton-0.22.0/proton-c/src/reactor/selectable.h0000664000000000000000000000235613257152177017222 0ustar #ifndef _PROTON_SRC_SELECTABLE_H #define _PROTON_SRC_SELECTABLE_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef __cplusplus #include #endif #include void *pni_selectable_get_context(pn_selectable_t *selectable); void pni_selectable_set_context(pn_selectable_t *selectable, void *context); int pni_selectable_get_index(pn_selectable_t *selectable); void pni_selectable_set_index(pn_selectable_t *selectable, int index); #endif /* selectable.h */ qpid-proton-0.22.0/proton-c/src/reactor/selectable.c0000664000000000000000000001603013257152177017207 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "selectable.h" #include #include "io.h" #include #include pn_selectables_t *pn_selectables(void) { return pn_iterator(); } pn_selectable_t *pn_selectables_next(pn_selectables_t *selectables) { return (pn_selectable_t *) pn_iterator_next(selectables); } void pn_selectables_free(pn_selectables_t *selectables) { pn_free(selectables); } struct pn_selectable_t { pn_socket_t fd; int index; pn_record_t *attachments; void (*readable)(pn_selectable_t *); void (*writable)(pn_selectable_t *); void (*error)(pn_selectable_t *); void (*expired)(pn_selectable_t *); void (*release) (pn_selectable_t *); void (*finalize)(pn_selectable_t *); pn_collector_t *collector; pn_timestamp_t deadline; bool reading; bool writing; bool registered; bool terminal; }; void pn_selectable_initialize(pn_selectable_t *sel) { sel->fd = PN_INVALID_SOCKET; sel->index = -1; sel->attachments = pn_record(); sel->readable = NULL; sel->writable = NULL; sel->error = NULL; sel->expired = NULL; sel->release = NULL; sel->finalize = NULL; sel->collector = NULL; sel->deadline = 0; sel->reading = false; sel->writing = false; sel->registered = false; sel->terminal = false; } void pn_selectable_finalize(pn_selectable_t *sel) { if (sel->finalize) { sel->finalize(sel); } pn_decref(sel->attachments); pn_decref(sel->collector); } #define pn_selectable_hashcode NULL #define pn_selectable_inspect NULL #define pn_selectable_compare NULL PN_CLASSDEF(pn_selectable) pn_selectable_t *pn_selectable(void) { return pn_selectable_new(); } bool pn_selectable_is_reading(pn_selectable_t *sel) { assert(sel); return sel->reading; } void pn_selectable_set_reading(pn_selectable_t *sel, bool reading) { assert(sel); sel->reading = reading; } bool pn_selectable_is_writing(pn_selectable_t *sel) { assert(sel); return sel->writing; } void pn_selectable_set_writing(pn_selectable_t *sel, bool writing) { assert(sel); sel->writing = writing; } pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *sel) { assert(sel); return sel->deadline; } void pn_selectable_set_deadline(pn_selectable_t *sel, pn_timestamp_t deadline) { assert(sel); sel->deadline = deadline; } void pn_selectable_on_readable(pn_selectable_t *sel, void (*readable)(pn_selectable_t *)) { assert(sel); sel->readable = readable; } void pn_selectable_on_writable(pn_selectable_t *sel, void (*writable)(pn_selectable_t *)) { assert(sel); sel->writable = writable; } void pn_selectable_on_error(pn_selectable_t *sel, void (*error)(pn_selectable_t *)) { assert(sel); sel->error = error; } void pn_selectable_on_expired(pn_selectable_t *sel, void (*expired)(pn_selectable_t *)) { assert(sel); sel->expired = expired; } void pn_selectable_on_release(pn_selectable_t *sel, void (*release)(pn_selectable_t *)) { assert(sel); sel->release = release; } void pn_selectable_on_finalize(pn_selectable_t *sel, void (*finalize)(pn_selectable_t *)) { assert(sel); sel->finalize = finalize; } pn_record_t *pn_selectable_attachments(pn_selectable_t *sel) { return sel->attachments; } void *pni_selectable_get_context(pn_selectable_t *selectable) { assert(selectable); return pn_record_get(selectable->attachments, PN_LEGCTX); } void pni_selectable_set_context(pn_selectable_t *selectable, void *context) { assert(selectable); pn_record_set(selectable->attachments, PN_LEGCTX, context); } int pni_selectable_get_index(pn_selectable_t *selectable) { assert(selectable); return selectable->index; } void pni_selectable_set_index(pn_selectable_t *selectable, int index) { assert(selectable); selectable->index = index; } pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable) { assert(selectable); return selectable->fd; } void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd) { assert(selectable); selectable->fd = fd; } void pn_selectable_readable(pn_selectable_t *selectable) { assert(selectable); if (selectable->readable) { selectable->readable(selectable); } } void pn_selectable_writable(pn_selectable_t *selectable) { assert(selectable); if (selectable->writable) { selectable->writable(selectable); } } void pn_selectable_error(pn_selectable_t *selectable) { assert(selectable); if (selectable->error) { selectable->error(selectable); } } void pn_selectable_expired(pn_selectable_t *selectable) { assert(selectable); if (selectable->expired) { selectable->expired(selectable); } } bool pn_selectable_is_registered(pn_selectable_t *selectable) { assert(selectable); return selectable->registered; } void pn_selectable_set_registered(pn_selectable_t *selectable, bool registered) { assert(selectable); selectable->registered = registered; } bool pn_selectable_is_terminal(pn_selectable_t *selectable) { assert(selectable); return selectable->terminal; } void pn_selectable_terminate(pn_selectable_t *selectable) { assert(selectable); selectable->terminal = true; } void pn_selectable_release(pn_selectable_t *selectable) { assert(selectable); if (selectable->release) { selectable->release(selectable); } } void pn_selectable_free(pn_selectable_t *selectable) { pn_decref(selectable); } static void pni_readable(pn_selectable_t *selectable) { pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_READABLE); } static void pni_writable(pn_selectable_t *selectable) { pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_WRITABLE); } static void pni_error(pn_selectable_t *selectable) { pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_ERROR); } static void pni_expired(pn_selectable_t *selectable) { pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_EXPIRED); } void pn_selectable_collect(pn_selectable_t *selectable, pn_collector_t *collector) { assert(selectable); pn_decref(selectable->collector); selectable->collector = collector; pn_incref(selectable->collector); if (collector) { pn_selectable_on_readable(selectable, pni_readable); pn_selectable_on_writable(selectable, pni_writable); pn_selectable_on_error(selectable, pni_error); pn_selectable_on_expired(selectable, pni_expired); } } qpid-proton-0.22.0/proton-c/src/reactor/reactor.h0000664000000000000000000000240213257152177016546 0ustar #ifndef _PROTON_SRC_REACTOR_H #define _PROTON_SRC_REACTOR_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor); void pni_reactor_set_connection_peer_address(pn_connection_t *connection, const char *host, const char *port); pn_io_t *pni_reactor_io(pn_reactor_t *reactor); #endif /* src/reactor.h */ qpid-proton-0.22.0/proton-c/src/reactor/reactor.c0000664000000000000000000003464413257152177016556 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "io.h" #include "reactor.h" #include "selectable.h" #include "platform/platform.h" // pn_i_now #include #include #include #include #include #include #include #include #include #include #include struct pn_reactor_t { pn_record_t *attachments; pn_io_t *io; pn_collector_t *collector; pn_handler_t *global; pn_handler_t *handler; pn_list_t *children; pn_timer_t *timer; pn_socket_t wakeup[2]; pn_selectable_t *selectable; pn_event_type_t previous; pn_timestamp_t now; int selectables; int timeout; bool yield; bool stop; }; pn_timestamp_t pn_reactor_mark(pn_reactor_t *reactor) { assert(reactor); reactor->now = pn_i_now(); return reactor->now; } pn_timestamp_t pn_reactor_now(pn_reactor_t *reactor) { assert(reactor); return reactor->now; } static void pn_reactor_initialize(pn_reactor_t *reactor) { reactor->attachments = pn_record(); reactor->io = pn_io(); reactor->collector = pn_collector(); reactor->global = pn_iohandler(); reactor->handler = pn_handler(NULL); reactor->children = pn_list(PN_OBJECT, 0); reactor->timer = pn_timer(reactor->collector); reactor->wakeup[0] = PN_INVALID_SOCKET; reactor->wakeup[1] = PN_INVALID_SOCKET; reactor->selectable = NULL; reactor->previous = PN_EVENT_NONE; reactor->selectables = 0; reactor->timeout = 0; reactor->yield = false; reactor->stop = false; pn_reactor_mark(reactor); } static void pn_reactor_finalize(pn_reactor_t *reactor) { for (int i = 0; i < 2; i++) { if (reactor->wakeup[i] != PN_INVALID_SOCKET) { pn_close(reactor->io, reactor->wakeup[i]); } } pn_decref(reactor->attachments); pn_decref(reactor->collector); pn_decref(reactor->global); pn_decref(reactor->handler); pn_decref(reactor->children); pn_decref(reactor->timer); pn_decref(reactor->io); } #define pn_reactor_hashcode NULL #define pn_reactor_compare NULL #define pn_reactor_inspect NULL PN_CLASSDEF(pn_reactor) pn_reactor_t *pn_reactor() { pn_reactor_t *reactor = pn_reactor_new(); int err = pn_pipe(reactor->io, reactor->wakeup); if (err) { pn_free(reactor); return NULL; } else { return reactor; } } pn_record_t *pn_reactor_attachments(pn_reactor_t *reactor) { assert(reactor); return reactor->attachments; } pn_millis_t pn_reactor_get_timeout(pn_reactor_t *reactor) { assert(reactor); return reactor->timeout; } void pn_reactor_set_timeout(pn_reactor_t *reactor, pn_millis_t timeout) { assert(reactor); reactor->timeout = timeout; } void pn_reactor_free(pn_reactor_t *reactor) { if (reactor) { pn_collector_release(reactor->collector); pn_handler_free(reactor->handler); reactor->handler = NULL; pn_decref(reactor); } } pn_handler_t *pn_reactor_get_global_handler(pn_reactor_t *reactor) { assert(reactor); return reactor->global; } void pn_reactor_set_global_handler(pn_reactor_t *reactor, pn_handler_t *handler) { assert(reactor); pn_decref(reactor->global); reactor->global = handler; pn_incref(reactor->global); } pn_handler_t *pn_reactor_get_handler(pn_reactor_t *reactor) { assert(reactor); return reactor->handler; } void pn_reactor_set_handler(pn_reactor_t *reactor, pn_handler_t *handler) { assert(reactor); pn_decref(reactor->handler); reactor->handler = handler; pn_incref(reactor->handler); } pn_io_t *pni_reactor_io(pn_reactor_t *reactor) { assert(reactor); return reactor->io; } pn_error_t *pn_reactor_error(pn_reactor_t *reactor) { assert(reactor); return pn_io_error(reactor->io); } pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor) { assert(reactor); return reactor->collector; } pn_list_t *pn_reactor_children(pn_reactor_t *reactor) { assert(reactor); return reactor->children; } static void pni_selectable_release(pn_selectable_t *selectable) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(selectable); pn_incref(selectable); if (pn_list_remove(reactor->children, selectable)) { reactor->selectables--; } pn_decref(selectable); } pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor) { assert(reactor); pn_selectable_t *sel = pn_selectable(); pn_selectable_collect(sel, reactor->collector); pn_collector_put(reactor->collector, PN_OBJECT, sel, PN_SELECTABLE_INIT); pni_selectable_set_context(sel, reactor); pn_list_add(reactor->children, sel); pn_selectable_on_release(sel, pni_selectable_release); pn_decref(sel); reactor->selectables++; return sel; } PN_HANDLE(PNI_TERMINATED) void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable) { assert(reactor); pn_record_t *record = pn_selectable_attachments(selectable); if (!pn_record_has(record, PNI_TERMINATED)) { if (pn_selectable_is_terminal(selectable)) { pn_record_def(record, PNI_TERMINATED, PN_VOID); pn_collector_put(reactor->collector, PN_OBJECT, selectable, PN_SELECTABLE_FINAL); } else { pn_collector_put(reactor->collector, PN_OBJECT, selectable, PN_SELECTABLE_UPDATED); } } } void pni_handle_final(pn_reactor_t *reactor, pn_event_t *event); static void pni_reactor_dispatch_post(pn_reactor_t *reactor, pn_event_t *event) { assert(reactor); assert(event); switch (pn_event_type(event)) { case PN_CONNECTION_FINAL: pni_handle_final(reactor, event); break; default: break; } } PN_HANDLE(PN_HANDLER) pn_handler_t *pn_record_get_handler(pn_record_t *record) { assert(record); return (pn_handler_t *) pn_record_get(record, PN_HANDLER); } void pn_record_set_handler(pn_record_t *record, pn_handler_t *handler) { assert(record); pn_record_def(record, PN_HANDLER, PN_OBJECT); pn_record_set(record, PN_HANDLER, handler); } PN_HANDLE(PN_REACTOR) pn_reactor_t *pni_record_get_reactor(pn_record_t *record) { return (pn_reactor_t *) pn_record_get(record, PN_REACTOR); } void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor) { pn_record_def(record, PN_REACTOR, PN_WEAKREF); pn_record_set(record, PN_REACTOR, reactor); } static pn_connection_t *pni_object_connection(const pn_class_t *clazz, void *object) { switch (pn_class_id(clazz)) { case CID_pn_delivery: return pn_session_connection(pn_link_session(pn_delivery_link((pn_delivery_t *) object))); case CID_pn_link: return pn_session_connection(pn_link_session((pn_link_t *) object)); case CID_pn_session: return pn_session_connection((pn_session_t *) object); case CID_pn_connection: return (pn_connection_t *) object; case CID_pn_transport: return pn_transport_connection((pn_transport_t *) object); default: return NULL; } } static pn_reactor_t *pni_reactor(pn_selectable_t *sel) { return (pn_reactor_t *) pni_selectable_get_context(sel); } pn_reactor_t *pn_class_reactor(const pn_class_t *clazz, void *object) { switch (pn_class_id(clazz)) { case CID_pn_reactor: return (pn_reactor_t *) object; case CID_pn_task: return pni_record_get_reactor(pn_task_attachments((pn_task_t *) object)); case CID_pn_transport: return pni_record_get_reactor(pn_transport_attachments((pn_transport_t *) object)); case CID_pn_delivery: case CID_pn_link: case CID_pn_session: case CID_pn_connection: { pn_connection_t *conn = pni_object_connection(clazz, object); pn_record_t *record = pn_connection_attachments(conn); return pni_record_get_reactor(record); } case CID_pn_selectable: { pn_selectable_t *sel = (pn_selectable_t *) object; return pni_reactor(sel); } default: return NULL; } } pn_reactor_t *pn_object_reactor(void *object) { return pn_class_reactor(pn_object_reify(object), object); } pn_reactor_t *pn_event_reactor(pn_event_t *event) { const pn_class_t *clazz = pn_event_class(event); void *context = pn_event_context(event); return pn_class_reactor(clazz, context); } pn_handler_t *pn_event_handler(pn_event_t *event, pn_handler_t *default_handler) { pn_handler_t *handler = NULL; pn_link_t *link = pn_event_link(event); if (link) { handler = pn_record_get_handler(pn_link_attachments(link)); if (handler) { return handler; } } pn_session_t *session = pn_event_session(event); if (session) { handler = pn_record_get_handler(pn_session_attachments(session)); if (handler) { return handler; } } pn_connection_t *connection = pn_event_connection(event); if (connection) { handler = pn_record_get_handler(pn_connection_attachments(connection)); if (handler) { return handler; } } switch (pn_class_id(pn_event_class(event))) { case CID_pn_task: handler = pn_record_get_handler(pn_task_attachments((pn_task_t *) pn_event_context(event))); if (handler) { return handler; } break; case CID_pn_selectable: handler = pn_record_get_handler(pn_selectable_attachments((pn_selectable_t *) pn_event_context(event))); if (handler) { return handler; } break; default: break; } return default_handler; } pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor, int delay, pn_handler_t *handler) { pn_task_t *task = pn_timer_schedule(reactor->timer, reactor->now + delay); pn_record_t *record = pn_task_attachments(task); pni_record_init_reactor(record, reactor); pn_record_set_handler(record, handler); if (reactor->selectable) { pn_selectable_set_deadline(reactor->selectable, pn_timer_deadline(reactor->timer)); pn_reactor_update(reactor, reactor->selectable); } return task; } void pni_event_print(pn_event_t *event) { pn_string_t *str = pn_string(NULL); pn_inspect(event, str); printf("%s\n", pn_string_get(str)); pn_free(str); } bool pni_reactor_more(pn_reactor_t *reactor) { assert(reactor); return pn_timer_tasks(reactor->timer) || reactor->selectables > 1; } void pn_reactor_yield(pn_reactor_t *reactor) { assert(reactor); reactor->yield = true; } bool pn_reactor_quiesced(pn_reactor_t *reactor) { assert(reactor); pn_event_t *event = pn_collector_peek(reactor->collector); // no events if (!event) { return true; } // more than one event if (pn_collector_more(reactor->collector)) { return false; } // if we have just one event then we are quiesced if the quiesced event return pn_event_type(event) == PN_REACTOR_QUIESCED; } pn_handler_t *pn_event_root(pn_event_t *event) { pn_handler_t *h = pn_record_get_handler(pn_event_attachments(event)); return h; } static void pni_event_set_root(pn_event_t *event, pn_handler_t *handler) { pn_record_set_handler(pn_event_attachments(event), handler); } bool pn_reactor_process(pn_reactor_t *reactor) { assert(reactor); pn_reactor_mark(reactor); pn_event_type_t previous = PN_EVENT_NONE; while (true) { pn_event_t *event = pn_collector_peek(reactor->collector); //pni_event_print(event); if (event) { if (reactor->yield) { reactor->yield = false; return true; } reactor->yield = false; pn_incref(event); pn_handler_t *handler = pn_event_handler(event, reactor->handler); pn_event_type_t type = pn_event_type(event); pni_event_set_root(event, handler); pn_handler_dispatch(handler, event, type); pni_event_set_root(event, reactor->global); pn_handler_dispatch(reactor->global, event, type); pni_reactor_dispatch_post(reactor, event); previous = reactor->previous = type; pn_decref(event); pn_collector_pop(reactor->collector); } else if (!reactor->stop && pni_reactor_more(reactor)) { if (previous != PN_REACTOR_QUIESCED && reactor->previous != PN_REACTOR_FINAL) { pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_QUIESCED); } else { return true; } } else { if (reactor->selectable) { pn_selectable_terminate(reactor->selectable); pn_reactor_update(reactor, reactor->selectable); reactor->selectable = NULL; } else { if (reactor->previous != PN_REACTOR_FINAL) pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_FINAL); return false; } } } } static void pni_timer_expired(pn_selectable_t *sel) { pn_reactor_t *reactor = pni_reactor(sel); pn_timer_tick(reactor->timer, reactor->now); pn_selectable_set_deadline(sel, pn_timer_deadline(reactor->timer)); pn_reactor_update(reactor, sel); } static void pni_timer_readable(pn_selectable_t *sel) { char buf[64]; pn_reactor_t *reactor = pni_reactor(sel); pn_socket_t fd = pn_selectable_get_fd(sel); pn_read(reactor->io, fd, buf, 64); pni_timer_expired(sel); } pn_selectable_t *pni_timer_selectable(pn_reactor_t *reactor) { pn_selectable_t *sel = pn_reactor_selectable(reactor); pn_selectable_set_fd(sel, reactor->wakeup[0]); pn_selectable_on_readable(sel, pni_timer_readable); pn_selectable_on_expired(sel, pni_timer_expired); pn_selectable_set_reading(sel, true); pn_selectable_set_deadline(sel, pn_timer_deadline(reactor->timer)); pn_reactor_update(reactor, sel); return sel; } int pn_reactor_wakeup(pn_reactor_t *reactor) { assert(reactor); ssize_t n = pn_write(reactor->io, reactor->wakeup[1], "x", 1); if (n < 0) { return (int) n; } else { return 0; } } void pn_reactor_start(pn_reactor_t *reactor) { assert(reactor); pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_INIT); reactor->selectable = pni_timer_selectable(reactor); } void pn_reactor_stop(pn_reactor_t *reactor) { assert(reactor); reactor->stop = true; } void pn_reactor_run(pn_reactor_t *reactor) { assert(reactor); pn_reactor_set_timeout(reactor, 3141); pn_reactor_start(reactor); while (pn_reactor_process(reactor)) {} pn_reactor_process(reactor); pn_collector_release(reactor->collector); } qpid-proton-0.22.0/proton-c/src/reactor/io/0000775000000000000000000000000013257152177015347 5ustar qpid-proton-0.22.0/proton-c/src/reactor/io/windows/0000775000000000000000000000000013257152177017041 5ustar qpid-proton-0.22.0/proton-c/src/reactor/io/windows/write_pipeline.c0000664000000000000000000002217513257152177022233 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * A simple write buffer pool. Each socket has a dedicated "primary" * buffer and can borrow from a shared pool with limited size tuning. * Could enhance e.g. with separate pools per network interface and fancier * memory tuning based on interface speed, system resources, and * number of connections, etc. */ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #if _WIN32_WINNT < 0x0501 #error "Proton requires Windows API support for XP or later." #endif #include #include #include "reactor/io.h" #include "reactor/selector.h" #include "reactor/selectable.h" #include "iocp.h" #include "core/util.h" #include #include #include // Max overlapped writes per socket #define IOCP_MAX_OWRITES 16 // Write buffer size #define IOCP_WBUFSIZE 16384 static void pipeline_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } void pni_shared_pool_create(iocp_t *iocp) { // TODO: more pools (or larger one) when using multiple non-loopback interfaces iocp->shared_pool_size = 16; char *env = getenv("PNI_WRITE_BUFFERS"); // Internal: for debugging if (env) { int sz = atoi(env); if (sz >= 0 && sz < 256) { iocp->shared_pool_size = sz; } } iocp->loopback_bufsize = 0; env = getenv("PNI_LB_BUFSIZE"); // Internal: for debugging if (env) { int sz = atoi(env); if (sz >= 0 && sz <= 128 * 1024) { iocp->loopback_bufsize = sz; } } if (iocp->shared_pool_size) { iocp->shared_pool_memory = (char *) VirtualAlloc(NULL, IOCP_WBUFSIZE * iocp->shared_pool_size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); HRESULT status = GetLastError(); if (!iocp->shared_pool_memory) { perror("Proton write buffer pool allocation failure\n"); iocp->shared_pool_size = 0; iocp->shared_available_count = 0; return; } iocp->shared_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *)); iocp->available_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *)); iocp->shared_available_count = iocp->shared_pool_size; char *mem = iocp->shared_pool_memory; for (unsigned i = 0; i < iocp->shared_pool_size; i++) { iocp->shared_results[i] = iocp->available_results[i] = pni_write_result(NULL, mem, IOCP_WBUFSIZE); mem += IOCP_WBUFSIZE; } } } void pni_shared_pool_free(iocp_t *iocp) { for (unsigned i = 0; i < iocp->shared_pool_size; i++) { write_result_t *result = iocp->shared_results[i]; if (result->in_use) pipeline_log("Proton buffer pool leak\n"); else free(result); } if (iocp->shared_pool_size) { free(iocp->shared_results); free(iocp->available_results); if (iocp->shared_pool_memory) { if (!VirtualFree(iocp->shared_pool_memory, 0, MEM_RELEASE)) { perror("write buffers release failed"); } iocp->shared_pool_memory = NULL; } } } static void shared_pool_push(write_result_t *result) { iocp_t *iocp = result->base.iocpd->iocp; assert(iocp->shared_available_count < iocp->shared_pool_size); iocp->available_results[iocp->shared_available_count++] = result; } static write_result_t *shared_pool_pop(iocp_t *iocp) { return iocp->shared_available_count ? iocp->available_results[--iocp->shared_available_count] : NULL; } struct write_pipeline_t { iocpdesc_t *iocpd; size_t pending_count; write_result_t *primary; size_t reserved_count; size_t next_primary_index; size_t depth; bool is_writer; }; #define write_pipeline_compare NULL #define write_pipeline_inspect NULL #define write_pipeline_hashcode NULL static void write_pipeline_initialize(void *object) { write_pipeline_t *pl = (write_pipeline_t *) object; pl->pending_count = 0; const char *pribuf = (const char *) malloc(IOCP_WBUFSIZE); pl->primary = pni_write_result(NULL, pribuf, IOCP_WBUFSIZE); pl->depth = 0; pl->is_writer = false; } static void write_pipeline_finalize(void *object) { write_pipeline_t *pl = (write_pipeline_t *) object; free((void *)pl->primary->buffer.start); free(pl->primary); } write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd) { static const pn_cid_t CID_write_pipeline = CID_pn_void; static const pn_class_t clazz = PN_CLASS(write_pipeline); write_pipeline_t *pipeline = (write_pipeline_t *) pn_class_new(&clazz, sizeof(write_pipeline_t)); pipeline->iocpd = iocpd; pipeline->primary->base.iocpd = iocpd; return pipeline; } static void confirm_as_writer(write_pipeline_t *pl) { if (!pl->is_writer) { iocp_t *iocp = pl->iocpd->iocp; iocp->writer_count++; pl->is_writer = true; } } static void remove_as_writer(write_pipeline_t *pl) { if (!pl->is_writer) return; iocp_t *iocp = pl->iocpd->iocp; assert(iocp->writer_count); pl->is_writer = false; iocp->writer_count--; } /* * Optimal depth will depend on properties of the NIC, server, and driver. For now, * just distinguish between loopback interfaces and the rest. Optimizations in the * loopback stack allow decent performance with depth 1 and actually cause major * performance hiccups if set to large values. */ static void set_depth(write_pipeline_t *pl) { pl->depth = 1; sockaddr_storage sa; socklen_t salen = sizeof(sa); char buf[INET6_ADDRSTRLEN]; DWORD buflen = sizeof(buf); if (getsockname(pl->iocpd->socket,(sockaddr*) &sa, &salen) == 0 && getnameinfo((sockaddr*) &sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) == 0) { if ((sa.ss_family == AF_INET6 && strcmp(buf, "::1")) || (sa.ss_family == AF_INET && strncmp(buf, "127.", 4))) { // not loopback pl->depth = IOCP_MAX_OWRITES; } else { iocp_t *iocp = pl->iocpd->iocp; if (iocp->loopback_bufsize) { const char *p = (const char *) realloc((void *) pl->primary->buffer.start, iocp->loopback_bufsize); if (p) { pl->primary->buffer.start = p; pl->primary->buffer.size = iocp->loopback_bufsize; } } } } } // Reserve as many buffers as possible for count bytes. size_t pni_write_pipeline_reserve(write_pipeline_t *pl, size_t count) { if (pl->primary->in_use) return 0; // I.e. io->wouldblock if (!pl->depth) set_depth(pl); if (pl->depth == 1) { // always use the primary pl->reserved_count = 1; pl->next_primary_index = 0; return 1; } iocp_t *iocp = pl->iocpd->iocp; confirm_as_writer(pl); size_t wanted = (count / IOCP_WBUFSIZE); if (count % IOCP_WBUFSIZE) wanted++; size_t pending = pl->pending_count; assert(pending < pl->depth); size_t bufs = pn_min(wanted, pl->depth - pending); // Can draw from shared pool or the primary... but share with others. size_t writers = iocp->writer_count; size_t shared_count = (iocp->shared_available_count + writers - 1) / writers; bufs = pn_min(bufs, shared_count + 1); pl->reserved_count = pending + bufs; if (bufs == wanted && pl->reserved_count < (pl->depth / 2) && iocp->shared_available_count > (2 * writers + bufs)) { // No shortage: keep the primary as spare for future use pl->next_primary_index = pl->reserved_count; } else if (bufs == 1) { pl->next_primary_index = pending; } else { // let approx 1/3 drain before replenishing pl->next_primary_index = ((pl->reserved_count + 2) / 3) - 1; if (pl->next_primary_index < pending) pl->next_primary_index = pending; } return bufs; } write_result_t *pni_write_pipeline_next(write_pipeline_t *pl) { size_t sz = pl->pending_count; if (sz >= pl->reserved_count) return NULL; write_result_t *result; if (sz == pl->next_primary_index) { result = pl->primary; } else { assert(pl->iocpd->iocp->shared_available_count > 0); result = shared_pool_pop(pl->iocpd->iocp); } result->in_use = true; pl->pending_count++; return result; } void pni_write_pipeline_return(write_pipeline_t *pl, write_result_t *result) { result->in_use = false; pl->pending_count--; pl->reserved_count = 0; if (result != pl->primary) shared_pool_push(result); if (pl->pending_count == 0) remove_as_writer(pl); } bool pni_write_pipeline_writable(write_pipeline_t *pl) { // Only writable if not full and we can guarantee a buffer: return pl->pending_count < pl->depth && !pl->primary->in_use; } size_t pni_write_pipeline_size(write_pipeline_t *pl) { return pl->pending_count; } qpid-proton-0.22.0/proton-c/src/reactor/io/windows/selector.c0000664000000000000000000002667213257152177021042 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #if _WIN32_WINNT < 0x0501 #error "Proton requires Windows API support for XP or later." #endif #include #include #include "reactor/io.h" #include "reactor/selectable.h" #include "reactor/selector.h" #include "iocp.h" #include "platform/platform.h" #include "core/util.h" #include #include #include static void interests_update(iocpdesc_t *iocpd, int interests); static void deadlines_update(iocpdesc_t *iocpd, pn_timestamp_t t); struct pn_selector_t { iocp_t *iocp; pn_list_t *selectables; pn_list_t *iocp_descriptors; size_t current; iocpdesc_t *current_triggered; pn_timestamp_t awoken; pn_error_t *error; iocpdesc_t *triggered_list_head; iocpdesc_t *triggered_list_tail; iocpdesc_t *deadlines_head; iocpdesc_t *deadlines_tail; }; void pn_selector_initialize(void *obj) { pn_selector_t *selector = (pn_selector_t *) obj; selector->iocp = NULL; selector->selectables = pn_list(PN_WEAKREF, 0); selector->iocp_descriptors = pn_list(PN_OBJECT, 0); selector->current = 0; selector->current_triggered = NULL; selector->awoken = 0; selector->error = pn_error(); selector->triggered_list_head = NULL; selector->triggered_list_tail = NULL; selector->deadlines_head = NULL; selector->deadlines_tail = NULL; } void pn_selector_finalize(void *obj) { pn_selector_t *selector = (pn_selector_t *) obj; pn_free(selector->selectables); pn_free(selector->iocp_descriptors); pn_error_free(selector->error); selector->iocp->selector = NULL; } #define pn_selector_hashcode NULL #define pn_selector_compare NULL #define pn_selector_inspect NULL pn_selector_t *pni_selector() { static const pn_class_t clazz = PN_CLASS(pn_selector); pn_selector_t *selector = (pn_selector_t *) pn_class_new(&clazz, sizeof(pn_selector_t)); return selector; } pn_selector_t *pni_selector_create(iocp_t *iocp) { pn_selector_t *selector = pni_selector(); selector->iocp = iocp; return selector; } void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable) { assert(selector); assert(selectable); assert(pni_selectable_get_index(selectable) < 0); pn_socket_t sock = pn_selectable_get_fd(selectable); iocpdesc_t *iocpd = NULL; if (pni_selectable_get_index(selectable) < 0) { pn_list_add(selector->selectables, selectable); pn_list_add(selector->iocp_descriptors, NULL); size_t size = pn_list_size(selector->selectables); pni_selectable_set_index(selectable, size - 1); } pn_selector_update(selector, selectable); } void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable) { // A selectable's fd may switch from PN_INVALID_SCOKET to a working socket between // update calls. If a selectable without a valid socket has a deadline, we need // a dummy iocpdesc_t to participate in the deadlines list. int idx = pni_selectable_get_index(selectable); assert(idx >= 0); pn_timestamp_t deadline = pn_selectable_get_deadline(selectable); pn_socket_t sock = pn_selectable_get_fd(selectable); iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(selector->iocp_descriptors, idx); if (!iocpd && deadline && sock == PN_INVALID_SOCKET) { iocpd = pni_deadline_desc(selector->iocp); assert(iocpd); pn_list_set(selector->iocp_descriptors, idx, iocpd); pn_decref(iocpd); // life is solely tied to iocp_descriptors list iocpd->selector = selector; iocpd->selectable = selectable; } else if (iocpd && iocpd->deadline_desc && sock != PN_INVALID_SOCKET) { // Switching to a real socket. Stop using a deadline descriptor. deadlines_update(iocpd, 0); // decref descriptor in list and pick up a real iocpd below pn_list_set(selector->iocp_descriptors, idx, NULL); iocpd = NULL; } // The selectables socket may be set long after it has been added if (!iocpd && sock != PN_INVALID_SOCKET) { iocpd = pni_iocpdesc_map_get(selector->iocp, sock); if (!iocpd) { // Socket created outside proton. Hook it up to iocp. iocpd = pni_iocpdesc_create(selector->iocp, sock, true); assert(iocpd); if (iocpd) pni_iocpdesc_start(iocpd); } if (iocpd) { pn_list_set(selector->iocp_descriptors, idx, iocpd); iocpd->selector = selector; iocpd->selectable = selectable; } } if (iocpd) { assert(sock == iocpd->socket || iocpd->closing); int interests = PN_ERROR; // Always if (pn_selectable_is_reading(selectable)) { interests |= PN_READABLE; } if (pn_selectable_is_writing(selectable)) { interests |= PN_WRITABLE; } if (deadline) { interests |= PN_EXPIRED; } interests_update(iocpd, interests); deadlines_update(iocpd, deadline); } } void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable) { assert(selector); assert(selectable); int idx = pni_selectable_get_index(selectable); assert(idx >= 0); iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(selector->iocp_descriptors, idx); if (iocpd) { if (selector->current_triggered == iocpd) selector->current_triggered = iocpd->triggered_list_next; interests_update(iocpd, 0); deadlines_update(iocpd, 0); assert(selector->triggered_list_head != iocpd && !iocpd->triggered_list_prev); assert(selector->deadlines_head != iocpd && !iocpd->deadlines_prev); iocpd->selector = NULL; iocpd->selectable = NULL; } pn_list_del(selector->selectables, idx, 1); pn_list_del(selector->iocp_descriptors, idx, 1); size_t size = pn_list_size(selector->selectables); for (size_t i = idx; i < size; i++) { pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(selector->selectables, i); pni_selectable_set_index(sel, i); } pni_selectable_set_index(selectable, -1); if (selector->current >= (size_t) idx) { selector->current--; } } size_t pn_selector_size(pn_selector_t *selector) { assert(selector); return pn_list_size(selector->selectables); } int pn_selector_select(pn_selector_t *selector, int timeout) { assert(selector); pn_error_clear(selector->error); pn_timestamp_t deadline = 0; pn_timestamp_t now = pn_i_now(); if (timeout) { if (selector->deadlines_head) deadline = selector->deadlines_head->deadline; } if (deadline) { int64_t delta = deadline - now; if (delta < 0) { delta = 0; } if (timeout < 0) timeout = delta; else if (timeout > delta) timeout = delta; } deadline = (timeout >= 0) ? now + timeout : 0; // Process all currently available completions, even if matched events available pni_iocp_drain_completions(selector->iocp); pni_zombie_check(selector->iocp, now); // Loop until an interested event is matched, or until deadline while (true) { if (selector->triggered_list_head) break; if (deadline && deadline <= now) break; pn_timestamp_t completion_deadline = deadline; pn_timestamp_t zd = pni_zombie_deadline(selector->iocp); if (zd) completion_deadline = completion_deadline ? pn_min(zd, completion_deadline) : zd; int completion_timeout = (!completion_deadline) ? -1 : completion_deadline - now; int rv = pni_iocp_wait_one(selector->iocp, completion_timeout, selector->error); if (rv < 0) return pn_error_code(selector->error); now = pn_i_now(); if (zd && zd <= now) { pni_zombie_check(selector->iocp, now); } } selector->current = 0; selector->awoken = now; for (iocpdesc_t *iocpd = selector->deadlines_head; iocpd; iocpd = iocpd->deadlines_next) { if (iocpd->deadline <= now) pni_events_update(iocpd, iocpd->events | PN_EXPIRED); else break; } selector->current_triggered = selector->triggered_list_head; return pn_error_code(selector->error); } pn_selectable_t *pn_selector_next(pn_selector_t *selector, int *events) { if (selector->current_triggered) { iocpdesc_t *iocpd = selector->current_triggered; *events = iocpd->interests & iocpd->events; selector->current_triggered = iocpd->triggered_list_next; return iocpd->selectable; } return NULL; } void pn_selector_free(pn_selector_t *selector) { assert(selector); pn_free(selector); } static void triggered_list_add(pn_selector_t *selector, iocpdesc_t *iocpd) { if (iocpd->triggered_list_prev || selector->triggered_list_head == iocpd) return; // already in list LL_ADD(selector, triggered_list, iocpd); } static void triggered_list_remove(pn_selector_t *selector, iocpdesc_t *iocpd) { if (!iocpd->triggered_list_prev && selector->triggered_list_head != iocpd) return; // not in list LL_REMOVE(selector, triggered_list, iocpd); iocpd->triggered_list_prev = NULL; iocpd->triggered_list_next = NULL; } void pni_events_update(iocpdesc_t *iocpd, int events) { // If set, a poll error is permanent if (iocpd->poll_error) events |= PN_ERROR; if (iocpd->events == events) return; iocpd->events = events; if (iocpd->selector) { if (iocpd->events & iocpd->interests) triggered_list_add(iocpd->selector, iocpd); else triggered_list_remove(iocpd->selector, iocpd); } } static void interests_update(iocpdesc_t *iocpd, int interests) { int old_interests = iocpd->interests; if (old_interests == interests) return; iocpd->interests = interests; if (iocpd->selector) { if (iocpd->events & iocpd->interests) triggered_list_add(iocpd->selector, iocpd); else triggered_list_remove(iocpd->selector, iocpd); } } static void deadlines_remove(pn_selector_t *selector, iocpdesc_t *iocpd) { if (!iocpd->deadlines_prev && selector->deadlines_head != iocpd) return; // not in list LL_REMOVE(selector, deadlines, iocpd); iocpd->deadlines_prev = NULL; iocpd->deadlines_next = NULL; } static void deadlines_update(iocpdesc_t *iocpd, pn_timestamp_t deadline) { if (deadline == iocpd->deadline) return; iocpd->deadline = deadline; pn_selector_t *selector = iocpd->selector; if (!deadline) { deadlines_remove(selector, iocpd); pni_events_update(iocpd, iocpd->events & ~PN_EXPIRED); } else { if (iocpd->deadlines_prev || selector->deadlines_head == iocpd) { deadlines_remove(selector, iocpd); pni_events_update(iocpd, iocpd->events & ~PN_EXPIRED); } iocpdesc_t *dl_iocpd = LL_HEAD(selector, deadlines); while (dl_iocpd && dl_iocpd->deadline <= deadline) dl_iocpd = dl_iocpd->deadlines_next; if (dl_iocpd) { // insert iocpd->deadlines_prev = dl_iocpd->deadlines_prev; iocpd->deadlines_next = dl_iocpd; dl_iocpd->deadlines_prev = iocpd; if (selector->deadlines_head == dl_iocpd) selector->deadlines_head = iocpd; } else { LL_ADD(selector, deadlines, iocpd); // append } } } qpid-proton-0.22.0/proton-c/src/reactor/io/windows/iocp.h0000664000000000000000000001131213257152177020142 0ustar #ifndef PROTON_SRC_IOCP_H #define PROTON_SRC_IOCP_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include typedef struct pni_acceptor_t pni_acceptor_t; typedef struct write_result_t write_result_t; typedef struct read_result_t read_result_t; typedef struct write_pipeline_t write_pipeline_t; typedef struct iocpdesc_t iocpdesc_t; // One per pn_io_t. struct iocp_t { HANDLE completion_port; pn_hash_t *iocpdesc_map; pn_list_t *zombie_list; unsigned shared_pool_size; char *shared_pool_memory; write_result_t **shared_results; write_result_t **available_results; size_t shared_available_count; size_t writer_count; int loopback_bufsize; bool iocp_trace; pn_selector_t *selector; }; // One for each socket. // This iocpdesc_t structure is ref counted by the iocpdesc_map, zombie_list, // selector->iocp_descriptors list. It should remain ref counted in the // zombie_list until ops_in_progress == 0 or the completion port is closed. struct iocpdesc_t { pn_socket_t socket; iocp_t *iocp; pni_acceptor_t *acceptor; pn_error_t *error; int ops_in_progress; bool read_in_progress; write_pipeline_t *pipeline; read_result_t *read_result; bool external; // true if socket set up outside Proton bool bound; // associted with the completion port bool closing; // pn_close called by application bool read_closed; // EOF or read error bool write_closed; // shutdown sent or write error bool poll_error; // flag posix-like POLLERR/POLLHUP/POLLNVAL bool deadline_desc; // Socket-less deadline descriptor for selectors pn_selector_t *selector; pn_selectable_t *selectable; int events; int interests; pn_timestamp_t deadline; iocpdesc_t *triggered_list_next; iocpdesc_t *triggered_list_prev; iocpdesc_t *deadlines_next; iocpdesc_t *deadlines_prev; pn_timestamp_t reap_time;; }; typedef enum { IOCP_ACCEPT, IOCP_CONNECT, IOCP_READ, IOCP_WRITE } iocp_type_t; typedef struct { OVERLAPPED overlapped; iocp_type_t type; iocpdesc_t *iocpd; HRESULT status; } iocp_result_t; struct write_result_t { iocp_result_t base; size_t requested; bool in_use; pn_bytes_t buffer; }; iocpdesc_t *pni_iocpdesc_create(iocp_t *, pn_socket_t s, bool external); iocpdesc_t *pni_iocpdesc_map_get(iocp_t *, pn_socket_t s); iocpdesc_t *pni_deadline_desc(iocp_t *); void pni_iocpdesc_map_del(iocp_t *, pn_socket_t s); void pni_iocpdesc_map_push(iocpdesc_t *iocpd); void pni_iocpdesc_start(iocpdesc_t *iocpd); void pni_iocp_drain_completions(iocp_t *); int pni_iocp_wait_one(iocp_t *, int timeout, pn_error_t *); void pni_iocp_start_accepting(iocpdesc_t *iocpd); pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error); pn_socket_t pni_iocp_begin_connect(iocp_t *, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error); ssize_t pni_iocp_begin_write(iocpdesc_t *, const void *, size_t, bool *, pn_error_t *); ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error); void pni_iocp_begin_close(iocpdesc_t *iocpd); iocp_t *pni_iocp(); void pni_events_update(iocpdesc_t *iocpd, int events); write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen); write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd); size_t pni_write_pipeline_size(write_pipeline_t *); bool pni_write_pipeline_writable(write_pipeline_t *); void pni_write_pipeline_return(write_pipeline_t *, write_result_t *); size_t pni_write_pipeline_reserve(write_pipeline_t *, size_t); write_result_t *pni_write_pipeline_next(write_pipeline_t *); void pni_shared_pool_create(iocp_t *); void pni_shared_pool_free(iocp_t *); void pni_zombie_check(iocp_t *, pn_timestamp_t); pn_timestamp_t pni_zombie_deadline(iocp_t *); pn_selector_t *pni_selector_create(iocp_t *iocp); int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code); #endif /* iocp.h */ qpid-proton-0.22.0/proton-c/src/reactor/io/windows/iocp.c0000664000000000000000000010732213257152177020144 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #if _WIN32_WINNT < 0x0501 #error "Proton requires Windows API support for XP or later." #endif #include #include #include #include "reactor/io.h" #include "reactor/selector.h" #include "iocp.h" #include "platform/platform.h" #include "core/util.h" #include #include #include #include /* * Windows IO Completion Port support for Proton. * * Overlapped writes are used to avoid lengthy stalls between write * completion and starting a new write. Non-overlapped reads are used * since Windows accumulates inbound traffic without stalling and * managing read buffers would not avoid a memory copy at the pn_read * boundary. * * A socket must not get a Windows closesocket() unless the * application has called pn_close on the socket or a global * pn_io_finalize(). On error, the internal accounting for * write_closed or read_closed may be updated along with the external * event notification. A socket may be closed if it is never added to * the iocpdesc_map or is on its way out of the map. */ // Max number of overlapped accepts per listener #define IOCP_MAX_ACCEPTS 10 // AcceptEx squishes the local and remote addresses and optional data // all together when accepting the connection. Reserve enough for // IPv6 addresses, even if the socket is IPv4. The 16 bytes padding // per address is required by AcceptEx. #define IOCP_SOCKADDRMAXLEN (sizeof(sockaddr_in6) + 16) #define IOCP_SOCKADDRBUFLEN (2 * IOCP_SOCKADDRMAXLEN) static void iocp_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } static void set_iocp_error_status(pn_error_t *error, int code, HRESULT status) { char buf[512]; if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, 0, status, 0, buf, sizeof(buf), 0)) pn_error_set(error, code, buf); else { fprintf(stderr, "pn internal Windows error: %lu\n", GetLastError()); } } static void reap_check(iocpdesc_t *); static void bind_to_completion_port(iocpdesc_t *iocpd); static void iocp_shutdown(iocpdesc_t *iocpd); static void start_reading(iocpdesc_t *iocpd); static bool is_listener(iocpdesc_t *iocpd); static void release_sys_sendbuf(SOCKET s); static void iocpdesc_fail(iocpdesc_t *iocpd, HRESULT status, const char* text) { pni_win32_error(iocpd->error, text, status); if (iocpd->iocp->iocp_trace) { iocp_log("connection terminated: %s\n", pn_error_text(iocpd->error)); } iocpd->write_closed = true; iocpd->read_closed = true; iocpd->poll_error = true; pni_events_update(iocpd, iocpd->events & ~(PN_READABLE | PN_WRITABLE)); } // Helper functions to use specialized IOCP AcceptEx() and ConnectEx() static LPFN_ACCEPTEX lookup_accept_ex(SOCKET s) { GUID guid = WSAID_ACCEPTEX; DWORD bytes = 0; LPFN_ACCEPTEX fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } static LPFN_CONNECTEX lookup_connect_ex(SOCKET s) { GUID guid = WSAID_CONNECTEX; DWORD bytes = 0; LPFN_CONNECTEX fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } static LPFN_GETACCEPTEXSOCKADDRS lookup_get_accept_ex_sockaddrs(SOCKET s) { GUID guid = WSAID_GETACCEPTEXSOCKADDRS; DWORD bytes = 0; LPFN_GETACCEPTEXSOCKADDRS fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } // match accept socket to listener socket static iocpdesc_t *create_same_type_socket(iocpdesc_t *iocpd) { sockaddr_storage sa; socklen_t salen = sizeof(sa); if (getsockname(iocpd->socket, (sockaddr*)&sa, &salen) == -1) return NULL; SOCKET s = socket(sa.ss_family, SOCK_STREAM, 0); // Currently only work with SOCK_STREAM if (s == INVALID_SOCKET) return NULL; return pni_iocpdesc_create(iocpd->iocp, s, false); } static bool is_listener(iocpdesc_t *iocpd) { return iocpd && iocpd->acceptor; } // === Async accept processing typedef struct { iocp_result_t base; iocpdesc_t *new_sock; char address_buffer[IOCP_SOCKADDRBUFLEN]; DWORD unused; } accept_result_t; static accept_result_t *accept_result(iocpdesc_t *listen_sock) { accept_result_t *result = (accept_result_t *)calloc(1, sizeof(accept_result_t)); if (result) { result->base.type = IOCP_ACCEPT; result->base.iocpd = listen_sock; } return result; } static void reset_accept_result(accept_result_t *result) { memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); memset(&result->address_buffer, 0, IOCP_SOCKADDRBUFLEN); } struct pni_acceptor_t { int accept_queue_size; pn_list_t *accepts; iocpdesc_t *listen_sock; bool signalled; LPFN_ACCEPTEX fn_accept_ex; LPFN_GETACCEPTEXSOCKADDRS fn_get_accept_ex_sockaddrs; }; #define pni_acceptor_compare NULL #define pni_acceptor_inspect NULL #define pni_acceptor_hashcode NULL static void pni_acceptor_initialize(void *object) { pni_acceptor_t *acceptor = (pni_acceptor_t *) object; acceptor->accepts = pn_list(PN_VOID, IOCP_MAX_ACCEPTS); } static void pni_acceptor_finalize(void *object) { pni_acceptor_t *acceptor = (pni_acceptor_t *) object; size_t len = pn_list_size(acceptor->accepts); for (size_t i = 0; i < len; i++) free(pn_list_get(acceptor->accepts, i)); pn_free(acceptor->accepts); } static pni_acceptor_t *pni_acceptor(iocpdesc_t *iocpd) { static const pn_cid_t CID_pni_acceptor = CID_pn_void; static const pn_class_t clazz = PN_CLASS(pni_acceptor); pni_acceptor_t *acceptor = (pni_acceptor_t *) pn_class_new(&clazz, sizeof(pni_acceptor_t)); acceptor->listen_sock = iocpd; acceptor->accept_queue_size = 0; acceptor->signalled = false; pn_socket_t sock = acceptor->listen_sock->socket; acceptor->fn_accept_ex = lookup_accept_ex(sock); acceptor->fn_get_accept_ex_sockaddrs = lookup_get_accept_ex_sockaddrs(sock); return acceptor; } static void begin_accept(pni_acceptor_t *acceptor, accept_result_t *result) { if (acceptor->listen_sock->closing) { if (result) { free(result); acceptor->accept_queue_size--; } if (acceptor->accept_queue_size == 0) acceptor->signalled = true; return; } if (result) { reset_accept_result(result); } else { if (acceptor->accept_queue_size < IOCP_MAX_ACCEPTS && pn_list_size(acceptor->accepts) == acceptor->accept_queue_size ) { result = accept_result(acceptor->listen_sock); acceptor->accept_queue_size++; } else { // an async accept is still pending or max concurrent accepts already hit return; } } result->new_sock = create_same_type_socket(acceptor->listen_sock); if (result->new_sock) { // Not yet connected. result->new_sock->read_closed = true; result->new_sock->write_closed = true; bool success = acceptor->fn_accept_ex(acceptor->listen_sock->socket, result->new_sock->socket, result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN, &result->unused, (LPOVERLAPPED) result); if (!success && WSAGetLastError() != ERROR_IO_PENDING) { result->base.status = WSAGetLastError(); pn_list_add(acceptor->accepts, result); pni_events_update(acceptor->listen_sock, acceptor->listen_sock->events | PN_READABLE); } else { acceptor->listen_sock->ops_in_progress++; // This socket is equally involved in the async operation. result->new_sock->ops_in_progress++; } } else { iocpdesc_fail(acceptor->listen_sock, WSAGetLastError(), "create accept socket"); } } static void complete_accept(accept_result_t *result, HRESULT status) { result->new_sock->ops_in_progress--; iocpdesc_t *ld = result->base.iocpd; if (ld->read_closed) { if (!result->new_sock->closing) pni_iocp_begin_close(result->new_sock); free(result); // discard reap_check(ld); } else { result->base.status = status; pn_list_add(ld->acceptor->accepts, result); pni_events_update(ld, ld->events | PN_READABLE); } } pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error) { if (!is_listener(ld)) { set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP); return INVALID_SOCKET; } if (ld->read_closed) { set_iocp_error_status(error, PN_ERR, WSAENOTSOCK); return INVALID_SOCKET; } if (pn_list_size(ld->acceptor->accepts) == 0) { if (ld->events & PN_READABLE && ld->iocp->iocp_trace) iocp_log("listen socket readable with no available accept completions\n"); *would_block = true; return INVALID_SOCKET; } accept_result_t *result = (accept_result_t *) pn_list_get(ld->acceptor->accepts, 0); pn_list_del(ld->acceptor->accepts, 0, 1); if (!pn_list_size(ld->acceptor->accepts)) pni_events_update(ld, ld->events & ~PN_READABLE); // No pending accepts pn_socket_t accept_sock; if (result->base.status) { accept_sock = INVALID_SOCKET; pni_win32_error(ld->error, "accept failure", result->base.status); if (ld->iocp->iocp_trace) iocp_log("%s\n", pn_error_text(ld->error)); // App never sees this socket so close it here. pni_iocp_begin_close(result->new_sock); } else { accept_sock = result->new_sock->socket; // AcceptEx special setsockopt: setsockopt(accept_sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&ld->socket, sizeof (SOCKET)); if (addr && addrlen && *addrlen > 0) { sockaddr_storage *local_addr = NULL; sockaddr_storage *remote_addr = NULL; int local_addrlen, remote_addrlen; LPFN_GETACCEPTEXSOCKADDRS fn = ld->acceptor->fn_get_accept_ex_sockaddrs; fn(result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN, (SOCKADDR **) &local_addr, &local_addrlen, (SOCKADDR **) &remote_addr, &remote_addrlen); *addrlen = pn_min(*addrlen, remote_addrlen); memmove(addr, remote_addr, *addrlen); } } if (accept_sock != INVALID_SOCKET) { // Connected. result->new_sock->read_closed = false; result->new_sock->write_closed = false; } // Done with the completion result, so reuse it result->new_sock = NULL; begin_accept(ld->acceptor, result); return accept_sock; } // === Async connect processing typedef struct { iocp_result_t base; char address_buffer[IOCP_SOCKADDRBUFLEN]; struct addrinfo *addrinfo; } connect_result_t; #define connect_result_initialize NULL #define connect_result_compare NULL #define connect_result_inspect NULL #define connect_result_hashcode NULL static void connect_result_finalize(void *object) { connect_result_t *result = (connect_result_t *) object; // Do not release addrinfo until ConnectEx completes if (result->addrinfo) freeaddrinfo(result->addrinfo); } static connect_result_t *connect_result(iocpdesc_t *iocpd, struct addrinfo *addr) { static const pn_cid_t CID_connect_result = CID_pn_void; static const pn_class_t clazz = PN_CLASS(connect_result); connect_result_t *result = (connect_result_t *) pn_class_new(&clazz, sizeof(connect_result_t)); if (result) { memset(result, 0, sizeof(connect_result_t)); result->base.type = IOCP_CONNECT; result->base.iocpd = iocpd; result->addrinfo = addr; } return result; } pn_socket_t pni_iocp_begin_connect(iocp_t *iocp, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error) { // addr lives for the duration of the async connect. Caller has passed ownership here. // See connect_result_finalize(). // Use of Windows-specific ConnectEx() requires our socket to be "loosely" pre-bound: sockaddr_storage sa; memset(&sa, 0, sizeof(sa)); sa.ss_family = addr->ai_family; if (bind(sock, (SOCKADDR *) &sa, addr->ai_addrlen)) { pni_win32_error(error, "begin async connection", WSAGetLastError()); if (iocp->iocp_trace) iocp_log("%s\n", pn_error_text(error)); closesocket(sock); freeaddrinfo(addr); return INVALID_SOCKET; } iocpdesc_t *iocpd = pni_iocpdesc_create(iocp, sock, false); bind_to_completion_port(iocpd); LPFN_CONNECTEX fn_connect_ex = lookup_connect_ex(iocpd->socket); connect_result_t *result = connect_result(iocpd, addr); DWORD unused; bool success = fn_connect_ex(iocpd->socket, result->addrinfo->ai_addr, result->addrinfo->ai_addrlen, NULL, 0, &unused, (LPOVERLAPPED) result); if (!success && WSAGetLastError() != ERROR_IO_PENDING) { pni_win32_error(error, "ConnectEx failure", WSAGetLastError()); pn_free(result); iocpd->write_closed = true; iocpd->read_closed = true; if (iocp->iocp_trace) iocp_log("%s\n", pn_error_text(error)); } else { iocpd->ops_in_progress++; } return sock; } static void complete_connect(connect_result_t *result, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; if (iocpd->closing) { pn_free(result); reap_check(iocpd); return; } if (status) { iocpdesc_fail(iocpd, status, "Connect failure"); // Posix sets selectable events as follows: pni_events_update(iocpd, PN_READABLE | PN_EXPIRED); } else { release_sys_sendbuf(iocpd->socket); if (setsockopt(iocpd->socket, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0)) { iocpdesc_fail(iocpd, WSAGetLastError(), "Internal connect failure (update context)"); } else { pni_events_update(iocpd, PN_WRITABLE); start_reading(iocpd); } } pn_free(result); return; } // === Async writes static bool write_in_progress(iocpdesc_t *iocpd) { return pni_write_pipeline_size(iocpd->pipeline) != 0; } write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen) { write_result_t *result = (write_result_t *) calloc(sizeof(write_result_t), 1); if (result) { result->base.type = IOCP_WRITE; result->base.iocpd = iocpd; result->buffer.start = buf; result->buffer.size = buflen; } return result; } static int submit_write(write_result_t *result, const void *buf, size_t len) { WSABUF wsabuf; wsabuf.buf = (char *) buf; wsabuf.len = len; memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); return WSASend(result->base.iocpd->socket, &wsabuf, 1, NULL, 0, (LPOVERLAPPED) result, 0); } ssize_t pni_iocp_begin_write(iocpdesc_t *iocpd, const void *buf, size_t len, bool *would_block, pn_error_t *error) { if (len == 0) return 0; *would_block = false; if (is_listener(iocpd)) { set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP); return INVALID_SOCKET; } if (iocpd->closing) { set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN); return SOCKET_ERROR; } if (iocpd->write_closed) { assert(pn_error_code(iocpd->error)); pn_error_copy(error, iocpd->error); if (iocpd->iocp->iocp_trace) iocp_log("write error: %s\n", pn_error_text(error)); return SOCKET_ERROR; } if (len == 0) return 0; if (!(iocpd->events & PN_WRITABLE)) { *would_block = true; return SOCKET_ERROR; } size_t written = 0; size_t requested = len; const char *outgoing = (const char *) buf; size_t available = pni_write_pipeline_reserve(iocpd->pipeline, len); if (!available) { *would_block = true; return SOCKET_ERROR; } for (size_t wr_count = 0; wr_count < available; wr_count++) { write_result_t *result = pni_write_pipeline_next(iocpd->pipeline); assert(result); result->base.iocpd = iocpd; ssize_t actual_len = pn_min(len, result->buffer.size); result->requested = actual_len; memmove((void *)result->buffer.start, outgoing, actual_len); outgoing += actual_len; written += actual_len; len -= actual_len; int werror = submit_write(result, result->buffer.start, actual_len); if (werror && WSAGetLastError() != ERROR_IO_PENDING) { pni_write_pipeline_return(iocpd->pipeline, result); iocpdesc_fail(iocpd, WSAGetLastError(), "overlapped send"); return SOCKET_ERROR; } iocpd->ops_in_progress++; } if (!pni_write_pipeline_writable(iocpd->pipeline)) pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE); return written; } /* * Note: iocp write completion is not "bytes on the wire", it is "peer * acked the sent bytes". Completion can be seconds on a slow * consuming peer. */ static void complete_write(write_result_t *result, DWORD xfer_count, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; if (iocpd->closing) { pni_write_pipeline_return(iocpd->pipeline, result); if (!iocpd->write_closed && !write_in_progress(iocpd)) iocp_shutdown(iocpd); reap_check(iocpd); return; } if (status == 0 && xfer_count > 0) { if (xfer_count != result->requested) { // Is this recoverable? How to preserve order if multiple overlapped writes? pni_write_pipeline_return(iocpd->pipeline, result); iocpdesc_fail(iocpd, WSA_OPERATION_ABORTED, "Partial overlapped write on socket"); return; } else { // Success. pni_write_pipeline_return(iocpd->pipeline, result); if (pni_write_pipeline_writable(iocpd->pipeline)) pni_events_update(iocpd, iocpd->events | PN_WRITABLE); return; } } // Other error pni_write_pipeline_return(iocpd->pipeline, result); if (status == WSAECONNABORTED || status == WSAECONNRESET || status == WSAENOTCONN || status == ERROR_NETNAME_DELETED) { iocpd->write_closed = true; iocpd->poll_error = true; pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE); pni_win32_error(iocpd->error, "Remote close or timeout", status); } else { iocpdesc_fail(iocpd, status, "IOCP async write error"); } } // === Async reads struct read_result_t { iocp_result_t base; size_t drain_count; char unused_buf[1]; }; static read_result_t *read_result(iocpdesc_t *iocpd) { read_result_t *result = (read_result_t *) calloc(sizeof(read_result_t), 1); if (result) { result->base.type = IOCP_READ; result->base.iocpd = iocpd; } return result; } static void begin_zero_byte_read(iocpdesc_t *iocpd) { if (iocpd->read_in_progress) return; if (iocpd->read_closed) { pni_events_update(iocpd, iocpd->events | PN_READABLE); return; } read_result_t *result = iocpd->read_result; memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); DWORD flags = 0; WSABUF wsabuf; wsabuf.buf = result->unused_buf; wsabuf.len = 0; int rc = WSARecv(iocpd->socket, &wsabuf, 1, NULL, &flags, &result->base.overlapped, 0); if (rc && WSAGetLastError() != ERROR_IO_PENDING) { iocpdesc_fail(iocpd, WSAGetLastError(), "IOCP read error"); return; } iocpd->ops_in_progress++; iocpd->read_in_progress = true; } static void drain_until_closed(iocpdesc_t *iocpd) { size_t max_drain = 16 * 1024; char buf[512]; read_result_t *result = iocpd->read_result; while (result->drain_count < max_drain) { int rv = recv(iocpd->socket, buf, 512, 0); if (rv > 0) result->drain_count += rv; else if (rv == 0) { iocpd->read_closed = true; return; } else if (WSAGetLastError() == WSAEWOULDBLOCK) { // wait a little longer start_reading(iocpd); return; } else break; } // Graceful close indication unlikely, force the issue if (iocpd->iocp->iocp_trace) if (result->drain_count >= max_drain) iocp_log("graceful close on reader abandoned (too many chars)\n"); else iocp_log("graceful close on reader abandoned: %d\n", WSAGetLastError()); iocpd->read_closed = true; } static void complete_read(read_result_t *result, DWORD xfer_count, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; iocpd->read_in_progress = false; if (iocpd->closing) { // Application no longer reading, but we are looking for a zero length read if (!iocpd->read_closed) drain_until_closed(iocpd); reap_check(iocpd); return; } if (status == 0 && xfer_count == 0) { // Success. pni_events_update(iocpd, iocpd->events | PN_READABLE); } else { iocpdesc_fail(iocpd, status, "IOCP read complete error"); } } ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error) { if (size == 0) return 0; *would_block = false; if (is_listener(iocpd)) { set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP); return SOCKET_ERROR; } if (iocpd->closing) { // Previous call to pn_close() set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN); return SOCKET_ERROR; } if (iocpd->read_closed) { if (pn_error_code(iocpd->error)) pn_error_copy(error, iocpd->error); else set_iocp_error_status(error, PN_ERR, WSAENOTCONN); return SOCKET_ERROR; } int count = recv(iocpd->socket, (char *) buf, size, 0); if (count > 0) { pni_events_update(iocpd, iocpd->events & ~PN_READABLE); begin_zero_byte_read(iocpd); return (ssize_t) count; } else if (count == 0) { iocpd->read_closed = true; return 0; } if (WSAGetLastError() == WSAEWOULDBLOCK) *would_block = true; else { set_iocp_error_status(error, PN_ERR, WSAGetLastError()); iocpd->read_closed = true; } return SOCKET_ERROR; } static void start_reading(iocpdesc_t *iocpd) { begin_zero_byte_read(iocpd); } // === The iocp descriptor static void pni_iocpdesc_initialize(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; memset(iocpd, 0, sizeof(iocpdesc_t)); iocpd->socket = INVALID_SOCKET; } static void pni_iocpdesc_finalize(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; pn_free(iocpd->acceptor); pn_error_free(iocpd->error); if (iocpd->pipeline) if (write_in_progress(iocpd)) iocp_log("iocp descriptor write leak\n"); else pn_free(iocpd->pipeline); if (iocpd->read_in_progress) iocp_log("iocp descriptor read leak\n"); else free(iocpd->read_result); } static uintptr_t pni_iocpdesc_hashcode(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; return iocpd->socket; } #define pni_iocpdesc_compare NULL #define pni_iocpdesc_inspect NULL // Reference counted in the iocpdesc map, zombie_list, selector. static iocpdesc_t *pni_iocpdesc(pn_socket_t s) { static const pn_cid_t CID_pni_iocpdesc = CID_pn_void; static pn_class_t clazz = PN_CLASS(pni_iocpdesc); iocpdesc_t *iocpd = (iocpdesc_t *) pn_class_new(&clazz, sizeof(iocpdesc_t)); assert(iocpd); iocpd->socket = s; return iocpd; } static bool is_listener_socket(pn_socket_t s) { BOOL tval = false; int tvalsz = sizeof(tval); int code = getsockopt(s, SOL_SOCKET, SO_ACCEPTCONN, (char *)&tval, &tvalsz); return code == 0 && tval; } iocpdesc_t *pni_iocpdesc_create(iocp_t *iocp, pn_socket_t s, bool external) { assert (s != INVALID_SOCKET); assert(!pni_iocpdesc_map_get(iocp, s)); bool listening = is_listener_socket(s); iocpdesc_t *iocpd = pni_iocpdesc(s); iocpd->iocp = iocp; if (iocpd) { iocpd->external = external; iocpd->error = pn_error(); if (listening) { iocpd->acceptor = pni_acceptor(iocpd); } else { iocpd->pipeline = pni_write_pipeline(iocpd); iocpd->read_result = read_result(iocpd); } pni_iocpdesc_map_push(iocpd); } return iocpd; } iocpdesc_t *pni_deadline_desc(iocp_t *iocp) { // Non IO descriptor for selector deadlines. Do not add to iocpdesc map or // zombie list. Selector responsible to free/decref object. iocpdesc_t *iocpd = pni_iocpdesc(PN_INVALID_SOCKET); iocpd->iocp = iocp; iocpd->deadline_desc = true; return iocpd; } // === Fast lookup of a socket's iocpdesc_t iocpdesc_t *pni_iocpdesc_map_get(iocp_t *iocp, pn_socket_t s) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_get(iocp->iocpdesc_map, s); return iocpd; } void pni_iocpdesc_map_push(iocpdesc_t *iocpd) { pn_hash_put(iocpd->iocp->iocpdesc_map, iocpd->socket, iocpd); pn_decref(iocpd); assert(pn_refcount(iocpd) == 1); } void pni_iocpdesc_map_del(iocp_t *iocp, pn_socket_t s) { pn_hash_del(iocp->iocpdesc_map, (uintptr_t) s); } static void bind_to_completion_port(iocpdesc_t *iocpd) { if (iocpd->bound) return; if (!iocpd->iocp->completion_port) { iocpdesc_fail(iocpd, WSAEINVAL, "Incomplete setup, no completion port."); return; } if (CreateIoCompletionPort ((HANDLE) iocpd->socket, iocpd->iocp->completion_port, 0, 0)) iocpd->bound = true; else { iocpdesc_fail(iocpd, GetLastError(), "IOCP socket setup."); } } static void release_sys_sendbuf(SOCKET s) { // Set the socket's send buffer size to zero. int sz = 0; int status = setsockopt(s, SOL_SOCKET, SO_SNDBUF, (const char *)&sz, sizeof(int)); assert(status == 0); } void pni_iocpdesc_start(iocpdesc_t *iocpd) { if (iocpd->bound) return; bind_to_completion_port(iocpd); if (is_listener(iocpd)) { begin_accept(iocpd->acceptor, NULL); } else { release_sys_sendbuf(iocpd->socket); pni_events_update(iocpd, PN_WRITABLE); start_reading(iocpd); } } static void complete(iocp_result_t *result, bool success, DWORD num_transferred) { result->iocpd->ops_in_progress--; DWORD status = success ? 0 : GetLastError(); switch (result->type) { case IOCP_ACCEPT: complete_accept((accept_result_t *) result, status); break; case IOCP_CONNECT: complete_connect((connect_result_t *) result, status); break; case IOCP_WRITE: complete_write((write_result_t *) result, num_transferred, status); break; case IOCP_READ: complete_read((read_result_t *) result, num_transferred, status); break; default: assert(false); } } void pni_iocp_drain_completions(iocp_t *iocp) { while (true) { DWORD timeout_ms = 0; DWORD num_transferred = 0; ULONG_PTR completion_key = 0; OVERLAPPED *overlapped = 0; bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred, &completion_key, &overlapped, timeout_ms); if (!overlapped) return; // timed out iocp_result_t *result = (iocp_result_t *) overlapped; complete(result, good_op, num_transferred); } } // returns: -1 on error, 0 on timeout, 1 successful completion int pni_iocp_wait_one(iocp_t *iocp, int timeout, pn_error_t *error) { DWORD win_timeout = (timeout < 0) ? INFINITE : (DWORD) timeout; DWORD num_transferred = 0; ULONG_PTR completion_key = 0; OVERLAPPED *overlapped = 0; bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred, &completion_key, &overlapped, win_timeout); if (!overlapped) if (GetLastError() == WAIT_TIMEOUT) return 0; else { if (error) pni_win32_error(error, "GetQueuedCompletionStatus", GetLastError()); return -1; } iocp_result_t *result = (iocp_result_t *) overlapped; complete(result, good_op, num_transferred); return 1; } // === Close (graceful and otherwise) // zombie_list is for sockets transitioning out of iocp on their way to zero ops_in_progress // and fully closed. static void zombie_list_add(iocpdesc_t *iocpd) { assert(iocpd->closing); if (!iocpd->ops_in_progress) { // No need to make a zombie. if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; } return; } // Allow 2 seconds for graceful shutdown before releasing socket resource. iocpd->reap_time = pn_i_now() + 2000; pn_list_add(iocpd->iocp->zombie_list, iocpd); } static void reap_check(iocpdesc_t *iocpd) { if (iocpd->closing && !iocpd->ops_in_progress) { if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; } pn_list_remove(iocpd->iocp->zombie_list, iocpd); // iocpd is decref'ed and possibly released } } pn_timestamp_t pni_zombie_deadline(iocp_t *iocp) { if (pn_list_size(iocp->zombie_list)) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, 0); return iocpd->reap_time; } return 0; } void pni_zombie_check(iocp_t *iocp, pn_timestamp_t now) { pn_list_t *zl = iocp->zombie_list; // Look for stale zombies that should have been reaped by "now" for (size_t idx = 0; idx < pn_list_size(zl); idx++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(zl, idx); if (iocpd->reap_time > now) return; if (iocpd->socket == INVALID_SOCKET) continue; assert(iocpd->ops_in_progress > 0); if (iocp->iocp_trace) iocp_log("async close: graceful close timeout exceeded\n"); closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; // outstanding ops should complete immediately now } } static void drain_zombie_completions(iocp_t *iocp) { // No more pn_selector_select() from App, but zombies still need care and feeding // until their outstanding async actions complete. pni_iocp_drain_completions(iocp); // Discard any that have no pending async IO size_t sz = pn_list_size(iocp->zombie_list); for (size_t idx = 0; idx < sz;) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, idx); if (!iocpd->ops_in_progress) { pn_list_del(iocp->zombie_list, idx, 1); sz--; } else { idx++; } } unsigned shutdown_grace = 2000; char *override = getenv("PN_SHUTDOWN_GRACE"); if (override) { int grace = atoi(override); if (grace > 0 && grace < 60000) shutdown_grace = (unsigned) grace; } pn_timestamp_t now = pn_i_now(); pn_timestamp_t deadline = now + shutdown_grace; while (pn_list_size(iocp->zombie_list)) { if (now >= deadline) break; int rv = pni_iocp_wait_one(iocp, deadline - now, NULL); if (rv < 0) { iocp_log("unexpected IOCP failure on Proton IO shutdown %d\n", GetLastError()); break; } now = pn_i_now(); } if (now >= deadline && pn_list_size(iocp->zombie_list) && iocp->iocp_trace) // Should only happen if really slow TCP handshakes, i.e. total network failure iocp_log("network failure on Proton shutdown\n"); } static pn_list_t *iocp_map_close_all(iocp_t *iocp) { // Zombify stragglers, i.e. no pn_close() from the application. pn_list_t *externals = pn_list(PN_OBJECT, 0); for (pn_handle_t entry = pn_hash_head(iocp->iocpdesc_map); entry; entry = pn_hash_next(iocp->iocpdesc_map, entry)) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_value(iocp->iocpdesc_map, entry); // Just listeners first. if (is_listener(iocpd)) { if (iocpd->external) { // Owned by application, just keep a temporary reference to it. // iocp_result_t structs must not be free'd until completed or // the completion port is closed. if (iocpd->ops_in_progress) pn_list_add(externals, iocpd); pni_iocpdesc_map_del(iocp, iocpd->socket); } else { // Make it a zombie. pni_iocp_begin_close(iocpd); } } } pni_iocp_drain_completions(iocp); for (pn_handle_t entry = pn_hash_head(iocp->iocpdesc_map); entry; entry = pn_hash_next(iocp->iocpdesc_map, entry)) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_value(iocp->iocpdesc_map, entry); if (iocpd->external) { iocpd->read_closed = true; // Do not consume from read side iocpd->write_closed = true; // Do not shutdown write side if (iocpd->ops_in_progress) pn_list_add(externals, iocpd); pni_iocpdesc_map_del(iocp, iocpd->socket); } else { // Make it a zombie. pni_iocp_begin_close(iocpd); } } return externals; } static void zombie_list_hard_close_all(iocp_t *iocp) { pni_iocp_drain_completions(iocp); size_t zs = pn_list_size(iocp->zombie_list); for (size_t i = 0; i < zs; i++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i); if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; iocpd->write_closed = true; } } pni_iocp_drain_completions(iocp); // Zombies should be all gone. Do a sanity check. zs = pn_list_size(iocp->zombie_list); int remaining = 0; int ops = 0; for (size_t i = 0; i < zs; i++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i); remaining++; ops += iocpd->ops_in_progress; } if (remaining) iocp_log("Proton: %d unfinished close operations (ops count = %d)\n", remaining, ops); } static void iocp_shutdown(iocpdesc_t *iocpd) { if (iocpd->socket == PN_INVALID_SOCKET) return; // Hard close in progress if (shutdown(iocpd->socket, SD_SEND)) { int err = WSAGetLastError(); if (err != WSAECONNABORTED && err != WSAECONNRESET && err != WSAENOTCONN) if (iocpd->iocp->iocp_trace) iocp_log("socket shutdown failed %d\n", err); } iocpd->write_closed = true; } void pni_iocp_begin_close(iocpdesc_t *iocpd) { assert (!iocpd->closing); if (is_listener(iocpd)) { // Listening socket is easy. Close the socket which will cancel async ops. pn_socket_t old_sock = iocpd->socket; iocpd->socket = INVALID_SOCKET; iocpd->closing = true; iocpd->read_closed = true; iocpd->write_closed = true; closesocket(old_sock); // Pending accepts will now complete. Zombie can die when all consumed. zombie_list_add(iocpd); pni_iocpdesc_map_del(iocpd->iocp, old_sock); // may pn_free *iocpd } else { // Continue async operation looking for graceful close confirmation or timeout. pn_socket_t old_sock = iocpd->socket; iocpd->closing = true; if (!iocpd->write_closed && !write_in_progress(iocpd)) iocp_shutdown(iocpd); zombie_list_add(iocpd); pni_iocpdesc_map_del(iocpd->iocp, old_sock); // may pn_free *iocpd } } // === iocp_t #define pni_iocp_hashcode NULL #define pni_iocp_compare NULL #define pni_iocp_inspect NULL void pni_iocp_initialize(void *obj) { iocp_t *iocp = (iocp_t *) obj; memset(iocp, 0, sizeof(iocp_t)); pni_shared_pool_create(iocp); iocp->completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0); assert(iocp->completion_port != NULL); iocp->iocpdesc_map = pn_hash(PN_OBJECT, 0, 0.75); iocp->zombie_list = pn_list(PN_OBJECT, 0); iocp->iocp_trace = pn_env_bool("PN_TRACE_DRV"); iocp->selector = NULL; } void pni_iocp_finalize(void *obj) { iocp_t *iocp = (iocp_t *) obj; // Move sockets to closed state, except external sockets. pn_list_t *externals = iocp_map_close_all(iocp); // Now everything with ops_in_progress is in the zombie_list or the externals list. assert(!pn_hash_head(iocp->iocpdesc_map)); pn_free(iocp->iocpdesc_map); drain_zombie_completions(iocp); // Last chance for graceful close zombie_list_hard_close_all(iocp); CloseHandle(iocp->completion_port); // This cancels all our async ops iocp->completion_port = NULL; if (pn_list_size(externals) && iocp->iocp_trace) iocp_log("%d external sockets not closed and removed from Proton IOCP control\n", pn_list_size(externals)); // Now safe to free everything that might be touched by a former async operation. pn_free(externals); pn_free(iocp->zombie_list); pni_shared_pool_free(iocp); } iocp_t *pni_iocp() { static const pn_cid_t CID_pni_iocp = CID_pn_void; static const pn_class_t clazz = PN_CLASS(pni_iocp); iocp_t *iocp = (iocp_t *) pn_class_new(&clazz, sizeof(iocp_t)); return iocp; } qpid-proton-0.22.0/proton-c/src/reactor/io/windows/io.c0000664000000000000000000003060013257152177017613 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #define FD_SETSIZE 2048 #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #if _WIN32_WINNT < 0x0501 #error "Proton requires Windows API support for XP or later." #endif #include #include #include #include "reactor/io.h" #include "reactor/selector.h" #include "platform/platform.h" #include "iocp.h" #include "core/util.h" #include #include #include #include #include int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code) { // Error code can be from GetLastError or WSAGetLastError, char err[1024] = {0}; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, code, 0, (LPSTR)&err, sizeof(err), NULL); return pn_error_format(error, PN_ERR, "%s: %s", msg, err); } static void io_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } struct pn_io_t { char host[NI_MAXHOST]; char serv[NI_MAXSERV]; pn_error_t *error; bool trace; bool wouldblock; iocp_t *iocp; }; void pn_io_initialize(void *obj) { pn_io_t *io = (pn_io_t *) obj; io->error = pn_error(); io->wouldblock = false; io->trace = pn_env_bool("PN_TRACE_DRV"); /* Request WinSock 2.2 */ WORD wsa_ver = MAKEWORD(2, 2); WSADATA unused; int err = WSAStartup(wsa_ver, &unused); if (err) { pni_win32_error(io->error, "WSAStartup", WSAGetLastError()); fprintf(stderr, "Can't load WinSock: %s\n", pn_error_text(io->error)); } io->iocp = pni_iocp(); } void pn_io_finalize(void *obj) { pn_io_t *io = (pn_io_t *) obj; pn_selector_t *sel = io->iocp->selector; pn_free(io->iocp); if (sel) pn_decref(sel); pn_error_free(io->error); WSACleanup(); } #define pn_io_hashcode NULL #define pn_io_compare NULL #define pn_io_inspect pn_io_t *pn_io(void) { static const pn_class_t clazz = PN_CLASS(pn_io); pn_io_t *io = (pn_io_t *) pn_class_new(&clazz, sizeof(pn_io_t)); return io; } void pn_io_free(pn_io_t *io) { pn_free(io); } pn_error_t *pn_io_error(pn_io_t *io) { assert(io); return io->error; } static void ensure_unique(pn_io_t *io, pn_socket_t new_socket) { // A brand new socket can have the same HANDLE value as a previous // one after a socketclose. If the application closes one itself // (i.e. not using pn_close), we don't find out about it until here. iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, new_socket); if (iocpd) { if (io->trace) io_log("Stale external socket reference discarded\n"); // Re-use means former socket instance was closed assert(iocpd->ops_in_progress == 0); assert(iocpd->external); // Clean up the straggler as best we can pn_socket_t sock = iocpd->socket; iocpd->socket = INVALID_SOCKET; pni_iocpdesc_map_del(io->iocp, sock); // may free the iocpdesc_t depending on refcount } } /* * This heavyweight surrogate pipe could be replaced with a normal Windows pipe * now that select() is no longer used. If interrupt semantics are all that is * needed, a simple user space counter and reserved completion status would * probably suffice. */ static int pni_socket_pair(pn_io_t *io, SOCKET sv[2]); int pn_pipe(pn_io_t *io, pn_socket_t *dest) { int n = pni_socket_pair(io, dest); if (n) { pni_win32_error(io->error, "pipe", WSAGetLastError()); } return n; } static void pn_configure_sock(pn_io_t *io, pn_socket_t sock) { // // Disable the Nagle algorithm on TCP connections. // int flag = 1; if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)) != 0) { perror("setsockopt"); } u_long nonblock = 1; if (ioctlsocket(sock, FIONBIO, &nonblock)) { perror("ioctlsocket"); } } static inline pn_socket_t pni_create_socket(int domain, int protocol); static const char *amqp_service(const char *port) { // Help older Windows to know about amqp[s] ports if (port) { if (!strcmp("amqp", port)) return "5672"; if (!strcmp("amqps", port)) return "5671"; } return port; } pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port) { struct addrinfo *addr; int code = getaddrinfo(host, amqp_service(port), NULL, &addr); if (code) { pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s\n", host, port, gai_strerror(code)); return INVALID_SOCKET; } pn_socket_t sock = pni_create_socket(addr->ai_family, addr->ai_protocol); if (sock == INVALID_SOCKET) { pni_win32_error(io->error, "pni_create_socket", WSAGetLastError()); return INVALID_SOCKET; } ensure_unique(io, sock); bool optval = 1; if (setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (const char *) &optval, sizeof(optval)) == -1) { pni_win32_error(io->error, "setsockopt", WSAGetLastError()); closesocket(sock); return INVALID_SOCKET; } if (bind(sock, addr->ai_addr, addr->ai_addrlen) == -1) { pni_win32_error(io->error, "bind", WSAGetLastError()); freeaddrinfo(addr); closesocket(sock); return INVALID_SOCKET; } freeaddrinfo(addr); if (listen(sock, 50) == -1) { pni_win32_error(io->error, "listen", WSAGetLastError()); closesocket(sock); return INVALID_SOCKET; } if (io->iocp->selector) { iocpdesc_t *iocpd = pni_iocpdesc_create(io->iocp, sock, false); if (!iocpd) { pn_i_error_from_errno(io->error, "register"); closesocket(sock); return INVALID_SOCKET; } pni_iocpdesc_start(iocpd); } return sock; } pn_socket_t pn_connect(pn_io_t *io, const char *hostarg, const char *port) { // convert "0.0.0.0" to "127.0.0.1" on Windows for outgoing sockets const char *host = strcmp("0.0.0.0", hostarg) ? hostarg : "127.0.0.1"; struct addrinfo *addr; int code = getaddrinfo(host, amqp_service(port), NULL, &addr); if (code) { pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s", host, port, gai_strerror(code)); return INVALID_SOCKET; } pn_socket_t sock = pni_create_socket(addr->ai_family, addr->ai_protocol); if (sock == INVALID_SOCKET) { pni_win32_error(io->error, "proton pni_create_socket", WSAGetLastError()); freeaddrinfo(addr); return INVALID_SOCKET; } ensure_unique(io, sock); pn_configure_sock(io, sock); if (io->iocp->selector) { return pni_iocp_begin_connect(io->iocp, sock, addr, io->error); } else { if (connect(sock, addr->ai_addr, addr->ai_addrlen) != 0) { if (WSAGetLastError() != WSAEWOULDBLOCK) { pni_win32_error(io->error, "connect", WSAGetLastError()); freeaddrinfo(addr); closesocket(sock); return INVALID_SOCKET; } } freeaddrinfo(addr); return sock; } } pn_socket_t pn_accept(pn_io_t *io, pn_socket_t listen_sock, char *name, size_t size) { struct sockaddr_storage addr; socklen_t addrlen = sizeof(addr); iocpdesc_t *listend = pni_iocpdesc_map_get(io->iocp, listen_sock); pn_socket_t accept_sock; *name = '\0'; if (listend) accept_sock = pni_iocp_end_accept(listend, (struct sockaddr *) &addr, &addrlen, &io->wouldblock, io->error); else { // User supplied socket accept_sock = accept(listen_sock, (struct sockaddr *) &addr, &addrlen); if (accept_sock == INVALID_SOCKET) pni_win32_error(io->error, "sync accept", WSAGetLastError()); } if (accept_sock == INVALID_SOCKET) return accept_sock; int code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, NI_MAXHOST, io->serv, NI_MAXSERV, 0); if (code) code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, NI_MAXHOST, io->serv, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV); if (code) { pn_error_format(io->error, PN_ERR, "getnameinfo: %s\n", gai_strerror(code)); pn_close(io, accept_sock); return INVALID_SOCKET; } else { pn_configure_sock(io, accept_sock); pni_snprintf(name, size, "%s:%s", io->host, io->serv); if (listend) { pni_iocpdesc_start(pni_iocpdesc_map_get(io->iocp, accept_sock)); } return accept_sock; } } static inline pn_socket_t pni_create_socket(int domain, int protocol) { return socket(domain, SOCK_STREAM, protocol); } ssize_t pn_send(pn_io_t *io, pn_socket_t sockfd, const void *buf, size_t len) { ssize_t count; iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, sockfd); if (iocpd) { count = pni_iocp_begin_write(iocpd, buf, len, &io->wouldblock, io->error); } else { count = send(sockfd, (const char *) buf, len, 0); io->wouldblock = count < 0 && WSAGetLastError() == WSAEWOULDBLOCK; } return count; } ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size) { ssize_t count; iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, socket); if (iocpd) { count = pni_iocp_recv(iocpd, buf, size, &io->wouldblock, io->error); } else { count = recv(socket, (char *) buf, size, 0); io->wouldblock = count < 0 && WSAGetLastError() == WSAEWOULDBLOCK; } return count; } ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) { // non-socket io is mapped to socket io for now. See pn_pipe() return pn_send(io, socket, buf, size); } ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size) { return pn_recv(io, socket, buf, size); } void pn_close(pn_io_t *io, pn_socket_t socket) { iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, socket); if (iocpd) pni_iocp_begin_close(iocpd); else { closesocket(socket); } } bool pn_wouldblock(pn_io_t *io) { return io->wouldblock; } pn_selector_t *pn_io_selector(pn_io_t *io) { if (io->iocp->selector == NULL) { io->iocp->selector = pni_selector_create(io->iocp); pn_incref(io->iocp->selector); } return io->iocp->selector; } static void configure_pipe_socket(pn_io_t *io, pn_socket_t sock) { u_long v = 1; ioctlsocket (sock, FIONBIO, &v); ensure_unique(io, sock); iocpdesc_t *iocpd = pni_iocpdesc_create(io->iocp, sock, false); pni_iocpdesc_start(iocpd); } static int pni_socket_pair (pn_io_t *io, SOCKET sv[2]) { // no socketpair on windows. provide pipe() semantics using sockets struct protoent * pe_tcp = getprotobyname("tcp"); if (pe_tcp == NULL) { perror("getprotobyname"); return -1; } SOCKET sock = socket(AF_INET, SOCK_STREAM, pe_tcp->p_proto); if (sock == INVALID_SOCKET) { perror("socket"); return -1; } BOOL b = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &b, sizeof(b)) == -1) { perror("setsockopt"); closesocket(sock); return -1; } else { struct sockaddr_in addr = {0}; addr.sin_family = AF_INET; addr.sin_port = 0; addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) { perror("bind"); closesocket(sock); return -1; } } if (listen(sock, 50) == -1) { perror("listen"); closesocket(sock); return -1; } if ((sv[1] = socket(AF_INET, SOCK_STREAM, pe_tcp->p_proto)) == INVALID_SOCKET) { perror("sock1"); closesocket(sock); return -1; } else { struct sockaddr addr = {0}; int l = sizeof(addr); if (getsockname(sock, &addr, &l) == -1) { perror("getsockname"); closesocket(sock); return -1; } if (connect(sv[1], &addr, sizeof(addr)) == -1) { int err = WSAGetLastError(); fprintf(stderr, "connect wsaerrr %d\n", err); closesocket(sock); closesocket(sv[1]); return -1; } if ((sv[0] = accept(sock, &addr, &l)) == INVALID_SOCKET) { perror("accept"); closesocket(sock); closesocket(sv[1]); return -1; } } configure_pipe_socket(io, sv[0]); configure_pipe_socket(io, sv[1]); closesocket(sock); return 0; } qpid-proton-0.22.0/proton-c/src/reactor/io/posix/0000775000000000000000000000000013257152177016511 5ustar qpid-proton-0.22.0/proton-c/src/reactor/io/posix/selector.c0000664000000000000000000001334513257152177020503 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "core/util.h" #include "platform/platform.h" // pn_i_now, pn_i_error_from_errno #include "reactor/io.h" #include "reactor/selector.h" #include "reactor/selectable.h" #include #include #include #include struct pn_selector_t { struct pollfd *fds; pn_timestamp_t *deadlines; size_t capacity; pn_list_t *selectables; size_t current; pn_timestamp_t awoken; pn_error_t *error; }; void pn_selector_initialize(void *obj) { pn_selector_t *selector = (pn_selector_t *) obj; selector->fds = NULL; selector->deadlines = NULL; selector->capacity = 0; selector->selectables = pn_list(PN_WEAKREF, 0); selector->current = 0; selector->awoken = 0; selector->error = pn_error(); } void pn_selector_finalize(void *obj) { pn_selector_t *selector = (pn_selector_t *) obj; free(selector->fds); free(selector->deadlines); pn_free(selector->selectables); pn_error_free(selector->error); } #define pn_selector_hashcode NULL #define pn_selector_compare NULL #define pn_selector_inspect NULL pn_selector_t *pni_selector(void) { static const pn_class_t clazz = PN_CLASS(pn_selector); pn_selector_t *selector = (pn_selector_t *) pn_class_new(&clazz, sizeof(pn_selector_t)); return selector; } void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable) { assert(selector); assert(selectable); assert(pni_selectable_get_index(selectable) < 0); if (pni_selectable_get_index(selectable) < 0) { pn_list_add(selector->selectables, selectable); size_t size = pn_list_size(selector->selectables); if (selector->capacity < size) { selector->fds = (struct pollfd *) realloc(selector->fds, size*sizeof(struct pollfd)); selector->deadlines = (pn_timestamp_t *) realloc(selector->deadlines, size*sizeof(pn_timestamp_t)); selector->capacity = size; } pni_selectable_set_index(selectable, size - 1); } pn_selector_update(selector, selectable); } void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable) { int idx = pni_selectable_get_index(selectable); assert(idx >= 0); selector->fds[idx].fd = pn_selectable_get_fd(selectable); selector->fds[idx].events = 0; selector->fds[idx].revents = 0; if (pn_selectable_is_reading(selectable)) { selector->fds[idx].events |= POLLIN; } if (pn_selectable_is_writing(selectable)) { selector->fds[idx].events |= POLLOUT; } selector->deadlines[idx] = pn_selectable_get_deadline(selectable); } void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable) { assert(selector); assert(selectable); int idx = pni_selectable_get_index(selectable); assert(idx >= 0); pn_list_del(selector->selectables, idx, 1); size_t size = pn_list_size(selector->selectables); for (size_t i = idx; i < size; i++) { pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(selector->selectables, i); pni_selectable_set_index(sel, i); selector->fds[i] = selector->fds[i + 1]; } pni_selectable_set_index(selectable, -1); if (selector->current >= (size_t) idx) { selector->current--; } } size_t pn_selector_size(pn_selector_t *selector) { assert(selector); return pn_list_size(selector->selectables); } int pn_selector_select(pn_selector_t *selector, int timeout) { assert(selector); size_t size = pn_list_size(selector->selectables); if (timeout) { pn_timestamp_t deadline = 0; for (size_t i = 0; i < size; i++) { pn_timestamp_t d = selector->deadlines[i]; if (d) deadline = (deadline == 0) ? d : pn_min(deadline, d); } if (deadline) { pn_timestamp_t now = pn_i_now(); int64_t delta = deadline - now; if (delta < 0) { timeout = 0; } else if (delta < timeout) { timeout = delta; } } } int error = 0; int result = poll(selector->fds, size, timeout); if (result == -1) { error = pn_i_error_from_errno(selector->error, "poll"); } else { selector->current = 0; selector->awoken = pn_i_now(); } return error; } pn_selectable_t *pn_selector_next(pn_selector_t *selector, int *events) { pn_list_t *l = selector->selectables; size_t size = pn_list_size(l); while (selector->current < size) { pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(l, selector->current); struct pollfd *pfd = &selector->fds[selector->current]; pn_timestamp_t deadline = selector->deadlines[selector->current]; int ev = 0; if (pfd->revents & POLLIN) { ev |= PN_READABLE; } if ((pfd->revents & POLLERR) || (pfd->revents & POLLHUP) || (pfd->revents & POLLNVAL)) { ev |= PN_ERROR; } if (pfd->revents & POLLOUT) { ev |= PN_WRITABLE; } if (deadline && selector->awoken >= deadline) { ev |= PN_EXPIRED; } selector->current++; if (ev) { *events = ev; return sel; } } return NULL; } void pn_selector_free(pn_selector_t *selector) { assert(selector); pn_free(selector); } qpid-proton-0.22.0/proton-c/src/reactor/io/posix/io.c0000664000000000000000000002165113257152177017271 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "reactor/io.h" #include "reactor/selector.h" #include "platform/platform.h" // pn_i_error_from_errno #include #include #include #include #include #include #include #include #include #include #include #include #define MAX_HOST (1024) #define MAX_SERV (64) struct pn_io_t { char host[MAX_HOST]; char serv[MAX_SERV]; pn_error_t *error; pn_selector_t *selector; bool wouldblock; }; void pn_io_initialize(void *obj) { pn_io_t *io = (pn_io_t *) obj; io->error = pn_error(); io->wouldblock = false; io->selector = NULL; } void pn_io_finalize(void *obj) { pn_io_t *io = (pn_io_t *) obj; pn_error_free(io->error); } #define pn_io_hashcode NULL #define pn_io_compare NULL #define pn_io_inspect NULL pn_io_t *pn_io(void) { static const pn_class_t clazz = PN_CLASS(pn_io); pn_io_t *io = (pn_io_t *) pn_class_new(&clazz, sizeof(pn_io_t)); return io; } void pn_io_free(pn_io_t *io) { pn_free(io); } pn_error_t *pn_io_error(pn_io_t *io) { assert(io); return io->error; } int pn_pipe(pn_io_t *io, pn_socket_t *dest) { int n = pipe(dest); if (n) { pn_i_error_from_errno(io->error, "pipe"); } return n; } static void pn_configure_sock(pn_io_t *io, pn_socket_t sock) { // this would be nice, but doesn't appear to exist on linux /* int set = 1; if (!setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int))) { pn_i_error_from_errno(io->error, "setsockopt"); }; */ int flags = fcntl(sock, F_GETFL); flags |= O_NONBLOCK; if (fcntl(sock, F_SETFL, flags) < 0) { pn_i_error_from_errno(io->error, "fcntl"); } // // Disable the Nagle algorithm on TCP connections. // // Note: It would be more correct for the "level" argument to be SOL_TCP. However, there // are portability issues with this macro so we use IPPROTO_TCP instead. // int tcp_nodelay = 1; if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*) &tcp_nodelay, sizeof(tcp_nodelay)) < 0) { pn_i_error_from_errno(io->error, "setsockopt"); } } static inline int pn_create_socket(int af, int protocol); pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port) { struct addrinfo *addr; struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM}; int code = getaddrinfo(host, port, &hints, &addr); if (code) { pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s\n", host, port, gai_strerror(code)); return PN_INVALID_SOCKET; } pn_socket_t sock = pn_create_socket(addr->ai_family, addr->ai_protocol); if (sock == PN_INVALID_SOCKET) { freeaddrinfo(addr); pn_i_error_from_errno(io->error, "pn_create_socket"); return PN_INVALID_SOCKET; } int optval = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1) { pn_i_error_from_errno(io->error, "setsockopt"); freeaddrinfo(addr); close(sock); return PN_INVALID_SOCKET; } if (bind(sock, addr->ai_addr, addr->ai_addrlen) == -1) { pn_i_error_from_errno(io->error, "bind"); freeaddrinfo(addr); close(sock); return PN_INVALID_SOCKET; } freeaddrinfo(addr); if (listen(sock, 50) == -1) { pn_i_error_from_errno(io->error, "listen"); close(sock); return PN_INVALID_SOCKET; } return sock; } pn_socket_t pn_connect(pn_io_t *io, const char *host, const char *port) { struct addrinfo *addr; struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM}; int code = getaddrinfo(host, port, &hints, &addr); if (code) { pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s", host, port, gai_strerror(code)); return PN_INVALID_SOCKET; } pn_socket_t sock = pn_create_socket(addr->ai_family, addr->ai_protocol); if (sock == PN_INVALID_SOCKET) { pn_i_error_from_errno(io->error, "pn_create_socket"); freeaddrinfo(addr); return PN_INVALID_SOCKET; } pn_configure_sock(io, sock); if (connect(sock, addr->ai_addr, addr->ai_addrlen) == -1) { if (errno != EINPROGRESS) { pn_i_error_from_errno(io->error, "connect"); freeaddrinfo(addr); close(sock); return PN_INVALID_SOCKET; } } freeaddrinfo(addr); return sock; } pn_socket_t pn_accept(pn_io_t *io, pn_socket_t socket, char *name, size_t size) { struct sockaddr_storage addr; socklen_t addrlen = sizeof(addr); *name = '\0'; pn_socket_t sock = accept(socket, (struct sockaddr *) &addr, &addrlen); if (sock == PN_INVALID_SOCKET) { pn_i_error_from_errno(io->error, "accept"); return sock; } else { int code; if ((code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, MAX_HOST, io->serv, MAX_SERV, 0))) { pn_error_format(io->error, PN_ERR, "getnameinfo: %s\n", gai_strerror(code)); if (close(sock) == -1) pn_i_error_from_errno(io->error, "close"); return PN_INVALID_SOCKET; } else { pn_configure_sock(io, sock); pni_snprintf(name, size, "%s:%s", io->host, io->serv); return sock; } } } /* Abstract away turning off SIGPIPE */ #ifdef MSG_NOSIGNAL ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t len) { ssize_t count = send(socket, buf, len, MSG_NOSIGNAL); io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK); if (count < 0) { pn_i_error_from_errno(io->error, "send"); } return count; } static inline int pn_create_socket(int af, int protocol) { return socket(af, SOCK_STREAM, protocol); } #elif defined(SO_NOSIGPIPE) ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) { ssize_t count = send(socket, buf, size, 0); io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK); if (count < 0) { pn_i_error_from_errno(io->error, "send"); } return count; } static inline int pn_create_socket(int af, int protocol) { int sock; sock = socket(af, SOCK_STREAM, protocol); if (sock == -1) return sock; int optval = 1; if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)) == -1) { close(sock); return -1; } return sock; } #else #include static inline int pn_create_socket(int af, int protocol) { return socket(af, SOCK_STREAM, protocol); } static ssize_t nosigpipe_send(int fd, const void *buffer, size_t size) { sigset_t pendingSignals, oldSignals, newSignals; ssize_t count; int sendErrno, sigmaskErr; sigpending(&pendingSignals); int sigpipeIsPending = sigismember(&pendingSignals, SIGPIPE); if (!sigpipeIsPending) { sigemptyset(&newSignals); sigaddset(&newSignals, SIGPIPE); if (sigmaskErr = pthread_sigmask(SIG_BLOCK, (const sigset_t *)&newSignals, (sigset_t *)&oldSignals)) { errno = sigmaskErr; return -1; } } count = send(fd, buffer, size, 0); if (!sigpipeIsPending) { sendErrno = errno; if (count == -1 && errno == EPIPE) { while (-1 == sigtimedwait(&newSignals, NULL, &(struct timespec){ 0, 0 }) && errno == EINTR) ; //do nothing } if (sigmaskErr = pthread_sigmask(SIG_SETMASK, (const sigset_t *)&oldSignals, (sigset_t *)NULL)) { errno = sigmaskErr; return -1; } errno = sendErrno; } return count; } ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) { ssize_t count = nosigpipe_send(socket, buf, size); io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK); if (count < 0) { pn_i_error_from_errno(io->error, "send"); } return count; } #endif ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size) { ssize_t count = recv(socket, buf, size, 0); io->wouldblock = count < 0 && (errno == EAGAIN || errno == EWOULDBLOCK); if (count < 0) { pn_i_error_from_errno(io->error, "recv"); } return count; } ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) { return write(socket, buf, size); } ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size) { return read(socket, buf, size); } void pn_close(pn_io_t *io, pn_socket_t socket) { close(socket); } bool pn_wouldblock(pn_io_t *io) { return io->wouldblock; } pn_selector_t *pn_io_selector(pn_io_t *io) { if (io->selector == NULL) io->selector = pni_selector(); return io->selector; } qpid-proton-0.22.0/proton-c/src/reactor/io.h0000664000000000000000000000475013257152177015526 0ustar #ifndef PROTON_IO_H #define PROTON_IO_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "selector.h" #include #include #include #include /** * A ::pn_io_t manages IO for a group of pn_socket_t handles. A * pn_io_t object may have zero or one pn_selector_t selectors * associated with it (see ::pn_io_selector()). If one is associated, * all the pn_socket_t handles managed by a pn_io_t must use that * pn_selector_t instance. * * The pn_io_t interface is single-threaded. All methods are intended * to be used by one thread at a time, except that multiple threads * may use: * * ::pn_write() * ::pn_send() * ::pn_recv() * ::pn_close() * ::pn_selector_select() * * provided at most one thread is calling ::pn_selector_select() and * the other threads are operating on separate pn_socket_t handles. */ typedef struct pn_io_t pn_io_t; pn_io_t *pn_io(void); void pn_io_free(pn_io_t *io); pn_error_t *pn_io_error(pn_io_t *io); pn_socket_t pn_connect(pn_io_t *io, const char *host, const char *port); pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port); pn_socket_t pn_accept(pn_io_t *io, pn_socket_t socket, char *name, size_t size); void pn_close(pn_io_t *io, pn_socket_t socket); ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size); ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size); int pn_pipe(pn_io_t *io, pn_socket_t *dest); ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size); ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size); bool pn_wouldblock(pn_io_t *io); pn_selector_t *pn_io_selector(pn_io_t *io); #endif /* io.h */ qpid-proton-0.22.0/proton-c/src/reactor/handler.c0000664000000000000000000000633713257152177016532 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include struct pn_handler_t { void (*dispatch) (pn_handler_t *, pn_event_t *, pn_event_type_t); void (*finalize) (pn_handler_t *); pn_list_t *children; }; void pn_handler_initialize(void *object) { pn_handler_t *handler = (pn_handler_t *) object; handler->dispatch = NULL; handler->children = NULL; } void pn_handler_finalize(void *object) { pn_handler_t *handler = (pn_handler_t *) object; if (handler->finalize) { handler->finalize(handler); } pn_free(handler->children); } #define pn_handler_hashcode NULL #define pn_handler_compare NULL #define pn_handler_inspect NULL pn_handler_t *pn_handler(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t)) { return pn_handler_new(dispatch, 0, NULL); } pn_handler_t *pn_handler_new(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t), size_t size, void (*finalize)(pn_handler_t *)) { static const pn_class_t clazz = PN_CLASS(pn_handler); pn_handler_t *handler = (pn_handler_t *) pn_class_new(&clazz, sizeof(pn_handler_t) + size); handler->dispatch = dispatch; handler->finalize = finalize; memset(pn_handler_mem(handler), 0, size); return handler; } void pn_handler_free(pn_handler_t *handler) { if (handler) { if (handler->children) { size_t n = pn_list_size(handler->children); for (size_t i = 0; i < n; i++) { void *child = pn_list_get(handler->children, i); pn_decref(child); } } pn_decref(handler); } } void *pn_handler_mem(pn_handler_t *handler) { return (void *) (handler + 1); } void pn_handler_add(pn_handler_t *handler, pn_handler_t *child) { assert(handler); if (!handler->children) { handler->children = pn_list(PN_OBJECT, 0); } pn_list_add(handler->children, child); } void pn_handler_clear(pn_handler_t *handler) { assert(handler); if (handler->children) { pn_list_clear(handler->children); } } void pn_handler_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { assert(handler); if (handler->dispatch) { handler->dispatch(handler, event, type); } if (handler->children) { size_t n = pn_list_size(handler->children); for (size_t i = 0; i < n; i++) { pn_handler_t *child = (pn_handler_t *) pn_list_get(handler->children, i); pn_handler_dispatch(child, event, type); } } } qpid-proton-0.22.0/proton-c/src/reactor/connection.c0000664000000000000000000003202113257152177017241 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include "io.h" #include "selectable.h" #include "reactor.h" // XXX: overloaded for both directions PN_HANDLE(PN_TRANCTX) PN_HANDLE(PNI_CONN_PEER_ADDRESS) void pni_reactor_set_connection_peer_address(pn_connection_t *connection, const char *host, const char *port) { pn_url_t *url = pn_url(); pn_url_set_host(url, host); pn_url_set_port(url, port); pn_record_t *record = pn_connection_attachments(connection); if (!pn_record_has(record, PNI_CONN_PEER_ADDRESS)) { pn_record_def(record, PNI_CONN_PEER_ADDRESS, PN_OBJECT); } pn_record_set(record, PNI_CONN_PEER_ADDRESS, url); pn_decref(url); } static pn_transport_t *pni_transport(pn_selectable_t *sel) { pn_record_t *record = pn_selectable_attachments(sel); return (pn_transport_t *) pn_record_get(record, PN_TRANCTX); } static ssize_t pni_connection_capacity(pn_selectable_t *sel) { pn_transport_t *transport = pni_transport(sel); ssize_t capacity = pn_transport_capacity(transport); if (capacity < 0) { if (pn_transport_closed(transport)) { pn_selectable_terminate(sel); } } return capacity; } static ssize_t pni_connection_pending(pn_selectable_t *sel) { pn_transport_t *transport = pni_transport(sel); ssize_t pending = pn_transport_pending(transport); if (pending < 0) { if (pn_transport_closed(transport)) { pn_selectable_terminate(sel); } } return pending; } static pn_timestamp_t pni_connection_deadline(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); pn_timestamp_t deadline = pn_transport_tick(transport, pn_reactor_now(reactor)); return deadline; } static void pni_connection_update(pn_selectable_t *sel) { ssize_t c = pni_connection_capacity(sel); ssize_t p = pni_connection_pending(sel); pn_selectable_set_reading(sel, c > 0); pn_selectable_set_writing(sel, p > 0); pn_selectable_set_deadline(sel, pni_connection_deadline(sel)); } void pni_handle_transport(pn_reactor_t *reactor, pn_event_t *event) { assert(reactor); pn_transport_t *transport = pn_event_transport(event); pn_record_t *record = pn_transport_attachments(transport); pn_selectable_t *sel = (pn_selectable_t *) pn_record_get(record, PN_TRANCTX); if (sel && !pn_selectable_is_terminal(sel)) { pni_connection_update(sel); pn_reactor_update(reactor, sel); } } pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport); void pni_handle_open(pn_reactor_t *reactor, pn_event_t *event) { assert(reactor); assert(event); pn_connection_t *conn = pn_event_connection(event); if (!(pn_connection_state(conn) & PN_REMOTE_UNINIT)) { return; } pn_transport_t *transport = pn_transport(); pn_transport_bind(transport, conn); pn_decref(transport); } void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event) { assert(reactor); assert(event); pn_connection_t *conn = pn_event_connection(event); pn_transport_t *transport = pn_event_transport(event); pn_record_t *record = pn_connection_attachments(conn); pn_url_t *url = (pn_url_t *)pn_record_get(record, PNI_CONN_PEER_ADDRESS); const char *host = NULL; const char *port = "5672"; pn_string_t *str = NULL; // link the new transport to its reactor: pni_record_init_reactor(pn_transport_attachments(transport), reactor); if (pn_connection_acceptor(conn) != NULL) { // this connection was created by the acceptor. There is already a // socket assigned to this connection. Nothing needs to be done. return; } if (url) { host = pn_url_get_host(url); const char *uport = pn_url_get_port(url); if (uport) { port = uport; } else { const char *scheme = pn_url_get_scheme(url); if (scheme && strcmp(scheme, "amqps") == 0) { port = "5671"; } } if (!pn_connection_get_user(conn)) { // user did not manually set auth info const char *user = pn_url_get_username(url); if (user) pn_connection_set_user(conn, user); const char *passwd = pn_url_get_password(url); if (passwd) pn_connection_set_password(conn, passwd); } } else { // for backward compatibility, see if the connection's hostname can be // used for the remote address. See JIRA PROTON-1133 const char *hostname = pn_connection_get_hostname(conn); if (hostname) { str = pn_string(hostname); char *h = pn_string_buffer(str); // see if a port has been included in the hostname. This is not // allowed by the spec, but the old reactor interface allowed it. char *colon = strrchr(h, ':'); if (colon) { *colon = '\0'; port = colon + 1; } host = h; } } if (!host) { // error: no address configured pn_condition_t *cond = pn_transport_condition(transport); pn_condition_set_name(cond, "proton:io"); pn_condition_set_description(cond, "Connection failed: no address configured"); pn_transport_close_tail(transport); pn_transport_close_head(transport); } else { pn_socket_t sock = pn_connect(pni_reactor_io(reactor), host, port); // invalid sockets are ignored by poll, so we need to do this manually if (sock == PN_INVALID_SOCKET) { pn_condition_t *cond = pn_transport_condition(transport); pn_condition_set_name(cond, "proton:io"); pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor))); pn_transport_close_tail(transport); pn_transport_close_head(transport); } else { pn_reactor_selectable_transport(reactor, sock, transport); } } pn_free(str); } void pni_handle_final(pn_reactor_t *reactor, pn_event_t *event) { assert(reactor); assert(event); pn_connection_t *conn = pn_event_connection(event); pn_list_remove(pn_reactor_children(reactor), conn); } static void pni_connection_readable(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); ssize_t capacity = pn_transport_capacity(transport); if (capacity > 0) { ssize_t n = pn_recv(pni_reactor_io(reactor), pn_selectable_get_fd(sel), pn_transport_tail(transport), capacity); if (n <= 0) { if (n == 0 || !pn_wouldblock(pni_reactor_io(reactor))) { if (n < 0) { pn_condition_t *cond = pn_transport_condition(transport); pn_condition_set_name(cond, "proton:io"); pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor))); } pn_transport_close_tail(transport); } } else { pn_transport_process(transport, (size_t)n); } } ssize_t newcap = pn_transport_capacity(transport); //occasionally transport events aren't generated when expected, so //the following hack ensures we always update the selector if (1 || newcap != capacity) { pni_connection_update(sel); pn_reactor_update(reactor, sel); } } static void pni_connection_writable(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); ssize_t pending = pn_transport_pending(transport); if (pending > 0) { ssize_t n = pn_send(pni_reactor_io(reactor), pn_selectable_get_fd(sel), pn_transport_head(transport), pending); if (n < 0) { if (!pn_wouldblock(pni_reactor_io(reactor))) { pn_condition_t *cond = pn_transport_condition(transport); if (!pn_condition_is_set(cond)) { pn_condition_set_name(cond, "proton:io"); pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor))); } pn_transport_close_head(transport); } } else { pn_transport_pop(transport, n); } } ssize_t newpending = pn_transport_pending(transport); if (newpending != pending) { pni_connection_update(sel); pn_reactor_update(reactor, sel); } } static void pni_connection_error(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); pn_transport_close_head(transport); pn_transport_close_tail(transport); pn_selectable_terminate(sel); pn_reactor_update(reactor, sel); } static void pni_connection_expired(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); pn_timestamp_t deadline = pn_transport_tick(transport, pn_reactor_now(reactor)); pn_selectable_set_deadline(sel, deadline); ssize_t c = pni_connection_capacity(sel); ssize_t p = pni_connection_pending(sel); pn_selectable_set_reading(sel, c > 0); pn_selectable_set_writing(sel, p > 0); pn_reactor_update(reactor, sel); } static void pni_connection_finalize(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_transport_t *transport = pni_transport(sel); pn_record_t *record = pn_transport_attachments(transport); pn_record_set(record, PN_TRANCTX, NULL); pn_socket_t fd = pn_selectable_get_fd(sel); pn_close(pni_reactor_io(reactor), fd); } pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport) { pn_selectable_t *sel = pn_reactor_selectable(reactor); pn_selectable_set_fd(sel, sock); pn_selectable_on_readable(sel, pni_connection_readable); pn_selectable_on_writable(sel, pni_connection_writable); pn_selectable_on_error(sel, pni_connection_error); pn_selectable_on_expired(sel, pni_connection_expired); pn_selectable_on_finalize(sel, pni_connection_finalize); pn_record_t *record = pn_selectable_attachments(sel); pn_record_def(record, PN_TRANCTX, PN_OBJECT); pn_record_set(record, PN_TRANCTX, transport); pn_record_t *tr = pn_transport_attachments(transport); pn_record_def(tr, PN_TRANCTX, PN_WEAKREF); pn_record_set(tr, PN_TRANCTX, sel); pni_connection_update(sel); pn_reactor_update(reactor, sel); return sel; } pn_connection_t *pn_reactor_connection(pn_reactor_t *reactor, pn_handler_t *handler) { assert(reactor); pn_connection_t *connection = pn_connection(); pn_record_t *record = pn_connection_attachments(connection); pn_record_set_handler(record, handler); pn_connection_collect(connection, pn_reactor_collector(reactor)); pn_list_add(pn_reactor_children(reactor), connection); pni_record_init_reactor(record, reactor); pn_decref(connection); return connection; } pn_connection_t *pn_reactor_connection_to_host(pn_reactor_t *reactor, const char *host, const char *port, pn_handler_t *handler) { pn_connection_t *connection = pn_reactor_connection(reactor, handler); pn_reactor_set_connection_host(reactor, connection, host, port); return connection; } void pn_reactor_set_connection_host(pn_reactor_t *reactor, pn_connection_t *connection, const char *host, const char *port) { (void)reactor; // ignored if (pn_connection_acceptor(connection) != NULL) { // this is an inbound connection created by the acceptor. The peer // address cannot be modified. return; } pni_reactor_set_connection_peer_address(connection, host, port); } const char *pn_reactor_get_connection_address(pn_reactor_t *reactor, pn_connection_t *connection) { (void)reactor; // ignored if (!connection) return NULL; pn_record_t *record = pn_connection_attachments(connection); pn_url_t *url = (pn_url_t *)pn_record_get(record, PNI_CONN_PEER_ADDRESS); if (url) { return pn_url_str(url); } return NULL; } qpid-proton-0.22.0/proton-c/src/reactor/acceptor.c0000664000000000000000000001107013257152177016703 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "io.h" #include "reactor.h" #include "selectable.h" #include "selector.h" #include pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport); PN_HANDLE(PNI_ACCEPTOR_HANDLER) PN_HANDLE(PNI_ACCEPTOR_SSL_DOMAIN) PN_HANDLE(PNI_ACCEPTOR_CONNECTION) void pni_acceptor_readable(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); char name[1024]; pn_socket_t sock = pn_accept(pni_reactor_io(reactor), pn_selectable_get_fd(sel), name, 1024); pn_handler_t *handler = (pn_handler_t *) pn_record_get(pn_selectable_attachments(sel), PNI_ACCEPTOR_HANDLER); if (!handler) { handler = pn_reactor_get_handler(reactor); } pn_record_t *record = pn_selectable_attachments(sel); pn_ssl_domain_t *ssl_domain = (pn_ssl_domain_t *) pn_record_get(record, PNI_ACCEPTOR_SSL_DOMAIN); pn_connection_t *conn = pn_reactor_connection(reactor, handler); if (name[0]) { // store the peer address of connection in : format char *port = strrchr(name, ':'); // last : separates the port # *port++ = '\0'; pni_reactor_set_connection_peer_address(conn, name, port); } pn_transport_t *trans = pn_transport(); pn_transport_set_server(trans); if (ssl_domain) { pn_ssl_t *ssl = pn_ssl(trans); pn_ssl_init(ssl, ssl_domain, 0); } pn_transport_bind(trans, conn); pn_decref(trans); pn_reactor_selectable_transport(reactor, sock, trans); record = pn_connection_attachments(conn); pn_record_def(record, PNI_ACCEPTOR_CONNECTION, PN_OBJECT); pn_record_set(record, PNI_ACCEPTOR_CONNECTION, sel); } void pni_acceptor_finalize(pn_selectable_t *sel) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); if (pn_selectable_get_fd(sel) != PN_INVALID_SOCKET) { pn_close(pni_reactor_io(reactor), pn_selectable_get_fd(sel)); } } pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port, pn_handler_t *handler) { pn_socket_t socket = pn_listen(pni_reactor_io(reactor), host, port); if (socket == PN_INVALID_SOCKET) { return NULL; } pn_selectable_t *sel = pn_reactor_selectable(reactor); pn_selectable_set_fd(sel, socket); pn_selectable_on_readable(sel, pni_acceptor_readable); pn_selectable_on_finalize(sel, pni_acceptor_finalize); pni_record_init_reactor(pn_selectable_attachments(sel), reactor); pn_record_t *record = pn_selectable_attachments(sel); pn_record_def(record, PNI_ACCEPTOR_HANDLER, PN_OBJECT); pn_record_set(record, PNI_ACCEPTOR_HANDLER, handler); pn_selectable_set_reading(sel, true); pn_reactor_update(reactor, sel); return (pn_acceptor_t *) sel; } void pn_acceptor_close(pn_acceptor_t *acceptor) { pn_selectable_t *sel = (pn_selectable_t *) acceptor; if (!pn_selectable_is_terminal(sel)) { pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel); pn_socket_t socket = pn_selectable_get_fd(sel); pn_close(pni_reactor_io(reactor), socket); pn_selectable_set_fd(sel, PN_INVALID_SOCKET); pn_selectable_terminate(sel); pn_reactor_update(reactor, sel); } } void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain) { pn_selectable_t *sel = (pn_selectable_t *) acceptor; pn_record_t *record = pn_selectable_attachments(sel); pn_record_def(record, PNI_ACCEPTOR_SSL_DOMAIN, PN_VOID); pn_record_set(record, PNI_ACCEPTOR_SSL_DOMAIN, domain); } pn_acceptor_t *pn_connection_acceptor(pn_connection_t *conn) { // Return the acceptor that created the connection or NULL if an outbound connection pn_record_t *record = pn_connection_attachments(conn); return (pn_acceptor_t *) pn_record_get(record, PNI_ACCEPTOR_CONNECTION); } qpid-proton-0.22.0/proton-c/src/protocol.py0000664000000000000000000000705113257152177015517 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import mllib, os, sys doc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "transport.xml")) mdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "messaging.xml")) tdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "transactions.xml")) sdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "security.xml")) def eq(attr, value): return lambda nd: nd[attr] == value TYPEStmp = doc.query["amqp/section/type", eq("@class", "composite")] + \ mdoc.query["amqp/section/type", eq("@class", "composite")] + \ tdoc.query["amqp/section/type", eq("@class", "composite")] + \ sdoc.query["amqp/section/type", eq("@class", "composite")] + \ mdoc.query["amqp/section/type", eq("@provides", "section")] TYPES = [] for ty in TYPEStmp: if not ty in TYPES: TYPES.append(ty) RESTRICTIONS = {} COMPOSITES = {} for type in doc.query["amqp/section/type"] + mdoc.query["amqp/section/type"] + \ sdoc.query["amqp/section/type"] + tdoc.query["amqp/section/type"]: source = type["@source"] if source: RESTRICTIONS[type["@name"]] = source if type["@class"] == "composite": COMPOSITES[type["@name"]] = type def resolve(name): if name in RESTRICTIONS: return resolve(RESTRICTIONS[name]) else: return name TYPEMAP = { "boolean": ("bool", "", ""), "binary": ("pn_binary_t", "*", ""), "string": ("wchar_t", "*", ""), "symbol": ("char", "*", ""), "ubyte": ("uint8_t", "", ""), "ushort": ("uint16_t", "", ""), "uint": ("uint32_t", "", ""), "ulong": ("uint64_t", "", ""), "timestamp": ("uint64_t", "", ""), "list": ("pn_list_t", "*", ""), "map": ("pn_map_t", "*", ""), "box": ("pn_box_t", "*", ""), "*": ("pn_object_t", "*", "") } CONSTRUCTORS = { "boolean": "boolean", "string": "string", "symbol": "symbol", "ubyte": "ubyte", "ushort": "ushort", "uint": "uint", "ulong": "ulong", "timestamp": "ulong" } NULLABLE = set(["string", "symbol"]) def fname(field): return field["@name"].replace("-", "_") def tname(t): return t["@name"].replace("-", "_") def multi(f): return f["@multiple"] == "true" def ftype(field): if multi(field): return "list" elif field["@type"] in COMPOSITES: return "box" else: return resolve(field["@type"]).replace("-", "_") def fconstruct(field, expr): type = ftype(field) if type in CONSTRUCTORS: result = "pn_%s(mem, %s)" % (CONSTRUCTORS[type], expr) if type in NULLABLE: result = "%s ? %s : NULL" % (expr, result) else: result = expr if multi(field): result = "pn_box(mem, pn_boolean(mem, true), %s)" % result return result def declaration(field): name = fname(field) type = ftype(field) t, pre, post = TYPEMAP.get(type, (type, "", "")) return t, "%s%s%s" % (pre, name, post) def field_kw(field): return fname(field).upper() qpid-proton-0.22.0/proton-c/src/protocol.h.py0000664000000000000000000001104413257152177015742 0ustar #!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from protocol import * print("/* generated */") print("#ifndef _PROTON_PROTOCOL_H") print("#define _PROTON_PROTOCOL_H 1") print() print("#include \"proton/type_compat.h\"") fields = {} for type in TYPES: fidx = 0 for f in type.query["field"]: print("#define %s_%s (%s)" % (field_kw(type), field_kw(f), fidx)) fidx += 1 d = f["@default"] if d: ft = ftype(f) # Don't bother to emit a boolean default that is False if ft=="boolean" and d=="false": continue # Don't output non numerics unless symbol # We should really fully resolve to actual restricted value # this is really true for symbols too which accidentally work if ft=="symbol": d = '"' + d + '"' elif d[0] not in '0123456789': continue print("#define %s_%s_DEFAULT (%s) /* %s */" % (field_kw(type), field_kw(f), d, ft)) idx = 0 for type in TYPES: desc = type["descriptor"] name = type["@name"].upper().replace("-", "_") print("#define %s_SYM (\"%s\")" % (name, desc["@name"])) hi, lo = [int(x, 0) for x in desc["@code"].split(":")] code = (hi << 32) + lo print("#define %s ((uint64_t) %s)" % (name, code)) fields[code] = (type["@name"], [f["@name"] for f in type.query["field"]]) idx += 1 print(""" #include typedef struct { const unsigned char name_index; const unsigned char first_field_index; const unsigned char field_count; } pn_fields_t; extern const pn_fields_t FIELDS[]; extern const uint16_t FIELD_NAME[]; extern const uint16_t FIELD_FIELDS[]; """) print('struct FIELD_STRINGS {') print(' const char STRING0[sizeof("")];') strings = set() for name, fnames in fields.values(): strings.add(name) strings.update(fnames) for str in strings: istr = str.replace("-", "_"); print(' const char FIELD_STRINGS_%s[sizeof("%s")];' % (istr, str)) print("};") print() print("extern const struct FIELD_STRINGS FIELD_STRINGPOOL;") print("#ifdef DEFINE_FIELDS") print() print('const struct FIELD_STRINGS FIELD_STRINGPOOL = {') print(' "",') for str in strings: print(' "%s",'% str) print("};") print() print("/* This is an array of offsets into FIELD_STRINGPOOL */") print("const uint16_t FIELD_NAME[] = {") print(" offsetof(struct FIELD_STRINGS, STRING0),") index = 1 for i in range(256): if i in fields: name, fnames = fields[i] iname = name.replace("-", "_"); print(' offsetof(struct FIELD_STRINGS, FIELD_STRINGS_%s), /* %d */' % (iname, index)) index += 1 print("};") print("/* This is an array of offsets into FIELD_STRINGPOOL */") print("const uint16_t FIELD_FIELDS[] = {") print(" offsetof(struct FIELD_STRINGS, STRING0),") index = 1 for i in range(256): if i in fields: name, fnames = fields[i] if fnames: for f in fnames: ifname = f.replace("-", "_"); print(' offsetof(struct FIELD_STRINGS, FIELD_STRINGS_%s), /* %d (%s) */' % (ifname, index, name)) index += 1 print("};") print("const pn_fields_t FIELDS[] = {") name_count = 1 field_count = 1 field_min = 256 field_max = 0 for i in range(256): if i in fields: if i>field_max: field_max = i if ifield_max: field_max = i if i #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "./netaddr-internal.h" /* Include after socket/inet headers */ /* * Proactor for Windows using IO completion ports. * * There is no specific threading code other than locking and indirect (and * brief) calls to the default threadpool via timerqueue timers. * * The IOCP system remembers what threads have called pn_proactor_wait and * assumes they are doing proactor work until they call wait again. Using a * dedicated threadpool to drive the proactor, as in the examples, is * recommended. The use of other long-lived threads to occasionally drive the * proactor will hurt the completion port scheduler and cause fewer threads to * run. * * Each proactor connection maintains its own queue of pending completions and * its work is serialized on that. The proactor listener runs parallel where * possible, but its event batch is serialized. */ // TODO: make all code C++ or all C90-ish // change INACTIVE to be from begin_close instead of zombie reap, to be more like Posix // make the global write lock window much smaller // 2 exclusive write buffers per connection // make the zombie processing thread safe // configurable completion port concurrency // proton objects and ref counting: just say no. // From selector.h #define PN_READABLE (1) #define PN_WRITABLE (2) #define PN_EXPIRED (4) #define PN_ERROR (8) typedef SOCKET pn_socket_t; namespace pn_experimental { // Code borrowed from old messenger/reactor io.c iocp.c write_pipeline.c select.c // Mostly unchanged except fro some thread safety (i.e. dropping the old descriptor map) typedef struct pni_acceptor_t pni_acceptor_t; typedef struct write_result_t write_result_t; typedef struct read_result_t read_result_t; typedef struct write_pipeline_t write_pipeline_t; typedef struct iocpdesc_t iocpdesc_t; typedef struct iocp_t iocp_t; // One per completion port. struct iocp_t { HANDLE completion_port; pn_list_t *zombie_list; unsigned shared_pool_size; char *shared_pool_memory; write_result_t **shared_results; write_result_t **available_results; size_t shared_available_count; size_t writer_count; int loopback_bufsize; bool iocp_trace; }; // One for each socket. // It should remain ref counted in the // zombie_list until ops_in_progress == 0 or the completion port is closed. struct iocpdesc_t { pn_socket_t socket; iocp_t *iocp; void *active_completer; pni_acceptor_t *acceptor; pn_error_t *error; int ops_in_progress; bool read_in_progress; write_pipeline_t *pipeline; read_result_t *read_result; bool bound; // associated with the completion port bool closing; // close called by application bool read_closed; // EOF or read error bool write_closed; // shutdown sent or write error bool poll_error; // flag posix-like POLLERR/POLLHUP/POLLNVAL bool is_mp; // Special multi thread care required bool write_blocked; int events; pn_timestamp_t reap_time; }; // Max number of overlapped accepts per listener. TODO: configurable. #define IOCP_MAX_ACCEPTS 4 // AcceptEx squishes the local and remote addresses and optional data // all together when accepting the connection. Reserve enough for // IPv6 addresses, even if the socket is IPv4. The 16 bytes padding // per address is required by AcceptEx. #define IOCP_SOCKADDRMAXLEN (sizeof(sockaddr_in6) + 16) #define IOCP_SOCKADDRBUFLEN (2 * IOCP_SOCKADDRMAXLEN) typedef enum { IOCP_ACCEPT, IOCP_CONNECT, IOCP_READ, IOCP_WRITE } iocp_type_t; typedef struct { OVERLAPPED overlapped; iocp_type_t type; iocpdesc_t *iocpd; HRESULT status; DWORD num_transferred; } iocp_result_t; struct read_result_t { iocp_result_t base; size_t drain_count; char unused_buf[1]; }; struct write_result_t { iocp_result_t base; size_t requested; bool in_use; pn_bytes_t buffer; }; typedef struct { iocp_result_t base; char address_buffer[IOCP_SOCKADDRBUFLEN]; struct addrinfo *addrinfo; } connect_result_t; typedef struct { iocp_result_t base; iocpdesc_t *new_sock; char address_buffer[IOCP_SOCKADDRBUFLEN]; DWORD unused; } accept_result_t; void complete_connect(connect_result_t *result, HRESULT status); void complete_write(write_result_t *result, DWORD xfer_count, HRESULT status); void complete_read(read_result_t *result, DWORD xfer_count, HRESULT status); void start_reading(iocpdesc_t *iocpd); void begin_accept(pni_acceptor_t *acceptor, accept_result_t *result); void reset_accept_result(accept_result_t *result); iocpdesc_t *create_same_type_socket(iocpdesc_t *iocpd); void pni_iocp_reap_check(iocpdesc_t *iocpd); connect_result_t *connect_result(iocpdesc_t *iocpd, struct addrinfo *addr); iocpdesc_t *pni_iocpdesc_create(iocp_t *, pn_socket_t s); iocpdesc_t *pni_deadline_desc(iocp_t *); void pni_iocpdesc_start(iocpdesc_t *iocpd); void pni_iocp_drain_completions(iocp_t *); int pni_iocp_wait_one(iocp_t *, int timeout, pn_error_t *); void pni_iocp_start_accepting(iocpdesc_t *iocpd); pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error); pn_socket_t pni_iocp_begin_connect(iocp_t *, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error); ssize_t pni_iocp_begin_write(iocpdesc_t *, const void *, size_t, bool *, pn_error_t *); ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error); void pni_iocp_begin_close(iocpdesc_t *iocpd); iocp_t *pni_iocp(); void pni_events_update(iocpdesc_t *iocpd, int events); write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen); void pni_zombie_check(iocp_t *, pn_timestamp_t); pn_timestamp_t pni_zombie_deadline(iocp_t *); int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code); pn_timestamp_t pn_i_now2(void); } // ====================================================================== // Write pipeline. // ====================================================================== /* * A simple write buffer pool. Each socket has a dedicated "primary" * buffer and can borrow from a shared pool with limited size tuning. * Could enhance e.g. with separate pools per network interface and fancier * memory tuning based on interface speed, system resources, and * number of connections, etc. */ namespace pn_experimental { // Max overlapped writes per socket #define IOCP_MAX_OWRITES 16 // Write buffer size #define IOCP_WBUFSIZE 16384 static void pipeline_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } void pni_shared_pool_create(iocp_t *iocp) { // TODO: more pools (or larger one) when using multiple non-loopback interfaces iocp->shared_pool_size = 16; char *env = getenv("PNI_WRITE_BUFFERS"); // Internal: for debugging if (env) { int sz = atoi(env); if (sz >= 0 && sz < 256) { iocp->shared_pool_size = sz; } } iocp->loopback_bufsize = 0; env = getenv("PNI_LB_BUFSIZE"); // Internal: for debugging if (env) { int sz = atoi(env); if (sz >= 0 && sz <= 128 * 1024) { iocp->loopback_bufsize = sz; } } if (iocp->shared_pool_size) { iocp->shared_pool_memory = (char *) VirtualAlloc(NULL, IOCP_WBUFSIZE * iocp->shared_pool_size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); HRESULT status = GetLastError(); if (!iocp->shared_pool_memory) { perror("Proton write buffer pool allocation failure\n"); iocp->shared_pool_size = 0; iocp->shared_available_count = 0; return; } iocp->shared_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *)); iocp->available_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *)); iocp->shared_available_count = iocp->shared_pool_size; char *mem = iocp->shared_pool_memory; for (unsigned i = 0; i < iocp->shared_pool_size; i++) { iocp->shared_results[i] = iocp->available_results[i] = pni_write_result(NULL, mem, IOCP_WBUFSIZE); mem += IOCP_WBUFSIZE; } } } void pni_shared_pool_free(iocp_t *iocp) { for (unsigned i = 0; i < iocp->shared_pool_size; i++) { write_result_t *result = iocp->shared_results[i]; if (result->in_use) pipeline_log("Proton buffer pool leak\n"); else free(result); } if (iocp->shared_pool_size) { free(iocp->shared_results); free(iocp->available_results); if (iocp->shared_pool_memory) { if (!VirtualFree(iocp->shared_pool_memory, 0, MEM_RELEASE)) { perror("write buffers release failed"); } iocp->shared_pool_memory = NULL; } } } static void shared_pool_push(write_result_t *result) { iocp_t *iocp = result->base.iocpd->iocp; assert(iocp->shared_available_count < iocp->shared_pool_size); iocp->available_results[iocp->shared_available_count++] = result; } static write_result_t *shared_pool_pop(iocp_t *iocp) { return iocp->shared_available_count ? iocp->available_results[--iocp->shared_available_count] : NULL; } struct write_pipeline_t { iocpdesc_t *iocpd; size_t pending_count; write_result_t *primary; size_t reserved_count; size_t next_primary_index; size_t depth; bool is_writer; }; #define write_pipeline_compare NULL #define write_pipeline_inspect NULL #define write_pipeline_hashcode NULL static void write_pipeline_initialize(void *object) { write_pipeline_t *pl = (write_pipeline_t *) object; pl->pending_count = 0; const char *pribuf = (const char *) malloc(IOCP_WBUFSIZE); pl->primary = pni_write_result(NULL, pribuf, IOCP_WBUFSIZE); pl->depth = 0; pl->is_writer = false; } static void write_pipeline_finalize(void *object) { write_pipeline_t *pl = (write_pipeline_t *) object; free((void *)pl->primary->buffer.start); free(pl->primary); } write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd) { static const pn_cid_t CID_write_pipeline = CID_pn_void; static const pn_class_t clazz = PN_CLASS(write_pipeline); write_pipeline_t *pipeline = (write_pipeline_t *) pn_class_new(&clazz, sizeof(write_pipeline_t)); pipeline->iocpd = iocpd; pipeline->primary->base.iocpd = iocpd; return pipeline; } static void confirm_as_writer(write_pipeline_t *pl) { if (!pl->is_writer) { iocp_t *iocp = pl->iocpd->iocp; iocp->writer_count++; pl->is_writer = true; } } static void remove_as_writer(write_pipeline_t *pl) { if (!pl->is_writer) return; iocp_t *iocp = pl->iocpd->iocp; assert(iocp->writer_count); pl->is_writer = false; iocp->writer_count--; } /* * Optimal depth will depend on properties of the NIC, server, and driver. For now, * just distinguish between loopback interfaces and the rest. Optimizations in the * loopback stack allow decent performance with depth 1 and actually cause major * performance hiccups if set to large values. */ static void set_depth(write_pipeline_t *pl) { pl->depth = 1; sockaddr_storage sa; socklen_t salen = sizeof(sa); char buf[INET6_ADDRSTRLEN]; DWORD buflen = sizeof(buf); if (getsockname(pl->iocpd->socket,(sockaddr*) &sa, &salen) == 0 && getnameinfo((sockaddr*) &sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) == 0) { if ((sa.ss_family == AF_INET6 && strcmp(buf, "::1")) || (sa.ss_family == AF_INET && strncmp(buf, "127.", 4))) { // not loopback pl->depth = IOCP_MAX_OWRITES; } else { iocp_t *iocp = pl->iocpd->iocp; if (iocp->loopback_bufsize) { const char *p = (const char *) realloc((void *) pl->primary->buffer.start, iocp->loopback_bufsize); if (p) { pl->primary->buffer.start = p; pl->primary->buffer.size = iocp->loopback_bufsize; } } } } } static size_t pni_min(size_t a, size_t b) { return a < b ? a : b; } // Reserve as many buffers as possible for count bytes. size_t pni_write_pipeline_reserve(write_pipeline_t *pl, size_t count) { if (pl->primary->in_use) return 0; // I.e. io->wouldblock if (!pl->depth) set_depth(pl); if (pl->depth == 1) { // always use the primary pl->reserved_count = 1; pl->next_primary_index = 0; return 1; } iocp_t *iocp = pl->iocpd->iocp; confirm_as_writer(pl); size_t wanted = (count / IOCP_WBUFSIZE); if (count % IOCP_WBUFSIZE) wanted++; size_t pending = pl->pending_count; assert(pending < pl->depth); size_t bufs = pni_min(wanted, pl->depth - pending); // Can draw from shared pool or the primary... but share with others. size_t writers = iocp->writer_count; size_t shared_count = (iocp->shared_available_count + writers - 1) / writers; bufs = pni_min(bufs, shared_count + 1); pl->reserved_count = pending + bufs; if (bufs == wanted && pl->reserved_count < (pl->depth / 2) && iocp->shared_available_count > (2 * writers + bufs)) { // No shortage: keep the primary as spare for future use pl->next_primary_index = pl->reserved_count; } else if (bufs == 1) { pl->next_primary_index = pending; } else { // let approx 1/3 drain before replenishing pl->next_primary_index = ((pl->reserved_count + 2) / 3) - 1; if (pl->next_primary_index < pending) pl->next_primary_index = pending; } return bufs; } write_result_t *pni_write_pipeline_next(write_pipeline_t *pl) { size_t sz = pl->pending_count; if (sz >= pl->reserved_count) return NULL; write_result_t *result; if (sz == pl->next_primary_index) { result = pl->primary; } else { assert(pl->iocpd->iocp->shared_available_count > 0); result = shared_pool_pop(pl->iocpd->iocp); } result->in_use = true; pl->pending_count++; return result; } void pni_write_pipeline_return(write_pipeline_t *pl, write_result_t *result) { result->in_use = false; pl->pending_count--; pl->reserved_count = 0; if (result != pl->primary) shared_pool_push(result); if (pl->pending_count == 0) remove_as_writer(pl); } bool pni_write_pipeline_writable(write_pipeline_t *pl) { // Only writable if not full and we can guarantee a buffer: return pl->pending_count < pl->depth && !pl->primary->in_use; } size_t pni_write_pipeline_size(write_pipeline_t *pl) { return pl->pending_count; } } // ====================================================================== // IOCP infrastructure code // ====================================================================== /* * Socket IO including graceful or forced zombie teardown. * * Overlapped writes are used to avoid lengthy stalls between write * completion and starting a new write. Non-overlapped reads are used * since Windows accumulates inbound traffic without stalling and * managing read buffers would not avoid a memory copy at the pn_read * boundary. * * A socket must not get a Windows closesocket() unless the * application has called pn_connection_close on the connection or a * global single threaded shutdown is in progress. On error, the * internal accounting for write_closed or read_closed may be updated * along with the external event notification. A socket may be * directly closed if it is never gets started (accept/listener_close * collision) or otherwise turned into a zombie. */ namespace pn_experimental { pn_timestamp_t pn_i_now2(void) { FILETIME now; GetSystemTimeAsFileTime(&now); ULARGE_INTEGER t; t.u.HighPart = now.dwHighDateTime; t.u.LowPart = now.dwLowDateTime; // Convert to milliseconds and adjust base epoch return t.QuadPart / 10000 - 11644473600000; } static void iocp_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fflush(stderr); } static void set_iocp_error_status(pn_error_t *error, int code, HRESULT status) { char buf[512]; if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, 0, status, 0, buf, sizeof(buf), 0)) pn_error_set(error, code, buf); else { fprintf(stderr, "pn internal Windows error: %lu\n", GetLastError()); } } static void reap_check(iocpdesc_t *); static void bind_to_completion_port(iocpdesc_t *iocpd); static void iocp_shutdown(iocpdesc_t *iocpd); static bool is_listener(iocpdesc_t *iocpd); static void release_sys_sendbuf(SOCKET s); int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code) { // Error code can be from GetLastError or WSAGetLastError, char err[1024] = {0}; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, code, 0, (LPSTR)&err, sizeof(err), NULL); return pn_error_format(error, PN_ERR, "%s: %s", msg, err); } static void iocpdesc_fail(iocpdesc_t *iocpd, HRESULT status, const char* text) { pni_win32_error(iocpd->error, text, status); if (iocpd->iocp->iocp_trace) { iocp_log("connection terminated: %s\n", pn_error_text(iocpd->error)); } iocpd->write_closed = true; iocpd->read_closed = true; iocpd->poll_error = true; pni_events_update(iocpd, iocpd->events & ~(PN_READABLE | PN_WRITABLE)); } static int pni_strcasecmp(const char *a, const char *b) { int diff; while (*b) { char aa = *a++, bb = *b++; diff = tolower(aa)-tolower(bb); if ( diff!=0 ) return diff; } return *a; } static void pni_events_update(iocpdesc_t *iocpd, int events) { // If set, a poll error is permanent if (iocpd->poll_error) events |= PN_ERROR; if (iocpd->events == events) return; // ditch old code to update list of ready selectables iocpd->events = events; } // Helper functions to use specialized IOCP AcceptEx() and ConnectEx() static LPFN_ACCEPTEX lookup_accept_ex(SOCKET s) { GUID guid = WSAID_ACCEPTEX; DWORD bytes = 0; LPFN_ACCEPTEX fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } static LPFN_CONNECTEX lookup_connect_ex(SOCKET s) { GUID guid = WSAID_CONNECTEX; DWORD bytes = 0; LPFN_CONNECTEX fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } static LPFN_GETACCEPTEXSOCKADDRS lookup_get_accept_ex_sockaddrs(SOCKET s) { GUID guid = WSAID_GETACCEPTEXSOCKADDRS; DWORD bytes = 0; LPFN_GETACCEPTEXSOCKADDRS fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } // match accept socket to listener socket iocpdesc_t *create_same_type_socket(iocpdesc_t *iocpd) { sockaddr_storage sa; socklen_t salen = sizeof(sa); if (getsockname(iocpd->socket, (sockaddr*)&sa, &salen) == -1) return NULL; SOCKET s = socket(sa.ss_family, SOCK_STREAM, 0); // Currently only work with SOCK_STREAM if (s == INVALID_SOCKET) return NULL; return pni_iocpdesc_create(iocpd->iocp, s); } static bool is_listener(iocpdesc_t *iocpd) { return iocpd && iocpd->acceptor; } // === Async accept processing static accept_result_t *accept_result(iocpdesc_t *listen_sock) { accept_result_t *result = (accept_result_t *)calloc(1, sizeof(accept_result_t)); if (result) { result->base.type = IOCP_ACCEPT; result->base.iocpd = listen_sock; } return result; } void reset_accept_result(accept_result_t *result) { memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); memset(&result->address_buffer, 0, IOCP_SOCKADDRBUFLEN); result->new_sock = NULL; } struct pni_acceptor_t { int accept_queue_size; pn_list_t *accepts; iocpdesc_t *listen_sock; bool signalled; LPFN_ACCEPTEX fn_accept_ex; LPFN_GETACCEPTEXSOCKADDRS fn_get_accept_ex_sockaddrs; }; #define pni_acceptor_compare NULL #define pni_acceptor_inspect NULL #define pni_acceptor_hashcode NULL static void pni_acceptor_initialize(void *object) { pni_acceptor_t *acceptor = (pni_acceptor_t *) object; acceptor->accepts = pn_list(PN_VOID, IOCP_MAX_ACCEPTS); } static void pni_acceptor_finalize(void *object) { pni_acceptor_t *acceptor = (pni_acceptor_t *) object; size_t len = pn_list_size(acceptor->accepts); for (size_t i = 0; i < len; i++) free(pn_list_get(acceptor->accepts, i)); pn_free(acceptor->accepts); } static pni_acceptor_t *pni_acceptor(iocpdesc_t *iocpd) { static const pn_cid_t CID_pni_acceptor = CID_pn_void; static const pn_class_t clazz = PN_CLASS(pni_acceptor); pni_acceptor_t *acceptor = (pni_acceptor_t *) pn_class_new(&clazz, sizeof(pni_acceptor_t)); acceptor->listen_sock = iocpd; acceptor->accept_queue_size = 0; acceptor->signalled = false; pn_socket_t sock = acceptor->listen_sock->socket; acceptor->fn_accept_ex = lookup_accept_ex(sock); acceptor->fn_get_accept_ex_sockaddrs = lookup_get_accept_ex_sockaddrs(sock); return acceptor; } void begin_accept(pni_acceptor_t *acceptor, accept_result_t *result) { // flag to divide this routine's logic into locked/unlocked mp portions bool mp = acceptor->listen_sock->is_mp; bool created = false; if (acceptor->listen_sock->closing) { if (result) { if (mp && result->new_sock && result->new_sock->socket != INVALID_SOCKET) closesocket(result->new_sock->socket); free(result); acceptor->accept_queue_size--; } if (acceptor->accept_queue_size == 0) acceptor->signalled = true; return; } if (result) { if (!mp) reset_accept_result(result); } else { if (acceptor->accept_queue_size < IOCP_MAX_ACCEPTS && (mp || pn_list_size(acceptor->accepts) == acceptor->accept_queue_size )) { result = accept_result(acceptor->listen_sock); acceptor->accept_queue_size++; created = true; } else { // an async accept is still pending or max concurrent accepts already hit return; } } if (created || !mp) result->new_sock = create_same_type_socket(acceptor->listen_sock); if (result->new_sock) { // Not yet connected. result->new_sock->read_closed = true; result->new_sock->write_closed = true; bool success = acceptor->fn_accept_ex(acceptor->listen_sock->socket, result->new_sock->socket, result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN, &result->unused, (LPOVERLAPPED) result); if (!success) { DWORD err = WSAGetLastError(); if (err != ERROR_IO_PENDING) { if (err == WSAECONNRESET) { // other side gave up. Ignore and try again. begin_accept(acceptor, result); return; } else { iocpdesc_fail(acceptor->listen_sock, err, "AcceptEX call failure"); return; } } acceptor->listen_sock->ops_in_progress++; // This socket is equally involved in the async operation. result->new_sock->ops_in_progress++; } } else { iocpdesc_fail(acceptor->listen_sock, WSAGetLastError(), "create accept socket"); } } static void complete_accept(accept_result_t *result, HRESULT status) { result->new_sock->ops_in_progress--; iocpdesc_t *ld = result->base.iocpd; if (ld->read_closed) { if (!result->new_sock->closing) pni_iocp_begin_close(result->new_sock); pn_decref(result->new_sock); free(result); // discard reap_check(ld); } else { assert(!ld->is_mp); // Non mp only result->base.status = status; pn_list_add(ld->acceptor->accepts, result); pni_events_update(ld, ld->events | PN_READABLE); } } // === Async connect processing #define connect_result_initialize NULL #define connect_result_compare NULL #define connect_result_inspect NULL #define connect_result_hashcode NULL static void connect_result_finalize(void *object) { connect_result_t *result = (connect_result_t *) object; // Do not release addrinfo until ConnectEx completes if (result->addrinfo) freeaddrinfo(result->addrinfo); } connect_result_t *connect_result(iocpdesc_t *iocpd, struct addrinfo *addr) { static const pn_cid_t CID_connect_result = CID_pn_void; static const pn_class_t clazz = PN_CLASS(connect_result); connect_result_t *result = (connect_result_t *) pn_class_new(&clazz, sizeof(connect_result_t)); if (result) { memset(result, 0, sizeof(connect_result_t)); result->base.type = IOCP_CONNECT; result->base.iocpd = iocpd; result->addrinfo = addr; } return result; } pn_socket_t pni_iocp_begin_connect(iocp_t *iocp, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error) { // addr lives for the duration of the async connect. Caller has passed ownership here. // See connect_result_finalize(). // Use of Windows-specific ConnectEx() requires our socket to be "loosely" pre-bound: sockaddr_storage sa; memset(&sa, 0, sizeof(sa)); sa.ss_family = addr->ai_family; if (bind(sock, (SOCKADDR *) &sa, addr->ai_addrlen)) { pni_win32_error(error, "begin async connection", WSAGetLastError()); if (iocp->iocp_trace) iocp_log("%s\n", pn_error_text(error)); closesocket(sock); freeaddrinfo(addr); return INVALID_SOCKET; } iocpdesc_t *iocpd = pni_iocpdesc_create(iocp, sock); bind_to_completion_port(iocpd); LPFN_CONNECTEX fn_connect_ex = lookup_connect_ex(iocpd->socket); connect_result_t *result = connect_result(iocpd, addr); DWORD unused; bool success = fn_connect_ex(iocpd->socket, result->addrinfo->ai_addr, result->addrinfo->ai_addrlen, NULL, 0, &unused, (LPOVERLAPPED) result); if (!success && WSAGetLastError() != ERROR_IO_PENDING) { pni_win32_error(error, "ConnectEx failure", WSAGetLastError()); pn_free(result); iocpd->write_closed = true; iocpd->read_closed = true; if (iocp->iocp_trace) iocp_log("%s\n", pn_error_text(error)); } else { iocpd->ops_in_progress++; } return sock; } void complete_connect(connect_result_t *result, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; if (iocpd->closing) { pn_free(result); reap_check(iocpd); return; } if (status) { iocpdesc_fail(iocpd, status, "Connect failure"); // Posix sets selectable events as follows: pni_events_update(iocpd, PN_READABLE | PN_EXPIRED); } else { release_sys_sendbuf(iocpd->socket); if (setsockopt(iocpd->socket, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0)) { iocpdesc_fail(iocpd, WSAGetLastError(), "Internal connect failure (update context)"); } else { pni_events_update(iocpd, PN_WRITABLE); start_reading(iocpd); } } pn_free(result); return; } // === Async writes static bool write_in_progress(iocpdesc_t *iocpd) { return pni_write_pipeline_size(iocpd->pipeline) != 0; } write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen) { write_result_t *result = (write_result_t *) calloc(sizeof(write_result_t), 1); if (result) { result->base.type = IOCP_WRITE; result->base.iocpd = iocpd; result->buffer.start = buf; result->buffer.size = buflen; } return result; } static int submit_write(write_result_t *result, const void *buf, size_t len) { WSABUF wsabuf; wsabuf.buf = (char *) buf; wsabuf.len = len; memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); return WSASend(result->base.iocpd->socket, &wsabuf, 1, NULL, 0, (LPOVERLAPPED) result, 0); } ssize_t pni_iocp_begin_write(iocpdesc_t *iocpd, const void *buf, size_t len, bool *would_block, pn_error_t *error) { if (len == 0) return 0; *would_block = false; if (is_listener(iocpd)) { set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP); return INVALID_SOCKET; } if (iocpd->closing) { set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN); return SOCKET_ERROR; } if (iocpd->write_closed) { assert(pn_error_code(iocpd->error)); pn_error_copy(error, iocpd->error); if (iocpd->iocp->iocp_trace) iocp_log("write error: %s\n", pn_error_text(error)); return SOCKET_ERROR; } if (len == 0) return 0; if (!(iocpd->events & PN_WRITABLE)) { *would_block = true; return SOCKET_ERROR; } size_t written = 0; size_t requested = len; const char *outgoing = (const char *) buf; size_t available = pni_write_pipeline_reserve(iocpd->pipeline, len); if (!available) { *would_block = true; return SOCKET_ERROR; } for (size_t wr_count = 0; wr_count < available; wr_count++) { write_result_t *result = pni_write_pipeline_next(iocpd->pipeline); assert(result); result->base.iocpd = iocpd; ssize_t actual_len = len; if (len > result->buffer.size) actual_len = result->buffer.size; result->requested = actual_len; memmove((void *)result->buffer.start, outgoing, actual_len); outgoing += actual_len; written += actual_len; len -= actual_len; int werror = submit_write(result, result->buffer.start, actual_len); if (werror && WSAGetLastError() != ERROR_IO_PENDING) { pni_write_pipeline_return(iocpd->pipeline, result); iocpdesc_fail(iocpd, WSAGetLastError(), "overlapped send"); return SOCKET_ERROR; } iocpd->ops_in_progress++; } if (!pni_write_pipeline_writable(iocpd->pipeline)) pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE); return written; } /* * Note: iocp write completion is not "bytes on the wire", it is "peer * acked the sent bytes". Completion can be seconds on a slow * consuming peer. */ void complete_write(write_result_t *result, DWORD xfer_count, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; if (iocpd->closing) { pni_write_pipeline_return(iocpd->pipeline, result); if (!iocpd->write_closed && !write_in_progress(iocpd)) iocp_shutdown(iocpd); reap_check(iocpd); return; } if (status == 0 && xfer_count > 0) { if (xfer_count != result->requested) { // Is this recoverable? How to preserve order if multiple overlapped writes? pni_write_pipeline_return(iocpd->pipeline, result); iocpdesc_fail(iocpd, WSA_OPERATION_ABORTED, "Partial overlapped write on socket"); return; } else { // Success. pni_write_pipeline_return(iocpd->pipeline, result); if (pni_write_pipeline_writable(iocpd->pipeline)) pni_events_update(iocpd, iocpd->events | PN_WRITABLE); return; } } // Other error pni_write_pipeline_return(iocpd->pipeline, result); if (status == WSAECONNABORTED || status == WSAECONNRESET || status == WSAENOTCONN || status == ERROR_NETNAME_DELETED) { iocpd->write_closed = true; iocpd->poll_error = true; pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE); pni_win32_error(iocpd->error, "Remote close or timeout", status); } else { iocpdesc_fail(iocpd, status, "IOCP async write error"); } } // === Async reads static read_result_t *read_result(iocpdesc_t *iocpd) { read_result_t *result = (read_result_t *) calloc(sizeof(read_result_t), 1); if (result) { result->base.type = IOCP_READ; result->base.iocpd = iocpd; } return result; } static void begin_zero_byte_read(iocpdesc_t *iocpd) { if (iocpd->read_in_progress) return; if (iocpd->read_closed) { pni_events_update(iocpd, iocpd->events | PN_READABLE); return; } read_result_t *result = iocpd->read_result; memset(&result->base.overlapped, 0, sizeof (OVERLAPPED)); DWORD flags = 0; WSABUF wsabuf; wsabuf.buf = result->unused_buf; wsabuf.len = 0; int rc = WSARecv(iocpd->socket, &wsabuf, 1, NULL, &flags, &result->base.overlapped, 0); if (rc && WSAGetLastError() != ERROR_IO_PENDING) { iocpdesc_fail(iocpd, WSAGetLastError(), "IOCP read error"); return; } iocpd->ops_in_progress++; iocpd->read_in_progress = true; } static void drain_until_closed(iocpdesc_t *iocpd) { size_t max_drain = 16 * 1024; char buf[512]; read_result_t *result = iocpd->read_result; while (result->drain_count < max_drain) { int rv = recv(iocpd->socket, buf, 512, 0); if (rv > 0) result->drain_count += rv; else if (rv == 0) { iocpd->read_closed = true; return; } else if (WSAGetLastError() == WSAEWOULDBLOCK) { // wait a little longer start_reading(iocpd); return; } else break; } // Graceful close indication unlikely, force the issue if (iocpd->iocp->iocp_trace) if (result->drain_count >= max_drain) iocp_log("graceful close on reader abandoned (too many chars)\n"); else iocp_log("graceful close on reader abandoned: %d\n", WSAGetLastError()); iocpd->read_closed = true; } void complete_read(read_result_t *result, DWORD xfer_count, HRESULT status) { iocpdesc_t *iocpd = result->base.iocpd; iocpd->read_in_progress = false; if (iocpd->closing) { // Application no longer reading, but we are looking for a zero length read if (!iocpd->read_closed) drain_until_closed(iocpd); reap_check(iocpd); return; } if (status == 0 && xfer_count == 0) { // Success. pni_events_update(iocpd, iocpd->events | PN_READABLE); } else { iocpdesc_fail(iocpd, status, "IOCP read complete error"); } } ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error) { if (size == 0) return 0; *would_block = false; if (is_listener(iocpd)) { set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP); return SOCKET_ERROR; } if (iocpd->closing) { // Previous call to pn_close() set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN); return SOCKET_ERROR; } if (iocpd->read_closed) { if (pn_error_code(iocpd->error)) pn_error_copy(error, iocpd->error); else set_iocp_error_status(error, PN_ERR, WSAENOTCONN); return SOCKET_ERROR; } int count = recv(iocpd->socket, (char *) buf, size, 0); if (count > 0) { pni_events_update(iocpd, iocpd->events & ~PN_READABLE); // caller must initiate begin_zero_byte_read(iocpd); return (ssize_t) count; } else if (count == 0) { iocpd->read_closed = true; return 0; } if (WSAGetLastError() == WSAEWOULDBLOCK) *would_block = true; else { set_iocp_error_status(error, PN_ERR, WSAGetLastError()); iocpd->read_closed = true; } return SOCKET_ERROR; } void start_reading(iocpdesc_t *iocpd) { begin_zero_byte_read(iocpd); } // === The iocp descriptor static void pni_iocpdesc_initialize(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; memset(iocpd, 0, sizeof(iocpdesc_t)); iocpd->socket = INVALID_SOCKET; } static void pni_iocpdesc_finalize(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; pn_free(iocpd->acceptor); pn_error_free(iocpd->error); if (iocpd->pipeline) if (write_in_progress(iocpd)) iocp_log("iocp descriptor write leak\n"); else pn_free(iocpd->pipeline); if (iocpd->read_in_progress) iocp_log("iocp descriptor read leak\n"); else free(iocpd->read_result); } static uintptr_t pni_iocpdesc_hashcode(void *object) { iocpdesc_t *iocpd = (iocpdesc_t *) object; return iocpd->socket; } #define pni_iocpdesc_compare NULL #define pni_iocpdesc_inspect NULL // Reference counted in the iocpdesc map, zombie_list, selector. static iocpdesc_t *pni_iocpdesc(pn_socket_t s) { static const pn_cid_t CID_pni_iocpdesc = CID_pn_void; static pn_class_t clazz = PN_CLASS(pni_iocpdesc); iocpdesc_t *iocpd = (iocpdesc_t *) pn_class_new(&clazz, sizeof(iocpdesc_t)); assert(iocpd); iocpd->socket = s; return iocpd; } static bool is_listener_socket(pn_socket_t s) { BOOL tval = false; int tvalsz = sizeof(tval); int code = getsockopt(s, SOL_SOCKET, SO_ACCEPTCONN, (char *)&tval, &tvalsz); return code == 0 && tval; } iocpdesc_t *pni_iocpdesc_create(iocp_t *iocp, pn_socket_t s) { assert (s != INVALID_SOCKET); bool listening = is_listener_socket(s); iocpdesc_t *iocpd = pni_iocpdesc(s); iocpd->iocp = iocp; if (iocpd) { iocpd->error = pn_error(); if (listening) { iocpd->acceptor = pni_acceptor(iocpd); } else { iocpd->pipeline = pni_write_pipeline(iocpd); iocpd->read_result = read_result(iocpd); } } return iocpd; } static void bind_to_completion_port(iocpdesc_t *iocpd) { if (iocpd->bound) return; if (!iocpd->iocp->completion_port) { iocpdesc_fail(iocpd, WSAEINVAL, "Incomplete setup, no completion port."); return; } if (CreateIoCompletionPort ((HANDLE) iocpd->socket, iocpd->iocp->completion_port, 0, 0)) iocpd->bound = true; else { iocpdesc_fail(iocpd, GetLastError(), "IOCP socket setup."); } } static void release_sys_sendbuf(SOCKET s) { // Set the socket's send buffer size to zero. int sz = 0; int status = setsockopt(s, SOL_SOCKET, SO_SNDBUF, (const char *)&sz, sizeof(int)); assert(status == 0); } void pni_iocpdesc_start(iocpdesc_t *iocpd) { if (iocpd->bound) return; bind_to_completion_port(iocpd); if (is_listener(iocpd)) { begin_accept(iocpd->acceptor, NULL); } else { release_sys_sendbuf(iocpd->socket); pni_events_update(iocpd, PN_WRITABLE); start_reading(iocpd); } } static void complete(iocp_result_t *result, bool success, DWORD num_transferred) { result->iocpd->ops_in_progress--; DWORD status = success ? 0 : GetLastError(); switch (result->type) { case IOCP_ACCEPT: complete_accept((accept_result_t *) result, status); break; case IOCP_CONNECT: complete_connect((connect_result_t *) result, status); break; case IOCP_WRITE: complete_write((write_result_t *) result, num_transferred, status); break; case IOCP_READ: complete_read((read_result_t *) result, num_transferred, status); break; default: assert(false); } } void pni_iocp_drain_completions(iocp_t *iocp) { while (true) { DWORD timeout_ms = 0; DWORD num_transferred = 0; ULONG_PTR completion_key = 0; OVERLAPPED *overlapped = 0; bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred, &completion_key, &overlapped, timeout_ms); if (!overlapped) return; // timed out iocp_result_t *result = (iocp_result_t *) overlapped; if (!completion_key) complete(result, good_op, num_transferred); } } // returns: -1 on error, 0 on timeout, 1 successful completion // proactor layer uses completion_key, but we don't, so ignore those (shutdown in progress) int pni_iocp_wait_one(iocp_t *iocp, int timeout, pn_error_t *error) { DWORD win_timeout = (timeout < 0) ? INFINITE : (DWORD) timeout; DWORD num_transferred = 0; ULONG_PTR completion_key = 0; OVERLAPPED *overlapped = 0; bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred, &completion_key, &overlapped, win_timeout); if (!overlapped) if (GetLastError() == WAIT_TIMEOUT) return 0; else { if (error) pni_win32_error(error, "GetQueuedCompletionStatus", GetLastError()); return -1; } if (completion_key) return pni_iocp_wait_one(iocp, timeout, error); iocp_result_t *result = (iocp_result_t *) overlapped; complete(result, good_op, num_transferred); return 1; } // === Close (graceful and otherwise) // zombie_list is for sockets transitioning out of iocp on their way to zero ops_in_progress // and fully closed. static void zombie_list_add(iocpdesc_t *iocpd) { assert(iocpd->closing); if (!iocpd->ops_in_progress) { // No need to make a zombie. if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; } return; } // Allow 2 seconds for graceful shutdown before releasing socket resource. iocpd->reap_time = pn_i_now2() + 2000; pn_list_add(iocpd->iocp->zombie_list, iocpd); } static void reap_check(iocpdesc_t *iocpd) { if (iocpd->closing && !iocpd->ops_in_progress) { if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; } pn_list_remove(iocpd->iocp->zombie_list, iocpd); // iocpd is decref'ed and possibly released } } void pni_iocp_reap_check(iocpdesc_t *iocpd) { reap_check(iocpd); } pn_timestamp_t pni_zombie_deadline(iocp_t *iocp) { if (pn_list_size(iocp->zombie_list)) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, 0); return iocpd->reap_time; } return 0; } void pni_zombie_check(iocp_t *iocp, pn_timestamp_t now) { pn_list_t *zl = iocp->zombie_list; // Look for stale zombies that should have been reaped by "now" for (size_t idx = 0; idx < pn_list_size(zl); idx++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(zl, idx); if (iocpd->reap_time > now) return; if (iocpd->socket == INVALID_SOCKET) continue; if (iocp->iocp_trace) iocp_log("async close: graceful close timeout exceeded\n"); closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; // outstanding ops should complete immediately now } } static void drain_zombie_completions(iocp_t *iocp) { // No more pn_selector_select() from App, but zombies still need care and feeding // until their outstanding async actions complete. pni_iocp_drain_completions(iocp); // Discard any that have no pending async IO size_t sz = pn_list_size(iocp->zombie_list); for (size_t idx = 0; idx < sz;) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, idx); if (!iocpd->ops_in_progress) { pn_list_del(iocp->zombie_list, idx, 1); sz--; } else { idx++; } } unsigned shutdown_grace = 2000; char *override = getenv("PN_SHUTDOWN_GRACE"); if (override) { int grace = atoi(override); if (grace > 0 && grace < 60000) shutdown_grace = (unsigned) grace; } pn_timestamp_t now = pn_i_now2(); pn_timestamp_t deadline = now + shutdown_grace; while (pn_list_size(iocp->zombie_list)) { if (now >= deadline) break; int rv = pni_iocp_wait_one(iocp, deadline - now, NULL); if (rv < 0) { iocp_log("unexpected IOCP failure on Proton IO shutdown %d\n", GetLastError()); break; } now = pn_i_now2(); } if (now >= deadline && pn_list_size(iocp->zombie_list) && iocp->iocp_trace) // Should only happen if really slow TCP handshakes, i.e. total network failure iocp_log("network failure on Proton shutdown\n"); } static void zombie_list_hard_close_all(iocp_t *iocp) { pni_iocp_drain_completions(iocp); size_t zs = pn_list_size(iocp->zombie_list); for (size_t i = 0; i < zs; i++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i); if (iocpd->socket != INVALID_SOCKET) { closesocket(iocpd->socket); iocpd->socket = INVALID_SOCKET; iocpd->read_closed = true; iocpd->write_closed = true; } } pni_iocp_drain_completions(iocp); // Zombies should be all gone. Do a sanity check. zs = pn_list_size(iocp->zombie_list); int remaining = 0; int ops = 0; for (size_t i = 0; i < zs; i++) { iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i); remaining++; ops += iocpd->ops_in_progress; } if (remaining) iocp_log("Proton: %d unfinished close operations (ops count = %d)\n", remaining, ops); } static void iocp_shutdown(iocpdesc_t *iocpd) { if (iocpd->socket == INVALID_SOCKET) return; // Hard close in progress if (shutdown(iocpd->socket, SD_SEND)) { int err = WSAGetLastError(); if (err != WSAECONNABORTED && err != WSAECONNRESET && err != WSAENOTCONN) if (iocpd->iocp->iocp_trace) iocp_log("socket shutdown failed %d\n", err); } iocpd->write_closed = true; } void pni_iocp_begin_close(iocpdesc_t *iocpd) { assert (!iocpd->closing); if (is_listener(iocpd)) { // Listening socket is easy. Close the socket which will cancel async ops. pn_socket_t old_sock = iocpd->socket; iocpd->socket = INVALID_SOCKET; iocpd->closing = true; iocpd->read_closed = true; iocpd->write_closed = true; closesocket(old_sock); // Pending accepts will now complete. Zombie can die when all consumed. zombie_list_add(iocpd); } else { // Continue async operation looking for graceful close confirmation or timeout. pn_socket_t old_sock = iocpd->socket; iocpd->closing = true; if (!iocpd->write_closed && !write_in_progress(iocpd)) iocp_shutdown(iocpd); zombie_list_add(iocpd); } } // === iocp_t #define pni_iocp_hashcode NULL #define pni_iocp_compare NULL #define pni_iocp_inspect NULL void pni_iocp_initialize(void *obj) { iocp_t *iocp = (iocp_t *) obj; memset(iocp, 0, sizeof(iocp_t)); pni_shared_pool_create(iocp); iocp->completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0); assert(iocp->completion_port != NULL); iocp->zombie_list = pn_list(PN_OBJECT, 0); iocp->iocp_trace = false; } void pni_iocp_finalize(void *obj) { iocp_t *iocp = (iocp_t *) obj; // Move sockets to closed state drain_zombie_completions(iocp); // Last chance for graceful close zombie_list_hard_close_all(iocp); CloseHandle(iocp->completion_port); // This cancels all our async ops iocp->completion_port = NULL; // Now safe to free everything that might be touched by a former async operation. pn_free(iocp->zombie_list); pni_shared_pool_free(iocp); } iocp_t *pni_iocp() { static const pn_cid_t CID_pni_iocp = CID_pn_void; static const pn_class_t clazz = PN_CLASS(pni_iocp); iocp_t *iocp = (iocp_t *) pn_class_new(&clazz, sizeof(iocp_t)); return iocp; } } // ====================================================================== // Proton Proactor support // ====================================================================== #include "../core/log_private.h" #include "./proactor-internal.h" class csguard { public: csguard(CRITICAL_SECTION *cs) : cs_(cs), set_(true) { EnterCriticalSection(cs_); } ~csguard() { if (set_) LeaveCriticalSection(cs_); } void release() { if (set_) { set_ = false; LeaveCriticalSection(cs_); } } private: LPCRITICAL_SECTION cs_; bool set_; }; // Get string from error status std::string errno_str2(DWORD status) { char buf[512]; if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, 0, status, 0, buf, sizeof(buf), 0)) return std::string(buf); return std::string("internal proactor error"); } std::string errno_str(const std::string& msg, bool is_wsa) { DWORD e = is_wsa ? WSAGetLastError() : GetLastError(); return msg + ": " + errno_str2(e); } using namespace pn_experimental; static void proactor_wake_stub() {} ULONG_PTR proactor_wake_key = (ULONG_PTR) &proactor_wake_stub; static void psocket_wakeup_stub() {} ULONG_PTR psocket_wakeup_key = (ULONG_PTR) &psocket_wakeup_stub; static void recycle_accept_stub() {} ULONG_PTR recycle_accept_key = (ULONG_PTR) &recycle_accept_stub; static int pgetaddrinfo(const char *host, const char *port, int flags, struct addrinfo **res) { struct addrinfo hints = { 0 }; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | flags; return getaddrinfo(host, port, &hints, res) ? WSAGetLastError() : 0; } const char *COND_NAME = "proactor"; PN_HANDLE(PN_PROACTOR) // The number of times a connection event batch may be replenished for // a thread between calls to wait(). // TODO: consider some instrumentation to determine an optimal number // or switch to cpu time based limit. #define HOG_MAX 3 /* pn_proactor_t and pn_listener_t are plain C structs with normal memory management. Class definitions are for identification as pn_event_t context only. */ PN_STRUCT_CLASSDEF(pn_proactor, CID_pn_proactor) PN_STRUCT_CLASSDEF(pn_listener, CID_pn_listener) /* Completion serialization context common to connection and listener. */ /* And also the reaper singleton (which has no socket */ typedef enum { PROACTOR, PCONNECTION, LISTENER, WAKEABLE } pcontext_type_t; typedef struct pcontext_t { CRITICAL_SECTION cslock; pn_proactor_t *proactor; /* Immutable */ void *owner; /* Instance governed by the context */ pcontext_type_t type; bool working; bool wake_pending; int completion_ops; // uncompleted ops that are not socket IO related struct pcontext_t *wake_next; // wake list, guarded by proactor eventfd_mutex bool closing; // Next 4 are protected by the proactor mutex struct pcontext_t* next; /* Protected by proactor.mutex */ struct pcontext_t* prev; /* Protected by proactor.mutex */ int disconnect_ops; /* ops remaining before disconnect complete */ bool disconnecting; /* pn_proactor_disconnect */ } pcontext_t; static void pcontext_init(pcontext_t *ctx, pcontext_type_t t, pn_proactor_t *p, void *o) { memset(ctx, 0, sizeof(*ctx)); InitializeCriticalSectionAndSpinCount(&ctx->cslock, 4000); ctx->proactor = p; ctx->owner = o; ctx->type = t; } static void pcontext_finalize(pcontext_t* ctx) { DeleteCriticalSection(&ctx->cslock); } typedef struct psocket_t { iocpdesc_t *iocpd; /* NULL if reaper, or socket open failure. */ pn_listener_t *listener; /* NULL for a connection socket */ pn_netaddr_t listen_addr; /* Not filled in for connection sockets */ char addr_buf[PN_MAX_ADDR]; const char *host, *port; bool is_reaper; } psocket_t; static void psocket_init(psocket_t* ps, pn_listener_t *listener, bool is_reaper, const char *addr) { ps->is_reaper = is_reaper; if (is_reaper) return; ps->listener = listener; pni_parse_addr(addr, ps->addr_buf, sizeof(ps->addr_buf), &ps->host, &ps->port); } struct pn_proactor_t { pcontext_t context; CRITICAL_SECTION write_lock; CRITICAL_SECTION timer_lock; CRITICAL_SECTION bind_lock; HANDLE timer_queue; HANDLE timeout_timer; iocp_t *iocp; class reaper *reaper; pn_collector_t *collector; pcontext_t *contexts; /* in-use contexts for PN_PROACTOR_INACTIVE and cleanup */ pn_event_batch_t batch; size_t disconnects_pending; /* unfinished proactor disconnects*/ // need_xxx flags indicate we should generate PN_PROACTOR_XXX on the next update_batch() bool need_interrupt; bool need_inactive; bool need_timeout; bool timeout_set; /* timeout has been set by user and not yet cancelled or generated event */ bool timeout_processed; /* timout event dispatched in the most recent event batch */ bool delayed_interrupt; bool shutting_down; }; typedef struct pconnection_t { psocket_t psocket; pcontext_t context; pn_connection_driver_t driver; std::queue *completion_queue; std::queue *work_queue; pn_condition_t *disconnect_condition; pn_event_batch_t batch; int wake_count; int hog_count; // thread hogging limiter bool server; /* accept, not connect */ bool started; bool connecting; bool tick_pending; bool queued_disconnect; /* deferred from pn_proactor_disconnect() */ bool bound; bool stop_timer_required; bool can_wake; HANDLE tick_timer; struct pn_netaddr_t local, remote; /* Actual addresses */ struct addrinfo *addrinfo; /* Resolved address list */ struct addrinfo *ai; /* Current connect address */ } pconnection_t; struct pn_listener_t { psocket_t *psockets; /* Array of listening sockets */ size_t psockets_size; pcontext_t context; std::queue *pending_accepts; // sockets awaiting a pn_listener_accept int pending_events; // number of PN_LISTENER_ACCEPT events to be delivered pn_condition_t *condition; pn_collector_t *collector; pn_event_batch_t batch; pn_record_t *attachments; void *listener_context; size_t backlog; bool close_dispatched; }; static bool proactor_remove(pcontext_t *ctx); static void listener_done(pn_listener_t *l); static bool proactor_update_batch(pn_proactor_t *p); static pn_event_batch_t *listener_process(pn_listener_t *l, iocp_result_t *result); static void recycle_result(accept_result_t *accept_result); static void proactor_add(pcontext_t *p); static void release_pending_accepts(pn_listener_t *l); static void proactor_shutdown(pn_proactor_t *p); static void post_completion(iocp_t *iocp, ULONG_PTR arg1, void *arg2) { // Despite the vagueness of the official documentation, the // following args to Post are passed undisturbed and unvalidated // to GetQueuedCompletionStatus(). In particular, arg2 does not // have to be an OVERLAPPED struct and may be NULL. DWORD nxfer = 0; // We could pass this through too if needed. PostQueuedCompletionStatus(iocp->completion_port, nxfer, arg1, (LPOVERLAPPED) arg2); } static inline bool is_write_result(iocp_result_t *r) { return r && r->type == IOCP_WRITE; } static inline bool is_read_result(iocp_result_t *r) { return r && r->type == IOCP_READ; } static inline bool is_connect_result(iocp_result_t *r) { return r && r->type == IOCP_CONNECT; } // From old io.c static void pni_configure_sock_2(pn_socket_t sock) { // // Disable the Nagle algorithm on TCP connections. // int flag = 1; if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)) != 0) { //TODO: log/err } u_long nonblock = 1; if (ioctlsocket(sock, FIONBIO, &nonblock)) { // TODO: log/err } } static LPFN_CONNECTEX lookup_connect_ex2(SOCKET s) { GUID guid = WSAID_CONNECTEX; DWORD bytes = 0; LPFN_CONNECTEX fn; WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &fn, sizeof(fn), &bytes, NULL, NULL); assert(fn); return fn; } // File descriptor wrapper that calls ::close in destructor. class unique_socket { public: unique_socket(pn_socket_t socket) : socket_(socket) {} ~unique_socket() { if (socket_ != INVALID_SOCKET) ::closesocket(socket_); } operator pn_socket_t() const { return socket_; } pn_socket_t release() { pn_socket_t ret = socket_; socket_ = INVALID_SOCKET; return ret; } protected: pn_socket_t socket_; }; void do_complete(iocp_result_t *result) { iocpdesc_t *iocpd = result->iocpd; // connect result gets deleted switch (result->type) { case IOCP_ACCEPT: /* accept is now processed inline to do in parallel, except on teardown */ assert(iocpd->closing); complete_accept((accept_result_t *) result, result->status); // free's result and retires new_sock break; case IOCP_CONNECT: complete_connect((connect_result_t *) result, result->status); break; case IOCP_WRITE: complete_write((write_result_t *) result, result->num_transferred, result->status); break; case IOCP_READ: complete_read((read_result_t *) result, result->num_transferred, result->status); break; default: assert(false); } iocpd->ops_in_progress--; // Set in each begin_xxx call } static inline pconnection_t *as_pconnection_t(psocket_t* ps) { return !(ps->is_reaper || ps->listener) ? (pconnection_t*)ps : NULL; } static inline pn_listener_t *as_listener(psocket_t* ps) { return ps->listener; } static inline pconnection_t *pcontext_pconnection(pcontext_t *c) { return c->type == PCONNECTION ? (pconnection_t*)((char*)c - offsetof(pconnection_t, context)) : NULL; } static inline pn_listener_t *pcontext_listener(pcontext_t *c) { return c->type == LISTENER ? (pn_listener_t*)((char*)c - offsetof(pn_listener_t, context)) : NULL; } static pcontext_t *psocket_context(psocket_t *ps) { if (ps->listener) return &ps->listener->context; pconnection_t *pc = as_pconnection_t(ps); return &pc->context; } // Call wih lock held static inline void wake_complete(pcontext_t *ctx) { ctx->wake_pending = false; ctx->completion_ops--; } // Call wih lock held static void wakeup(psocket_t *ps) { pcontext_t *ctx = psocket_context(ps); if (!ctx->working && !ctx->wake_pending) { ctx->wake_pending = true; ctx->completion_ops++; post_completion(ctx->proactor->iocp, psocket_wakeup_key, ps); } } // Call wih lock held static inline void proactor_wake_complete(pn_proactor_t *p) { wake_complete(&p->context); } // Call wih lock held static void proactor_wake(pn_proactor_t *p) { if (!p->context.working && !p->context.wake_pending) { p->context.wake_pending = true; p->context.completion_ops++; post_completion(p->iocp, proactor_wake_key, p); } } VOID CALLBACK reap_check_cb(PVOID arg, BOOLEAN /* ignored*/ ); // Serialize handling listener and connection closing IO completions // after the engine has lost interest. A temporary convenience while // using the old single threaded iocp/io/select driver code. class reaper { public: reaper(pn_proactor_t *p, CRITICAL_SECTION *wlock, iocp_t *iocp) : iocp_(iocp), global_wlock_(wlock), timer_(NULL), running(true) { InitializeCriticalSectionAndSpinCount(&lock_, 4000); timer_queue_ = CreateTimerQueue(); if (!timer_queue_) { perror("CreateTimerQueue"); abort(); } } // Connection or listener lock must also be held by caller. bool add(iocpdesc_t *iocpd) { if (!iocpd) return false; csguard g(&lock_); if (iocpd->closing) return false; bool rval = !iocpd->ops_in_progress; pni_iocp_begin_close(iocpd); // sets iocpd->closing pn_decref(iocpd); // may still be ref counted on zombie list reap_timer(); return rval; } // For cases where the close will be immediate. I.E. after a failed // connection attempt where there is no follow-on IO. void fast_reap(iocpdesc_t *iocpd) { assert(iocpd && iocpd->ops_in_progress == 0 && !iocpd->closing); csguard g(&lock_); pni_iocp_begin_close(iocpd); pn_decref(iocpd); } bool process(iocp_result_t *result) { // No queue of completions for the reaper. Just process // serialized by the lock assuming all actions are "short". // That may be wrong, and if so the real fix is not a // consumer/producer setup but just replace the reaper with a // multi threaded alternative. csguard g(&lock_); iocpdesc_t *iocpd = result->iocpd; if (is_write_result(result)) { csguard wg(global_wlock_); do_complete(result); } else do_complete(result); // result may now be NULL bool rval = (iocpd->ops_in_progress == 0); pni_iocp_reap_check(iocpd); return rval; } // Called when all competing threads have terminated except our own reap_check timer. void final_shutdown() { running = false; DeleteTimerQueueEx(timer_queue_, INVALID_HANDLE_VALUE); // No pending or active timers from thread pool remain. Truly single threaded now. pn_free((void *) iocp_); // calls pni_iocp_finalize(); cleans up all sockets, completions, completion port. DeleteCriticalSection(&lock_); } void reap_check() { csguard g(&lock_); DeleteTimerQueueTimer(timer_queue_, timer_, NULL); timer_ = NULL; reap_timer(); } private: void reap_timer() { // Call with lock if (timer_ || !running) return; pn_timestamp_t now = pn_i_now2(); pni_zombie_check(iocp_, now); pn_timestamp_t zd = pni_zombie_deadline(iocp_); if (zd) { DWORD tm = (zd > now) ? zd - now : 1; if (!CreateTimerQueueTimer(&timer_, timer_queue_, reap_check_cb, this, tm, 0, WT_EXECUTEONLYONCE)) { perror("CreateTimerQueueTimer"); abort(); } } } iocp_t *iocp_; CRITICAL_SECTION lock_; CRITICAL_SECTION *global_wlock_; HANDLE timer_queue_; HANDLE timer_; bool running; }; VOID CALLBACK reap_check_cb(PVOID arg, BOOLEAN /* ignored*/ ) { // queue timer callback reaper *r = static_cast(arg); r->reap_check(); } static void listener_begin_close(pn_listener_t* l); static void connect_step_done(pconnection_t *pc, connect_result_t *result); static pn_event_t *listener_batch_next(pn_event_batch_t *batch); static pn_event_t *proactor_batch_next(pn_event_batch_t *batch); static pn_event_t *pconnection_batch_next(pn_event_batch_t *batch); static inline pn_proactor_t *batch_proactor(pn_event_batch_t *batch) { return (batch->next_event == proactor_batch_next) ? (pn_proactor_t*)((char*)batch - offsetof(pn_proactor_t, batch)) : NULL; } static inline pn_listener_t *batch_listener(pn_event_batch_t *batch) { return (batch->next_event == listener_batch_next) ? (pn_listener_t*)((char*)batch - offsetof(pn_listener_t, batch)) : NULL; } static inline pconnection_t *batch_pconnection(pn_event_batch_t *batch) { return (batch->next_event == pconnection_batch_next) ? (pconnection_t*)((char*)batch - offsetof(pconnection_t, batch)) : NULL; } static inline bool pconnection_has_event(pconnection_t *pc) { return pn_connection_driver_has_event(&pc->driver); } static inline bool listener_has_event(pn_listener_t *l) { return pn_collector_peek(l->collector); } static inline bool proactor_has_event(pn_proactor_t *p) { return pn_collector_peek(p->collector); } static pn_event_t *log_event(void* p, pn_event_t *e) { if (e) { pn_logf("[%p]:(%s)", (void*)p, pn_event_type_name(pn_event_type(e))); } return e; } static void psocket_error_str(psocket_t *ps, const char *msg, const char* what) { if (ps->is_reaper) return; if (!ps->listener) { pn_connection_driver_t *driver = &as_pconnection_t(ps)->driver; pn_connection_driver_bind(driver); /* Bind so errors will be reported */ pni_proactor_set_cond(pn_transport_condition(driver->transport), what, ps->host, ps->port, msg); pn_connection_driver_close(driver); } else { pn_listener_t *l = as_listener(ps); pni_proactor_set_cond(l->condition, what, ps->host, ps->port, msg); listener_begin_close(l); } } static void psocket_error(psocket_t *ps, int err, const char* what) { psocket_error_str(ps, errno_str2(err).c_str(), what); } // ======================================================================== // pconnection // ======================================================================== /* Make a pn_class for pconnection_t since it is attached to a pn_connection_t record */ #define CID_pconnection CID_pn_object #define pconnection_inspect NULL #define pconnection_initialize NULL #define pconnection_hashcode NULL #define pconnection_compare NULL static void pconnection_finalize(void *vp_pconnection) { pconnection_t *pc = (pconnection_t*)vp_pconnection; pcontext_finalize(&pc->context); } static const pn_class_t pconnection_class = PN_CLASS(pconnection); static const char *pconnection_setup(pconnection_t *pc, pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, bool server, const char *addr) { if (pn_connection_driver_init(&pc->driver, c, t) != 0) { free(pc); return "pn_connection_driver_init failure"; } { csguard g(&p->bind_lock); pn_record_t *r = pn_connection_attachments(pc->driver.connection); if (pn_record_get(r, PN_PROACTOR)) { pn_connection_driver_destroy(&pc->driver); free(pc); return "pn_connection_t already in use"; } pn_record_def(r, PN_PROACTOR, &pconnection_class); pn_record_set(r, PN_PROACTOR, pc); pc->bound = true; pc->can_wake = true; } pc->completion_queue = new std::queue(); pc->work_queue = new std::queue(); pcontext_init(&pc->context, PCONNECTION, p, pc); psocket_init(&pc->psocket, NULL, false, addr); pc->batch.next_event = pconnection_batch_next; if (server) { pn_transport_set_server(pc->driver.transport); } pn_decref(pc); /* Will be deleted when the connection is */ return NULL; } // Either stops a timer before firing or returns after the callback has // completed (in the threadpool thread). Never "in doubt". static bool stop_timer(HANDLE tqueue, HANDLE *timer) { if (!*timer) return true; if (DeleteTimerQueueTimer(tqueue, *timer, INVALID_HANDLE_VALUE)) { *timer = NULL; return true; } return false; // error } static bool start_timer(HANDLE tqueue, HANDLE *timer, WAITORTIMERCALLBACK cb, void *cb_arg, DWORD time) { if (*timer) { // TODO: log err return false; } return CreateTimerQueueTimer(timer, tqueue, cb, cb_arg, time, 0, WT_EXECUTEONLYONCE); } VOID CALLBACK tick_timer_cb(PVOID arg, BOOLEAN /* ignored*/ ) { pconnection_t *pc = (pconnection_t *) arg; csguard g(&pc->context.cslock); if (pc->psocket.iocpd && !pc->psocket.iocpd->closing) { pc->tick_pending = true; wakeup(&pc->psocket); } } // Call with no lock held or stop_timer and callback may deadlock static void pconnection_tick(pconnection_t *pc) { pn_transport_t *t = pc->driver.transport; if (pn_transport_get_idle_timeout(t) || pn_transport_get_remote_idle_timeout(t)) { if(!stop_timer(pc->context.proactor->timer_queue, &pc->tick_timer)) { // TODO: handle error } uint64_t now = pn_i_now2(); uint64_t next = pn_transport_tick(t, now); if (next) { if (!start_timer(pc->context.proactor->timer_queue, &pc->tick_timer, tick_timer_cb, pc, next - now)) { // TODO: handle error } } } } static pconnection_t *get_pconnection(pn_connection_t* c) { if (!c) return NULL; pn_record_t *r = pn_connection_attachments(c); return (pconnection_t*) pn_record_get(r, PN_PROACTOR); } pn_listener_t *pn_event_listener(pn_event_t *e) { return (pn_event_class(e) == pn_listener__class()) ? (pn_listener_t*)pn_event_context(e) : NULL; } pn_proactor_t *pn_event_proactor(pn_event_t *e) { if (pn_event_class(e) == pn_proactor__class()) return (pn_proactor_t*)pn_event_context(e); pn_listener_t *l = pn_event_listener(e); if (l) return l->context.proactor; pn_connection_t *c = pn_event_connection(e); if (c) return pn_connection_proactor(pn_event_connection(e)); return NULL; } // Call after successful accept static void set_sock_names(pconnection_t *pc) { // This works. Note possible use of GetAcceptExSockaddrs() pn_socket_t sock = pc->psocket.iocpd->socket; socklen_t len = sizeof(pc->local.ss); getsockname(sock, (struct sockaddr*)&pc->local.ss, &len); len = sizeof(pc->remote.ss); getpeername(sock, (struct sockaddr*)&pc->remote.ss, &len); } // Call with lock held when closing and transitioning away from working context static inline bool pconnection_can_free(pconnection_t *pc) { return pc->psocket.iocpd == NULL && pc->context.completion_ops == 0 && !pc->stop_timer_required && !pconnection_has_event(pc) && !pc->queued_disconnect; } static void pconnection_final_free(pconnection_t *pc) { if (pc->addrinfo) { freeaddrinfo(pc->addrinfo); } pn_condition_free(pc->disconnect_condition); pn_incref(pc); /* Make sure we don't do a circular free */ pn_connection_driver_destroy(&pc->driver); pn_decref(pc); /* Now pc is freed iff the connection is, otherwise remains till the pn_connection_t is freed. */ } // Call with lock held or from forced shutdown static void pconnection_begin_close(pconnection_t *pc) { if (!pc->context.closing) { pc->context.closing = true; pn_connection_driver_close(&pc->driver); pc->stop_timer_required = true; if (pc->context.proactor->reaper->add(pc->psocket.iocpd)) pc->psocket.iocpd = NULL; wakeup(&pc->psocket); } } // call with lock held. return true if caller must call pconnection_final_free() static bool pconnection_cleanup(pconnection_t *pc) { delete pc->completion_queue; delete pc->work_queue; return proactor_remove(&pc->context); } static inline bool pconnection_work_pending(pconnection_t *pc) { if (pc->completion_queue->size() || pc->wake_count || pc->tick_pending || pc->queued_disconnect) return true; if (!pc->started) return false; pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); return (wbuf.size > 0 && (pc->psocket.iocpd->events & PN_WRITABLE)); } // Return true unless reaped static bool pconnection_write(pconnection_t *pc, pn_bytes_t wbuf) { ssize_t n; bool wouldblock; { csguard g(&pc->context.proactor->write_lock); n = pni_iocp_begin_write(pc->psocket.iocpd, wbuf.start, wbuf.size, &wouldblock, pc->psocket.iocpd->error); } if (n > 0) { pn_connection_driver_write_done(&pc->driver, n); } else if (n < 0 && !wouldblock) { psocket_error(&pc->psocket, WSAGetLastError(), "on write to"); } else if (wbuf.size == 0 && pn_connection_driver_write_closed(&pc->driver)) { if (pc->context.proactor->reaper->add(pc->psocket.iocpd)) { pc->psocket.iocpd = NULL; return false; } } return true; } // Queue the result (if any) for the one worker thread. Become the worker if possible. // NULL result is a wakeup or a topup. // topup signifies that the working thread is the caller looking for additional events. static pn_event_batch_t *pconnection_process(pconnection_t *pc, iocp_result_t *result, bool topup) { bool first = true; bool waking = false; bool tick_required = false; bool open = false; while (true) { { csguard g(&pc->context.cslock); if (first) { first = false; if (result) pc->completion_queue->push(result); else if (!topup) wake_complete(&pc->context); if (!topup) { if (pc->context.working) return NULL; pc->context.working = true; } open = pc->started && !pc->connecting && !pc->context.closing; } else { // Just re-acquired lock after processing IO and engine work if (pconnection_has_event(pc)) return &pc->batch; if (!pconnection_work_pending(pc)) { pc->context.working = false; if (pn_connection_driver_finished(&pc->driver)) { pconnection_begin_close(pc); } if (pc->context.closing && pconnection_can_free(pc)) { if (pconnection_cleanup(pc)) { g.release(); pconnection_final_free(pc); return NULL; } // else disconnect logic has the free obligation } return NULL; } } if (pc->queued_disconnect) { // From pn_proactor_disconnect() pc->queued_disconnect = false; if (!pc->context.closing) { if (pc->disconnect_condition) { pn_condition_copy(pn_transport_condition(pc->driver.transport), pc->disconnect_condition); } pn_connection_driver_close(&pc->driver); } } assert(pc->work_queue->empty()); if (pc->completion_queue->size()) std::swap(pc->work_queue, pc->completion_queue); if (pc->wake_count) { waking = open && pc->can_wake && !pn_connection_driver_finished(&pc->driver); pc->wake_count = 0; } if (pc->tick_pending) { pc->tick_pending = false; if (open) tick_required = true; } } // No lock // Drain completions prior to engine work while (pc->work_queue->size()) { result = (iocp_result_t *) pc->work_queue->front(); pc->work_queue->pop(); if (result->iocpd->closing) { if (pc->context.proactor->reaper->process(result)) { pc->psocket.iocpd = NULL; // reaped open = false; } } else { if (is_write_result(result)) { csguard g(&pc->context.proactor->write_lock); do_complete(result); } else if (is_connect_result(result)) { connect_step_done(pc, (connect_result_t *) result); if (pc->psocket.iocpd && (pc->psocket.iocpd->events & PN_WRITABLE)) { pc->connecting = false; if (pc->started) open = true; } } else do_complete(result); } } if (!open) { if (pc->stop_timer_required) { pc->stop_timer_required = false; // Do without context lock to avoid possible deadlock stop_timer(pc->context.proactor->timer_queue, &pc->tick_timer); } } else { pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver); pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); /* Ticks and checking buffers can generate events, process before proceeding */ bool ready = pconnection_has_event(pc); if (waking) { pn_connection_t *c = pc->driver.connection; pn_collector_put(pn_connection_collector(c), PN_OBJECT, c, PN_CONNECTION_WAKE); waking = false; } if (ready) { continue; } if (wbuf.size >= 16384 && (pc->psocket.iocpd->events & PN_WRITABLE)) { if (!pconnection_write(pc, wbuf)) continue; } if (rbuf.size > 0 && !pc->psocket.iocpd->read_in_progress) { bool wouldblock; ssize_t n = pni_iocp_recv(pc->psocket.iocpd, rbuf.start, rbuf.size, &wouldblock, pc->psocket.iocpd->error); if (n > 0) { pn_connection_driver_read_done(&pc->driver, n); pconnection_tick(pc); /* check for tick changes. */ tick_required = false; } else if (n == 0) pn_connection_driver_read_close(&pc->driver); else if (!wouldblock) psocket_error(&pc->psocket, WSAGetLastError(), "on read from"); } if (!pc->psocket.iocpd->read_in_progress) start_reading(pc->psocket.iocpd); if (tick_required) { pconnection_tick(pc); /* check for tick changes. */ tick_required = false; } wbuf = pn_connection_driver_write_buffer(&pc->driver); if (wbuf.size > 0 && (pc->psocket.iocpd->events & PN_WRITABLE)) { if (!pconnection_write(pc, wbuf)) open = false; } } if (topup) return NULL; // regardless if new events made available } } static pn_event_t *pconnection_batch_next(pn_event_batch_t *batch) { pconnection_t *pc = batch_pconnection(batch); pn_event_t *e = pn_connection_driver_next_event(&pc->driver); if (!e && ++pc->hog_count < HOG_MAX) { pconnection_process(pc, NULL, true); // top up e = pn_connection_driver_next_event(&pc->driver); } if (e && !pc->started && pn_event_type(e) == PN_CONNECTION_BOUND) pc->started = true; // SSL will be set up on return and safe to do IO with correct transport layers return e; } static void pconnection_done(pconnection_t *pc) { { csguard g(&pc->context.cslock); pc->context.working = false; pc->hog_count = 0; if (pconnection_has_event(pc) || pconnection_work_pending(pc)) { wakeup(&pc->psocket); } else if (pn_connection_driver_finished(&pc->driver)) { pconnection_begin_close(pc); wakeup(&pc->psocket); } } } static inline bool is_inactive(pn_proactor_t *p) { return (!p->contexts && !p->disconnects_pending && !p->timeout_set && !p->need_timeout && !p->shutting_down); } // Call whenever transitioning from "definitely active" to "maybe inactive" static void wake_if_inactive(pn_proactor_t *p) { if (is_inactive(p)) { p->need_inactive = true; proactor_wake(p); } } void pn_proactor_done(pn_proactor_t *p, pn_event_batch_t *batch) { pconnection_t *pc = batch_pconnection(batch); if (pc) { pconnection_done(pc); return; } pn_listener_t *l = batch_listener(batch); if (l) { listener_done(l); return; } pn_proactor_t *bp = batch_proactor(batch); if (bp == p) { csguard g(&p->context.cslock); p->context.working = false; if (p->delayed_interrupt) { p->delayed_interrupt = false; p->need_interrupt = true; } if (p->timeout_processed) { p->timeout_processed = false; wake_if_inactive(p); } if (proactor_update_batch(p)) proactor_wake(p); return; } } static void proactor_add_event(pn_proactor_t *p, pn_event_type_t t) { pn_collector_put(p->collector, pn_proactor__class(), p, t); } static pn_event_batch_t *proactor_process(pn_proactor_t *p) { csguard g(&p->context.cslock); proactor_wake_complete(p); if (!p->context.working) { /* Can generate proactor events */ if (proactor_update_batch(p)) { p->context.working = true; return &p->batch; } } return NULL; } static pn_event_batch_t *psocket_process(psocket_t *ps, iocp_result_t *result, reaper *rpr) { if (ps) { pconnection_t *pc = as_pconnection_t(ps); if (pc) { return pconnection_process(pc, result, false); } else { pn_listener_t *l = as_listener(ps); if (l) return listener_process(l, result); } } rpr->process(result); return NULL; } static pn_event_batch_t *proactor_completion_loop(struct pn_proactor_t* p, bool can_block) { // Proact! Process inbound completions of async activity until one // of them provides a batch of events. while(true) { pn_event_batch_t *batch = NULL; DWORD win_timeout = can_block ? INFINITE : 0; DWORD num_xfer = 0; ULONG_PTR completion_key = 0; OVERLAPPED *overlapped = 0; bool good_op = GetQueuedCompletionStatus (p->iocp->completion_port, &num_xfer, &completion_key, &overlapped, win_timeout); if (!overlapped && !can_block && GetLastError() == WAIT_TIMEOUT) return NULL; // valid timeout if (!good_op && !overlapped) { // Should never happen. shutdown? // We aren't expecting a timeout, closed completion port, or other error here. pn_logf("%s", errno_str("Windows Proton proactor internal failure\n", false).c_str()); abort(); } if (completion_key == NULL) { // Normal IO case for connections and listeners iocp_result_t *result = (iocp_result_t *) overlapped; result->status = good_op ? 0 : GetLastError(); result->num_transferred = num_xfer; psocket_t *ps = (psocket_t *) result->iocpd->active_completer; batch = psocket_process(ps, result, p->reaper); } else { // completion_key on our completion port is always null unless set by us // in PostQueuedCompletionStatus. In which case, we hijack the overlapped // data structure for our own use. if (completion_key == psocket_wakeup_key) batch = psocket_process((psocket_t *) overlapped, NULL, p->reaper); else if (completion_key == proactor_wake_key) batch = proactor_process((pn_proactor_t *) overlapped); else if (completion_key == recycle_accept_key) recycle_result((accept_result_t *) overlapped); } if (batch) return batch; // No event generated. Try again with next completion. } } pn_event_batch_t *pn_proactor_wait(struct pn_proactor_t* p) { return proactor_completion_loop(p, true); } pn_event_batch_t *pn_proactor_get(struct pn_proactor_t* p) { return proactor_completion_loop(p, false); } void pn_proactor_interrupt(pn_proactor_t *p) { csguard g(&p->context.cslock); if (p->context.working) p->delayed_interrupt = true; else p->need_interrupt = true; proactor_wake(p); } // runs on a threadpool thread. Must not hold timer_lock. VOID CALLBACK timeout_cb(PVOID arg, BOOLEAN /* ignored*/ ) { pn_proactor_t *p = (pn_proactor_t *) arg; csguard gtimer(&p->timer_lock); csguard g(&p->context.cslock); if (p->timeout_set) p->need_timeout = true; // else cancelled p->timeout_set = false; if (p->need_timeout) proactor_wake(p); } void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) { bool ticking = false; csguard gtimer(&p->timer_lock); { csguard g(&p->context.cslock); ticking = (p->timeout_timer != NULL); if (t == 0) { p->need_timeout = true; p->timeout_set = false; proactor_wake(p); } else p->timeout_set = true; } // Just timer_lock held if (ticking) { stop_timer(p->timer_queue, &p->timeout_timer); } if (t) { start_timer(p->timer_queue, &p->timeout_timer, timeout_cb, p, t); } } void pn_proactor_cancel_timeout(pn_proactor_t *p) { bool ticking = false; csguard gtimer(&p->timer_lock); { csguard g(&p->context.cslock); p->timeout_set = false; ticking = (p->timeout_timer != NULL); } if (ticking) { stop_timer(p->timer_queue, &p->timeout_timer); csguard g(&p->context.cslock); wake_if_inactive(p); } } // Return true if connect_step_done()will handle connection status static bool connect_step(pconnection_t *pc) { pn_proactor_t *p = pc->context.proactor; while (pc->ai) { /* Have an address */ struct addrinfo *ai = pc->ai; pc->ai = pc->ai->ai_next; /* Move to next address in case this fails */ unique_socket fd(::socket(ai->ai_family, SOCK_STREAM, ai->ai_protocol)); if (fd != INVALID_SOCKET) { // Windows ConnectEx requires loosely bound socket. sockaddr_storage sa; memset(&sa, 0, sizeof(sa)); sa.ss_family = ai->ai_family; if (!bind(fd, (SOCKADDR *) &sa, ai->ai_addrlen)) { pni_configure_sock_2(fd); pc->psocket.iocpd = pni_iocpdesc_create(p->iocp, fd); assert(pc->psocket.iocpd); pc->psocket.iocpd->write_closed = true; pc->psocket.iocpd->read_closed = true; fd.release(); iocpdesc_t *iocpd = pc->psocket.iocpd; if (CreateIoCompletionPort ((HANDLE) iocpd->socket, iocpd->iocp->completion_port, 0, 0)) { LPFN_CONNECTEX fn_connect_ex = lookup_connect_ex2(iocpd->socket); // addrinfo is owned by the pconnection so pass NULL to the connect result connect_result_t *result = connect_result(iocpd, NULL); DWORD unused; bool success = fn_connect_ex(iocpd->socket, ai->ai_addr, ai->ai_addrlen, NULL, 0, &unused, (LPOVERLAPPED) result); if (success || WSAGetLastError() == ERROR_IO_PENDING) { iocpd->ops_in_progress++; iocpd->active_completer = &pc->psocket; // getpeername unreliable for outgoing connections, but we know it at this point memcpy(&pc->remote.ss, ai->ai_addr, ai->ai_addrlen); return true; // logic resumes at connect_step_done() } pn_free(result); } } if (pc->psocket.iocpd) { pc->context.proactor->reaper->fast_reap(pc->psocket.iocpd); pc->psocket.iocpd = NULL; } } } pc->context.closing = true; return false; } static void connect_step_done(pconnection_t *pc, connect_result_t *result) { csguard g(&pc->context.cslock); DWORD saved_status = result->base.status; iocpdesc_t *iocpd = result->base.iocpd; iocpd->ops_in_progress--; assert(pc->psocket.iocpd == iocpd); complete_connect(result, result->base.status); // frees result, starts regular IO if connected if (!saved_status) { // Success pc->psocket.iocpd->write_closed = false; pc->psocket.iocpd->read_closed = false; if (pc->addrinfo) { socklen_t len = sizeof(pc->local.ss); getsockname(pc->psocket.iocpd->socket, (struct sockaddr*)&pc->local.ss, &len); freeaddrinfo(pc->addrinfo); pc->addrinfo = NULL; } pc->ai = NULL; return; } else { // Descriptor will never be used. Dispose. // Connect failed, no IO started, i.e. no pending iocpd based events pc->context.proactor->reaper->fast_reap(iocpd); pc->psocket.iocpd = NULL; memset(&pc->remote.ss, 0, sizeof(pc->remote.ss)); // Is there a next connection target in the addrinfo to try? if (pc->ai && connect_step(pc)) { // Trying the next addrinfo possibility. Will return here. return; } // Give up psocket_error(&pc->psocket, saved_status, "connect to "); pc->context.closing = true; wakeup(&pc->psocket); } } void pn_proactor_connect2(pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, const char *addr) { pconnection_t *pc = (pconnection_t*) pn_class_new(&pconnection_class, sizeof(pconnection_t)); assert(pc); // TODO: memory safety const char *err = pconnection_setup(pc, p, c, t, false, addr); if (err) { pn_logf("pn_proactor_connect failure: %s", err); return; } // TODO: check case of proactor shutting down csguard g(&pc->context.cslock); pc->connecting = true; proactor_add(&pc->context); pn_connection_open(pc->driver.connection); /* Auto-open */ if (!pgetaddrinfo(pc->psocket.host, pc->psocket.port, 0, &pc->addrinfo)) { pc->ai = pc->addrinfo; if (connect_step(pc)) { return; } } psocket_error(&pc->psocket, WSAGetLastError(), "connect to "); wakeup(&pc->psocket); if (p->reaper->add(pc->psocket.iocpd)) { pc->psocket.iocpd = NULL; } } void pn_proactor_release_connection(pn_connection_t *c) { bool notify = false; pconnection_t *pc = get_pconnection(c); if (pc) { csguard g(&pc->context.cslock); // reverse lifecycle entanglement of pc and c from new_pconnection_t() pn_incref(pc); pn_proactor_t *p = pc->context.proactor; csguard g2(&p->bind_lock); pn_record_t *r = pn_connection_attachments(pc->driver.connection); pn_record_set(r, PN_PROACTOR, NULL); pn_connection_driver_release_connection(&pc->driver); pc->bound = false; // Transport unbound g2.release(); pconnection_begin_close(pc); } } void pn_proactor_listen(pn_proactor_t *p, pn_listener_t *l, const char *addr, int backlog) { csguard g(&l->context.cslock); l->context.proactor = p;; l->backlog = backlog; proactor_add(&l->context); // l->overflow = NO_OVERFLOW; TODO, as for epoll char addr_buf[PN_MAX_ADDR]; const char *host, *port; pni_parse_addr(addr, addr_buf, PN_MAX_ADDR, &host, &port); struct addrinfo *addrinfo = NULL; int gai_err = pgetaddrinfo(host, port, AI_PASSIVE | AI_ALL, &addrinfo); int wsa_err = 0; if (!gai_err) { /* Count addresses, allocate enough space for sockets */ size_t len = 0; for (struct addrinfo *ai = addrinfo; ai; ai = ai->ai_next) { ++len; } assert(len > 0); /* guaranteed by getaddrinfo */ l->psockets = (psocket_t*)calloc(len, sizeof(psocket_t)); assert(l->psockets); /* TODO: memory safety */ l->psockets_size = 0; uint16_t dynamic_port = 0; /* Record dynamic port from first bind(0) */ /* Find working listen addresses */ for (struct addrinfo *ai = addrinfo; ai; ai = ai->ai_next) { if (dynamic_port) set_port(ai->ai_addr, dynamic_port); // Note fd destructor can clear WSAGetLastError() unique_socket fd(::socket(ai->ai_family, SOCK_STREAM, ai->ai_protocol)); if (fd != INVALID_SOCKET) { bool yes = 1; if (!::bind(fd, ai->ai_addr, ai->ai_addrlen)) if (!::listen(fd, backlog)) { iocpdesc_t *iocpd = pni_iocpdesc_create(p->iocp, fd); if (iocpd) { pn_socket_t sock = fd.release(); psocket_t *ps = &l->psockets[l->psockets_size++]; psocket_init(ps, l, false, addr); ps->iocpd = iocpd; iocpd->is_mp = true; iocpd->active_completer = ps; pni_iocpdesc_start(ps->iocpd); /* Get actual address */ socklen_t len = sizeof(ps->listen_addr.ss); (void)getsockname(sock, (struct sockaddr*)&ps->listen_addr.ss, &len); if (ps == l->psockets) { /* First socket, check for dynamic port */ dynamic_port = check_dynamic_port(ai->ai_addr, pn_netaddr_sockaddr(&ps->listen_addr)); } else { (ps-1)->listen_addr.next = &ps->listen_addr; /* Link into list */ } } } } wsa_err = WSAGetLastError(); // save it } } if (addrinfo) { freeaddrinfo(addrinfo); } if (l->psockets_size == 0) { /* All failed, create dummy socket with an error */ l->psockets = (psocket_t*)calloc(sizeof(psocket_t), 1); psocket_init(l->psockets, l, false, addr); if (gai_err) { psocket_error(l->psockets, gai_err, "listen on"); } else { psocket_error(l->psockets, wsa_err, "listen on"); } } else { pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_OPEN); } wakeup(l->psockets); } // Assumes listener lock is held static pn_event_batch_t *batch_owned(pn_listener_t *l) { if (l->close_dispatched) return NULL; if (!l->context.working) { if (listener_has_event(l)) { l->context.working = true; return &l->batch; } assert(!(l->context.closing && l->pending_events)); if (l->pending_events) { pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_ACCEPT); l->pending_events--; l->context.working = true; return &l->batch; } } return NULL; } static void listener_close_all(pn_listener_t *l) { for (size_t i = 0; i < l->psockets_size; ++i) { psocket_t *ps = &l->psockets[i]; if(ps->iocpd && !ps->iocpd->closing) if (l->context.proactor->reaper->add(ps->iocpd)) ps->iocpd = NULL; } } static bool listener_can_free(pn_listener_t *l) { if (!l->close_dispatched) return false; if (l->context.working || l->context.completion_ops) return false; for (size_t i = 0; i < l->psockets_size; ++i) { psocket_t *ps = &l->psockets[i]; if (ps->iocpd) return false; } return true; } /* Call with lock not held */ static inline void listener_final_free(pn_listener_t *l) { pcontext_finalize(&l->context); free(l->psockets); if (l->collector) pn_collector_free(l->collector); if (l->condition) pn_condition_free(l->condition); if (l->attachments) pn_free(l->attachments); free(l); } /* Call with listener lock held by lg.*/ static void internal_listener_free(pn_listener_t *l, csguard &g) { bool can_free = true; if (l->context.proactor) { can_free = proactor_remove(&l->context); } g.release(); if (can_free) listener_final_free(l); // else final free is done by proactor_disconnect() } static bool listener_maybe_free(pn_listener_t *l, csguard &g) { if (listener_can_free(l)) { internal_listener_free(l, g); return true; } return false; } static pn_event_batch_t *listener_process(pn_listener_t *l, iocp_result_t *result) { accept_result_t *accept_result = NULL; psocket_t *ps = NULL; { csguard g(&l->context.cslock); if (!result) { wake_complete(&l->context); if (listener_maybe_free(l, g)) return NULL; return batch_owned(l); } else ps = (psocket_t *) result->iocpd->active_completer; if (!l->context.closing && result->status) { psocket_error(ps, WSAGetLastError(), "listen on "); // initiates close/multi-reap } if (l->context.closing) { if (l->context.proactor->reaper->process(result)) { ps->iocpd = NULL; if (listener_maybe_free(l, g)) return NULL; } return batch_owned(l); } accept_result = (accept_result_t *) result; l->context.completion_ops++; // prevent accidental deletion while lock is temporarily removed } // No lock pn_socket_t accept_sock = accept_result->new_sock->socket; // AcceptEx special setsockopt: setsockopt(accept_sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&ps->iocpd->socket, sizeof (SOCKET)); // Connected. iocpdesc_t *conn_iocpd = accept_result->new_sock; conn_iocpd->read_closed = false; conn_iocpd->write_closed = false; pni_configure_sock_2(conn_iocpd->socket); { csguard g(&l->context.cslock); l->context.completion_ops--; accept_result->new_sock->ops_in_progress--; ps->iocpd->ops_in_progress--; // add even if closing to reuse cleanup code l->pending_accepts->push(accept_result); if (!ps->iocpd->ops_in_progress) begin_accept(ps->iocpd->acceptor, NULL); // Start another, up to IOCP_MAX_ACCEPTS l->pending_events++; if (l->context.closing) release_pending_accepts(l); if (listener_maybe_free(l, g)) return NULL; return batch_owned(l); } } pn_proactor_t *pn_connection_proactor(pn_connection_t* c) { pconnection_t *pc = get_pconnection(c); return pc ? pc->context.proactor : NULL; } void pn_connection_wake(pn_connection_t* c) { pconnection_t *pc = get_pconnection(c); csguard g(&pc->context.cslock); if (!pc->context.closing) { pc->wake_count++; wakeup(&pc->psocket); } } pn_proactor_t *pn_proactor() { HANDLE tq = NULL; bool wsa = false; iocp_t *iocp = NULL; pn_proactor_t *p = NULL; pn_collector_t *c = NULL; class reaper *r = NULL; tq = CreateTimerQueue(); if (tq) { p = (pn_proactor_t*)calloc(1, sizeof(*p)); c = pn_collector(); if (p && c) { /* Request WinSock 2.2 */ WORD wsa_ver = MAKEWORD(2, 2); WSADATA unused; if (!WSAStartup(wsa_ver, &unused)) { wsa = true; if (iocp = pni_iocp()) { InitializeCriticalSectionAndSpinCount(&p->context.cslock, 4000); InitializeCriticalSectionAndSpinCount(&p->write_lock, 4000); InitializeCriticalSectionAndSpinCount(&p->timer_lock, 4000); InitializeCriticalSectionAndSpinCount(&p->bind_lock, 4000); try { r = new reaper(p, &p->write_lock, iocp); // success p->iocp = iocp; p->reaper = r; p->batch.next_event = &proactor_batch_next; p->collector = c; p->timer_queue = tq; return p; } catch (...) {} } } } } fprintf(stderr, "%s\n", errno_str("Windows Proton proactor OS resource failure", false).c_str()); if (iocp) pn_free((void *) iocp); if (wsa) WSACleanup(); free(c); free(p); if (tq) DeleteTimerQueueEx(tq, NULL); return NULL; } void pn_proactor_free(pn_proactor_t *p) { DeleteTimerQueueEx(p->timer_queue, INVALID_HANDLE_VALUE); DeleteCriticalSection(&p->timer_lock); DeleteCriticalSection(&p->bind_lock); proactor_shutdown(p); delete p->reaper; WSACleanup(); pn_collector_free(p->collector); free(p); } static pn_event_t *listener_batch_next(pn_event_batch_t *batch) { pn_listener_t *l = batch_listener(batch); { csguard g(&l->context.cslock); if (!listener_has_event(l) && l->pending_events) { pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_ACCEPT); l->pending_events--; } pn_event_t *e = pn_collector_next(l->collector); if (e && pn_event_type(e) == PN_LISTENER_CLOSE) l->close_dispatched = true; return log_event(l, e); } } static void listener_done(pn_listener_t *l) { { csguard g(&l->context.cslock); l->context.working = false; if (l->close_dispatched) { listener_maybe_free(l, g); return; } else if (listener_has_event(l)) wakeup(l->psockets); } } pn_listener_t *pn_listener() { pn_listener_t *l = (pn_listener_t*)calloc(1, sizeof(pn_listener_t)); if (l) { l->batch.next_event = listener_batch_next; l->collector = pn_collector(); l->condition = pn_condition(); l->attachments = pn_record(); l->pending_accepts = new std::queue(); if (!l->condition || !l->collector || !l->attachments) { pn_listener_free(l); return NULL; } pn_proactor_t *unknown = NULL; // won't know until pn_proactor_listen pcontext_init(&l->context, LISTENER, unknown, l); } return l; } void pn_listener_free(pn_listener_t *l) { /* Note at this point either the listener has never been used (freed by user) or it has been closed, and all pending operations completed, i.e. listener_can_free() is true. */ if (l) { csguard g(&l->context.cslock); if (l->context.proactor) { internal_listener_free(l, g); return; } // freed by user g.release(); listener_final_free(l); } } static void listener_begin_close(pn_listener_t* l) { if (l->context.closing) return; l->context.closing = true; listener_close_all(l); release_pending_accepts(l); pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_CLOSE); } void pn_listener_close(pn_listener_t* l) { csguard g(&l->context.cslock); listener_begin_close(l); wakeup(&l->psockets[0]); } pn_proactor_t *pn_listener_proactor(pn_listener_t* l) { return l ? l->context.proactor : NULL; } pn_condition_t* pn_listener_condition(pn_listener_t* l) { return l->condition; } void *pn_listener_get_context(pn_listener_t *l) { return l->listener_context; } void pn_listener_set_context(pn_listener_t *l, void *context) { l->listener_context = context; } pn_record_t *pn_listener_attachments(pn_listener_t *l) { return l->attachments; } static void release_pending_accepts(pn_listener_t *l) { // called with lock held or at shutdown while (!l->pending_accepts->empty()) { accept_result_t *accept_result = l->pending_accepts->front(); l->pending_accepts->pop(); psocket_t *ps = (psocket_t *) accept_result->base.iocpd->active_completer; accept_result->new_sock->ops_in_progress--; ps->iocpd->ops_in_progress--; l->context.proactor->reaper->add(accept_result->new_sock); begin_accept(accept_result->base.iocpd->acceptor, accept_result); // does proper disposal when closing } l->pending_events = 0; } static void recycle_result(accept_result_t *accept_result) { psocket_t *ps = (psocket_t *) accept_result->base.iocpd->active_completer; pn_listener_t *l = ps->listener; reset_accept_result(accept_result); accept_result->new_sock = create_same_type_socket(ps->iocpd); { csguard g(&l->context.cslock); if (l->context.closing && accept_result->new_sock) { closesocket(accept_result->new_sock->socket); accept_result->new_sock->socket = INVALID_SOCKET; } begin_accept(ps->iocpd->acceptor, accept_result); // cleans up if closing l->context.completion_ops--; if (l->context.closing && listener_maybe_free(l, g)) return; } } void pn_listener_accept2(pn_listener_t *l, pn_connection_t *c, pn_transport_t *t) { accept_result_t *accept_result = NULL; DWORD err = 0; psocket_t *ps = NULL; pn_proactor_t *p = l->context.proactor; { csguard g(&l->context.cslock); pconnection_t *pc = (pconnection_t*) pn_class_new(&pconnection_class, sizeof(pconnection_t)); assert(pc); // TODO: memory safety const char *err_str = pconnection_setup(pc, p, c, t, true, ""); if (err_str) { pn_logf("pn_listener_accept failure: %s", err_str); return; } proactor_add(&pc->context); if (l->context.closing) err = WSAESHUTDOWN; else if (l->pending_accepts->empty()) err = WSAEWOULDBLOCK; else { accept_result = l->pending_accepts->front(); l->pending_accepts->pop(); ps = (psocket_t *) accept_result->base.iocpd->active_completer; l->context.completion_ops++; // for recycle_result iocpdesc_t *conn_iocpd = accept_result->new_sock; pc->psocket.iocpd = conn_iocpd; conn_iocpd->active_completer =&pc->psocket; set_sock_names(pc); pc->started = true; csguard g(&pc->context.cslock); pni_iocpdesc_start(conn_iocpd); } if (err) { psocket_error(&pc->psocket, err, "listen on"); wakeup(&pc->psocket); } } // Use another thread to prepare a replacement async accept request post_completion(p->iocp, recycle_accept_key, accept_result); } // Call with lock held. Leave unchanged if events pending. // Return true if there is an event in the collector static bool proactor_update_batch(pn_proactor_t *p) { if (proactor_has_event(p)) return true; if (p->need_timeout) { p->need_timeout = false; proactor_add_event(p, PN_PROACTOR_TIMEOUT); return true; } if (p->need_interrupt) { p->need_interrupt = false; proactor_add_event(p, PN_PROACTOR_INTERRUPT); return true; } if (p->need_inactive) { p->need_inactive = false; proactor_add_event(p, PN_PROACTOR_INACTIVE); return true; } return false; } static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) { pn_proactor_t *p = batch_proactor(batch); pn_event_t *e = pn_collector_next(p->collector); if (!e) { csguard g(&p->context.cslock); proactor_update_batch(p); e = pn_collector_next(p->collector); } if (e && pn_event_type(e) == PN_PROACTOR_TIMEOUT) p->timeout_processed = true; return log_event(p, e); } static void proactor_add(pcontext_t *ctx) { pn_proactor_t *p = ctx->proactor; csguard g(&p->context.cslock); if (p->contexts) { p->contexts->prev = ctx; ctx->next = p->contexts; } p->contexts = ctx; } // call with pcontext lock held static bool proactor_remove(pcontext_t *ctx) { pn_proactor_t *p = ctx->proactor; csguard g(&p->context.cslock); bool can_free = true; if (ctx->disconnecting) { // No longer on contexts list if (--ctx->disconnect_ops == 0) { --p->disconnects_pending; } else // proactor_disconnect() still processing can_free = false; // this psocket } else { // normal case if (ctx->prev) ctx->prev->next = ctx->next; else { p->contexts = ctx->next; ctx->next = NULL; if (p->contexts) p->contexts->prev = NULL; } if (ctx->next) { ctx->next->prev = ctx->prev; } } wake_if_inactive(p); return can_free; } static void pconnection_forced_shutdown(pconnection_t *pc) { // Called by proactor_free, no competing threads processing iocp activity. pconnection_begin_close(pc); // Timer threads may lurk. No lock held, so no deadlock risk stop_timer(pc->context.proactor->timer_queue, &pc->tick_timer); pconnection_final_free(pc); } static void listener_forced_shutdown(pn_listener_t *l) { // Called by proactor_free, no competing threads, no iocp activity. listener_close_all(l); // reaper gets all iocp descriptors to cleanup listener_final_free(l); } static void proactor_shutdown(pn_proactor_t *p) { // Called from free(), no competing threads except our own timer queue callbacks. p->shutting_down = true; while (p->contexts) { pcontext_t *ctx = p->contexts; p->contexts = ctx->next; switch (ctx->type) { case PCONNECTION: pconnection_forced_shutdown(pcontext_pconnection(ctx)); break; case LISTENER: listener_forced_shutdown(pcontext_listener(ctx)); break; default: break; } } // Graceful close of the sockets (zombies), closes completion port, free iocp related resources p->reaper->final_shutdown(); } void pn_proactor_disconnect(pn_proactor_t *p, pn_condition_t *cond) { pcontext_t *disconnecting_pcontexts = NULL; pcontext_t *ctx = NULL; { csguard g(&p->context.cslock); // Move the whole contexts list into a disconnecting state disconnecting_pcontexts = p->contexts; p->contexts = NULL; // First pass: mark each pcontext as disconnecting and update global pending count. pcontext_t *ctx = disconnecting_pcontexts; while (ctx) { ctx->disconnecting = true; ctx->disconnect_ops = 2; // Second pass below and proactor_remove(), in any order. p->disconnects_pending++; ctx = ctx->next; } } // no lock if (!disconnecting_pcontexts) { csguard p_guard(&p->context.cslock); wake_if_inactive(p); return; } // Second pass: different locking, close the pcontexts, free them if !disconnect_ops for (ctx = disconnecting_pcontexts; ctx; ctx = ctx ? ctx->next : NULL) { bool do_free = false; pconnection_t *pc = pcontext_pconnection(ctx); pn_listener_t *l = pc ? NULL : pcontext_listener(ctx); CRITICAL_SECTION *ctx_cslock = pc ? &pc->context.cslock : &l->context.cslock; csguard ctx_guard(ctx_cslock); if (pc) { pc->can_wake = false; if (!ctx->closing) { if (ctx->working) { // Must defer pc->queued_disconnect = true; if (cond) { if (!pc->disconnect_condition) pc->disconnect_condition = pn_condition(); pn_condition_copy(pc->disconnect_condition, cond); } } else { // No conflicting working context. if (cond) { pn_condition_copy(pn_transport_condition(pc->driver.transport), cond); } pn_connection_driver_close(&pc->driver); } } } else { assert(l); if (!ctx->closing) { if (cond) { pn_condition_copy(pn_listener_condition(l), cond); } listener_begin_close(l); } } csguard p_guard(&p->context.cslock); if (--ctx->disconnect_ops == 0) { do_free = true; wake_if_inactive(p); } else { // If initiating the close, wake the pcontext to do the free. wakeup(pc ? &pc->psocket : l->psockets); } p_guard.release(); ctx_guard.release(); if (do_free) { if (pc) pconnection_final_free(pc); else listener_final_free(pcontext_listener(ctx)); } } } const pn_netaddr_t *pn_transport_local_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc? &pc->local : NULL; } const pn_netaddr_t *pn_transport_remote_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc ? &pc->remote : NULL; } const pn_netaddr_t *pn_listener_addr(pn_listener_t *l) { return l->psockets ? &l->psockets[0].listen_addr : NULL; } pn_millis_t pn_proactor_now(void) { FILETIME now; GetSystemTimeAsFileTime(&now); ULARGE_INTEGER t; t.u.HighPart = now.dwHighDateTime; t.u.LowPart = now.dwLowDateTime; // Convert to milliseconds and adjust base epoch return t.QuadPart / 10000 - 11644473600000; } qpid-proton-0.22.0/proton-c/src/proactor/proactor-internal.h0000664000000000000000000000345613257152177020756 0ustar #ifndef PROACTOR_PROACTOR_INTERNAL_H #define PROACTOR_PROACTOR_INTERNAL_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include /* NOTE PNP_EXTERN is for use by proton-internal tests */ /** * Parse a pn_proactor_addr string, copy data into buf as necessary. * Set *host and *port to point to the host and port strings. * * If the port is empty, replace it with "5672", if it is "amqp" or "amqps" * replace it with the numeric port value. * * @return 0 on success, PN_OVERFLOW if buf is too small. */ PNP_EXTERN int pni_parse_addr(const char *addr, char *buf, size_t len, const char **host, const char **port); /** * Condition name for error conditions related to proton-IO. */ extern const char *PNI_IO_CONDITION; /** * Format a proactor error condition with message " (:): " */ void pni_proactor_set_cond( pn_condition_t *cond, const char *what, const char *host, const char *port, const char *msg); #endif /*!PROACTOR_PROACTOR_INTERNAL_H*/ qpid-proton-0.22.0/proton-c/src/proactor/proactor-internal.c0000664000000000000000000000633113257152177020744 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* Common platform-independent implementation for proactor libraries */ #include "proactor-internal.h" #include #include #include #include #include #include #include static const char *AMQP_PORT = "5672"; static const char *AMQP_PORT_NAME = "amqp"; static const char *AMQPS_PORT = "5671"; static const char *AMQPS_PORT_NAME = "amqps"; const char *PNI_IO_CONDITION = "proton:io"; int pn_proactor_addr(char *buf, size_t len, const char *host, const char *port) { /* Don't use snprintf, Windows is not C99 compliant and snprintf is broken. */ if (buf && len > 0) { buf[0] = '\0'; if (host) strncat(buf, host, len); strncat(buf, ":", len); if (port) strncat(buf, port, len); } return (host ? strlen(host) : 0) + (port ? strlen(port) : 0) + 1; } int pni_parse_addr(const char *addr, char *buf, size_t len, const char **host, const char **port) { size_t hplen = strlen(addr); if (hplen >= len) { return PN_OVERFLOW; } memcpy(buf, addr, hplen+1); char *p = strrchr(buf, ':'); if (p) { *port = p + 1; *p = '\0'; if (**port == '\0' || !strcmp(*port, AMQP_PORT_NAME)) { *port = AMQP_PORT; } else if (!strcmp(*port, AMQPS_PORT_NAME)) { *port = AMQPS_PORT; } } else { *port = AMQP_PORT; } if (*buf) { *host = buf; } else { *host = NULL; } return 0; } static inline const char *nonull(const char *str) { return str ? str : ""; } void pni_proactor_set_cond( pn_condition_t *cond, const char *what, const char *host, const char *port, const char *msg) { if (!pn_condition_is_set(cond)) { /* Preserve older error information */ pn_condition_format(cond, PNI_IO_CONDITION, "%s - %s %s:%s", msg, what, nonull(host), nonull(port)); } } // Backwards compatibility signatures. void pn_proactor_connect(pn_proactor_t *p, pn_connection_t *c, const char *addr) { pn_proactor_connect2(p, c, NULL, addr); } void pn_listener_accept(pn_listener_t *l, pn_connection_t *c) { pn_listener_accept2(l, c, NULL); } /* Deprecated, keep backwards compatible library symbols */ const pn_netaddr_t *pn_netaddr_local(pn_transport_t *t) { return pn_transport_local_addr(t); } const pn_netaddr_t *pn_netaddr_remote(pn_transport_t *t) { return pn_transport_remote_addr(t); } const pn_netaddr_t *pn_netaddr_listening(pn_listener_t *l) { return pn_listener_addr(l); } qpid-proton-0.22.0/proton-c/src/proactor/netaddr-internal.h0000664000000000000000000000615613257152177020546 0ustar #ifndef PROACTOR_NETADDR_INTERNAL_H #define PROACTOR_NETADDR_INTERNAL_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include /* Common code for proactors that use the POSIX/Winsock sockaddr library for socket addresses. */ struct pn_netaddr_t { struct sockaddr_storage ss; pn_netaddr_t *next; }; const struct sockaddr *pn_netaddr_sockaddr(const pn_netaddr_t *na) { return na ? (struct sockaddr*)&na->ss : NULL; } size_t pn_netaddr_socklen(const pn_netaddr_t *na) { if (!na) return 0; switch (na->ss.ss_family) { case AF_INET: return sizeof(struct sockaddr_in); case AF_INET6: return sizeof(struct sockaddr_in6); default: return sizeof(na->ss); } } const pn_netaddr_t *pn_netaddr_next(const pn_netaddr_t *na) { return na ? na->next : NULL; } #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif #ifndef NI_MAXSERV # define NI_MAXSERV 32 #endif int pn_netaddr_host_port(const pn_netaddr_t* na, char *host, size_t hlen, char *port, size_t plen) { return getnameinfo(pn_netaddr_sockaddr(na), pn_netaddr_socklen(na), host, hlen, port, plen, NI_NUMERICHOST | NI_NUMERICSERV); } int pn_netaddr_str(const pn_netaddr_t* na, char *buf, size_t len) { char host[NI_MAXHOST]; char port[NI_MAXSERV]; int err = pn_netaddr_host_port(na, host, sizeof(host), port, sizeof(port)); if (!err) { return pn_proactor_addr(buf, len, host, port); } else { if (buf) *buf = '\0'; return 0; } } /* Return port or -1 if sa is not a known address type */ static int get_port(const struct sockaddr *sa) { switch (sa->sa_family) { case AF_INET: return ((struct sockaddr_in*)sa)->sin_port; case AF_INET6: return ((struct sockaddr_in6*)sa)->sin6_port; default: return -1; } } /* Set the port in sa or do nothing if it is not a known address type */ static void set_port(struct sockaddr *sa, uint16_t port) { switch (sa->sa_family) { case AF_INET: ((struct sockaddr_in*)sa)->sin_port = port; break; case AF_INET6: ((struct sockaddr_in6*)sa)->sin6_port = port; break; default: break; } } /* If want has port=0 and got has port > 0 then return port of got, else return 0 */ static uint16_t check_dynamic_port(const struct sockaddr *want, const struct sockaddr *got) { if (get_port(want) == 0) { int port = get_port(got); if (port > 0) return (uint16_t)port; } return 0; } #endif /*!PROACTOR_NETADDR_INTERNAL_H*/ qpid-proton-0.22.0/proton-c/src/proactor/libuv.c0000664000000000000000000012510713257152177016425 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* Enable POSIX features for uv.h */ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif #include "../core/log_private.h" #include "proactor-internal.h" #include #include #include #include #include #include #include #include #include "netaddr-internal.h" /* Include after socket headers via uv.h */ /* All asserts are cheap and should remain in a release build for debuggability */ #undef NDEBUG #include #include #include #include #include /* libuv functions are thread unsafe, we use a"leader-worker-follower" model as follows: - At most one thread at a time is the "leader". The leader runs the UV loop till there are events to process and then becomes a "worker" - Concurrent "worker" threads process events for separate connections or listeners. When they run out of work they become "followers" - A "follower" is idle, waiting for work. When the leader becomes a worker, one follower takes over as the new leader. Any thread that calls pn_proactor_wait() or pn_proactor_get() can take on any of the roles as required at run-time. Monitored sockets (connections or listeners) are passed between threads on thread-safe queues. Function naming: - on_*() - libuv callbacks, called in leader thread via uv_run(). - leader_* - only called in leader thread from - *_lh - called with the relevant lock held */ const char *AMQP_PORT = "5672"; const char *AMQP_PORT_NAME = "amqp"; /* pn_proactor_t and pn_listener_t are plain C structs with normal memory management. CLASSDEF is for identification when used as a pn_event_t context. */ PN_STRUCT_CLASSDEF(pn_proactor, CID_pn_proactor) PN_STRUCT_CLASSDEF(pn_listener, CID_pn_listener) /* ================ Queues ================ */ static int unqueued; /* Provide invalid address for _unqueued pointers */ #define QUEUE_DECL(T) \ typedef struct T##_queue_t { T##_t *front, *back; } T##_queue_t; \ \ static T##_t *T##_unqueued = (T##_t*)&unqueued; \ \ static void T##_push(T##_queue_t *q, T##_t *x) { \ assert(x->next == T##_unqueued); \ x->next = NULL; \ if (!q->front) { \ q->front = q->back = x; \ } else { \ q->back->next = x; \ q->back = x; \ } \ } \ \ static T##_t* T##_pop(T##_queue_t *q) { \ T##_t *x = q->front; \ if (x) { \ q->front = x->next; \ x->next = T##_unqueued; \ } \ return x; \ } /* All work structs and UV callback data structs start with a struct_type member */ typedef enum { T_CONNECTION, T_LISTENER, T_LSOCKET } struct_type; /* A stream of serialized work for the proactor */ typedef struct work_t { /* Immutable */ struct_type type; pn_proactor_t *proactor; /* Protected by proactor.lock */ struct work_t* next; bool working; /* Owned by a worker thread */ } work_t; QUEUE_DECL(work) static void work_init(work_t* w, pn_proactor_t* p, struct_type type) { w->proactor = p; w->next = work_unqueued; w->type = type; w->working = true; } /* ================ IO ================ */ /* A resolvable address */ typedef struct addr_t { char addr_buf[PN_MAX_ADDR]; const char *host, *port; uv_getaddrinfo_t getaddrinfo; /* UV getaddrinfo request, contains list of addrinfo */ struct addrinfo* addrinfo; /* The current addrinfo being tried */ } addr_t; /* A single listening socket, a listener can have more than one */ typedef struct lsocket_t { struct_type type; /* Always T_LSOCKET */ pn_listener_t *parent; uv_tcp_t tcp; struct lsocket_t *next; } lsocket_t; PN_STRUCT_CLASSDEF(lsocket, CID_pn_listener_socket) typedef enum { W_NONE, W_PENDING, W_CLOSED } wake_state; /* An incoming or outgoing connection. */ typedef struct pconnection_t { work_t work; /* Must be first to allow casting */ struct pconnection_t *next; /* For listener list */ /* Only used by owner thread */ pn_connection_driver_t driver; /* Only used by leader */ uv_tcp_t tcp; addr_t addr; uv_connect_t connect; /* Outgoing connection only */ int connected; /* 0: not connected, <0: connecting after error, 1 = connected ok */ lsocket_t *lsocket; /* Incoming connection only */ struct pn_netaddr_t local, remote; /* Actual addresses */ uv_timer_t timer; uv_write_t write; size_t writing; /* size of pending write request, 0 if none pending */ uv_shutdown_t shutdown; /* Locked for thread-safe access */ uv_mutex_t lock; wake_state wake; } pconnection_t; QUEUE_DECL(pconnection) typedef enum { L_UNINIT, /**<< Not yet listening */ L_LISTENING, /**<< Listening */ L_CLOSE, /**<< Close requested */ L_CLOSING, /**<< Socket close initiated, wait for all to close */ L_CLOSED /**<< User saw PN_LISTENER_CLOSED, all done */ } listener_state; /* A listener */ struct pn_listener_t { work_t work; /* Must be first to allow casting */ /* Only used by owner thread */ pn_event_batch_t batch; pn_record_t *attachments; void *context; size_t backlog; /* Only used by leader */ addr_t addr; lsocket_t *lsockets; int dynamic_port; /* Record dynamic port from first bind(0) */ /* Invariant listening addresses allocated during leader_listen_lh() */ struct pn_netaddr_t *addrs; int addrs_len; /* Locked for thread-safe access. uv_listen can't be stopped or cancelled so we can't * detach a listener from the UV loop to prevent concurrent access. */ uv_mutex_t lock; pn_condition_t *condition; pn_collector_t *collector; pconnection_queue_t accept; /* pconnection_t list for accepting */ listener_state state; }; typedef enum { TM_NONE, TM_REQUEST, TM_PENDING, TM_FIRED } timeout_state_t; struct pn_proactor_t { /* Notification */ uv_async_t notify; uv_async_t interrupt; /* Leader thread */ uv_cond_t cond; uv_loop_t loop; uv_timer_t timer; /* Owner thread: proactor collector and batch can belong to leader or a worker */ pn_collector_t *collector; pn_event_batch_t batch; /* Protected by lock */ uv_mutex_t lock; work_queue_t worker_q; /* ready for work, to be returned via pn_proactor_wait() */ work_queue_t leader_q; /* waiting for attention by the leader thread */ timeout_state_t timeout_state; pn_millis_t timeout; size_t active; /* connection/listener count for INACTIVE events */ pn_condition_t *disconnect_cond; /* disconnect condition */ bool has_leader; /* A thread is working as leader */ bool disconnect; /* disconnect requested */ bool batch_working; /* batch is being processed in a worker thread */ bool need_interrupt; /* Need a PN_PROACTOR_INTERRUPT event */ bool need_inactive; /* need INACTIVE event */ }; /* Notify the leader thread that there is something to do outside of uv_run() */ static inline void notify(pn_proactor_t* p) { uv_async_send(&p->notify); } /* Set the interrupt flag in the leader thread to avoid race conditions. */ void on_interrupt(uv_async_t *async) { if (async->data) { pn_proactor_t *p = (pn_proactor_t*)async->data; p->need_interrupt = true; } } /* Notify that this work item needs attention from the leader at the next opportunity */ static void work_notify(work_t *w) { uv_mutex_lock(&w->proactor->lock); /* If the socket is in use by a worker or is already queued then leave it where it is. It will be processed in pn_proactor_done() or when the queue it is on is processed. */ if (!w->working && w->next == work_unqueued) { work_push(&w->proactor->leader_q, w); notify(w->proactor); } uv_mutex_unlock(&w->proactor->lock); } /* Notify the leader of a newly-created work item */ static void work_start(work_t *w) { uv_mutex_lock(&w->proactor->lock); if (w->next == work_unqueued) { /* No-op if already queued */ w->working = false; work_push(&w->proactor->leader_q, w); notify(w->proactor); uv_mutex_unlock(&w->proactor->lock); } } static void parse_addr(addr_t *addr, const char *str) { pni_parse_addr(str, addr->addr_buf, sizeof(addr->addr_buf), &addr->host, &addr->port); } /* Protect read/update of pn_connnection_t pointer to it's pconnection_t * * Global because pn_connection_wake()/pn_connection_proactor() navigate from * the pn_connection_t before we know the proactor or driver. Critical sections * are small: only get/set of the pn_connection_t driver pointer. * * TODO: replace mutex with atomic load/store */ static pthread_mutex_t driver_ptr_mutex; static uv_once_t global_init_once = UV_ONCE_INIT; static void global_init_fn(void) { /* Call via uv_once(&global_init_once, global_init_fn) */ uv_mutex_init(&driver_ptr_mutex); } static pconnection_t *get_pconnection(pn_connection_t* c) { if (!c) return NULL; uv_mutex_lock(&driver_ptr_mutex); pn_connection_driver_t *d = *pn_connection_driver_ptr(c); uv_mutex_unlock(&driver_ptr_mutex); if (!d) return NULL; return (pconnection_t*)((char*)d-offsetof(pconnection_t, driver)); } static void set_pconnection(pn_connection_t* c, pconnection_t *pc) { uv_mutex_lock(&driver_ptr_mutex); *pn_connection_driver_ptr(c) = pc ? &pc->driver : NULL; uv_mutex_unlock(&driver_ptr_mutex); } static pconnection_t *pconnection(pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, bool server) { pconnection_t *pc = (pconnection_t*)calloc(1, sizeof(*pc)); if (!pc || pn_connection_driver_init(&pc->driver, c, t) != 0) { return NULL; } work_init(&pc->work, p, T_CONNECTION); pc->next = pconnection_unqueued; pc->write.data = &pc->work; uv_mutex_init(&pc->lock); if (server) { pn_transport_set_server(pc->driver.transport); } set_pconnection(pc->driver.connection, pc); return pc; } static void pconnection_free(pconnection_t *pc) { pn_connection_t *c = pc->driver.connection; if (c) set_pconnection(c, NULL); pn_connection_driver_destroy(&pc->driver); if (pc->addr.getaddrinfo.addrinfo) { uv_freeaddrinfo(pc->addr.getaddrinfo.addrinfo); /* Interrupted after resolve */ } uv_mutex_destroy(&pc->lock); free(pc); } static pn_event_t *listener_batch_next(pn_event_batch_t *batch); static pn_event_t *proactor_batch_next(pn_event_batch_t *batch); static inline pn_proactor_t *batch_proactor(pn_event_batch_t *batch) { return (batch->next_event == proactor_batch_next) ? (pn_proactor_t*)((char*)batch - offsetof(pn_proactor_t, batch)) : NULL; } static inline pn_listener_t *batch_listener(pn_event_batch_t *batch) { return (batch->next_event == listener_batch_next) ? (pn_listener_t*)((char*)batch - offsetof(pn_listener_t, batch)) : NULL; } static inline pconnection_t *batch_pconnection(pn_event_batch_t *batch) { pn_connection_driver_t *d = pn_event_batch_connection_driver(batch); return d ? (pconnection_t*)((char*)d - offsetof(pconnection_t, driver)) : NULL; } static inline work_t *batch_work(pn_event_batch_t *batch) { pconnection_t *pc = batch_pconnection(batch); if (pc) return &pc->work; pn_listener_t *l = batch_listener(batch); if (l) return &l->work; return NULL; } /* Total count of listener and connections for PN_PROACTOR_INACTIVE */ static void add_active(pn_proactor_t *p) { uv_mutex_lock(&p->lock); ++p->active; uv_mutex_unlock(&p->lock); } static void remove_active_lh(pn_proactor_t *p) { assert(p->active > 0); if (--p->active == 0) { p->need_inactive = true; } } static void remove_active(pn_proactor_t *p) { uv_mutex_lock(&p->lock); remove_active_lh(p); uv_mutex_unlock(&p->lock); } /* Final close event for for a pconnection_t, disconnects from proactor */ static void on_close_pconnection_final(uv_handle_t *h) { /* Free resources associated with a pconnection_t. If the life of the pn_connection_t has been extended with reference counts we want the pconnection_t to have the same lifespan so calls to pn_connection_wake() will be valid, but no-ops. */ pconnection_t *pc = (pconnection_t*)h->data; remove_active(pc->work.proactor); pconnection_free(pc); } static void uv_safe_close(uv_handle_t *h, uv_close_cb cb) { /* Only close if h has been initialized and is not already closing */ if (h->type && !uv_is_closing(h)) { uv_close(h, cb); } } static void on_close_pconnection(uv_handle_t *h) { pconnection_t *pc = (pconnection_t*)h->data; /* Delay the free till the timer handle is also closed */ uv_timer_stop(&pc->timer); uv_safe_close((uv_handle_t*)&pc->timer, on_close_pconnection_final); } static void listener_close_lh(pn_listener_t* l) { if (l->state < L_CLOSE) { l->state = L_CLOSE; } work_notify(&l->work); } static void on_close_lsocket(uv_handle_t *h) { lsocket_t* ls = (lsocket_t*)h->data; pn_listener_t *l = ls->parent; if (l) { /* Remove from list */ lsocket_t **pp = &l->lsockets; for (; *pp != ls; pp = &(*pp)->next) ; *pp = ls->next; work_notify(&l->work); } free(ls); } /* Remember the first error code from a bad connect attempt. * This is not yet a full-blown error as we might succeed connecting * to a different address if there are several. */ static inline void pconnection_bad_connect(pconnection_t *pc, int err) { if (!pc->connected) { pc->connected = err; /* Remember first connect error in case they all fail */ } } /* Set the error condition, but don't close the driver. */ static void pconnection_set_error(pconnection_t *pc, int err, const char* what) { pn_connection_driver_t *driver = &pc->driver; pn_connection_driver_bind(driver); /* Make sure we are bound so errors will be reported */ pni_proactor_set_cond(pn_transport_condition(driver->transport), what, pc->addr.host , pc->addr.port, uv_strerror(err)); } /* Set the error condition and close the driver. */ static void pconnection_error(pconnection_t *pc, int err, const char* what) { assert(err); pconnection_bad_connect(pc, err); pconnection_set_error(pc, err, what); pn_connection_driver_close(&pc->driver); } static void listener_error_lh(pn_listener_t *l, int err, const char* what) { assert(err); if (!pn_condition_is_set(l->condition)) { pni_proactor_set_cond(l->condition, what, l->addr.host, l->addr.port, uv_strerror(err)); } listener_close_lh(l); } static void listener_error(pn_listener_t *l, int err, const char* what) { uv_mutex_lock(&l->lock); listener_error_lh(l, err, what); uv_mutex_unlock(&l->lock); } static int pconnection_init(pconnection_t *pc) { int err = 0; err = uv_tcp_init(&pc->work.proactor->loop, &pc->tcp); if (!err) { pc->tcp.data = pc; pc->connect.data = pc; err = uv_timer_init(&pc->work.proactor->loop, &pc->timer); if (!err) { pc->timer.data = pc; } else { uv_close((uv_handle_t*)&pc->tcp, NULL); } } if (!err) { add_active(pc->work.proactor); } else { pconnection_error(pc, err, "initialization"); } return err; } static void try_connect(pconnection_t *pc); static void on_connect_fail(uv_handle_t *handle) { pconnection_t *pc = (pconnection_t*)handle->data; /* Create a new TCP socket, the current one is closed */ int err = uv_tcp_init(&pc->work.proactor->loop, &pc->tcp); if (err) { pc->connected = err; pc->addr.addrinfo = NULL; /* No point in trying anymore, we can't create a socket */ } else { try_connect(pc); } } static void pconnection_addresses(pconnection_t *pc) { int len; len = sizeof(pc->local.ss); uv_tcp_getsockname(&pc->tcp, (struct sockaddr*)&pc->local.ss, &len); len = sizeof(pc->remote.ss); uv_tcp_getpeername(&pc->tcp, (struct sockaddr*)&pc->remote.ss, &len); } /* Outgoing connection */ static void on_connect(uv_connect_t *connect, int err) { pconnection_t *pc = (pconnection_t*)connect->data; if (!err) { pc->connected = 1; pconnection_addresses(pc); work_notify(&pc->work); uv_freeaddrinfo(pc->addr.getaddrinfo.addrinfo); /* Done with address info */ pc->addr.getaddrinfo.addrinfo = NULL; } else { pconnection_bad_connect(pc, err); uv_safe_close((uv_handle_t*)&pc->tcp, on_connect_fail); /* Try the next addr if there is one */ } } /* Incoming connection ready to be accepted */ static void on_connection(uv_stream_t* server, int err) { /* Unlike most on_* functions, this can be called by the leader thread when the listener * is ON_WORKER or ON_LEADER, because * * 1. There's no way to stop libuv from calling on_connection(). * 2. There can be multiple lsockets per listener. * * Update the state of the listener and queue it for leader attention. */ lsocket_t *ls = (lsocket_t*)server->data; pn_listener_t *l = ls->parent; if (err) { listener_error(l, err, "on incoming connection"); } else { uv_mutex_lock(&l->lock); pn_collector_put(l->collector, lsocket__class(), ls, PN_LISTENER_ACCEPT); uv_mutex_unlock(&l->lock); } work_notify(&l->work); } /* Common address resolution for leader_listen and leader_connect */ static int leader_resolve(pn_proactor_t *p, addr_t *addr, bool listen) { struct addrinfo hints = { 0 }; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_ADDRCONFIG; if (listen) { hints.ai_flags |= AI_PASSIVE | AI_ALL; } int err = uv_getaddrinfo(&p->loop, &addr->getaddrinfo, NULL, addr->host, addr->port, &hints); addr->addrinfo = addr->getaddrinfo.addrinfo; /* Start with the first addrinfo */ return err; } /* Try to connect to the current addrinfo. Called by leader and via callbacks for retry.*/ static void try_connect(pconnection_t *pc) { struct addrinfo *ai = pc->addr.addrinfo; if (!ai) { /* End of list, connect fails */ uv_freeaddrinfo(pc->addr.getaddrinfo.addrinfo); pc->addr.getaddrinfo.addrinfo = NULL; pconnection_bad_connect(pc, UV_EAI_NODATA); pconnection_error(pc, pc->connected, "connecting to"); work_notify(&pc->work); } else { pc->addr.addrinfo = ai->ai_next; /* Advance for next attempt */ int err = uv_tcp_connect(&pc->connect, &pc->tcp, ai->ai_addr, on_connect); if (err) { pconnection_bad_connect(pc, err); uv_close((uv_handle_t*)&pc->tcp, on_connect_fail); /* Queue up next attempt */ } } } static bool leader_connect(pconnection_t *pc) { int err = pconnection_init(pc); if (!err) err = leader_resolve(pc->work.proactor, &pc->addr, false); if (err) { pconnection_error(pc, err, "on connect resolving"); return true; } else { try_connect(pc); return false; } } static int lsocket(pn_listener_t *l, struct addrinfo *ai) { lsocket_t *ls = (lsocket_t*)calloc(1, sizeof(lsocket_t)); ls->type = T_LSOCKET; ls->tcp.data = ls; ls->parent = NULL; ls->next = NULL; int err = uv_tcp_init(&l->work.proactor->loop, &ls->tcp); if (err) { free(ls); /* Will never be closed */ } else { if (l->dynamic_port) set_port(ai->ai_addr, l->dynamic_port); int flags = (ai->ai_family == AF_INET6) ? UV_TCP_IPV6ONLY : 0; err = uv_tcp_bind(&ls->tcp, ai->ai_addr, flags); if (!err) err = uv_listen((uv_stream_t*)&ls->tcp, l->backlog, on_connection); if (!err) { /* Get actual listening address */ pn_netaddr_t *na = &l->addrs[l->addrs_len++]; int len = sizeof(na->ss); uv_tcp_getsockname(&ls->tcp, (struct sockaddr*)(&na->ss), &len); if (na == l->addrs) { /* First socket, check for dynamic port bind */ l->dynamic_port = check_dynamic_port(ai->ai_addr, pn_netaddr_sockaddr(na)); } else { (na-1)->next = na; /* Link into list */ } /* Add to l->lsockets list */ ls->parent = l; ls->next = l->lsockets; l->lsockets = ls; } else { uv_close((uv_handle_t*)&ls->tcp, on_close_lsocket); /* Freed by on_close_lsocket */ } } return err; } #define ARRAY_LEN(A) (sizeof(A)/sizeof(*(A))) /* Listen on all available addresses */ static void leader_listen_lh(pn_listener_t *l) { add_active(l->work.proactor); int err = leader_resolve(l->work.proactor, &l->addr, true); if (!err) { /* Allocate enough space for the pn_netaddr_t addresses */ size_t len = 0; for (struct addrinfo *ai = l->addr.getaddrinfo.addrinfo; ai; ai = ai->ai_next) { ++len; } l->addrs = (pn_netaddr_t*)calloc(len, sizeof(lsocket_t)); /* Find the working addresses */ for (struct addrinfo *ai = l->addr.getaddrinfo.addrinfo; ai; ai = ai->ai_next) { int err2 = lsocket(l, ai); if (err2) { err = err2; } } uv_freeaddrinfo(l->addr.getaddrinfo.addrinfo); l->addr.getaddrinfo.addrinfo = NULL; if (l->lsockets) { /* Ignore errors if we got at least one good listening socket */ err = 0; } } if (err) { listener_error_lh(l, err, "listening on"); } else { pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_OPEN); } } void pn_listener_free(pn_listener_t *l) { if (l) { if (l->addrs) free(l->addrs); if (l->addr.getaddrinfo.addrinfo) { /* Interrupted after resolve */ uv_freeaddrinfo(l->addr.getaddrinfo.addrinfo); } if (l->collector) pn_collector_free(l->collector); if (l->condition) pn_condition_free(l->condition); if (l->attachments) pn_free(l->attachments); while (l->lsockets) { lsocket_t *ls = l->lsockets; l->lsockets = ls->next; free(ls); } assert(!l->accept.front); uv_mutex_destroy(&l->lock); free(l); } } /* Process a listener, return true if it has events for a worker thread */ static bool leader_process_listener(pn_listener_t *l) { /* NOTE: l may be concurrently accessed by on_connection() */ bool closed = false; uv_mutex_lock(&l->lock); /* Process accepted connections */ for (pconnection_t *pc = pconnection_pop(&l->accept); pc; pc = pconnection_pop(&l->accept)) { int err = pconnection_init(pc); if (!err) err = uv_accept((uv_stream_t*)&pc->lsocket->tcp, (uv_stream_t*)&pc->tcp); if (!err) { pconnection_addresses(pc); } else { listener_error(l, err, "accepting from"); pconnection_error(pc, err, "accepting from"); } work_start(&pc->work); /* Process events for the accepted/failed connection */ } switch (l->state) { case L_UNINIT: l->state = L_LISTENING; leader_listen_lh(l); break; case L_LISTENING: break; case L_CLOSE: /* Close requested, start closing lsockets */ l->state = L_CLOSING; for (lsocket_t *ls = l->lsockets; ls; ls = ls->next) { uv_safe_close((uv_handle_t*)&ls->tcp, on_close_lsocket); } /* NOTE: Fall through in case we have 0 sockets - e.g. resolver error */ case L_CLOSING: /* Closing - can we send PN_LISTENER_CLOSE? */ if (!l->lsockets) { l->state = L_CLOSED; pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_CLOSE); } break; case L_CLOSED: /* Closed, has LISTENER_CLOSE has been processed? */ if (!pn_collector_peek(l->collector)) { remove_active(l->work.proactor); closed = true; } } bool has_work = !closed && pn_collector_peek(l->collector); uv_mutex_unlock(&l->lock); if (closed) { pn_listener_free(l); } return has_work; } /* Generate tick events and return millis till next tick or 0 if no tick is required */ static pn_millis_t leader_tick(pconnection_t *pc) { uint64_t now = uv_now(pc->timer.loop); uint64_t next = pn_transport_tick(pc->driver.transport, now); return next ? next - now : 0; } static void on_tick(uv_timer_t *timer) { pconnection_t *pc = (pconnection_t*)timer->data; leader_tick(pc); work_notify(&pc->work); } static void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { pconnection_t *pc = (pconnection_t*)stream->data; if (nread > 0) { pn_connection_driver_read_done(&pc->driver, nread); } else if (nread < 0) { if (nread != UV_EOF) { /* hangup */ pconnection_set_error(pc, nread, "on read from"); } pn_connection_driver_close(&pc->driver); } work_notify(&pc->work); } static void on_write(uv_write_t* write, int err) { pconnection_t *pc = (pconnection_t*)write->data; size_t size = pc->writing; pc->writing = 0; if (err) { pconnection_set_error(pc, err, "on write to"); pn_connection_driver_write_close(&pc->driver); } else if (!pn_connection_driver_write_closed(&pc->driver)) { pn_connection_driver_write_done(&pc->driver, size); } work_notify(&pc->work); } static void on_timeout(uv_timer_t *timer) { pn_proactor_t *p = (pn_proactor_t*)timer->data; uv_mutex_lock(&p->lock); if (p->timeout_state == TM_PENDING) { /* Only fire if still pending */ p->timeout_state = TM_FIRED; } uv_stop(&p->loop); /* UV does not always stop after on_timeout without this */ uv_mutex_unlock(&p->lock); } /* Read buffer allocation function for uv, just returns the transports read buffer. */ static void alloc_read_buffer(uv_handle_t* stream, size_t size, uv_buf_t* buf) { pconnection_t *pc = (pconnection_t*)stream->data; pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver); *buf = uv_buf_init(rbuf.start, rbuf.size); } /* Set the event in the proactor's batch */ static pn_event_batch_t *proactor_batch_lh(pn_proactor_t *p, pn_event_type_t t) { pn_collector_put(p->collector, pn_proactor__class(), p, t); p->batch_working = true; return &p->batch; } static pn_event_t *log_event(void* p, pn_event_t *e) { if (e) { pn_logf("[%p]:(%s)", (void*)p, pn_event_type_name(pn_event_type(e))); } return e; } static pn_event_t *listener_batch_next(pn_event_batch_t *batch) { pn_listener_t *l = batch_listener(batch); uv_mutex_lock(&l->lock); pn_event_t *e = pn_collector_next(l->collector); uv_mutex_unlock(&l->lock); return log_event(l, e); } static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) { pn_proactor_t *p = batch_proactor(batch); assert(p->batch_working); return log_event(p, pn_collector_next(p->collector)); } /* Return the next event batch or NULL if no events are available */ static pn_event_batch_t *get_batch_lh(pn_proactor_t *p) { if (!p->batch_working) { /* Can generate proactor events */ if (p->need_inactive) { p->need_inactive = false; return proactor_batch_lh(p, PN_PROACTOR_INACTIVE); } if (p->need_interrupt) { p->need_interrupt = false; return proactor_batch_lh(p, PN_PROACTOR_INTERRUPT); } if (p->timeout_state == TM_FIRED) { p->timeout_state = TM_NONE; remove_active_lh(p); return proactor_batch_lh(p, PN_PROACTOR_TIMEOUT); } } for (work_t *w = work_pop(&p->worker_q); w; w = work_pop(&p->worker_q)) { assert(w->working); switch (w->type) { case T_CONNECTION: return &((pconnection_t*)w)->driver.batch; case T_LISTENER: return &((pn_listener_t*)w)->batch; default: break; } } return NULL; } /* Check wake state and generate WAKE event if needed */ static void check_wake(pconnection_t *pc) { uv_mutex_lock(&pc->lock); if (pc->wake == W_PENDING) { pn_connection_t *c = pc->driver.connection; pn_collector_put(pn_connection_collector(c), PN_OBJECT, c, PN_CONNECTION_WAKE); pc->wake = W_NONE; } uv_mutex_unlock(&pc->lock); } /* Process a pconnection, return true if it has events for a worker thread */ static bool leader_process_pconnection(pconnection_t *pc) { /* Important to do the following steps in order */ if (!pc->connected) { return leader_connect(pc); } if (pc->writing) { /* We can't do anything while a write request is pending */ return false; } /* Must process INIT and BOUND events before we do any IO-related stuff */ if (pn_connection_driver_has_event(&pc->driver)) { return true; } if (pn_connection_driver_finished(&pc->driver)) { uv_mutex_lock(&pc->lock); pc->wake = W_CLOSED; /* wake() is a no-op from now on */ uv_mutex_unlock(&pc->lock); uv_safe_close((uv_handle_t*)&pc->tcp, on_close_pconnection); } else { /* Check for events that can be generated without blocking for IO */ check_wake(pc); pn_millis_t next_tick = leader_tick(pc); pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver); pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); /* If we still have no events, make async UV requests */ if (!pn_connection_driver_has_event(&pc->driver)) { int err = 0; const char *what = NULL; if (!err && next_tick) { what = "connection timer start"; err = uv_timer_start(&pc->timer, on_tick, next_tick, 0); } if (!err) { what = "write"; if (wbuf.size > 0) { uv_buf_t buf = uv_buf_init((char*)wbuf.start, wbuf.size); err = uv_write(&pc->write, (uv_stream_t*)&pc->tcp, &buf, 1, on_write); if (!err) { pc->writing = wbuf.size; } } else if (pn_connection_driver_write_closed(&pc->driver)) { uv_shutdown(&pc->shutdown, (uv_stream_t*)&pc->tcp, NULL); } } if (!err && rbuf.size > 0) { what = "read"; err = uv_read_start((uv_stream_t*)&pc->tcp, alloc_read_buffer, on_read); } if (err) { /* Some IO requests failed, generate the error events */ pconnection_error(pc, err, what); } } } return pn_connection_driver_has_event(&pc->driver); } /* Detach a connection from the UV loop so it can be used safely by a worker */ void pconnection_detach(pconnection_t *pc) { if (pc->connected && !pc->writing) { /* Can't detach while a write is pending */ uv_read_stop((uv_stream_t*)&pc->tcp); uv_timer_stop(&pc->timer); } } static void on_proactor_disconnect(uv_handle_t* h, void* v) { if (h->type == UV_TCP) { switch (*(struct_type*)h->data) { case T_CONNECTION: { pconnection_t *pc = (pconnection_t*)h->data; pn_condition_t *cond = pc->work.proactor->disconnect_cond; if (cond) { pn_condition_copy(pn_transport_condition(pc->driver.transport), cond); } pn_connection_driver_close(&pc->driver); work_notify(&pc->work); break; } case T_LSOCKET: { pn_listener_t *l = ((lsocket_t*)h->data)->parent; if (l) { pn_condition_t *cond = l->work.proactor->disconnect_cond; if (cond) { pn_condition_copy(pn_listener_condition(l), cond); } } pn_listener_close(l); break; } default: break; } } } /* Process the leader_q and the UV loop, in the leader thread */ static pn_event_batch_t *leader_lead_lh(pn_proactor_t *p, uv_run_mode mode) { /* Set timeout timer if there was a request, let it count down while we process work */ if (p->timeout_state == TM_REQUEST) { p->timeout_state = TM_PENDING; uv_timer_stop(&p->timer); uv_timer_start(&p->timer, on_timeout, p->timeout, 0); } /* If disconnect was requested, walk the socket list */ if (p->disconnect) { p->disconnect = false; if (p->active) { uv_mutex_unlock(&p->lock); uv_walk(&p->loop, on_proactor_disconnect, NULL); uv_mutex_lock(&p->lock); } else { p->need_inactive = true; /* Send INACTIVE right away, nothing to do. */ } } pn_event_batch_t *batch = NULL; for (work_t *w = work_pop(&p->leader_q); w; w = work_pop(&p->leader_q)) { assert(!w->working); uv_mutex_unlock(&p->lock); /* Unlock to process each item, may add more items to leader_q */ bool has_work = false; switch (w->type) { case T_CONNECTION: has_work = leader_process_pconnection((pconnection_t*)w); break; case T_LISTENER: has_work = leader_process_listener((pn_listener_t*)w); break; default: break; } uv_mutex_lock(&p->lock); if (has_work && !w->working && w->next == work_unqueued) { if (w->type == T_CONNECTION) { pconnection_detach((pconnection_t*)w); } w->working = true; work_push(&p->worker_q, w); } } batch = get_batch_lh(p); /* Check for work */ if (!batch) { /* No work, run the UV loop */ uv_mutex_unlock(&p->lock); /* Unlock to run UV loop */ uv_run(&p->loop, mode); uv_mutex_lock(&p->lock); batch = get_batch_lh(p); } return batch; } /**** public API ****/ pn_event_batch_t *pn_proactor_get(struct pn_proactor_t* p) { uv_mutex_lock(&p->lock); pn_event_batch_t *batch = get_batch_lh(p); if (batch == NULL && !p->has_leader) { /* Try a non-blocking lead to generate some work */ p->has_leader = true; batch = leader_lead_lh(p, UV_RUN_NOWAIT); p->has_leader = false; uv_cond_broadcast(&p->cond); /* Signal followers for possible work */ } uv_mutex_unlock(&p->lock); return batch; } pn_event_batch_t *pn_proactor_wait(struct pn_proactor_t* p) { uv_mutex_lock(&p->lock); pn_event_batch_t *batch = get_batch_lh(p); while (!batch && p->has_leader) { uv_cond_wait(&p->cond, &p->lock); /* Follow the leader */ batch = get_batch_lh(p); } if (!batch) { /* Become leader */ p->has_leader = true; do { batch = leader_lead_lh(p, UV_RUN_ONCE); } while (!batch); p->has_leader = false; uv_cond_broadcast(&p->cond); /* Signal a followers. One takes over, many can work. */ } uv_mutex_unlock(&p->lock); return batch; } void pn_proactor_done(pn_proactor_t *p, pn_event_batch_t *batch) { if (!batch) return; uv_mutex_lock(&p->lock); work_t *w = batch_work(batch); if (w) { assert(w->working); assert(w->next == work_unqueued); w->working = false; work_push(&p->leader_q, w); } pn_proactor_t *bp = batch_proactor(batch); /* Proactor events */ if (bp == p) { p->batch_working = false; } uv_mutex_unlock(&p->lock); notify(p); } pn_listener_t *pn_event_listener(pn_event_t *e) { if (pn_event_class(e) == pn_listener__class()) { return (pn_listener_t*)pn_event_context(e); } else if (pn_event_class(e) == lsocket__class()) { return ((lsocket_t*)pn_event_context(e))->parent; } else { return NULL; } } pn_proactor_t *pn_event_proactor(pn_event_t *e) { if (pn_event_class(e) == pn_proactor__class()) { return (pn_proactor_t*)pn_event_context(e); } pn_listener_t *l = pn_event_listener(e); if (l) { return l->work.proactor; } pn_connection_t *c = pn_event_connection(e); if (c) { return pn_connection_proactor(pn_event_connection(e)); } return NULL; } void pn_proactor_interrupt(pn_proactor_t *p) { /* NOTE: pn_proactor_interrupt must be async-signal-safe so we cannot use locks to update shared proactor state here. Instead we use a dedicated uv_async, the on_interrupt() callback will set the interrupt flag in the safety of the leader thread. */ uv_async_send(&p->interrupt); } void pn_proactor_disconnect(pn_proactor_t *p, pn_condition_t *cond) { uv_mutex_lock(&p->lock); if (!p->disconnect) { p->disconnect = true; if (cond) { pn_condition_copy(p->disconnect_cond, cond); } else { pn_condition_clear(p->disconnect_cond); } notify(p); } uv_mutex_unlock(&p->lock); } void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) { uv_mutex_lock(&p->lock); p->timeout = t; // This timeout *replaces* any existing timeout if (p->timeout_state == TM_NONE) ++p->active; p->timeout_state = TM_REQUEST; uv_mutex_unlock(&p->lock); notify(p); } void pn_proactor_cancel_timeout(pn_proactor_t *p) { uv_mutex_lock(&p->lock); if (p->timeout_state != TM_NONE) { p->timeout_state = TM_NONE; remove_active_lh(p); notify(p); } uv_mutex_unlock(&p->lock); } void pn_proactor_connect2(pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, const char *addr) { pconnection_t *pc = pconnection(p, c, t, false); assert(pc); /* TODO aconway 2017-03-31: memory safety */ pn_connection_open(pc->driver.connection); /* Auto-open */ parse_addr(&pc->addr, addr); work_start(&pc->work); } void pn_proactor_listen(pn_proactor_t *p, pn_listener_t *l, const char *addr, int backlog) { work_init(&l->work, p, T_LISTENER); parse_addr(&l->addr, addr); l->backlog = backlog; work_start(&l->work); } static void on_proactor_free(uv_handle_t* h, void* v) { uv_safe_close(h, NULL); /* Close the handle */ if (h->type == UV_TCP) { /* Put the corresponding work item on the leader_q for cleanup */ work_t *w = NULL; switch (*(struct_type*)h->data) { case T_CONNECTION: w = (work_t*)h->data; break; case T_LSOCKET: w = &((lsocket_t*)h->data)->parent->work; break; default: break; } if (w && w->next == work_unqueued) { work_push(&w->proactor->leader_q, w); /* Save to be freed after all closed */ } } } static void work_free(work_t *w) { switch (w->type) { case T_CONNECTION: pconnection_free((pconnection_t*)w); break; case T_LISTENER: pn_listener_free((pn_listener_t*)w); break; default: break; } } pn_proactor_t *pn_proactor() { uv_once(&global_init_once, global_init_fn); pn_proactor_t *p = (pn_proactor_t*)calloc(1, sizeof(pn_proactor_t)); p->collector = pn_collector(); if (!p->collector) { free(p); return NULL; } p->batch.next_event = &proactor_batch_next; uv_loop_init(&p->loop); uv_mutex_init(&p->lock); uv_cond_init(&p->cond); uv_async_init(&p->loop, &p->notify, NULL); uv_async_init(&p->loop, &p->interrupt, on_interrupt); p->interrupt.data = p; uv_timer_init(&p->loop, &p->timer); p->timer.data = p; p->disconnect_cond = pn_condition(); return p; } void pn_proactor_free(pn_proactor_t *p) { /* Close all open handles */ uv_walk(&p->loop, on_proactor_free, NULL); while (uv_loop_alive(&p->loop)) { uv_run(&p->loop, UV_RUN_DEFAULT); /* Finish closing the proactor handles */ } /* Free all work items */ for (work_t *w = work_pop(&p->leader_q); w; w = work_pop(&p->leader_q)) { work_free(w); } for (work_t *w = work_pop(&p->worker_q); w; w = work_pop(&p->worker_q)) { work_free(w); } uv_loop_close(&p->loop); uv_mutex_destroy(&p->lock); uv_cond_destroy(&p->cond); pn_collector_free(p->collector); pn_condition_free(p->disconnect_cond); free(p); } pn_proactor_t *pn_connection_proactor(pn_connection_t* c) { pconnection_t *pc = get_pconnection(c); return pc ? pc->work.proactor : NULL; } void pn_connection_wake(pn_connection_t* c) { /* May be called from any thread */ pconnection_t *pc = get_pconnection(c); if (pc) { bool notify = false; uv_mutex_lock(&pc->lock); if (pc->wake == W_NONE) { pc->wake = W_PENDING; notify = true; } uv_mutex_unlock(&pc->lock); if (notify) { work_notify(&pc->work); } } } void pn_proactor_release_connection(pn_connection_t *c) { pconnection_t *pc = get_pconnection(c); if (pc) { set_pconnection(c, NULL); pn_connection_driver_release_connection(&pc->driver); } } pn_listener_t *pn_listener(void) { pn_listener_t *l = (pn_listener_t*)calloc(1, sizeof(pn_listener_t)); if (l) { l->batch.next_event = listener_batch_next; l->collector = pn_collector(); l->condition = pn_condition(); l->attachments = pn_record(); if (!l->condition || !l->collector || !l->attachments) { pn_listener_free(l); return NULL; } uv_mutex_init(&l->lock); } return l; } void pn_listener_close(pn_listener_t* l) { /* May be called from any thread */ uv_mutex_lock(&l->lock); listener_close_lh(l); uv_mutex_unlock(&l->lock); } pn_proactor_t *pn_listener_proactor(pn_listener_t* l) { return l ? l->work.proactor : NULL; } pn_condition_t* pn_listener_condition(pn_listener_t* l) { return l->condition; } void *pn_listener_get_context(pn_listener_t *l) { return l->context; } void pn_listener_set_context(pn_listener_t *l, void *context) { l->context = context; } pn_record_t *pn_listener_attachments(pn_listener_t *l) { return l->attachments; } void pn_listener_accept2(pn_listener_t *l, pn_connection_t *c, pn_transport_t *t) { uv_mutex_lock(&l->lock); pconnection_t *pc = pconnection(l->work.proactor, c, t, true); assert(pc); /* Get the socket from the accept event that we are processing */ pn_event_t *e = pn_collector_prev(l->collector); assert(pn_event_type(e) == PN_LISTENER_ACCEPT); assert(pn_event_listener(e) == l); pc->lsocket = (lsocket_t*)pn_event_context(e); pc->connected = 1; /* Don't need to connect() */ pconnection_push(&l->accept, pc); uv_mutex_unlock(&l->lock); work_notify(&l->work); } const pn_netaddr_t *pn_transport_local_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc? &pc->local : NULL; } const pn_netaddr_t *pn_transport_remote_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc ? &pc->remote : NULL; } const pn_netaddr_t *pn_listener_addr(pn_listener_t *l) { return l->addrs ? &l->addrs[0] : NULL; } pn_millis_t pn_proactor_now(void) { return uv_hrtime() / 1000000; // uv_hrtime returns time in nanoseconds } qpid-proton-0.22.0/proton-c/src/proactor/epoll.c0000664000000000000000000021335613257152177016423 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* Enable POSIX features beyond c99 for modern pthread and standard strerror_r() */ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif /* Avoid GNU extensions, in particular the incompatible alternative strerror_r() */ #undef _GNU_SOURCE #include "../core/log_private.h" #include "./proactor-internal.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "./netaddr-internal.h" /* Include after socket/inet headers */ // TODO: replace timerfd per connection with global lightweight timer mechanism. // logging in general // SIGPIPE? // Can some of the mutexes be spinlocks (any benefit over adaptive pthread mutex)? // Maybe futex is even better? // See other "TODO" in code. // // Consider case of large number of wakes: proactor_do_epoll() could start by // looking for pending wakes before a kernel call to epoll_wait(), or there // could be several eventfds with random assignment of wakeables. typedef char strerrorbuf[1024]; /* used for pstrerror message buffer */ /* Like strerror_r but provide a default message if strerror_r fails */ static void pstrerror(int err, strerrorbuf msg) { int e = strerror_r(err, msg, sizeof(strerrorbuf)); if (e) snprintf(msg, sizeof(strerrorbuf), "unknown error %d", err); } /* Internal error, no recovery */ #define EPOLL_FATAL(EXPR, SYSERRNO) \ do { \ strerrorbuf msg; \ pstrerror((SYSERRNO), msg); \ fprintf(stderr, "epoll proactor failure in %s:%d: %s: %s\n", \ __FILE__, __LINE__ , #EXPR, msg); \ abort(); \ } while (0) // ======================================================================== // First define a proactor mutex (pmutex) and timer mechanism (ptimer) to taste. // ======================================================================== // In general all locks to be held singly and shortly (possibly as spin locks). // Exception: psockets+proactor for pn_proactor_disconnect (convention: acquire // psocket first to avoid deadlock). TODO: revisit the exception and its // awkwardness in the code (additional mutex? different type?). typedef pthread_mutex_t pmutex; static void pmutex_init(pthread_mutex_t *pm){ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); if (pthread_mutex_init(pm, &attr)) { perror("pthread failure"); abort(); } } static void pmutex_finalize(pthread_mutex_t *m) { pthread_mutex_destroy(m); } static inline void lock(pmutex *m) { pthread_mutex_lock(m); } static inline void unlock(pmutex *m) { pthread_mutex_unlock(m); } typedef struct acceptor_t acceptor_t; typedef enum { WAKE, /* see if any work to do in proactor/psocket context */ PCONNECTION_IO, PCONNECTION_TIMER, LISTENER_IO, PROACTOR_TIMER } epoll_type_t; // Data to use with epoll. typedef struct epoll_extended_t { struct psocket_t *psocket; // pconnection, listener, or NULL -> proactor int fd; epoll_type_t type; // io/timer/wakeup uint32_t wanted; // events to poll for bool polling; pmutex barrier_mutex; } epoll_extended_t; /* epoll_ctl()/epoll_wait() do not form a memory barrier, so cached memory writes to struct epoll_extended_t in the EPOLL_ADD thread might not be visible to epoll_wait() thread. This function creates a memory barrier, called before epoll_ctl() and after epoll_wait() */ static void memory_barrier(epoll_extended_t *ee) { // Mutex lock/unlock has the side-effect of being a memory barrier. lock(&ee->barrier_mutex); unlock(&ee->barrier_mutex); } /* * This timerfd logic assumes EPOLLONESHOT and there never being two * active timeout callbacks. There can be multiple (or zero) * unclaimed expiries processed in a single callback. * * timerfd_set() documentation implies a crisp relationship between * timer expiry count and oldt's return value, but a return value of * zero is ambiguous. It can lead to no EPOLLIN, EPOLLIN + expected * read, or * * event expiry (in kernel) -> EPOLLIN * cancel/settime(0) (thread A) (number of expiries resets to zero) * read(timerfd) -> -1, EAGAIN (thread B servicing epoll event) * * The original implementation with counters to track expiry counts * was abandoned in favor of "in doubt" transitions and resolution * at shutdown. */ typedef struct ptimer_t { pmutex mutex; int timerfd; epoll_extended_t epoll_io; bool timer_active; bool in_doubt; // 0 or 1 callbacks are possible bool shutting_down; } ptimer_t; static bool ptimer_init(ptimer_t *pt, struct psocket_t *ps) { pt->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); pmutex_init(&pt->mutex); pt->timer_active = false; pt->in_doubt = false; pt->shutting_down = false; epoll_type_t type = ps ? PCONNECTION_TIMER : PROACTOR_TIMER; pt->epoll_io.psocket = ps; pt->epoll_io.fd = pt->timerfd; pt->epoll_io.type = type; pt->epoll_io.wanted = EPOLLIN; pt->epoll_io.polling = false; return (pt->timerfd >= 0); } // Call with ptimer lock held static void ptimer_set_lh(ptimer_t *pt, uint64_t t_millis) { struct itimerspec newt, oldt; memset(&newt, 0, sizeof(newt)); newt.it_value.tv_sec = t_millis / 1000; newt.it_value.tv_nsec = (t_millis % 1000) * 1000000; timerfd_settime(pt->timerfd, 0, &newt, &oldt); if (pt->timer_active && oldt.it_value.tv_nsec == 0 && oldt.it_value.tv_sec == 0) { // EPOLLIN is possible but not assured pt->in_doubt = true; } pt->timer_active = t_millis; } static void ptimer_set(ptimer_t *pt, uint64_t t_millis) { // t_millis == 0 -> cancel lock(&pt->mutex); if ((t_millis == 0 && !pt->timer_active) || pt->shutting_down) { unlock(&pt->mutex); return; // nothing to do } ptimer_set_lh(pt, t_millis); unlock(&pt->mutex); } /* Read from a timer or event FD */ static uint64_t read_uint64(int fd) { uint64_t result = 0; ssize_t n = read(fd, &result, sizeof(result)); if (n != sizeof(result) && !(n < 0 && errno == EAGAIN)) { EPOLL_FATAL("timerfd or eventfd read error", errno); } return result; } // Callback bookkeeping. Return true if there is an expired timer. static bool ptimer_callback(ptimer_t *pt) { lock(&pt->mutex); struct itimerspec current; if (timerfd_gettime(pt->timerfd, ¤t) == 0) { if (current.it_value.tv_nsec == 0 && current.it_value.tv_sec == 0) pt->timer_active = false; } uint64_t u_exp_count = read_uint64(pt->timerfd); if (!pt->timer_active) { // Expiry counter just cleared, timer not set, timerfd not armed pt->in_doubt = false; } unlock(&pt->mutex); return u_exp_count > 0; } // Return true if timerfd has and will have no pollable expiries in the current armed state static bool ptimer_shutdown(ptimer_t *pt, bool currently_armed) { lock(&pt->mutex); if (currently_armed) { ptimer_set_lh(pt, 0); pt->shutting_down = true; if (pt->in_doubt) // Force at least one callback. If two, second cannot proceed with unarmed timerfd. ptimer_set_lh(pt, 1); } else pt->shutting_down = true; bool rv = !pt->in_doubt; unlock(&pt->mutex); return rv; } static void ptimer_finalize(ptimer_t *pt) { if (pt->timerfd >= 0) close(pt->timerfd); pmutex_finalize(&pt->mutex); } pn_timestamp_t pn_i_now2(void) { struct timespec now; clock_gettime(CLOCK_REALTIME, &now); return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_nsec / 1000000); } // ======================================================================== // Proactor common code // ======================================================================== const char *AMQP_PORT = "5672"; const char *AMQP_PORT_NAME = "amqp"; // The number of times a connection event batch may be replenished for // a thread between calls to wait(). Some testing shows that // increasing this value above 1 actually slows performance slightly // and increases latency. #define HOG_MAX 1 /* pn_proactor_t and pn_listener_t are plain C structs with normal memory management. Class definitions are for identification as pn_event_t context only. */ PN_STRUCT_CLASSDEF(pn_proactor, CID_pn_proactor) PN_STRUCT_CLASSDEF(pn_listener, CID_pn_listener) static bool start_polling(epoll_extended_t *ee, int epollfd) { if (ee->polling) return false; ee->polling = true; struct epoll_event ev; ev.data.ptr = ee; ev.events = ee->wanted | EPOLLONESHOT; memory_barrier(ee); return (epoll_ctl(epollfd, EPOLL_CTL_ADD, ee->fd, &ev) == 0); } static void stop_polling(epoll_extended_t *ee, int epollfd) { // TODO: check for error, return bool or just log? if (ee->fd == -1 || !ee->polling || epollfd == -1) return; struct epoll_event ev; ev.data.ptr = ee; ev.events = 0; memory_barrier(ee); if (epoll_ctl(epollfd, EPOLL_CTL_DEL, ee->fd, &ev) == -1) EPOLL_FATAL("EPOLL_CTL_DEL", errno); ee->fd = -1; ee->polling = false; } /* * The proactor maintains a number of serialization contexts: each * connection, each listener, the proactor itself. The serialization * is presented to the application via each associated event batch. * * Multiple threads can be trying to do work on a single context * (i.e. socket IO is ready and wakeup at same time). Mutexes are used * to manage contention. Some vars are only ever touched by one * "working" thread and are accessed without holding the mutex. * * Currently internal wakeups (via wake()/wake_notify()) are used to * force a context to check if it has work to do. To minimize trips * through the kernel, wake() is a no-op if the context has a working * thread. Conversely, a thread must never stop working without * checking if it has newly arrived work. * * External wake operations, like pn_connection_wake() and are built on top of * the internal wake mechanism. The former coalesces multiple wakes until event * delivery, the latter does not. The WAKEABLE implementation can be modeled on * whichever is more suited. * * pn_proactor_interrupt() must be async-signal-safe so it has a dedicated * eventfd to allow a lock-free pn_proactor_interrupt() implementation. */ typedef enum { PROACTOR, PCONNECTION, LISTENER, WAKEABLE } pcontext_type_t; typedef struct pcontext_t { pmutex mutex; pn_proactor_t *proactor; /* Immutable */ void *owner; /* Instance governed by the context */ pcontext_type_t type; bool working; int wake_ops; // unprocessed eventfd wake callback (convert to bool?) struct pcontext_t *wake_next; // wake list, guarded by proactor eventfd_mutex bool closing; // Next 4 are protected by the proactor mutex struct pcontext_t* next; /* Protected by proactor.mutex */ struct pcontext_t* prev; /* Protected by proactor.mutex */ int disconnect_ops; /* ops remaining before disconnect complete */ bool disconnecting; /* pn_proactor_disconnect */ } pcontext_t; static void pcontext_init(pcontext_t *ctx, pcontext_type_t t, pn_proactor_t *p, void *o) { memset(ctx, 0, sizeof(*ctx)); pmutex_init(&ctx->mutex); ctx->proactor = p; ctx->owner = o; ctx->type = t; } static void pcontext_finalize(pcontext_t* ctx) { pmutex_finalize(&ctx->mutex); } /* common to connection and listener */ typedef struct psocket_t { pn_proactor_t *proactor; // Remaining protected by the pconnection/listener mutex int sockfd; epoll_extended_t epoll_io; pn_listener_t *listener; /* NULL for a connection socket */ char addr_buf[PN_MAX_ADDR]; const char *host, *port; } psocket_t; struct pn_proactor_t { pcontext_t context; int epollfd; ptimer_t timer; pn_collector_t *collector; pcontext_t *contexts; /* in-use contexts for PN_PROACTOR_INACTIVE and cleanup */ epoll_extended_t epoll_wake; epoll_extended_t epoll_interrupt; pn_event_batch_t batch; size_t disconnects_pending; /* unfinished proactor disconnects*/ // need_xxx flags indicate we should generate PN_PROACTOR_XXX on the next update_batch() bool need_interrupt; bool need_inactive; bool need_timeout; bool timeout_set; /* timeout has been set by user and not yet cancelled or generated event */ bool timeout_processed; /* timeout event dispatched in the most recent event batch */ bool timer_armed; /* timer is armed in epoll */ bool shutting_down; // wake subsystem int eventfd; pmutex eventfd_mutex; bool wakes_in_progress; pcontext_t *wake_list_first; pcontext_t *wake_list_last; // Interrupts have a dedicated eventfd because they must be async-signal safe. int interruptfd; // If the process runs out of file descriptors, disarm listening sockets temporarily and save them here. acceptor_t *overflow; pmutex overflow_mutex; }; static void rearm(pn_proactor_t *p, epoll_extended_t *ee); /* * Wake strategy with eventfd. * - wakees can be in the list only once * - wakers only write() if wakes_in_progress is false * - wakees only read() if about to set wakes_in_progress to false * When multiple wakes are pending, the kernel cost is a single rearm(). * Otherwise it is the trio of write/read/rearm. * Only the writes and reads need to be carefully ordered. * * Multiple eventfds could be used and shared amongst the pcontext_t's. */ // part1: call with ctx->owner lock held, return true if notify required by caller static bool wake(pcontext_t *ctx) { bool notify = false; if (!ctx->wake_ops) { if (!ctx->working) { ctx->wake_ops++; pn_proactor_t *p = ctx->proactor; lock(&p->eventfd_mutex); if (!p->wake_list_first) { p->wake_list_first = p->wake_list_last = ctx; } else { p->wake_list_last->wake_next = ctx; p->wake_list_last = ctx; } if (!p->wakes_in_progress) { // force a wakeup via the eventfd p->wakes_in_progress = true; notify = true; } unlock(&p->eventfd_mutex); } } return notify; } // part2: make OS call without lock held static inline void wake_notify(pcontext_t *ctx) { if (ctx->proactor->eventfd == -1) return; uint64_t increment = 1; if (write(ctx->proactor->eventfd, &increment, sizeof(uint64_t)) != sizeof(uint64_t)) EPOLL_FATAL("setting eventfd", errno); } // call with no locks static pcontext_t *wake_pop_front(pn_proactor_t *p) { pcontext_t *ctx = NULL; lock(&p->eventfd_mutex); assert(p->wakes_in_progress); if (p->wake_list_first) { ctx = p->wake_list_first; p->wake_list_first = ctx->wake_next; if (!p->wake_list_first) p->wake_list_last = NULL; ctx->wake_next = NULL; if (!p->wake_list_first) { /* Reset the eventfd until a future write. * Can the read system call be made without holding the lock? * Note that if the reads/writes happen out of order, the wake * mechanism will hang. */ (void)read_uint64(p->eventfd); p->wakes_in_progress = false; } } unlock(&p->eventfd_mutex); rearm(p, &p->epoll_wake); return ctx; } // call with owner lock held, once for each pop from the wake list static inline void wake_done(pcontext_t *ctx) { assert(ctx->wake_ops > 0); ctx->wake_ops--; } static void psocket_init(psocket_t* ps, pn_proactor_t* p, pn_listener_t *listener, const char *addr) { ps->epoll_io.psocket = ps; ps->epoll_io.fd = -1; ps->epoll_io.type = listener ? LISTENER_IO : PCONNECTION_IO; ps->epoll_io.wanted = 0; ps->epoll_io.polling = false; ps->proactor = p; ps->listener = listener; ps->sockfd = -1; pni_parse_addr(addr, ps->addr_buf, sizeof(ps->addr_buf), &ps->host, &ps->port); } typedef struct pconnection_t { psocket_t psocket; pcontext_t context; uint32_t new_events; int wake_count; bool server; /* accept, not connect */ bool tick_pending; bool timer_armed; bool queued_disconnect; /* deferred from pn_proactor_disconnect() */ pn_condition_t *disconnect_condition; ptimer_t timer; // TODO: review one timerfd per connection // Following values only changed by (sole) working context: uint32_t current_arm; // active epoll io events bool connected; bool read_blocked; bool write_blocked; bool disconnected; int hog_count; // thread hogging limiter pn_event_batch_t batch; pn_connection_driver_t driver; struct pn_netaddr_t local, remote; /* Actual addresses */ struct addrinfo *addrinfo; /* Resolved address list */ struct addrinfo *ai; /* Current connect address */ pmutex rearm_mutex; /* protects pconnection_rearm from out of order arming*/ } pconnection_t; /* Protects read/update of pn_connnection_t pointer to it's pconnection_t * * Global because pn_connection_wake()/pn_connection_proactor() navigate from * the pn_connection_t before we know the proactor or driver. Critical sections * are small: only get/set of the pn_connection_t driver pointer. * * TODO: replace mutex with atomic load/store */ static pthread_mutex_t driver_ptr_mutex = PTHREAD_MUTEX_INITIALIZER; static pconnection_t *get_pconnection(pn_connection_t* c) { if (!c) return NULL; lock(&driver_ptr_mutex); pn_connection_driver_t *d = *pn_connection_driver_ptr(c); unlock(&driver_ptr_mutex); if (!d) return NULL; return (pconnection_t*)((char*)d-offsetof(pconnection_t, driver)); } static void set_pconnection(pn_connection_t* c, pconnection_t *pc) { lock(&driver_ptr_mutex); *pn_connection_driver_ptr(c) = pc ? &pc->driver : NULL; unlock(&driver_ptr_mutex); } /* * A listener can have mutiple sockets (as specified in the addrinfo). They * are armed separately. The individual psockets can be part of at most one * list: the global proactor overflow retry list or the per-listener list of * pending accepts (valid inbound socket obtained, but pn_listener_accept not * yet called by the application). These lists will be small and quick to * traverse. */ struct acceptor_t{ psocket_t psocket; int accepted_fd; bool armed; bool overflowed; acceptor_t *next; /* next listener list member */ struct pn_netaddr_t addr; /* listening address */ }; struct pn_listener_t { acceptor_t *acceptors; /* Array of listening sockets */ size_t acceptors_size; int active_count; /* Number of listener sockets registered with epoll */ pcontext_t context; pn_condition_t *condition; pn_collector_t *collector; pn_event_batch_t batch; pn_record_t *attachments; void *listener_context; acceptor_t *pending_acceptors; /* list of those with a valid inbound fd*/ int pending_count; bool unclaimed; /* attach event dispatched but no pn_listener_attach() call yet */ size_t backlog; bool close_dispatched; pmutex rearm_mutex; /* orders rearms/disarms, nothing else */ }; static pn_event_batch_t *pconnection_process(pconnection_t *pc, uint32_t events, bool timeout, bool topup); static void write_flush(pconnection_t *pc); static void listener_begin_close(pn_listener_t* l); static void proactor_add(pcontext_t *ctx); static bool proactor_remove(pcontext_t *ctx); static inline pconnection_t *psocket_pconnection(psocket_t* ps) { return ps->listener ? NULL : (pconnection_t*)ps; } static inline pn_listener_t *psocket_listener(psocket_t* ps) { return ps->listener; } static inline acceptor_t *psocket_acceptor(psocket_t* ps) { return !ps->listener ? NULL : (acceptor_t *)ps; } static inline pconnection_t *pcontext_pconnection(pcontext_t *c) { return c->type == PCONNECTION ? (pconnection_t*)((char*)c - offsetof(pconnection_t, context)) : NULL; } static inline pn_listener_t *pcontext_listener(pcontext_t *c) { return c->type == LISTENER ? (pn_listener_t*)((char*)c - offsetof(pn_listener_t, context)) : NULL; } static pn_event_t *listener_batch_next(pn_event_batch_t *batch); static pn_event_t *proactor_batch_next(pn_event_batch_t *batch); static pn_event_t *pconnection_batch_next(pn_event_batch_t *batch); static inline pn_proactor_t *batch_proactor(pn_event_batch_t *batch) { return (batch->next_event == proactor_batch_next) ? (pn_proactor_t*)((char*)batch - offsetof(pn_proactor_t, batch)) : NULL; } static inline pn_listener_t *batch_listener(pn_event_batch_t *batch) { return (batch->next_event == listener_batch_next) ? (pn_listener_t*)((char*)batch - offsetof(pn_listener_t, batch)) : NULL; } static inline pconnection_t *batch_pconnection(pn_event_batch_t *batch) { return (batch->next_event == pconnection_batch_next) ? (pconnection_t*)((char*)batch - offsetof(pconnection_t, batch)) : NULL; } static inline bool pconnection_has_event(pconnection_t *pc) { return pn_connection_driver_has_event(&pc->driver); } static inline bool listener_has_event(pn_listener_t *l) { return pn_collector_peek(l->collector) || (l->pending_count && !l->unclaimed); } static inline bool proactor_has_event(pn_proactor_t *p) { return pn_collector_peek(p->collector); } static pn_event_t *log_event(void* p, pn_event_t *e) { if (e) { pn_logf("[%p]:(%s)", (void*)p, pn_event_type_name(pn_event_type(e))); } return e; } static void psocket_error_str(psocket_t *ps, const char *msg, const char* what) { if (!ps->listener) { pn_connection_driver_t *driver = &psocket_pconnection(ps)->driver; pn_connection_driver_bind(driver); /* Bind so errors will be reported */ pni_proactor_set_cond(pn_transport_condition(driver->transport), what, ps->host, ps->port, msg); pn_connection_driver_close(driver); } else { pn_listener_t *l = psocket_listener(ps); pni_proactor_set_cond(l->condition, what, ps->host, ps->port, msg); listener_begin_close(l); } } static void psocket_error(psocket_t *ps, int err, const char* what) { strerrorbuf msg; pstrerror(err, msg); psocket_error_str(ps, msg, what); } static void psocket_gai_error(psocket_t *ps, int gai_err, const char* what) { psocket_error_str(ps, gai_strerror(gai_err), what); } static void rearm(pn_proactor_t *p, epoll_extended_t *ee) { struct epoll_event ev; ev.data.ptr = ee; ev.events = ee->wanted | EPOLLONESHOT; memory_barrier(ee); if (epoll_ctl(p->epollfd, EPOLL_CTL_MOD, ee->fd, &ev) == -1) EPOLL_FATAL("arming polled file descriptor", errno); } static void listener_list_append(acceptor_t **start, acceptor_t *item) { assert(item->next == NULL); if (*start) { acceptor_t *end = *start; while (end->next) end = end->next; end->next = item; } else *start = item; } static acceptor_t *listener_list_next(acceptor_t **start) { acceptor_t *item = *start; if (*start) *start = (*start)->next; if (item) item->next = NULL; return item; } // Add an overflowing listener to the overflow list. Called with listener context lock held. static void listener_set_overflow(acceptor_t *a) { a->overflowed = true; pn_proactor_t *p = a->psocket.proactor; lock(&p->overflow_mutex); listener_list_append(&p->overflow, a); unlock(&p->overflow_mutex); } /* TODO aconway 2017-06-08: we should also call proactor_rearm_overflow after a fixed delay, even if the proactor has not freed any file descriptors, since other parts of the process might have*/ // Activate overflowing listeners, called when there may be available file descriptors. static void proactor_rearm_overflow(pn_proactor_t *p) { lock(&p->overflow_mutex); acceptor_t* ovflw = p->overflow; p->overflow = NULL; unlock(&p->overflow_mutex); acceptor_t *a = listener_list_next(&ovflw); while (a) { pn_listener_t *l = a->psocket.listener; lock(&l->context.mutex); bool rearming = !l->context.closing; bool notify = false; assert(!a->armed); assert(a->overflowed); a->overflowed = false; if (rearming) { lock(&l->rearm_mutex); a->armed = true; } else notify = wake(&l->context); unlock(&l->context.mutex); if (rearming) { rearm(p, &a->psocket.epoll_io); unlock(&l->rearm_mutex); } if (notify) wake_notify(&l->context); a = listener_list_next(&ovflw); } } // Close an FD and rearm overflow listeners. Call with no listener locks held. static int pclosefd(pn_proactor_t *p, int fd) { int err = close(fd); if (!err) proactor_rearm_overflow(p); return err; } // ======================================================================== // pconnection // ======================================================================== static void pconnection_tick(pconnection_t *pc); static const char *pconnection_setup(pconnection_t *pc, pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, bool server, const char *addr) { memset(pc, 0, sizeof(*pc)); if (pn_connection_driver_init(&pc->driver, c, t) != 0) { free(pc); return "pn_connection_driver_init failure"; } pcontext_init(&pc->context, PCONNECTION, p, pc); psocket_init(&pc->psocket, p, NULL, addr); pc->new_events = 0; pc->wake_count = 0; pc->tick_pending = false; pc->timer_armed = false; pc->queued_disconnect = false; pc->disconnect_condition = NULL; pc->current_arm = 0; pc->connected = false; pc->read_blocked = true; pc->write_blocked = true; pc->disconnected = false; pc->hog_count = 0; pc->batch.next_event = pconnection_batch_next; if (server) { pn_transport_set_server(pc->driver.transport); } if (!ptimer_init(&pc->timer, &pc->psocket)) { psocket_error(&pc->psocket, errno, "timer setup"); pc->disconnected = true; /* Already failed */ } pmutex_init(&pc->rearm_mutex); /* Set the pconnection_t backpointer last. Connections that were released by pn_proactor_release_connection() must not reveal themselves to be re-associated with a proactor till setup is complete. */ set_pconnection(pc->driver.connection, pc); return NULL; } // Call with lock held and closing == true (i.e. pn_connection_driver_finished() == true), timer cancelled. // Return true when all possible outstanding epoll events associated with this pconnection have been processed. static inline bool pconnection_is_final(pconnection_t *pc) { return !pc->current_arm && !pc->timer_armed && !pc->context.wake_ops; } static void pconnection_final_free(pconnection_t *pc) { if (pc->driver.connection) { set_pconnection(pc->driver.connection, NULL); } if (pc->addrinfo) { freeaddrinfo(pc->addrinfo); } pmutex_finalize(&pc->rearm_mutex); pn_condition_free(pc->disconnect_condition); pn_connection_driver_destroy(&pc->driver); pcontext_finalize(&pc->context); free(pc); } // call without lock, but only if pconnection_is_final() is true static void pconnection_cleanup(pconnection_t *pc) { stop_polling(&pc->psocket.epoll_io, pc->psocket.proactor->epollfd); if (pc->psocket.sockfd != -1) pclosefd(pc->psocket.proactor, pc->psocket.sockfd); stop_polling(&pc->timer.epoll_io, pc->psocket.proactor->epollfd); ptimer_finalize(&pc->timer); lock(&pc->context.mutex); bool can_free = proactor_remove(&pc->context); unlock(&pc->context.mutex); if (can_free) pconnection_final_free(pc); // else proactor_disconnect logic owns psocket and its final free } // Call with lock held or from forced_shutdown static void pconnection_begin_close(pconnection_t *pc) { if (!pc->context.closing) { pc->context.closing = true; if (pc->current_arm != 0 && !pc->new_events) { // Force io callback via an EPOLLHUP shutdown(pc->psocket.sockfd, SHUT_RDWR); } pn_connection_driver_close(&pc->driver); if (ptimer_shutdown(&pc->timer, pc->timer_armed)) pc->timer_armed = false; // disarmed in the sense that the timer will never fire again else if (!pc->timer_armed) { // In doubt. One last callback to collect rearm(pc->psocket.proactor, &pc->timer.epoll_io); pc->timer_armed = true; } } } static void pconnection_forced_shutdown(pconnection_t *pc) { // Called by proactor_free, no competing threads, no epoll activity. pc->current_arm = 0; pc->new_events = 0; pconnection_begin_close(pc); // pconnection_process will never be called again. Zero everything. pc->timer_armed = false; pc->context.wake_ops = 0; pn_connection_t *c = pc->driver.connection; pn_collector_release(pn_connection_collector(c)); assert(pconnection_is_final(pc)); pconnection_cleanup(pc); } static pn_event_t *pconnection_batch_next(pn_event_batch_t *batch) { pconnection_t *pc = batch_pconnection(batch); if (!pc->driver.connection) return NULL; pn_event_t *e = pn_connection_driver_next_event(&pc->driver); if (!e) { write_flush(pc); // May generate transport event e = pn_connection_driver_next_event(&pc->driver); if (!e && pc->hog_count < HOG_MAX) { if (pconnection_process(pc, 0, false, true)) { e = pn_connection_driver_next_event(&pc->driver); } } } return e; } /* Shortcuts */ static inline bool pconnection_rclosed(pconnection_t *pc) { return pn_connection_driver_read_closed(&pc->driver); } static inline bool pconnection_wclosed(pconnection_t *pc) { return pn_connection_driver_write_closed(&pc->driver); } /* Call only from working context (no competitor for pc->current_arm or connection driver). If true returned, caller must do pconnection_rearm(). Never rearm(0 | EPOLLONESHOT), since this really means rearm(EPOLLHUP | EPOLLERR | EPOLLONESHOT) and leaves doubt that the EPOLL_CTL_DEL can prevent a parallel HUP/ERR error notification during close/shutdown. Let read()/write() return 0 or -1 to trigger cleanup logic. */ static bool pconnection_rearm_check(pconnection_t *pc) { if (pconnection_rclosed(pc) && pconnection_wclosed(pc)) { return false; } uint32_t wanted_now = (pc->read_blocked && !pconnection_rclosed(pc)) ? EPOLLIN : 0; if (!pconnection_wclosed(pc)) { if (pc->write_blocked) wanted_now |= EPOLLOUT; else { pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); if (wbuf.size > 0) wanted_now |= EPOLLOUT; } } if (!wanted_now || pc->current_arm == wanted_now) return false; lock(&pc->rearm_mutex); /* unlocked in pconnection_rearm... */ pc->psocket.epoll_io.wanted = wanted_now; pc->current_arm = wanted_now; return true; /* ... so caller MUST call pconnection_rearm */ } /* Call without lock */ static inline void pconnection_rearm(pconnection_t *pc) { rearm(pc->psocket.proactor, &pc->psocket.epoll_io); unlock(&pc->rearm_mutex); } static inline bool pconnection_work_pending(pconnection_t *pc) { if (pc->new_events || pc->wake_count || pc->tick_pending || pc->queued_disconnect) return true; if (!pc->read_blocked && !pconnection_rclosed(pc)) return true; pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); return (wbuf.size > 0 && !pc->write_blocked); } static void pconnection_done(pconnection_t *pc) { bool notify = false; lock(&pc->context.mutex); pc->context.working = false; // So we can wake() ourself if necessary. We remain the de facto // working context while the lock is held. pc->hog_count = 0; if (pconnection_has_event(pc) || pconnection_work_pending(pc)) { notify = wake(&pc->context); } else if (pn_connection_driver_finished(&pc->driver)) { pconnection_begin_close(pc); if (pconnection_is_final(pc)) { unlock(&pc->context.mutex); pconnection_cleanup(pc); return; } } bool rearm = pconnection_rearm_check(pc); unlock(&pc->context.mutex); if (rearm) pconnection_rearm(pc); if (notify) wake_notify(&pc->context); } // Return true unless error static bool pconnection_write(pconnection_t *pc, pn_bytes_t wbuf) { ssize_t n = send(pc->psocket.sockfd, wbuf.start, wbuf.size, MSG_NOSIGNAL); if (n > 0) { pn_connection_driver_write_done(&pc->driver, n); if ((size_t) n < wbuf.size) pc->write_blocked = true; } else if (errno == EWOULDBLOCK) { pc->write_blocked = true; } else if (!(errno == EAGAIN || errno == EINTR)) { return false; } return true; } static void write_flush(pconnection_t *pc) { if (!pc->write_blocked && !pconnection_wclosed(pc)) { pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver); if (wbuf.size > 0) { if (!pconnection_write(pc, wbuf)) { psocket_error(&pc->psocket, errno, pc->disconnected ? "disconnected" : "on write to"); } } else { if (pn_connection_driver_write_closed(&pc->driver)) { shutdown(pc->psocket.sockfd, SHUT_WR); pc->write_blocked = true; } } } } static void pconnection_connected_lh(pconnection_t *pc); static void pconnection_maybe_connect_lh(pconnection_t *pc); /* * May be called concurrently from multiple threads: * pn_event_batch_t loop (topup is true) * timer (timeout is true) * socket io (events != 0) * one or more wake() * Only one thread becomes (or always was) the working thread. */ static pn_event_batch_t *pconnection_process(pconnection_t *pc, uint32_t events, bool timeout, bool topup) { bool inbound_wake = !(events | timeout | topup); bool rearm_timer = false; bool timer_fired = false; bool waking = false; bool tick_required = false; // Don't touch data exclusive to working thread (yet). if (timeout) { rearm_timer = true; timer_fired = ptimer_callback(&pc->timer) != 0; } lock(&pc->context.mutex); if (events) { pc->new_events = events; events = 0; } else if (timer_fired) { pc->tick_pending = true; timer_fired = false; } else if (inbound_wake) { wake_done(&pc->context); inbound_wake = false; } if (rearm_timer) pc->timer_armed = false; if (topup) { // Only called by the batch owner. Does not loop, just "tops up" // once. May be back depending on hog_count. assert(pc->context.working); } else { if (pc->context.working) { // Another thread is the working context. unlock(&pc->context.mutex); return NULL; } pc->context.working = true; } // Confirmed as working thread. Review state and unlock ASAP. retry: if (pc->queued_disconnect) { // From pn_proactor_disconnect() pc->queued_disconnect = false; if (!pc->context.closing) { if (pc->disconnect_condition) { pn_condition_copy(pn_transport_condition(pc->driver.transport), pc->disconnect_condition); } pn_connection_driver_close(&pc->driver); } } if (pconnection_has_event(pc)) { unlock(&pc->context.mutex); return &pc->batch; } bool closed = pconnection_rclosed(pc) && pconnection_wclosed(pc); if (pc->wake_count) { waking = !closed; pc->wake_count = 0; } if (pc->tick_pending) { pc->tick_pending = false; tick_required = !closed; } if (pc->new_events) { pc->current_arm = 0; if (!pc->context.closing) { if ((pc->new_events & (EPOLLHUP | EPOLLERR)) && !pconnection_rclosed(pc) && !pconnection_wclosed(pc)) pconnection_maybe_connect_lh(pc); else pconnection_connected_lh(pc); /* Non error event means we are connected */ if (pc->new_events & EPOLLOUT) pc->write_blocked = false; if (pc->new_events & EPOLLIN) pc->read_blocked = false; } pc->new_events = 0; } if (pc->context.closing && pconnection_is_final(pc)) { unlock(&pc->context.mutex); pconnection_cleanup(pc); return NULL; } unlock(&pc->context.mutex); pc->hog_count++; // working context doing work if (waking) { pn_connection_t *c = pc->driver.connection; pn_collector_put(pn_connection_collector(c), PN_OBJECT, c, PN_CONNECTION_WAKE); waking = false; } // read... tick... write // perhaps should be: write_if_recent_EPOLLOUT... read... tick... write if (!pconnection_rclosed(pc)) { pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver); if (rbuf.size > 0 && !pc->read_blocked) { ssize_t n = read(pc->psocket.sockfd, rbuf.start, rbuf.size); if (n > 0) { pn_connection_driver_read_done(&pc->driver, n); pconnection_tick(pc); /* check for tick changes. */ tick_required = false; if (!pn_connection_driver_read_closed(&pc->driver) && (size_t)n < rbuf.size) pc->read_blocked = true; } else if (n == 0) { pn_connection_driver_read_close(&pc->driver); } else if (errno == EWOULDBLOCK) pc->read_blocked = true; else if (!(errno == EAGAIN || errno == EINTR)) { psocket_error(&pc->psocket, errno, pc->disconnected ? "disconnected" : "on read from"); } } } if (tick_required) { pconnection_tick(pc); /* check for tick changes. */ tick_required = false; } if (topup) { // If there was anything new to topup, we have it by now. return NULL; // caller already owns the batch } if (pconnection_has_event(pc)) { return &pc->batch; } write_flush(pc); lock(&pc->context.mutex); if (pc->context.closing && pconnection_is_final(pc)) { unlock(&pc->context.mutex); pconnection_cleanup(pc); return NULL; } // Never stop working while work remains. hog_count exception to this rule is elsewhere. if (pconnection_work_pending(pc)) goto retry; // TODO: get rid of goto without adding more locking pc->context.working = false; pc->hog_count = 0; if (pn_connection_driver_finished(&pc->driver)) { pconnection_begin_close(pc); if (pconnection_is_final(pc)) { unlock(&pc->context.mutex); pconnection_cleanup(pc); return NULL; } } bool rearm_pc = pconnection_rearm_check(pc); if (!pc->timer_armed && !pc->timer.shutting_down && pc->timer.timerfd >= 0) { pc->timer_armed = true; // about to rearm outside the lock rearm_timer = true; // so we remember } unlock(&pc->context.mutex); if (rearm_timer) { rearm(pc->psocket.proactor, &pc->timer.epoll_io); } if (rearm_pc) pconnection_rearm(pc); return NULL; } static void configure_socket(int sock) { int flags = fcntl(sock, F_GETFL); flags |= O_NONBLOCK; (void)fcntl(sock, F_SETFL, flags); // TODO: check for error int tcp_nodelay = 1; (void)setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*) &tcp_nodelay, sizeof(tcp_nodelay)); } /* Called with context.lock held */ void pconnection_connected_lh(pconnection_t *pc) { if (!pc->connected) { pc->connected = true; if (pc->addrinfo) { freeaddrinfo(pc->addrinfo); pc->addrinfo = NULL; } pc->ai = NULL; socklen_t len = sizeof(pc->remote.ss); (void)getpeername(pc->psocket.sockfd, (struct sockaddr*)&pc->remote.ss, &len); } } /* multi-address connections may call pconnection_start multiple times with diffferent FDs */ static void pconnection_start(pconnection_t *pc) { int efd = pc->psocket.proactor->epollfd; /* Start timer, a no-op if the timer has already started. */ start_polling(&pc->timer.epoll_io, efd); // TODO: check for error /* Get the local socket name now, get the peer name in pconnection_connected */ socklen_t len = sizeof(pc->local.ss); (void)getsockname(pc->psocket.sockfd, (struct sockaddr*)&pc->local.ss, &len); epoll_extended_t *ee = &pc->psocket.epoll_io; if (ee->polling) { /* This is not the first attempt, stop polling and close the old FD */ int fd = ee->fd; /* Save fd, it will be set to -1 by stop_polling */ stop_polling(ee, efd); pclosefd(pc->psocket.proactor, fd); } ee->fd = pc->psocket.sockfd; pc->current_arm = ee->wanted = EPOLLIN | EPOLLOUT; start_polling(ee, efd); // TODO: check for error } /* Called on initial connect, and if connection fails to try another address */ static void pconnection_maybe_connect_lh(pconnection_t *pc) { errno = 0; if (!pc->connected) { /* Not yet connected */ while (pc->ai) { /* Have an address */ struct addrinfo *ai = pc->ai; pc->ai = pc->ai->ai_next; /* Move to next address in case this fails */ int fd = socket(ai->ai_family, SOCK_STREAM, 0); if (fd >= 0) { configure_socket(fd); if (!connect(fd, ai->ai_addr, ai->ai_addrlen) || errno == EINPROGRESS) { pc->psocket.sockfd = fd; pconnection_start(pc); return; /* Async connection started */ } else { close(fd); } } /* connect failed immediately, go round the loop to try the next addr */ } freeaddrinfo(pc->addrinfo); pc->addrinfo = NULL; /* If there was a previous attempted connection, let the poller discover the errno from its socket, otherwise set the current error. */ if (pc->psocket.sockfd < 1) { psocket_error(&pc->psocket, errno ? errno : ENOTCONN, "on connect"); } } pc->disconnected = true; } static int pgetaddrinfo(const char *host, const char *port, int flags, struct addrinfo **res) { struct addrinfo hints = { 0 }; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | flags; return getaddrinfo(host, port, &hints, res); } static inline bool is_inactive(pn_proactor_t *p) { return (!p->contexts && !p->disconnects_pending && !p->timeout_set && !p->shutting_down); } /* If inactive set need_inactive and return true if the proactor needs a wakeup */ static bool wake_if_inactive(pn_proactor_t *p) { if (is_inactive(p)) { p->need_inactive = true; return wake(&p->context); } return false; } void pn_proactor_connect2(pn_proactor_t *p, pn_connection_t *c, pn_transport_t *t, const char *addr) { pconnection_t *pc = (pconnection_t*) calloc(1, sizeof(pconnection_t)); assert(pc); // TODO: memory safety const char *err = pconnection_setup(pc, p, c, t, false, addr); if (err) { /* TODO aconway 2017-09-13: errors must be reported as events */ pn_logf("pn_proactor_connect failure: %s", err); return; } // TODO: check case of proactor shutting down lock(&pc->context.mutex); proactor_add(&pc->context); pn_connection_open(pc->driver.connection); /* Auto-open */ bool notify = false; bool notify_proactor = false; if (pc->disconnected) { notify = wake(&pc->context); /* Error during initialization */ } else { int gai_error = pgetaddrinfo(pc->psocket.host, pc->psocket.port, 0, &pc->addrinfo); if (!gai_error) { pn_connection_open(pc->driver.connection); /* Auto-open */ pc->ai = pc->addrinfo; pconnection_maybe_connect_lh(pc); /* Start connection attempts */ if (pc->disconnected) notify = wake(&pc->context); } else { psocket_gai_error(&pc->psocket, gai_error, "connect to "); notify = wake(&pc->context); notify_proactor = wake_if_inactive(p); } } /* We need to issue INACTIVE on immediate failure */ unlock(&pc->context.mutex); if (notify) wake_notify(&pc->context); if (notify_proactor) wake_notify(&p->context); } static void pconnection_tick(pconnection_t *pc) { pn_transport_t *t = pc->driver.transport; if (pn_transport_get_idle_timeout(t) || pn_transport_get_remote_idle_timeout(t)) { ptimer_set(&pc->timer, 0); uint64_t now = pn_i_now2(); uint64_t next = pn_transport_tick(t, now); if (next) { ptimer_set(&pc->timer, next - now); } } } void pn_connection_wake(pn_connection_t* c) { bool notify = false; pconnection_t *pc = get_pconnection(c); if (pc) { lock(&pc->context.mutex); if (!pc->context.closing) { pc->wake_count++; notify = wake(&pc->context); } unlock(&pc->context.mutex); } if (notify) wake_notify(&pc->context); } void pn_proactor_release_connection(pn_connection_t *c) { bool notify = false; pconnection_t *pc = get_pconnection(c); if (pc) { set_pconnection(c, NULL); lock(&pc->context.mutex); pn_connection_driver_release_connection(&pc->driver); pconnection_begin_close(pc); notify = wake(&pc->context); unlock(&pc->context.mutex); } if (notify) wake_notify(&pc->context); } // ======================================================================== // listener // ======================================================================== pn_listener_t *pn_event_listener(pn_event_t *e) { return (pn_event_class(e) == pn_listener__class()) ? (pn_listener_t*)pn_event_context(e) : NULL; } pn_listener_t *pn_listener() { pn_listener_t *l = (pn_listener_t*)calloc(1, sizeof(pn_listener_t)); if (l) { l->batch.next_event = listener_batch_next; l->collector = pn_collector(); l->condition = pn_condition(); l->attachments = pn_record(); if (!l->condition || !l->collector || !l->attachments) { pn_listener_free(l); return NULL; } pn_proactor_t *unknown = NULL; // won't know until pn_proactor_listen pcontext_init(&l->context, LISTENER, unknown, l); pmutex_init(&l->rearm_mutex); } return l; } void pn_proactor_listen(pn_proactor_t *p, pn_listener_t *l, const char *addr, int backlog) { // TODO: check listener not already listening for this or another proactor lock(&l->context.mutex); l->context.proactor = p;; l->backlog = backlog; char addr_buf[PN_MAX_ADDR]; const char *host, *port; pni_parse_addr(addr, addr_buf, PN_MAX_ADDR, &host, &port); struct addrinfo *addrinfo = NULL; int gai_err = pgetaddrinfo(host, port, AI_PASSIVE | AI_ALL, &addrinfo); if (!gai_err) { /* Count addresses, allocate enough space for sockets */ size_t len = 0; for (struct addrinfo *ai = addrinfo; ai; ai = ai->ai_next) { ++len; } assert(len > 0); /* guaranteed by getaddrinfo */ l->acceptors = (acceptor_t*)calloc(len, sizeof(acceptor_t)); assert(l->acceptors); /* TODO aconway 2017-05-05: memory safety */ l->acceptors_size = 0; uint16_t dynamic_port = 0; /* Record dynamic port from first bind(0) */ /* Find working listen addresses */ for (struct addrinfo *ai = addrinfo; ai; ai = ai->ai_next) { if (dynamic_port) set_port(ai->ai_addr, dynamic_port); int fd = socket(ai->ai_family, SOCK_STREAM, ai->ai_protocol); static int on = 1; if (fd >= 0) { if (!setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) && /* We listen to v4/v6 on separate sockets, don't let v6 listen for v4 */ (ai->ai_family != AF_INET6 || !setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on))) && !bind(fd, ai->ai_addr, ai->ai_addrlen) && !listen(fd, backlog)) { acceptor_t *acceptor = &l->acceptors[l->acceptors_size++]; /* Get actual address */ socklen_t len = pn_netaddr_socklen(&acceptor->addr); (void)getsockname(fd, (struct sockaddr*)(&acceptor->addr.ss), &len); if (acceptor == l->acceptors) { /* First acceptor, check for dynamic port */ dynamic_port = check_dynamic_port(ai->ai_addr, pn_netaddr_sockaddr(&acceptor->addr)); } else { /* Link addr to previous addr */ (acceptor-1)->addr.next = &acceptor->addr; } acceptor->accepted_fd = -1; psocket_t *ps = &acceptor->psocket; psocket_init(ps, p, l, addr); ps->sockfd = fd; ps->epoll_io.fd = fd; ps->epoll_io.wanted = EPOLLIN; ps->epoll_io.polling = false; lock(&l->rearm_mutex); start_polling(&ps->epoll_io, ps->proactor->epollfd); // TODO: check for error l->active_count++; acceptor->armed = true; unlock(&l->rearm_mutex); } else { close(fd); } } } } if (addrinfo) { freeaddrinfo(addrinfo); } bool notify = wake(&l->context); if (l->acceptors_size == 0) { /* All failed, create dummy socket with an error */ l->acceptors = (acceptor_t*)realloc(l->acceptors, sizeof(acceptor_t)); l->acceptors_size = 1; memset(l->acceptors, 0, sizeof(acceptor_t)); psocket_init(&l->acceptors[0].psocket, p, l, addr); l->acceptors[0].accepted_fd = -1; if (gai_err) { psocket_gai_error(&l->acceptors[0].psocket, gai_err, "listen on"); } else { psocket_error(&l->acceptors[0].psocket, errno, "listen on"); } } else { pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_OPEN); } proactor_add(&l->context); unlock(&l->context.mutex); if (notify) wake_notify(&l->context); return; } // call with lock held and context.working false static inline bool listener_can_free(pn_listener_t *l) { return l->context.closing && l->close_dispatched && !l->context.wake_ops && !l->active_count; } static inline void listener_final_free(pn_listener_t *l) { pcontext_finalize(&l->context); pmutex_finalize(&l->rearm_mutex); free(l->acceptors); free(l); } void pn_listener_free(pn_listener_t *l) { /* Note at this point either the listener has never been used (freed by user) or it has been closed, so all its sockets are closed. */ if (l) { bool can_free = true; if (l->collector) pn_collector_free(l->collector); if (l->condition) pn_condition_free(l->condition); if (l->attachments) pn_free(l->attachments); lock(&l->context.mutex); if (l->context.proactor) { can_free = proactor_remove(&l->context); } unlock(&l->context.mutex); if (can_free) listener_final_free(l); } } /* Always call with lock held so it can be unlocked around overflow processing. */ static void listener_begin_close(pn_listener_t* l) { if (!l->context.closing) { l->context.closing = true; /* Close all listening sockets */ for (size_t i = 0; i < l->acceptors_size; ++i) { acceptor_t *a = &l->acceptors[i]; psocket_t *ps = &a->psocket; if (ps->sockfd >= 0) { lock(&l->rearm_mutex); if (a->armed) { shutdown(ps->sockfd, SHUT_RD); // Force epoll event and callback } else { stop_polling(&ps->epoll_io, ps->proactor->epollfd); close(ps->sockfd); ps->sockfd = -1; l->active_count--; } unlock(&l->rearm_mutex); } } /* Close all sockets waiting for a pn_listener_accept2() */ if (l->unclaimed) l->pending_count++; acceptor_t *a = listener_list_next(&l->pending_acceptors); while (a) { close(a->accepted_fd); a->accepted_fd = -1; l->pending_count--; a = listener_list_next(&l->pending_acceptors); } assert(!l->pending_count); unlock(&l->context.mutex); /* Remove all acceptors from the overflow list. closing flag prevents re-insertion.*/ proactor_rearm_overflow(pn_listener_proactor(l)); lock(&l->context.mutex); pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_CLOSE); } } void pn_listener_close(pn_listener_t* l) { bool notify = false; lock(&l->context.mutex); if (!l->context.closing) { listener_begin_close(l); notify = wake(&l->context); } unlock(&l->context.mutex); if (notify) wake_notify(&l->context); } static void listener_forced_shutdown(pn_listener_t *l) { // Called by proactor_free, no competing threads, no epoll activity. lock(&l->context.mutex); // needed because of interaction with proactor_rearm_overflow listener_begin_close(l); unlock(&l->context.mutex); // pconnection_process will never be called again. Zero everything. l->context.wake_ops = 0; l->close_dispatched = true; l->active_count = 0; assert(listener_can_free(l)); pn_listener_free(l); } /* Accept a connection as part of listener_process(). Called with listener context lock held. */ static void listener_accept_lh(psocket_t *ps) { pn_listener_t *l = psocket_listener(ps); acceptor_t *acceptor = psocket_acceptor(ps); assert(acceptor->accepted_fd < 0); /* Shouldn't already have an accepted_fd */ acceptor->accepted_fd = accept(ps->sockfd, NULL, 0); if (acceptor->accepted_fd >= 0) { // acceptor_t *acceptor = listener_list_next(pending_acceptors); listener_list_append(&l->pending_acceptors, acceptor); l->pending_count++; } else { int err = errno; if (err == ENFILE || err == EMFILE) { listener_set_overflow(acceptor); } else { psocket_error(ps, err, "accept"); } } } /* Process a listening socket */ static pn_event_batch_t *listener_process(psocket_t *ps, uint32_t events) { // TODO: some parallelization of the accept mechanism. pn_listener_t *l = psocket_listener(ps); acceptor_t *a = psocket_acceptor(ps); lock(&l->context.mutex); if (events) { a->armed = false; if (l->context.closing) { lock(&l->rearm_mutex); stop_polling(&ps->epoll_io, ps->proactor->epollfd); unlock(&l->rearm_mutex); close(ps->sockfd); ps->sockfd = -1; l->active_count--; } else { if (events & EPOLLRDHUP) { /* Calls listener_begin_close which closes all the listener's sockets */ psocket_error(ps, errno, "listener epoll"); } else if (!l->context.closing && events & EPOLLIN) { listener_accept_lh(ps); } } } else { wake_done(&l->context); // callback accounting } pn_event_batch_t *lb = NULL; if (!l->context.working) { l->context.working = true; if (listener_has_event(l)) lb = &l->batch; else { l->context.working = false; if (listener_can_free(l)) { unlock(&l->context.mutex); pn_listener_free(l); return NULL; } } } unlock(&l->context.mutex); return lb; } static pn_event_t *listener_batch_next(pn_event_batch_t *batch) { pn_listener_t *l = batch_listener(batch); lock(&l->context.mutex); pn_event_t *e = pn_collector_next(l->collector); if (!e && l->pending_count && !l->unclaimed) { // empty collector means pn_collector_put() will not coalesce pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_ACCEPT); l->unclaimed = true; l->pending_count--; e = pn_collector_next(l->collector); } if (e && pn_event_type(e) == PN_LISTENER_CLOSE) l->close_dispatched = true; unlock(&l->context.mutex); return log_event(l, e); } static void listener_done(pn_listener_t *l) { bool notify = false; lock(&l->context.mutex); l->context.working = false; if (listener_can_free(l)) { unlock(&l->context.mutex); pn_listener_free(l); return; } else if (listener_has_event(l)) notify = wake(&l->context); unlock(&l->context.mutex); if (notify) wake_notify(&l->context); } pn_proactor_t *pn_listener_proactor(pn_listener_t* l) { return l ? l->acceptors[0].psocket.proactor : NULL; } pn_condition_t* pn_listener_condition(pn_listener_t* l) { return l->condition; } void *pn_listener_get_context(pn_listener_t *l) { return l->listener_context; } void pn_listener_set_context(pn_listener_t *l, void *context) { l->listener_context = context; } pn_record_t *pn_listener_attachments(pn_listener_t *l) { return l->attachments; } void pn_listener_accept2(pn_listener_t *l, pn_connection_t *c, pn_transport_t *t) { pconnection_t *pc = (pconnection_t*) calloc(1, sizeof(pconnection_t)); assert(pc); // TODO: memory safety const char *err = pconnection_setup(pc, pn_listener_proactor(l), c, t, true, ""); if (err) { pn_logf("pn_listener_accept failure: %s", err); return; } // TODO: fuller sanity check on input args int err2 = 0; int fd = -1; psocket_t *rearming_ps = NULL; bool notify = false; lock(&l->context.mutex); if (l->context.closing) err2 = EBADF; else if (l->unclaimed) { l->unclaimed = false; acceptor_t *a = listener_list_next(&l->pending_acceptors); assert(a); assert(!a->armed); fd = a->accepted_fd; a->accepted_fd = -1; lock(&l->rearm_mutex); rearming_ps = &a->psocket; a->armed = true; } else err2 = EWOULDBLOCK; proactor_add(&pc->context); lock(&pc->context.mutex); pc->psocket.sockfd = fd; if (fd >= 0) { configure_socket(fd); pconnection_start(pc); pconnection_connected_lh(pc); } else psocket_error(&pc->psocket, err2, "pn_listener_accept"); if (!l->context.working && listener_has_event(l)) notify = wake(&l->context); unlock(&pc->context.mutex); unlock(&l->context.mutex); if (rearming_ps) { rearm(rearming_ps->proactor, &rearming_ps->epoll_io); unlock(&l->rearm_mutex); } if (notify) wake_notify(&l->context); } // ======================================================================== // proactor // ======================================================================== /* Set up an epoll_extended_t to be used for wakeup or interrupts */ static void epoll_wake_init(epoll_extended_t *ee, int eventfd, int epollfd) { ee->psocket = NULL; ee->fd = eventfd; ee->type = WAKE; ee->wanted = EPOLLIN; ee->polling = false; start_polling(ee, epollfd); // TODO: check for error } pn_proactor_t *pn_proactor() { pn_proactor_t *p = (pn_proactor_t*)calloc(1, sizeof(*p)); if (!p) return NULL; p->epollfd = p->eventfd = p->timer.timerfd = -1; pcontext_init(&p->context, PROACTOR, p, p); pmutex_init(&p->eventfd_mutex); ptimer_init(&p->timer, 0); if ((p->epollfd = epoll_create(1)) >= 0) { if ((p->eventfd = eventfd(0, EFD_NONBLOCK)) >= 0) { if ((p->interruptfd = eventfd(0, EFD_NONBLOCK)) >= 0) { if (p->timer.timerfd >= 0) if ((p->collector = pn_collector()) != NULL) { p->batch.next_event = &proactor_batch_next; start_polling(&p->timer.epoll_io, p->epollfd); // TODO: check for error p->timer_armed = true; epoll_wake_init(&p->epoll_wake, p->eventfd, p->epollfd); epoll_wake_init(&p->epoll_interrupt, p->interruptfd, p->epollfd); return p; } } } } if (p->epollfd >= 0) close(p->epollfd); if (p->eventfd >= 0) close(p->eventfd); if (p->interruptfd >= 0) close(p->interruptfd); ptimer_finalize(&p->timer); if (p->collector) pn_free(p->collector); free (p); return NULL; } void pn_proactor_free(pn_proactor_t *p) { // No competing threads, not even a pending timer p->shutting_down = true; close(p->epollfd); p->epollfd = -1; close(p->eventfd); p->eventfd = -1; close(p->interruptfd); p->interruptfd = -1; ptimer_finalize(&p->timer); while (p->contexts) { pcontext_t *ctx = p->contexts; p->contexts = ctx->next; switch (ctx->type) { case PCONNECTION: pconnection_forced_shutdown(pcontext_pconnection(ctx)); break; case LISTENER: listener_forced_shutdown(pcontext_listener(ctx)); break; default: break; } } pn_collector_free(p->collector); pmutex_finalize(&p->eventfd_mutex); pcontext_finalize(&p->context); free(p); } pn_proactor_t *pn_event_proactor(pn_event_t *e) { if (pn_event_class(e) == pn_proactor__class()) return (pn_proactor_t*)pn_event_context(e); pn_listener_t *l = pn_event_listener(e); if (l) return l->acceptors[0].psocket.proactor; pn_connection_t *c = pn_event_connection(e); if (c) return pn_connection_proactor(c); return NULL; } static void proactor_add_event(pn_proactor_t *p, pn_event_type_t t) { pn_collector_put(p->collector, pn_proactor__class(), p, t); } // Call with lock held. Leave unchanged if events pending. // There can be multiple interrupts but only one inside the collector to avoid coalescing. // Return true if there is an event in the collector. static bool proactor_update_batch(pn_proactor_t *p) { if (proactor_has_event(p)) return true; if (p->need_timeout) { p->need_timeout = false; p->timeout_set = false; proactor_add_event(p, PN_PROACTOR_TIMEOUT); return true; } if (p->need_interrupt) { p->need_interrupt = false; proactor_add_event(p, PN_PROACTOR_INTERRUPT); return true; } if (p->need_inactive) { p->need_inactive = false; proactor_add_event(p, PN_PROACTOR_INACTIVE); return true; } return false; } static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) { pn_proactor_t *p = batch_proactor(batch); lock(&p->context.mutex); proactor_update_batch(p); pn_event_t *e = pn_collector_next(p->collector); if (e && pn_event_type(e) == PN_PROACTOR_TIMEOUT) p->timeout_processed = true; unlock(&p->context.mutex); return log_event(p, e); } static pn_event_batch_t *proactor_process(pn_proactor_t *p, pn_event_type_t event) { bool timer_fired = (event == PN_PROACTOR_TIMEOUT) && ptimer_callback(&p->timer) != 0; lock(&p->context.mutex); if (event == PN_PROACTOR_INTERRUPT) { p->need_interrupt = true; } else if (event == PN_PROACTOR_TIMEOUT) { p->timer_armed = false; if (timer_fired && p->timeout_set) { p->need_timeout = true; } } else { wake_done(&p->context); } if (!p->context.working) { /* Can generate proactor events */ if (proactor_update_batch(p)) { p->context.working = true; unlock(&p->context.mutex); return &p->batch; } } bool rearm_timer = !p->timer_armed && !p->timer.shutting_down; p->timer_armed = true; unlock(&p->context.mutex); if (rearm_timer) rearm(p, &p->timer.epoll_io); return NULL; } static void proactor_add(pcontext_t *ctx) { pn_proactor_t *p = ctx->proactor; lock(&p->context.mutex); if (p->contexts) { p->contexts->prev = ctx; ctx->next = p->contexts; } p->contexts = ctx; unlock(&p->context.mutex); } // call with psocket's mutex held // return true if safe for caller to free psocket static bool proactor_remove(pcontext_t *ctx) { pn_proactor_t *p = ctx->proactor; lock(&p->context.mutex); bool can_free = true; if (ctx->disconnecting) { // No longer on contexts list if (--ctx->disconnect_ops == 0) { --p->disconnects_pending; } else // procator_disconnect() still processing can_free = false; // this psocket } else { // normal case if (ctx->prev) ctx->prev->next = ctx->next; else { p->contexts = ctx->next; ctx->next = NULL; if (p->contexts) p->contexts->prev = NULL; } if (ctx->next) { ctx->next->prev = ctx->prev; } } bool notify = wake_if_inactive(p); unlock(&p->context.mutex); if (notify) wake_notify(&p->context); return can_free; } static pn_event_batch_t *process_inbound_wake(pn_proactor_t *p, epoll_extended_t *ee) { if (ee->fd == p->interruptfd) { /* Interrupts have their own dedicated eventfd */ (void)read_uint64(p->interruptfd); rearm(p, &p->epoll_interrupt); return proactor_process(p, PN_PROACTOR_INTERRUPT); } pcontext_t *ctx = wake_pop_front(p); if (ctx) { switch (ctx->type) { case PROACTOR: return proactor_process(p, PN_EVENT_NONE); case PCONNECTION: return pconnection_process((pconnection_t *) ctx->owner, 0, false, false); case LISTENER: return listener_process(&((pn_listener_t *) ctx->owner)->acceptors[0].psocket, 0); default: assert(ctx->type == WAKEABLE); // TODO: implement or remove } } return NULL; } static pn_event_batch_t *proactor_do_epoll(struct pn_proactor_t* p, bool can_block) { int timeout = can_block ? -1 : 0; while(true) { pn_event_batch_t *batch = NULL; struct epoll_event ev; int n = epoll_wait(p->epollfd, &ev, 1, timeout); if (n < 0) { if (errno != EINTR) perror("epoll_wait"); // TODO: proper log if (!can_block) return NULL; else continue; } else if (n == 0) { if (!can_block) return NULL; else { perror("epoll_wait unexpected timeout"); // TODO: proper log continue; } } assert(n == 1); epoll_extended_t *ee = (epoll_extended_t *) ev.data.ptr; memory_barrier(ee); if (ee->type == WAKE) { batch = process_inbound_wake(p, ee); } else if (ee->type == PROACTOR_TIMER) { batch = proactor_process(p, PN_PROACTOR_TIMEOUT); } else { pconnection_t *pc = psocket_pconnection(ee->psocket); if (pc) { if (ee->type == PCONNECTION_IO) { batch = pconnection_process(pc, ev.events, false, false); } else { assert(ee->type == PCONNECTION_TIMER); batch = pconnection_process(pc, 0, true, false); } } else { // TODO: can any of the listener processing be parallelized like IOCP? batch = listener_process(ee->psocket, ev.events); } } if (batch) return batch; // No Proton event generated. epoll_wait() again. } } pn_event_batch_t *pn_proactor_wait(struct pn_proactor_t* p) { return proactor_do_epoll(p, true); } pn_event_batch_t *pn_proactor_get(struct pn_proactor_t* p) { return proactor_do_epoll(p, false); } void pn_proactor_done(pn_proactor_t *p, pn_event_batch_t *batch) { pconnection_t *pc = batch_pconnection(batch); if (pc) { pconnection_done(pc); return; } pn_listener_t *l = batch_listener(batch); if (l) { listener_done(l); return; } pn_proactor_t *bp = batch_proactor(batch); if (bp == p) { bool notify = false; lock(&p->context.mutex); bool rearm_timer = !p->timer_armed && !p->shutting_down; p->timer_armed = true; p->context.working = false; if (p->timeout_processed) { p->timeout_processed = false; if (wake_if_inactive(p)) notify = true; } proactor_update_batch(p); if (proactor_has_event(p)) if (wake(&p->context)) notify = true; unlock(&p->context.mutex); if (notify) wake_notify(&p->context); if (rearm_timer) rearm(p, &p->timer.epoll_io); return; } } void pn_proactor_interrupt(pn_proactor_t *p) { if (p->interruptfd == -1) return; uint64_t increment = 1; if (write(p->interruptfd, &increment, sizeof(uint64_t)) != sizeof(uint64_t)) EPOLL_FATAL("setting eventfd", errno); } void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) { bool notify = false; lock(&p->context.mutex); p->timeout_set = true; if (t == 0) { ptimer_set(&p->timer, 0); p->need_timeout = true; notify = wake(&p->context); } else { ptimer_set(&p->timer, t); } unlock(&p->context.mutex); if (notify) wake_notify(&p->context); } void pn_proactor_cancel_timeout(pn_proactor_t *p) { lock(&p->context.mutex); p->timeout_set = false; p->need_timeout = false; ptimer_set(&p->timer, 0); bool notify = wake_if_inactive(p); unlock(&p->context.mutex); if (notify) wake_notify(&p->context); } pn_proactor_t *pn_connection_proactor(pn_connection_t* c) { pconnection_t *pc = get_pconnection(c); return pc ? pc->psocket.proactor : NULL; } void pn_proactor_disconnect(pn_proactor_t *p, pn_condition_t *cond) { bool notify = false; lock(&p->context.mutex); // Move the whole contexts list into a disconnecting state pcontext_t *disconnecting_pcontexts = p->contexts; p->contexts = NULL; // First pass: mark each pcontext as disconnecting and update global pending count. pcontext_t *ctx = disconnecting_pcontexts; while (ctx) { ctx->disconnecting = true; ctx->disconnect_ops = 2; // Second pass below and proactor_remove(), in any order. p->disconnects_pending++; ctx = ctx->next; } notify = wake_if_inactive(p); unlock(&p->context.mutex); if (!disconnecting_pcontexts) { if (notify) wake_notify(&p->context); return; } // Second pass: different locking, close the pcontexts, free them if !disconnect_ops pcontext_t *next = disconnecting_pcontexts; while (next) { ctx = next; next = ctx->next; /* Save next pointer in case we free ctx */ bool do_free = false; bool ctx_notify = true; pmutex *ctx_mutex = NULL; pconnection_t *pc = pcontext_pconnection(ctx); if (pc) { ctx_mutex = &pc->context.mutex; lock(ctx_mutex); if (!ctx->closing) { if (ctx->working) { // Must defer pc->queued_disconnect = true; if (cond) { if (!pc->disconnect_condition) pc->disconnect_condition = pn_condition(); pn_condition_copy(pc->disconnect_condition, cond); } } else { // No conflicting working context. if (cond) { pn_condition_copy(pn_transport_condition(pc->driver.transport), cond); } pn_connection_driver_close(&pc->driver); } } } else { pn_listener_t *l = pcontext_listener(ctx); assert(l); ctx_mutex = &l->context.mutex; lock(ctx_mutex); if (!ctx->closing) { if (cond) { pn_condition_copy(pn_listener_condition(l), cond); } listener_begin_close(l); } } lock(&p->context.mutex); if (--ctx->disconnect_ops == 0) { do_free = true; ctx_notify = false; notify = wake_if_inactive(p); } else { // If initiating the close, wake the pcontext to do the free. if (ctx_notify) ctx_notify = wake(ctx); } unlock(&p->context.mutex); unlock(ctx_mutex); if (do_free) { if (pc) pconnection_final_free(pc); else listener_final_free(pcontext_listener(ctx)); } else { if (ctx_notify) wake_notify(ctx); } } if (notify) wake_notify(&p->context); } const pn_netaddr_t *pn_transport_local_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc? &pc->local : NULL; } const pn_netaddr_t *pn_transport_remote_addr(pn_transport_t *t) { pconnection_t *pc = get_pconnection(pn_transport_connection(t)); return pc ? &pc->remote : NULL; } const pn_netaddr_t *pn_listener_addr(pn_listener_t *l) { return l->acceptors_size > 0 ? &l->acceptors[0].addr : NULL; } pn_millis_t pn_proactor_now(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec*1000 + t.tv_nsec/1000000; } qpid-proton-0.22.0/proton-c/src/platform/0000775000000000000000000000000013257152177015125 5ustar qpid-proton-0.22.0/proton-c/src/platform/platform_fmt.h0000664000000000000000000000367213257152177020000 0ustar #ifndef _PROTON_SRC_PLATFORM_FMT_H #define _PROTON_SRC_PLATFORM_FMT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * Platform dependent type-specific format specifiers for PRIx and %z * for use with printf. PRIx defs are normally available in * inttypes.h (C99), but extra steps are required for C++, and they * are not available in Visual Studio at all. * Visual studio uses "%I" for size_t instead of "%z". */ #ifndef __cplusplus // normal case #include #define PN_ZI "zi" #define PN_ZU "zu" #ifdef _OPENVMS #undef PN_ZI #undef PN_ZU #define PN_ZI "i" #define PN_ZU "u" #define PRIu64 "llu" #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "u" #define PRIu64 "llu" #define PRIi8 "i" #define PRIi16 "i" #define PRIi32 "i" #define PRIi64 "lli" #endif /* _OPENVMS */ #else #ifdef _MSC_VER #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "u" #define PRIu64 "I64u" #define PRIi8 "i" #define PRIi16 "i" #define PRIi32 "i" #define PRIi64 "I64i" #define PN_ZI "Ii" #define PN_ZU "Iu" #else // Normal C++ #define __STDC_FORMAT_MACROS #include #define PN_ZI "zi" #define PN_ZU "zu" #endif /* _MSC_VER */ #endif /* __cplusplus */ #endif /* platform_fmt.h */ qpid-proton-0.22.0/proton-c/src/platform/platform.h0000664000000000000000000000417713257152177017133 0ustar #ifndef PROTON_PLATFORM_H #define PROTON_PLATFORM_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/types.h" #include "proton/error.h" /** Get the current PID * * @return process id * @internal */ int pn_i_getpid(void); /** Get the current time in pn_timestamp_t format. * * Returns current time in milliseconds since Unix Epoch, * as defined by AMQP 1.0 * * @return current time * @internal */ pn_timestamp_t pn_i_now(void); /** Generate system error message. * * Populate the proton error structure based on the last system error * code. * * @param[in] error the proton error structure * @param[in] msg the descriptive context message * @return error->code * * @internal */ int pn_i_error_from_errno(pn_error_t *error, const char *msg); /** Provide C99 atoll functinality. * * @param[in] num the string representation of the number. * @return the integer value. * * @internal */ int64_t pn_i_atoll(const char* num); int pni_snprintf(char *buf, size_t count, const char *fmt, ...); int pni_vsnprintf(char *buf, size_t count, const char *fmt, va_list ap); #ifndef _MSC_VER #define pni_snprintf snprintf #define pni_vsnprintf vsnprintf #else #if !defined(S_ISDIR) # define S_ISDIR(X) ((X) & _S_IFDIR) #endif #endif #if defined _MSC_VER || defined _OPENVMS #if !defined(va_copy) #define va_copy(d,s) ((d) = (s)) #endif #endif #endif /* platform.h */ qpid-proton-0.22.0/proton-c/src/platform/platform.c0000664000000000000000000000600713257152177017120 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "platform.h" #include #include #include #ifdef PN_WINAPI #include int pn_i_getpid() { return (int) GetCurrentProcessId(); } #else #include int pn_i_getpid() { return (int) getpid(); } #endif void pni_vfatal(const char *fmt, va_list ap) { vfprintf(stderr, fmt, ap); abort(); } void pni_fatal(const char *fmt, ...) { va_list ap; va_start(ap, fmt); pni_vfatal(fmt, ap); va_end(ap); } /* Allow for systems that do not implement clock_gettime()*/ #ifdef USE_CLOCK_GETTIME #include pn_timestamp_t pn_i_now(void) { struct timespec now; if (clock_gettime(CLOCK_REALTIME, &now)) pni_fatal("clock_gettime() failed\n"); return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_nsec / 1000000); } #elif defined(USE_WIN_FILETIME) #include pn_timestamp_t pn_i_now(void) { FILETIME now; GetSystemTimeAsFileTime(&now); ULARGE_INTEGER t; t.u.HighPart = now.dwHighDateTime; t.u.LowPart = now.dwLowDateTime; // Convert to milliseconds and adjust base epoch return t.QuadPart / 10000 - 11644473600000; } #else #include pn_timestamp_t pn_i_now(void) { struct timeval now; if (gettimeofday(&now, NULL)) pni_fatal("gettimeofday failed\n"); return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000); } #endif #include #include static void pn_i_strerror(int errnum, char *buf, size_t buflen) { // PROTON-1029 provide a simple default in case strerror fails pni_snprintf(buf, buflen, "errno: %d", errnum); #ifdef USE_STRERROR_R strerror_r(errnum, buf, buflen); #elif USE_STRERROR_S strerror_s(buf, buflen, errnum); #elif USE_OLD_STRERROR strncpy(buf, strerror(errnum), buflen); #endif } int pn_i_error_from_errno(pn_error_t *error, const char *msg) { char err[1024]; pn_i_strerror(errno, err, 1024); int code = PN_ERR; if (errno == EINTR) code = PN_INTR; return pn_error_format(error, code, "%s: %s", msg, err); } #ifdef USE_ATOLL #include int64_t pn_i_atoll(const char* num) { return atoll(num); } #elif USE_ATOI64 #include int64_t pn_i_atoll(const char* num) { return _atoi64(num); } #else #error "Don't know how to convert int64_t values on this platform" #endif qpid-proton-0.22.0/proton-c/src/messenger/0000775000000000000000000000000013257152177015271 5ustar qpid-proton-0.22.0/proton-c/src/messenger/transform.h0000664000000000000000000000264613257152177017465 0ustar #ifndef _PROTON_TRANSFORM_H #define _PROTON_TRANSFORM_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "core/buffer.h" #include typedef struct pn_transform_t pn_transform_t; pn_transform_t *pn_transform(void); void pn_transform_rule(pn_transform_t *transform, const char *pattern, const char *substitution); int pn_transform_apply(pn_transform_t *transform, const char *src, pn_string_t *dest); bool pn_transform_matched(pn_transform_t *transform); int pn_transform_get_substitutions(pn_transform_t *transform, pn_list_t *substitutions); #endif /* transform.h */ qpid-proton-0.22.0/proton-c/src/messenger/transform.c0000664000000000000000000001500113257152177017445 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "transform.h" typedef struct { const char *start; size_t size; } pn_group_t; #define MAX_GROUP (64) typedef struct { size_t groups; pn_group_t group[MAX_GROUP]; } pn_matcher_t; typedef struct { pn_string_t *pattern; pn_string_t *substitution; } pn_rule_t; struct pn_transform_t { pn_list_t *rules; pn_matcher_t matcher; bool matched; }; static void pn_rule_finalize(void *object) { pn_rule_t *rule = (pn_rule_t *) object; pn_free(rule->pattern); pn_free(rule->substitution); } #define CID_pn_rule CID_pn_object #define pn_rule_initialize NULL #define pn_rule_hashcode NULL #define pn_rule_compare NULL #define pn_rule_inspect NULL pn_rule_t *pn_rule(const char *pattern, const char *substitution) { static const pn_class_t clazz = PN_CLASS(pn_rule); pn_rule_t *rule = (pn_rule_t *) pn_class_new(&clazz, sizeof(pn_rule_t)); rule->pattern = pn_string(pattern); rule->substitution = pn_string(substitution); return rule; } static void pn_transform_finalize(void *object) { pn_transform_t *transform = (pn_transform_t *) object; pn_free(transform->rules); } #define CID_pn_transform CID_pn_object #define pn_transform_initialize NULL #define pn_transform_hashcode NULL #define pn_transform_compare NULL #define pn_transform_inspect NULL pn_transform_t *pn_transform() { static const pn_class_t clazz = PN_CLASS(pn_transform); pn_transform_t *transform = (pn_transform_t *) pn_class_new(&clazz, sizeof(pn_transform_t)); transform->rules = pn_list(PN_OBJECT, 0); transform->matched = false; return transform; } void pn_transform_rule(pn_transform_t *transform, const char *pattern, const char *substitution) { assert(transform); pn_rule_t *rule = pn_rule(pattern, substitution); pn_list_add(transform->rules, rule); pn_decref(rule); } static void pni_sub(pn_matcher_t *matcher, size_t group, const char *text, size_t matched) { if (group > matcher->groups) { matcher->groups = group; } matcher->group[group].start = text - matched; matcher->group[group].size = matched; } static bool pni_match_r(pn_matcher_t *matcher, const char *pattern, const char *text, size_t group, size_t matched) { bool match; char p = *pattern; char c = *text; switch (p) { case '\0': return c == '\0'; case '%': case '*': switch (c) { case '\0': match = pni_match_r(matcher, pattern + 1, text, group + 1, 0); if (match) pni_sub(matcher, group, text, matched); return match; case '/': if (p == '%') { match = pni_match_r(matcher, pattern + 1, text, group + 1, 0); if (match) pni_sub(matcher, group, text, matched); return match; } // Fallthrough default: match = pni_match_r(matcher, pattern, text + 1, group, matched + 1); if (!match) { match = pni_match_r(matcher, pattern + 1, text, group + 1, 0); if (match) pni_sub(matcher, group, text, matched); } return match; } default: return c == p && pni_match_r(matcher, pattern + 1, text + 1, group, 0); } } static bool pni_match(pn_matcher_t *matcher, const char *pattern, const char *text) { text = text ? text : ""; matcher->groups = 0; if (pni_match_r(matcher, pattern, text, 1, 0)) { matcher->group[0].start = text; matcher->group[0].size = strlen(text); return true; } else { matcher->groups = 0; return false; } } static size_t pni_substitute(pn_matcher_t *matcher, const char *pattern, char *dest, size_t limit) { size_t result = 0; while (*pattern) { switch (*pattern) { case '$': pattern++; if (*pattern == '$') { if (result < limit) { *dest++ = *pattern; } pattern++; result++; } else { size_t idx = 0; while (isdigit(*pattern)) { idx *= 10; idx += *pattern++ - '0'; } if (idx <= matcher->groups) { pn_group_t *group = &matcher->group[idx]; for (size_t i = 0; i < group->size; i++) { if (result < limit) { *dest++ = group->start[i]; } result++; } } } break; default: if (result < limit) { *dest++ = *pattern; } pattern++; result++; break; } } if (result < limit) { *dest = '\0'; } return result; } int pn_transform_apply(pn_transform_t *transform, const char *src, pn_string_t *dst) { for (size_t i = 0; i < pn_list_size(transform->rules); i++) { pn_rule_t *rule = (pn_rule_t *) pn_list_get(transform->rules, i); if (pni_match(&transform->matcher, pn_string_get(rule->pattern), src)) { transform->matched = true; if (!pn_string_get(rule->substitution)) { return pn_string_set(dst, NULL); } while (true) { size_t capacity = pn_string_capacity(dst); size_t n = pni_substitute(&transform->matcher, pn_string_get(rule->substitution), pn_string_buffer(dst), capacity); int err = pn_string_resize(dst, n); if (err) return err; if (n <= capacity) { return 0; } } } } transform->matched = false; return pn_string_set(dst, src); } bool pn_transform_matched(pn_transform_t *transform) { return transform->matched; } int pn_transform_get_substitutions(pn_transform_t *transform, pn_list_t *substitutions) { int size = pn_list_size(transform->rules); for (size_t i = 0; i < (size_t)size; i++) { pn_rule_t *rule = (pn_rule_t *)pn_list_get(transform->rules, i); pn_list_add(substitutions, rule->substitution); } return size; } qpid-proton-0.22.0/proton-c/src/messenger/subscription.h0000664000000000000000000000236413257152177020173 0ustar #ifndef _PROTON_SUBSCRIPTION_H #define _PROTON_SUBSCRIPTION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include pn_subscription_t *pn_subscription(pn_messenger_t *messenger, const char *scheme, const char *host, const char *port); const char *pn_subscription_scheme(pn_subscription_t *sub); int pni_subscription_set_address(pn_subscription_t *sub, const char *address); #endif /* subscription.h */ qpid-proton-0.22.0/proton-c/src/messenger/subscription.c0000664000000000000000000000727413257152177020173 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include "messenger.h" struct pn_subscription_t { pn_messenger_t *messenger; pn_string_t *scheme; pn_string_t *host; pn_string_t *port; pn_string_t *address; void *context; }; void pn_subscription_initialize(void *obj) { pn_subscription_t *sub = (pn_subscription_t *) obj; sub->messenger = NULL; sub->scheme = pn_string(NULL); sub->host = pn_string(NULL); sub->port = pn_string(NULL); sub->address = pn_string(NULL); sub->context = NULL; } void pn_subscription_finalize(void *obj) { pn_subscription_t *sub = (pn_subscription_t *) obj; pn_free(sub->scheme); pn_free(sub->host); pn_free(sub->port); pn_free(sub->address); } #define CID_pn_subscription CID_pn_object #define pn_subscription_hashcode NULL #define pn_subscription_compare NULL #define pn_subscription_inspect NULL pn_subscription_t *pn_subscription(pn_messenger_t *messenger, const char *scheme, const char *host, const char *port) { static const pn_class_t clazz = PN_CLASS(pn_subscription); pn_subscription_t *sub = (pn_subscription_t *) pn_class_new(&clazz, sizeof(pn_subscription_t)); sub->messenger = messenger; pn_string_set(sub->scheme, scheme); pn_string_set(sub->host, host); pn_string_set(sub->port, port); pni_messenger_add_subscription(messenger, sub); pn_class_decref(PN_OBJECT, sub); return sub; } const char *pn_subscription_scheme(pn_subscription_t *sub) { assert(sub); return pn_string_get(sub->scheme); } void *pn_subscription_get_context(pn_subscription_t *sub) { assert(sub); return sub->context; } void pn_subscription_set_context(pn_subscription_t *sub, void *context) { assert(sub); sub->context = context; } int pni_subscription_set_address(pn_subscription_t *sub, const char *address) { assert(sub); if (!address) return 0; bool absolute = strncmp(address, "amqp:", 5) == 0; if (absolute) { return pn_string_set(sub->address, address); } else { pn_string_set(sub->address, ""); bool scheme = pn_string_get(sub->scheme); if (scheme) { int e = pn_string_addf(sub->address, "%s:", pn_string_get(sub->scheme)); if (e) return e; } if (pn_string_get(sub->host)) { int e = pn_string_addf(sub->address, scheme ? "//%s" : "%s", pn_string_get(sub->host)); if (e) return e; } if (pn_string_get(sub->port)) { int e = pn_string_addf(sub->address, ":%s", pn_string_get(sub->port)); if (e) return e; } return pn_string_addf(sub->address, "/%s", address); } } const char *pn_subscription_address(pn_subscription_t *sub) { assert(sub); while (!pn_string_get(sub->address)) { int err = pni_messenger_work(sub->messenger); if (err < 0) { return NULL; } } return pn_string_get(sub->address); } qpid-proton-0.22.0/proton-c/src/messenger/store.h0000664000000000000000000000410013257152177016571 0ustar #ifndef _PROTON_STORE_H #define _PROTON_STORE_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "core/buffer.h" typedef struct pni_store_t pni_store_t; typedef struct pni_entry_t pni_entry_t; pni_store_t *pni_store(void); void pni_store_free(pni_store_t *store); size_t pni_store_size(pni_store_t *store); pni_entry_t *pni_store_put(pni_store_t *store, const char *address); pni_entry_t *pni_store_get(pni_store_t *store, const char *address); pn_buffer_t *pni_entry_bytes(pni_entry_t *entry); pn_status_t pni_entry_get_status(pni_entry_t *entry); void pni_entry_set_status(pni_entry_t *entry, pn_status_t status); pn_delivery_t *pni_entry_get_delivery(pni_entry_t *entry); void pni_entry_set_delivery(pni_entry_t *entry, pn_delivery_t *delivery); void pni_entry_set_context(pni_entry_t *entry, void *context); void *pni_entry_get_context(pni_entry_t *entry); void pni_entry_updated(pni_entry_t *entry); void pni_entry_free(pni_entry_t *entry); pn_sequence_t pni_entry_track(pni_entry_t *entry); pni_entry_t *pni_store_entry(pni_store_t *store, pn_sequence_t id); int pni_store_update(pni_store_t *store, pn_sequence_t id, pn_status_t status, int flags, bool settle, bool match); int pni_store_get_window(pni_store_t *store); void pni_store_set_window(pni_store_t *store, int window); #endif /* store.h */ qpid-proton-0.22.0/proton-c/src/messenger/store.c0000664000000000000000000002304613257152177016576 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifndef __cplusplus #include #endif #include #include #include "core/util.h" #include "store.h" typedef struct pni_stream_t pni_stream_t; struct pni_store_t { pni_stream_t *streams; pni_entry_t *store_head; pni_entry_t *store_tail; pn_hash_t *tracked; size_t size; int window; pn_sequence_t lwm; pn_sequence_t hwm; }; struct pni_stream_t { pni_store_t *store; pn_string_t *address; pni_entry_t *stream_head; pni_entry_t *stream_tail; pni_stream_t *next; }; struct pni_entry_t { pni_stream_t *stream; pni_entry_t *stream_next; pni_entry_t *stream_prev; pni_entry_t *store_next; pni_entry_t *store_prev; pn_buffer_t *bytes; pn_delivery_t *delivery; void *context; pn_status_t status; pn_sequence_t id; bool free; }; void pni_entry_finalize(void *object) { pni_entry_t *entry = (pni_entry_t *) object; assert(entry->free); pn_delivery_t *d = entry->delivery; if (d) { pn_delivery_settle(d); pni_entry_set_delivery(entry, NULL); } } pni_store_t *pni_store() { pni_store_t *store = (pni_store_t *) malloc(sizeof(pni_store_t)); if (!store) return NULL; store->size = 0; store->streams = NULL; store->store_head = NULL; store->store_tail = NULL; store->window = 0; store->lwm = 0; store->hwm = 0; store->tracked = pn_hash(PN_OBJECT, 0, 0.75); return store; } size_t pni_store_size(pni_store_t *store) { assert(store); return store->size; } pni_stream_t *pni_stream(pni_store_t *store, const char *address, bool create) { assert(store); assert(address); pni_stream_t *prev = NULL; pni_stream_t *stream = store->streams; while (stream) { if (!strcmp(pn_string_get(stream->address), address)) { return stream; } prev = stream; stream = stream->next; } if (create) { stream = (pni_stream_t *) malloc(sizeof(pni_stream_t)); if (stream != NULL) { stream->store = store; stream->address = pn_string(address); stream->stream_head = NULL; stream->stream_tail = NULL; stream->next = NULL; if (prev) { prev->next = stream; } else { store->streams = stream; } } } return stream; } pni_stream_t *pni_stream_head(pni_store_t *store) { assert(store); return store->streams; } pni_stream_t *pni_stream_next(pni_stream_t *stream) { assert(stream); return stream->next; } void pni_entry_free(pni_entry_t *entry) { if (!entry) return; pni_stream_t *stream = entry->stream; pni_store_t *store = stream->store; LL_REMOVE(stream, stream, entry); LL_REMOVE(store, store, entry); entry->free = true; pn_buffer_free(entry->bytes); entry->bytes = NULL; pn_decref(entry); store->size--; } void pni_stream_free(pni_stream_t *stream) { if (!stream) return; pni_entry_t *entry; while ((entry = LL_HEAD(stream, stream))) { pni_entry_free(entry); } pn_free(stream->address); stream->address = NULL; free(stream); } void pni_store_free(pni_store_t *store) { if (!store) return; pn_free(store->tracked); pni_stream_t *stream = store->streams; while (stream) { pni_stream_t *next = stream->next; pni_stream_free(stream); stream = next; } free(store); } pni_stream_t *pni_stream_put(pni_store_t *store, const char *address) { assert(store); assert(address); return pni_stream(store, address, true); } pni_stream_t *pni_stream_get(pni_store_t *store, const char *address) { assert(store); assert(address); return pni_stream(store, address, false); } #define CID_pni_entry CID_pn_object #define pni_entry_initialize NULL #define pni_entry_hashcode NULL #define pni_entry_compare NULL #define pni_entry_inspect NULL pni_entry_t *pni_store_put(pni_store_t *store, const char *address) { assert(store); static const pn_class_t clazz = PN_CLASS(pni_entry); if (!address) address = ""; pni_stream_t *stream = pni_stream_put(store, address); if (!stream) return NULL; pni_entry_t *entry = (pni_entry_t *) pn_class_new(&clazz, sizeof(pni_entry_t)); if (!entry) return NULL; entry->stream = stream; entry->free = false; entry->stream_next = NULL; entry->stream_prev = NULL; entry->store_next = NULL; entry->store_prev = NULL; entry->delivery = NULL; entry->bytes = pn_buffer(64); entry->status = PN_STATUS_UNKNOWN; LL_ADD(stream, stream, entry); LL_ADD(store, store, entry); store->size++; return entry; } pni_entry_t *pni_store_get(pni_store_t *store, const char *address) { assert(store); if (address) { pni_stream_t *stream = pni_stream_get(store, address); if (!stream) return NULL; return LL_HEAD(stream, stream); } else { return LL_HEAD(store, store); } } pn_buffer_t *pni_entry_bytes(pni_entry_t *entry) { assert(entry); return entry->bytes; } pn_status_t pni_entry_get_status(pni_entry_t *entry) { assert(entry); return entry->status; } void pni_entry_set_status(pni_entry_t *entry, pn_status_t status) { assert(entry); entry->status = status; } pn_delivery_t *pni_entry_get_delivery(pni_entry_t *entry) { assert(entry); return entry->delivery; } void pni_entry_set_delivery(pni_entry_t *entry, pn_delivery_t *delivery) { assert(entry); if (entry->delivery) { pn_delivery_set_context(entry->delivery, NULL); } entry->delivery = delivery; if (delivery) { pn_delivery_set_context(delivery, entry); } pni_entry_updated(entry); } void pni_entry_set_context(pni_entry_t *entry, void *context) { assert(entry); entry->context = context; } void *pni_entry_get_context(pni_entry_t *entry) { assert(entry); return entry->context; } static pn_status_t disp2status(uint64_t disp) { if (!disp) return PN_STATUS_PENDING; switch (disp) { case PN_RECEIVED: return PN_STATUS_PENDING; case PN_ACCEPTED: return PN_STATUS_ACCEPTED; case PN_REJECTED: return PN_STATUS_REJECTED; case PN_RELEASED: return PN_STATUS_RELEASED; case PN_MODIFIED: return PN_STATUS_MODIFIED; default: assert(0); } return (pn_status_t) 0; } void pni_entry_updated(pni_entry_t *entry) { assert(entry); pn_delivery_t *d = entry->delivery; if (d) { if (pn_delivery_remote_state(d)) { entry->status = disp2status(pn_delivery_remote_state(d)); } else if (pn_delivery_settled(d)) { uint64_t disp = pn_delivery_local_state(d); if (disp) { entry->status = disp2status(disp); } else { entry->status = PN_STATUS_SETTLED; } } else { entry->status = PN_STATUS_PENDING; } } } pn_sequence_t pni_entry_id(pni_entry_t *entry) { assert(entry); return entry->id; } pni_entry_t *pni_store_entry(pni_store_t *store, pn_sequence_t id) { assert(store); return (pni_entry_t *) pn_hash_get(store->tracked, id); } bool pni_store_tracking(pni_store_t *store, pn_sequence_t id) { return (id - store->lwm >= 0) && (store->hwm - id > 0); } pn_sequence_t pni_entry_track(pni_entry_t *entry) { assert(entry); pni_store_t *store = entry->stream->store; entry->id = store->hwm++; pn_hash_put(store->tracked, entry->id, entry); if (store->window >= 0) { while (store->hwm - store->lwm > store->window) { pni_entry_t *e = pni_store_entry(store, store->lwm); if (e) { pn_hash_del(store->tracked, store->lwm); } store->lwm++; } } return entry->id; } int pni_store_update(pni_store_t *store, pn_sequence_t id, pn_status_t status, int flags, bool settle, bool match) { assert(store); if (!pni_store_tracking(store, id)) { return 0; } size_t start; if (PN_CUMULATIVE & flags) { start = store->lwm; } else { start = id; } for (pn_sequence_t i = start; i <= id; i++) { pni_entry_t *e = pni_store_entry(store, i); if (e) { pn_delivery_t *d = e->delivery; if (d) { if (!pn_delivery_local_state(d)) { if (match) { pn_delivery_update(d, pn_delivery_remote_state(d)); } else { switch (status) { case PN_STATUS_ACCEPTED: pn_delivery_update(d, PN_ACCEPTED); break; case PN_STATUS_REJECTED: pn_delivery_update(d, PN_REJECTED); break; default: break; } } pni_entry_updated(e); } } if (settle) { if (d) { pn_delivery_settle(d); } pn_hash_del(store->tracked, e->id); } } } while (store->hwm - store->lwm > 0 && !pn_hash_get(store->tracked, store->lwm)) { store->lwm++; } return 0; } int pni_store_get_window(pni_store_t *store) { assert(store); return store->window; } void pni_store_set_window(pni_store_t *store, int window) { assert(store); store->window = window; } qpid-proton-0.22.0/proton-c/src/messenger/messenger.h0000664000000000000000000000206613257152177017436 0ustar #ifndef _PROTON_MESSENGER_H #define _PROTON_MESSENGER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include int pni_messenger_add_subscription(pn_messenger_t *messenger, pn_subscription_t *subscription); int pni_messenger_work(pn_messenger_t *messenger); #endif /* messenger.h */ qpid-proton-0.22.0/proton-c/src/messenger/messenger.c0000664000000000000000000022416313257152177017435 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "core/log_private.h" #include "core/util.h" #include "platform/platform.h" // pn_i_getpid, pn_i_now, pni_snprintf #include "platform/platform_fmt.h" #include "store.h" #include "subscription.h" #include "transform.h" #include "reactor/io.h" #include "reactor/selectable.h" #include "reactor/selector.h" typedef struct pn_link_ctx_t pn_link_ctx_t; typedef struct { pn_string_t *text; bool passive; char *scheme; char *user; char *pass; char *host; char *port; char *name; } pn_address_t; // algorithm for granting credit to receivers typedef enum { // pn_messenger_recv( X ), where: LINK_CREDIT_EXPLICIT, // X > 0 LINK_CREDIT_AUTO, // X == -1 LINK_CREDIT_MANUAL // X == -2 } pn_link_credit_mode_t; struct pn_messenger_t { pn_address_t address; char *name; char *certificate; char *private_key; char *password; char *trusted_certificates; pn_io_t *io; pn_list_t *pending; // pending selectables pn_selectable_t *interruptor; pn_socket_t ctrl[2]; pn_list_t *listeners; pn_list_t *connections; pn_selector_t *selector; pn_collector_t *collector; pn_list_t *credited; pn_list_t *blocked; pn_timestamp_t next_drain; uint64_t next_tag; pni_store_t *outgoing; pni_store_t *incoming; pn_list_t *subscriptions; pn_subscription_t *incoming_subscription; pn_error_t *error; pn_transform_t *routes; pn_transform_t *rewrites; pn_tracker_t outgoing_tracker; pn_tracker_t incoming_tracker; pn_string_t *original; pn_string_t *rewritten; pn_string_t *domain; int timeout; int send_threshold; pn_link_credit_mode_t credit_mode; int credit_batch; // when LINK_CREDIT_AUTO int credit; // available int distributed; // credit int receivers; // # receiver links int draining; // # links in drain state int connection_error; int flags; int snd_settle_mode; /* pn_snd_settle_mode_t or -1 for unset */ pn_rcv_settle_mode_t rcv_settle_mode; pn_tracer_t tracer; pn_ssl_verify_mode_t ssl_peer_authentication_mode; bool blocking; bool passive; bool interrupted; bool worked; }; #define CTX_HEAD \ pn_messenger_t *messenger; \ pn_selectable_t *selectable; \ bool pending; typedef struct pn_ctx_t { CTX_HEAD } pn_ctx_t; typedef struct { CTX_HEAD char *host; char *port; pn_subscription_t *subscription; pn_ssl_domain_t *domain; } pn_listener_ctx_t; typedef struct { CTX_HEAD pn_connection_t *connection; char *address; char *scheme; char *user; char *pass; char *host; char *port; pn_listener_ctx_t *listener; } pn_connection_ctx_t; static pn_connection_ctx_t *pni_context(pn_selectable_t *sel) { assert(sel); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pni_selectable_get_context(sel); assert(ctx); return ctx; } static pn_transport_t *pni_transport(pn_selectable_t *sel) { return pn_connection_transport(pni_context(sel)->connection); } static ssize_t pni_connection_capacity(pn_selectable_t *sel) { pn_transport_t *transport = pni_transport(sel); ssize_t capacity = pn_transport_capacity(transport); if (capacity < 0) { if (pn_transport_closed(transport)) { pn_selectable_terminate(sel); } } return capacity; } bool pn_messenger_flow(pn_messenger_t *messenger); static ssize_t pni_connection_pending(pn_selectable_t *sel) { pn_connection_ctx_t *ctx = pni_context(sel); pn_messenger_flow(ctx->messenger); pn_transport_t *transport = pni_transport(sel); ssize_t pending = pn_transport_pending(transport); if (pending < 0) { if (pn_transport_closed(transport)) { pn_selectable_terminate(sel); } } return pending; } static pn_timestamp_t pni_connection_deadline(pn_selectable_t *sel) { pn_connection_ctx_t *ctx = pni_context(sel); return ctx->messenger->next_drain; } static void pni_connection_update(pn_selectable_t *sel) { ssize_t c = pni_connection_capacity(sel); pn_selectable_set_reading(sel, c > 0); ssize_t p = pni_connection_pending(sel); pn_selectable_set_writing(sel, p > 0); pn_selectable_set_deadline(sel, pni_connection_deadline(sel)); if (c < 0 && p < 0) { pn_selectable_terminate(sel); } } #include static void pn_error_report(const char *pfx, const char *error) { pn_logf("%s ERROR %s", pfx, error); } void pni_modified(pn_ctx_t *ctx) { pn_messenger_t *m = ctx->messenger; pn_selectable_t *sel = ctx->selectable; if (pn_selectable_is_registered(sel) && !ctx->pending) { pn_list_add(m->pending, sel); ctx->pending = true; } } void pni_conn_modified(pn_connection_ctx_t *ctx) { pni_connection_update(ctx->selectable); pni_modified((pn_ctx_t *) ctx); } void pni_lnr_modified(pn_listener_ctx_t *lnr) { pni_modified((pn_ctx_t *) lnr); } int pn_messenger_process_events(pn_messenger_t *messenger); static void pni_connection_error(pn_selectable_t *sel) { pn_transport_t *transport = pni_transport(sel); pn_transport_close_tail(transport); pn_transport_close_head(transport); } static void pni_connection_readable(pn_selectable_t *sel) { pn_connection_ctx_t *context = pni_context(sel); pn_messenger_t *messenger = context->messenger; pn_connection_t *connection = context->connection; pn_transport_t *transport = pni_transport(sel); ssize_t capacity = pn_transport_capacity(transport); if (capacity > 0) { ssize_t n = pn_recv(messenger->io, pn_selectable_get_fd(sel), pn_transport_tail(transport), capacity); if (n <= 0) { if (n == 0 || !pn_wouldblock(messenger->io)) { pn_transport_close_tail(transport); if (!(pn_connection_state(connection) & PN_REMOTE_CLOSED)) { pn_error_report("CONNECTION", "connection aborted (remote)"); } } } else { int err = pn_transport_process(transport, (size_t)n); if (err) pn_error_copy(messenger->error, pn_transport_error(transport)); } } pn_messenger_process_events(messenger); pn_messenger_flow(messenger); messenger->worked = true; pni_conn_modified(context); } static void pni_connection_writable(pn_selectable_t *sel) { pn_connection_ctx_t *context = pni_context(sel); pn_messenger_t *messenger = context->messenger; pn_transport_t *transport = pni_transport(sel); ssize_t pending = pn_transport_pending(transport); if (pending > 0) { ssize_t n = pn_send(messenger->io, pn_selectable_get_fd(sel), pn_transport_head(transport), pending); if (n < 0) { if (!pn_wouldblock(messenger->io)) { pn_transport_close_head(transport); } } else { pn_transport_pop(transport, n); } } pn_messenger_process_events(messenger); pn_messenger_flow(messenger); messenger->worked = true; pni_conn_modified(context); } static void pni_connection_expired(pn_selectable_t *sel) { pn_connection_ctx_t *ctx = pni_context(sel); pn_messenger_flow(ctx->messenger); ctx->messenger->worked = true; pni_conn_modified(ctx); } static void pni_messenger_reclaim(pn_messenger_t *messenger, pn_connection_t *conn); static void pni_connection_finalize(pn_selectable_t *sel) { pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pni_selectable_get_context(sel); pn_socket_t fd = pn_selectable_get_fd(sel); pn_close(ctx->messenger->io, fd); pn_list_remove(ctx->messenger->pending, sel); pni_messenger_reclaim(ctx->messenger, ctx->connection); } pn_connection_t *pn_messenger_connection(pn_messenger_t *messenger, pn_socket_t sock, const char *scheme, char *user, char *pass, char *host, char *port, pn_listener_ctx_t *lnr); static void pni_listener_readable(pn_selectable_t *sel) { pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pni_selectable_get_context(sel); pn_subscription_t *sub = ctx->subscription; const char *scheme = pn_subscription_scheme(sub); char name[1024]; pn_socket_t sock = pn_accept(ctx->messenger->io, pn_selectable_get_fd(sel), name, 1024); pn_transport_t *t = pn_transport(); pn_transport_set_server(t); if (ctx->messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS) { pn_sasl_t *s = pn_sasl(t); pn_sasl_set_allow_insecure_mechs(s, true); } pn_ssl_t *ssl = pn_ssl(t); pn_ssl_init(ssl, ctx->domain, NULL); pn_connection_t *conn = pn_messenger_connection(ctx->messenger, sock, scheme, NULL, NULL, NULL, NULL, ctx); pn_transport_bind(t, conn); pn_decref(t); pni_conn_modified((pn_connection_ctx_t *) pn_connection_get_context(conn)); } static void pn_listener_ctx_free(pn_messenger_t *messenger, pn_listener_ctx_t *ctx); static void pni_listener_finalize(pn_selectable_t *sel) { pn_listener_ctx_t *lnr = (pn_listener_ctx_t *) pni_selectable_get_context(sel); pn_messenger_t *messenger = lnr->messenger; pn_close(messenger->io, pn_selectable_get_fd(sel)); pn_list_remove(messenger->pending, sel); pn_listener_ctx_free(messenger, lnr); } static bool pn_streq(const char *a, const char *b) { return a == b || (a && b && !strcmp(a, b)); } static const char *default_port(const char *scheme) { if (scheme && pn_streq(scheme, "amqps")) return "5671"; else return "5672"; } static pn_listener_ctx_t *pn_listener_ctx(pn_messenger_t *messenger, const char *scheme, const char *host, const char *port) { pn_socket_t socket = pn_listen(messenger->io, host, port ? port : default_port(scheme)); if (socket == PN_INVALID_SOCKET) { pn_error_copy(messenger->error, pn_io_error(messenger->io)); pn_error_format(messenger->error, PN_ERR, "CONNECTION ERROR (%s:%s): %s\n", messenger->address.host, messenger->address.port, pn_error_text(messenger->error)); return NULL; } pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pn_class_new(PN_OBJECT, sizeof(pn_listener_ctx_t)); ctx->messenger = messenger; ctx->domain = pn_ssl_domain(PN_SSL_MODE_SERVER); if (messenger->certificate) { int err = pn_ssl_domain_set_credentials(ctx->domain, messenger->certificate, messenger->private_key, messenger->password); if (err) { pn_error_format(messenger->error, PN_ERR, "invalid credentials"); pn_ssl_domain_free(ctx->domain); pn_free(ctx); pn_close(messenger->io, socket); return NULL; } } if (!(scheme && !strcmp(scheme, "amqps"))) { pn_ssl_domain_allow_unsecured_client(ctx->domain); } pn_subscription_t *sub = pn_subscription(messenger, scheme, host, port); ctx->subscription = sub; ctx->host = pn_strdup(host); ctx->port = pn_strdup(port); pn_selectable_t *selectable = pn_selectable(); pn_selectable_set_reading(selectable, true); pn_selectable_on_readable(selectable, pni_listener_readable); pn_selectable_on_release(selectable, pn_selectable_free); pn_selectable_on_finalize(selectable, pni_listener_finalize); pn_selectable_set_fd(selectable, socket); pni_selectable_set_context(selectable, ctx); pn_list_add(messenger->pending, selectable); ctx->selectable = selectable; ctx->pending = true; pn_list_add(messenger->listeners, ctx); return ctx; } static void pn_listener_ctx_free(pn_messenger_t *messenger, pn_listener_ctx_t *ctx) { pn_list_remove(messenger->listeners, ctx); // XXX: subscriptions are freed when the messenger is freed pn_subscription_free(ctx->subscription); free(ctx->host); free(ctx->port); pn_ssl_domain_free(ctx->domain); pn_free(ctx); } static pn_connection_ctx_t *pn_connection_ctx(pn_messenger_t *messenger, pn_connection_t *conn, pn_socket_t sock, const char *scheme, const char *user, const char *pass, const char *host, const char *port, pn_listener_ctx_t *lnr) { pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn); assert(!ctx); ctx = (pn_connection_ctx_t *) malloc(sizeof(pn_connection_ctx_t)); ctx->messenger = messenger; ctx->connection = conn; pn_selectable_t *sel = pn_selectable(); ctx->selectable = sel; pn_selectable_on_error(sel, pni_connection_error); pn_selectable_on_readable(sel, pni_connection_readable); pn_selectable_on_writable(sel, pni_connection_writable); pn_selectable_on_expired(sel, pni_connection_expired); pn_selectable_on_release(sel, pn_selectable_free); pn_selectable_on_finalize(sel, pni_connection_finalize); pn_selectable_set_fd(ctx->selectable, sock); pni_selectable_set_context(ctx->selectable, ctx); pn_list_add(messenger->pending, ctx->selectable); ctx->pending = true; ctx->scheme = pn_strdup(scheme); ctx->user = pn_strdup(user); ctx->pass = pn_strdup(pass); ctx->host = pn_strdup(host); ctx->port = pn_strdup(port); ctx->listener = lnr; pn_connection_set_context(conn, ctx); return ctx; } static void pn_connection_ctx_free(pn_connection_t *conn) { pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn); if (ctx) { pni_selectable_set_context(ctx->selectable, NULL); free(ctx->scheme); free(ctx->user); free(ctx->pass); free(ctx->host); free(ctx->port); free(ctx); pn_connection_set_context(conn, NULL); } } #define OUTGOING (0x0000000000000000) #define INCOMING (0x1000000000000000) #define pn_tracker(direction, sequence) ((direction) | (sequence)) #define pn_tracker_direction(tracker) ((tracker) & (0x1000000000000000)) #define pn_tracker_sequence(tracker) ((pn_sequence_t) ((tracker) & (0x00000000FFFFFFFF))) static char *build_name(const char *name) { static bool seeded = false; // UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hypens) static const char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X"; int count = 0; char *generated; uint8_t bytes[16]; unsigned int r = 0; if (name) { return pn_strdup(name); } if (!seeded) { int pid = pn_i_getpid(); int nowish = (int)pn_i_now(); // the lower bits of time are the most random, shift pid to push some // randomness into the higher order bits srand(nowish ^ (pid<<16)); seeded = true; } while (count < 16) { if (!r) { r = (unsigned int) rand(); } bytes[count] = r & 0xFF; r >>= 8; count++; } // From RFC4122, the version bits are set to 0100 bytes[6] = (bytes[6] & 0x0F) | 0x40; // From RFC4122, the top two bits of byte 8 get set to 01 bytes[8] = (bytes[8] & 0x3F) | 0x80; generated = (char *) malloc(37*sizeof(char)); sprintf(generated, uuid_fmt, bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15]); return generated; } struct pn_link_ctx_t { pn_subscription_t *subscription; }; // compute the maximum amount of credit each receiving link is // entitled to. The actual credit given to the link depends on what // amount of credit is actually available. static int per_link_credit( pn_messenger_t *messenger ) { if (messenger->receivers == 0) return 0; int total = messenger->credit + messenger->distributed; return pn_max(total/messenger->receivers, 1); } static void link_ctx_setup( pn_messenger_t *messenger, pn_connection_t *connection, pn_link_t *link ) { if (pn_link_is_receiver(link)) { messenger->receivers++; pn_link_ctx_t *ctx = (pn_link_ctx_t *) calloc(1, sizeof(pn_link_ctx_t)); assert( ctx ); assert( !pn_link_get_context(link) ); pn_link_set_context( link, ctx ); pn_list_add(messenger->blocked, link); } } static void link_ctx_release( pn_messenger_t *messenger, pn_link_t *link ) { if (pn_link_is_receiver(link)) { pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( link ); if (!ctx) return; assert( messenger->receivers > 0 ); messenger->receivers--; if (pn_link_get_drain(link)) { pn_link_set_drain(link, false); assert( messenger->draining > 0 ); messenger->draining--; } pn_list_remove(messenger->credited, link); pn_list_remove(messenger->blocked, link); pn_link_set_context( link, NULL ); free( ctx ); } } static void pni_interruptor_readable(pn_selectable_t *sel) { pn_messenger_t *messenger = (pn_messenger_t *) pni_selectable_get_context(sel); char buf[1024]; pn_read(messenger->io, pn_selectable_get_fd(sel), buf, 1024); messenger->interrupted = true; } static void pni_interruptor_finalize(pn_selectable_t *sel) { pn_messenger_t *messenger = (pn_messenger_t *) pni_selectable_get_context(sel); messenger->interruptor = NULL; } pn_messenger_t *pn_messenger(const char *name) { pn_messenger_t *m = (pn_messenger_t *) malloc(sizeof(pn_messenger_t)); if (m) { m->name = build_name(name); m->certificate = NULL; m->private_key = NULL; m->password = NULL; m->trusted_certificates = NULL; m->timeout = -1; m->blocking = true; m->passive = false; m->io = pn_io(); m->pending = pn_list(PN_WEAKREF, 0); m->interruptor = pn_selectable(); pn_selectable_set_reading(m->interruptor, true); pn_selectable_on_readable(m->interruptor, pni_interruptor_readable); pn_selectable_on_release(m->interruptor, pn_selectable_free); pn_selectable_on_finalize(m->interruptor, pni_interruptor_finalize); pn_list_add(m->pending, m->interruptor); m->interrupted = false; // Explicitly initialise pipe file descriptors to invalid values in case pipe // fails, if we don't do this m->ctrl[0] could default to 0 - which is stdin. m->ctrl[0] = -1; m->ctrl[1] = -1; pn_pipe(m->io, m->ctrl); pn_selectable_set_fd(m->interruptor, m->ctrl[0]); pni_selectable_set_context(m->interruptor, m); m->listeners = pn_list(PN_WEAKREF, 0); m->connections = pn_list(PN_WEAKREF, 0); m->selector = pn_io_selector(m->io); m->collector = pn_collector(); m->credit_mode = LINK_CREDIT_EXPLICIT; m->credit_batch = 1024; m->credit = 0; m->distributed = 0; m->receivers = 0; m->draining = 0; m->credited = pn_list(PN_WEAKREF, 0); m->blocked = pn_list(PN_WEAKREF, 0); m->next_drain = 0; m->next_tag = 0; m->outgoing = pni_store(); m->incoming = pni_store(); m->subscriptions = pn_list(PN_OBJECT, 0); m->incoming_subscription = NULL; m->error = pn_error(); m->routes = pn_transform(); m->rewrites = pn_transform(); m->outgoing_tracker = 0; m->incoming_tracker = 0; m->address.text = pn_string(NULL); m->original = pn_string(NULL); m->rewritten = pn_string(NULL); m->domain = pn_string(NULL); m->connection_error = 0; m->flags = PN_FLAGS_ALLOW_INSECURE_MECHS; // TODO: Change this back to 0 for the Proton 0.11 release m->snd_settle_mode = -1; /* Default depends on sender/receiver */ m->rcv_settle_mode = PN_RCV_FIRST; m->tracer = NULL; m->ssl_peer_authentication_mode = PN_SSL_VERIFY_PEER_NAME; } return m; } int pni_messenger_add_subscription(pn_messenger_t *messenger, pn_subscription_t *subscription) { return pn_list_add(messenger->subscriptions, subscription); } const char *pn_messenger_name(pn_messenger_t *messenger) { return messenger->name; } int pn_messenger_set_certificate(pn_messenger_t *messenger, const char *certificate) { if (messenger->certificate) free(messenger->certificate); messenger->certificate = pn_strdup(certificate); return 0; } const char *pn_messenger_get_certificate(pn_messenger_t *messenger) { return messenger->certificate; } int pn_messenger_set_private_key(pn_messenger_t *messenger, const char *private_key) { if (messenger->private_key) free(messenger->private_key); messenger->private_key = pn_strdup(private_key); return 0; } const char *pn_messenger_get_private_key(pn_messenger_t *messenger) { return messenger->private_key; } int pn_messenger_set_password(pn_messenger_t *messenger, const char *password) { if (messenger->password) free(messenger->password); messenger->password = pn_strdup(password); return 0; } const char *pn_messenger_get_password(pn_messenger_t *messenger) { return messenger->password; } int pn_messenger_set_trusted_certificates(pn_messenger_t *messenger, const char *trusted_certificates) { if (messenger->trusted_certificates) free(messenger->trusted_certificates); messenger->trusted_certificates = pn_strdup(trusted_certificates); return 0; } const char *pn_messenger_get_trusted_certificates(pn_messenger_t *messenger) { return messenger->trusted_certificates; } int pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout) { if (!messenger) return PN_ARG_ERR; messenger->timeout = timeout; return 0; } int pn_messenger_get_timeout(pn_messenger_t *messenger) { return messenger ? messenger->timeout : 0; } bool pn_messenger_is_blocking(pn_messenger_t *messenger) { assert(messenger); return messenger->blocking; } int pn_messenger_set_blocking(pn_messenger_t *messenger, bool blocking) { messenger->blocking = blocking; return 0; } bool pn_messenger_is_passive(pn_messenger_t *messenger) { assert(messenger); return messenger->passive; } int pn_messenger_set_passive(pn_messenger_t *messenger, bool passive) { messenger->passive = passive; return 0; } pn_selectable_t *pn_messenger_selectable(pn_messenger_t *messenger) { assert(messenger); pn_messenger_process_events(messenger); pn_list_t *p = messenger->pending; size_t n = pn_list_size(p); if (n) { pn_selectable_t *s = (pn_selectable_t *) pn_list_get(p, n - 1); pn_list_del(p, n-1, 1); // this is a total hack, messenger has selectables whose context // are the messenger itself and whose context share a common // prefix that is described by pn_ctx_t void *c = pni_selectable_get_context(s); if (c != messenger) { pn_ctx_t *ctx = (pn_ctx_t *) c; ctx->pending = false; } return s; } else { return NULL; } } static void pni_reclaim(pn_messenger_t *messenger) { while (pn_list_size(messenger->listeners)) { pn_listener_ctx_t *l = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, 0); pn_listener_ctx_free(messenger, l); } while (pn_list_size(messenger->connections)) { pn_connection_t *c = (pn_connection_t *) pn_list_get(messenger->connections, 0); pni_messenger_reclaim(messenger, c); } } void pn_messenger_free(pn_messenger_t *messenger) { if (messenger) { pn_free(messenger->domain); pn_free(messenger->rewritten); pn_free(messenger->original); pn_free(messenger->address.text); free(messenger->name); free(messenger->certificate); free(messenger->private_key); free(messenger->password); free(messenger->trusted_certificates); pni_reclaim(messenger); pn_free(messenger->pending); pn_selectable_free(messenger->interruptor); pn_close(messenger->io, messenger->ctrl[0]); pn_close(messenger->io, messenger->ctrl[1]); pn_free(messenger->listeners); pn_free(messenger->connections); pn_selector_free(messenger->selector); pn_collector_free(messenger->collector); pn_error_free(messenger->error); pni_store_free(messenger->incoming); pni_store_free(messenger->outgoing); pn_free(messenger->subscriptions); pn_free(messenger->rewrites); pn_free(messenger->routes); pn_free(messenger->credited); pn_free(messenger->blocked); pn_free(messenger->io); free(messenger); } } int pn_messenger_errno(pn_messenger_t *messenger) { if (messenger) { return pn_error_code(messenger->error); } else { return PN_ARG_ERR; } } pn_error_t *pn_messenger_error(pn_messenger_t *messenger) { assert(messenger); return messenger->error; } // Run the credit scheduler, grant flow as needed. Return True if // credit allocation for any link has changed. bool pn_messenger_flow(pn_messenger_t *messenger) { bool updated = false; if (messenger->receivers == 0) { messenger->next_drain = 0; return updated; } if (messenger->credit_mode == LINK_CREDIT_AUTO) { // replenish, but limit the max total messages buffered const int max = messenger->receivers * messenger->credit_batch; const int used = messenger->distributed + pn_messenger_incoming(messenger); if (max > used) messenger->credit = max - used; } else if (messenger->credit_mode == LINK_CREDIT_MANUAL) { messenger->next_drain = 0; return false; } const int batch = per_link_credit(messenger); while (messenger->credit > 0 && pn_list_size(messenger->blocked)) { pn_link_t *link = (pn_link_t *) pn_list_get(messenger->blocked, 0); pn_list_del(messenger->blocked, 0, 1); const int more = pn_min( messenger->credit, batch ); messenger->distributed += more; messenger->credit -= more; pn_link_flow(link, more); pn_list_add(messenger->credited, link); updated = true; } if (!pn_list_size(messenger->blocked)) { messenger->next_drain = 0; } else { // not enough credit for all links if (!messenger->draining) { pn_logf("%s: let's drain", messenger->name); if (messenger->next_drain == 0) { messenger->next_drain = pn_i_now() + 250; pn_logf("%s: initializing next_drain", messenger->name); } else if (messenger->next_drain <= pn_i_now()) { // initiate drain, free up at most enough to satisfy blocked messenger->next_drain = 0; int needed = pn_list_size(messenger->blocked) * batch; for (size_t i = 0; i < pn_list_size(messenger->credited); i++) { pn_link_t *link = (pn_link_t *) pn_list_get(messenger->credited, i); if (!pn_link_get_drain(link)) { pn_link_set_drain(link, true); needed -= pn_link_remote_credit(link); messenger->draining++; updated = true; } if (needed <= 0) { break; } } } else { pn_logf("%s: delaying", messenger->name); } } } return updated; } static int pn_transport_config(pn_messenger_t *messenger, pn_connection_t *connection) { pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection); pn_transport_t *transport = pn_connection_transport(connection); if (messenger->tracer) pn_transport_set_tracer(transport, messenger->tracer); if (ctx->scheme && !strcmp(ctx->scheme, "amqps")) { pn_ssl_domain_t *d = pn_ssl_domain(PN_SSL_MODE_CLIENT); if (messenger->certificate) { int err = pn_ssl_domain_set_credentials( d, messenger->certificate, messenger->private_key, messenger->password); if (err) { pn_ssl_domain_free(d); pn_error_report("CONNECTION", "invalid credentials"); return err; } } if (messenger->trusted_certificates) { int err = pn_ssl_domain_set_trusted_ca_db(d, messenger->trusted_certificates); if (err) { pn_ssl_domain_free(d); pn_error_report("CONNECTION", "invalid certificate db"); return err; } err = pn_ssl_domain_set_peer_authentication( d, messenger->ssl_peer_authentication_mode, NULL); if (err) { pn_ssl_domain_free(d); pn_error_report("CONNECTION", "error configuring ssl to verify peer"); } } else { int err = pn_ssl_domain_set_peer_authentication(d, PN_SSL_ANONYMOUS_PEER, NULL); if (err) { pn_ssl_domain_free(d); pn_error_report("CONNECTION", "error configuring ssl for anonymous peer"); return err; } } pn_ssl_t *ssl = pn_ssl(transport); pn_ssl_init(ssl, d, NULL); pn_ssl_domain_free( d ); } return 0; } static void pn_condition_report(const char *pfx, pn_condition_t *condition) { if (pn_condition_is_redirect(condition)) { pn_logf("%s NOTICE (%s) redirecting to %s:%i", pfx, pn_condition_get_name(condition), pn_condition_redirect_host(condition), pn_condition_redirect_port(condition)); } else if (pn_condition_is_set(condition)) { char error[1024]; pni_snprintf(error, 1024, "(%s) %s", pn_condition_get_name(condition), pn_condition_get_description(condition)); pn_error_report(pfx, error); } } int pni_pump_in(pn_messenger_t *messenger, const char *address, pn_link_t *receiver) { pn_delivery_t *d = pn_link_current(receiver); if (!pn_delivery_readable(d) || pn_delivery_partial(d)) { return 0; } pni_entry_t *entry = pni_store_put(messenger->incoming, address); pn_buffer_t *buf = pni_entry_bytes(entry); pni_entry_set_delivery(entry, d); pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( receiver ); pni_entry_set_context(entry, ctx ? ctx->subscription : NULL); size_t pending = pn_delivery_pending(d); int err = pn_buffer_ensure(buf, pending + 1); if (err) return pn_error_format(messenger->error, err, "get: error growing buffer"); char *encoded = pn_buffer_memory(buf).start; ssize_t n = pn_link_recv(receiver, encoded, pending); if (n != (ssize_t) pending) { return pn_error_format(messenger->error, n, "didn't receive pending bytes: %" PN_ZI " %" PN_ZI, n, pending); } n = pn_link_recv(receiver, encoded + pending, 1); pn_link_advance(receiver); pn_link_t *link = receiver; if (messenger->credit_mode != LINK_CREDIT_MANUAL) { // account for the used credit assert(ctx); assert(messenger->distributed); messenger->distributed--; // replenish if low (< 20% maximum batch) and credit available if (!pn_link_get_drain(link) && pn_list_size(messenger->blocked) == 0 && messenger->credit > 0) { const int max = per_link_credit(messenger); const int lo_thresh = (int)(max * 0.2 + 0.5); if (pn_link_remote_credit(link) < lo_thresh) { const int more = pn_min(messenger->credit, max - pn_link_remote_credit(link)); messenger->credit -= more; messenger->distributed += more; pn_link_flow(link, more); } } // check if blocked if (pn_list_index(messenger->blocked, link) < 0 && pn_link_remote_credit(link) == 0) { pn_list_remove(messenger->credited, link); if (pn_link_get_drain(link)) { pn_link_set_drain(link, false); assert(messenger->draining > 0); messenger->draining--; } pn_list_add(messenger->blocked, link); } } if (n != PN_EOS) { return pn_error_format(messenger->error, n, "PN_EOS expected"); } pn_buffer_append(buf, encoded, pending); // XXX return 0; } void pni_messenger_reclaim_link(pn_messenger_t *messenger, pn_link_t *link) { if (pn_link_is_receiver(link) && pn_link_credit(link) > 0) { int credit = pn_link_credit(link); messenger->credit += credit; messenger->distributed -= credit; } pn_delivery_t *d = pn_unsettled_head(link); while (d) { pni_entry_t *e = (pni_entry_t *) pn_delivery_get_context(d); if (e) { pni_entry_set_delivery(e, NULL); if (pn_delivery_buffered(d)) { pni_entry_set_status(e, PN_STATUS_ABORTED); } } d = pn_unsettled_next(d); } link_ctx_release(messenger, link); } void pni_messenger_reclaim(pn_messenger_t *messenger, pn_connection_t *conn) { if (!conn) return; pn_link_t *link = pn_link_head(conn, 0); while (link) { pni_messenger_reclaim_link(messenger, link); link = pn_link_next(link, 0); } pn_list_remove(messenger->connections, conn); pn_connection_ctx_free(conn); pn_transport_free(pn_connection_transport(conn)); pn_connection_free(conn); } pn_connection_t *pn_messenger_connection(pn_messenger_t *messenger, pn_socket_t sock, const char *scheme, char *user, char *pass, char *host, char *port, pn_listener_ctx_t *lnr) { pn_connection_t *connection = pn_connection(); if (!connection) return NULL; pn_connection_collect(connection, messenger->collector); pn_connection_ctx(messenger, connection, sock, scheme, user, pass, host, port, lnr); pn_connection_set_container(connection, messenger->name); pn_connection_set_hostname(connection, host); pn_connection_set_user(connection, user); pn_connection_set_password(connection, pass); pn_list_add(messenger->connections, connection); return connection; } void pn_messenger_process_connection(pn_messenger_t *messenger, pn_event_t *event) { pn_connection_t *conn = pn_event_connection(event); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn); if (pn_connection_state(conn) & PN_LOCAL_UNINIT) { pn_connection_open(conn); } if (pn_connection_state(conn) == (PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED)) { pn_condition_t *condition = pn_connection_remote_condition(conn); pn_condition_report("CONNECTION", condition); pn_connection_close(conn); if (pn_condition_is_redirect(condition)) { const char *host = pn_condition_redirect_host(condition); char buf[1024]; sprintf(buf, "%i", pn_condition_redirect_port(condition)); pn_close(messenger->io, pn_selectable_get_fd(ctx->selectable)); pn_socket_t sock = pn_connect(messenger->io, host, buf); pn_selectable_set_fd(ctx->selectable, sock); pn_transport_unbind(pn_connection_transport(conn)); pn_connection_reset(conn); pn_transport_t *t = pn_transport(); if (messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS && messenger->address.user && messenger->address.pass) { pn_sasl_t *s = pn_sasl(t); pn_sasl_set_allow_insecure_mechs(s, true); } pn_transport_bind(t, conn); pn_decref(t); pn_transport_config(messenger, conn); } } } void pn_messenger_process_session(pn_messenger_t *messenger, pn_event_t *event) { pn_session_t *ssn = pn_event_session(event); if (pn_session_state(ssn) & PN_LOCAL_UNINIT) { pn_session_open(ssn); } if (pn_session_state(ssn) == (PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED)) { pn_session_close(ssn); } } void pn_messenger_process_link(pn_messenger_t *messenger, pn_event_t *event) { pn_link_t *link = pn_event_link(event); pn_connection_t *conn = pn_event_connection(event); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn); if (pn_link_state(link) & PN_LOCAL_UNINIT) { pn_terminus_copy(pn_link_source(link), pn_link_remote_source(link)); pn_terminus_copy(pn_link_target(link), pn_link_remote_target(link)); link_ctx_setup( messenger, conn, link ); pn_link_open(link); if (pn_link_is_receiver(link)) { pn_listener_ctx_t *lnr = ctx->listener; ((pn_link_ctx_t *)pn_link_get_context(link))->subscription = lnr ? lnr->subscription : NULL; } } if (pn_link_state(link) & PN_REMOTE_ACTIVE) { pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context(link); if (ctx) { const char *addr = pn_terminus_get_address(pn_link_remote_source(link)); if (ctx->subscription) { pni_subscription_set_address(ctx->subscription, addr); } } } if (pn_link_state(link) & PN_REMOTE_CLOSED) { if (PN_LOCAL_ACTIVE & pn_link_state(link)) { pn_condition_report("LINK", pn_link_remote_condition(link)); pn_link_close(link); pni_messenger_reclaim_link(messenger, link); pn_link_free(link); } } } int pni_pump_out(pn_messenger_t *messenger, const char *address, pn_link_t *sender); void pn_messenger_process_flow(pn_messenger_t *messenger, pn_event_t *event) { pn_link_t *link = pn_event_link(event); if (pn_link_is_sender(link)) { pni_pump_out(messenger, pn_terminus_get_address(pn_link_target(link)), link); } else { // account for any credit left over after draining links has completed if (pn_link_get_drain(link)) { if (!pn_link_draining(link)) { // drain completed! int drained = pn_link_drained(link); messenger->distributed -= drained; messenger->credit += drained; pn_link_set_drain(link, false); messenger->draining--; pn_list_remove(messenger->credited, link); pn_list_add(messenger->blocked, link); } } } } void pn_messenger_process_delivery(pn_messenger_t *messenger, pn_event_t *event) { pn_delivery_t *d = pn_event_delivery(event); pn_link_t *link = pn_event_link(event); if (pn_delivery_updated(d)) { if (pn_link_is_sender(link)) { pn_delivery_update(d, pn_delivery_remote_state(d)); } pni_entry_t *e = (pni_entry_t *) pn_delivery_get_context(d); if (e) pni_entry_updated(e); } pn_delivery_clear(d); if (pn_delivery_readable(d)) { int err = pni_pump_in(messenger, pn_terminus_get_address(pn_link_source(link)), link); if (err) { pn_logf("%s", pn_error_text(messenger->error)); } } } void pn_messenger_process_transport(pn_messenger_t *messenger, pn_event_t *event) { pn_connection_t *conn = pn_event_connection(event); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn); if (ctx) { pni_conn_modified(ctx); } } int pn_messenger_process_events(pn_messenger_t *messenger) { int processed = 0; pn_event_t *event; while ((event = pn_collector_peek(messenger->collector))) { processed++; switch (pn_event_type(event)) { case PN_CONNECTION_INIT: pn_logf("connection created: %p", (void *) pn_event_connection(event)); break; case PN_SESSION_INIT: pn_logf("session created: %p", (void *) pn_event_session(event)); break; case PN_LINK_INIT: pn_logf("link created: %p", (void *) pn_event_link(event)); break; case PN_CONNECTION_REMOTE_OPEN: case PN_CONNECTION_REMOTE_CLOSE: case PN_CONNECTION_LOCAL_OPEN: case PN_CONNECTION_LOCAL_CLOSE: pn_messenger_process_connection(messenger, event); break; case PN_SESSION_REMOTE_OPEN: case PN_SESSION_REMOTE_CLOSE: case PN_SESSION_LOCAL_OPEN: case PN_SESSION_LOCAL_CLOSE: pn_messenger_process_session(messenger, event); break; case PN_LINK_REMOTE_OPEN: case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: case PN_LINK_LOCAL_OPEN: case PN_LINK_LOCAL_CLOSE: case PN_LINK_LOCAL_DETACH: pn_messenger_process_link(messenger, event); break; case PN_LINK_FLOW: pn_messenger_process_flow(messenger, event); break; case PN_DELIVERY: pn_messenger_process_delivery(messenger, event); break; case PN_TRANSPORT: case PN_TRANSPORT_ERROR: case PN_TRANSPORT_HEAD_CLOSED: case PN_TRANSPORT_TAIL_CLOSED: case PN_TRANSPORT_CLOSED: pn_messenger_process_transport(messenger, event); break; case PN_EVENT_NONE: break; case PN_CONNECTION_BOUND: break; case PN_CONNECTION_UNBOUND: break; case PN_CONNECTION_FINAL: break; case PN_SESSION_FINAL: break; case PN_LINK_FINAL: break; default: break; } pn_collector_pop(messenger->collector); } return processed; } /** * Function to invoke AMQP related timer events, such as a heartbeat to prevent * remote_idle timeout events */ static void pni_messenger_tick(pn_messenger_t *messenger) { for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *connection = (pn_connection_t *)pn_list_get(messenger->connections, i); pn_transport_t *transport = pn_connection_transport(connection); if (transport) { pn_transport_tick(transport, pn_i_now()); // if there is pending data, such as an empty heartbeat frame, call // process events. This should kick off the chain of selectables for // reading/writing. ssize_t pending = pn_transport_pending(transport); if (pending > 0) { pn_connection_ctx_t *cctx = (pn_connection_ctx_t *)pn_connection_get_context(connection); pn_messenger_process_events(messenger); pn_messenger_flow(messenger); pni_conn_modified(pni_context(cctx->selectable)); } } } } int pn_messenger_process(pn_messenger_t *messenger) { bool doMessengerTick = true; pn_selectable_t *sel; int events; while ((sel = pn_selector_next(messenger->selector, &events))) { if (events & PN_READABLE) { pn_selectable_readable(sel); } if (events & PN_WRITABLE) { pn_selectable_writable(sel); doMessengerTick = false; } if (events & PN_EXPIRED) { pn_selectable_expired(sel); } if (events & PN_ERROR) { pn_selectable_error(sel); } } // ensure timer events are processed. Cannot call this inside the while loop // as the timer events are not seen by the selector if (doMessengerTick) { pni_messenger_tick(messenger); } if (messenger->interrupted) { messenger->interrupted = false; return PN_INTR; } else { return 0; } } pn_timestamp_t pn_messenger_deadline(pn_messenger_t *messenger) { // If the scheduler detects credit imbalance on the links, wake up // in time to service credit drain return messenger->next_drain; } int pni_wait(pn_messenger_t *messenger, int timeout) { bool wake = false; pn_selectable_t *sel; while ((sel = pn_messenger_selectable(messenger))) { if (pn_selectable_is_terminal(sel)) { if (pn_selectable_is_registered(sel)) { pn_selector_remove(messenger->selector, sel); } pn_selectable_free(sel); // we can't wait if we end up freeing anything because we could // be waiting on the stopped predicate which might become true // as a result of the free wake = true; } else if (pn_selectable_is_registered(sel)) { pn_selector_update(messenger->selector, sel); } else { pn_selector_add(messenger->selector, sel); pn_selectable_set_registered(sel, true); } } if (wake) return 0; return pn_selector_select(messenger->selector, timeout); } int pn_messenger_tsync(pn_messenger_t *messenger, bool (*predicate)(pn_messenger_t *), int timeout) { if (messenger->passive) { bool pred = predicate(messenger); return pred ? 0 : PN_INPROGRESS; } pn_timestamp_t now = pn_i_now(); long int deadline = now + timeout; bool pred; while (true) { int error = pn_messenger_process(messenger); pred = predicate(messenger); if (error == PN_INTR) { return pred ? 0 : PN_INTR; } int remaining = deadline - now; if (pred || (timeout >= 0 && remaining < 0)) break; pn_timestamp_t mdeadline = pn_messenger_deadline(messenger); if (mdeadline) { if (now >= mdeadline) remaining = 0; else { const int delay = mdeadline - now; remaining = (remaining < 0) ? delay : pn_min( remaining, delay ); } } error = pni_wait(messenger, remaining); if (error) return error; if (timeout >= 0) { now = pn_i_now(); } } return pred ? 0 : PN_TIMEOUT; } int pn_messenger_sync(pn_messenger_t *messenger, bool (*predicate)(pn_messenger_t *)) { if (messenger->blocking) { return pn_messenger_tsync(messenger, predicate, messenger->timeout); } else { int err = pn_messenger_tsync(messenger, predicate, 0); if (err == PN_TIMEOUT) { return PN_INPROGRESS; } else { return err; } } } static void pni_parse(pn_address_t *address); pn_connection_t *pn_messenger_resolve(pn_messenger_t *messenger, const char *address, char **name); int pn_messenger_work(pn_messenger_t *messenger, int timeout); int pn_messenger_start(pn_messenger_t *messenger) { if (!messenger) return PN_ARG_ERR; int error = 0; // When checking of routes is required we attempt to resolve each route // with a substitution that has a defined scheme, address and port. If // any of theses routes is invalid an appropriate error code will be // returned. Currently no attempt is made to check the name part of the // address, as the intent here is to fail fast if the addressed host // is invalid or unavailable. if (messenger->flags & PN_FLAGS_CHECK_ROUTES) { pn_list_t *substitutions = pn_list(PN_WEAKREF, 0); pn_transform_get_substitutions(messenger->routes, substitutions); for (size_t i = 0; i < pn_list_size(substitutions) && error == 0; i++) { pn_string_t *substitution = (pn_string_t *)pn_list_get(substitutions, i); if (substitution) { pn_address_t addr; addr.text = pn_string(NULL); error = pn_string_copy(addr.text, substitution); if (!error) { pni_parse(&addr); if (addr.scheme && strlen(addr.scheme) > 0 && !strstr(addr.scheme, "$") && addr.host && strlen(addr.host) > 0 && !strstr(addr.host, "$") && addr.port && strlen(addr.port) > 0 && !strstr(addr.port, "$")) { pn_string_t *check_addr = pn_string(NULL); // ipv6 hosts need to be wrapped in [] within a URI if (strstr(addr.host, ":")) { pn_string_format(check_addr, "%s://[%s]:%s/", addr.scheme, addr.host, addr.port); } else { pn_string_format(check_addr, "%s://%s:%s/", addr.scheme, addr.host, addr.port); } char *name = NULL; pn_connection_t *connection = pn_messenger_resolve( messenger, pn_string_get(check_addr), &name); pn_free(check_addr); if (!connection) { if (pn_error_code(messenger->error) == 0) pn_error_copy(messenger->error, pn_io_error(messenger->io)); pn_error_format(messenger->error, PN_ERR, "CONNECTION ERROR (%s:%s): %s\n", messenger->address.host, messenger->address.port, pn_error_text(messenger->error)); error = pn_error_code(messenger->error); } else { // Send and receive outstanding messages until connection // completes or an error occurs int work = pn_messenger_work(messenger, -1); pn_connection_ctx_t *cctx = (pn_connection_ctx_t *)pn_connection_get_context(connection); while ((work > 0 || (pn_connection_state(connection) & PN_REMOTE_UNINIT) || pni_connection_pending(cctx->selectable) != (ssize_t)0) && pn_error_code(messenger->error) == 0) work = pn_messenger_work(messenger, 0); if (work < 0 && work != PN_TIMEOUT) { error = work; } else { error = pn_error_code(messenger->error); } } } pn_free(addr.text); } } } pn_free(substitutions); } return error; } bool pn_messenger_stopped(pn_messenger_t *messenger) { return pn_list_size(messenger->connections) == 0 && pn_list_size(messenger->listeners) == 0; } int pn_messenger_stop(pn_messenger_t *messenger) { if (!messenger) return PN_ARG_ERR; for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i); pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE); while (link) { pn_link_close(link); link = pn_link_next(link, PN_LOCAL_ACTIVE); } pn_connection_close(conn); } for (size_t i = 0; i < pn_list_size(messenger->listeners); i++) { pn_listener_ctx_t *lnr = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, i); pn_selectable_terminate(lnr->selectable); pni_lnr_modified(lnr); } return pn_messenger_sync(messenger, pn_messenger_stopped); } void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path); static void pni_parse(pn_address_t *address) { address->passive = false; address->scheme = NULL; address->user = NULL; address->pass = NULL; address->host = NULL; address->port = NULL; address->name = NULL; pni_parse_url(pn_string_buffer(address->text), &address->scheme, &address->user, &address->pass, &address->host, &address->port, &address->name); if (address->host[0] == '~') { address->passive = true; address->host++; } } static int pni_route(pn_messenger_t *messenger, const char *address) { pn_address_t *addr = &messenger->address; int err = pn_transform_apply(messenger->routes, address, addr->text); if (err) return pn_error_format(messenger->error, PN_ERR, "transformation error"); pni_parse(addr); return 0; } pn_connection_t *pn_messenger_resolve(pn_messenger_t *messenger, const char *address, char **name) { assert(messenger); messenger->connection_error = 0; pn_string_t *domain = messenger->domain; int err = pni_route(messenger, address); if (err) return NULL; bool passive = messenger->address.passive; char *scheme = messenger->address.scheme; char *user = messenger->address.user; char *pass = messenger->address.pass; char *host = messenger->address.host; char *port = messenger->address.port; *name = messenger->address.name; if (passive) { for (size_t i = 0; i < pn_list_size(messenger->listeners); i++) { pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, i); if (pn_streq(host, ctx->host) && pn_streq(port, ctx->port)) { return NULL; } } pn_listener_ctx(messenger, scheme, host, port); return NULL; } pn_string_set(domain, ""); if (user) { pn_string_addf(domain, "%s@", user); } pn_string_addf(domain, "%s", host); if (port) { pn_string_addf(domain, ":%s", port); } for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *connection = (pn_connection_t *) pn_list_get(messenger->connections, i); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection); if (pn_streq(scheme, ctx->scheme) && pn_streq(user, ctx->user) && pn_streq(pass, ctx->pass) && pn_streq(host, ctx->host) && pn_streq(port, ctx->port)) { return connection; } const char *container = pn_connection_remote_container(connection); if (pn_streq(container, pn_string_get(domain))) { return connection; } } pn_socket_t sock = pn_connect(messenger->io, host, port ? port : default_port(scheme)); if (sock == PN_INVALID_SOCKET) { pn_error_copy(messenger->error, pn_io_error(messenger->io)); pn_error_format(messenger->error, PN_ERR, "CONNECTION ERROR (%s:%s): %s\n", messenger->address.host, messenger->address.port, pn_error_text(messenger->error)); return NULL; } pn_connection_t *connection = pn_messenger_connection(messenger, sock, scheme, user, pass, host, port, NULL); pn_transport_t *transport = pn_transport(); if (messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS && user && pass) { pn_sasl_t *s = pn_sasl(transport); pn_sasl_set_allow_insecure_mechs(s, true); } pn_transport_bind(transport, connection); pn_decref(transport); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection); pn_selectable_t *sel = ctx->selectable; err = pn_transport_config(messenger, connection); if (err) { pn_selectable_free(sel); messenger->connection_error = err; return NULL; } pn_connection_open(connection); return connection; } pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger, const char *address, bool sender) { char *name = NULL; pn_connection_t *connection = pn_messenger_resolve(messenger, address, &name); if (!connection) return NULL; pn_link_t *link = pn_link_head(connection, PN_LOCAL_ACTIVE); while (link) { if (pn_link_is_sender(link) == sender) { const char *terminus = pn_link_is_sender(link) ? pn_terminus_get_address(pn_link_target(link)) : pn_terminus_get_address(pn_link_source(link)); if (pn_streq(name, terminus)) return link; } link = pn_link_next(link, PN_LOCAL_ACTIVE); } return NULL; } pn_link_t *pn_messenger_link(pn_messenger_t *messenger, const char *address, bool sender, pn_seconds_t timeout) { char *name = NULL; pn_connection_t *connection = pn_messenger_resolve(messenger, address, &name); if (!connection) return NULL; pn_connection_ctx_t *cctx = (pn_connection_ctx_t *)pn_connection_get_context(connection); pn_link_t *link = pn_messenger_get_link(messenger, address, sender); if (link) return link; pn_session_t *ssn = pn_session(connection); pn_session_open(ssn); if (sender) { link = pn_sender(ssn, "sender-xxx"); } else { if (name) { link = pn_receiver(ssn, name); } else { link = pn_receiver(ssn, ""); } } if ((sender && pn_messenger_get_outgoing_window(messenger)) || (!sender && pn_messenger_get_incoming_window(messenger))) { if (messenger->snd_settle_mode == -1) { /* Choose default based on sender/receiver */ /* For a sender use MIXED so the application can decide whether each message is settled or not. For a receiver request UNSETTLED, since the user set an incoming_window which means they want to decide settlement. */ pn_link_set_snd_settle_mode(link, sender ? PN_SND_MIXED : PN_SND_UNSETTLED); } else { /* Respect user setting */ pn_link_set_snd_settle_mode(link, (pn_snd_settle_mode_t)messenger->snd_settle_mode); } pn_link_set_rcv_settle_mode(link, messenger->rcv_settle_mode); } if (pn_streq(name, "#")) { if (pn_link_is_sender(link)) { pn_terminus_set_dynamic(pn_link_target(link), true); } else { pn_terminus_set_dynamic(pn_link_source(link), true); } } else { pn_terminus_set_address(pn_link_target(link), name); pn_terminus_set_address(pn_link_source(link), name); } link_ctx_setup( messenger, connection, link ); if (timeout > 0) { pn_terminus_set_expiry_policy(pn_link_target(link), PN_EXPIRE_WITH_LINK); pn_terminus_set_expiry_policy(pn_link_source(link), PN_EXPIRE_WITH_LINK); pn_terminus_set_timeout(pn_link_target(link), timeout); pn_terminus_set_timeout(pn_link_source(link), timeout); } if (!sender) { pn_link_ctx_t *ctx = (pn_link_ctx_t *)pn_link_get_context(link); assert( ctx ); ctx->subscription = pn_subscription(messenger, cctx->scheme, cctx->host, cctx->port); } pn_link_open(link); return link; } pn_link_t *pn_messenger_source(pn_messenger_t *messenger, const char *source, pn_seconds_t timeout) { return pn_messenger_link(messenger, source, false, timeout); } pn_link_t *pn_messenger_target(pn_messenger_t *messenger, const char *target, pn_seconds_t timeout) { return pn_messenger_link(messenger, target, true, timeout); } pn_subscription_t *pn_messenger_subscribe(pn_messenger_t *messenger, const char *source) { return pn_messenger_subscribe_ttl(messenger, source, 0); } pn_subscription_t *pn_messenger_subscribe_ttl(pn_messenger_t *messenger, const char *source, pn_seconds_t timeout) { pni_route(messenger, source); if (pn_error_code(messenger->error)) return NULL; bool passive = messenger->address.passive; char *scheme = messenger->address.scheme; char *host = messenger->address.host; char *port = messenger->address.port; if (passive) { pn_listener_ctx_t *ctx = pn_listener_ctx(messenger, scheme, host, port); if (ctx) { return ctx->subscription; } else { return NULL; } } else { pn_link_t *src = pn_messenger_source(messenger, source, timeout); if (!src) return NULL; pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( src ); return ctx ? ctx->subscription : NULL; } } int pn_messenger_get_outgoing_window(pn_messenger_t *messenger) { return pni_store_get_window(messenger->outgoing); } int pn_messenger_set_outgoing_window(pn_messenger_t *messenger, int window) { pni_store_set_window(messenger->outgoing, window); return 0; } int pn_messenger_get_incoming_window(pn_messenger_t *messenger) { return pni_store_get_window(messenger->incoming); } int pn_messenger_set_incoming_window(pn_messenger_t *messenger, int window) { pni_store_set_window(messenger->incoming, window); return 0; } static void outward_munge(pn_messenger_t *mng, pn_message_t *msg) { char stackbuf[256]; char *heapbuf = NULL; char *buf = stackbuf; const char *address = pn_message_get_reply_to(msg); int len = address ? strlen(address) : 0; if (len > 1 && address[0] == '~' && address[1] == '/') { unsigned needed = len + strlen(mng->name) + 9; if (needed > sizeof(stackbuf)) { heapbuf = (char *) malloc(needed); buf = heapbuf; } sprintf(buf, "amqp://%s/%s", mng->name, address + 2); pn_message_set_reply_to(msg, buf); } else if (len == 1 && address[0] == '~') { unsigned needed = strlen(mng->name) + 8; if (needed > sizeof(stackbuf)) { heapbuf = (char *) malloc(needed); buf = heapbuf; } sprintf(buf, "amqp://%s", mng->name); pn_message_set_reply_to(msg, buf); } if (heapbuf) free (heapbuf); } int pni_bump_out(pn_messenger_t *messenger, const char *address) { pni_entry_t *entry = pni_store_get(messenger->outgoing, address); if (!entry) return 0; pni_entry_set_status(entry, PN_STATUS_ABORTED); pni_entry_free(entry); return 0; } int pni_pump_out(pn_messenger_t *messenger, const char *address, pn_link_t *sender) { pni_entry_t *entry = pni_store_get(messenger->outgoing, address); if (!entry) { pn_link_drained(sender); return 0; } pn_buffer_t *buf = pni_entry_bytes(entry); pn_bytes_t bytes = pn_buffer_bytes(buf); const char *encoded = bytes.start; size_t size = bytes.size; // XXX: proper tag char tag[8]; void *ptr = &tag; uint64_t next = messenger->next_tag++; *((uint64_t *) ptr) = next; pn_delivery_t *d = pn_delivery(sender, pn_dtag(tag, 8)); pni_entry_set_delivery(entry, d); ssize_t n = pn_link_send(sender, encoded, size); if (n < 0) { pni_entry_free(entry); return pn_error_format(messenger->error, n, "send error: %s", pn_error_text(pn_link_error(sender))); } else { pn_link_advance(sender); pni_entry_free(entry); return 0; } } static void pni_default_rewrite(pn_messenger_t *messenger, const char *address, pn_string_t *dst) { pn_address_t *addr = &messenger->address; if (address && strstr(address, "@")) { int err = pn_string_set(addr->text, address); if (err) assert(false); pni_parse(addr); if (addr->user || addr->pass) { pn_string_format(messenger->rewritten, "%s%s%s%s%s%s%s", addr->scheme ? addr->scheme : "", addr->scheme ? "://" : "", addr->host, addr->port ? ":" : "", addr->port ? addr->port : "", addr->name ? "/" : "", addr->name ? addr->name : ""); } } } static void pni_rewrite(pn_messenger_t *messenger, pn_message_t *msg) { const char *address = pn_message_get_address(msg); pn_string_set(messenger->original, address); int err = pn_transform_apply(messenger->rewrites, address, messenger->rewritten); if (err) assert(false); if (!pn_transform_matched(messenger->rewrites)) { pni_default_rewrite(messenger, pn_string_get(messenger->rewritten), messenger->rewritten); } pn_message_set_address(msg, pn_string_get(messenger->rewritten)); } static void pni_restore(pn_messenger_t *messenger, pn_message_t *msg) { pn_message_set_address(msg, pn_string_get(messenger->original)); } int pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg) { if (!messenger) return PN_ARG_ERR; if (!msg) return pn_error_set(messenger->error, PN_ARG_ERR, "null message"); outward_munge(messenger, msg); const char *address = pn_message_get_address(msg); pni_entry_t *entry = pni_store_put(messenger->outgoing, address); if (!entry) return pn_error_format(messenger->error, PN_ERR, "store error"); messenger->outgoing_tracker = pn_tracker(OUTGOING, pni_entry_track(entry)); pn_buffer_t *buf = pni_entry_bytes(entry); pni_rewrite(messenger, msg); while (true) { char *encoded = pn_buffer_memory(buf).start; size_t size = pn_buffer_capacity(buf); int err = pn_message_encode(msg, encoded, &size); if (err == PN_OVERFLOW) { err = pn_buffer_ensure(buf, 2*pn_buffer_capacity(buf)); if (err) { pni_entry_free(entry); pni_restore(messenger, msg); return pn_error_format(messenger->error, err, "put: error growing buffer"); } } else if (err) { pni_restore(messenger, msg); return pn_error_format(messenger->error, err, "encode error: %s", pn_message_error(msg)); } else { pni_restore(messenger, msg); pn_buffer_append(buf, encoded, size); // XXX pn_link_t *sender = pn_messenger_target(messenger, address, 0); if (!sender) { int err = pn_error_code(messenger->error); if (err) { return err; } else if (messenger->connection_error) { return pni_bump_out(messenger, address); } else { return 0; } } else { return pni_pump_out(messenger, address, sender); } } } return PN_ERR; } pn_tracker_t pn_messenger_outgoing_tracker(pn_messenger_t *messenger) { assert(messenger); return messenger->outgoing_tracker; } pni_store_t *pn_tracker_store(pn_messenger_t *messenger, pn_tracker_t tracker) { if (pn_tracker_direction(tracker) == OUTGOING) { return messenger->outgoing; } else { return messenger->incoming; } } pn_status_t pn_messenger_status(pn_messenger_t *messenger, pn_tracker_t tracker) { pni_store_t *store = pn_tracker_store(messenger, tracker); pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker)); if (e) { return pni_entry_get_status(e); } else { return PN_STATUS_UNKNOWN; } } pn_delivery_t *pn_messenger_delivery(pn_messenger_t *messenger, pn_tracker_t tracker) { pni_store_t *store = pn_tracker_store(messenger, tracker); pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker)); if (e) { return pni_entry_get_delivery(e); } else { return NULL; } } bool pn_messenger_buffered(pn_messenger_t *messenger, pn_tracker_t tracker) { pni_store_t *store = pn_tracker_store(messenger, tracker); pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker)); if (e) { pn_delivery_t *d = pni_entry_get_delivery(e); if (d) { bool b = pn_delivery_buffered(d); return b; } else { return true; } } else { return false; } } int pn_messenger_settle(pn_messenger_t *messenger, pn_tracker_t tracker, int flags) { pni_store_t *store = pn_tracker_store(messenger, tracker); return pni_store_update(store, pn_tracker_sequence(tracker), PN_STATUS_UNKNOWN, flags, true, true); } // true if all pending output has been sent to peer bool pn_messenger_sent(pn_messenger_t *messenger) { int total = pni_store_size(messenger->outgoing); for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i); // check if transport is done generating output pn_transport_t *transport = pn_connection_transport(conn); if (transport) { if (!pn_transport_quiesced(transport)) { return false; } } pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE); while (link) { if (pn_link_is_sender(link)) { total += pn_link_queued(link); pn_delivery_t *d = pn_unsettled_head(link); while (d) { if (!pn_delivery_remote_state(d) && !pn_delivery_settled(d)) { total++; } d = pn_unsettled_next(d); } } link = pn_link_next(link, PN_LOCAL_ACTIVE); } } return total <= messenger->send_threshold; } bool pn_messenger_rcvd(pn_messenger_t *messenger) { if (pni_store_size(messenger->incoming) > 0) return true; for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i); pn_delivery_t *d = pn_work_head(conn); while (d) { if (pn_delivery_readable(d) && !pn_delivery_partial(d)) { return true; } d = pn_work_next(d); } } if (!pn_list_size(messenger->connections) && !pn_list_size(messenger->listeners)) { return true; } else { return false; } } static bool work_pred(pn_messenger_t *messenger) { return messenger->worked; } int pn_messenger_work(pn_messenger_t *messenger, int timeout) { messenger->worked = false; int err = pn_messenger_tsync(messenger, work_pred, timeout); if (err) { return err; } return (int) (messenger->worked ? 1 : 0); } int pni_messenger_work(pn_messenger_t *messenger) { if (messenger->blocking) { return pn_messenger_work(messenger, messenger->timeout); } else { int err = pn_messenger_work(messenger, 0); if (err == PN_TIMEOUT) { return PN_INPROGRESS; } else { return err; } } } int pn_messenger_interrupt(pn_messenger_t *messenger) { assert(messenger); ssize_t n = pn_write(messenger->io, messenger->ctrl[1], "x", 1); if (n <= 0) { return n; } else { return 0; } } int pn_messenger_send(pn_messenger_t *messenger, int n) { if (n == -1) { messenger->send_threshold = 0; } else { messenger->send_threshold = pn_messenger_outgoing(messenger) - n; if (messenger->send_threshold < 0) messenger->send_threshold = 0; } return pn_messenger_sync(messenger, pn_messenger_sent); } int pn_messenger_recv(pn_messenger_t *messenger, int n) { if (!messenger) return PN_ARG_ERR; if (messenger->blocking && !pn_list_size(messenger->listeners) && !pn_list_size(messenger->connections)) return pn_error_format(messenger->error, PN_STATE_ERR, "no valid sources"); // re-compute credit, and update credit scheduler if (n == -2) { messenger->credit_mode = LINK_CREDIT_MANUAL; } else if (n == -1) { messenger->credit_mode = LINK_CREDIT_AUTO; } else { messenger->credit_mode = LINK_CREDIT_EXPLICIT; if (n > messenger->distributed) messenger->credit = n - messenger->distributed; else // cancel unallocated messenger->credit = 0; } pn_messenger_flow(messenger); int err = pn_messenger_sync(messenger, pn_messenger_rcvd); if (err) return err; if (!pn_messenger_incoming(messenger) && messenger->blocking && !pn_list_size(messenger->listeners) && !pn_list_size(messenger->connections)) { return pn_error_format(messenger->error, PN_STATE_ERR, "no valid sources"); } else { return 0; } } int pn_messenger_receiving(pn_messenger_t *messenger) { assert(messenger); return messenger->credit + messenger->distributed; } int pn_messenger_get(pn_messenger_t *messenger, pn_message_t *msg) { if (!messenger) return PN_ARG_ERR; pni_entry_t *entry = pni_store_get(messenger->incoming, NULL); // XXX: need to drain credit before returning EOS if (!entry) return PN_EOS; messenger->incoming_tracker = pn_tracker(INCOMING, pni_entry_track(entry)); pn_buffer_t *buf = pni_entry_bytes(entry); pn_bytes_t bytes = pn_buffer_bytes(buf); const char *encoded = bytes.start; size_t size = bytes.size; messenger->incoming_subscription = (pn_subscription_t *) pni_entry_get_context(entry); if (msg) { int err = pn_message_decode(msg, encoded, size); pni_entry_free(entry); if (err) { return pn_error_format(messenger->error, err, "error decoding message: %s", pn_message_error(msg)); } else { return 0; } } else { pni_entry_free(entry); return 0; } } pn_tracker_t pn_messenger_incoming_tracker(pn_messenger_t *messenger) { assert(messenger); return messenger->incoming_tracker; } pn_subscription_t *pn_messenger_incoming_subscription(pn_messenger_t *messenger) { assert(messenger); return messenger->incoming_subscription; } int pn_messenger_accept(pn_messenger_t *messenger, pn_tracker_t tracker, int flags) { if (pn_tracker_direction(tracker) != INCOMING) { return pn_error_format(messenger->error, PN_ARG_ERR, "invalid tracker, incoming tracker required"); } return pni_store_update(messenger->incoming, pn_tracker_sequence(tracker), PN_STATUS_ACCEPTED, flags, false, false); } int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int flags) { if (pn_tracker_direction(tracker) != INCOMING) { return pn_error_format(messenger->error, PN_ARG_ERR, "invalid tracker, incoming tracker required"); } return pni_store_update(messenger->incoming, pn_tracker_sequence(tracker), PN_STATUS_REJECTED, flags, false, false); } pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger, pn_tracker_t tracker) { pni_store_t *store = pn_tracker_store(messenger, tracker); pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker)); if (e) { pn_delivery_t *d = pni_entry_get_delivery(e); if (d) { return pn_delivery_link(d); } } return NULL; } int pn_messenger_queued(pn_messenger_t *messenger, bool sender) { if (!messenger) return 0; int result = 0; for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i); pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE); while (link) { if (pn_link_is_sender(link)) { if (sender) { result += pn_link_queued(link); } } else if (!sender) { result += pn_link_queued(link); } link = pn_link_next(link, PN_LOCAL_ACTIVE); } } return result; } int pn_messenger_outgoing(pn_messenger_t *messenger) { return pni_store_size(messenger->outgoing) + pn_messenger_queued(messenger, true); } int pn_messenger_incoming(pn_messenger_t *messenger) { return pni_store_size(messenger->incoming) + pn_messenger_queued(messenger, false); } int pn_messenger_route(pn_messenger_t *messenger, const char *pattern, const char *address) { pn_transform_rule(messenger->routes, pattern, address); return 0; } int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern, const char *address) { pn_transform_rule(messenger->rewrites, pattern, address); return 0; } int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags) { if (!messenger) return PN_ARG_ERR; if (flags == 0) { messenger->flags = 0; } else if (flags & (PN_FLAGS_CHECK_ROUTES | PN_FLAGS_ALLOW_INSECURE_MECHS)) { messenger->flags |= flags; } else { return PN_ARG_ERR; } return 0; } int pn_messenger_get_flags(pn_messenger_t *messenger) { return messenger ? messenger->flags : 0; } int pn_messenger_set_snd_settle_mode(pn_messenger_t *messenger, const pn_snd_settle_mode_t mode) { if (!messenger) return PN_ARG_ERR; messenger->snd_settle_mode = mode; return 0; } int pn_messenger_set_rcv_settle_mode(pn_messenger_t *messenger, const pn_rcv_settle_mode_t mode) { if (!messenger) return PN_ARG_ERR; messenger->rcv_settle_mode = mode; return 0; } void pn_messenger_set_tracer(pn_messenger_t *messenger, pn_tracer_t tracer) { assert(messenger); assert(tracer); messenger->tracer = tracer; } pn_millis_t pn_messenger_get_remote_idle_timeout(pn_messenger_t *messenger, const char *address) { if (!messenger) return PN_ARG_ERR; pn_address_t addr; addr.text = pn_string(address); pni_parse(&addr); pn_millis_t timeout = -1; for (size_t i = 0; i < pn_list_size(messenger->connections); i++) { pn_connection_t *connection = (pn_connection_t *)pn_list_get(messenger->connections, i); pn_connection_ctx_t *ctx = (pn_connection_ctx_t *)pn_connection_get_context(connection); if (pn_streq(addr.scheme, ctx->scheme) && pn_streq(addr.host, ctx->host) && pn_streq(addr.port, ctx->port)) { pn_transport_t *transport = pn_connection_transport(connection); if (transport) timeout = pn_transport_get_remote_idle_timeout(transport); break; } } return timeout; } int pn_messenger_set_ssl_peer_authentication_mode(pn_messenger_t *messenger, const pn_ssl_verify_mode_t mode) { if (!messenger) return PN_ARG_ERR; messenger->ssl_peer_authentication_mode = mode; return 0; } qpid-proton-0.22.0/proton-c/src/messaging.xml0000664000000000000000000002264713257152177016013 0ustar
qpid-proton-0.22.0/proton-c/src/libqpid-proton.pc.in0000664000000000000000000000203613257152177017176 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ includedir=@INCLUDEDIR@ Name: Proton Description: Qpid Proton C library Version: @PN_VERSION@ URL: http://qpid.apache.org/proton/ Libs: -L${libdir} -lqpid-proton Cflags: -I${includedir} qpid-proton-0.22.0/proton-c/src/libqpid-proton-proactor.pc.in0000664000000000000000000000207513257152177021030 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ includedir=@INCLUDEDIR@ Name: Proton Proactor Description: Qpid Proton C proactive IO library Version: @PN_VERSION@ URL: http://qpid.apache.org/proton/ Libs: -L${libdir} -lqpid-proton-proactor Cflags: -I${includedir} qpid-proton-0.22.0/proton-c/src/libqpid-proton-core.pc.in0000664000000000000000000000206613257152177020127 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ includedir=@INCLUDEDIR@ Name: Proton Core Description: Qpid Proton C core protocol library Version: @PN_VERSION@ URL: http://qpid.apache.org/proton/ Libs: -L${libdir} -lqpid-proton-core Cflags: -I${includedir} qpid-proton-0.22.0/proton-c/src/handlers/0000775000000000000000000000000013257152177015101 5ustar qpid-proton-0.22.0/proton-c/src/handlers/iohandler.c0000664000000000000000000000677513257152177017231 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "reactor/io.h" #include "reactor/reactor.h" #include "reactor/selector.h" #include #include #include static const char pni_selector_handle = 0; #define PN_SELECTOR ((pn_handle_t) &pni_selector_handle) void pni_handle_quiesced(pn_reactor_t *reactor, pn_selector_t *selector) { // check if we are still quiesced, other handlers of // PN_REACTOR_QUIESCED could have produced more events to process if (!pn_reactor_quiesced(reactor)) { return; } pn_selector_select(selector, pn_reactor_get_timeout(reactor)); pn_selectable_t *sel; int events; pn_reactor_mark(reactor); while ((sel = pn_selector_next(selector, &events))) { if (events & PN_READABLE) { pn_selectable_readable(sel); } if (events & PN_WRITABLE) { pn_selectable_writable(sel); } if (events & PN_EXPIRED) { pn_selectable_expired(sel); } if (events & PN_ERROR) { pn_selectable_error(sel); } } pn_reactor_yield(reactor); } void pni_handle_transport(pn_reactor_t *reactor, pn_event_t *event); void pni_handle_open(pn_reactor_t *reactor, pn_event_t *event); void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event); static void pn_iodispatch(pn_iohandler_t *handler, pn_event_t *event, pn_event_type_t type) { pn_reactor_t *reactor = pn_event_reactor(event); pn_record_t *record = pn_reactor_attachments(reactor); pn_selector_t *selector = (pn_selector_t *) pn_record_get(record, PN_SELECTOR); if (!selector) { selector = pn_io_selector(pni_reactor_io(reactor)); pn_record_def(record, PN_SELECTOR, PN_OBJECT); pn_record_set(record, PN_SELECTOR, selector); pn_decref(selector); } switch (type) { case PN_SELECTABLE_INIT: { pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event); pn_selector_add(selector, sel); } break; case PN_SELECTABLE_UPDATED: { pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event); pn_selector_update(selector, sel); } break; case PN_SELECTABLE_FINAL: { pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event); pn_selector_remove(selector, sel); pn_selectable_release(sel); } break; case PN_CONNECTION_LOCAL_OPEN: pni_handle_open(reactor, event); break; case PN_CONNECTION_BOUND: pni_handle_bound(reactor, event); break; case PN_TRANSPORT: pni_handle_transport(reactor, event); break; case PN_TRANSPORT_CLOSED: pn_transport_unbind(pn_event_transport(event)); break; case PN_REACTOR_QUIESCED: pni_handle_quiesced(reactor, selector); break; default: break; } } pn_iohandler_t *pn_iohandler(void) { return pn_handler(pn_iodispatch); } qpid-proton-0.22.0/proton-c/src/handlers/handshaker.c0000664000000000000000000000575013257152177017364 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include typedef struct { pn_map_t *handlers; } pni_handshaker_t; pni_handshaker_t *pni_handshaker(pn_handler_t *handler) { return (pni_handshaker_t *) pn_handler_mem(handler); } static void pn_handshaker_finalize(pn_handler_t *handler) { pni_handshaker_t *handshaker = pni_handshaker(handler); pn_free(handshaker->handlers); } static void pn_handshaker_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { switch (type) { case PN_CONNECTION_REMOTE_OPEN: { pn_connection_t *conn = pn_event_connection(event); if (pn_connection_state(conn) & PN_LOCAL_UNINIT) { pn_connection_open(conn); } } break; case PN_SESSION_REMOTE_OPEN: { pn_session_t *ssn = pn_event_session(event); if (pn_session_state(ssn) & PN_LOCAL_UNINIT) { pn_session_open(ssn); } } break; case PN_LINK_REMOTE_OPEN: { pn_link_t *link = pn_event_link(event); if (pn_link_state(link) & PN_LOCAL_UNINIT) { pn_terminus_copy(pn_link_source(link), pn_link_remote_source(link)); pn_terminus_copy(pn_link_target(link), pn_link_remote_target(link)); pn_link_open(link); } } break; case PN_CONNECTION_REMOTE_CLOSE: { pn_connection_t *conn = pn_event_connection(event); if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) { pn_connection_close(conn); } } break; case PN_SESSION_REMOTE_CLOSE: { pn_session_t *ssn = pn_event_session(event); if (!(pn_session_state(ssn) & PN_LOCAL_CLOSED)) { pn_session_close(ssn); } } break; case PN_LINK_REMOTE_CLOSE: { pn_link_t *link = pn_event_link(event); if (!(pn_link_state(link) & PN_LOCAL_CLOSED)) { pn_link_close(link); } } break; default: break; } } pn_handshaker_t *pn_handshaker(void) { pn_handler_t *handler = pn_handler_new(pn_handshaker_dispatch, sizeof(pni_handshaker_t), pn_handshaker_finalize); pni_handshaker_t *handshaker = pni_handshaker(handler); handshaker->handlers = NULL; return handler; } qpid-proton-0.22.0/proton-c/src/handlers/flowcontroller.c0000664000000000000000000000424113257152177020321 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include typedef struct { int window; int drained; } pni_flowcontroller_t; pni_flowcontroller_t *pni_flowcontroller(pn_handler_t *handler) { return (pni_flowcontroller_t *) pn_handler_mem(handler); } static void pni_topup(pn_link_t *link, int window) { int delta = window - pn_link_credit(link); pn_link_flow(link, delta); } static void pn_flowcontroller_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { pni_flowcontroller_t *fc = pni_flowcontroller(handler); int window = fc->window; pn_link_t *link = pn_event_link(event); switch (pn_event_type(event)) { case PN_LINK_LOCAL_OPEN: case PN_LINK_REMOTE_OPEN: case PN_LINK_FLOW: case PN_DELIVERY: if (pn_link_is_receiver(link)) { fc->drained += pn_link_drained(link); if (!fc->drained) { pni_topup(link, window); } } break; default: break; } } pn_flowcontroller_t *pn_flowcontroller(int window) { // XXX: a window of 1 doesn't work because we won't necessarily get // notified when the one allowed delivery is settled assert(window > 1); pn_flowcontroller_t *handler = pn_handler_new(pn_flowcontroller_dispatch, sizeof(pni_flowcontroller_t), NULL); pni_flowcontroller_t *fc = pni_flowcontroller(handler); fc->window = window; fc->drained = 0; return handler; } qpid-proton-0.22.0/proton-c/src/extra/0000775000000000000000000000000013257152177014424 5ustar qpid-proton-0.22.0/proton-c/src/extra/url.c0000664000000000000000000001660213257152177015377 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "core/util.h" #include "proton/url.h" #include "proton/object.h" #include #include static void pni_urldecode(const char *src, char *dst) { const char *in = src; char *out = dst; while (*in != '\0') { if ('%' == *in) { if ((in[1] != '\0') && (in[2] != '\0')) { char esc[3]; esc[0] = in[1]; esc[1] = in[2]; esc[2] = '\0'; unsigned long d = strtoul(esc, NULL, 16); *out = (char)d; in += 3; out++; } else { *out = *in; in++; out++; } } else { *out = *in; in++; out++; } } *out = '\0'; } /* Not static - used by messenger.c */ void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path) { if (!url) return; *scheme = *user = *pass = *host = *port = *path = NULL; char *slash = strchr(url, '/'); if (slash && slash>url) { char *scheme_end = strstr(slash-1, "://"); if (scheme_end && scheme_end */ if (colon) { *colon = '\0'; *port = colon + 1; } if (*user) pni_urldecode(*user, *user); if (*pass) pni_urldecode(*pass, *pass); } /** URL-encode src and append to dst. */ static void pni_urlencode(pn_string_t *dst, const char* src) { static const char *bad = "@:/"; if (!src) return; const char *i = src; const char *j = strpbrk(i, bad); while (j) { pn_string_addf(dst, "%.*s", (int)(j-i), i); pn_string_addf(dst, "%%%02X", (int)*j); i = j + 1; j = strpbrk(i, bad); } pn_string_addf(dst, "%s", i); } struct pn_url_t { char *scheme; char *username; char *password; char *host; char *port; char *path; pn_string_t *str; }; /** Internal use only, returns the pn_string_t. Public function is pn_url_str() */ static pn_string_t *pn_url_string(pn_url_t* url) { pn_url_str(url); /* Make sure str is up to date */ return url->str; } static void pn_url_finalize(void *object) { pn_url_t *url = (pn_url_t *) object; pn_url_clear(url); pn_free(url->str); } static uintptr_t pn_url_hashcode(void *object) { pn_url_t *url = (pn_url_t *) object; return pn_hashcode(pn_url_string(url)); } static intptr_t pn_url_compare(void *oa, void *ob) { pn_url_t *a = (pn_url_t *) oa; pn_url_t *b = (pn_url_t *) ob; return pn_compare(pn_url_string(a), pn_url_string(b)); } static int pn_url_inspect(void *obj, pn_string_t *dst) { pn_url_t *url = (pn_url_t *) obj; int err = 0; err = pn_string_addf(dst, "Url("); if (err) return err; err = pn_inspect(pn_url_string(url), dst); if (err) return err; return pn_string_addf(dst, ")"); } #define pn_url_initialize NULL pn_url_t *pn_url() { static const pn_class_t clazz = PN_CLASS(pn_url); pn_url_t *url = (pn_url_t*) pn_class_new(&clazz, sizeof(pn_url_t)); if (!url) return NULL; memset(url, 0, sizeof(*url)); url->str = pn_string(NULL); return url; } /** Parse a string URL as a pn_url_t. *@param[in] url A URL string. *@return The parsed pn_url_t or NULL if url is not a valid URL string. */ pn_url_t *pn_url_parse(const char *str) { if (!str || !*str) /* Empty string or NULL is illegal. */ return NULL; pn_url_t *url = pn_url(); char *str2 = pn_strdup(str); pni_parse_url(str2, &url->scheme, &url->username, &url->password, &url->host, &url->port, &url->path); url->scheme = pn_strdup(url->scheme); url->username = pn_strdup(url->username); url->password = pn_strdup(url->password); url->host = (url->host && !*url->host) ? NULL : pn_strdup(url->host); url->port = pn_strdup(url->port); url->path = pn_strdup(url->path); free(str2); return url; } /** Free a URL */ void pn_url_free(pn_url_t *url) { pn_free(url); } /** Clear the contents of the URL. */ void pn_url_clear(pn_url_t *url) { pn_url_set_scheme(url, NULL); pn_url_set_username(url, NULL); pn_url_set_password(url, NULL); pn_url_set_host(url, NULL); pn_url_set_port(url, NULL); pn_url_set_path(url, NULL); pn_string_clear(url->str); } /** Return the string form of a URL. */ const char *pn_url_str(pn_url_t *url) { if (pn_string_get(url->str) == NULL) { pn_string_set(url->str, ""); if (url->scheme) pn_string_addf(url->str, "%s://", url->scheme); if (url->username) pni_urlencode(url->str, url->username); if (url->password) { pn_string_addf(url->str, ":"); pni_urlencode(url->str, url->password); } if (url->username || url->password) pn_string_addf(url->str, "@"); if (url->host) { if (strchr(url->host, ':')) pn_string_addf(url->str, "[%s]", url->host); else pn_string_addf(url->str, "%s", url->host); } if (url->port) pn_string_addf(url->str, ":%s", url->port); if (url->path) pn_string_addf(url->str, "/%s", url->path); } return pn_string_get(url->str); } const char *pn_url_get_scheme(pn_url_t *url) { return url->scheme; } const char *pn_url_get_username(pn_url_t *url) { return url->username; } const char *pn_url_get_password(pn_url_t *url) { return url->password; } const char *pn_url_get_host(pn_url_t *url) { return url->host; } const char *pn_url_get_port(pn_url_t *url) { return url->port; } const char *pn_url_get_path(pn_url_t *url) { return url->path; } #define SET(part) free(url->part); url->part = pn_strdup(part); pn_string_clear(url->str) void pn_url_set_scheme(pn_url_t *url, const char *scheme) { SET(scheme); } void pn_url_set_username(pn_url_t *url, const char *username) { SET(username); } void pn_url_set_password(pn_url_t *url, const char *password) { SET(password); } void pn_url_set_host(pn_url_t *url, const char *host) { SET(host); } void pn_url_set_port(pn_url_t *url, const char *port) { SET(port); } void pn_url_set_path(pn_url_t *url, const char *path) { SET(path); } qpid-proton-0.22.0/proton-c/src/encodings.h.py0000664000000000000000000000270613257152177016057 0ustar #!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import mllib, optparse, os, sys xml = os.path.join(os.path.dirname(__file__), "types.xml") doc = mllib.xml_parse(xml) print("/* generated from %s */" % xml) print("#ifndef _PROTON_ENCODINGS_H") print("#define _PROTON_ENCODINGS_H 1") print() print("#define PNE_DESCRIPTOR (0x00)") for enc in doc.query["amqp/section/type/encoding"]: name = enc["@name"] or enc.parent["@name"] # XXX: a bit hacky if name == "ieee-754": name = enc.parent["@name"] cname = "PNE_" + name.replace("-", "_").upper() print("#define %s%s(%s)" % (cname, " "*(20-len(cname)), enc["@code"])) print() print("#endif /* encodings.h */") qpid-proton-0.22.0/proton-c/src/core/0000775000000000000000000000000013257152177014231 5ustar qpid-proton-0.22.0/proton-c/src/core/util.h0000664000000000000000000001407613257152177015367 0ustar #ifndef _PROTON_SRC_UTIL_H #define _PROTON_SRC_UTIL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "buffer.h" #include #ifndef __cplusplus #include #endif #include #include #include #include #include ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size); int pn_quote(pn_string_t *dst, const char *src, size_t size); void pn_fprint_data(FILE *stream, const char *bytes, size_t size); void pn_print_data(const char *bytes, size_t size); bool pn_env_bool(const char *name); pn_timestamp_t pn_timestamp_min(pn_timestamp_t a, pn_timestamp_t b); char *pn_strdup(const char *src); char *pn_strndup(const char *src, size_t n); int pn_strcasecmp(const char* a, const char* b); int pn_strncasecmp(const char* a, const char* b, size_t len); static inline bool pn_bytes_equal(const pn_bytes_t a, const pn_bytes_t b) { return (a.size == b.size && !memcmp(a.start, b.start, a.size)); } static inline pn_bytes_t pn_string_bytes(pn_string_t *s) { return pn_bytes(pn_string_size(s), pn_string_get(s)); } /* Create a literal bytes value, e.g. PN_BYTES_LITERAL(foo) == pn_bytes(3, "foo") */ #define PN_BYTES_LITERAL(X) (pn_bytes(sizeof(#X)-1, #X)) #define DIE_IFR(EXPR, STRERR) \ do { \ int __code__ = (EXPR); \ if (__code__) { \ fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__, \ #EXPR, STRERR(__code__), __code__); \ exit(-1); \ } \ } while (0) #define DIE_IFE(EXPR) \ do { \ if ((EXPR) == -1) { \ int __code__ = errno; \ fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__, \ #EXPR, strerror(__code__), __code__); \ exit(-1); \ } \ } while (0) #define LL_HEAD(ROOT, LIST) ((ROOT)-> LIST ## _head) #define LL_TAIL(ROOT, LIST) ((ROOT)-> LIST ## _tail) #define LL_ADD(ROOT, LIST, NODE) \ { \ (NODE)-> LIST ## _next = NULL; \ (NODE)-> LIST ## _prev = (ROOT)-> LIST ## _tail; \ if (LL_TAIL(ROOT, LIST)) \ LL_TAIL(ROOT, LIST)-> LIST ## _next = (NODE); \ LL_TAIL(ROOT, LIST) = (NODE); \ if (!LL_HEAD(ROOT, LIST)) LL_HEAD(ROOT, LIST) = (NODE); \ } #define LL_POP(ROOT, LIST, TYPE) \ { \ if (LL_HEAD(ROOT, LIST)) { \ TYPE *_old = LL_HEAD(ROOT, LIST); \ LL_HEAD(ROOT, LIST) = LL_HEAD(ROOT, LIST)-> LIST ## _next; \ _old-> LIST ## _next = NULL; \ if (_old == LL_TAIL(ROOT, LIST)) { \ LL_TAIL(ROOT, LIST) = NULL; \ } else { \ LL_HEAD(ROOT, LIST)-> LIST ## _prev = NULL; \ } \ } \ } #define LL_REMOVE(ROOT, LIST, NODE) \ { \ if ((NODE)-> LIST ## _prev) \ (NODE)-> LIST ## _prev-> LIST ## _next = (NODE)-> LIST ## _next; \ if ((NODE)-> LIST ## _next) \ (NODE)-> LIST ## _next-> LIST ## _prev = (NODE)-> LIST ## _prev; \ if ((NODE) == LL_HEAD(ROOT, LIST)) \ LL_HEAD(ROOT, LIST) = (NODE)-> LIST ## _next; \ if ((NODE) == LL_TAIL(ROOT, LIST)) \ LL_TAIL(ROOT, LIST) = (NODE)-> LIST ## _prev; \ } #define pn_min(X,Y) ((X) > (Y) ? (Y) : (X)) #define pn_max(X,Y) ((X) < (Y) ? (Y) : (X)) #define PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE) \ while ((CAPACITY) < (COUNT)) { \ (CAPACITY) = (CAPACITY) ? 2 * (CAPACITY) : 16; \ (ARRAY) = (TYPE *) realloc((ARRAY), (CAPACITY) * sizeof (TYPE)); \ } \ #define PN_ENSUREZ(ARRAY, CAPACITY, COUNT, TYPE) \ { \ size_t _old_capacity = (CAPACITY); \ PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE); \ memset((ARRAY) + _old_capacity, 0, \ sizeof(TYPE)*((CAPACITY) - _old_capacity)); \ } #endif /* util.h */ qpid-proton-0.22.0/proton-c/src/core/util.c0000664000000000000000000000772713257152177015367 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "util.h" #include "buffer.h" #include #include #include #include #include #include #include #include ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size) { int idx = 0; for (unsigned i = 0; i < size; i++) { uint8_t c = src[i]; if (isprint(c)) { if (idx < (int) (capacity - 1)) { dst[idx++] = c; } else { if (idx > 0) { dst[idx - 1] = '\0'; } return PN_OVERFLOW; } } else { if (idx < (int) (capacity - 4)) { idx += sprintf(dst + idx, "\\x%.2x", c); } else { if (idx > 0) { dst[idx - 1] = '\0'; } return PN_OVERFLOW; } } } dst[idx] = '\0'; return idx; } int pn_quote(pn_string_t *dst, const char *src, size_t size) { while (true) { size_t str_size = pn_string_size(dst); char *str = pn_string_buffer(dst) + str_size; size_t capacity = pn_string_capacity(dst) - str_size; ssize_t ssize = pn_quote_data(str, capacity, src, size); if (ssize == PN_OVERFLOW) { int err = pn_string_grow(dst, (str_size + capacity) ? 2*(str_size + capacity) : 16); if (err) return err; } else if (ssize >= 0) { return pn_string_resize(dst, str_size + ssize); } else { return ssize; } } } void pn_fprint_data(FILE *stream, const char *bytes, size_t size) { char buf[256]; ssize_t n = pn_quote_data(buf, 256, bytes, size); if (n >= 0) { fputs(buf, stream); } else { if (n == PN_OVERFLOW) { fputs(buf, stream); fputs("... (truncated)", stream); } else fprintf(stderr, "pn_quote_data: %s\n", pn_code(n)); } } void pn_print_data(const char *bytes, size_t size) { pn_fprint_data(stdout, bytes, size); } int pn_strcasecmp(const char *a, const char *b) { int diff; while (*b) { char aa = *a++, bb = *b++; diff = tolower(aa)-tolower(bb); if ( diff!=0 ) return diff; } return *a; } int pn_strncasecmp(const char* a, const char* b, size_t len) { int diff = 0; while (*b && len > 0) { char aa = *a++, bb = *b++; diff = tolower(aa)-tolower(bb); if ( diff!=0 ) return diff; --len; }; return len==0 ? diff : *a; } bool pn_env_bool(const char *name) { char *v = getenv(name); return v && (!pn_strcasecmp(v, "true") || !pn_strcasecmp(v, "1") || !pn_strcasecmp(v, "yes") || !pn_strcasecmp(v, "on")); } char *pn_strdup(const char *src) { if (!src) return NULL; char *dest = (char *) malloc(strlen(src)+1); if (!dest) return NULL; return strcpy(dest, src); } char *pn_strndup(const char *src, size_t n) { if (src) { unsigned size = 0; for (const char *c = src; size < n && *c; c++) { size++; } char *dest = (char *) malloc(size + 1); if (!dest) return NULL; strncpy(dest, src, pn_min(n, size)); dest[size] = '\0'; return dest; } else { return NULL; } } // which timestamp will expire next, or zero if none set pn_timestamp_t pn_timestamp_min( pn_timestamp_t a, pn_timestamp_t b ) { if (a && b) return pn_min(a, b); if (a) return a; return b; } qpid-proton-0.22.0/proton-c/src/core/types.c0000664000000000000000000000204313257152177015540 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include pn_bytes_t pn_bytes(size_t size, const char *start) { pn_bytes_t bytes = {size, start}; return bytes; } pn_rwbytes_t pn_rwbytes(size_t size, char *start) { pn_rwbytes_t bytes = {size, start}; return bytes; } qpid-proton-0.22.0/proton-c/src/core/transport.h0000664000000000000000000000232713257152177016442 0ustar #ifndef _PROTON_TRANSPORT_INTERNAL_H #define _PROTON_TRANSPORT_INTERNAL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next); void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery); void pn_delivery_map_free(pn_delivery_map_t *db); void pn_unmap_handle(pn_session_t *ssn, pn_link_t *link); void pn_unmap_channel(pn_transport_t *transport, pn_session_t *ssn); #endif /* transport.h */ qpid-proton-0.22.0/proton-c/src/core/transport.c0000664000000000000000000031014213257152177016432 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "engine-internal.h" #include "framing.h" #include "platform/platform.h" #include "platform/platform_fmt.h" #include "sasl/sasl-internal.h" #include "ssl/ssl-internal.h" #include "autodetect.h" #include "protocol.h" #include "dispatch_actions.h" #include "config.h" #include "log_private.h" #include "proton/event.h" #include #include #include #include #include static ssize_t transport_consume(pn_transport_t *transport); // delivery buffers /* * Call this any time anything happens that may affect channel_max: * i.e. when the app indicates a preference, or when we receive the * OPEN frame from the remote peer. And call it to do the final * calculation just before we communicate our limit to the remote * peer by sending our OPEN frame. */ static void pni_calculate_channel_max(pn_transport_t *transport) { /* * The application cannot make the limit larger than * what this library will allow. */ transport->channel_max = (PN_IMPL_CHANNEL_MAX < transport->local_channel_max) ? PN_IMPL_CHANNEL_MAX : transport->local_channel_max; /* * The remote peer's constraint is not valid until the * peer's open frame has been received. */ if(transport->open_rcvd) { transport->channel_max = (transport->channel_max < transport->remote_channel_max) ? transport->channel_max : transport->remote_channel_max; } } void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next) { db->deliveries = pn_hash(PN_WEAKREF, 0, 0.75); db->next = next; } void pn_delivery_map_free(pn_delivery_map_t *db) { pn_free(db->deliveries); } static inline uintptr_t pni_sequence_make_hash ( pn_sequence_t i ) { return i & 0x00000000FFFFFFFFUL; } static pn_delivery_t *pni_delivery_map_get(pn_delivery_map_t *db, pn_sequence_t id) { return (pn_delivery_t *) pn_hash_get(db->deliveries, pni_sequence_make_hash(id) ); } static void pn_delivery_state_init(pn_delivery_state_t *ds, pn_delivery_t *delivery, pn_sequence_t id) { ds->id = id; ds->sending = false; ds->sent = false; ds->init = true; } static pn_delivery_state_t *pni_delivery_map_push(pn_delivery_map_t *db, pn_delivery_t *delivery) { pn_delivery_state_t *ds = &delivery->state; pn_delivery_state_init(ds, delivery, db->next++); pn_hash_put(db->deliveries, pni_sequence_make_hash(ds->id), delivery); return ds; } void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery) { if (delivery->state.init) { delivery->state.init = false; delivery->state.sending = false; delivery->state.sent = false; pn_hash_del(db->deliveries, pni_sequence_make_hash(delivery->state.id) ); } } static void pni_delivery_map_clear(pn_delivery_map_t *dm) { pn_hash_t *hash = dm->deliveries; for (pn_handle_t entry = pn_hash_head(hash); entry; entry = pn_hash_next(hash, entry)) { pn_delivery_t *dlv = (pn_delivery_t *) pn_hash_value(hash, entry); pn_delivery_map_del(dm, dlv); } dm->next = 0; } static void pni_default_tracer(pn_transport_t *transport, const char *message) { fprintf(stderr, "[%p]:%s\n", (void *) transport, message); } static ssize_t pn_io_layer_input_passthru(pn_transport_t *, unsigned int, const char *, size_t ); static ssize_t pn_io_layer_output_passthru(pn_transport_t *, unsigned int, char *, size_t ); static ssize_t pn_io_layer_input_error(pn_transport_t *, unsigned int, const char *, size_t ); static ssize_t pn_io_layer_output_error(pn_transport_t *, unsigned int, char *, size_t ); static ssize_t pn_io_layer_input_setup(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_io_layer_output_setup(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); static ssize_t pn_input_read_amqp_header(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_input_read_amqp(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_output_write_amqp_header(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); static ssize_t pn_output_write_amqp(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); static void pn_error_amqp(pn_transport_t *transport, unsigned int layer); static pn_timestamp_t pn_tick_amqp(pn_transport_t *transport, unsigned int layer, pn_timestamp_t now); static ssize_t pn_io_layer_input_autodetect(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available); static ssize_t pn_io_layer_output_null(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available); const pn_io_layer_t amqp_header_layer = { pn_input_read_amqp_header, pn_output_write_amqp_header, NULL, pn_tick_amqp, NULL }; const pn_io_layer_t amqp_write_header_layer = { pn_input_read_amqp, pn_output_write_amqp_header, NULL, pn_tick_amqp, NULL }; const pn_io_layer_t amqp_read_header_layer = { pn_input_read_amqp_header, pn_output_write_amqp, pn_error_amqp, pn_tick_amqp, NULL }; const pn_io_layer_t amqp_layer = { pn_input_read_amqp, pn_output_write_amqp, pn_error_amqp, pn_tick_amqp, NULL }; const pn_io_layer_t pni_setup_layer = { pn_io_layer_input_setup, pn_io_layer_output_setup, NULL, NULL, NULL }; const pn_io_layer_t pni_autodetect_layer = { pn_io_layer_input_autodetect, pn_io_layer_output_null, NULL, NULL, NULL }; const pn_io_layer_t pni_passthru_layer = { pn_io_layer_input_passthru, pn_io_layer_output_passthru, NULL, NULL, NULL }; const pn_io_layer_t pni_header_error_layer = { pn_io_layer_input_error, pn_output_write_amqp_header, NULL, NULL, NULL }; const pn_io_layer_t pni_error_layer = { pn_io_layer_input_error, pn_io_layer_output_error, pn_error_amqp, NULL, NULL }; /* Set up the transport protocol layers depending on what is configured */ static void pn_io_layer_setup(pn_transport_t *transport, unsigned int layer) { assert(layer == 0); // Figure out if we are server or not if (transport->server) { transport->io_layers[layer++] = &pni_autodetect_layer; return; } if (transport->ssl) { transport->io_layers[layer++] = &ssl_layer; } if (transport->sasl) { transport->io_layers[layer++] = &sasl_header_layer; } transport->io_layers[layer++] = &amqp_header_layer; } ssize_t pn_io_layer_input_setup(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available) { pn_io_layer_setup(transport, layer); return transport->io_layers[layer]->process_input(transport, layer, bytes, available); } ssize_t pn_io_layer_output_setup(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available) { pn_io_layer_setup(transport, layer); return transport->io_layers[layer]->process_output(transport, layer, bytes, available); } void pn_set_error_layer(pn_transport_t *transport) { // Set every layer to the error layer in case we manually // pass through (happens from SASL to AMQP) for (int layer=0; layerio_layers[layer] = &pni_error_layer; } } // Autodetect the layer by reading the protocol header ssize_t pn_io_layer_input_autodetect(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available) { const char* error; bool eos = pn_transport_capacity(transport)==PN_EOS; if (eos && available==0) { pn_do_error(transport, "amqp:connection:framing-error", "No valid protocol header found"); pn_set_error_layer(transport); return PN_EOS; } pni_protocol_type_t protocol = pni_sniff_header(bytes, available); if (transport->trace & PN_TRACE_DRV) pn_transport_logf(transport, "%s detected", pni_protocol_name(protocol)); switch (protocol) { case PNI_PROTOCOL_SSL: if (!(transport->allowed_layers & LAYER_SSL)) { error = "SSL protocol header not allowed (maybe detected twice)"; break; } transport->present_layers |= LAYER_SSL; transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSASL; if (!transport->ssl) { pn_ssl(transport); } transport->io_layers[layer] = &ssl_layer; transport->io_layers[layer+1] = &pni_autodetect_layer; return ssl_layer.process_input(transport, layer, bytes, available); case PNI_PROTOCOL_AMQP_SSL: if (!(transport->allowed_layers & LAYER_AMQPSSL)) { error = "AMQP SSL protocol header not allowed (maybe detected twice)"; break; } transport->present_layers |= LAYER_AMQPSSL; transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSASL; if (!transport->ssl) { pn_ssl(transport); } transport->io_layers[layer] = &ssl_layer; transport->io_layers[layer+1] = &pni_autodetect_layer; return 8; case PNI_PROTOCOL_AMQP_SASL: if (!(transport->allowed_layers & LAYER_AMQPSASL)) { error = "AMQP SASL protocol header not allowed (maybe detected twice)"; break; } transport->present_layers |= LAYER_AMQPSASL; transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSSL; if (!transport->sasl) { pn_sasl(transport); } transport->io_layers[layer] = &sasl_write_header_layer; transport->io_layers[layer+1] = &pni_autodetect_layer; if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " <- %s", "SASL"); pni_sasl_set_external_security(transport, pn_ssl_get_ssf((pn_ssl_t*)transport), pn_ssl_get_remote_subject((pn_ssl_t*)transport)); return 8; case PNI_PROTOCOL_AMQP1: if (!(transport->allowed_layers & LAYER_AMQP1)) { error = "AMQP1.0 protocol header not allowed (maybe detected twice)"; break; } transport->present_layers |= LAYER_AMQP1; transport->allowed_layers = LAYER_NONE; if (transport->auth_required && !pn_transport_is_authenticated(transport)) { pn_do_error(transport, "amqp:connection:policy-error", "Client skipped authentication - forbidden"); pn_set_error_layer(transport); return 8; } if (transport->encryption_required && !pn_transport_is_encrypted(transport)) { pn_do_error(transport, "amqp:connection:policy-error", "Client connection unencrypted - forbidden"); pn_set_error_layer(transport); return 8; } transport->io_layers[layer] = &amqp_write_header_layer; if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " <- %s", "AMQP"); return 8; case PNI_PROTOCOL_INSUFFICIENT: if (!eos) return 0; error = "End of input stream before protocol detection"; break; case PNI_PROTOCOL_AMQP_OTHER: error = "Incompatible AMQP connection detected"; break; case PNI_PROTOCOL_UNKNOWN: default: error = "Unknown protocol detected"; break; } transport->io_layers[layer] = &pni_header_error_layer; char quoted[1024]; pn_quote_data(quoted, 1024, bytes, available); pn_do_error(transport, "amqp:connection:framing-error", "%s: '%s'%s", error, quoted, !eos ? "" : " (connection aborted)"); return 0; } // We don't know what the output should be - do nothing ssize_t pn_io_layer_output_null(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available) { return 0; } /** Pass through input handler */ ssize_t pn_io_layer_input_passthru(pn_transport_t *transport, unsigned int layer, const char *data, size_t available) { if (layer+1io_layers[layer+1]->process_input(transport, layer+1, data, available); return PN_EOS; } /** Pass through output handler */ ssize_t pn_io_layer_output_passthru(pn_transport_t *transport, unsigned int layer, char *data, size_t available) { if (layer+1io_layers[layer+1]->process_output(transport, layer+1, data, available); return PN_EOS; } /** Input handler after detected error */ ssize_t pn_io_layer_input_error(pn_transport_t *transport, unsigned int layer, const char *data, size_t available) { return PN_EOS; } /** Output handler after detected error */ ssize_t pn_io_layer_output_error(pn_transport_t *transport, unsigned int layer, char *data, size_t available) { return PN_EOS; } static void pn_transport_initialize(void *object) { pn_transport_t *transport = (pn_transport_t *)object; transport->freed = false; transport->output_buf = NULL; transport->output_size = PN_TRANSPORT_INITIAL_BUFFER_SIZE; transport->input_buf = NULL; transport->input_size = PN_TRANSPORT_INITIAL_BUFFER_SIZE; transport->tracer = pni_default_tracer; transport->sasl = NULL; transport->ssl = NULL; transport->scratch = pn_string(NULL); transport->args = pn_data(16); transport->output_args = pn_data(16); transport->frame = pn_buffer(PN_TRANSPORT_INITIAL_FRAME_SIZE); transport->input_frames_ct = 0; transport->output_frames_ct = 0; transport->connection = NULL; transport->context = pn_record(); for (int layer=0; layerio_layers[layer] = NULL; } transport->allowed_layers = LAYER_AMQP1 | LAYER_AMQPSASL | LAYER_AMQPSSL | LAYER_SSL; transport->present_layers = LAYER_NONE; // Defer setting up the layers until the first data arrives or is sent transport->io_layers[0] = &pni_setup_layer; transport->open_sent = false; transport->open_rcvd = false; transport->close_sent = false; transport->close_rcvd = false; transport->tail_closed = false; transport->head_closed = false; transport->remote_container = NULL; transport->remote_hostname = NULL; transport->local_max_frame = PN_DEFAULT_MAX_FRAME_SIZE; transport->remote_max_frame = OPEN_MAX_FRAME_SIZE_DEFAULT; /* * We set the local limit on channels to 2^15, because * parts of the code use the topmost bit (of a short) * as a flag. * The peer that this transport connects to may also * place its own limit on max channel number, and the * application may also set a limit. * The maximum that we use will be the minimum of all * these constraints. */ // There is no constraint yet from remote peer, // so set to max possible. transport->remote_channel_max = OPEN_CHANNEL_MAX_DEFAULT; transport->local_channel_max = PN_IMPL_CHANNEL_MAX; transport->channel_max = transport->local_channel_max; transport->local_idle_timeout = 0; transport->dead_remote_deadline = 0; transport->last_bytes_input = 0; transport->remote_idle_timeout = 0; transport->keepalive_deadline = 0; transport->last_bytes_output = 0; transport->remote_offered_capabilities = pn_data(0); transport->remote_desired_capabilities = pn_data(0); transport->remote_properties = pn_data(0); transport->disp_data = pn_data(0); pn_condition_init(&transport->remote_condition); pn_condition_init(&transport->condition); transport->error = pn_error(); transport->local_channels = pn_hash(PN_WEAKREF, 0, 0.75); transport->remote_channels = pn_hash(PN_WEAKREF, 0, 0.75); transport->bytes_input = 0; transport->bytes_output = 0; transport->input_pending = 0; transport->output_pending = 0; transport->done_processing = false; transport->posted_idle_timeout = false; transport->server = false; transport->halt = false; transport->auth_required = false; transport->authenticated = false; transport->encryption_required = false; transport->referenced = true; transport->trace = (pn_env_bool("PN_TRACE_RAW") ? PN_TRACE_RAW : PN_TRACE_OFF) | (pn_env_bool("PN_TRACE_FRM") ? PN_TRACE_FRM : PN_TRACE_OFF) | (pn_env_bool("PN_TRACE_DRV") ? PN_TRACE_DRV : PN_TRACE_OFF) | (pn_env_bool("PN_TRACE_EVT") ? PN_TRACE_EVT : PN_TRACE_OFF) ; } static pn_session_t *pni_channel_state(pn_transport_t *transport, uint16_t channel) { return (pn_session_t *) pn_hash_get(transport->remote_channels, channel); } static void pni_map_remote_channel(pn_session_t *session, uint16_t channel) { pn_transport_t *transport = session->connection->transport; pn_hash_put(transport->remote_channels, channel, session); session->state.remote_channel = channel; pn_ep_incref(&session->endpoint); } void pni_transport_unbind_handles(pn_hash_t *handles, bool reset_state); static void pni_unmap_remote_channel(pn_session_t *ssn) { // XXX: should really update link state also pni_delivery_map_clear(&ssn->state.incoming); pni_transport_unbind_handles(ssn->state.remote_handles, false); pn_transport_t *transport = ssn->connection->transport; uint16_t channel = ssn->state.remote_channel; ssn->state.remote_channel = -2; if (pn_hash_get(transport->remote_channels, channel)) { pn_ep_decref(&ssn->endpoint); } // note: may free the session: pn_hash_del(transport->remote_channels, channel); } static void pn_transport_incref(void *object) { pn_transport_t *transport = (pn_transport_t *) object; if (!transport->referenced) { transport->referenced = true; if (transport->connection) { pn_incref(transport->connection); } else { pn_object_incref(object); } } else { pn_object_incref(object); } } static void pn_transport_finalize(void *object); #define pn_transport_new pn_object_new #define pn_transport_refcount pn_object_refcount #define pn_transport_decref pn_object_decref #define pn_transport_reify pn_object_reify #define pn_transport_hashcode NULL #define pn_transport_compare NULL #define pn_transport_inspect NULL pn_transport_t *pn_transport(void) { #define pn_transport_free pn_object_free static const pn_class_t clazz = PN_METACLASS(pn_transport); #undef pn_transport_free pn_transport_t *transport = (pn_transport_t *) pn_class_new(&clazz, sizeof(pn_transport_t)); if (!transport) return NULL; transport->output_buf = (char *) malloc(transport->output_size); if (!transport->output_buf) { pn_transport_free(transport); return NULL; } transport->input_buf = (char *) malloc(transport->input_size); if (!transport->input_buf) { pn_transport_free(transport); return NULL; } transport->output_buffer = pn_buffer(4*1024); if (!transport->output_buffer) { pn_transport_free(transport); return NULL; } return transport; } void pn_transport_set_server(pn_transport_t *transport) { assert(transport); transport->server = true; } const char *pn_transport_get_user(pn_transport_t *transport) { assert(transport); // Client - just return whatever we gave to sasl if (!transport->server) { if (transport->sasl) return pn_sasl_get_user((pn_sasl_t *)transport); return "anonymous"; } // Server // Not finished authentication yet if (!(transport->present_layers & LAYER_AMQP1)) return 0; // We have SASL so it takes precedence if (transport->present_layers & LAYER_AMQPSASL) return pn_sasl_get_user((pn_sasl_t *)transport); // No SASL but we may have a SSL remote_subject if (transport->present_layers & (LAYER_AMQPSSL | LAYER_SSL)) return pn_ssl_get_remote_subject((pn_ssl_t *)transport); // otherwise it's just an unauthenticated anonymous connection return "anonymous"; } void pn_transport_require_auth(pn_transport_t *transport, bool required) { assert(transport); transport->auth_required = required; } bool pn_transport_is_authenticated(pn_transport_t *transport) { return transport && transport->authenticated; } void pn_transport_require_encryption(pn_transport_t *transport, bool required) { assert(transport); transport->encryption_required = required; } bool pn_transport_is_encrypted(pn_transport_t *transport) { return transport && transport->ssl && pn_ssl_get_ssf((pn_ssl_t*)transport)>0; } void pn_transport_free(pn_transport_t *transport) { if (!transport) return; assert(!transport->freed); transport->freed = true; pn_decref(transport); } static void pn_transport_finalize(void *object) { pn_transport_t *transport = (pn_transport_t *) object; if (transport->referenced && transport->connection && pn_refcount(transport->connection) > 1) { pn_object_incref(transport); transport->referenced = false; pn_decref(transport->connection); return; } // once the application frees the transport, no further I/O // processing can be done to the connection: pn_transport_unbind(transport); // we may have posted events, so stay alive until they are processed if (pn_refcount(transport) > 0) return; pn_ssl_free(transport); pn_sasl_free(transport); free(transport->remote_container); free(transport->remote_hostname); pn_free(transport->remote_offered_capabilities); pn_free(transport->remote_desired_capabilities); pn_free(transport->remote_properties); pn_free(transport->disp_data); pn_condition_tini(&transport->remote_condition); pn_condition_tini(&transport->condition); pn_error_free(transport->error); pn_free(transport->local_channels); pn_free(transport->remote_channels); if (transport->input_buf) free(transport->input_buf); if (transport->output_buf) free(transport->output_buf); pn_free(transport->scratch); pn_data_free(transport->args); pn_data_free(transport->output_args); pn_buffer_free(transport->frame); pn_free(transport->context); pn_buffer_free(transport->output_buffer); } static void pni_post_remote_open_events(pn_transport_t *transport, pn_connection_t *connection) { pn_collector_put(connection->collector, PN_OBJECT, connection, PN_CONNECTION_REMOTE_OPEN); if (transport->remote_idle_timeout) { pn_collector_put(connection->collector, PN_OBJECT, transport, PN_TRANSPORT); } } int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection) { assert(transport); assert(connection); if (transport->connection) return PN_STATE_ERR; if (connection->transport) return PN_STATE_ERR; transport->connection = connection; connection->transport = transport; pn_incref(connection); pn_connection_bound(connection); // set the hostname/user/password if (pn_string_size(connection->auth_user)) { pn_sasl(transport); pni_sasl_set_user_password(transport, pn_string_get(connection->auth_user), pn_string_get(connection->auth_password)); } if (pn_string_size(connection->hostname)) { if (transport->sasl) { pni_sasl_set_remote_hostname(transport, pn_string_get(connection->hostname)); } // be sure not to overwrite a hostname already set by the user via // pn_ssl_set_peer_hostname() called before the bind if (transport->ssl) { size_t name_len = 0; pn_ssl_get_peer_hostname((pn_ssl_t*) transport, NULL, &name_len); if (name_len == 0) { pn_ssl_set_peer_hostname((pn_ssl_t*) transport, pn_string_get(connection->hostname)); } } } if (transport->open_rcvd) { PN_SET_REMOTE(connection->endpoint.state, PN_REMOTE_ACTIVE); pni_post_remote_open_events(transport, connection); transport->halt = false; transport_consume(transport); // blech - testBindAfterOpen } return 0; } void pni_transport_unbind_handles(pn_hash_t *handles, bool reset_state) { for (pn_handle_t h = pn_hash_head(handles); h; h = pn_hash_next(handles, h)) { uintptr_t key = pn_hash_key(handles, h); pn_link_t *link = (pn_link_t *) pn_hash_value(handles, h); if (reset_state) { pn_link_unbound(link); } pn_ep_decref(&link->endpoint); pn_hash_del(handles, key); } } void pni_transport_unbind_channels(pn_hash_t *channels) { for (pn_handle_t h = pn_hash_head(channels); h; h = pn_hash_next(channels, h)) { uintptr_t key = pn_hash_key(channels, h); pn_session_t *ssn = (pn_session_t *) pn_hash_value(channels, h); pni_delivery_map_clear(&ssn->state.incoming); pni_delivery_map_clear(&ssn->state.outgoing); pni_transport_unbind_handles(ssn->state.local_handles, true); pni_transport_unbind_handles(ssn->state.remote_handles, true); pn_session_unbound(ssn); pn_ep_decref(&ssn->endpoint); pn_hash_del(channels, key); } } int pn_transport_unbind(pn_transport_t *transport) { assert(transport); if (!transport->connection) return 0; pn_connection_t *conn = transport->connection; transport->connection = NULL; bool was_referenced = transport->referenced; pn_collector_put(conn->collector, PN_OBJECT, conn, PN_CONNECTION_UNBOUND); // XXX: what happens if the endpoints are freed before we get here? pn_session_t *ssn = pn_session_head(conn, 0); while (ssn) { pni_delivery_map_clear(&ssn->state.incoming); pni_delivery_map_clear(&ssn->state.outgoing); ssn = pn_session_next(ssn, 0); } pn_endpoint_t *endpoint = conn->endpoint_head; while (endpoint) { pn_condition_clear(&endpoint->remote_condition); pn_modified(conn, endpoint, true); endpoint = endpoint->endpoint_next; } pni_transport_unbind_channels(transport->local_channels); pni_transport_unbind_channels(transport->remote_channels); pn_connection_unbound(conn); if (was_referenced) { pn_decref(conn); } return 0; } pn_error_t *pn_transport_error(pn_transport_t *transport) { assert(transport); if (pn_condition_is_set(&transport->condition)) { pn_error_format(transport->error, PN_ERR, "%s: %s", pn_condition_get_name(&transport->condition), pn_condition_get_description(&transport->condition)); } else { pn_error_clear(transport->error); } return transport->error; } pn_condition_t *pn_transport_condition(pn_transport_t *transport) { assert(transport); return &transport->condition; } static void pni_map_remote_handle(pn_link_t *link, uint32_t handle) { link->state.remote_handle = handle; pn_hash_put(link->session->state.remote_handles, handle, link); pn_ep_incref(&link->endpoint); } static void pni_unmap_remote_handle(pn_link_t *link) { uintptr_t handle = link->state.remote_handle; link->state.remote_handle = -2; if (pn_hash_get(link->session->state.remote_handles, handle)) { pn_ep_decref(&link->endpoint); } // may delete link: pn_hash_del(link->session->state.remote_handles, handle); } static pn_link_t *pni_handle_state(pn_session_t *ssn, uint32_t handle) { return (pn_link_t *) pn_hash_get(ssn->state.remote_handles, handle); } bool pni_disposition_batchable(pn_disposition_t *disposition) { switch (disposition->type) { case PN_ACCEPTED: return true; case PN_RELEASED: return true; default: return false; } } static int pni_disposition_encode(pn_disposition_t *disposition, pn_data_t *data) { pn_condition_t *cond = &disposition->condition; switch (disposition->type) { case PN_RECEIVED: PN_RETURN_IF_ERROR(pn_data_put_list(data)); pn_data_enter(data); PN_RETURN_IF_ERROR(pn_data_put_uint(data, disposition->section_number)); PN_RETURN_IF_ERROR(pn_data_put_ulong(data, disposition->section_offset)); pn_data_exit(data); return 0; case PN_ACCEPTED: case PN_RELEASED: return 0; case PN_REJECTED: return pn_data_fill(data, "[?DL[sSC]]", pn_condition_is_set(cond), ERROR, pn_condition_get_name(cond), pn_condition_get_description(cond), pn_condition_info(cond)); case PN_MODIFIED: return pn_data_fill(data, "[ooC]", disposition->failed, disposition->undeliverable, disposition->annotations); default: return pn_data_copy(data, disposition->data); } } void pn_do_trace(pn_transport_t *transport, uint16_t ch, pn_dir_t dir, pn_data_t *args, const char *payload, size_t size) { if (transport->trace & PN_TRACE_FRM) { pn_string_format(transport->scratch, "%u %s ", ch, dir == OUT ? "->" : "<-"); pn_inspect(args, transport->scratch); if (pn_data_size(args)==0) { pn_string_addf(transport->scratch, "(EMPTY FRAME)"); } if (size) { char buf[1024]; int e = pn_quote_data(buf, 1024, payload, size); pn_string_addf(transport->scratch, " (%" PN_ZU ") \"%s\"%s", size, buf, e == PN_OVERFLOW ? "... (truncated)" : ""); } pn_transport_log(transport, pn_string_get(transport->scratch)); } } int pn_post_frame(pn_transport_t *transport, uint8_t type, uint16_t ch, const char *fmt, ...) { pn_buffer_t *frame_buf = transport->frame; va_list ap; va_start(ap, fmt); pn_data_clear(transport->output_args); int err = pn_data_vfill(transport->output_args, fmt, ap); va_end(ap); if (err) { pn_transport_logf(transport, "error posting frame: %s, %s: %s", fmt, pn_code(err), pn_error_text(pn_data_error(transport->output_args))); return PN_ERR; } pn_do_trace(transport, ch, OUT, transport->output_args, NULL, 0); encode_performatives: pn_buffer_clear( frame_buf ); pn_rwbytes_t buf = pn_buffer_memory( frame_buf ); buf.size = pn_buffer_available( frame_buf ); ssize_t wr = pn_data_encode( transport->output_args, buf.start, buf.size ); if (wr < 0) { if (wr == PN_OVERFLOW) { pn_buffer_ensure( frame_buf, pn_buffer_available( frame_buf ) * 2 ); goto encode_performatives; } pn_transport_logf(transport, "error posting frame: %s", pn_code(wr)); return PN_ERR; } pn_frame_t frame = {AMQP_FRAME_TYPE}; frame.type = type; frame.channel = ch; frame.payload = buf.start; frame.size = wr; pn_buffer_ensure(transport->output_buffer, AMQP_HEADER_SIZE+frame.ex_size+frame.size); pn_write_frame(transport->output_buffer, frame); transport->output_frames_ct += 1; if (transport->trace & PN_TRACE_RAW) { pn_string_set(transport->scratch, "RAW: \""); pn_buffer_quote(transport->output_buffer, transport->scratch, AMQP_HEADER_SIZE+frame.ex_size+frame.size); pn_string_addf(transport->scratch, "\""); pn_transport_log(transport, pn_string_get(transport->scratch)); } return 0; } static int pni_post_amqp_transfer_frame(pn_transport_t *transport, uint16_t ch, uint32_t handle, pn_sequence_t id, pn_bytes_t *payload, const pn_bytes_t *tag, uint32_t message_format, bool settled, bool more, pn_sequence_t frame_limit, uint64_t code, pn_data_t* state, bool resume, bool aborted, bool batchable) { bool more_flag = more; int framecount = 0; pn_buffer_t *frame = transport->frame; // create preformatives, assuming 'more' flag need not change compute_performatives: pn_data_clear(transport->output_args); int err = pn_data_fill(transport->output_args, "DL[IIzI?o?on?DLC?o?o?o]", TRANSFER, handle, id, tag->size, tag->start, message_format, settled, settled, more_flag, more_flag, (bool)code, code, state, resume, resume, aborted, aborted, batchable, batchable); if (err) { pn_transport_logf(transport, "error posting transfer frame: %s: %s", pn_code(err), pn_error_text(pn_data_error(transport->output_args))); return PN_ERR; } do { // send as many frames as possible without changing the 'more' flag... encode_performatives: pn_buffer_clear( frame ); pn_rwbytes_t buf = pn_buffer_memory( frame ); buf.size = pn_buffer_available( frame ); ssize_t wr = pn_data_encode(transport->output_args, buf.start, buf.size); if (wr < 0) { if (wr == PN_OVERFLOW) { pn_buffer_ensure( frame, pn_buffer_available( frame ) * 2 ); goto encode_performatives; } pn_transport_logf(transport, "error posting frame: %s", pn_code(wr)); return PN_ERR; } buf.size = wr; // check if we need to break up the outbound frame size_t available = payload->size; if (transport->remote_max_frame) { if ((available + buf.size) > transport->remote_max_frame - 8) { available = transport->remote_max_frame - 8 - buf.size; if (more_flag == false) { more_flag = true; goto compute_performatives; // deal with flag change } } else if (more_flag == true && more == false) { // caller has no more, and this is the last frame more_flag = false; goto compute_performatives; } } if (pn_buffer_available( frame ) < (available + buf.size)) { // not enough room for payload - try again... pn_buffer_ensure( frame, available + buf.size ); goto encode_performatives; } pn_do_trace(transport, ch, OUT, transport->output_args, payload->start, available); memmove( buf.start + buf.size, payload->start, available); payload->start += available; payload->size -= available; buf.size += available; pn_frame_t frame = {AMQP_FRAME_TYPE}; frame.channel = ch; frame.payload = buf.start; frame.size = buf.size; pn_buffer_ensure(transport->output_buffer, AMQP_HEADER_SIZE+frame.ex_size+frame.size); pn_write_frame(transport->output_buffer, frame); transport->output_frames_ct += 1; framecount++; if (transport->trace & PN_TRACE_RAW) { pn_string_set(transport->scratch, "RAW: \""); pn_buffer_quote(transport->output_buffer, transport->scratch, AMQP_HEADER_SIZE+frame.ex_size+frame.size); pn_string_addf(transport->scratch, "\""); pn_transport_log(transport, pn_string_get(transport->scratch)); } } while (payload->size > 0 && framecount < frame_limit); return framecount; } static int pni_post_close(pn_transport_t *transport, pn_condition_t *cond) { if (!cond && transport->connection) { cond = pn_connection_condition(transport->connection); } const char *condition = NULL; const char *description = NULL; pn_data_t *info = NULL; if (pn_condition_is_set(cond)) { condition = pn_condition_get_name(cond); description = pn_condition_get_description(cond); info = pn_condition_info(cond); } return pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[?DL[sSC]]", CLOSE, (bool) condition, ERROR, condition, description, info); } static pn_collector_t *pni_transport_collector(pn_transport_t *transport) { if (transport->connection && transport->connection->collector) { return transport->connection->collector; } else { return NULL; } } static void pni_maybe_post_closed(pn_transport_t *transport) { pn_collector_t *collector = pni_transport_collector(transport); if (transport->head_closed && transport->tail_closed) { pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_CLOSED); } } static void pni_close_tail(pn_transport_t *transport) { if (!transport->tail_closed) { transport->tail_closed = true; pn_collector_t *collector = pni_transport_collector(transport); pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_TAIL_CLOSED); pni_maybe_post_closed(transport); } } int pn_do_error(pn_transport_t *transport, const char *condition, const char *fmt, ...) { va_list ap; va_start(ap, fmt); char buf[1024]; if (fmt) { // XXX: result pni_vsnprintf(buf, 1024, fmt, ap); } else { buf[0] = '\0'; } va_end(ap); pn_condition_t *cond = &transport->condition; if (!pn_condition_is_set(cond)) { pn_condition_set_name(cond, condition); if (fmt) { pn_condition_set_description(cond, buf); } } else { const char *first = pn_condition_get_description(cond); if (first && fmt) { char extended[2048]; pni_snprintf(extended, 2048, "%s (%s)", first, buf); pn_condition_set_description(cond, extended); } else if (fmt) { pn_condition_set_description(cond, buf); } } pn_collector_t *collector = pni_transport_collector(transport); pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_ERROR); if (transport->trace & PN_TRACE_DRV) { pn_transport_logf(transport, "ERROR %s %s", condition, buf); } for (int i = 0; iio_layers[i] && transport->io_layers[i]->handle_error) transport->io_layers[i]->handle_error(transport, i); } pni_close_tail(transport); return PN_ERR; } static char *pn_bytes_strdup(pn_bytes_t str) { return pn_strndup(str.start, str.size); } int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_connection_t *conn = transport->connection; bool container_q, hostname_q, remote_channel_max_q, remote_max_frame_q; uint16_t remote_channel_max; uint32_t remote_max_frame; pn_bytes_t remote_container, remote_hostname; pn_data_clear(transport->remote_offered_capabilities); pn_data_clear(transport->remote_desired_capabilities); pn_data_clear(transport->remote_properties); int err = pn_data_scan(args, "D.[?S?S?I?HI..CCC]", &container_q, &remote_container, &hostname_q, &remote_hostname, &remote_max_frame_q, &remote_max_frame, &remote_channel_max_q, &remote_channel_max, &transport->remote_idle_timeout, transport->remote_offered_capabilities, transport->remote_desired_capabilities, transport->remote_properties); if (err) return err; /* * The default value is already stored in the variable. * But the scanner zeroes out values if it does not * find them in the args, so don't give the variable * directly to the scanner. */ transport->remote_channel_max = remote_channel_max_q ? remote_channel_max : OPEN_CHANNEL_MAX_DEFAULT; transport->remote_max_frame = remote_max_frame_q ? remote_max_frame : OPEN_MAX_FRAME_SIZE_DEFAULT; if (transport->remote_max_frame > 0) { if (transport->remote_max_frame < AMQP_MIN_MAX_FRAME_SIZE) { pn_transport_logf(transport, "Peer advertised bad max-frame (%u), forcing to %u", transport->remote_max_frame, AMQP_MIN_MAX_FRAME_SIZE); transport->remote_max_frame = AMQP_MIN_MAX_FRAME_SIZE; } } free(transport->remote_container); transport->remote_container = container_q ? pn_bytes_strdup(remote_container) : NULL; free(transport->remote_hostname); transport->remote_hostname = hostname_q ? pn_bytes_strdup(remote_hostname) : NULL; if (conn) { PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_ACTIVE); pni_post_remote_open_events(transport, conn); } else { transport->halt = true; } transport->open_rcvd = true; pni_calculate_channel_max(transport); return 0; } int pn_do_begin(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { bool reply; uint16_t remote_channel; pn_sequence_t next; int err = pn_data_scan(args, "D.[?HI]", &reply, &remote_channel, &next); if (err) return err; // AMQP 1.0 section 2.7.1 - if the peer doesn't honor our channel_max -- // express our displeasure by closing the connection with a framing error. if (channel > transport->channel_max) { pn_do_error(transport, "amqp:connection:framing-error", "remote channel %d is above negotiated channel_max %d.", channel, transport->channel_max ); return PN_TRANSPORT_ERROR; } pn_session_t *ssn; if (reply) { ssn = (pn_session_t *) pn_hash_get(transport->local_channels, remote_channel); if (ssn == 0) { pn_do_error(transport, "amqp:invalid-field", "begin reply to unknown channel %d.", remote_channel ); return PN_TRANSPORT_ERROR; } } else { ssn = pn_session(transport->connection); } ssn->state.incoming_transfer_count = next; pni_map_remote_channel(ssn, channel); PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_ACTIVE); pn_collector_put(transport->connection->collector, PN_OBJECT, ssn, PN_SESSION_REMOTE_OPEN); return 0; } pn_link_t *pn_find_link(pn_session_t *ssn, pn_bytes_t name, bool is_sender) { pn_endpoint_type_t type = is_sender ? SENDER : RECEIVER; for (size_t i = 0; i < pn_list_size(ssn->links); i++) { pn_link_t *link = (pn_link_t *) pn_list_get(ssn->links, i); if (link->endpoint.type == type && // This function is used to locate the link object for an // incoming attach. If a link object of the same name is found // which is closed both locally and remotely, assume that is // no longer in use. !((link->endpoint.state & PN_LOCAL_CLOSED) && (link->endpoint.state & PN_REMOTE_CLOSED)) && pn_bytes_equal(name, pn_string_bytes(link->name))) { return link; } } return NULL; } static pn_expiry_policy_t symbol2policy(pn_bytes_t symbol) { if (!symbol.start) return PN_EXPIRE_WITH_SESSION; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(link-detach))) return PN_EXPIRE_WITH_LINK; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(session-end))) return PN_EXPIRE_WITH_SESSION; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(connection-close))) return PN_EXPIRE_WITH_CONNECTION; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(never))) return PN_EXPIRE_NEVER; return PN_EXPIRE_WITH_SESSION; } static pn_distribution_mode_t symbol2dist_mode(const pn_bytes_t symbol) { if (!symbol.start) return PN_DIST_MODE_UNSPECIFIED; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(move))) return PN_DIST_MODE_MOVE; if (pn_bytes_equal(symbol, PN_BYTES_LITERAL(copy))) return PN_DIST_MODE_COPY; return PN_DIST_MODE_UNSPECIFIED; } static const char *dist_mode2symbol(const pn_distribution_mode_t mode) { switch (mode) { case PN_DIST_MODE_COPY: return "copy"; case PN_DIST_MODE_MOVE: return "move"; default: return NULL; } } int pn_terminus_set_address_bytes(pn_terminus_t *terminus, pn_bytes_t address) { assert(terminus); return pn_string_setn(terminus->address, address.start, address.size); } int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_bytes_t name; uint32_t handle; bool is_sender; pn_bytes_t source, target; pn_durability_t src_dr, tgt_dr; pn_bytes_t src_exp, tgt_exp; pn_seconds_t src_timeout, tgt_timeout; bool src_dynamic, tgt_dynamic; pn_sequence_t idc; pn_bytes_t dist_mode; bool snd_settle, rcv_settle; uint8_t snd_settle_mode, rcv_settle_mode; uint64_t max_msgsz; int err = pn_data_scan(args, "D.[SIo?B?BD.[SIsIo.s]D.[SIsIo]..IL]", &name, &handle, &is_sender, &snd_settle, &snd_settle_mode, &rcv_settle, &rcv_settle_mode, &source, &src_dr, &src_exp, &src_timeout, &src_dynamic, &dist_mode, &target, &tgt_dr, &tgt_exp, &tgt_timeout, &tgt_dynamic, &idc, &max_msgsz); if (err) return err; char strbuf[128]; // avoid malloc for most link names char *strheap = (name.size >= sizeof(strbuf)) ? (char *) malloc(name.size + 1) : NULL; char *strname = strheap ? strheap : strbuf; if (name.size > 0) strncpy(strname, name.start, name.size); strname[name.size] = '\0'; pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); if (strheap) free(strheap); return PN_EOS; } pn_link_t *link = pn_find_link(ssn, name, is_sender); if (!link) { if (is_sender) { link = (pn_link_t *) pn_sender(ssn, strname); } else { link = (pn_link_t *) pn_receiver(ssn, strname); } } if (strheap) { free(strheap); } pni_map_remote_handle(link, handle); PN_SET_REMOTE(link->endpoint.state, PN_REMOTE_ACTIVE); pn_terminus_t *rsrc = &link->remote_source; if (source.start || src_dynamic) { pn_terminus_set_type(rsrc, PN_SOURCE); pn_terminus_set_address_bytes(rsrc, source); pn_terminus_set_durability(rsrc, src_dr); pn_terminus_set_expiry_policy(rsrc, symbol2policy(src_exp)); pn_terminus_set_timeout(rsrc, src_timeout); pn_terminus_set_dynamic(rsrc, src_dynamic); pn_terminus_set_distribution_mode(rsrc, symbol2dist_mode(dist_mode)); } else { pn_terminus_set_type(rsrc, PN_UNSPECIFIED); } pn_terminus_t *rtgt = &link->remote_target; if (target.start || tgt_dynamic) { pn_terminus_set_type(rtgt, PN_TARGET); pn_terminus_set_address_bytes(rtgt, target); pn_terminus_set_durability(rtgt, tgt_dr); pn_terminus_set_expiry_policy(rtgt, symbol2policy(tgt_exp)); pn_terminus_set_timeout(rtgt, tgt_timeout); pn_terminus_set_dynamic(rtgt, tgt_dynamic); } else { uint64_t code = 0; pn_data_clear(link->remote_target.capabilities); err = pn_data_scan(args, "D.[.....D..DL[C]...]", &code, link->remote_target.capabilities); if (err) return err; if (code == COORDINATOR) { pn_terminus_set_type(rtgt, PN_COORDINATOR); } else if (code == TARGET) { pn_terminus_set_type(rtgt, PN_TARGET); } else { pn_terminus_set_type(rtgt, PN_UNSPECIFIED); } } if (snd_settle) link->remote_snd_settle_mode = snd_settle_mode; if (rcv_settle) link->remote_rcv_settle_mode = rcv_settle_mode; pn_data_clear(link->remote_source.properties); pn_data_clear(link->remote_source.filter); pn_data_clear(link->remote_source.outcomes); pn_data_clear(link->remote_source.capabilities); pn_data_clear(link->remote_target.properties); pn_data_clear(link->remote_target.capabilities); err = pn_data_scan(args, "D.[.....D.[.....C.C.CC]D.[.....CC]", link->remote_source.properties, link->remote_source.filter, link->remote_source.outcomes, link->remote_source.capabilities, link->remote_target.properties, link->remote_target.capabilities); if (err) return err; pn_data_rewind(link->remote_source.properties); pn_data_rewind(link->remote_source.filter); pn_data_rewind(link->remote_source.outcomes); pn_data_rewind(link->remote_source.capabilities); pn_data_rewind(link->remote_target.properties); pn_data_rewind(link->remote_target.capabilities); if (!is_sender) { link->state.delivery_count = idc; } if (max_msgsz) { link->remote_max_message_size = max_msgsz; } pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_OPEN); return 0; } static int pni_post_flow(pn_transport_t *transport, pn_session_t *ssn, pn_link_t *link); // free the delivery static void pn_full_settle(pn_delivery_map_t *db, pn_delivery_t *delivery) { assert(!delivery->work); pn_clear_tpwork(delivery); pn_delivery_map_del(db, delivery); pn_incref(delivery); pn_decref(delivery); } int pn_do_transfer(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { // XXX: multi transfer uint32_t handle; pn_bytes_t tag; bool id_present; pn_sequence_t id; bool settled; bool more; bool has_type; bool resume, aborted, batchable; uint64_t type; pn_data_clear(transport->disp_data); int err = pn_data_scan(args, "D.[I?Iz.oo.D?LCooo]", &handle, &id_present, &id, &tag, &settled, &more, &has_type, &type, transport->disp_data, &resume, &aborted, &batchable); if (err) return err; pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); } if (!ssn->state.incoming_window) { return pn_do_error(transport, "amqp:session:window-violation", "incoming session window exceeded"); } pn_link_t *link = pni_handle_state(ssn, handle); if (!link) { return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle); } pn_delivery_t *delivery; if (link->unsettled_tail && !link->unsettled_tail->done) { delivery = link->unsettled_tail; } else { pn_delivery_map_t *incoming = &ssn->state.incoming; if (!ssn->state.incoming_init) { incoming->next = id; ssn->state.incoming_init = true; ssn->incoming_deliveries++; } delivery = pn_delivery(link, pn_dtag(tag.start, tag.size)); pn_delivery_state_t *state = pni_delivery_map_push(incoming, delivery); if (id_present && id != state->id) { return pn_do_error(transport, "amqp:session:invalid-field", "sequencing error, expected delivery-id %u, got %u", state->id, id); } if (has_type) { delivery->remote.type = type; pn_data_copy(delivery->remote.data, transport->disp_data); } link->state.delivery_count++; link->state.link_credit--; link->queued++; // XXX: need to fill in remote state: delivery->remote.state = ...; delivery->remote.settled = settled; if (settled) { delivery->updated = true; pn_work_update(transport->connection, delivery); } } pn_buffer_append(delivery->bytes, payload->start, payload->size); ssn->incoming_bytes += payload->size; delivery->done = !more; ssn->state.incoming_transfer_count++; ssn->state.incoming_window--; // XXX: need better policy for when to refresh window if (!ssn->state.incoming_window && (int32_t) link->state.local_handle >= 0) { pni_post_flow(transport, ssn, link); } if ((delivery->aborted = aborted)) { delivery->remote.settled = true; delivery->done = true; delivery->updated = true; pn_work_update(transport->connection, delivery); } pn_collector_put(transport->connection->collector, PN_OBJECT, delivery, PN_DELIVERY); return 0; } int pn_do_flow(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_sequence_t onext, inext, delivery_count; uint32_t iwin, owin, link_credit; uint32_t handle; bool inext_init, handle_init, dcount_init, drain; int err = pn_data_scan(args, "D.[?IIII?I?II.o]", &inext_init, &inext, &iwin, &onext, &owin, &handle_init, &handle, &dcount_init, &delivery_count, &link_credit, &drain); if (err) return err; pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); } if (inext_init) { ssn->state.remote_incoming_window = inext + iwin - ssn->state.outgoing_transfer_count; } else { ssn->state.remote_incoming_window = iwin; } if (handle_init) { pn_link_t *link = pni_handle_state(ssn, handle); if (!link) { return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle); } if (link->endpoint.type == SENDER) { pn_sequence_t receiver_count; if (dcount_init) { receiver_count = delivery_count; } else { // our initial delivery count receiver_count = 0; } pn_sequence_t old = link->state.link_credit; link->state.link_credit = receiver_count + link_credit - link->state.delivery_count; link->credit += link->state.link_credit - old; link->drain = drain; pn_delivery_t *delivery = pn_link_current(link); if (delivery) pn_work_update(transport->connection, delivery); } else { pn_sequence_t delta = delivery_count - link->state.delivery_count; if (delta > 0) { link->state.delivery_count += delta; link->state.link_credit -= delta; link->credit -= delta; link->drained += delta; } } pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_FLOW); } return 0; } #define SCAN_ERROR_DEFAULT ("D.[D.[sSC]") #define SCAN_ERROR_DETACH ("D.[..D.[sSC]") #define SCAN_ERROR_DISP ("[D.[sSC]") static int pn_scan_error(pn_data_t *data, pn_condition_t *condition, const char *fmt) { pn_bytes_t cond; pn_bytes_t desc; pn_condition_clear(condition); int err = pn_data_scan(data, fmt, &cond, &desc, condition->info); if (err) return err; pn_string_setn(condition->name, cond.start, cond.size); pn_string_setn(condition->description, desc.start, desc.size); pn_data_rewind(condition->info); return 0; } /* This operator, inspired by code for the qpid cpp broker, gives the correct result when comparing sequence numbers implemented in a signed integer type. */ static inline int sequence_cmp(pn_sequence_t a, pn_sequence_t b) { return a-b; } int pn_do_disposition(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { bool role; pn_sequence_t first, last; uint64_t type = 0; bool last_init, settled, type_init; pn_data_clear(transport->disp_data); int err = pn_data_scan(args, "D.[oI?IoD?LC]", &role, &first, &last_init, &last, &settled, &type_init, &type, transport->disp_data); if (err) return err; if (!last_init) last = first; pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); } pn_delivery_map_t *deliveries; if (role) { deliveries = &ssn->state.outgoing; } else { deliveries = &ssn->state.incoming; } pn_data_rewind(transport->disp_data); bool remote_data = (pn_data_next(transport->disp_data) && pn_data_get_list(transport->disp_data) > 0); for (pn_sequence_t id = first; sequence_cmp(id, last) <= 0; ++id) { pn_delivery_t *delivery = pni_delivery_map_get(deliveries, id); pn_disposition_t *remote = &delivery->remote; if (delivery) { if (type_init) remote->type = type; if (remote_data) { switch (type) { case PN_RECEIVED: pn_data_rewind(transport->disp_data); pn_data_next(transport->disp_data); pn_data_enter(transport->disp_data); if (pn_data_next(transport->disp_data)) remote->section_number = pn_data_get_uint(transport->disp_data); if (pn_data_next(transport->disp_data)) remote->section_offset = pn_data_get_ulong(transport->disp_data); break; case PN_ACCEPTED: break; case PN_REJECTED: err = pn_scan_error(transport->disp_data, &remote->condition, SCAN_ERROR_DISP); if (err) return err; break; case PN_RELEASED: break; case PN_MODIFIED: pn_data_rewind(transport->disp_data); pn_data_next(transport->disp_data); pn_data_enter(transport->disp_data); if (pn_data_next(transport->disp_data)) remote->failed = pn_data_get_bool(transport->disp_data); if (pn_data_next(transport->disp_data)) remote->undeliverable = pn_data_get_bool(transport->disp_data); pn_data_narrow(transport->disp_data); pn_data_clear(remote->data); pn_data_appendn(remote->annotations, transport->disp_data, 1); pn_data_widen(transport->disp_data); break; default: pn_data_copy(remote->data, transport->disp_data); break; } } remote->settled = settled; delivery->updated = true; pn_work_update(transport->connection, delivery); pn_collector_put(transport->connection->collector, PN_OBJECT, delivery, PN_DELIVERY); } } return 0; } int pn_do_detach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { uint32_t handle; bool closed; int err = pn_data_scan(args, "D.[Io]", &handle, &closed); if (err) return err; pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); } pn_link_t *link = pni_handle_state(ssn, handle); if (!link) { return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle); } err = pn_scan_error(args, &link->endpoint.remote_condition, SCAN_ERROR_DETACH); if (err) return err; if (closed) { PN_SET_REMOTE(link->endpoint.state, PN_REMOTE_CLOSED); pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_CLOSE); } else { pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_DETACH); } pni_unmap_remote_handle(link); return 0; } int pn_do_end(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_session_t *ssn = pni_channel_state(transport, channel); if (!ssn) { return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel); } int err = pn_scan_error(args, &ssn->endpoint.remote_condition, SCAN_ERROR_DEFAULT); if (err) return err; PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_CLOSED); pn_collector_put(transport->connection->collector, PN_OBJECT, ssn, PN_SESSION_REMOTE_CLOSE); pni_unmap_remote_channel(ssn); return 0; } int pn_do_close(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_connection_t *conn = transport->connection; int err = pn_scan_error(args, &transport->remote_condition, SCAN_ERROR_DEFAULT); if (err) return err; transport->close_rcvd = true; PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_CLOSED); pn_collector_put(transport->connection->collector, PN_OBJECT, conn, PN_CONNECTION_REMOTE_CLOSE); return 0; } // deprecated ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available) { if (!transport) return PN_ARG_ERR; if (available == 0) { return pn_transport_close_tail(transport); } const size_t original = available; ssize_t capacity = pn_transport_capacity(transport); if (capacity < 0) return capacity; while (available && capacity) { char *dest = pn_transport_tail(transport); assert(dest); size_t count = pn_min( (size_t)capacity, available ); memmove( dest, bytes, count ); available -= count; bytes += count; int rc = pn_transport_process( transport, count ); if (rc < 0) return rc; capacity = pn_transport_capacity(transport); if (capacity < 0) return capacity; } return original - available; } // process pending input until none remaining or EOS static ssize_t transport_consume(pn_transport_t *transport) { // This allows whatever is driving the I/O to set the error // condition on the transport before doing pn_transport_close_head() // or pn_transport_close_tail(). This allows all transport errors to // flow to the app the same way, but provides cleaner error messages // since we don't try to look for a protocol header when, e.g. the // connection was refused. if (!transport->bytes_input && transport->tail_closed && pn_condition_is_set(&transport->condition)) { pn_do_error(transport, NULL, NULL); return PN_EOS; } size_t consumed = 0; while (transport->input_pending || transport->tail_closed) { ssize_t n; n = transport->io_layers[0]-> process_input( transport, 0, transport->input_buf + consumed, transport->input_pending ); if (n > 0) { consumed += n; transport->input_pending -= n; } else if (n == 0) { break; } else { assert(n == PN_EOS); if (transport->trace & (PN_TRACE_RAW | PN_TRACE_FRM)) pn_transport_log(transport, " <- EOS"); transport->input_pending = 0; // XXX ??? return n; } } if (transport->input_pending && consumed) { memmove( transport->input_buf, &transport->input_buf[consumed], transport->input_pending ); } return consumed; } static int pni_process_conn_setup(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == CONNECTION) { if (!(endpoint->state & PN_LOCAL_UNINIT) && !transport->open_sent) { // as per the recommendation in the spec, advertise half our // actual timeout to the remote const pn_millis_t idle_timeout = transport->local_idle_timeout ? (transport->local_idle_timeout/2) : 0; pn_connection_t *connection = (pn_connection_t *) endpoint; const char *cid = pn_string_get(connection->container); pni_calculate_channel_max(transport); int err = pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[SS?I?H?InnCCC]", OPEN, cid ? cid : "", pn_string_get(connection->hostname), // TODO: This is messy, because we also have to allow local_max_frame_ to be 0 to mean unlimited // otherwise flow control goes wrong transport->local_max_frame!=0 && transport->local_max_frame!=OPEN_MAX_FRAME_SIZE_DEFAULT, transport->local_max_frame, transport->channel_max!=OPEN_CHANNEL_MAX_DEFAULT, transport->channel_max, (bool)idle_timeout, idle_timeout, connection->offered_capabilities, connection->desired_capabilities, connection->properties); if (err) return err; transport->open_sent = true; } } return 0; } static uint16_t allocate_alias(pn_hash_t *aliases, uint32_t max_index, int * valid) { for (uint32_t i = 0; i <= max_index; i++) { if (!pn_hash_get(aliases, i)) { * valid = 1; return i; } } * valid = 0; return 0; } static size_t pni_session_outgoing_window(pn_session_t *ssn) { return ssn->outgoing_window; } static size_t pni_session_incoming_window(pn_session_t *ssn) { uint32_t size = ssn->connection->transport->local_max_frame; if (!size) { return 2147483647; // biggest legal value } else { return (ssn->incoming_capacity - ssn->incoming_bytes)/size; } } static int pni_map_local_channel(pn_session_t *ssn) { pn_transport_t *transport = ssn->connection->transport; pn_session_state_t *state = &ssn->state; int valid; uint16_t channel = allocate_alias(transport->local_channels, transport->channel_max, & valid); if (!valid) { return 0; } state->local_channel = channel; pn_hash_put(transport->local_channels, channel, ssn); pn_ep_incref(&ssn->endpoint); return 1; } static int pni_process_ssn_setup(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == SESSION && transport->open_sent) { pn_session_t *ssn = (pn_session_t *) endpoint; pn_session_state_t *state = &ssn->state; if (!(endpoint->state & PN_LOCAL_UNINIT) && state->local_channel == (uint16_t) -1) { if (! pni_map_local_channel(ssn)) { pn_transport_logf(transport, "unable to find an open available channel within limit of %d", transport->channel_max ); return PN_ERR; } state->incoming_window = pni_session_incoming_window(ssn); state->outgoing_window = pni_session_outgoing_window(ssn); pn_post_frame(transport, AMQP_FRAME_TYPE, state->local_channel, "DL[?HIII]", BEGIN, ((int16_t) state->remote_channel >= 0), state->remote_channel, state->outgoing_transfer_count, state->incoming_window, state->outgoing_window); } } return 0; } static const char *expiry_symbol(pn_expiry_policy_t policy) { switch (policy) { case PN_EXPIRE_WITH_LINK: return "link-detach"; case PN_EXPIRE_WITH_SESSION: return NULL; case PN_EXPIRE_WITH_CONNECTION: return "connection-close"; case PN_EXPIRE_NEVER: return "never"; } return NULL; } static int pni_map_local_handle(pn_link_t *link) { pn_link_state_t *state = &link->state; pn_session_state_t *ssn_state = &link->session->state; int valid; // XXX TODO MICK: once changes are made to handle_max, change this hardcoded value to something reasonable. state->local_handle = allocate_alias(ssn_state->local_handles, 65536, & valid); if ( ! valid ) return 0; pn_hash_put(ssn_state->local_handles, state->local_handle, link); pn_ep_incref(&link->endpoint); return 1; } static int pni_process_link_setup(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (transport->open_sent && (endpoint->type == SENDER || endpoint->type == RECEIVER)) { pn_link_t *link = (pn_link_t *) endpoint; pn_session_state_t *ssn_state = &link->session->state; pn_link_state_t *state = &link->state; if (((int16_t) ssn_state->local_channel >= 0) && !(endpoint->state & PN_LOCAL_UNINIT) && state->local_handle == (uint32_t) -1) { pni_map_local_handle(link); const pn_distribution_mode_t dist_mode = link->source.distribution_mode; if (link->target.type == PN_COORDINATOR) { int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel, "DL[SIoBB?DL[SIsIoC?sCnCC]DL[C]nnI]", ATTACH, pn_string_get(link->name), state->local_handle, endpoint->type == RECEIVER, link->snd_settle_mode, link->rcv_settle_mode, (bool) link->source.type, SOURCE, pn_string_get(link->source.address), link->source.durability, expiry_symbol(link->source.expiry_policy), link->source.timeout, link->source.dynamic, link->source.properties, (dist_mode != PN_DIST_MODE_UNSPECIFIED), dist_mode2symbol(dist_mode), link->source.filter, link->source.outcomes, link->source.capabilities, COORDINATOR, link->target.capabilities, 0); if (err) return err; } else { int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel, "DL[SIoBB?DL[SIsIoC?sCnCC]?DL[SIsIoCC]nnIL]", ATTACH, pn_string_get(link->name), state->local_handle, endpoint->type == RECEIVER, link->snd_settle_mode, link->rcv_settle_mode, (bool) link->source.type, SOURCE, pn_string_get(link->source.address), link->source.durability, expiry_symbol(link->source.expiry_policy), link->source.timeout, link->source.dynamic, link->source.properties, (dist_mode != PN_DIST_MODE_UNSPECIFIED), dist_mode2symbol(dist_mode), link->source.filter, link->source.outcomes, link->source.capabilities, (bool) link->target.type, TARGET, pn_string_get(link->target.address), link->target.durability, expiry_symbol(link->target.expiry_policy), link->target.timeout, link->target.dynamic, link->target.properties, link->target.capabilities, 0, link->max_message_size); if (err) return err; } } } return 0; } static int pni_post_flow(pn_transport_t *transport, pn_session_t *ssn, pn_link_t *link) { ssn->state.incoming_window = pni_session_incoming_window(ssn); ssn->state.outgoing_window = pni_session_outgoing_window(ssn); bool linkq = (bool) link; pn_link_state_t *state = &link->state; return pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel, "DL[?IIII?I?I?In?o]", FLOW, (int16_t) ssn->state.remote_channel >= 0, ssn->state.incoming_transfer_count, ssn->state.incoming_window, ssn->state.outgoing_transfer_count, ssn->state.outgoing_window, linkq, linkq ? state->local_handle : 0, linkq, linkq ? state->delivery_count : 0, linkq, linkq ? state->link_credit : 0, linkq, linkq ? link->drain : false); } static int pni_process_flow_receiver(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == RECEIVER && endpoint->state & PN_LOCAL_ACTIVE) { pn_link_t *rcv = (pn_link_t *) endpoint; pn_session_t *ssn = rcv->session; pn_link_state_t *state = &rcv->state; if ((int16_t) ssn->state.local_channel >= 0 && (int32_t) state->local_handle >= 0 && ((rcv->drain || state->link_credit != rcv->credit - rcv->queued) || !ssn->state.incoming_window)) { state->link_credit = rcv->credit - rcv->queued; return pni_post_flow(transport, ssn, rcv); } } return 0; } static int pni_flush_disp(pn_transport_t *transport, pn_session_t *ssn) { uint64_t code = ssn->state.disp_code; bool settled = ssn->state.disp_settled; if (ssn->state.disp) { int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel, "DL[oI?I?o?DL[]]", DISPOSITION, ssn->state.disp_type, ssn->state.disp_first, ssn->state.disp_last!=ssn->state.disp_first, ssn->state.disp_last, settled, settled, (bool)code, code); if (err) return err; ssn->state.disp_type = 0; ssn->state.disp_code = 0; ssn->state.disp_settled = 0; ssn->state.disp_first = 0; ssn->state.disp_last = 0; ssn->state.disp = false; } return 0; } static int pni_post_disp(pn_transport_t *transport, pn_delivery_t *delivery) { pn_link_t *link = delivery->link; pn_session_t *ssn = link->session; pn_session_state_t *ssn_state = &ssn->state; pn_modified(transport->connection, &link->session->endpoint, false); pn_delivery_state_t *state = &delivery->state; assert(state->init); bool role = (link->endpoint.type == RECEIVER); uint64_t code = delivery->local.type; if (!code && !delivery->local.settled) { return 0; } if (!pni_disposition_batchable(&delivery->local)) { pn_data_clear(transport->disp_data); PN_RETURN_IF_ERROR(pni_disposition_encode(&delivery->local, transport->disp_data)); return pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel, "DL[oIn?o?DLC]", DISPOSITION, role, state->id, delivery->local.settled, delivery->local.settled, (bool)code, code, transport->disp_data); } if (ssn_state->disp && code == ssn_state->disp_code && delivery->local.settled == ssn_state->disp_settled && ssn_state->disp_type == role) { if (state->id == ssn_state->disp_first - 1) { ssn_state->disp_first = state->id; return 0; } else if (state->id == ssn_state->disp_last + 1) { ssn_state->disp_last = state->id; return 0; } } if (ssn_state->disp) { int err = pni_flush_disp(transport, ssn); if (err) return err; } ssn_state->disp_type = role; ssn_state->disp_code = code; ssn_state->disp_settled = delivery->local.settled; ssn_state->disp_first = state->id; ssn_state->disp_last = state->id; ssn_state->disp = true; return 0; } static int pni_process_tpwork_sender(pn_transport_t *transport, pn_delivery_t *delivery, bool *settle) { pn_link_t *link = delivery->link; pn_delivery_state_t *state = &delivery->state; if (delivery->aborted && !delivery->state.sending) { // Aborted delivery with no data yet sent, drop it and issue a FLOW as we may have credit. *settle = true; state->sent = true; pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_FLOW); return 0; } *settle = false; pn_session_state_t *ssn_state = &link->session->state; pn_link_state_t *link_state = &link->state; bool xfr_posted = false; if ((int16_t) ssn_state->local_channel >= 0 && (int32_t) link_state->local_handle >= 0) { if (!state->sent && (delivery->done || pn_buffer_size(delivery->bytes) > 0) && ssn_state->remote_incoming_window > 0 && link_state->link_credit > 0) { if (!state->init) { state = pni_delivery_map_push(&ssn_state->outgoing, delivery); } pn_bytes_t bytes = pn_buffer_bytes(delivery->bytes); size_t full_size = bytes.size; pn_bytes_t tag = pn_buffer_bytes(delivery->tag); pn_data_clear(transport->disp_data); PN_RETURN_IF_ERROR(pni_disposition_encode(&delivery->local, transport->disp_data)); int count = pni_post_amqp_transfer_frame(transport, ssn_state->local_channel, link_state->local_handle, state->id, &bytes, &tag, 0, // message-format delivery->local.settled, !delivery->done, ssn_state->remote_incoming_window, delivery->local.type, transport->disp_data, false, /* Resume */ delivery->aborted, false /* Batchable */ ); if (count < 0) return count; state->sending = true; xfr_posted = true; ssn_state->outgoing_transfer_count += count; ssn_state->remote_incoming_window -= count; int sent = full_size - bytes.size; pn_buffer_trim(delivery->bytes, sent, 0); link->session->outgoing_bytes -= sent; if (!pn_buffer_size(delivery->bytes) && delivery->done) { state->sent = true; link_state->delivery_count++; link_state->link_credit--; link->queued--; link->session->outgoing_deliveries--; } pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_FLOW); } } if (!state->init) state = NULL; if ((int16_t) ssn_state->local_channel >= 0 && !delivery->remote.settled && state && state->sent && !xfr_posted) { int err = pni_post_disp(transport, delivery); if (err) return err; } *settle = delivery->local.settled && state && state->sent; return 0; } static int pni_process_tpwork_receiver(pn_transport_t *transport, pn_delivery_t *delivery, bool *settle) { *settle = false; pn_link_t *link = delivery->link; // XXX: need to prevent duplicate disposition sending pn_session_t *ssn = link->session; if ((int16_t) ssn->state.local_channel >= 0 && !delivery->remote.settled && delivery->state.init) { int err = pni_post_disp(transport, delivery); if (err) return err; } // XXX: need to centralize this policy and improve it if (!ssn->state.incoming_window) { int err = pni_post_flow(transport, ssn, link); if (err) return err; } *settle = delivery->local.settled; return 0; } static int pni_process_tpwork(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == CONNECTION && !transport->close_sent) { pn_connection_t *conn = (pn_connection_t *) endpoint; pn_delivery_t *delivery = conn->tpwork_head; while (delivery) { pn_delivery_t *tp_next = delivery->tpwork_next; bool settle = false; pn_link_t *link = delivery->link; pn_delivery_map_t *dm = NULL; if (pn_link_is_sender(link)) { dm = &link->session->state.outgoing; int err = pni_process_tpwork_sender(transport, delivery, &settle); if (err) return err; } else { dm = &link->session->state.incoming; int err = pni_process_tpwork_receiver(transport, delivery, &settle); if (err) return err; } if (settle) { pn_full_settle(dm, delivery); } else if (!pn_delivery_buffered(delivery)) { pn_clear_tpwork(delivery); } delivery = tp_next; } } return 0; } static int pni_process_flush_disp(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == SESSION) { pn_session_t *session = (pn_session_t *) endpoint; pn_session_state_t *state = &session->state; if ((int16_t) state->local_channel >= 0 && !transport->close_sent) { int err = pni_flush_disp(transport, session); if (err) return err; } } return 0; } static int pni_process_flow_sender(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == SENDER && endpoint->state & PN_LOCAL_ACTIVE) { pn_link_t *snd = (pn_link_t *) endpoint; pn_session_t *ssn = snd->session; pn_link_state_t *state = &snd->state; if ((int16_t) ssn->state.local_channel >= 0 && (int32_t) state->local_handle >= 0 && snd->drain && snd->drained) { pn_delivery_t *tail = snd->unsettled_tail; if (!tail || !pn_delivery_buffered(tail)) { state->delivery_count += state->link_credit; state->link_credit = 0; snd->drained = 0; return pni_post_flow(transport, ssn, snd); } } } return 0; } static void pni_unmap_local_handle(pn_link_t *link) { pn_link_state_t *state = &link->state; uintptr_t handle = state->local_handle; state->local_handle = -2; if (pn_hash_get(link->session->state.local_handles, handle)) { pn_ep_decref(&link->endpoint); } // may delete link pn_hash_del(link->session->state.local_handles, handle); } static int pni_process_link_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == SENDER || endpoint->type == RECEIVER) { pn_link_t *link = (pn_link_t *) endpoint; pn_session_t *session = link->session; pn_session_state_t *ssn_state = &session->state; pn_link_state_t *state = &link->state; if (((endpoint->state & PN_LOCAL_CLOSED) || link->detached) && (int32_t) state->local_handle >= 0 && (int16_t) ssn_state->local_channel >= 0 && !transport->close_sent) { if (pn_link_is_sender(link) && pn_link_queued(link) && (int32_t) state->remote_handle != -2 && (int16_t) ssn_state->remote_channel != -2 && !transport->close_rcvd) return 0; const char *name = NULL; const char *description = NULL; pn_data_t *info = NULL; if (pn_condition_is_set(&endpoint->condition)) { name = pn_condition_get_name(&endpoint->condition); description = pn_condition_get_description(&endpoint->condition); info = pn_condition_info(&endpoint->condition); } int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel, "DL[I?o?DL[sSC]]", DETACH, state->local_handle, !link->detached, !link->detached, (bool)name, ERROR, name, description, info); if (err) return err; pni_unmap_local_handle(link); } pn_clear_modified(transport->connection, endpoint); } return 0; } static bool pni_pointful_buffering(pn_transport_t *transport, pn_session_t *session) { if (transport->close_rcvd) return false; if (!transport->open_rcvd) return true; pn_connection_t *conn = transport->connection; pn_link_t *link = pn_link_head(conn, 0); while (link) { if (pn_link_is_sender(link) && pn_link_queued(link) > 0) { pn_session_t *ssn = link->session; if (session && session == ssn) { if ((int32_t) link->state.remote_handle != -2 && (int16_t) session->state.remote_channel != -2) { return true; } } } link = pn_link_next(link, 0); } return false; } static void pni_unmap_local_channel(pn_session_t *ssn) { // XXX: should really update link state also pni_delivery_map_clear(&ssn->state.outgoing); pni_transport_unbind_handles(ssn->state.local_handles, false); pn_transport_t *transport = ssn->connection->transport; pn_session_state_t *state = &ssn->state; uintptr_t channel = state->local_channel; state->local_channel = -2; if (pn_hash_get(transport->local_channels, channel)) { pn_ep_decref(&ssn->endpoint); } // may delete session pn_hash_del(transport->local_channels, channel); } static int pni_process_ssn_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == SESSION) { pn_session_t *session = (pn_session_t *) endpoint; pn_session_state_t *state = &session->state; if (endpoint->state & PN_LOCAL_CLOSED && (int16_t) state->local_channel >= 0 && !transport->close_sent) { if (pni_pointful_buffering(transport, session)) { return 0; } const char *name = NULL; const char *description = NULL; pn_data_t *info = NULL; if (pn_condition_is_set(&endpoint->condition)) { name = pn_condition_get_name(&endpoint->condition); description = pn_condition_get_description(&endpoint->condition); info = pn_condition_info(&endpoint->condition); } int err = pn_post_frame(transport, AMQP_FRAME_TYPE, state->local_channel, "DL[?DL[sSC]]", END, (bool) name, ERROR, name, description, info); if (err) return err; pni_unmap_local_channel(session); } pn_clear_modified(transport->connection, endpoint); } return 0; } static int pni_process_conn_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint) { if (endpoint->type == CONNECTION) { if (endpoint->state & PN_LOCAL_CLOSED && !transport->close_sent) { if (pni_pointful_buffering(transport, NULL)) return 0; int err = pni_post_close(transport, NULL); if (err) return err; transport->close_sent = true; } pn_clear_modified(transport->connection, endpoint); } return 0; } static int pni_phase(pn_transport_t *transport, int (*phase)(pn_transport_t *, pn_endpoint_t *)) { pn_connection_t *conn = transport->connection; pn_endpoint_t *endpoint = conn->transport_head; while (endpoint) { pn_endpoint_t *next = endpoint->transport_next; int err = phase(transport, endpoint); if (err) return err; endpoint = next; } return 0; } static int pni_process(pn_transport_t *transport) { int err; if ((err = pni_phase(transport, pni_process_conn_setup))) return err; if ((err = pni_phase(transport, pni_process_ssn_setup))) return err; if ((err = pni_phase(transport, pni_process_link_setup))) return err; if ((err = pni_phase(transport, pni_process_flow_receiver))) return err; // XXX: this has to happen two times because we might settle stuff // on the first pass and create space for more work to be done on the // second pass if ((err = pni_phase(transport, pni_process_tpwork))) return err; if ((err = pni_phase(transport, pni_process_tpwork))) return err; if ((err = pni_phase(transport, pni_process_flush_disp))) return err; if ((err = pni_phase(transport, pni_process_flow_sender))) return err; if ((err = pni_phase(transport, pni_process_link_teardown))) return err; if ((err = pni_phase(transport, pni_process_ssn_teardown))) return err; if ((err = pni_phase(transport, pni_process_conn_teardown))) return err; if (transport->connection->tpwork_head) { pn_modified(transport->connection, &transport->connection->endpoint, false); } return 0; } #define AMQP_HEADER ("AMQP\x00\x01\x00\x00") static void pn_error_amqp(pn_transport_t* transport, unsigned int layer) { if (!transport->close_sent) { if (!transport->open_sent) { pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[S]", OPEN, ""); } pni_post_close(transport, &transport->condition); transport->close_sent = true; } transport->halt = true; transport->done_processing = true; } static ssize_t pn_input_read_amqp_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available) { bool eos = pn_transport_capacity(transport)==PN_EOS; pni_protocol_type_t protocol = pni_sniff_header(bytes, available); switch (protocol) { case PNI_PROTOCOL_AMQP1: if (transport->io_layers[layer] == &amqp_read_header_layer) { transport->io_layers[layer] = &amqp_layer; } else { transport->io_layers[layer] = &amqp_write_header_layer; } if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " <- %s", "AMQP"); return 8; case PNI_PROTOCOL_INSUFFICIENT: if (!eos) return 0; /* Fallthru */ default: break; } char quoted[1024]; pn_quote_data(quoted, 1024, bytes, available); pn_do_error(transport, "amqp:connection:framing-error", "%s header mismatch: %s ['%s']%s", "AMQP", pni_protocol_name(protocol), quoted, !eos ? "" : " (connection aborted)"); return PN_EOS; } static ssize_t pn_input_read_amqp(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available) { if (transport->close_rcvd) { if (available > 0) { pn_do_error(transport, "amqp:connection:framing-error", "data after close"); return PN_EOS; } } if (!transport->close_rcvd && !available) { pn_do_error(transport, "amqp:connection:framing-error", "connection aborted"); return PN_EOS; } ssize_t n = pn_dispatcher_input(transport, bytes, available, true, &transport->halt); if (n < 0) { //return pn_error_set(transport->error, n, "dispatch error"); return PN_EOS; } else if (transport->close_rcvd) { return PN_EOS; } else { return n; } } /* process AMQP related timer events */ static pn_timestamp_t pn_tick_amqp(pn_transport_t* transport, unsigned int layer, pn_timestamp_t now) { pn_timestamp_t timeout = 0; if (transport->local_idle_timeout) { if (transport->dead_remote_deadline == 0 || transport->last_bytes_input != transport->bytes_input) { transport->dead_remote_deadline = now + transport->local_idle_timeout; transport->last_bytes_input = transport->bytes_input; } else if (transport->dead_remote_deadline <= now) { transport->dead_remote_deadline = now + transport->local_idle_timeout; if (!transport->posted_idle_timeout) { transport->posted_idle_timeout = true; // Note: AMQP-1.0 really should define a generic "timeout" error, but does not. pn_do_error(transport, "amqp:resource-limit-exceeded", "local-idle-timeout expired"); } } timeout = transport->dead_remote_deadline; } // Prevent remote idle timeout as describe by AMQP 1.0: if (transport->remote_idle_timeout && !transport->close_sent) { if (transport->keepalive_deadline == 0 || transport->last_bytes_output != transport->bytes_output) { transport->keepalive_deadline = now + (pn_timestamp_t)(transport->remote_idle_timeout/2.0); transport->last_bytes_output = transport->bytes_output; } else if (transport->keepalive_deadline <= now) { transport->keepalive_deadline = now + (pn_timestamp_t)(transport->remote_idle_timeout/2.0); if (pn_buffer_size(transport->output_buffer) == 0) { // no outbound data pending // so send empty frame (and account for it!) pn_post_frame(transport, AMQP_FRAME_TYPE, 0, ""); transport->last_bytes_output += pn_buffer_size(transport->output_buffer); } } timeout = pn_timestamp_min( timeout, transport->keepalive_deadline ); } return timeout; } static ssize_t pn_output_write_amqp_header(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available) { if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, " -> %s", "AMQP"); assert(available >= 8); memmove(bytes, AMQP_HEADER, 8); if (pn_condition_is_set(&transport->condition)) { pn_error_amqp(transport, layer); transport->io_layers[layer] = &pni_error_layer; return pn_dispatcher_output(transport, bytes+8, available-8) + 8; } if (transport->io_layers[layer] == &amqp_write_header_layer) { transport->io_layers[layer] = &amqp_layer; } else { transport->io_layers[layer] = &amqp_read_header_layer; } return 8; } static ssize_t pn_output_write_amqp(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available) { if (transport->connection && !transport->done_processing) { int err = pni_process(transport); if (err) { pn_transport_logf(transport, "process error %i", err); transport->done_processing = true; } } // write out any buffered data _before_ returning PN_EOS, else we // could truncate an outgoing Close frame containing a useful error // status if (!pn_buffer_size(transport->output_buffer) && transport->close_sent) { return PN_EOS; } return pn_dispatcher_output(transport, bytes, available); } // Mark transport output as closed and send event static void pni_close_head(pn_transport_t *transport) { if (!transport->head_closed) { transport->head_closed = true; pn_collector_t *collector = pni_transport_collector(transport); pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_HEAD_CLOSED); pni_maybe_post_closed(transport); } } // generate outbound data, return amount of pending output else error static ssize_t transport_produce(pn_transport_t *transport) { if (transport->head_closed) return PN_EOS; ssize_t space = transport->output_size - transport->output_pending; if (space <= 0) { // can we expand the buffer? int more = 0; if (!transport->remote_max_frame) // no limit, so double it more = transport->output_size; else if (transport->remote_max_frame > transport->output_size) more = pn_min(transport->output_size, transport->remote_max_frame - transport->output_size); if (more) { char *newbuf = (char *)realloc( transport->output_buf, transport->output_size + more ); if (newbuf) { transport->output_buf = newbuf; transport->output_size += more; space += more; } } } while (space > 0) { ssize_t n; n = transport->io_layers[0]-> process_output( transport, 0, &transport->output_buf[transport->output_pending], space ); if (n > 0) { space -= n; transport->output_pending += n; } else if (n == 0) { break; } else { if (transport->output_pending) break; // return what is available if (transport->trace & (PN_TRACE_RAW | PN_TRACE_FRM)) { pn_transport_log(transport, " -> EOS"); } pni_close_head(transport); return n; } } return transport->output_pending; } // deprecated ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size) { if (!transport) return PN_ARG_ERR; ssize_t available = pn_transport_pending(transport); if (available > 0) { available = (ssize_t) pn_min( (size_t)available, size ); memmove( bytes, pn_transport_head(transport), available ); pn_transport_pop( transport, (size_t) available ); } return available; } void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace) { transport->trace = trace; } void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t tracer) { assert(transport); assert(tracer); transport->tracer = tracer; } pn_tracer_t pn_transport_get_tracer(pn_transport_t *transport) { assert(transport); return transport->tracer; } void pn_transport_set_context(pn_transport_t *transport, void *context) { assert(transport); pn_record_set(transport->context, PN_LEGCTX, context); } void *pn_transport_get_context(pn_transport_t *transport) { assert(transport); return pn_record_get(transport->context, PN_LEGCTX); } pn_record_t *pn_transport_attachments(pn_transport_t *transport) { assert(transport); return transport->context; } void pn_transport_log(pn_transport_t *transport, const char *message) { assert(transport); transport->tracer(transport, message); } void pn_transport_vlogf(pn_transport_t *transport, const char *fmt, va_list ap) { if (transport) { pn_string_vformat(transport->scratch, fmt, ap); pn_transport_log(transport, pn_string_get(transport->scratch)); } else { pn_vlogf(fmt, ap); } } void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...) { va_list ap; va_start(ap, fmt); pn_transport_vlogf(transport, fmt, ap); va_end(ap); } uint16_t pn_transport_get_channel_max(pn_transport_t *transport) { return transport->channel_max; } int pn_transport_set_channel_max(pn_transport_t *transport, uint16_t requested_channel_max) { /* * Once the OPEN frame has been sent, we have communicated our * wishes to the remote client and there is no way to renegotiate. * After that point, we do not allow the application to make changes. * Before that point, however, the app is free to either raise or * lower our local limit. (But the app cannot raise it above the * limit imposed by this library.) * The channel-max value will be finalized just before the OPEN frame * is sent. */ if(transport->open_sent) { pn_transport_logf(transport, "Cannot change local channel-max after OPEN frame sent."); return PN_STATE_ERR; } transport->local_channel_max = (requested_channel_max < PN_IMPL_CHANNEL_MAX) ? requested_channel_max : PN_IMPL_CHANNEL_MAX; pni_calculate_channel_max(transport); return PN_OK; } uint16_t pn_transport_remote_channel_max(pn_transport_t *transport) { return transport->remote_channel_max; } uint32_t pn_transport_get_max_frame(pn_transport_t *transport) { return transport->local_max_frame; } void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size) { // if size == 0, no advertised limit to input frame size. if (size && size < AMQP_MIN_MAX_FRAME_SIZE) size = AMQP_MIN_MAX_FRAME_SIZE; transport->local_max_frame = size; } uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport) { return transport->remote_max_frame; } pn_millis_t pn_transport_get_idle_timeout(pn_transport_t *transport) { return transport->local_idle_timeout; } void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout) { transport->local_idle_timeout = timeout; } pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport) { return transport->remote_idle_timeout; } pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now) { pn_timestamp_t r = 0; for (int i = 0; iio_layers[i] && transport->io_layers[i]->process_tick) r = pn_timestamp_min(r, transport->io_layers[i]->process_tick(transport, i, now)); } return r; } uint64_t pn_transport_get_frames_output(const pn_transport_t *transport) { if (transport) return transport->output_frames_ct; return 0; } uint64_t pn_transport_get_frames_input(const pn_transport_t *transport) { if (transport) return transport->input_frames_ct; return 0; } // input ssize_t pn_transport_capacity(pn_transport_t *transport) /* <0 == done */ { if (transport->tail_closed) return PN_EOS; //if (pn_error_code(transport->error)) return pn_error_code(transport->error); ssize_t capacity = transport->input_size - transport->input_pending; if ( capacity<=0 ) { // can we expand the size of the input buffer? int more = 0; if (!transport->local_max_frame) { // no limit (ha!) more = transport->input_size; } else if (transport->local_max_frame > transport->input_size) { more = pn_min(transport->input_size, transport->local_max_frame - transport->input_size); } if (more) { char *newbuf = (char *) realloc( transport->input_buf, transport->input_size + more ); if (newbuf) { transport->input_buf = newbuf; transport->input_size += more; capacity += more; } } } return capacity; } char *pn_transport_tail(pn_transport_t *transport) { if (transport && transport->input_pending < transport->input_size) { return &transport->input_buf[transport->input_pending]; } return NULL; } ssize_t pn_transport_push(pn_transport_t *transport, const char *src, size_t size) { assert(transport); ssize_t capacity = pn_transport_capacity(transport); if (capacity < 0) { return capacity; } else if (size > (size_t) capacity) { size = capacity; } char *dst = pn_transport_tail(transport); assert(dst); memmove(dst, src, size); int n = pn_transport_process(transport, size); if (n < 0) { return n; } else { return size; } } int pn_transport_process(pn_transport_t *transport, size_t size) { assert(transport); size = pn_min( size, (transport->input_size - transport->input_pending) ); transport->input_pending += size; transport->bytes_input += size; ssize_t n = transport_consume( transport ); if (n == PN_EOS) { pni_close_tail(transport); } if (n < 0 && n != PN_EOS) return n; return 0; } // input stream has closed int pn_transport_close_tail(pn_transport_t *transport) { pni_close_tail(transport); transport_consume( transport ); return 0; // XXX: what if not all input processed at this point? do we care??? } // output ssize_t pn_transport_pending(pn_transport_t *transport) /* <0 == done */ { assert(transport); return transport_produce( transport ); } const char *pn_transport_head(pn_transport_t *transport) { if (transport && transport->output_pending) { return transport->output_buf; } return NULL; } ssize_t pn_transport_peek(pn_transport_t *transport, char *dst, size_t size) { assert(transport); ssize_t pending = pn_transport_pending(transport); if (pending < 0) { return pending; } else if (size > (size_t) pending) { size = pending; } if (pending > 0) { const char *src = pn_transport_head(transport); assert(src); memmove(dst, src, size); } return size; } void pn_transport_pop(pn_transport_t *transport, size_t size) { if (transport) { assert( transport->output_pending >= size ); transport->output_pending -= size; transport->bytes_output += size; if (transport->output_pending) { memmove( transport->output_buf, &transport->output_buf[size], transport->output_pending ); } if (transport->output_pending==0 && pn_transport_pending(transport) < 0) { // TODO: It looks to me that this is a NOP as iff we ever get here // TODO: pni_close_head() will always have been already called before leaving pn_transport_pending() pni_close_head(transport); } } } int pn_transport_close_head(pn_transport_t *transport) { ssize_t pending = pn_transport_pending(transport); pni_close_head(transport); if (pending > 0) pn_transport_pop(transport, pending); return 0; } // true if the transport will not generate further output bool pn_transport_quiesced(pn_transport_t *transport) { if (!transport) return true; ssize_t pending = pn_transport_pending(transport); if (pending < 0) return true; // output done else if (pending > 0) return false; // no pending at transport, but check if data is buffered in I/O layers for (int layer = 0; layerio_layers[layer] && transport->io_layers[layer]->buffered_output && transport->io_layers[layer]->buffered_output( transport )) return false; } return true; } bool pn_transport_head_closed(pn_transport_t *transport) { return transport->head_closed; } bool pn_transport_tail_closed(pn_transport_t *transport) { return transport->tail_closed; } bool pn_transport_closed(pn_transport_t *transport) { return transport->head_closed && transport->tail_closed; } pn_connection_t *pn_transport_connection(pn_transport_t *transport) { assert(transport); return transport->connection; } qpid-proton-0.22.0/proton-c/src/core/object/0000775000000000000000000000000013257152177015477 5ustar qpid-proton-0.22.0/proton-c/src/core/object/string.c0000664000000000000000000001353113257152177017154 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "platform/platform.h" #include #include #include #include #include #include #include #define PNI_NULL_SIZE (-1) struct pn_string_t { char *bytes; ssize_t size; // PNI_NULL_SIZE (-1) means null size_t capacity; }; static void pn_string_finalize(void *object) { pn_string_t *string = (pn_string_t *) object; free(string->bytes); } static uintptr_t pn_string_hashcode(void *object) { pn_string_t *string = (pn_string_t *) object; if (string->size == PNI_NULL_SIZE) { return 0; } uintptr_t hashcode = 1; for (ssize_t i = 0; i < string->size; i++) { hashcode = hashcode * 31 + string->bytes[i]; } return hashcode; } static intptr_t pn_string_compare(void *oa, void *ob) { pn_string_t *a = (pn_string_t *) oa; pn_string_t *b = (pn_string_t *) ob; if (a->size != b->size) { return b->size - a->size; } if (a->size == PNI_NULL_SIZE) { return 0; } else { return memcmp(a->bytes, b->bytes, a->size); } } static int pn_string_inspect(void *obj, pn_string_t *dst) { pn_string_t *str = (pn_string_t *) obj; if (str->size == PNI_NULL_SIZE) { return pn_string_addf(dst, "null"); } int err = pn_string_addf(dst, "\""); if (err) return err; for (int i = 0; i < str->size; i++) { uint8_t c = str->bytes[i]; if (isprint(c)) { err = pn_string_addf(dst, "%c", c); if (err) return err; } else { err = pn_string_addf(dst, "\\x%.2x", c); if (err) return err; } } return pn_string_addf(dst, "\""); } pn_string_t *pn_string(const char *bytes) { return pn_stringn(bytes, bytes ? strlen(bytes) : 0); } #define pn_string_initialize NULL pn_string_t *pn_stringn(const char *bytes, size_t n) { static const pn_class_t clazz = PN_CLASS(pn_string); pn_string_t *string = (pn_string_t *) pn_class_new(&clazz, sizeof(pn_string_t)); string->capacity = n ? n * sizeof(char) : 16; string->bytes = (char *) malloc(string->capacity); pn_string_setn(string, bytes, n); return string; } const char *pn_string_get(pn_string_t *string) { assert(string); if (string->size == PNI_NULL_SIZE) { return NULL; } else { return string->bytes; } } size_t pn_string_size(pn_string_t *string) { assert(string); if (string->size == PNI_NULL_SIZE) { return 0; } else { return string->size; } } int pn_string_set(pn_string_t *string, const char *bytes) { return pn_string_setn(string, bytes, bytes ? strlen(bytes) : 0); } int pn_string_grow(pn_string_t *string, size_t capacity) { bool grow = false; while (string->capacity < (capacity*sizeof(char) + 1)) { string->capacity *= 2; grow = true; } if (grow) { char *growed = (char *) realloc(string->bytes, string->capacity); if (growed) { string->bytes = growed; } else { return PN_ERR; } } return 0; } int pn_string_setn(pn_string_t *string, const char *bytes, size_t n) { int err = pn_string_grow(string, n); if (err) return err; if (bytes) { memcpy(string->bytes, bytes, n*sizeof(char)); string->bytes[n] = '\0'; string->size = n; } else { string->size = PNI_NULL_SIZE; } return 0; } ssize_t pn_string_put(pn_string_t *string, char *dst) { assert(string); assert(dst); if (string->size != PNI_NULL_SIZE) { memcpy(dst, string->bytes, string->size + 1); } return string->size; } void pn_string_clear(pn_string_t *string) { pn_string_set(string, NULL); } int pn_string_format(pn_string_t *string, const char *format, ...) { va_list ap; va_start(ap, format); int err = pn_string_vformat(string, format, ap); va_end(ap); return err; } int pn_string_vformat(pn_string_t *string, const char *format, va_list ap) { pn_string_set(string, ""); return pn_string_vaddf(string, format, ap); } int pn_string_addf(pn_string_t *string, const char *format, ...) { va_list ap; va_start(ap, format); int err = pn_string_vaddf(string, format, ap); va_end(ap); return err; } int pn_string_vaddf(pn_string_t *string, const char *format, va_list ap) { va_list copy; if (string->size == PNI_NULL_SIZE) { return PN_ERR; } while (true) { va_copy(copy, ap); int err = pni_vsnprintf(string->bytes + string->size, string->capacity - string->size, format, copy); va_end(copy); if (err < 0) { return err; } else if ((size_t) err >= string->capacity - string->size) { pn_string_grow(string, string->size + err); } else { string->size += err; return 0; } } } char *pn_string_buffer(pn_string_t *string) { assert(string); return string->bytes; } size_t pn_string_capacity(pn_string_t *string) { assert(string); return string->capacity - 1; } int pn_string_resize(pn_string_t *string, size_t size) { assert(string); int err = pn_string_grow(string, size); if (err) return err; string->size = size; string->bytes[size] = '\0'; return 0; } int pn_string_copy(pn_string_t *string, pn_string_t *src) { assert(string); return pn_string_setn(string, pn_string_get(src), pn_string_size(src)); } qpid-proton-0.22.0/proton-c/src/core/object/record.c0000664000000000000000000000737213257152177017132 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include typedef struct { pn_handle_t key; const pn_class_t *clazz; void *value; } pni_field_t; struct pn_record_t { size_t size; size_t capacity; pni_field_t *fields; }; static void pn_record_initialize(void *object) { pn_record_t *record = (pn_record_t *) object; record->size = 0; record->capacity = 0; record->fields = NULL; } static void pn_record_finalize(void *object) { pn_record_t *record = (pn_record_t *) object; for (size_t i = 0; i < record->size; i++) { pni_field_t *v = &record->fields[i]; pn_class_decref(v->clazz, v->value); } free(record->fields); } #define pn_record_hashcode NULL #define pn_record_compare NULL #define pn_record_inspect NULL pn_record_t *pn_record(void) { static const pn_class_t clazz = PN_CLASS(pn_record); pn_record_t *record = (pn_record_t *) pn_class_new(&clazz, sizeof(pn_record_t)); pn_record_def(record, PN_LEGCTX, PN_VOID); return record; } static pni_field_t *pni_record_find(pn_record_t *record, pn_handle_t key) { for (size_t i = 0; i < record->size; i++) { pni_field_t *field = &record->fields[i]; if (field->key == key) { return field; } } return NULL; } static pni_field_t *pni_record_create(pn_record_t *record) { record->size++; if (record->size > record->capacity) { record->fields = (pni_field_t *) realloc(record->fields, record->size * sizeof(pni_field_t)); record->capacity = record->size; } pni_field_t *field = &record->fields[record->size - 1]; field->key = 0; field->clazz = NULL; field->value = NULL; return field; } void pn_record_def(pn_record_t *record, pn_handle_t key, const pn_class_t *clazz) { assert(record); assert(clazz); pni_field_t *field = pni_record_find(record, key); if (field) { assert(field->clazz == clazz); } else { field = pni_record_create(record); field->key = key; field->clazz = clazz; } } bool pn_record_has(pn_record_t *record, pn_handle_t key) { assert(record); pni_field_t *field = pni_record_find(record, key); if (field) { return true; } else { return false; } } void *pn_record_get(pn_record_t *record, pn_handle_t key) { assert(record); pni_field_t *field = pni_record_find(record, key); if (field) { return field->value; } else { return NULL; } } void pn_record_set(pn_record_t *record, pn_handle_t key, void *value) { assert(record); pni_field_t *field = pni_record_find(record, key); if (field) { void *old = field->value; field->value = value; pn_class_incref(field->clazz, value); pn_class_decref(field->clazz, old); } } void pn_record_clear(pn_record_t *record) { assert(record); for (size_t i = 0; i < record->size; i++) { pni_field_t *field = &record->fields[i]; pn_class_decref(field->clazz, field->value); field->key = 0; field->clazz = NULL; field->value = NULL; } record->size = 0; pn_record_def(record, PN_LEGCTX, PN_VOID); } qpid-proton-0.22.0/proton-c/src/core/object/object.c0000664000000000000000000001564113257152177017120 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #define pn_object_initialize NULL #define pn_object_finalize NULL #define pn_object_inspect NULL uintptr_t pn_object_hashcode(void *object) { return (uintptr_t) object; } intptr_t pn_object_compare(void *a, void *b) { return (intptr_t) a - (intptr_t) b; } const pn_class_t PN_OBJECT[] = {PN_CLASS(pn_object)}; #define pn_void_initialize NULL void *pn_void_new(const pn_class_t *clazz, size_t size) { return malloc(size); } void pn_void_incref(void* p) {} void pn_void_decref(void* p) {} int pn_void_refcount(void *object) { return -1; } #define pn_void_finalize NULL static void pn_void_free(void *object) { free(object); } static const pn_class_t *pn_void_reify(void *object) { return PN_VOID; } uintptr_t pn_void_hashcode(void *object) { return (uintptr_t) object; } intptr_t pn_void_compare(void *a, void *b) { return (intptr_t) a - (intptr_t) b; } int pn_void_inspect(void *object, pn_string_t *dst) { return pn_string_addf(dst, "%p", object); } const pn_class_t PN_VOID[] = {PN_METACLASS(pn_void)}; const char *pn_class_name(const pn_class_t *clazz) { return clazz->name; } pn_cid_t pn_class_id(const pn_class_t *clazz) { return clazz->cid; } void *pn_class_new(const pn_class_t *clazz, size_t size) { assert(clazz); void *object = clazz->newinst(clazz, size); if (clazz->initialize) { clazz->initialize(object); } return object; } void *pn_class_incref(const pn_class_t *clazz, void *object) { assert(clazz); if (object) { clazz = clazz->reify(object); clazz->incref(object); } return object; } int pn_class_refcount(const pn_class_t *clazz, void *object) { assert(clazz); clazz = clazz->reify(object); return clazz->refcount(object); } int pn_class_decref(const pn_class_t *clazz, void *object) { assert(clazz); if (object) { clazz = clazz->reify(object); clazz->decref(object); int rc = clazz->refcount(object); if (rc == 0) { if (clazz->finalize) { clazz->finalize(object); // check the refcount again in case the finalizer created a // new reference rc = clazz->refcount(object); } if (rc == 0) { clazz->free(object); return 0; } } else { return rc; } } return 0; } void pn_class_free(const pn_class_t *clazz, void *object) { assert(clazz); if (object) { clazz = clazz->reify(object); int rc = clazz->refcount(object); assert(rc == 1 || rc == -1); if (rc == 1) { rc = pn_class_decref(clazz, object); assert(rc == 0); } else { if (clazz->finalize) { clazz->finalize(object); } clazz->free(object); } } } const pn_class_t *pn_class_reify(const pn_class_t *clazz, void *object) { assert(clazz); return clazz->reify(object); } uintptr_t pn_class_hashcode(const pn_class_t *clazz, void *object) { assert(clazz); if (!object) return 0; clazz = clazz->reify(object); if (clazz->hashcode) { return clazz->hashcode(object); } else { return (uintptr_t) object; } } intptr_t pn_class_compare(const pn_class_t *clazz, void *a, void *b) { assert(clazz); if (a == b) return 0; clazz = clazz->reify(a); if (a && b && clazz->compare) { return clazz->compare(a, b); } else { return (intptr_t) a - (intptr_t) b; } } bool pn_class_equals(const pn_class_t *clazz, void *a, void *b) { return pn_class_compare(clazz, a, b) == 0; } int pn_class_inspect(const pn_class_t *clazz, void *object, pn_string_t *dst) { assert(clazz); clazz = clazz->reify(object); if (!pn_string_get(dst)) { pn_string_set(dst, ""); } if (object && clazz->inspect) { return clazz->inspect(object, dst); } const char *name = clazz->name ? clazz->name : ""; return pn_string_addf(dst, "%s<%p>", name, object); } typedef struct { const pn_class_t *clazz; int refcount; } pni_head_t; #define pni_head(PTR) \ (((pni_head_t *) (PTR)) - 1) void *pn_object_new(const pn_class_t *clazz, size_t size) { void *object = NULL; pni_head_t *head = (pni_head_t *) calloc(1, sizeof(pni_head_t) + size); if (head != NULL) { object = head + 1; head->clazz = clazz; head->refcount = 1; } return object; } const pn_class_t *pn_object_reify(void *object) { if (object) { return pni_head(object)->clazz; } else { return PN_OBJECT; } } void pn_object_incref(void *object) { if (object) { pni_head(object)->refcount++; } } int pn_object_refcount(void *object) { assert(object); return pni_head(object)->refcount; } void pn_object_decref(void *object) { pni_head_t *head = pni_head(object); assert(head->refcount > 0); head->refcount--; } void pn_object_free(void *object) { pni_head_t *head = pni_head(object); free(head); } void *pn_incref(void *object) { return pn_class_incref(PN_OBJECT, object); } int pn_decref(void *object) { return pn_class_decref(PN_OBJECT, object); } int pn_refcount(void *object) { return pn_class_refcount(PN_OBJECT, object); } void pn_free(void *object) { pn_class_free(PN_OBJECT, object); } const pn_class_t *pn_class(void *object) { return pn_class_reify(PN_OBJECT, object); } uintptr_t pn_hashcode(void *object) { return pn_class_hashcode(PN_OBJECT, object); } intptr_t pn_compare(void *a, void *b) { return pn_class_compare(PN_OBJECT, a, b); } bool pn_equals(void *a, void *b) { return !pn_compare(a, b); } int pn_inspect(void *object, pn_string_t *dst) { return pn_class_inspect(PN_OBJECT, object, dst); } #define pn_weakref_new NULL #define pn_weakref_initialize NULL #define pn_weakref_finalize NULL #define pn_weakref_free NULL static void pn_weakref_incref(void *object) {} static void pn_weakref_decref(void *object) {} static int pn_weakref_refcount(void *object) { return -1; } static const pn_class_t *pn_weakref_reify(void *object) { return PN_WEAKREF; } static uintptr_t pn_weakref_hashcode(void *object) { return pn_hashcode(object); } static intptr_t pn_weakref_compare(void *a, void *b) { return pn_compare(a, b); } static int pn_weakref_inspect(void *object, pn_string_t *dst) { return pn_inspect(object, dst); } const pn_class_t PN_WEAKREF[] = {PN_METACLASS(pn_weakref)}; qpid-proton-0.22.0/proton-c/src/core/object/map.c0000664000000000000000000002621013257152177016421 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #define PNI_ENTRY_FREE (0) #define PNI_ENTRY_LINK (1) #define PNI_ENTRY_TAIL (2) typedef struct { void *key; void *value; size_t next; uint8_t state; } pni_entry_t; struct pn_map_t { const pn_class_t *key; const pn_class_t *value; pni_entry_t *entries; size_t capacity; size_t addressable; size_t size; uintptr_t (*hashcode)(void *key); bool (*equals)(void *a, void *b); float load_factor; }; static void pn_map_finalize(void *object) { pn_map_t *map = (pn_map_t *) object; for (size_t i = 0; i < map->capacity; i++) { if (map->entries[i].state != PNI_ENTRY_FREE) { pn_class_decref(map->key, map->entries[i].key); pn_class_decref(map->value, map->entries[i].value); } } free(map->entries); } static uintptr_t pn_map_hashcode(void *object) { pn_map_t *map = (pn_map_t *) object; uintptr_t hashcode = 0; for (size_t i = 0; i < map->capacity; i++) { if (map->entries[i].state != PNI_ENTRY_FREE) { void *key = map->entries[i].key; void *value = map->entries[i].value; hashcode += pn_hashcode(key) ^ pn_hashcode(value); } } return hashcode; } static void pni_map_allocate(pn_map_t *map) { map->entries = (pni_entry_t *) malloc(map->capacity * sizeof (pni_entry_t)); if (map->entries != NULL) { for (size_t i = 0; i < map->capacity; i++) { map->entries[i].key = NULL; map->entries[i].value = NULL; map->entries[i].next = 0; map->entries[i].state = PNI_ENTRY_FREE; } } map->size = 0; } static int pn_map_inspect(void *obj, pn_string_t *dst) { assert(obj); pn_map_t *map = (pn_map_t *) obj; int err = pn_string_addf(dst, "{"); if (err) return err; pn_handle_t entry = pn_map_head(map); bool first = true; while (entry) { if (first) { first = false; } else { err = pn_string_addf(dst, ", "); if (err) return err; } err = pn_class_inspect(map->key, pn_map_key(map, entry), dst); if (err) return err; err = pn_string_addf(dst, ": "); if (err) return err; err = pn_class_inspect(map->value, pn_map_value(map, entry), dst); if (err) return err; entry = pn_map_next(map, entry); } return pn_string_addf(dst, "}"); } #define pn_map_initialize NULL #define pn_map_compare NULL pn_map_t *pn_map(const pn_class_t *key, const pn_class_t *value, size_t capacity, float load_factor) { static const pn_class_t clazz = PN_CLASS(pn_map); pn_map_t *map = (pn_map_t *) pn_class_new(&clazz, sizeof(pn_map_t)); map->key = key; map->value = value; map->capacity = capacity ? capacity : 16; map->addressable = (size_t) (map->capacity * 0.86); if (!map->addressable) map->addressable = map->capacity; map->load_factor = load_factor; map->hashcode = pn_hashcode; map->equals = pn_equals; pni_map_allocate(map); return map; } size_t pn_map_size(pn_map_t *map) { assert(map); return map->size; } static float pni_map_load(pn_map_t *map) { return ((float) map->size) / ((float) map->addressable); } static bool pni_map_ensure(pn_map_t *map, size_t capacity) { float load = pni_map_load(map); if (capacity <= map->capacity && load <= map->load_factor) { return false; } size_t oldcap = map->capacity; while (map->capacity < capacity || pni_map_load(map) > map->load_factor) { map->capacity *= 2; map->addressable = (size_t) (0.86 * map->capacity); } pni_entry_t *entries = map->entries; pni_map_allocate(map); for (size_t i = 0; i < oldcap; i++) { if (entries[i].state != PNI_ENTRY_FREE) { void *key = entries[i].key; void *value = entries[i].value; pn_map_put(map, key, value); } } for (size_t i = 0; i < oldcap; i++) { if (entries[i].state != PNI_ENTRY_FREE) { void *key = entries[i].key; void *value = entries[i].value; pn_class_decref(map->key, key); pn_class_decref(map->value, value); } } free(entries); return true; } static pni_entry_t *pni_map_entry(pn_map_t *map, void *key, pni_entry_t **pprev, bool create) { uintptr_t hashcode = map->hashcode(key); pni_entry_t *entry = &map->entries[hashcode % map->addressable]; pni_entry_t *prev = NULL; if (entry->state == PNI_ENTRY_FREE) { if (create) { entry->state = PNI_ENTRY_TAIL; entry->key = key; pn_class_incref(map->key, key); map->size++; return entry; } else { return NULL; } } while (true) { if (map->equals(entry->key, key)) { if (pprev) *pprev = prev; return entry; } if (entry->state == PNI_ENTRY_TAIL) { break; } else { prev = entry; entry = &map->entries[entry->next]; } } if (create) { if (pni_map_ensure(map, map->size + 1)) { // if we had to grow the table we need to start over return pni_map_entry(map, key, pprev, create); } size_t empty = 0; for (size_t i = 0; i < map->capacity; i++) { size_t idx = map->capacity - i - 1; if (map->entries[idx].state == PNI_ENTRY_FREE) { empty = idx; break; } } entry->next = empty; entry->state = PNI_ENTRY_LINK; map->entries[empty].state = PNI_ENTRY_TAIL; map->entries[empty].key = key; pn_class_incref(map->key, key); if (pprev) *pprev = entry; map->size++; return &map->entries[empty]; } else { return NULL; } } int pn_map_put(pn_map_t *map, void *key, void *value) { assert(map); pni_entry_t *entry = pni_map_entry(map, key, NULL, true); void *dref_val = entry->value; entry->value = value; pn_class_incref(map->value, value); pn_class_decref(map->value, dref_val); return 0; } void *pn_map_get(pn_map_t *map, void *key) { assert(map); pni_entry_t *entry = pni_map_entry(map, key, NULL, false); return entry ? entry->value : NULL; } static void pni_map_rehash(pn_map_t *map, size_t index) { //reinsert entries in chain starting at index assert(map); size_t i = index; bool complete = false; while (!complete) { pni_entry_t *entry = &map->entries[i]; assert(entry); assert(entry->state != PNI_ENTRY_FREE); size_t current = i; if (entry->state == PNI_ENTRY_TAIL) { complete = true; } else { assert(entry->state == PNI_ENTRY_LINK); i = entry->next; } uintptr_t hashcode = map->hashcode(entry->key); pni_entry_t *reloc = &map->entries[hashcode % map->addressable]; if (reloc->state == PNI_ENTRY_FREE) { //correct addressable slot is available, copy into that... reloc->state = PNI_ENTRY_TAIL; reloc->key = entry->key; reloc->value = entry->value; //...then free the current entry entry->key = NULL; entry->value = NULL; entry->state = PNI_ENTRY_FREE; entry->next = 0; } else { //iterate to end of chain... while (reloc->state == PNI_ENTRY_LINK) { reloc = &map->entries[reloc->next]; } assert(reloc->state == PNI_ENTRY_TAIL); //... and append current entry reloc->state = PNI_ENTRY_LINK; reloc->next = current; entry->state = PNI_ENTRY_TAIL; entry->next = 0; } } } void pn_map_del(pn_map_t *map, void *key) { assert(map); pni_entry_t *prev = NULL; pni_entry_t *entry = pni_map_entry(map, key, &prev, false); if (entry) { uint8_t orig_state = entry->state; size_t orig_next = entry->next; void *dref_key = entry->key; void *dref_value = entry->value; if (prev) { prev->next = 0; prev->state = PNI_ENTRY_TAIL; } entry->state = PNI_ENTRY_FREE; entry->next = 0; entry->key = NULL; entry->value = NULL; map->size--; if (orig_state == PNI_ENTRY_LINK) { pni_map_rehash(map, orig_next); } // do this last as it may trigger further deletions pn_class_decref(map->key, dref_key); pn_class_decref(map->value, dref_value); } } pn_handle_t pn_map_head(pn_map_t *map) { assert(map); for (size_t i = 0; i < map->capacity; i++) { if (map->entries[i].state != PNI_ENTRY_FREE) { return (pn_handle_t)(i + 1); } } return 0; } pn_handle_t pn_map_next(pn_map_t *map, pn_handle_t entry) { for (size_t i = (size_t)entry; i < map->capacity; i++) { if (map->entries[i].state != PNI_ENTRY_FREE) { return (pn_handle_t)(i + 1); } } return 0; } void *pn_map_key(pn_map_t *map, pn_handle_t entry) { assert(map); assert(entry); return map->entries[(size_t)entry - 1].key; } void *pn_map_value(pn_map_t *map, pn_handle_t entry) { assert(map); assert(entry); return map->entries[(size_t)entry - 1].value; } struct pn_hash_t { pn_map_t map; }; static uintptr_t pni_identity_hashcode(void *obj) { return (uintptr_t ) obj; } static bool pni_identity_equals(void *a, void *b) { return a == b; } #define CID_pni_uintptr CID_pn_void static const pn_class_t *pni_uintptr_reify(void *object); #define pni_uintptr_new NULL #define pni_uintptr_free NULL #define pni_uintptr_initialize NULL static void pni_uintptr_incref(void *object) {} static void pni_uintptr_decref(void *object) {} static int pni_uintptr_refcount(void *object) { return -1; } #define pni_uintptr_finalize NULL #define pni_uintptr_hashcode NULL #define pni_uintptr_compare NULL #define pni_uintptr_inspect NULL static const pn_class_t PN_UINTPTR[] = {PN_METACLASS(pni_uintptr)}; static const pn_class_t *pni_uintptr_reify(void *object) { return PN_UINTPTR; } pn_hash_t *pn_hash(const pn_class_t *clazz, size_t capacity, float load_factor) { pn_hash_t *hash = (pn_hash_t *) pn_map(PN_UINTPTR, clazz, capacity, load_factor); hash->map.hashcode = pni_identity_hashcode; hash->map.equals = pni_identity_equals; return hash; } size_t pn_hash_size(pn_hash_t *hash) { return pn_map_size(&hash->map); } int pn_hash_put(pn_hash_t *hash, uintptr_t key, void *value) { return pn_map_put(&hash->map, (void *) key, value); } void *pn_hash_get(pn_hash_t *hash, uintptr_t key) { return pn_map_get(&hash->map, (void *) key); } void pn_hash_del(pn_hash_t *hash, uintptr_t key) { pn_map_del(&hash->map, (void *) key); } pn_handle_t pn_hash_head(pn_hash_t *hash) { return pn_map_head(&hash->map); } pn_handle_t pn_hash_next(pn_hash_t *hash, pn_handle_t entry) { return pn_map_next(&hash->map, entry); } uintptr_t pn_hash_key(pn_hash_t *hash, pn_handle_t entry) { return (uintptr_t) pn_map_key(&hash->map, entry); } void *pn_hash_value(pn_hash_t *hash, pn_handle_t entry) { return pn_map_value(&hash->map, entry); } qpid-proton-0.22.0/proton-c/src/core/object/list.c0000664000000000000000000001425713257152177016627 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include struct pn_list_t { const pn_class_t *clazz; size_t capacity; size_t size; void **elements; }; size_t pn_list_size(pn_list_t *list) { assert(list); return list->size; } void *pn_list_get(pn_list_t *list, int index) { assert(list); assert(list->size); return list->elements[index % list->size]; } void pn_list_set(pn_list_t *list, int index, void *value) { assert(list); assert(list->size); void *old = list->elements[index % list->size]; pn_class_decref(list->clazz, old); list->elements[index % list->size] = value; pn_class_incref(list->clazz, value); } static void pni_list_ensure(pn_list_t *list, size_t capacity) { assert(list); if (list->capacity < capacity) { size_t newcap = list->capacity; while (newcap < capacity) { newcap *= 2; } list->elements = (void **) realloc(list->elements, newcap * sizeof(void *)); assert(list->elements); list->capacity = newcap; } } int pn_list_add(pn_list_t *list, void *value) { assert(list); pni_list_ensure(list, list->size + 1); list->elements[list->size++] = value; pn_class_incref(list->clazz, value); return 0; } void *pn_list_pop(pn_list_t *list) { assert(list); if (list->size) { return list->elements[--list->size]; } else { return NULL; } } ssize_t pn_list_index(pn_list_t *list, void *value) { for (size_t i = 0; i < list->size; i++) { if (pn_class_equals(list->clazz, list->elements[i], value)) { return i; } } return -1; } bool pn_list_remove(pn_list_t *list, void *value) { assert(list); ssize_t idx = pn_list_index(list, value); if (idx < 0) { return false; } else { pn_list_del(list, idx, 1); } return true; } void pn_list_del(pn_list_t *list, int index, int n) { assert(list); if (!list->size) { return; } index %= list->size; for (int i = 0; i < n; i++) { pn_class_decref(list->clazz, list->elements[index + i]); } size_t slide = list->size - (index + n); for (size_t i = 0; i < slide; i++) { list->elements[index + i] = list->elements[index + n + i]; } list->size -= n; } void pn_list_clear(pn_list_t *list) { assert(list); pn_list_del(list, 0, list->size); } void pn_list_minpush(pn_list_t *list, void *value) { assert(list); pn_list_add(list, value); // we use one based indexing for the heap void **heap = list->elements - 1; int now = list->size; while (now > 1 && pn_class_compare(list->clazz, heap[now/2], value) > 0) { heap[now] = heap[now/2]; now /= 2; } heap[now] = value; } void *pn_list_minpop(pn_list_t *list) { assert(list); // we use one based indexing for the heap void **heap = list->elements - 1; void *min = heap[1]; void *last = pn_list_pop(list); int size = pn_list_size(list); int now, child; for (now = 1; now*2 <= size; now = child) { child = now*2; if (child != size && pn_class_compare(list->clazz, heap[child], heap[child + 1]) > 0) { child++; } if (pn_class_compare(list->clazz, last, heap[child]) > 0) { heap[now] = heap[child]; } else { break; } } heap[now] = last; return min; } typedef struct { pn_list_t *list; size_t index; } pni_list_iter_t; static void *pni_list_next(void *ctx) { pni_list_iter_t *iter = (pni_list_iter_t *) ctx; if (iter->index < pn_list_size(iter->list)) { return pn_list_get(iter->list, iter->index++); } else { return NULL; } } void pn_list_iterator(pn_list_t *list, pn_iterator_t *iter) { pni_list_iter_t *liter = (pni_list_iter_t *) pn_iterator_start(iter, pni_list_next, sizeof(pni_list_iter_t)); liter->list = list; liter->index = 0; } static void pn_list_finalize(void *object) { assert(object); pn_list_t *list = (pn_list_t *) object; for (size_t i = 0; i < list->size; i++) { pn_class_decref(list->clazz, pn_list_get(list, i)); } free(list->elements); } static uintptr_t pn_list_hashcode(void *object) { assert(object); pn_list_t *list = (pn_list_t *) object; uintptr_t hash = 1; for (size_t i = 0; i < list->size; i++) { hash = hash * 31 + pn_hashcode(pn_list_get(list, i)); } return hash; } static intptr_t pn_list_compare(void *oa, void *ob) { assert(oa); assert(ob); pn_list_t *a = (pn_list_t *) oa; pn_list_t *b = (pn_list_t *) ob; size_t na = pn_list_size(a); size_t nb = pn_list_size(b); if (na != nb) { return nb - na; } else { for (size_t i = 0; i < na; i++) { intptr_t delta = pn_compare(pn_list_get(a, i), pn_list_get(b, i)); if (delta) return delta; } } return 0; } static int pn_list_inspect(void *obj, pn_string_t *dst) { assert(obj); pn_list_t *list = (pn_list_t *) obj; int err = pn_string_addf(dst, "["); if (err) return err; size_t n = pn_list_size(list); for (size_t i = 0; i < n; i++) { if (i > 0) { err = pn_string_addf(dst, ", "); if (err) return err; } err = pn_class_inspect(list->clazz, pn_list_get(list, i), dst); if (err) return err; } return pn_string_addf(dst, "]"); } #define pn_list_initialize NULL pn_list_t *pn_list(const pn_class_t *clazz, size_t capacity) { static const pn_class_t list_clazz = PN_CLASS(pn_list); pn_list_t *list = (pn_list_t *) pn_class_new(&list_clazz, sizeof(pn_list_t)); list->clazz = clazz; list->capacity = capacity ? capacity : 16; list->elements = (void **) malloc(list->capacity * sizeof(void *)); list->size = 0; return list; } qpid-proton-0.22.0/proton-c/src/core/object/iterator.c0000664000000000000000000000407013257152177017475 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include struct pn_iterator_t { pn_iterator_next_t next; size_t size; void *state; }; static void pn_iterator_initialize(void *object) { pn_iterator_t *it = (pn_iterator_t *) object; it->next = NULL; it->size = 0; it->state = NULL; } static void pn_iterator_finalize(void *object) { pn_iterator_t *it = (pn_iterator_t *) object; free(it->state); } #define CID_pn_iterator CID_pn_object #define pn_iterator_hashcode NULL #define pn_iterator_compare NULL #define pn_iterator_inspect NULL pn_iterator_t *pn_iterator() { static const pn_class_t clazz = PN_CLASS(pn_iterator); pn_iterator_t *it = (pn_iterator_t *) pn_class_new(&clazz, sizeof(pn_iterator_t)); return it; } void *pn_iterator_start(pn_iterator_t *iterator, pn_iterator_next_t next, size_t size) { assert(iterator); assert(next); iterator->next = next; if (iterator->size < size) { iterator->state = realloc(iterator->state, size); } return iterator->state; } void *pn_iterator_next(pn_iterator_t *iterator) { assert(iterator); if (iterator->next) { void *result = iterator->next(iterator->state); if (!result) iterator->next = NULL; return result; } else { return NULL; } } qpid-proton-0.22.0/proton-c/src/core/message.c0000664000000000000000000005772613257152177016042 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "platform/platform_fmt.h" #include "max_align.h" #include "message-internal.h" #include "protocol.h" #include "util.h" #include #include #include #include #include #include #include // message struct pn_message_t { pn_timestamp_t expiry_time; pn_timestamp_t creation_time; pn_data_t *id; pn_string_t *user_id; pn_string_t *address; pn_string_t *subject; pn_string_t *reply_to; pn_data_t *correlation_id; pn_string_t *content_type; pn_string_t *content_encoding; pn_string_t *group_id; pn_string_t *reply_to_group_id; pn_data_t *data; pn_data_t *instructions; pn_data_t *annotations; pn_data_t *properties; pn_data_t *body; pn_error_t *error; pn_sequence_t group_sequence; pn_millis_t ttl; uint32_t delivery_count; uint8_t priority; bool durable; bool first_acquirer; bool inferred; }; void pn_message_finalize(void *obj) { pn_message_t *msg = (pn_message_t *) obj; pn_free(msg->user_id); pn_free(msg->address); pn_free(msg->subject); pn_free(msg->reply_to); pn_free(msg->content_type); pn_free(msg->content_encoding); pn_free(msg->group_id); pn_free(msg->reply_to_group_id); pn_data_free(msg->id); pn_data_free(msg->correlation_id); pn_data_free(msg->data); pn_data_free(msg->instructions); pn_data_free(msg->annotations); pn_data_free(msg->properties); pn_data_free(msg->body); pn_error_free(msg->error); } int pn_message_inspect(void *obj, pn_string_t *dst) { pn_message_t *msg = (pn_message_t *) obj; int err = pn_string_addf(dst, "Message{"); if (err) return err; bool comma = false; if (pn_string_get(msg->address)) { err = pn_string_addf(dst, "address="); if (err) return err; err = pn_inspect(msg->address, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (msg->durable) { err = pn_string_addf(dst, "durable=%i, ", msg->durable); if (err) return err; comma = true; } if (msg->priority != HEADER_PRIORITY_DEFAULT) { err = pn_string_addf(dst, "priority=%i, ", msg->priority); if (err) return err; comma = true; } if (msg->ttl) { err = pn_string_addf(dst, "ttl=%" PRIu32 ", ", msg->ttl); if (err) return err; comma = true; } if (msg->first_acquirer) { err = pn_string_addf(dst, "first_acquirer=%i, ", msg->first_acquirer); if (err) return err; comma = true; } if (msg->delivery_count) { err = pn_string_addf(dst, "delivery_count=%" PRIu32 ", ", msg->delivery_count); if (err) return err; comma = true; } if (pn_data_size(msg->id)) { err = pn_string_addf(dst, "id="); if (err) return err; err = pn_inspect(msg->id, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_string_get(msg->user_id)) { err = pn_string_addf(dst, "user_id="); if (err) return err; err = pn_inspect(msg->user_id, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_string_get(msg->subject)) { err = pn_string_addf(dst, "subject="); if (err) return err; err = pn_inspect(msg->subject, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_string_get(msg->reply_to)) { err = pn_string_addf(dst, "reply_to="); if (err) return err; err = pn_inspect(msg->reply_to, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_data_size(msg->correlation_id)) { err = pn_string_addf(dst, "correlation_id="); if (err) return err; err = pn_inspect(msg->correlation_id, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_string_get(msg->content_type)) { err = pn_string_addf(dst, "content_type="); if (err) return err; err = pn_inspect(msg->content_type, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_string_get(msg->content_encoding)) { err = pn_string_addf(dst, "content_encoding="); if (err) return err; err = pn_inspect(msg->content_encoding, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (msg->expiry_time) { err = pn_string_addf(dst, "expiry_time=%" PRIi64 ", ", msg->expiry_time); if (err) return err; comma = true; } if (msg->creation_time) { err = pn_string_addf(dst, "creation_time=%" PRIi64 ", ", msg->creation_time); if (err) return err; comma = true; } if (pn_string_get(msg->group_id)) { err = pn_string_addf(dst, "group_id="); if (err) return err; err = pn_inspect(msg->group_id, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (msg->group_sequence) { err = pn_string_addf(dst, "group_sequence=%" PRIi32 ", ", msg->group_sequence); if (err) return err; comma = true; } if (pn_string_get(msg->reply_to_group_id)) { err = pn_string_addf(dst, "reply_to_group_id="); if (err) return err; err = pn_inspect(msg->reply_to_group_id, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (msg->inferred) { err = pn_string_addf(dst, "inferred=%i, ", msg->inferred); if (err) return err; comma = true; } if (pn_data_size(msg->instructions)) { err = pn_string_addf(dst, "instructions="); if (err) return err; err = pn_inspect(msg->instructions, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_data_size(msg->annotations)) { err = pn_string_addf(dst, "annotations="); if (err) return err; err = pn_inspect(msg->annotations, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_data_size(msg->properties)) { err = pn_string_addf(dst, "properties="); if (err) return err; err = pn_inspect(msg->properties, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (pn_data_size(msg->body)) { err = pn_string_addf(dst, "body="); if (err) return err; err = pn_inspect(msg->body, dst); if (err) return err; err = pn_string_addf(dst, ", "); if (err) return err; comma = true; } if (comma) { int err = pn_string_resize(dst, pn_string_size(dst) - 2); if (err) return err; } return pn_string_addf(dst, "}"); } #define pn_message_initialize NULL #define pn_message_hashcode NULL #define pn_message_compare NULL static pn_message_t *pni_message_new(size_t size) { static const pn_class_t clazz = PN_CLASS(pn_message); pn_message_t *msg = (pn_message_t *) pn_class_new(&clazz, size); msg->durable = false; msg->priority = HEADER_PRIORITY_DEFAULT; msg->ttl = 0; msg->first_acquirer = false; msg->delivery_count = 0; msg->id = pn_data(1); msg->user_id = pn_string(NULL); msg->address = pn_string(NULL); msg->subject = pn_string(NULL); msg->reply_to = pn_string(NULL); msg->correlation_id = pn_data(1); msg->content_type = pn_string(NULL); msg->content_encoding = pn_string(NULL); msg->expiry_time = 0; msg->creation_time = 0; msg->group_id = pn_string(NULL); msg->group_sequence = 0; msg->reply_to_group_id = pn_string(NULL); msg->inferred = false; msg->data = pn_data(16); msg->instructions = pn_data(16); msg->annotations = pn_data(16); msg->properties = pn_data(16); msg->body = pn_data(16); msg->error = pn_error(); return msg; } pn_message_t *pn_message() { return pni_message_new(sizeof(pn_message_t)); } /* Maximally aligned message to make extra storage safe for any type */ typedef union { pn_message_t m; pn_max_align_t a; } pni_aligned_message_t; pn_message_t *pni_message_with_extra(size_t extra) { return pni_message_new(sizeof(pni_aligned_message_t) + extra); } void *pni_message_get_extra(pn_message_t *m) { return ((char*)m) + sizeof(pni_aligned_message_t); } void pn_message_free(pn_message_t *msg) { pn_free(msg); } void pn_message_clear(pn_message_t *msg) { msg->durable = false; msg->priority = HEADER_PRIORITY_DEFAULT; msg->ttl = 0; msg->first_acquirer = false; msg->delivery_count = 0; pn_data_clear(msg->id); pn_string_clear(msg->user_id); pn_string_clear(msg->address); pn_string_clear(msg->subject); pn_string_clear(msg->reply_to); pn_data_clear(msg->correlation_id); pn_string_clear(msg->content_type); pn_string_clear(msg->content_encoding); msg->expiry_time = 0; msg->creation_time = 0; pn_string_clear(msg->group_id); msg->group_sequence = 0; pn_string_clear(msg->reply_to_group_id); msg->inferred = false; pn_data_clear(msg->data); pn_data_clear(msg->instructions); pn_data_clear(msg->annotations); pn_data_clear(msg->properties); pn_data_clear(msg->body); } int pn_message_errno(pn_message_t *msg) { assert(msg); return pn_error_code(msg->error); } pn_error_t *pn_message_error(pn_message_t *msg) { assert(msg); return msg->error; } bool pn_message_is_inferred(pn_message_t *msg) { assert(msg); return msg->inferred; } int pn_message_set_inferred(pn_message_t *msg, bool inferred) { assert(msg); msg->inferred = inferred; return 0; } bool pn_message_is_durable(pn_message_t *msg) { assert(msg); return msg->durable; } int pn_message_set_durable(pn_message_t *msg, bool durable) { assert(msg); msg->durable = durable; return 0; } uint8_t pn_message_get_priority(pn_message_t *msg) { assert(msg); return msg->priority; } int pn_message_set_priority(pn_message_t *msg, uint8_t priority) { assert(msg); msg->priority = priority; return 0; } pn_millis_t pn_message_get_ttl(pn_message_t *msg) { assert(msg); return msg->ttl; } int pn_message_set_ttl(pn_message_t *msg, pn_millis_t ttl) { assert(msg); msg->ttl = ttl; return 0; } bool pn_message_is_first_acquirer(pn_message_t *msg) { assert(msg); return msg->first_acquirer; } int pn_message_set_first_acquirer(pn_message_t *msg, bool first) { assert(msg); msg->first_acquirer = first; return 0; } uint32_t pn_message_get_delivery_count(pn_message_t *msg) { assert(msg); return msg->delivery_count; } int pn_message_set_delivery_count(pn_message_t *msg, uint32_t count) { assert(msg); msg->delivery_count = count; return 0; } pn_data_t *pn_message_id(pn_message_t *msg) { assert(msg); return msg->id; } pn_atom_t pn_message_get_id(pn_message_t *msg) { assert(msg); return pn_data_get_atom(msg->id); } int pn_message_set_id(pn_message_t *msg, pn_atom_t id) { assert(msg); pn_data_rewind(msg->id); return pn_data_put_atom(msg->id, id); } static pn_bytes_t pn_string_get_bytes(pn_string_t *string) { return pn_bytes(pn_string_size(string), (char *) pn_string_get(string)); } static int pn_string_set_bytes(pn_string_t *string, pn_bytes_t bytes) { return pn_string_setn(string, bytes.start, bytes.size); } pn_bytes_t pn_message_get_user_id(pn_message_t *msg) { assert(msg); return pn_string_get_bytes(msg->user_id); } int pn_message_set_user_id(pn_message_t *msg, pn_bytes_t user_id) { assert(msg); return pn_string_set_bytes(msg->user_id, user_id); } const char *pn_message_get_address(pn_message_t *msg) { assert(msg); return pn_string_get(msg->address); } int pn_message_set_address(pn_message_t *msg, const char *address) { assert(msg); return pn_string_set(msg->address, address); } const char *pn_message_get_subject(pn_message_t *msg) { assert(msg); return pn_string_get(msg->subject); } int pn_message_set_subject(pn_message_t *msg, const char *subject) { assert(msg); return pn_string_set(msg->subject, subject); } const char *pn_message_get_reply_to(pn_message_t *msg) { assert(msg); return pn_string_get(msg->reply_to); } int pn_message_set_reply_to(pn_message_t *msg, const char *reply_to) { assert(msg); return pn_string_set(msg->reply_to, reply_to); } pn_data_t *pn_message_correlation_id(pn_message_t *msg) { assert(msg); return msg->correlation_id; } pn_atom_t pn_message_get_correlation_id(pn_message_t *msg) { assert(msg); return pn_data_get_atom(msg->correlation_id); } int pn_message_set_correlation_id(pn_message_t *msg, pn_atom_t atom) { assert(msg); pn_data_rewind(msg->correlation_id); return pn_data_put_atom(msg->correlation_id, atom); } const char *pn_message_get_content_type(pn_message_t *msg) { assert(msg); return pn_string_get(msg->content_type); } int pn_message_set_content_type(pn_message_t *msg, const char *type) { assert(msg); return pn_string_set(msg->content_type, type); } const char *pn_message_get_content_encoding(pn_message_t *msg) { assert(msg); return pn_string_get(msg->content_encoding); } int pn_message_set_content_encoding(pn_message_t *msg, const char *encoding) { assert(msg); return pn_string_set(msg->content_encoding, encoding); } pn_timestamp_t pn_message_get_expiry_time(pn_message_t *msg) { assert(msg); return msg->expiry_time; } int pn_message_set_expiry_time(pn_message_t *msg, pn_timestamp_t time) { assert(msg); msg->expiry_time = time; return 0; } pn_timestamp_t pn_message_get_creation_time(pn_message_t *msg) { assert(msg); return msg->creation_time; } int pn_message_set_creation_time(pn_message_t *msg, pn_timestamp_t time) { assert(msg); msg->creation_time = time; return 0; } const char *pn_message_get_group_id(pn_message_t *msg) { assert(msg); return pn_string_get(msg->group_id); } int pn_message_set_group_id(pn_message_t *msg, const char *group_id) { assert(msg); return pn_string_set(msg->group_id, group_id); } pn_sequence_t pn_message_get_group_sequence(pn_message_t *msg) { assert(msg); return msg->group_sequence; } int pn_message_set_group_sequence(pn_message_t *msg, pn_sequence_t n) { assert(msg); msg->group_sequence = n; return 0; } const char *pn_message_get_reply_to_group_id(pn_message_t *msg) { assert(msg); return pn_string_get(msg->reply_to_group_id); } int pn_message_set_reply_to_group_id(pn_message_t *msg, const char *reply_to_group_id) { assert(msg); return pn_string_set(msg->reply_to_group_id, reply_to_group_id); } int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size) { assert(msg && bytes && size); pn_message_clear(msg); while (size) { pn_data_clear(msg->data); ssize_t used = pn_data_decode(msg->data, bytes, size); if (used < 0) return pn_error_format(msg->error, used, "data error: %s", pn_error_text(pn_data_error(msg->data))); size -= used; bytes += used; bool scanned; uint64_t desc; int err = pn_data_scan(msg->data, "D?L.", &scanned, &desc); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(msg->data))); if (!scanned) { desc = 0; } pn_data_rewind(msg->data); pn_data_next(msg->data); pn_data_enter(msg->data); pn_data_next(msg->data); switch (desc) { case HEADER: { bool priority_q; uint8_t priority; err = pn_data_scan(msg->data, "D.[o?BIoI]", &msg->durable, &priority_q, &priority, &msg->ttl, &msg->first_acquirer, &msg->delivery_count); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(msg->data))); msg->priority = priority_q ? priority : HEADER_PRIORITY_DEFAULT; break; } case PROPERTIES: { pn_bytes_t user_id, address, subject, reply_to, ctype, cencoding, group_id, reply_to_group_id; pn_data_clear(msg->id); pn_data_clear(msg->correlation_id); err = pn_data_scan(msg->data, "D.[CzSSSCssttSIS]", msg->id, &user_id, &address, &subject, &reply_to, msg->correlation_id, &ctype, &cencoding, &msg->expiry_time, &msg->creation_time, &group_id, &msg->group_sequence, &reply_to_group_id); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(msg->data))); err = pn_string_set_bytes(msg->user_id, user_id); if (err) return pn_error_format(msg->error, err, "error setting user_id"); err = pn_string_setn(msg->address, address.start, address.size); if (err) return pn_error_format(msg->error, err, "error setting address"); err = pn_string_setn(msg->subject, subject.start, subject.size); if (err) return pn_error_format(msg->error, err, "error setting subject"); err = pn_string_setn(msg->reply_to, reply_to.start, reply_to.size); if (err) return pn_error_format(msg->error, err, "error setting reply_to"); err = pn_string_setn(msg->content_type, ctype.start, ctype.size); if (err) return pn_error_format(msg->error, err, "error setting content_type"); err = pn_string_setn(msg->content_encoding, cencoding.start, cencoding.size); if (err) return pn_error_format(msg->error, err, "error setting content_encoding"); err = pn_string_setn(msg->group_id, group_id.start, group_id.size); if (err) return pn_error_format(msg->error, err, "error setting group_id"); err = pn_string_setn(msg->reply_to_group_id, reply_to_group_id.start, reply_to_group_id.size); if (err) return pn_error_format(msg->error, err, "error setting reply_to_group_id"); } break; case DELIVERY_ANNOTATIONS: pn_data_narrow(msg->data); err = pn_data_copy(msg->instructions, msg->data); if (err) return err; break; case MESSAGE_ANNOTATIONS: pn_data_narrow(msg->data); err = pn_data_copy(msg->annotations, msg->data); if (err) return err; break; case APPLICATION_PROPERTIES: pn_data_narrow(msg->data); err = pn_data_copy(msg->properties, msg->data); if (err) return err; break; case DATA: case AMQP_SEQUENCE: case AMQP_VALUE: pn_data_narrow(msg->data); err = pn_data_copy(msg->body, msg->data); if (err) return err; break; case FOOTER: break; default: err = pn_data_copy(msg->body, msg->data); if (err) return err; break; } } pn_data_clear(msg->data); return 0; } int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size) { if (!msg || !bytes || !size || !*size) return PN_ARG_ERR; pn_data_clear(msg->data); pn_message_data(msg, msg->data); size_t remaining = *size; ssize_t encoded = pn_data_encode(msg->data, bytes, remaining); if (encoded < 0) { if (encoded == PN_OVERFLOW) { return encoded; } else { return pn_error_format(msg->error, encoded, "data error: %s", pn_error_text(pn_data_error(msg->data))); } } bytes += encoded; remaining -= encoded; *size -= remaining; pn_data_clear(msg->data); return 0; } int pn_message_data(pn_message_t *msg, pn_data_t *data) { pn_data_clear(data); int err = pn_data_fill(data, "DL[?o?B?I?o?I]", HEADER, msg->durable, msg->durable, msg->priority!=HEADER_PRIORITY_DEFAULT, msg->priority, (bool)msg->ttl, msg->ttl, msg->first_acquirer, msg->first_acquirer, (bool)msg->delivery_count, msg->delivery_count); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(data))); if (pn_data_size(msg->instructions)) { pn_data_put_described(data); pn_data_enter(data); pn_data_put_ulong(data, DELIVERY_ANNOTATIONS); pn_data_rewind(msg->instructions); err = pn_data_append(data, msg->instructions); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(data))); pn_data_exit(data); } if (pn_data_size(msg->annotations)) { pn_data_put_described(data); pn_data_enter(data); pn_data_put_ulong(data, MESSAGE_ANNOTATIONS); pn_data_rewind(msg->annotations); err = pn_data_append(data, msg->annotations); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(data))); pn_data_exit(data); } err = pn_data_fill(data, "DL[CzSSSCss?t?tS?IS]", PROPERTIES, msg->id, pn_string_size(msg->user_id), pn_string_get(msg->user_id), pn_string_get(msg->address), pn_string_get(msg->subject), pn_string_get(msg->reply_to), msg->correlation_id, pn_string_get(msg->content_type), pn_string_get(msg->content_encoding), (bool)msg->expiry_time, msg->expiry_time, (bool)msg->creation_time, msg->creation_time, pn_string_get(msg->group_id), /* * As a heuristic, null out group_sequence if there is no group_id and * group_sequence is 0. In this case it is extremely unlikely we want * group semantics */ (bool)pn_string_get(msg->group_id) || (bool)msg->group_sequence , msg->group_sequence, pn_string_get(msg->reply_to_group_id)); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(data))); if (pn_data_size(msg->properties)) { pn_data_put_described(data); pn_data_enter(data); pn_data_put_ulong(data, APPLICATION_PROPERTIES); pn_data_rewind(msg->properties); err = pn_data_append(data, msg->properties); if (err) return pn_error_format(msg->error, err, "data error: %s", pn_error_text(pn_data_error(data))); pn_data_exit(data); } if (pn_data_size(msg->body)) { pn_data_rewind(msg->body); pn_data_next(msg->body); pn_type_t body_type = pn_data_type(msg->body); pn_data_rewind(msg->body); pn_data_put_described(data); pn_data_enter(data); if (msg->inferred) { switch (body_type) { case PN_BINARY: pn_data_put_ulong(data, DATA); break; case PN_LIST: pn_data_put_ulong(data, AMQP_SEQUENCE); break; default: pn_data_put_ulong(data, AMQP_VALUE); break; } } else { pn_data_put_ulong(data, AMQP_VALUE); } pn_data_append(data, msg->body); } return 0; } pn_data_t *pn_message_instructions(pn_message_t *msg) { return msg ? msg->instructions : NULL; } pn_data_t *pn_message_annotations(pn_message_t *msg) { return msg ? msg->annotations : NULL; } pn_data_t *pn_message_properties(pn_message_t *msg) { return msg ? msg->properties : NULL; } pn_data_t *pn_message_body(pn_message_t *msg) { return msg ? msg->body : NULL; } qpid-proton-0.22.0/proton-c/src/core/message-internal.h0000664000000000000000000000240313257152177017637 0ustar #ifndef CORE_MESSAGE_INTERNAL_H #define CORE_MESSAGE_INTERNAL_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #ifdef __cplusplus extern "C" { #endif /** @cond INTERNAL */ /** Construct a message with extra storage */ PN_EXTERN pn_message_t * pni_message_with_extra(size_t extra); /** Pointer to extra space allocated by pn_message_with_extra(). */ PN_EXTERN void* pni_message_get_extra(pn_message_t *msg); /** @endcond */ #ifdef __cplusplus } #endif #endif // CORE_MESSAGE_INTERNAL_H qpid-proton-0.22.0/proton-c/src/core/max_align.h0000664000000000000000000000243113257152177016341 0ustar #ifndef MAX_ALIGN_H #define MAX_ALIGN_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #ifdef __cplusplus extern "C" { #endif #if __STDC_VERSION__ >= 201112 /* Use standard max_align_t for alignment on c11 */ typedef max_align_t pn_max_align_t; #else /* Align on a union of likely largest types for older compilers */ typedef union pn_max_align_t { uint64_t i; long double d; void *v; void (*fp)(void); } pn_max_align_t; #endif #ifdef __cplusplus } #endif #endif // MAX_ALIGN_H qpid-proton-0.22.0/proton-c/src/core/log_private.h0000664000000000000000000000325613257152177016723 0ustar #ifndef LOG_PRIVATE_H #define LOG_PRIVATE_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /**@file * * Log messages that are not associated with a transport. */ #include #include /** Log a printf style message */ #define pn_logf(...) \ do { \ if (pni_log_enabled()) \ pni_logf_impl(__VA_ARGS__); \ } while(0) /** va_list version of pn_logf */ #define pn_vlogf(fmt, ap) \ do { \ if (pni_log_enabled()) \ pni_vlogf_impl(fmt, ap); \ } while(0) /** Return true if logging is enabled. */ PN_EXTERN bool pni_log_enabled(void); /**@internal*/ PN_EXTERN void pni_logf_impl(const char* fmt, ...); /**@internal*/ PN_EXTERN void pni_vlogf_impl(const char *fmt, va_list ap); #endif qpid-proton-0.22.0/proton-c/src/core/log.c0000664000000000000000000000420313257152177015155 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include "log_private.h" #include "util.h" static void stderr_logger(const char *message) { fprintf(stderr, "%s\n", message); } static pn_logger_t logger = stderr_logger; static int enabled_env = -1; /* Set from environment variable. */ static int enabled_call = -1; /* set by pn_log_enable */ void pn_log_enable(bool value) { enabled_call = value; } bool pni_log_enabled(void) { if (enabled_call != -1) return enabled_call; /* Takes precedence */ if (enabled_env == -1) enabled_env = pn_env_bool("PN_TRACE_LOG"); return enabled_env; } void pn_log_logger(pn_logger_t new_logger) { logger = new_logger; if (!logger) pn_log_enable(false); } void pni_vlogf_impl(const char *fmt, va_list ap) { vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } /**@internal * * Note: We check pni_log_enabled() in the pn_logf macro *before* calling * pni_logf_impl because evaluating the arguments to that call could have * side-effects with performance impact (e.g. calling functions to construct * complicated messages.) It is important that a disabled log statement results * in nothing more than a call to pni_log_enabled(). */ void pni_logf_impl(const char *fmt, ...) { va_list ap; va_start(ap, fmt); pni_vlogf_impl(fmt, ap); va_end(ap); } qpid-proton-0.22.0/proton-c/src/core/framing.h0000664000000000000000000000261213257152177016026 0ustar #ifndef PROTON_FRAMING_H #define PROTON_FRAMING_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "buffer.h" #include #include #include #define AMQP_HEADER_SIZE (8) #define AMQP_MIN_MAX_FRAME_SIZE ((uint32_t)512) // minimum allowable max-frame typedef struct { uint8_t type; uint16_t channel; size_t ex_size; const char *extended; size_t size; const char *payload; } pn_frame_t; ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max); size_t pn_write_frame(pn_buffer_t* buffer, pn_frame_t frame); #endif /* framing.h */ qpid-proton-0.22.0/proton-c/src/core/framing.c0000664000000000000000000000576513257152177016035 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include "framing.h" // TODO: These are near duplicates of code in codec.c - they should be // deduplicated. static inline void pn_i_write16(char *bytes, uint16_t value) { bytes[0] = 0xFF & (value >> 8); bytes[1] = 0xFF & (value ); } static inline void pn_i_write32(char *bytes, uint32_t value) { bytes[0] = 0xFF & (value >> 24); bytes[1] = 0xFF & (value >> 16); bytes[2] = 0xFF & (value >> 8); bytes[3] = 0xFF & (value ); } static inline uint16_t pn_i_read16(const char *bytes) { uint16_t a = (uint8_t) bytes[0]; uint16_t b = (uint8_t) bytes[1]; uint16_t r = a << 8 | b; return r; } static inline uint32_t pn_i_read32(const char *bytes) { uint32_t a = (uint8_t) bytes[0]; uint32_t b = (uint8_t) bytes[1]; uint32_t c = (uint8_t) bytes[2]; uint32_t d = (uint8_t) bytes[3]; uint32_t r = a << 24 | b << 16 | c << 8 | d; return r; } ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max) { if (available < AMQP_HEADER_SIZE) return 0; uint32_t size = pn_i_read32(&bytes[0]); if (max && size > max) return PN_ERR; if (available < size) return 0; unsigned int doff = 4 * (uint8_t)bytes[4]; if (doff < AMQP_HEADER_SIZE || doff > size) return PN_ERR; frame->size = size - doff; frame->ex_size = doff - AMQP_HEADER_SIZE; frame->type = bytes[5]; frame->channel = pn_i_read16(&bytes[6]); frame->extended = bytes + AMQP_HEADER_SIZE; frame->payload = bytes + doff; return size; } size_t pn_write_frame(pn_buffer_t* buffer, pn_frame_t frame) { size_t size = AMQP_HEADER_SIZE + frame.ex_size + frame.size; if (size <= pn_buffer_available(buffer)) { // Prepare header char bytes[8]; pn_i_write32(&bytes[0], size); int doff = (frame.ex_size + AMQP_HEADER_SIZE - 1)/4 + 1; bytes[4] = doff; bytes[5] = frame.type; pn_i_write16(&bytes[6], frame.channel); // Write header then rest of frame pn_buffer_append(buffer, bytes, 8); if (frame.extended) pn_buffer_append(buffer, frame.extended, frame.ex_size); pn_buffer_append(buffer, frame.payload, frame.size); return size; } else { return 0; } } qpid-proton-0.22.0/proton-c/src/core/event.c0000664000000000000000000002335613257152177015527 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include struct pn_collector_t { pn_list_t *pool; pn_event_t *head; pn_event_t *tail; pn_event_t *prev; /* event returned by previous call to pn_collector_next() */ bool freed; }; struct pn_event_t { pn_list_t *pool; const pn_class_t *clazz; void *context; // depends on clazz pn_record_t *attachments; pn_event_t *next; pn_event_type_t type; }; static void pn_collector_initialize(pn_collector_t *collector) { collector->pool = pn_list(PN_OBJECT, 0); collector->head = NULL; collector->tail = NULL; collector->prev = NULL; collector->freed = false; } void pn_collector_drain(pn_collector_t *collector) { assert(collector); while (pn_collector_next(collector)) ; assert(!collector->head); assert(!collector->tail); } static void pn_collector_shrink(pn_collector_t *collector) { assert(collector); pn_list_clear(collector->pool); } static void pn_collector_finalize(pn_collector_t *collector) { pn_collector_drain(collector); pn_decref(collector->pool); } static int pn_collector_inspect(pn_collector_t *collector, pn_string_t *dst) { assert(collector); int err = pn_string_addf(dst, "EVENTS["); if (err) return err; pn_event_t *event = collector->head; bool first = true; while (event) { if (first) { first = false; } else { err = pn_string_addf(dst, ", "); if (err) return err; } err = pn_inspect(event, dst); if (err) return err; event = event->next; } return pn_string_addf(dst, "]"); } #define pn_collector_hashcode NULL #define pn_collector_compare NULL PN_CLASSDEF(pn_collector) pn_collector_t *pn_collector(void) { return pn_collector_new(); } void pn_collector_free(pn_collector_t *collector) { assert(collector); pn_collector_release(collector); pn_decref(collector); } void pn_collector_release(pn_collector_t *collector) { assert(collector); if (!collector->freed) { collector->freed = true; pn_collector_drain(collector); pn_collector_shrink(collector); } } pn_event_t *pn_event(void); pn_event_t *pn_collector_put(pn_collector_t *collector, const pn_class_t *clazz, void *context, pn_event_type_t type) { if (!collector) { return NULL; } assert(context); if (collector->freed) { return NULL; } pn_event_t *tail = collector->tail; if (tail && tail->type == type && tail->context == context) { return NULL; } clazz = clazz->reify(context); pn_event_t *event = (pn_event_t *) pn_list_pop(collector->pool); if (!event) { event = pn_event(); } event->pool = collector->pool; pn_incref(event->pool); if (tail) { tail->next = event; collector->tail = event; } else { collector->tail = event; collector->head = event; } event->clazz = clazz; event->context = context; event->type = type; pn_class_incref(clazz, event->context); return event; } pn_event_t *pn_collector_peek(pn_collector_t *collector) { return collector->head; } // Advance head pointer for pop or next, return the old head. static pn_event_t *pop_internal(pn_collector_t *collector) { pn_event_t *event = collector->head; if (event) { collector->head = event->next; if (!collector->head) { collector->tail = NULL; } } return event; } bool pn_collector_pop(pn_collector_t *collector) { pn_event_t *event = pop_internal(collector); if (event) { pn_decref(event); } return event; } pn_event_t *pn_collector_next(pn_collector_t *collector) { if (collector->prev) { pn_decref(collector->prev); } collector->prev = pop_internal(collector); return collector->prev; } pn_event_t *pn_collector_prev(pn_collector_t *collector) { return collector->prev; } bool pn_collector_more(pn_collector_t *collector) { assert(collector); return collector->head && collector->head->next; } static void pn_event_initialize(pn_event_t *event) { event->pool = NULL; event->type = PN_EVENT_NONE; event->clazz = NULL; event->context = NULL; event->next = NULL; event->attachments = pn_record(); } static void pn_event_finalize(pn_event_t *event) { // decref before adding to the free list if (event->clazz && event->context) { pn_class_decref(event->clazz, event->context); } pn_list_t *pool = event->pool; if (pool && pn_refcount(pool) > 1) { event->pool = NULL; event->type = PN_EVENT_NONE; event->clazz = NULL; event->context = NULL; event->next = NULL; pn_record_clear(event->attachments); pn_list_add(pool, event); } else { pn_decref(event->attachments); } pn_decref(pool); } static int pn_event_inspect(pn_event_t *event, pn_string_t *dst) { assert(event); assert(dst); const char *name = pn_event_type_name(event->type); int err; if (name) { err = pn_string_addf(dst, "(%s", pn_event_type_name(event->type)); } else { err = pn_string_addf(dst, "(<%u>", (unsigned int) event->type); } if (err) return err; if (event->context) { err = pn_string_addf(dst, ", "); if (err) return err; err = pn_class_inspect(event->clazz, event->context, dst); if (err) return err; } return pn_string_addf(dst, ")"); } #define pn_event_hashcode NULL #define pn_event_compare NULL PN_CLASSDEF(pn_event) pn_event_t *pn_event(void) { return pn_event_new(); } pn_event_type_t pn_event_type(pn_event_t *event) { return event ? event->type : PN_EVENT_NONE; } const pn_class_t *pn_event_class(pn_event_t *event) { assert(event); return event->clazz; } void *pn_event_context(pn_event_t *event) { assert(event); return event->context; } pn_record_t *pn_event_attachments(pn_event_t *event) { assert(event); return event->attachments; } const char *pn_event_type_name(pn_event_type_t type) { switch (type) { case PN_EVENT_NONE: return "PN_EVENT_NONE"; case PN_REACTOR_INIT: return "PN_REACTOR_INIT"; case PN_REACTOR_QUIESCED: return "PN_REACTOR_QUIESCED"; case PN_REACTOR_FINAL: return "PN_REACTOR_FINAL"; case PN_TIMER_TASK: return "PN_TIMER_TASK"; case PN_CONNECTION_INIT: return "PN_CONNECTION_INIT"; case PN_CONNECTION_BOUND: return "PN_CONNECTION_BOUND"; case PN_CONNECTION_UNBOUND: return "PN_CONNECTION_UNBOUND"; case PN_CONNECTION_REMOTE_OPEN: return "PN_CONNECTION_REMOTE_OPEN"; case PN_CONNECTION_LOCAL_OPEN: return "PN_CONNECTION_LOCAL_OPEN"; case PN_CONNECTION_REMOTE_CLOSE: return "PN_CONNECTION_REMOTE_CLOSE"; case PN_CONNECTION_LOCAL_CLOSE: return "PN_CONNECTION_LOCAL_CLOSE"; case PN_CONNECTION_FINAL: return "PN_CONNECTION_FINAL"; case PN_SESSION_INIT: return "PN_SESSION_INIT"; case PN_SESSION_REMOTE_OPEN: return "PN_SESSION_REMOTE_OPEN"; case PN_SESSION_LOCAL_OPEN: return "PN_SESSION_LOCAL_OPEN"; case PN_SESSION_REMOTE_CLOSE: return "PN_SESSION_REMOTE_CLOSE"; case PN_SESSION_LOCAL_CLOSE: return "PN_SESSION_LOCAL_CLOSE"; case PN_SESSION_FINAL: return "PN_SESSION_FINAL"; case PN_LINK_INIT: return "PN_LINK_INIT"; case PN_LINK_REMOTE_OPEN: return "PN_LINK_REMOTE_OPEN"; case PN_LINK_LOCAL_OPEN: return "PN_LINK_LOCAL_OPEN"; case PN_LINK_REMOTE_CLOSE: return "PN_LINK_REMOTE_CLOSE"; case PN_LINK_LOCAL_DETACH: return "PN_LINK_LOCAL_DETACH"; case PN_LINK_REMOTE_DETACH: return "PN_LINK_REMOTE_DETACH"; case PN_LINK_LOCAL_CLOSE: return "PN_LINK_LOCAL_CLOSE"; case PN_LINK_FLOW: return "PN_LINK_FLOW"; case PN_LINK_FINAL: return "PN_LINK_FINAL"; case PN_DELIVERY: return "PN_DELIVERY"; case PN_TRANSPORT: return "PN_TRANSPORT"; case PN_TRANSPORT_AUTHENTICATED: return "PN_TRANSPORT_AUTHENTICATED"; case PN_TRANSPORT_ERROR: return "PN_TRANSPORT_ERROR"; case PN_TRANSPORT_HEAD_CLOSED: return "PN_TRANSPORT_HEAD_CLOSED"; case PN_TRANSPORT_TAIL_CLOSED: return "PN_TRANSPORT_TAIL_CLOSED"; case PN_TRANSPORT_CLOSED: return "PN_TRANSPORT_CLOSED"; case PN_SELECTABLE_INIT: return "PN_SELECTABLE_INIT"; case PN_SELECTABLE_UPDATED: return "PN_SELECTABLE_UPDATED"; case PN_SELECTABLE_READABLE: return "PN_SELECTABLE_READABLE"; case PN_SELECTABLE_WRITABLE: return "PN_SELECTABLE_WRITABLE"; case PN_SELECTABLE_ERROR: return "PN_SELECTABLE_ERROR"; case PN_SELECTABLE_EXPIRED: return "PN_SELECTABLE_EXPIRED"; case PN_SELECTABLE_FINAL: return "PN_SELECTABLE_FINAL"; case PN_CONNECTION_WAKE: return "PN_CONNECTION_WAKE"; case PN_LISTENER_ACCEPT: return "PN_LISTENER_ACCEPT"; case PN_LISTENER_CLOSE: return "PN_LISTENER_CLOSE"; case PN_PROACTOR_INTERRUPT: return "PN_PROACTOR_INTERRUPT"; case PN_PROACTOR_TIMEOUT: return "PN_PROACTOR_TIMEOUT"; case PN_PROACTOR_INACTIVE: return "PN_PROACTOR_INACTIVE"; case PN_LISTENER_OPEN: return "PN_LISTENER_OPEN"; default: return "PN_UNKNOWN"; } return NULL; } pn_event_t *pn_event_batch_next(pn_event_batch_t *batch) { return batch->next_event(batch); } qpid-proton-0.22.0/proton-c/src/core/error.c0000664000000000000000000000603413257152177015531 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "platform/platform.h" #include "util.h" #include #include #include #include struct pn_error_t { char *text; pn_error_t *root; int code; }; pn_error_t *pn_error() { pn_error_t *error = (pn_error_t *) malloc(sizeof(pn_error_t)); if (error != NULL) { error->code = 0; error->text = NULL; error->root = NULL; } return error; } void pn_error_free(pn_error_t *error) { if (error) { free(error->text); free(error); } } void pn_error_clear(pn_error_t *error) { if (error) { error->code = 0; free(error->text); error->text = NULL; error->root = NULL; } } int pn_error_set(pn_error_t *error, int code, const char *text) { assert(error); pn_error_clear(error); if (code) { error->code = code; error->text = pn_strdup(text); } return code; } int pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap) { assert(error); char text[1024]; int n = pni_vsnprintf(text, 1024, fmt, ap); if (n >= 1024) { text[1023] = '\0'; } return pn_error_set(error, code, text); } int pn_error_format(pn_error_t *error, int code, const char *fmt, ...) { assert(error); va_list ap; va_start(ap, fmt); int rcode = pn_error_vformat(error, code, fmt, ap); va_end(ap); return rcode; } int pn_error_code(pn_error_t *error) { assert(error); return error->code; } const char *pn_error_text(pn_error_t *error) { assert(error); return error->text; } int pn_error_copy(pn_error_t *error, pn_error_t *src) { assert(error); if (src) { return pn_error_set(error, pn_error_code(src), pn_error_text(src)); } else { pn_error_clear(error); return 0; } } const char *pn_code(int code) { switch (code) { case 0: return ""; case PN_EOS: return "PN_EOS"; case PN_ERR: return "PN_ERR"; case PN_OVERFLOW: return "PN_OVERFLOW"; case PN_UNDERFLOW: return "PN_UNDERFLOW"; case PN_STATE_ERR: return "PN_STATE_ERR"; case PN_ARG_ERR: return "PN_ARG_ERR"; case PN_TIMEOUT: return "PN_TIMEOUT"; case PN_INTR: return "PN_INTR"; case PN_INPROGRESS: return "PN_INPROGRESS"; case PN_OUT_OF_MEMORY: return "PN_OUT_OF_MEMORY"; case PN_ABORTED: return "PN_ABORTED"; default: return ""; } } qpid-proton-0.22.0/proton-c/src/core/engine.c0000664000000000000000000016625713257152177015663 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "engine-internal.h" #include #include #include "protocol.h" #include #include #include #include "platform/platform.h" #include "platform/platform_fmt.h" #include "transport.h" static void pni_session_bound(pn_session_t *ssn); static void pni_link_bound(pn_link_t *link); // endpoints static pn_connection_t *pni_ep_get_connection(pn_endpoint_t *endpoint) { switch (endpoint->type) { case CONNECTION: return (pn_connection_t *) endpoint; case SESSION: return ((pn_session_t *) endpoint)->connection; case SENDER: case RECEIVER: return ((pn_link_t *) endpoint)->session->connection; } return NULL; } static pn_event_type_t endpoint_event(pn_endpoint_type_t type, bool open) { switch (type) { case CONNECTION: return open ? PN_CONNECTION_LOCAL_OPEN : PN_CONNECTION_LOCAL_CLOSE; case SESSION: return open ? PN_SESSION_LOCAL_OPEN : PN_SESSION_LOCAL_CLOSE; case SENDER: case RECEIVER: return open ? PN_LINK_LOCAL_OPEN : PN_LINK_LOCAL_CLOSE; default: assert(false); return PN_EVENT_NONE; } } static void pn_endpoint_open(pn_endpoint_t *endpoint) { if (!(endpoint->state & PN_LOCAL_ACTIVE)) { PN_SET_LOCAL(endpoint->state, PN_LOCAL_ACTIVE); pn_connection_t *conn = pni_ep_get_connection(endpoint); pn_collector_put(conn->collector, PN_OBJECT, endpoint, endpoint_event(endpoint->type, true)); pn_modified(conn, endpoint, true); } } static void pn_endpoint_close(pn_endpoint_t *endpoint) { if (!(endpoint->state & PN_LOCAL_CLOSED)) { PN_SET_LOCAL(endpoint->state, PN_LOCAL_CLOSED); pn_connection_t *conn = pni_ep_get_connection(endpoint); pn_collector_put(conn->collector, PN_OBJECT, endpoint, endpoint_event(endpoint->type, false)); pn_modified(conn, endpoint, true); } } void pn_connection_reset(pn_connection_t *connection) { assert(connection); pn_endpoint_t *endpoint = &connection->endpoint; endpoint->state = PN_LOCAL_UNINIT | PN_REMOTE_UNINIT; } void pn_connection_open(pn_connection_t *connection) { assert(connection); pn_endpoint_open(&connection->endpoint); } void pn_connection_close(pn_connection_t *connection) { assert(connection); pn_endpoint_close(&connection->endpoint); } static void pni_endpoint_tini(pn_endpoint_t *endpoint); void pn_connection_release(pn_connection_t *connection) { assert(!connection->endpoint.freed); // free those endpoints that haven't been freed by the application LL_REMOVE(connection, endpoint, &connection->endpoint); while (connection->endpoint_head) { pn_endpoint_t *ep = connection->endpoint_head; switch (ep->type) { case SESSION: // note: this will free all child links: pn_session_free((pn_session_t *)ep); break; case SENDER: case RECEIVER: pn_link_free((pn_link_t *)ep); break; default: assert(false); } } connection->endpoint.freed = true; if (!connection->transport) { // no transport available to consume transport work items, // so manually clear them: pn_ep_incref(&connection->endpoint); pn_connection_unbound(connection); } pn_ep_decref(&connection->endpoint); } void pn_connection_free(pn_connection_t *connection) { pn_connection_release(connection); pn_decref(connection); } void pn_connection_bound(pn_connection_t *connection) { pn_collector_put(connection->collector, PN_OBJECT, connection, PN_CONNECTION_BOUND); pn_ep_incref(&connection->endpoint); size_t nsessions = pn_list_size(connection->sessions); for (size_t i = 0; i < nsessions; i++) { pni_session_bound((pn_session_t *) pn_list_get(connection->sessions, i)); } } // invoked when transport has been removed: void pn_connection_unbound(pn_connection_t *connection) { connection->transport = NULL; if (connection->endpoint.freed) { // connection has been freed prior to unbinding, thus it // cannot be re-assigned to a new transport. Clear the // transport work lists to allow the connection to be freed. while (connection->transport_head) { pn_clear_modified(connection, connection->transport_head); } while (connection->tpwork_head) { pn_clear_tpwork(connection->tpwork_head); } } pn_ep_decref(&connection->endpoint); } pn_record_t *pn_connection_attachments(pn_connection_t *connection) { assert(connection); return connection->context; } void *pn_connection_get_context(pn_connection_t *conn) { // XXX: we should really assert on conn here, but this causes // messenger tests to fail return conn ? pn_record_get(conn->context, PN_LEGCTX) : NULL; } void pn_connection_set_context(pn_connection_t *conn, void *context) { assert(conn); pn_record_set(conn->context, PN_LEGCTX, context); } pn_transport_t *pn_connection_transport(pn_connection_t *connection) { assert(connection); return connection->transport; } void pn_condition_init(pn_condition_t *condition) { condition->name = pn_string(NULL); condition->description = pn_string(NULL); condition->info = pn_data(0); } pn_condition_t *pn_condition() { pn_condition_t *c = (pn_condition_t*)malloc(sizeof(pn_condition_t)); pn_condition_init(c); return c; } void pn_condition_tini(pn_condition_t *condition) { pn_data_free(condition->info); pn_free(condition->description); pn_free(condition->name); } void pn_condition_free(pn_condition_t *c) { if (c) { pn_condition_clear(c); pn_condition_tini(c); free(c); } } static void pni_add_session(pn_connection_t *conn, pn_session_t *ssn) { pn_list_add(conn->sessions, ssn); ssn->connection = conn; pn_incref(conn); // keep around until finalized pn_ep_incref(&conn->endpoint); } static void pni_remove_session(pn_connection_t *conn, pn_session_t *ssn) { if (pn_list_remove(conn->sessions, ssn)) { pn_ep_decref(&conn->endpoint); LL_REMOVE(conn, endpoint, &ssn->endpoint); } } pn_connection_t *pn_session_connection(pn_session_t *session) { if (!session) return NULL; return session->connection; } void pn_session_open(pn_session_t *session) { assert(session); pn_endpoint_open(&session->endpoint); } void pn_session_close(pn_session_t *session) { assert(session); pn_endpoint_close(&session->endpoint); } void pn_session_free(pn_session_t *session) { assert(!session->endpoint.freed); while(pn_list_size(session->links)) { pn_link_t *link = (pn_link_t *)pn_list_get(session->links, 0); pn_link_free(link); } pni_remove_session(session->connection, session); pn_list_add(session->connection->freed, session); session->endpoint.freed = true; pn_ep_decref(&session->endpoint); // the finalize logic depends on endpoint.freed, so we incref/decref // to give it a chance to rerun pn_incref(session); pn_decref(session); } pn_record_t *pn_session_attachments(pn_session_t *session) { assert(session); return session->context; } void *pn_session_get_context(pn_session_t *session) { return session ? pn_record_get(session->context, PN_LEGCTX) : 0; } void pn_session_set_context(pn_session_t *session, void *context) { assert(context); pn_record_set(session->context, PN_LEGCTX, context); } static void pni_add_link(pn_session_t *ssn, pn_link_t *link) { pn_list_add(ssn->links, link); link->session = ssn; pn_ep_incref(&ssn->endpoint); } static void pni_remove_link(pn_session_t *ssn, pn_link_t *link) { if (pn_list_remove(ssn->links, link)) { pn_ep_decref(&ssn->endpoint); LL_REMOVE(ssn->connection, endpoint, &link->endpoint); } } void pn_link_open(pn_link_t *link) { assert(link); pn_endpoint_open(&link->endpoint); } void pn_link_close(pn_link_t *link) { assert(link); pn_endpoint_close(&link->endpoint); } void pn_link_detach(pn_link_t *link) { assert(link); if (link->detached) return; link->detached = true; pn_collector_put(link->session->connection->collector, PN_OBJECT, link, PN_LINK_LOCAL_DETACH); pn_modified(link->session->connection, &link->endpoint, true); } static void pni_terminus_free(pn_terminus_t *terminus) { pn_free(terminus->address); pn_free(terminus->properties); pn_free(terminus->capabilities); pn_free(terminus->outcomes); pn_free(terminus->filter); } void pn_link_free(pn_link_t *link) { assert(!link->endpoint.freed); pni_remove_link(link->session, link); pn_list_add(link->session->freed, link); pn_delivery_t *delivery = link->unsettled_head; while (delivery) { pn_delivery_t *next = delivery->unsettled_next; pn_delivery_settle(delivery); delivery = next; } link->endpoint.freed = true; pn_ep_decref(&link->endpoint); // the finalize logic depends on endpoint.freed (modified above), so // we incref/decref to give it a chance to rerun pn_incref(link); pn_decref(link); } void *pn_link_get_context(pn_link_t *link) { assert(link); return pn_record_get(link->context, PN_LEGCTX); } void pn_link_set_context(pn_link_t *link, void *context) { assert(link); pn_record_set(link->context, PN_LEGCTX, context); } pn_record_t *pn_link_attachments(pn_link_t *link) { assert(link); return link->context; } void pn_endpoint_init(pn_endpoint_t *endpoint, int type, pn_connection_t *conn) { endpoint->type = (pn_endpoint_type_t) type; endpoint->referenced = true; endpoint->state = PN_LOCAL_UNINIT | PN_REMOTE_UNINIT; endpoint->error = pn_error(); pn_condition_init(&endpoint->condition); pn_condition_init(&endpoint->remote_condition); endpoint->endpoint_next = NULL; endpoint->endpoint_prev = NULL; endpoint->transport_next = NULL; endpoint->transport_prev = NULL; endpoint->modified = false; endpoint->freed = false; endpoint->refcount = 1; //fprintf(stderr, "initting 0x%lx\n", (uintptr_t) endpoint); LL_ADD(conn, endpoint, endpoint); } void pn_ep_incref(pn_endpoint_t *endpoint) { endpoint->refcount++; } static pn_event_type_t pn_final_type(pn_endpoint_type_t type) { switch (type) { case CONNECTION: return PN_CONNECTION_FINAL; case SESSION: return PN_SESSION_FINAL; case SENDER: case RECEIVER: return PN_LINK_FINAL; default: assert(false); return PN_EVENT_NONE; } } static pn_endpoint_t *pn_ep_parent(pn_endpoint_t *endpoint) { switch (endpoint->type) { case CONNECTION: return NULL; case SESSION: return &((pn_session_t *) endpoint)->connection->endpoint; case SENDER: case RECEIVER: return &((pn_link_t *) endpoint)->session->endpoint; default: assert(false); return NULL; } } void pn_ep_decref(pn_endpoint_t *endpoint) { assert(endpoint->refcount > 0); endpoint->refcount--; if (endpoint->refcount == 0) { pn_connection_t *conn = pni_ep_get_connection(endpoint); pn_collector_put(conn->collector, PN_OBJECT, endpoint, pn_final_type(endpoint->type)); } } static void pni_endpoint_tini(pn_endpoint_t *endpoint) { pn_error_free(endpoint->error); pn_condition_tini(&endpoint->remote_condition); pn_condition_tini(&endpoint->condition); } static void pni_free_children(pn_list_t *children, pn_list_t *freed) { while (pn_list_size(children) > 0) { pn_endpoint_t *endpoint = (pn_endpoint_t *) pn_list_get(children, 0); assert(!endpoint->referenced); pn_free(endpoint); } while (pn_list_size(freed) > 0) { pn_endpoint_t *endpoint = (pn_endpoint_t *) pn_list_get(freed, 0); assert(!endpoint->referenced); pn_free(endpoint); } pn_free(children); pn_free(freed); } static void pn_connection_finalize(void *object) { pn_connection_t *conn = (pn_connection_t *) object; pn_endpoint_t *endpoint = &conn->endpoint; if (conn->transport) { assert(!conn->transport->referenced); pn_free(conn->transport); } // freeing the transport could post events if (pn_refcount(conn) > 0) { return; } pni_free_children(conn->sessions, conn->freed); pn_free(conn->context); pn_decref(conn->collector); pn_free(conn->container); pn_free(conn->hostname); pn_free(conn->auth_user); pn_free(conn->auth_password); pn_free(conn->offered_capabilities); pn_free(conn->desired_capabilities); pn_free(conn->properties); pni_endpoint_tini(endpoint); pn_free(conn->delivery_pool); } #define pn_connection_initialize NULL #define pn_connection_hashcode NULL #define pn_connection_compare NULL #define pn_connection_inspect NULL pn_connection_t *pn_connection() { static const pn_class_t clazz = PN_CLASS(pn_connection); pn_connection_t *conn = (pn_connection_t *) pn_class_new(&clazz, sizeof(pn_connection_t)); if (!conn) return NULL; conn->endpoint_head = NULL; conn->endpoint_tail = NULL; pn_endpoint_init(&conn->endpoint, CONNECTION, conn); conn->transport_head = NULL; conn->transport_tail = NULL; conn->sessions = pn_list(PN_WEAKREF, 0); conn->freed = pn_list(PN_WEAKREF, 0); conn->transport = NULL; conn->work_head = NULL; conn->work_tail = NULL; conn->tpwork_head = NULL; conn->tpwork_tail = NULL; conn->container = pn_string(NULL); conn->hostname = pn_string(NULL); conn->auth_user = pn_string(NULL); conn->auth_password = pn_string(NULL); conn->offered_capabilities = pn_data(0); conn->desired_capabilities = pn_data(0); conn->properties = pn_data(0); conn->collector = NULL; conn->context = pn_record(); conn->delivery_pool = pn_list(PN_OBJECT, 0); conn->driver = NULL; return conn; } static const pn_event_type_t endpoint_init_event_map[] = { PN_CONNECTION_INIT, /* CONNECTION */ PN_SESSION_INIT, /* SESSION */ PN_LINK_INIT, /* SENDER */ PN_LINK_INIT}; /* RECEIVER */ void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector) { pn_decref(connection->collector); connection->collector = collector; pn_incref(connection->collector); pn_endpoint_t *endpoint = connection->endpoint_head; while (endpoint) { pn_collector_put(connection->collector, PN_OBJECT, endpoint, endpoint_init_event_map[endpoint->type]); endpoint = endpoint->endpoint_next; } } pn_collector_t* pn_connection_collector(pn_connection_t *connection) { return connection->collector; } pn_state_t pn_connection_state(pn_connection_t *connection) { return connection ? connection->endpoint.state : 0; } pn_error_t *pn_connection_error(pn_connection_t *connection) { return connection ? connection->endpoint.error : NULL; } const char *pn_connection_get_container(pn_connection_t *connection) { assert(connection); return pn_string_get(connection->container); } void pn_connection_set_container(pn_connection_t *connection, const char *container) { assert(connection); pn_string_set(connection->container, container); } const char *pn_connection_get_hostname(pn_connection_t *connection) { assert(connection); return pn_string_get(connection->hostname); } void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname) { assert(connection); pn_string_set(connection->hostname, hostname); } const char *pn_connection_get_user(pn_connection_t *connection) { assert(connection); return pn_string_get(connection->auth_user); } void pn_connection_set_user(pn_connection_t *connection, const char *user) { assert(connection); pn_string_set(connection->auth_user, user); } void pn_connection_set_password(pn_connection_t *connection, const char *password) { assert(connection); // Make sure the previous password is erased, if there was one. size_t n = pn_string_size(connection->auth_password); const char* s = pn_string_get(connection->auth_password); if (n > 0 && s) memset((void*)s, 0, n); pn_string_set(connection->auth_password, password); } pn_data_t *pn_connection_offered_capabilities(pn_connection_t *connection) { assert(connection); return connection->offered_capabilities; } pn_data_t *pn_connection_desired_capabilities(pn_connection_t *connection) { assert(connection); return connection->desired_capabilities; } pn_data_t *pn_connection_properties(pn_connection_t *connection) { assert(connection); return connection->properties; } pn_data_t *pn_connection_remote_offered_capabilities(pn_connection_t *connection) { assert(connection); return connection->transport ? connection->transport->remote_offered_capabilities : NULL; } pn_data_t *pn_connection_remote_desired_capabilities(pn_connection_t *connection) { assert(connection); return connection->transport ? connection->transport->remote_desired_capabilities : NULL; } pn_data_t *pn_connection_remote_properties(pn_connection_t *connection) { assert(connection); return connection->transport ? connection->transport->remote_properties : NULL; } const char *pn_connection_remote_container(pn_connection_t *connection) { assert(connection); return connection->transport ? connection->transport->remote_container : NULL; } const char *pn_connection_remote_hostname(pn_connection_t *connection) { assert(connection); return connection->transport ? connection->transport->remote_hostname : NULL; } pn_delivery_t *pn_work_head(pn_connection_t *connection) { assert(connection); return connection->work_head; } pn_delivery_t *pn_work_next(pn_delivery_t *delivery) { assert(delivery); if (delivery->work) return delivery->work_next; else return pn_work_head(delivery->link->session->connection); } static void pni_add_work(pn_connection_t *connection, pn_delivery_t *delivery) { if (!delivery->work) { assert(!delivery->local.settled); // never allow settled deliveries LL_ADD(connection, work, delivery); delivery->work = true; } } static void pni_clear_work(pn_connection_t *connection, pn_delivery_t *delivery) { if (delivery->work) { LL_REMOVE(connection, work, delivery); delivery->work = false; } } void pn_work_update(pn_connection_t *connection, pn_delivery_t *delivery) { pn_link_t *link = pn_delivery_link(delivery); pn_delivery_t *current = pn_link_current(link); if (delivery->updated && !delivery->local.settled) { pni_add_work(connection, delivery); } else if (delivery == current) { if (link->endpoint.type == SENDER) { if (pn_link_credit(link) > 0) { pni_add_work(connection, delivery); } else { pni_clear_work(connection, delivery); } } else { pni_add_work(connection, delivery); } } else { pni_clear_work(connection, delivery); } } static void pni_add_tpwork(pn_delivery_t *delivery) { pn_connection_t *connection = delivery->link->session->connection; if (!delivery->tpwork) { LL_ADD(connection, tpwork, delivery); delivery->tpwork = true; } pn_modified(connection, &connection->endpoint, true); } void pn_clear_tpwork(pn_delivery_t *delivery) { pn_connection_t *connection = delivery->link->session->connection; if (delivery->tpwork) { LL_REMOVE(connection, tpwork, delivery); delivery->tpwork = false; if (pn_refcount(delivery) > 0) { pn_incref(delivery); pn_decref(delivery); } } } void pn_dump(pn_connection_t *conn) { pn_endpoint_t *endpoint = conn->transport_head; while (endpoint) { printf("%p", (void *) endpoint); endpoint = endpoint->transport_next; if (endpoint) printf(" -> "); } printf("\n"); } void pn_modified(pn_connection_t *connection, pn_endpoint_t *endpoint, bool emit) { if (!endpoint->modified) { LL_ADD(connection, transport, endpoint); endpoint->modified = true; } if (emit && connection->transport) { pn_collector_put(connection->collector, PN_OBJECT, connection->transport, PN_TRANSPORT); } } void pn_clear_modified(pn_connection_t *connection, pn_endpoint_t *endpoint) { if (endpoint->modified) { LL_REMOVE(connection, transport, endpoint); endpoint->transport_next = NULL; endpoint->transport_prev = NULL; endpoint->modified = false; } } static bool pni_matches(pn_endpoint_t *endpoint, pn_endpoint_type_t type, pn_state_t state) { if (endpoint->type != type) return false; if (!state) return true; int st = endpoint->state; if ((state & PN_REMOTE_MASK) == 0 || (state & PN_LOCAL_MASK) == 0) return st & state; else return st == state; } pn_endpoint_t *pn_find(pn_endpoint_t *endpoint, pn_endpoint_type_t type, pn_state_t state) { while (endpoint) { if (pni_matches(endpoint, type, state)) return endpoint; endpoint = endpoint->endpoint_next; } return NULL; } pn_session_t *pn_session_head(pn_connection_t *conn, pn_state_t state) { if (conn) return (pn_session_t *) pn_find(conn->endpoint_head, SESSION, state); else return NULL; } pn_session_t *pn_session_next(pn_session_t *ssn, pn_state_t state) { if (ssn) return (pn_session_t *) pn_find(ssn->endpoint.endpoint_next, SESSION, state); else return NULL; } pn_link_t *pn_link_head(pn_connection_t *conn, pn_state_t state) { if (!conn) return NULL; pn_endpoint_t *endpoint = conn->endpoint_head; while (endpoint) { if (pni_matches(endpoint, SENDER, state) || pni_matches(endpoint, RECEIVER, state)) return (pn_link_t *) endpoint; endpoint = endpoint->endpoint_next; } return NULL; } pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state) { if (!link) return NULL; pn_endpoint_t *endpoint = link->endpoint.endpoint_next; while (endpoint) { if (pni_matches(endpoint, SENDER, state) || pni_matches(endpoint, RECEIVER, state)) return (pn_link_t *) endpoint; endpoint = endpoint->endpoint_next; } return NULL; } static void pn_session_incref(void *object) { pn_session_t *session = (pn_session_t *) object; if (!session->endpoint.referenced) { session->endpoint.referenced = true; pn_incref(session->connection); } else { pn_object_incref(object); } } static bool pn_ep_bound(pn_endpoint_t *endpoint) { pn_connection_t *conn = pni_ep_get_connection(endpoint); pn_session_t *ssn; pn_link_t *lnk; if (!conn->transport) return false; if (endpoint->modified) return true; switch (endpoint->type) { case CONNECTION: return ((pn_connection_t *)endpoint)->transport; case SESSION: ssn = (pn_session_t *) endpoint; return (((int16_t) ssn->state.local_channel) >= 0 || ((int16_t) ssn->state.remote_channel) >= 0); case SENDER: case RECEIVER: lnk = (pn_link_t *) endpoint; return ((int32_t) lnk->state.local_handle) >= 0 || ((int32_t) lnk->state.remote_handle) >= 0; default: assert(false); return false; } } static bool pni_connection_live(pn_connection_t *conn) { return pn_refcount(conn) > 1; } static bool pni_session_live(pn_session_t *ssn) { return pni_connection_live(ssn->connection) || pn_refcount(ssn) > 1; } static bool pni_link_live(pn_link_t *link) { return pni_session_live(link->session) || pn_refcount(link) > 1; } static bool pni_endpoint_live(pn_endpoint_t *endpoint) { switch (endpoint->type) { case CONNECTION: return pni_connection_live((pn_connection_t *)endpoint); case SESSION: return pni_session_live((pn_session_t *) endpoint); case SENDER: case RECEIVER: return pni_link_live((pn_link_t *) endpoint); default: assert(false); return false; } } static bool pni_preserve_child(pn_endpoint_t *endpoint) { pn_connection_t *conn = pni_ep_get_connection(endpoint); pn_endpoint_t *parent = pn_ep_parent(endpoint); if (pni_endpoint_live(parent) && (!endpoint->freed || (pn_ep_bound(endpoint))) && endpoint->referenced) { pn_object_incref(endpoint); endpoint->referenced = false; pn_decref(parent); return true; } else { LL_REMOVE(conn, transport, endpoint); return false; } } static void pn_session_finalize(void *object) { pn_session_t *session = (pn_session_t *) object; pn_endpoint_t *endpoint = &session->endpoint; if (pni_preserve_child(endpoint)) { return; } pn_free(session->context); pni_free_children(session->links, session->freed); pni_endpoint_tini(endpoint); pn_delivery_map_free(&session->state.incoming); pn_delivery_map_free(&session->state.outgoing); pn_free(session->state.local_handles); pn_free(session->state.remote_handles); pni_remove_session(session->connection, session); pn_list_remove(session->connection->freed, session); if (session->connection->transport) { pn_transport_t *transport = session->connection->transport; pn_hash_del(transport->local_channels, session->state.local_channel); pn_hash_del(transport->remote_channels, session->state.remote_channel); } if (endpoint->referenced) { pn_decref(session->connection); } } #define pn_session_new pn_object_new #define pn_session_refcount pn_object_refcount #define pn_session_decref pn_object_decref #define pn_session_reify pn_object_reify #define pn_session_initialize NULL #define pn_session_hashcode NULL #define pn_session_compare NULL #define pn_session_inspect NULL pn_session_t *pn_session(pn_connection_t *conn) { assert(conn); #define pn_session_free pn_object_free static const pn_class_t clazz = PN_METACLASS(pn_session); #undef pn_session_free pn_session_t *ssn = (pn_session_t *) pn_class_new(&clazz, sizeof(pn_session_t)); if (!ssn) return NULL; pn_endpoint_init(&ssn->endpoint, SESSION, conn); pni_add_session(conn, ssn); ssn->links = pn_list(PN_WEAKREF, 0); ssn->freed = pn_list(PN_WEAKREF, 0); ssn->context = pn_record(); ssn->incoming_capacity = 1024*1024; ssn->incoming_bytes = 0; ssn->outgoing_bytes = 0; ssn->incoming_deliveries = 0; ssn->outgoing_deliveries = 0; ssn->outgoing_window = 2147483647; // begin transport state memset(&ssn->state, 0, sizeof(ssn->state)); ssn->state.local_channel = (uint16_t)-1; ssn->state.remote_channel = (uint16_t)-1; pn_delivery_map_init(&ssn->state.incoming, 0); pn_delivery_map_init(&ssn->state.outgoing, 0); ssn->state.local_handles = pn_hash(PN_WEAKREF, 0, 0.75); ssn->state.remote_handles = pn_hash(PN_WEAKREF, 0, 0.75); // end transport state pn_collector_put(conn->collector, PN_OBJECT, ssn, PN_SESSION_INIT); if (conn->transport) { pni_session_bound(ssn); } pn_decref(ssn); return ssn; } static void pni_session_bound(pn_session_t *ssn) { assert(ssn); size_t nlinks = pn_list_size(ssn->links); for (size_t i = 0; i < nlinks; i++) { pni_link_bound((pn_link_t *) pn_list_get(ssn->links, i)); } } void pn_session_unbound(pn_session_t* ssn) { assert(ssn); ssn->state.local_channel = (uint16_t)-1; ssn->state.remote_channel = (uint16_t)-1; ssn->incoming_bytes = 0; ssn->outgoing_bytes = 0; ssn->incoming_deliveries = 0; ssn->outgoing_deliveries = 0; } size_t pn_session_get_incoming_capacity(pn_session_t *ssn) { assert(ssn); return ssn->incoming_capacity; } void pn_session_set_incoming_capacity(pn_session_t *ssn, size_t capacity) { assert(ssn); // XXX: should this trigger a flow? ssn->incoming_capacity = capacity; } size_t pn_session_get_outgoing_window(pn_session_t *ssn) { assert(ssn); return ssn->outgoing_window; } void pn_session_set_outgoing_window(pn_session_t *ssn, size_t window) { assert(ssn); ssn->outgoing_window = window; } size_t pn_session_outgoing_bytes(pn_session_t *ssn) { assert(ssn); return ssn->outgoing_bytes; } size_t pn_session_incoming_bytes(pn_session_t *ssn) { assert(ssn); return ssn->incoming_bytes; } pn_state_t pn_session_state(pn_session_t *session) { return session->endpoint.state; } pn_error_t *pn_session_error(pn_session_t *session) { return session->endpoint.error; } static void pni_terminus_init(pn_terminus_t *terminus, pn_terminus_type_t type) { terminus->type = type; terminus->address = pn_string(NULL); terminus->durability = PN_NONDURABLE; terminus->expiry_policy = PN_EXPIRE_WITH_SESSION; terminus->timeout = 0; terminus->dynamic = false; terminus->distribution_mode = PN_DIST_MODE_UNSPECIFIED; terminus->properties = pn_data(0); terminus->capabilities = pn_data(0); terminus->outcomes = pn_data(0); terminus->filter = pn_data(0); } static void pn_link_incref(void *object) { pn_link_t *link = (pn_link_t *) object; if (!link->endpoint.referenced) { link->endpoint.referenced = true; pn_incref(link->session); } else { pn_object_incref(object); } } static void pn_link_finalize(void *object) { pn_link_t *link = (pn_link_t *) object; pn_endpoint_t *endpoint = &link->endpoint; if (pni_preserve_child(endpoint)) { return; } while (link->unsettled_head) { assert(!link->unsettled_head->referenced); pn_free(link->unsettled_head); } pn_free(link->context); pni_terminus_free(&link->source); pni_terminus_free(&link->target); pni_terminus_free(&link->remote_source); pni_terminus_free(&link->remote_target); pn_free(link->name); pni_endpoint_tini(endpoint); pni_remove_link(link->session, link); pn_hash_del(link->session->state.local_handles, link->state.local_handle); pn_hash_del(link->session->state.remote_handles, link->state.remote_handle); pn_list_remove(link->session->freed, link); if (endpoint->referenced) { pn_decref(link->session); } } #define pn_link_refcount pn_object_refcount #define pn_link_decref pn_object_decref #define pn_link_reify pn_object_reify #define pn_link_initialize NULL #define pn_link_hashcode NULL #define pn_link_compare NULL #define pn_link_inspect NULL pn_link_t *pn_link_new(int type, pn_session_t *session, const char *name) { #define pn_link_new pn_object_new #define pn_link_free pn_object_free static const pn_class_t clazz = PN_METACLASS(pn_link); #undef pn_link_new #undef pn_link_free pn_link_t *link = (pn_link_t *) pn_class_new(&clazz, sizeof(pn_link_t)); pn_endpoint_init(&link->endpoint, type, session->connection); pni_add_link(session, link); pn_incref(session); // keep session until link finalized link->name = pn_string(name); pni_terminus_init(&link->source, PN_SOURCE); pni_terminus_init(&link->target, PN_TARGET); pni_terminus_init(&link->remote_source, PN_UNSPECIFIED); pni_terminus_init(&link->remote_target, PN_UNSPECIFIED); link->unsettled_head = link->unsettled_tail = link->current = NULL; link->unsettled_count = 0; link->max_message_size = 0; link->remote_max_message_size = 0; link->available = 0; link->credit = 0; link->queued = 0; link->drain = false; link->drain_flag_mode = true; link->drained = 0; link->context = pn_record(); link->snd_settle_mode = PN_SND_MIXED; link->rcv_settle_mode = PN_RCV_FIRST; link->remote_snd_settle_mode = PN_SND_MIXED; link->remote_rcv_settle_mode = PN_RCV_FIRST; link->detached = false; // begin transport state link->state.local_handle = -1; link->state.remote_handle = -1; link->state.delivery_count = 0; link->state.link_credit = 0; // end transport state pn_collector_put(session->connection->collector, PN_OBJECT, link, PN_LINK_INIT); if (session->connection->transport) { pni_link_bound(link); } pn_decref(link); return link; } static void pni_link_bound(pn_link_t *link) { } void pn_link_unbound(pn_link_t* link) { assert(link); link->state.local_handle = -1; link->state.remote_handle = -1; link->state.delivery_count = 0; link->state.link_credit = 0; } pn_terminus_t *pn_link_source(pn_link_t *link) { return link ? &link->source : NULL; } pn_terminus_t *pn_link_target(pn_link_t *link) { return link ? &link->target : NULL; } pn_terminus_t *pn_link_remote_source(pn_link_t *link) { return link ? &link->remote_source : NULL; } pn_terminus_t *pn_link_remote_target(pn_link_t *link) { return link ? &link->remote_target : NULL; } int pn_terminus_set_type(pn_terminus_t *terminus, pn_terminus_type_t type) { if (!terminus) return PN_ARG_ERR; terminus->type = type; return 0; } pn_terminus_type_t pn_terminus_get_type(pn_terminus_t *terminus) { return terminus ? terminus->type : (pn_terminus_type_t) 0; } const char *pn_terminus_get_address(pn_terminus_t *terminus) { assert(terminus); return pn_string_get(terminus->address); } int pn_terminus_set_address(pn_terminus_t *terminus, const char *address) { assert(terminus); return pn_string_set(terminus->address, address); } pn_durability_t pn_terminus_get_durability(pn_terminus_t *terminus) { return terminus ? terminus->durability : (pn_durability_t) 0; } int pn_terminus_set_durability(pn_terminus_t *terminus, pn_durability_t durability) { if (!terminus) return PN_ARG_ERR; terminus->durability = durability; return 0; } pn_expiry_policy_t pn_terminus_get_expiry_policy(pn_terminus_t *terminus) { return terminus ? terminus->expiry_policy : (pn_expiry_policy_t) 0; } int pn_terminus_set_expiry_policy(pn_terminus_t *terminus, pn_expiry_policy_t expiry_policy) { if (!terminus) return PN_ARG_ERR; terminus->expiry_policy = expiry_policy; return 0; } pn_seconds_t pn_terminus_get_timeout(pn_terminus_t *terminus) { return terminus ? terminus->timeout : 0; } int pn_terminus_set_timeout(pn_terminus_t *terminus, pn_seconds_t timeout) { if (!terminus) return PN_ARG_ERR; terminus->timeout = timeout; return 0; } bool pn_terminus_is_dynamic(pn_terminus_t *terminus) { return terminus ? terminus->dynamic : false; } int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic) { if (!terminus) return PN_ARG_ERR; terminus->dynamic = dynamic; return 0; } pn_data_t *pn_terminus_properties(pn_terminus_t *terminus) { return terminus ? terminus->properties : NULL; } pn_data_t *pn_terminus_capabilities(pn_terminus_t *terminus) { return terminus ? terminus->capabilities : NULL; } pn_data_t *pn_terminus_outcomes(pn_terminus_t *terminus) { return terminus ? terminus->outcomes : NULL; } pn_data_t *pn_terminus_filter(pn_terminus_t *terminus) { return terminus ? terminus->filter : NULL; } pn_distribution_mode_t pn_terminus_get_distribution_mode(const pn_terminus_t *terminus) { return terminus ? terminus->distribution_mode : PN_DIST_MODE_UNSPECIFIED; } int pn_terminus_set_distribution_mode(pn_terminus_t *terminus, pn_distribution_mode_t m) { if (!terminus) return PN_ARG_ERR; terminus->distribution_mode = m; return 0; } int pn_terminus_copy(pn_terminus_t *terminus, pn_terminus_t *src) { if (!terminus || !src) { return PN_ARG_ERR; } terminus->type = src->type; int err = pn_terminus_set_address(terminus, pn_terminus_get_address(src)); if (err) return err; terminus->durability = src->durability; terminus->expiry_policy = src->expiry_policy; terminus->timeout = src->timeout; terminus->dynamic = src->dynamic; terminus->distribution_mode = src->distribution_mode; err = pn_data_copy(terminus->properties, src->properties); if (err) return err; err = pn_data_copy(terminus->capabilities, src->capabilities); if (err) return err; err = pn_data_copy(terminus->outcomes, src->outcomes); if (err) return err; err = pn_data_copy(terminus->filter, src->filter); if (err) return err; return 0; } pn_link_t *pn_sender(pn_session_t *session, const char *name) { return pn_link_new(SENDER, session, name); } pn_link_t *pn_receiver(pn_session_t *session, const char *name) { return pn_link_new(RECEIVER, session, name); } pn_state_t pn_link_state(pn_link_t *link) { return link->endpoint.state; } pn_error_t *pn_link_error(pn_link_t *link) { return link->endpoint.error; } const char *pn_link_name(pn_link_t *link) { assert(link); return pn_string_get(link->name); } bool pn_link_is_sender(pn_link_t *link) { return link->endpoint.type == SENDER; } bool pn_link_is_receiver(pn_link_t *link) { return link->endpoint.type == RECEIVER; } pn_session_t *pn_link_session(pn_link_t *link) { assert(link); return link->session; } static void pn_disposition_finalize(pn_disposition_t *ds) { pn_free(ds->data); pn_free(ds->annotations); pn_condition_tini(&ds->condition); } static void pn_delivery_incref(void *object) { pn_delivery_t *delivery = (pn_delivery_t *) object; if (delivery->link && !delivery->referenced) { delivery->referenced = true; pn_incref(delivery->link); } else { pn_object_incref(object); } } static bool pni_preserve_delivery(pn_delivery_t *delivery) { pn_connection_t *conn = delivery->link->session->connection; return !delivery->local.settled || (conn->transport && (delivery->state.init || delivery->tpwork)); } static void pn_delivery_finalize(void *object) { pn_delivery_t *delivery = (pn_delivery_t *) object; pn_link_t *link = delivery->link; // assert(!delivery->state.init); bool pooled = false; bool referenced = true; if (link) { if (pni_link_live(link) && pni_preserve_delivery(delivery) && delivery->referenced) { delivery->referenced = false; pn_object_incref(delivery); pn_decref(link); return; } referenced = delivery->referenced; pn_clear_tpwork(delivery); LL_REMOVE(link, unsettled, delivery); pn_delivery_map_del(pn_link_is_sender(link) ? &link->session->state.outgoing : &link->session->state.incoming, delivery); pn_buffer_clear(delivery->tag); pn_buffer_clear(delivery->bytes); pn_record_clear(delivery->context); delivery->settled = true; pn_connection_t *conn = link->session->connection; assert(pn_refcount(delivery) == 0); if (pni_connection_live(conn)) { pn_list_t *pool = link->session->connection->delivery_pool; delivery->link = NULL; pn_list_add(pool, delivery); pooled = true; assert(pn_refcount(delivery) == 1); } } if (!pooled) { pn_free(delivery->context); pn_buffer_free(delivery->tag); pn_buffer_free(delivery->bytes); pn_disposition_finalize(&delivery->local); pn_disposition_finalize(&delivery->remote); } if (referenced) { pn_decref(link); } } static void pn_disposition_init(pn_disposition_t *ds) { ds->data = pn_data(0); ds->annotations = pn_data(0); pn_condition_init(&ds->condition); } static void pn_disposition_clear(pn_disposition_t *ds) { ds->type = 0; ds->section_number = 0; ds->section_offset = 0; ds->failed = false; ds->undeliverable = false; ds->settled = false; pn_data_clear(ds->data); pn_data_clear(ds->annotations); pn_condition_clear(&ds->condition); } #define pn_delivery_new pn_object_new #define pn_delivery_refcount pn_object_refcount #define pn_delivery_decref pn_object_decref #define pn_delivery_free pn_object_free #define pn_delivery_reify pn_object_reify #define pn_delivery_initialize NULL #define pn_delivery_hashcode NULL #define pn_delivery_compare NULL int pn_delivery_inspect(void *obj, pn_string_t *dst) { pn_delivery_t *d = (pn_delivery_t*)obj; const char* dir = pn_link_is_sender(d->link) ? "sending" : "receiving"; pn_bytes_t bytes = pn_buffer_bytes(d->tag); int err = pn_string_addf(dst, "pn_delivery<%p>{%s, tag=b\"", obj, dir) || pn_quote(dst, bytes.start, bytes.size) || pn_string_addf(dst, "\", local=%s, remote=%s}", pn_disposition_type_name(d->local.type), pn_disposition_type_name(d->remote.type)); return err; } pn_delivery_tag_t pn_dtag(const char *bytes, size_t size) { pn_delivery_tag_t dtag = {size, bytes}; return dtag; } pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag) { assert(link); pn_list_t *pool = link->session->connection->delivery_pool; pn_delivery_t *delivery = (pn_delivery_t *) pn_list_pop(pool); if (!delivery) { static const pn_class_t clazz = PN_METACLASS(pn_delivery); delivery = (pn_delivery_t *) pn_class_new(&clazz, sizeof(pn_delivery_t)); if (!delivery) return NULL; delivery->tag = pn_buffer(16); delivery->bytes = pn_buffer(64); pn_disposition_init(&delivery->local); pn_disposition_init(&delivery->remote); delivery->context = pn_record(); } else { assert(!delivery->state.init); } delivery->link = link; pn_incref(delivery->link); // keep link until finalized pn_buffer_clear(delivery->tag); pn_buffer_append(delivery->tag, tag.start, tag.size); pn_disposition_clear(&delivery->local); pn_disposition_clear(&delivery->remote); delivery->updated = false; delivery->settled = false; LL_ADD(link, unsettled, delivery); delivery->referenced = true; delivery->work_next = NULL; delivery->work_prev = NULL; delivery->work = false; delivery->tpwork_next = NULL; delivery->tpwork_prev = NULL; delivery->tpwork = false; pn_buffer_clear(delivery->bytes); delivery->done = false; delivery->aborted = false; pn_record_clear(delivery->context); // begin delivery state delivery->state.init = false; delivery->state.sending = false; /* True if we have sent at least 1 frame */ delivery->state.sent = false; /* True if we have sent the entire delivery */ // end delivery state if (!link->current) link->current = delivery; link->unsettled_count++; pn_work_update(link->session->connection, delivery); // XXX: could just remove incref above pn_decref(delivery); return delivery; } bool pn_delivery_buffered(pn_delivery_t *delivery) { assert(delivery); if (delivery->settled) return false; if (pn_link_is_sender(delivery->link)) { pn_delivery_state_t *state = &delivery->state; if (state->sent) { return false; } else { return delivery->done || (pn_buffer_size(delivery->bytes) > 0); } } else { return false; } } int pn_link_unsettled(pn_link_t *link) { return link->unsettled_count; } pn_delivery_t *pn_unsettled_head(pn_link_t *link) { pn_delivery_t *d = link->unsettled_head; while (d && d->local.settled) { d = d->unsettled_next; } return d; } pn_delivery_t *pn_unsettled_next(pn_delivery_t *delivery) { pn_delivery_t *d = delivery->unsettled_next; while (d && d->local.settled) { d = d->unsettled_next; } return d; } bool pn_delivery_current(pn_delivery_t *delivery) { pn_link_t *link = delivery->link; return pn_link_current(link) == delivery; } void pn_delivery_dump(pn_delivery_t *d) { char tag[1024]; pn_bytes_t bytes = pn_buffer_bytes(d->tag); pn_quote_data(tag, 1024, bytes.start, bytes.size); printf("{tag=%s, local.type=%" PRIu64 ", remote.type=%" PRIu64 ", local.settled=%u, " "remote.settled=%u, updated=%u, current=%u, writable=%u, readable=%u, " "work=%u}", tag, d->local.type, d->remote.type, d->local.settled, d->remote.settled, d->updated, pn_delivery_current(d), pn_delivery_writable(d), pn_delivery_readable(d), d->work); } void *pn_delivery_get_context(pn_delivery_t *delivery) { assert(delivery); return pn_record_get(delivery->context, PN_LEGCTX); } void pn_delivery_set_context(pn_delivery_t *delivery, void *context) { assert(delivery); pn_record_set(delivery->context, PN_LEGCTX, context); } pn_record_t *pn_delivery_attachments(pn_delivery_t *delivery) { assert(delivery); return delivery->context; } uint64_t pn_disposition_type(pn_disposition_t *disposition) { assert(disposition); return disposition->type; } pn_data_t *pn_disposition_data(pn_disposition_t *disposition) { assert(disposition); return disposition->data; } uint32_t pn_disposition_get_section_number(pn_disposition_t *disposition) { assert(disposition); return disposition->section_number; } void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number) { assert(disposition); disposition->section_number = section_number; } uint64_t pn_disposition_get_section_offset(pn_disposition_t *disposition) { assert(disposition); return disposition->section_offset; } void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset) { assert(disposition); disposition->section_offset = section_offset; } bool pn_disposition_is_failed(pn_disposition_t *disposition) { assert(disposition); return disposition->failed; } void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed) { assert(disposition); disposition->failed = failed; } bool pn_disposition_is_undeliverable(pn_disposition_t *disposition) { assert(disposition); return disposition->undeliverable; } void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable) { assert(disposition); disposition->undeliverable = undeliverable; } pn_data_t *pn_disposition_annotations(pn_disposition_t *disposition) { assert(disposition); return disposition->annotations; } pn_condition_t *pn_disposition_condition(pn_disposition_t *disposition) { assert(disposition); return &disposition->condition; } pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery) { if (delivery) { pn_bytes_t tag = pn_buffer_bytes(delivery->tag); return pn_dtag(tag.start, tag.size); } else { return pn_dtag(0, 0); } } pn_delivery_t *pn_link_current(pn_link_t *link) { if (!link) return NULL; return link->current; } static void pni_advance_sender(pn_link_t *link) { link->current->done = true; /* Skip accounting if the link is aborted and has not sent any frames. A delivery that was aborted before sending the first frame was not accounted for in pni_process_tpwork_sender() so we don't need to account for it being sent here. */ bool skip = link->current->aborted && !link->current->state.sending; if (!skip) { link->queued++; link->credit--; link->session->outgoing_deliveries++; } pni_add_tpwork(link->current); link->current = link->current->unsettled_next; } static void pni_advance_receiver(pn_link_t *link) { link->credit--; link->queued--; link->session->incoming_deliveries--; pn_delivery_t *current = link->current; link->session->incoming_bytes -= pn_buffer_size(current->bytes); pn_buffer_clear(current->bytes); if (!link->session->state.incoming_window) { pni_add_tpwork(current); } link->current = link->current->unsettled_next; } bool pn_link_advance(pn_link_t *link) { if (link && link->current) { pn_delivery_t *prev = link->current; if (link->endpoint.type == SENDER) { pni_advance_sender(link); } else { pni_advance_receiver(link); } pn_delivery_t *next = link->current; pn_work_update(link->session->connection, prev); if (next) pn_work_update(link->session->connection, next); return prev != next; } else { return false; } } int pn_link_credit(pn_link_t *link) { return link ? link->credit : 0; } int pn_link_available(pn_link_t *link) { return link ? link->available : 0; } int pn_link_queued(pn_link_t *link) { return link ? link->queued : 0; } int pn_link_remote_credit(pn_link_t *link) { assert(link); return link->credit - link->queued; } bool pn_link_get_drain(pn_link_t *link) { assert(link); return link->drain; } pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link) { return link ? (pn_snd_settle_mode_t)link->snd_settle_mode : PN_SND_MIXED; } pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link) { return link ? (pn_rcv_settle_mode_t)link->rcv_settle_mode : PN_RCV_FIRST; } pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link) { return link ? (pn_snd_settle_mode_t)link->remote_snd_settle_mode : PN_SND_MIXED; } pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link) { return link ? (pn_rcv_settle_mode_t)link->remote_rcv_settle_mode : PN_RCV_FIRST; } void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t mode) { if (link) link->snd_settle_mode = (uint8_t)mode; } void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t mode) { if (link) link->rcv_settle_mode = (uint8_t)mode; } void pn_delivery_settle(pn_delivery_t *delivery) { assert(delivery); if (!delivery->local.settled) { pn_link_t *link = delivery->link; if (pn_delivery_current(delivery)) { pn_link_advance(link); } link->unsettled_count--; delivery->local.settled = true; pni_add_tpwork(delivery); pn_work_update(delivery->link->session->connection, delivery); pn_incref(delivery); pn_decref(delivery); } } void pn_link_offered(pn_link_t *sender, int credit) { sender->available = credit; } ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n) { pn_delivery_t *current = pn_link_current(sender); if (!current) return PN_EOS; if (!bytes || !n) return 0; pn_buffer_append(current->bytes, bytes, n); sender->session->outgoing_bytes += n; pni_add_tpwork(current); return n; } int pn_link_drained(pn_link_t *link) { assert(link); int drained = 0; if (pn_link_is_sender(link)) { if (link->drain && link->credit > 0) { link->drained = link->credit; link->credit = 0; pn_modified(link->session->connection, &link->endpoint, true); drained = link->drained; } } else { drained = link->drained; link->drained = 0; } return drained; } ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n) { if (!receiver) return PN_ARG_ERR; pn_delivery_t *delivery = receiver->current; if (!delivery) return PN_STATE_ERR; if (delivery->aborted) return PN_ABORTED; size_t size = pn_buffer_get(delivery->bytes, 0, n, bytes); pn_buffer_trim(delivery->bytes, size, 0); if (size) { receiver->session->incoming_bytes -= size; if (!receiver->session->state.incoming_window) { pni_add_tpwork(delivery); } return size; } else { return delivery->done ? PN_EOS : 0; } } void pn_link_flow(pn_link_t *receiver, int credit) { assert(receiver); assert(pn_link_is_receiver(receiver)); receiver->credit += credit; pn_modified(receiver->session->connection, &receiver->endpoint, true); if (!receiver->drain_flag_mode) { pn_link_set_drain(receiver, false); receiver->drain_flag_mode = false; } } void pn_link_drain(pn_link_t *receiver, int credit) { assert(receiver); assert(pn_link_is_receiver(receiver)); pn_link_set_drain(receiver, true); pn_link_flow(receiver, credit); receiver->drain_flag_mode = false; } void pn_link_set_drain(pn_link_t *receiver, bool drain) { assert(receiver); assert(pn_link_is_receiver(receiver)); receiver->drain = drain; pn_modified(receiver->session->connection, &receiver->endpoint, true); receiver->drain_flag_mode = true; } bool pn_link_draining(pn_link_t *receiver) { assert(receiver); assert(pn_link_is_receiver(receiver)); return receiver->drain && (pn_link_credit(receiver) > pn_link_queued(receiver)); } uint64_t pn_link_max_message_size(pn_link_t *link) { return link->max_message_size; } void pn_link_set_max_message_size(pn_link_t *link, uint64_t size) { link->max_message_size = size; } uint64_t pn_link_remote_max_message_size(pn_link_t *link) { return link->remote_max_message_size; } pn_link_t *pn_delivery_link(pn_delivery_t *delivery) { assert(delivery); return delivery->link; } pn_disposition_t *pn_delivery_local(pn_delivery_t *delivery) { assert(delivery); return &delivery->local; } uint64_t pn_delivery_local_state(pn_delivery_t *delivery) { assert(delivery); return delivery->local.type; } pn_disposition_t *pn_delivery_remote(pn_delivery_t *delivery) { assert(delivery); return &delivery->remote; } uint64_t pn_delivery_remote_state(pn_delivery_t *delivery) { assert(delivery); return delivery->remote.type; } bool pn_delivery_settled(pn_delivery_t *delivery) { return delivery ? delivery->remote.settled : false; } bool pn_delivery_updated(pn_delivery_t *delivery) { return delivery ? delivery->updated : false; } void pn_delivery_clear(pn_delivery_t *delivery) { delivery->updated = false; pn_work_update(delivery->link->session->connection, delivery); } void pn_delivery_update(pn_delivery_t *delivery, uint64_t state) { if (!delivery) return; delivery->local.type = state; pni_add_tpwork(delivery); } bool pn_delivery_writable(pn_delivery_t *delivery) { if (!delivery) return false; pn_link_t *link = delivery->link; return pn_link_is_sender(link) && pn_delivery_current(delivery) && pn_link_credit(link) > 0; } bool pn_delivery_readable(pn_delivery_t *delivery) { if (delivery) { pn_link_t *link = delivery->link; return pn_link_is_receiver(link) && pn_delivery_current(delivery); } else { return false; } } size_t pn_delivery_pending(pn_delivery_t *delivery) { /* Aborted deliveries: for clients that don't check pn_delivery_aborted(), return 1 rather than 0. This will force them to call pn_link_recv() and get the PN_ABORTED error return code. */ if (delivery->aborted) return 1; return pn_buffer_size(delivery->bytes); } bool pn_delivery_partial(pn_delivery_t *delivery) { return !delivery->done; } void pn_delivery_abort(pn_delivery_t *delivery) { if (!delivery->local.settled) { /* Can't abort a settled delivery */ delivery->aborted = true; pn_delivery_settle(delivery); } } bool pn_delivery_aborted(pn_delivery_t *delivery) { return delivery->aborted; } pn_condition_t *pn_connection_condition(pn_connection_t *connection) { assert(connection); return &connection->endpoint.condition; } pn_condition_t *pn_connection_remote_condition(pn_connection_t *connection) { assert(connection); pn_transport_t *transport = connection->transport; return transport ? &transport->remote_condition : NULL; } pn_condition_t *pn_session_condition(pn_session_t *session) { assert(session); return &session->endpoint.condition; } pn_condition_t *pn_session_remote_condition(pn_session_t *session) { assert(session); return &session->endpoint.remote_condition; } pn_condition_t *pn_link_condition(pn_link_t *link) { assert(link); return &link->endpoint.condition; } pn_condition_t *pn_link_remote_condition(pn_link_t *link) { assert(link); return &link->endpoint.remote_condition; } bool pn_condition_is_set(pn_condition_t *condition) { return condition && pn_string_get(condition->name); } void pn_condition_clear(pn_condition_t *condition) { assert(condition); pn_string_clear(condition->name); pn_string_clear(condition->description); pn_data_clear(condition->info); } const char *pn_condition_get_name(pn_condition_t *condition) { assert(condition); return pn_string_get(condition->name); } int pn_condition_set_name(pn_condition_t *condition, const char *name) { assert(condition); return pn_string_set(condition->name, name); } const char *pn_condition_get_description(pn_condition_t *condition) { assert(condition); return pn_string_get(condition->description); } int pn_condition_set_description(pn_condition_t *condition, const char *description) { assert(condition); return pn_string_set(condition->description, description); } int pn_condition_vformat(pn_condition_t *condition, const char *name, const char *fmt, va_list ap) { assert(condition); int err = pn_condition_set_name(condition, name); if (err) return err; char text[1024]; size_t n = pni_vsnprintf(text, 1024, fmt, ap); if (n >= sizeof(text)) text[sizeof(text)-1] = '\0'; err = pn_condition_set_description(condition, text); return err; } int pn_condition_format(pn_condition_t *condition, const char *name, const char *fmt, ...) { assert(condition); va_list ap; va_start(ap, fmt); int err = pn_condition_vformat(condition, name, fmt, ap); va_end(ap); return err; } pn_data_t *pn_condition_info(pn_condition_t *condition) { assert(condition); return condition->info; } bool pn_condition_is_redirect(pn_condition_t *condition) { const char *name = pn_condition_get_name(condition); return name && (!strcmp(name, "amqp:connection:redirect") || !strcmp(name, "amqp:link:redirect")); } const char *pn_condition_redirect_host(pn_condition_t *condition) { pn_data_t *data = pn_condition_info(condition); pn_data_rewind(data); pn_data_next(data); pn_data_enter(data); pn_data_lookup(data, "network-host"); pn_bytes_t host = pn_data_get_bytes(data); pn_data_rewind(data); return host.start; } int pn_condition_redirect_port(pn_condition_t *condition) { pn_data_t *data = pn_condition_info(condition); pn_data_rewind(data); pn_data_next(data); pn_data_enter(data); pn_data_lookup(data, "port"); int port = pn_data_get_int(data); pn_data_rewind(data); return port; } pn_connection_t *pn_event_connection(pn_event_t *event) { pn_session_t *ssn; pn_transport_t *transport; switch (pn_class_id(pn_event_class(event))) { case CID_pn_connection: return (pn_connection_t *) pn_event_context(event); case CID_pn_transport: transport = pn_event_transport(event); if (transport) return transport->connection; return NULL; default: ssn = pn_event_session(event); if (ssn) return pn_session_connection(ssn); } return NULL; } pn_session_t *pn_event_session(pn_event_t *event) { pn_link_t *link; switch (pn_class_id(pn_event_class(event))) { case CID_pn_session: return (pn_session_t *) pn_event_context(event); default: link = pn_event_link(event); if (link) return pn_link_session(link); } return NULL; } pn_link_t *pn_event_link(pn_event_t *event) { pn_delivery_t *dlv; switch (pn_class_id(pn_event_class(event))) { case CID_pn_link: return (pn_link_t *) pn_event_context(event); default: dlv = pn_event_delivery(event); if (dlv) return pn_delivery_link(dlv); } return NULL; } pn_delivery_t *pn_event_delivery(pn_event_t *event) { switch (pn_class_id(pn_event_class(event))) { case CID_pn_delivery: return (pn_delivery_t *) pn_event_context(event); default: return NULL; } } pn_transport_t *pn_event_transport(pn_event_t *event) { switch (pn_class_id(pn_event_class(event))) { case CID_pn_transport: return (pn_transport_t *) pn_event_context(event); default: { pn_connection_t *conn = pn_event_connection(event); if (conn) return pn_connection_transport(conn); return NULL; } } } int pn_condition_copy(pn_condition_t *dest, pn_condition_t *src) { assert(dest); assert(src); int err = 0; if (src != dest) { err = pn_string_copy(dest->name, src->name); if (!err) err = pn_string_copy(dest->description, src->description); if (!err) err = pn_data_copy(dest->info, src->info); } return err; } static pn_condition_t *cond_set(pn_condition_t *cond) { return cond && pn_condition_is_set(cond) ? cond : NULL; } static pn_condition_t *cond2_set(pn_condition_t *cond1, pn_condition_t *cond2) { pn_condition_t *cond = cond_set(cond1); if (!cond) cond = cond_set(cond2); return cond; } pn_condition_t *pn_event_condition(pn_event_t *e) { void *ctx = pn_event_context(e); switch (pn_class_id(pn_event_class(e))) { case CID_pn_connection: { pn_connection_t *c = (pn_connection_t*)ctx; return cond2_set(pn_connection_remote_condition(c), pn_connection_condition(c)); } case CID_pn_session: { pn_session_t *s = (pn_session_t*)ctx; return cond2_set(pn_session_remote_condition(s), pn_session_condition(s)); } case CID_pn_link: { pn_link_t *l = (pn_link_t*)ctx; return cond2_set(pn_link_remote_condition(l), pn_link_condition(l)); } case CID_pn_transport: return cond_set(pn_transport_condition((pn_transport_t*)ctx)); default: return NULL; } } const char *pn_disposition_type_name(uint64_t d) { switch(d) { case PN_RECEIVED: return "received"; case PN_ACCEPTED: return "accepted"; case PN_REJECTED: return "rejected"; case PN_RELEASED: return "released"; case PN_MODIFIED: return "modified"; default: return "unknown"; } } qpid-proton-0.22.0/proton-c/src/core/engine-internal.h0000664000000000000000000002520713257152177017467 0ustar #ifndef _PROTON_ENGINE_INTERNAL_H #define _PROTON_ENGINE_INTERNAL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "buffer.h" #include "dispatcher.h" #include "util.h" typedef enum pn_endpoint_type_t {CONNECTION, SESSION, SENDER, RECEIVER} pn_endpoint_type_t; typedef struct pn_endpoint_t pn_endpoint_t; struct pn_condition_t { pn_string_t *name; pn_string_t *description; pn_data_t *info; }; struct pn_endpoint_t { pn_endpoint_type_t type; pn_state_t state; pn_error_t *error; pn_condition_t condition; pn_condition_t remote_condition; pn_endpoint_t *endpoint_next; pn_endpoint_t *endpoint_prev; pn_endpoint_t *transport_next; pn_endpoint_t *transport_prev; int refcount; // when this hits zero we generate a final event bool modified; bool freed; bool referenced; }; typedef struct { pn_sequence_t id; bool sending; bool sent; bool init; } pn_delivery_state_t; typedef struct { pn_sequence_t next; pn_hash_t *deliveries; } pn_delivery_map_t; typedef struct { // XXX: stop using negative numbers uint32_t local_handle; uint32_t remote_handle; pn_sequence_t delivery_count; pn_sequence_t link_credit; } pn_link_state_t; typedef struct { // XXX: stop using negative numbers uint16_t local_channel; uint16_t remote_channel; bool incoming_init; pn_delivery_map_t incoming; pn_delivery_map_t outgoing; pn_sequence_t incoming_transfer_count; pn_sequence_t incoming_window; pn_sequence_t remote_incoming_window; pn_sequence_t outgoing_transfer_count; pn_sequence_t outgoing_window; pn_hash_t *local_handles; pn_hash_t *remote_handles; uint64_t disp_code; bool disp_settled; bool disp_type; pn_sequence_t disp_first; pn_sequence_t disp_last; bool disp; } pn_session_state_t; typedef struct pn_io_layer_t { ssize_t (*process_input)(struct pn_transport_t *transport, unsigned int layer, const char *, size_t); ssize_t (*process_output)(struct pn_transport_t *transport, unsigned int layer, char *, size_t); void (*handle_error)(struct pn_transport_t* transport, unsigned int layer); pn_timestamp_t (*process_tick)(struct pn_transport_t *transport, unsigned int layer, pn_timestamp_t); size_t (*buffered_output)(struct pn_transport_t *transport); // how much output is held } pn_io_layer_t; extern const pn_io_layer_t pni_passthru_layer; extern const pn_io_layer_t ssl_layer; extern const pn_io_layer_t sasl_header_layer; extern const pn_io_layer_t sasl_write_header_layer; // Bit flag defines for the protocol layers typedef uint8_t pn_io_layer_flags_t; #define LAYER_NONE 0 #define LAYER_AMQP1 1 #define LAYER_AMQPSASL 2 #define LAYER_AMQPSSL 4 #define LAYER_SSL 8 typedef struct pni_sasl_t pni_sasl_t; typedef struct pni_ssl_t pni_ssl_t; struct pn_transport_t { pn_tracer_t tracer; pni_sasl_t *sasl; pni_ssl_t *ssl; pn_connection_t *connection; // reference counted char *remote_container; char *remote_hostname; pn_data_t *remote_offered_capabilities; pn_data_t *remote_desired_capabilities; pn_data_t *remote_properties; pn_data_t *disp_data; //#define PN_DEFAULT_MAX_FRAME_SIZE (16*1024) /* This is wrong and bad we should really use a sensible starting size not unlimited */ #define PN_DEFAULT_MAX_FRAME_SIZE (0) /* for now, allow unlimited size */ uint32_t local_max_frame; uint32_t remote_max_frame; pn_condition_t remote_condition; pn_condition_t condition; pn_error_t *error; #define PN_IO_LAYER_CT 3 const pn_io_layer_t *io_layers[PN_IO_LAYER_CT]; /* dead remote detection */ pn_millis_t local_idle_timeout; pn_millis_t remote_idle_timeout; pn_timestamp_t dead_remote_deadline; uint64_t last_bytes_input; /* keepalive */ pn_timestamp_t keepalive_deadline; uint64_t last_bytes_output; pn_hash_t *local_channels; pn_hash_t *remote_channels; /* scratch area */ pn_string_t *scratch; pn_data_t *args; pn_data_t *output_args; pn_buffer_t *frame; // frame under construction // Temporary - ?? pn_buffer_t *output_buffer; /* statistics */ uint64_t bytes_input; uint64_t bytes_output; uint64_t output_frames_ct; uint64_t input_frames_ct; /* output buffered for send */ #define PN_TRANSPORT_INITIAL_BUFFER_SIZE (16*1024) size_t output_size; size_t output_pending; char *output_buf; /* input from peer */ size_t input_size; size_t input_pending; char *input_buf; pn_record_t *context; pn_trace_t trace; /* * The maximum channel number can be constrained in several ways: * 1. an unchangeable limit imposed by this library code * 2. a limit imposed by the remote peer when the connection is opened, * which this app must honor * 3. a limit imposed by this app, which may be raised and lowered * until the OPEN frame is sent. * These constraints are all summed up in channel_max, below. */ #define PN_IMPL_CHANNEL_MAX 32767 uint16_t local_channel_max; uint16_t remote_channel_max; uint16_t channel_max; pn_io_layer_flags_t allowed_layers; pn_io_layer_flags_t present_layers; bool freed; bool open_sent; bool open_rcvd; bool close_sent; bool close_rcvd; bool tail_closed; // input stream closed by driver bool head_closed; bool done_processing; // if true, don't call pn_process again bool posted_idle_timeout; bool server; bool halt; bool auth_required; bool authenticated; bool encryption_required; bool referenced; }; struct pn_connection_t { pn_endpoint_t endpoint; pn_endpoint_t *endpoint_head; pn_endpoint_t *endpoint_tail; pn_endpoint_t *transport_head; // reference counted pn_endpoint_t *transport_tail; pn_list_t *sessions; pn_list_t *freed; pn_transport_t *transport; pn_delivery_t *work_head; pn_delivery_t *work_tail; pn_delivery_t *tpwork_head; // reference counted pn_delivery_t *tpwork_tail; pn_string_t *container; pn_string_t *hostname; pn_string_t *auth_user; pn_string_t *auth_password; pn_data_t *offered_capabilities; pn_data_t *desired_capabilities; pn_data_t *properties; pn_collector_t *collector; pn_record_t *context; pn_list_t *delivery_pool; struct pn_connection_driver_t *driver; }; struct pn_session_t { pn_endpoint_t endpoint; pn_connection_t *connection; // reference counted pn_list_t *links; pn_list_t *freed; pn_record_t *context; size_t incoming_capacity; pn_sequence_t incoming_bytes; pn_sequence_t outgoing_bytes; pn_sequence_t incoming_deliveries; pn_sequence_t outgoing_deliveries; pn_sequence_t outgoing_window; pn_session_state_t state; }; struct pn_terminus_t { pn_string_t *address; pn_data_t *properties; pn_data_t *capabilities; pn_data_t *outcomes; pn_data_t *filter; pn_durability_t durability; pn_expiry_policy_t expiry_policy; pn_seconds_t timeout; pn_terminus_type_t type; pn_distribution_mode_t distribution_mode; bool dynamic; }; struct pn_link_t { pn_endpoint_t endpoint; pn_terminus_t source; pn_terminus_t target; pn_terminus_t remote_source; pn_terminus_t remote_target; pn_link_state_t state; pn_string_t *name; pn_session_t *session; // reference counted pn_delivery_t *unsettled_head; pn_delivery_t *unsettled_tail; pn_delivery_t *current; pn_record_t *context; size_t unsettled_count; uint64_t max_message_size; uint64_t remote_max_message_size; pn_sequence_t available; pn_sequence_t credit; pn_sequence_t queued; int drained; // number of drained credits uint8_t snd_settle_mode; uint8_t rcv_settle_mode; uint8_t remote_snd_settle_mode; uint8_t remote_rcv_settle_mode; bool drain_flag_mode; // receiver only bool drain; bool detached; }; struct pn_disposition_t { pn_condition_t condition; uint64_t type; pn_data_t *data; pn_data_t *annotations; uint64_t section_offset; uint32_t section_number; bool failed; bool undeliverable; bool settled; }; struct pn_delivery_t { pn_disposition_t local; pn_disposition_t remote; pn_link_t *link; // reference counted pn_buffer_t *tag; pn_delivery_t *unsettled_next; pn_delivery_t *unsettled_prev; pn_delivery_t *work_next; pn_delivery_t *work_prev; pn_delivery_t *tpwork_next; pn_delivery_t *tpwork_prev; pn_delivery_state_t state; pn_buffer_t *bytes; pn_record_t *context; bool updated; bool settled; // tracks whether we're in the unsettled list or not bool work; bool tpwork; bool done; bool referenced; bool aborted; }; #define PN_SET_LOCAL(OLD, NEW) \ (OLD) = ((OLD) & PN_REMOTE_MASK) | (NEW) #define PN_SET_REMOTE(OLD, NEW) \ (OLD) = ((OLD) & PN_LOCAL_MASK) | (NEW) void pn_link_dump(pn_link_t *link); void pn_dump(pn_connection_t *conn); void pn_transport_sasl_init(pn_transport_t *transport); void pn_condition_init(pn_condition_t *condition); void pn_condition_tini(pn_condition_t *condition); void pn_modified(pn_connection_t *connection, pn_endpoint_t *endpoint, bool emit); void pn_real_settle(pn_delivery_t *delivery); // will free delivery if link is freed void pn_clear_tpwork(pn_delivery_t *delivery); void pn_work_update(pn_connection_t *connection, pn_delivery_t *delivery); void pn_clear_modified(pn_connection_t *connection, pn_endpoint_t *endpoint); void pn_connection_bound(pn_connection_t *conn); void pn_connection_unbound(pn_connection_t *conn); int pn_do_error(pn_transport_t *transport, const char *condition, const char *fmt, ...); void pn_set_error_layer(pn_transport_t *transport); void pn_session_unbound(pn_session_t* ssn); void pn_link_unbound(pn_link_t* link); void pn_ep_incref(pn_endpoint_t *endpoint); void pn_ep_decref(pn_endpoint_t *endpoint); int pn_post_frame(pn_transport_t *transport, uint8_t type, uint16_t ch, const char *fmt, ...); typedef enum {IN, OUT} pn_dir_t; void pn_do_trace(pn_transport_t *transport, uint16_t ch, pn_dir_t dir, pn_data_t *args, const char *payload, size_t size); #endif /* engine-internal.h */ qpid-proton-0.22.0/proton-c/src/core/encoder.h0000664000000000000000000000214313257152177016021 0ustar #ifndef _PROTON_ENCODER_H #define _PROTON_ENCODER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ typedef struct pn_encoder_t pn_encoder_t; pn_encoder_t *pn_encoder(void); ssize_t pn_encoder_encode(pn_encoder_t *encoder, pn_data_t *src, char *dst, size_t size); ssize_t pn_encoder_size(pn_encoder_t *encoder, pn_data_t *src); #endif /* encoder.h */ qpid-proton-0.22.0/proton-c/src/core/encoder.c0000664000000000000000000003241313257152177016017 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "encodings.h" #include "encoder.h" #include #include "data.h" struct pn_encoder_t { char *output; char *position; pn_error_t *error; size_t size; unsigned null_count; }; static void pn_encoder_initialize(void *obj) { pn_encoder_t *encoder = (pn_encoder_t *) obj; encoder->output = NULL; encoder->position = NULL; encoder->error = pn_error(); encoder->size = 0; encoder->null_count = 0; } static void pn_encoder_finalize(void *obj) { pn_encoder_t *encoder = (pn_encoder_t *) obj; pn_error_free(encoder->error); } #define pn_encoder_hashcode NULL #define pn_encoder_compare NULL #define pn_encoder_inspect NULL pn_encoder_t *pn_encoder() { static const pn_class_t clazz = PN_CLASS(pn_encoder); return (pn_encoder_t *) pn_class_new(&clazz, sizeof(pn_encoder_t)); } static uint8_t pn_type2code(pn_encoder_t *encoder, pn_type_t type) { switch (type) { case PN_NULL: return PNE_NULL; case PN_BOOL: return PNE_BOOLEAN; case PN_UBYTE: return PNE_UBYTE; case PN_BYTE: return PNE_BYTE; case PN_USHORT: return PNE_USHORT; case PN_SHORT: return PNE_SHORT; case PN_UINT: return PNE_UINT; case PN_INT: return PNE_INT; case PN_CHAR: return PNE_UTF32; case PN_FLOAT: return PNE_FLOAT; case PN_LONG: return PNE_LONG; case PN_TIMESTAMP: return PNE_MS64; case PN_DOUBLE: return PNE_DOUBLE; case PN_DECIMAL32: return PNE_DECIMAL32; case PN_DECIMAL64: return PNE_DECIMAL64; case PN_DECIMAL128: return PNE_DECIMAL128; case PN_UUID: return PNE_UUID; case PN_ULONG: return PNE_ULONG; case PN_BINARY: return PNE_VBIN32; case PN_STRING: return PNE_STR32_UTF8; case PN_SYMBOL: return PNE_SYM32; case PN_LIST: return PNE_LIST32; case PN_ARRAY: return PNE_ARRAY32; case PN_MAP: return PNE_MAP32; case PN_DESCRIBED: return PNE_DESCRIPTOR; default: return pn_error_format(encoder->error, PN_ERR, "not a value type: %u\n", type); } } static uint8_t pn_node2code(pn_encoder_t *encoder, pni_node_t *node) { switch (node->atom.type) { case PN_LONG: if (-128 <= node->atom.u.as_long && node->atom.u.as_long <= 127) { return PNE_SMALLLONG; } else { return PNE_LONG; } case PN_INT: if (-128 <= node->atom.u.as_int && node->atom.u.as_int <= 127) { return PNE_SMALLINT; } else { return PNE_INT; } case PN_ULONG: if (node->atom.u.as_ulong < 256) { return PNE_SMALLULONG; } else { return PNE_ULONG; } case PN_UINT: if (node->atom.u.as_uint < 256) { return PNE_SMALLUINT; } else { return PNE_UINT; } case PN_BOOL: if (node->atom.u.as_bool) { return PNE_TRUE; } else { return PNE_FALSE; } case PN_STRING: if (node->atom.u.as_bytes.size < 256) { return PNE_STR8_UTF8; } else { return PNE_STR32_UTF8; } case PN_SYMBOL: if (node->atom.u.as_bytes.size < 256) { return PNE_SYM8; } else { return PNE_SYM32; } case PN_BINARY: if (node->atom.u.as_bytes.size < 256) { return PNE_VBIN8; } else { return PNE_VBIN32; } default: return pn_type2code(encoder, node->atom.type); } } static size_t pn_encoder_remaining(pn_encoder_t *encoder) { char * end = encoder->output + encoder->size; if (end > encoder->position) return end - encoder->position; else return 0; } static inline void pn_encoder_writef8(pn_encoder_t *encoder, uint8_t value) { if (pn_encoder_remaining(encoder)) { encoder->position[0] = value; } encoder->position++; } static inline void pn_encoder_writef16(pn_encoder_t *encoder, uint16_t value) { if (pn_encoder_remaining(encoder) >= 2) { encoder->position[0] = 0xFF & (value >> 8); encoder->position[1] = 0xFF & (value ); } encoder->position += 2; } static inline void pn_encoder_writef32(pn_encoder_t *encoder, uint32_t value) { if (pn_encoder_remaining(encoder) >= 4) { encoder->position[0] = 0xFF & (value >> 24); encoder->position[1] = 0xFF & (value >> 16); encoder->position[2] = 0xFF & (value >> 8); encoder->position[3] = 0xFF & (value ); } encoder->position += 4; } static inline void pn_encoder_writef64(pn_encoder_t *encoder, uint64_t value) { if (pn_encoder_remaining(encoder) >= 8) { encoder->position[0] = 0xFF & (value >> 56); encoder->position[1] = 0xFF & (value >> 48); encoder->position[2] = 0xFF & (value >> 40); encoder->position[3] = 0xFF & (value >> 32); encoder->position[4] = 0xFF & (value >> 24); encoder->position[5] = 0xFF & (value >> 16); encoder->position[6] = 0xFF & (value >> 8); encoder->position[7] = 0xFF & (value ); } encoder->position += 8; } static inline void pn_encoder_writef128(pn_encoder_t *encoder, char *value) { if (pn_encoder_remaining(encoder) >= 16) { memmove(encoder->position, value, 16); } encoder->position += 16; } static inline void pn_encoder_writev8(pn_encoder_t *encoder, const pn_bytes_t *value) { pn_encoder_writef8(encoder, value->size); if (pn_encoder_remaining(encoder) >= value->size) memmove(encoder->position, value->start, value->size); encoder->position += value->size; } static inline void pn_encoder_writev32(pn_encoder_t *encoder, const pn_bytes_t *value) { pn_encoder_writef32(encoder, value->size); if (pn_encoder_remaining(encoder) >= value->size) memmove(encoder->position, value->start, value->size); encoder->position += value->size; } /* True if node is an element of an array - not the descriptor. */ static bool pn_is_in_array(pn_data_t *data, pni_node_t *parent, pni_node_t *node) { return (parent && parent->atom.type == PN_ARRAY) /* In array */ && !(parent->described && !node->prev); /* Not the descriptor */ } /** True if node is the first element of an array, not the descriptor. *@pre pn_is_in_array(data, parent, node) */ static bool pn_is_first_in_array(pn_data_t *data, pni_node_t *parent, pni_node_t *node) { if (!node->prev) return !parent->described; /* First node */ return parent->described && (!pn_data_node(data, node->prev)->prev); } /** True if node is in a described list - not the descriptor. * - In this case we can omit trailing nulls */ static bool pn_is_in_described_list(pn_data_t *data, pni_node_t *parent, pni_node_t *node) { return parent && parent->atom.type == PN_LIST && parent->described; } typedef union { uint32_t i; uint32_t a[2]; uint64_t l; float f; double d; } conv_t; static int pni_encoder_enter(void *ctx, pn_data_t *data, pni_node_t *node) { pn_encoder_t *encoder = (pn_encoder_t *) ctx; pni_node_t *parent = pn_data_node(data, node->parent); pn_atom_t *atom = &node->atom; uint8_t code; conv_t c; /** In an array we don't write the code before each element, only the first. */ if (pn_is_in_array(data, parent, node)) { code = pn_type2code(encoder, parent->type); if (pn_is_first_in_array(data, parent, node)) { pn_encoder_writef8(encoder, code); } } else { code = pn_node2code(encoder, node); // Omit trailing nulls for described lists if (pn_is_in_described_list(data, parent, node)) { if (code==PNE_NULL) { encoder->null_count++; } else { // Output pending nulls, then the nodes code for (unsigned i = 0; inull_count; i++) { pn_encoder_writef8(encoder, PNE_NULL); } encoder->null_count = 0; pn_encoder_writef8(encoder, code); } } else { pn_encoder_writef8(encoder, code); } } switch (code) { case PNE_DESCRIPTOR: case PNE_NULL: case PNE_TRUE: case PNE_FALSE: return 0; case PNE_BOOLEAN: pn_encoder_writef8(encoder, atom->u.as_bool); return 0; case PNE_UBYTE: pn_encoder_writef8(encoder, atom->u.as_ubyte); return 0; case PNE_BYTE: pn_encoder_writef8(encoder, atom->u.as_byte); return 0; case PNE_USHORT: pn_encoder_writef16(encoder, atom->u.as_ushort); return 0; case PNE_SHORT: pn_encoder_writef16(encoder, atom->u.as_short); return 0; case PNE_UINT0: return 0; case PNE_SMALLUINT: pn_encoder_writef8(encoder, atom->u.as_uint); return 0; case PNE_UINT: pn_encoder_writef32(encoder, atom->u.as_uint); return 0; case PNE_SMALLINT: pn_encoder_writef8(encoder, atom->u.as_int); return 0; case PNE_INT: pn_encoder_writef32(encoder, atom->u.as_int); return 0; case PNE_UTF32: pn_encoder_writef32(encoder, atom->u.as_char); return 0; case PNE_ULONG: pn_encoder_writef64(encoder, atom->u.as_ulong); return 0; case PNE_SMALLULONG: pn_encoder_writef8(encoder, atom->u.as_ulong); return 0; case PNE_LONG: pn_encoder_writef64(encoder, atom->u.as_long); return 0; case PNE_SMALLLONG: pn_encoder_writef8(encoder, atom->u.as_long); return 0; case PNE_MS64: pn_encoder_writef64(encoder, atom->u.as_timestamp); return 0; case PNE_FLOAT: c.f = atom->u.as_float; pn_encoder_writef32(encoder, c.i); return 0; case PNE_DOUBLE: c.d = atom->u.as_double; pn_encoder_writef64(encoder, c.l); return 0; case PNE_DECIMAL32: pn_encoder_writef32(encoder, atom->u.as_decimal32); return 0; case PNE_DECIMAL64: pn_encoder_writef64(encoder, atom->u.as_decimal64); return 0; case PNE_DECIMAL128: pn_encoder_writef128(encoder, atom->u.as_decimal128.bytes); return 0; case PNE_UUID: pn_encoder_writef128(encoder, atom->u.as_uuid.bytes); return 0; case PNE_VBIN8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0; case PNE_VBIN32: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0; case PNE_STR8_UTF8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0; case PNE_STR32_UTF8: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0; case PNE_SYM8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0; case PNE_SYM32: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0; case PNE_ARRAY32: node->start = encoder->position; node->small = false; // we'll backfill the size on exit encoder->position += 4; pn_encoder_writef32(encoder, node->described ? node->children - 1 : node->children); if (node->described) pn_encoder_writef8(encoder, 0); return 0; case PNE_LIST32: case PNE_MAP32: node->start = encoder->position; node->small = false; // we'll backfill the size later encoder->position += 4; pn_encoder_writef32(encoder, node->children); return 0; default: return pn_error_format(data->error, PN_ERR, "unrecognized encoding: %u", code); } } #include static int pni_encoder_exit(void *ctx, pn_data_t *data, pni_node_t *node) { pn_encoder_t *encoder = (pn_encoder_t *) ctx; char *pos; // Special case 0 length list if (node->atom.type==PN_LIST && node->children-encoder->null_count==0) { encoder->position = node->start-1; // position of list opcode pn_encoder_writef8(encoder, PNE_LIST0); encoder->null_count = 0; return 0; } switch (node->atom.type) { case PN_ARRAY: if ((node->described && node->children == 1) || (!node->described && node->children == 0)) { pn_encoder_writef8(encoder, pn_type2code(encoder, node->type)); } // Fallthrough case PN_LIST: case PN_MAP: pos = encoder->position; encoder->position = node->start; if (node->small) { // backfill size size_t size = pos - node->start - 1; pn_encoder_writef8(encoder, size); // Adjust count if (encoder->null_count) { pn_encoder_writef8(encoder, node->children-encoder->null_count); } } else { // backfill size size_t size = pos - node->start - 4; pn_encoder_writef32(encoder, size); // Adjust count if (encoder->null_count) { pn_encoder_writef32(encoder, node->children-encoder->null_count); } } encoder->position = pos; encoder->null_count = 0; return 0; default: return 0; } } ssize_t pn_encoder_encode(pn_encoder_t *encoder, pn_data_t *src, char *dst, size_t size) { encoder->output = dst; encoder->position = dst; encoder->size = size; int err = pni_data_traverse(src, pni_encoder_enter, pni_encoder_exit, encoder); if (err) return err; size_t encoded = encoder->position - encoder->output; if (encoded > size) { pn_error_format(pn_data_error(src), PN_OVERFLOW, "not enough space to encode"); return PN_OVERFLOW; } return (ssize_t)encoded; } ssize_t pn_encoder_size(pn_encoder_t *encoder, pn_data_t *src) { encoder->output = 0; encoder->position = 0; encoder->size = 0; pn_handle_t save = pn_data_point(src); int err = pni_data_traverse(src, pni_encoder_enter, pni_encoder_exit, encoder); pn_data_restore(src, save); if (err) return err; return encoder->position - encoder->output; } qpid-proton-0.22.0/proton-c/src/core/dispatcher.h0000664000000000000000000000247613257152177016541 0ustar #ifndef _PROTON_DISPATCHER_H #define _PROTON_DISPATCHER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef __cplusplus #include #endif #include "proton/codec.h" #include "proton/types.h" typedef int (pn_action_t)(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); ssize_t pn_dispatcher_input(pn_transport_t* transport, const char* bytes, size_t available, bool batch, bool* halt); ssize_t pn_dispatcher_output(pn_transport_t *transport, char *bytes, size_t size); #endif /* dispatcher.h */ qpid-proton-0.22.0/proton-c/src/core/dispatcher.c0000664000000000000000000001244013257152177016524 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "dispatcher.h" #include "framing.h" #include "protocol.h" #include "engine-internal.h" #include "dispatch_actions.h" int pni_bad_frame(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_transport_logf(transport, "Error dispatching frame: type: %d: Unknown performative", frame_type); return PN_ERR; } int pni_bad_frame_type(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_transport_logf(transport, "Error dispatching frame: Unknown frame type: %d", frame_type); return PN_ERR; } // We could use a table based approach here if we needed to dynamically // add new performatives static inline int pni_dispatch_action(pn_transport_t* transport, uint64_t lcode, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) { pn_action_t *action; switch (frame_type) { case AMQP_FRAME_TYPE: /* Regular AMQP fames */ switch (lcode) { case OPEN: action = pn_do_open; break; case BEGIN: action = pn_do_begin; break; case ATTACH: action = pn_do_attach; break; case FLOW: action = pn_do_flow; break; case TRANSFER: action = pn_do_transfer; break; case DISPOSITION: action = pn_do_disposition; break; case DETACH: action = pn_do_detach; break; case END: action = pn_do_end; break; case CLOSE: action = pn_do_close; break; default: action = pni_bad_frame; break; }; break; case SASL_FRAME_TYPE: /* SASL frames */ switch (lcode) { case SASL_MECHANISMS: action = pn_do_mechanisms; break; case SASL_INIT: action = pn_do_init; break; case SASL_CHALLENGE: action = pn_do_challenge; break; case SASL_RESPONSE: action = pn_do_response; break; case SASL_OUTCOME: action = pn_do_outcome; break; default: action = pni_bad_frame; break; }; break; default: action = pni_bad_frame_type; break; }; return action(transport, frame_type, channel, args, payload); } static int pni_dispatch_frame(pn_transport_t * transport, pn_data_t *args, pn_frame_t frame) { if (frame.size == 0) { // ignore null frames if (transport->trace & PN_TRACE_FRM) pn_transport_logf(transport, "%u <- (EMPTY FRAME)", frame.channel); return 0; } ssize_t dsize = pn_data_decode(args, frame.payload, frame.size); if (dsize < 0) { pn_string_format(transport->scratch, "Error decoding frame: %s %s\n", pn_code(dsize), pn_error_text(pn_data_error(args))); pn_quote(transport->scratch, frame.payload, frame.size); pn_transport_log(transport, pn_string_get(transport->scratch)); return dsize; } uint8_t frame_type = frame.type; uint16_t channel = frame.channel; // XXX: assuming numeric - // if we get a symbol we should map it to the numeric value and dispatch on that uint64_t lcode; bool scanned; int e = pn_data_scan(args, "D?L.", &scanned, &lcode); if (e) { pn_transport_log(transport, "Scan error"); return e; } if (!scanned) { pn_transport_log(transport, "Error dispatching frame"); return PN_ERR; } size_t payload_size = frame.size - dsize; const char *payload_mem = payload_size ? frame.payload + dsize : NULL; pn_bytes_t payload = {payload_size, payload_mem}; pn_do_trace(transport, channel, IN, args, payload_mem, payload_size); int err = pni_dispatch_action(transport, lcode, frame_type, channel, args, &payload); pn_data_clear(args); return err; } ssize_t pn_dispatcher_input(pn_transport_t *transport, const char *bytes, size_t available, bool batch, bool *halt) { size_t read = 0; while (available && !*halt) { pn_frame_t frame; ssize_t n = pn_read_frame(&frame, bytes + read, available, transport->local_max_frame); if (n > 0) { read += n; available -= n; transport->input_frames_ct += 1; int e = pni_dispatch_frame(transport, transport->args, frame); if (e) return e; } else if (n < 0) { pn_do_error(transport, "amqp:connection:framing-error", "malformed frame"); return n; } else { break; } if (!batch) break; } return read; } ssize_t pn_dispatcher_output(pn_transport_t *transport, char *bytes, size_t size) { int n = pn_buffer_get(transport->output_buffer, 0, size, bytes); pn_buffer_trim(transport->output_buffer, n, 0); // XXX: need to check for errors return n; } qpid-proton-0.22.0/proton-c/src/core/dispatch_actions.h0000664000000000000000000000542013257152177017722 0ustar #ifndef _PROTON_DISPATCH_ACTIONS_H #define _PROTON_DISPATCH_ACTIONS_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "dispatcher.h" #define AMQP_FRAME_TYPE (0) #define SASL_FRAME_TYPE (1) /* AMQP actions */ int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_begin(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_transfer(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_flow(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_disposition(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_detach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_end(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_close(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); /* SASL actions */ int pn_do_init(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_challenge(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_response(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); int pn_do_outcome(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload); #endif // _PROTON_DISPATCH_ACTIONS_H qpid-proton-0.22.0/proton-c/src/core/decoder.h0000664000000000000000000000205113257152177016005 0ustar #ifndef _PROTON_DECODER_H #define _PROTON_DECODER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ typedef struct pn_decoder_t pn_decoder_t; pn_decoder_t *pn_decoder(void); ssize_t pn_decoder_decode(pn_decoder_t *decoder, const char *src, size_t size, pn_data_t *dst); #endif /* decoder.h */ qpid-proton-0.22.0/proton-c/src/core/decoder.c0000664000000000000000000003203213257152177016002 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include "encodings.h" #include "decoder.h" #include struct pn_decoder_t { const char *input; size_t size; const char *position; pn_error_t *error; }; static void pn_decoder_initialize(void *obj) { pn_decoder_t *decoder = (pn_decoder_t *) obj; decoder->input = NULL; decoder->size = 0; decoder->position = NULL; decoder->error = pn_error(); } static void pn_decoder_finalize(void *obj) { pn_decoder_t *decoder = (pn_decoder_t *) obj; pn_error_free(decoder->error); } #define pn_decoder_hashcode NULL #define pn_decoder_compare NULL #define pn_decoder_inspect NULL pn_decoder_t *pn_decoder() { static const pn_class_t clazz = PN_CLASS(pn_decoder); return (pn_decoder_t *) pn_class_new(&clazz, sizeof(pn_decoder_t)); } static inline uint8_t pn_decoder_readf8(pn_decoder_t *decoder) { uint8_t r = decoder->position[0]; decoder->position++; return r; } static inline uint16_t pn_decoder_readf16(pn_decoder_t *decoder) { uint16_t a = (uint8_t) decoder->position[0]; uint16_t b = (uint8_t) decoder->position[1]; uint16_t r = a << 8 | b; decoder->position += 2; return r; } static inline uint32_t pn_decoder_readf32(pn_decoder_t *decoder) { uint32_t a = (uint8_t) decoder->position[0]; uint32_t b = (uint8_t) decoder->position[1]; uint32_t c = (uint8_t) decoder->position[2]; uint32_t d = (uint8_t) decoder->position[3]; uint32_t r = a << 24 | b << 16 | c << 8 | d; decoder->position += 4; return r; } static inline uint64_t pn_decoder_readf64(pn_decoder_t *decoder) { uint64_t a = pn_decoder_readf32(decoder); uint64_t b = pn_decoder_readf32(decoder); return a << 32 | b; } static inline void pn_decoder_readf128(pn_decoder_t *decoder, void *dst) { memmove(dst, decoder->position, 16); decoder->position += 16; } static inline size_t pn_decoder_remaining(pn_decoder_t *decoder) { return decoder->input + decoder->size - decoder->position; } typedef union { uint32_t i; uint32_t a[2]; uint64_t l; float f; double d; } conv_t; static inline pn_type_t pn_code2type(uint8_t code) { switch (code) { case PNE_DESCRIPTOR: return (pn_type_t) PN_ARG_ERR; case PNE_NULL: return PN_NULL; case PNE_TRUE: case PNE_FALSE: case PNE_BOOLEAN: return PN_BOOL; case PNE_UBYTE: return PN_UBYTE; case PNE_BYTE: return PN_BYTE; case PNE_USHORT: return PN_USHORT; case PNE_SHORT: return PN_SHORT; case PNE_UINT0: case PNE_SMALLUINT: case PNE_UINT: return PN_UINT; case PNE_SMALLINT: case PNE_INT: return PN_INT; case PNE_UTF32: return PN_CHAR; case PNE_FLOAT: return PN_FLOAT; case PNE_LONG: case PNE_SMALLLONG: return PN_LONG; case PNE_MS64: return PN_TIMESTAMP; case PNE_DOUBLE: return PN_DOUBLE; case PNE_DECIMAL32: return PN_DECIMAL32; case PNE_DECIMAL64: return PN_DECIMAL64; case PNE_DECIMAL128: return PN_DECIMAL128; case PNE_UUID: return PN_UUID; case PNE_ULONG0: case PNE_SMALLULONG: case PNE_ULONG: return PN_ULONG; case PNE_VBIN8: case PNE_VBIN32: return PN_BINARY; case PNE_STR8_UTF8: case PNE_STR32_UTF8: return PN_STRING; case PNE_SYM8: case PNE_SYM32: return PN_SYMBOL; case PNE_LIST0: case PNE_LIST8: case PNE_LIST32: return PN_LIST; case PNE_ARRAY8: case PNE_ARRAY32: return PN_ARRAY; case PNE_MAP8: case PNE_MAP32: return PN_MAP; default: return (pn_type_t) PN_ARG_ERR; } } static int pni_decoder_decode_type(pn_decoder_t *decoder, pn_data_t *data, uint8_t *code); static int pni_decoder_single(pn_decoder_t *decoder, pn_data_t *data); void pni_data_set_array_type(pn_data_t *data, pn_type_t type); static int pni_decoder_decode_value(pn_decoder_t *decoder, pn_data_t *data, uint8_t code) { int err; conv_t conv; pn_decimal128_t dec128; pn_uuid_t uuid; size_t size; size_t count; switch (code) { case PNE_NULL: err = pn_data_put_null(data); break; case PNE_TRUE: err = pn_data_put_bool(data, true); break; case PNE_FALSE: err = pn_data_put_bool(data, false); break; case PNE_BOOLEAN: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_bool(data, pn_decoder_readf8(decoder) != 0); break; case PNE_UBYTE: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_ubyte(data, pn_decoder_readf8(decoder)); break; case PNE_BYTE: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_byte(data, pn_decoder_readf8(decoder)); break; case PNE_USHORT: if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW; err = pn_data_put_ushort(data, pn_decoder_readf16(decoder)); break; case PNE_SHORT: if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW; err = pn_data_put_short(data, pn_decoder_readf16(decoder)); break; case PNE_UINT: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; err = pn_data_put_uint(data, pn_decoder_readf32(decoder)); break; case PNE_UINT0: err = pn_data_put_uint(data, 0); break; case PNE_SMALLUINT: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_uint(data, pn_decoder_readf8(decoder)); break; case PNE_SMALLINT: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_int(data, (int8_t)pn_decoder_readf8(decoder)); break; case PNE_INT: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; err = pn_data_put_int(data, pn_decoder_readf32(decoder)); break; case PNE_UTF32: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; err = pn_data_put_char(data, pn_decoder_readf32(decoder)); break; case PNE_FLOAT: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; // XXX: this assumes the platform uses IEEE floats conv.i = pn_decoder_readf32(decoder); err = pn_data_put_float(data, conv.f); break; case PNE_DECIMAL32: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; err = pn_data_put_decimal32(data, pn_decoder_readf32(decoder)); break; case PNE_ULONG: if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; err = pn_data_put_ulong(data, pn_decoder_readf64(decoder)); break; case PNE_LONG: if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; err = pn_data_put_long(data, pn_decoder_readf64(decoder)); break; case PNE_MS64: if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; err = pn_data_put_timestamp(data, pn_decoder_readf64(decoder)); break; case PNE_DOUBLE: // XXX: this assumes the platform uses IEEE floats if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; conv.l = pn_decoder_readf64(decoder); err = pn_data_put_double(data, conv.d); break; case PNE_DECIMAL64: if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; err = pn_data_put_decimal64(data, pn_decoder_readf64(decoder)); break; case PNE_ULONG0: err = pn_data_put_ulong(data, 0); break; case PNE_SMALLULONG: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_ulong(data, pn_decoder_readf8(decoder)); break; case PNE_SMALLLONG: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; err = pn_data_put_long(data, (int8_t)pn_decoder_readf8(decoder)); break; case PNE_DECIMAL128: if (pn_decoder_remaining(decoder) < 16) return PN_UNDERFLOW; pn_decoder_readf128(decoder, &dec128); err = pn_data_put_decimal128(data, dec128); break; case PNE_UUID: if (pn_decoder_remaining(decoder) < 16) return PN_UNDERFLOW; pn_decoder_readf128(decoder, &uuid); err = pn_data_put_uuid(data, uuid); break; case PNE_VBIN8: case PNE_STR8_UTF8: case PNE_SYM8: case PNE_VBIN32: case PNE_STR32_UTF8: case PNE_SYM32: switch (code & 0xF0) { case 0xA0: if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW; size = pn_decoder_readf8(decoder); break; case 0xB0: if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW; size = pn_decoder_readf32(decoder); break; default: return PN_ARG_ERR; } if (pn_decoder_remaining(decoder) < size) return PN_UNDERFLOW; { char *start = (char *) decoder->position; pn_bytes_t bytes = {size, start}; switch (code & 0x0F) { case 0x0: err = pn_data_put_binary(data, bytes); break; case 0x1: err = pn_data_put_string(data, bytes); break; case 0x3: err = pn_data_put_symbol(data, bytes); break; default: return PN_ARG_ERR; } } decoder->position += size; break; case PNE_LIST0: err = pn_data_put_list(data); break; case PNE_ARRAY8: case PNE_ARRAY32: case PNE_LIST8: case PNE_LIST32: case PNE_MAP8: case PNE_MAP32: switch (code) { case PNE_ARRAY8: case PNE_LIST8: case PNE_MAP8: if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW; size = pn_decoder_readf8(decoder); if (pn_decoder_remaining(decoder) < size) return PN_UNDERFLOW; count = pn_decoder_readf8(decoder); break; case PNE_ARRAY32: case PNE_LIST32: case PNE_MAP32: if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW; size = pn_decoder_readf32(decoder); if (pn_decoder_remaining(decoder) < size) return PN_UNDERFLOW; count = pn_decoder_readf32(decoder); break; default: return PN_ARG_ERR; } switch (code) { case PNE_ARRAY8: case PNE_ARRAY32: { uint8_t next = *decoder->position; bool described = (next == PNE_DESCRIPTOR); err = pn_data_put_array(data, described, (pn_type_t) 0); if (err) return err; pn_data_enter(data); uint8_t acode; int e = pni_decoder_decode_type(decoder, data, &acode); if (e) return e; pn_type_t type = pn_code2type(acode); if ((int)type < 0) return (int)type; for (size_t i = 0; i < count; i++) { e = pni_decoder_decode_value(decoder, data, acode); if (e) return e; } pn_data_exit(data); pni_data_set_array_type(data, type); } return 0; case PNE_LIST8: case PNE_LIST32: err = pn_data_put_list(data); if (err) return err; break; case PNE_MAP8: case PNE_MAP32: err = pn_data_put_map(data); if (err) return err; break; default: return PN_ARG_ERR; } pn_data_enter(data); for (size_t i = 0; i < count; i++) { int e = pni_decoder_single(decoder, data); if (e) return e; } pn_data_exit(data); return 0; default: return pn_error_format(decoder->error, PN_ARG_ERR, "unrecognized typecode: %u", code); } return err; } pn_type_t pni_data_parent_type(pn_data_t *data); static int pni_decoder_decode_type(pn_decoder_t *decoder, pn_data_t *data, uint8_t *code) { int err; if (!pn_decoder_remaining(decoder)) { return PN_UNDERFLOW; } uint8_t next = *decoder->position++; if (next == PNE_DESCRIPTOR) { if (pni_data_parent_type(data) != PN_ARRAY) { err = pn_data_put_described(data); if (err) return err; // pni_decoder_single has the corresponding exit pn_data_enter(data); } err = pni_decoder_single(decoder, data); if (err) return err; err = pni_decoder_decode_type(decoder, data, code); if (err) return err; } else { *code = next; } return 0; } size_t pn_data_siblings(pn_data_t *data); int pni_decoder_single(pn_decoder_t *decoder, pn_data_t *data) { uint8_t code; int err = pni_decoder_decode_type(decoder, data, &code); if (err) return err; err = pni_decoder_decode_value(decoder, data, code); if (err) return err; if (pni_data_parent_type(data) == PN_DESCRIBED && pn_data_siblings(data) > 1) { pn_data_exit(data); } return 0; } ssize_t pn_decoder_decode(pn_decoder_t *decoder, const char *src, size_t size, pn_data_t *dst) { decoder->input = src; decoder->size = size; decoder->position = src; int err = pni_decoder_single(decoder, dst); if (err == PN_UNDERFLOW) return pn_error_format(pn_data_error(dst), PN_UNDERFLOW, "not enough data to decode"); if (err) return err; return decoder->position - decoder->input; } qpid-proton-0.22.0/proton-c/src/core/data.h0000664000000000000000000000365613257152177015325 0ustar #ifndef _PROTON_DATA_H #define _PROTON_DATA_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include "buffer.h" #include "decoder.h" #include "encoder.h" typedef uint16_t pni_nid_t; #define PNI_NID_MAX ((pni_nid_t)-1) typedef struct { char *start; size_t data_offset; size_t data_size; pn_atom_t atom; pn_type_t type; pni_nid_t next; pni_nid_t prev; pni_nid_t down; pni_nid_t parent; pni_nid_t children; // for arrays bool described; bool data; bool small; } pni_node_t; struct pn_data_t { pni_node_t *nodes; pn_buffer_t *buf; pn_decoder_t *decoder; pn_encoder_t *encoder; pn_error_t *error; pn_string_t *str; pni_nid_t capacity; pni_nid_t size; pni_nid_t parent; pni_nid_t current; pni_nid_t base_parent; pni_nid_t base_current; }; static inline pni_node_t * pn_data_node(pn_data_t *data, pni_nid_t nd) { return nd ? (data->nodes + nd - 1) : NULL; } int pni_data_traverse(pn_data_t *data, int (*enter)(void *ctx, pn_data_t *data, pni_node_t *node), int (*exit)(void *ctx, pn_data_t *data, pni_node_t *node), void *ctx); #endif /* data.h */ qpid-proton-0.22.0/proton-c/src/core/connection_driver.c0000664000000000000000000001455713257152177020123 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "engine-internal.h" #include #include #include #include #include #include struct driver_batch { pn_event_batch_t batch; pn_collector_t *collector; }; static pn_event_t *batch_next(pn_event_batch_t *batch) { pn_connection_driver_t *d = (pn_connection_driver_t*)((char*)batch - offsetof(pn_connection_driver_t, batch)); if (!d->collector) return NULL; pn_event_t *handled = pn_collector_prev(d->collector); if (handled) { switch (pn_event_type(handled)) { case PN_CONNECTION_INIT: /* Auto-bind after the INIT event is handled */ pn_transport_bind(d->transport, d->connection); break; case PN_TRANSPORT_CLOSED: /* No more events after TRANSPORT_CLOSED */ pn_collector_release(d->collector); break; default: break; } } /* Log the next event that will be processed */ pn_event_t *next = pn_collector_next(d->collector); if (next && d->transport->trace & PN_TRACE_EVT) { pn_string_clear(d->transport->scratch); pn_inspect(next, d->transport->scratch); pn_transport_log(d->transport, pn_string_get(d->transport->scratch)); } return next; } int pn_connection_driver_init(pn_connection_driver_t* d, pn_connection_t *c, pn_transport_t *t) { memset(d, 0, sizeof(*d)); d->batch.next_event = &batch_next; d->connection = c ? c : pn_connection(); d->transport = t ? t : pn_transport(); d->collector = pn_collector(); if (!d->connection || !d->transport || !d->collector) { pn_connection_driver_destroy(d); return PN_OUT_OF_MEMORY; } pn_connection_collect(d->connection, d->collector); return 0; } int pn_connection_driver_bind(pn_connection_driver_t *d) { return pn_transport_bind(d->transport, d->connection); } pn_connection_t *pn_connection_driver_release_connection(pn_connection_driver_t *d) { if (d->transport) { /* Make sure transport is closed and unbound */ pn_connection_driver_close(d); pn_transport_unbind(d->transport); } pn_connection_t *c = d->connection; if (c) { d->connection = NULL; pn_connection_collect(c, NULL); /* Disconnect from the collector */ } return c; } void pn_connection_driver_destroy(pn_connection_driver_t *d) { pn_connection_t *c = pn_connection_driver_release_connection(d); if (c) pn_connection_free(c); if (d->transport) pn_transport_free(d->transport); if (d->collector) pn_collector_free(d->collector); memset(d, 0, sizeof(*d)); } pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *d) { ssize_t cap = pn_transport_capacity(d->transport); return (cap > 0) ? pn_rwbytes(cap, pn_transport_tail(d->transport)) : pn_rwbytes(0, 0); } void pn_connection_driver_read_done(pn_connection_driver_t *d, size_t n) { if (n > 0) pn_transport_process(d->transport, n); } bool pn_connection_driver_read_closed(pn_connection_driver_t *d) { return pn_transport_tail_closed(d->transport); } void pn_connection_driver_read_close(pn_connection_driver_t *d) { if (!pn_connection_driver_read_closed(d)) { pn_transport_close_tail(d->transport); } } pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *d) { ssize_t pending = pn_transport_pending(d->transport); return (pending > 0) ? pn_bytes(pending, pn_transport_head(d->transport)) : pn_bytes_null; } void pn_connection_driver_write_done(pn_connection_driver_t *d, size_t n) { pn_transport_pop(d->transport, n); } bool pn_connection_driver_write_closed(pn_connection_driver_t *d) { return pn_transport_head_closed(d->transport); } void pn_connection_driver_write_close(pn_connection_driver_t *d) { if (!pn_connection_driver_write_closed(d)) { pn_transport_close_head(d->transport); } } void pn_connection_driver_close(pn_connection_driver_t *d) { pn_connection_driver_read_close(d); pn_connection_driver_write_close(d); } pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *d) { return pn_event_batch_next(&d->batch); } bool pn_connection_driver_has_event(pn_connection_driver_t *d) { return d->connection && pn_collector_peek(pn_connection_collector(d->connection)); } bool pn_connection_driver_finished(pn_connection_driver_t *d) { return pn_transport_closed(d->transport) && !pn_connection_driver_has_event(d); } void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list ap) { pn_transport_t *t = d->transport; pn_condition_t *cond = pn_transport_condition(t); pn_string_vformat(t->scratch, fmt, ap); pn_condition_set_name(cond, name); pn_condition_set_description(cond, pn_string_get(t->scratch)); } void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...) { va_list ap; va_start(ap, fmt); pn_connection_driver_verrorf(d, name, fmt, ap); va_end(ap); } void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg) { pn_transport_log(d->transport, msg); } void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt, ...) { va_list ap; va_start(ap, fmt); pn_transport_vlogf(d->transport, fmt, ap); va_end(ap); } void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap) { pn_transport_vlogf(d->transport, fmt, ap); } pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch) { return (batch->next_event == batch_next) ? (pn_connection_driver_t*)((char*)batch - offsetof(pn_connection_driver_t, batch)) : NULL; } pn_connection_driver_t** pn_connection_driver_ptr(pn_connection_t *c) { return &c->driver; } qpid-proton-0.22.0/proton-c/src/core/config.h0000664000000000000000000000174713257152177015660 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #ifndef _PROTON_SRC_CONFIG_H #define _PROTON_SRC_CONFIG_H #ifndef PN_TRANSPORT_INITIAL_FRAME_SIZE # define PN_TRANSPORT_INITIAL_FRAME_SIZE (512) /* bytes */ #endif #endif /* _PROTON_SRC_CONFIG_H */ qpid-proton-0.22.0/proton-c/src/core/codec.c0000664000000000000000000015405613257152177015465 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include "encodings.h" #define DEFINE_FIELDS #include "protocol.h" #include "platform/platform_fmt.h" #include "util.h" #include "decoder.h" #include "encoder.h" #include "data.h" #include "log_private.h" const char *pn_type_name(pn_type_t type) { switch (type) { case PN_NULL: return "PN_NULL"; case PN_BOOL: return "PN_BOOL"; case PN_UBYTE: return "PN_UBYTE"; case PN_BYTE: return "PN_BYTE"; case PN_USHORT: return "PN_USHORT"; case PN_SHORT: return "PN_SHORT"; case PN_UINT: return "PN_UINT"; case PN_INT: return "PN_INT"; case PN_CHAR: return "PN_CHAR"; case PN_ULONG: return "PN_ULONG"; case PN_LONG: return "PN_LONG"; case PN_TIMESTAMP: return "PN_TIMESTAMP"; case PN_FLOAT: return "PN_FLOAT"; case PN_DOUBLE: return "PN_DOUBLE"; case PN_DECIMAL32: return "PN_DECIMAL32"; case PN_DECIMAL64: return "PN_DECIMAL64"; case PN_DECIMAL128: return "PN_DECIMAL128"; case PN_UUID: return "PN_UUID"; case PN_BINARY: return "PN_BINARY"; case PN_STRING: return "PN_STRING"; case PN_SYMBOL: return "PN_SYMBOL"; case PN_DESCRIBED: return "PN_DESCRIBED"; case PN_ARRAY: return "PN_ARRAY"; case PN_LIST: return "PN_LIST"; case PN_MAP: return "PN_MAP"; default: break; } return ""; } static inline void pni_atom_init(pn_atom_t *atom, pn_type_t type) { memset(atom, 0, sizeof(pn_atom_t)); atom->type = type; } // data static void pn_data_finalize(void *object) { pn_data_t *data = (pn_data_t *) object; free(data->nodes); pn_buffer_free(data->buf); pn_free(data->str); pn_error_free(data->error); pn_free(data->decoder); pn_free(data->encoder); } static const pn_fields_t *pni_node_fields(pn_data_t *data, pni_node_t *node) { if (!node) return NULL; if (node->atom.type != PN_DESCRIBED) return NULL; pni_node_t *descriptor = pn_data_node(data, node->down); if (!descriptor || descriptor->atom.type != PN_ULONG) { return NULL; } if (descriptor->atom.u.as_ulong >= FIELD_MIN && descriptor->atom.u.as_ulong <= FIELD_MAX) { const pn_fields_t *f = &FIELDS[descriptor->atom.u.as_ulong-FIELD_MIN]; return (f->name_index!=0) ? f : NULL; } else { return NULL; } } static int pni_node_index(pn_data_t *data, pni_node_t *node) { int count = 0; while (node) { node = pn_data_node(data, node->prev); count++; } return count - 1; } int pni_inspect_atom(pn_atom_t *atom, pn_string_t *str) { switch (atom->type) { case PN_NULL: return pn_string_addf(str, "null"); case PN_BOOL: return pn_string_addf(str, atom->u.as_bool ? "true" : "false"); case PN_UBYTE: return pn_string_addf(str, "%" PRIu8, atom->u.as_ubyte); case PN_BYTE: return pn_string_addf(str, "%" PRIi8, atom->u.as_byte); case PN_USHORT: return pn_string_addf(str, "%" PRIu16, atom->u.as_ushort); case PN_SHORT: return pn_string_addf(str, "%" PRIi16, atom->u.as_short); case PN_UINT: return pn_string_addf(str, "%" PRIu32, atom->u.as_uint); case PN_INT: return pn_string_addf(str, "%" PRIi32, atom->u.as_int); case PN_CHAR: return pn_string_addf(str, "%c", atom->u.as_char); case PN_ULONG: return pn_string_addf(str, "%" PRIu64, atom->u.as_ulong); case PN_LONG: return pn_string_addf(str, "%" PRIi64, atom->u.as_long); case PN_TIMESTAMP: return pn_string_addf(str, "%" PRIi64, atom->u.as_timestamp); case PN_FLOAT: return pn_string_addf(str, "%g", atom->u.as_float); case PN_DOUBLE: return pn_string_addf(str, "%g", atom->u.as_double); case PN_DECIMAL32: return pn_string_addf(str, "D32(%" PRIu32 ")", atom->u.as_decimal32); case PN_DECIMAL64: return pn_string_addf(str, "D64(%" PRIu64 ")", atom->u.as_decimal64); case PN_DECIMAL128: return pn_string_addf(str, "D128(%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" "%02hhx%02hhx)", atom->u.as_decimal128.bytes[0], atom->u.as_decimal128.bytes[1], atom->u.as_decimal128.bytes[2], atom->u.as_decimal128.bytes[3], atom->u.as_decimal128.bytes[4], atom->u.as_decimal128.bytes[5], atom->u.as_decimal128.bytes[6], atom->u.as_decimal128.bytes[7], atom->u.as_decimal128.bytes[8], atom->u.as_decimal128.bytes[9], atom->u.as_decimal128.bytes[10], atom->u.as_decimal128.bytes[11], atom->u.as_decimal128.bytes[12], atom->u.as_decimal128.bytes[13], atom->u.as_decimal128.bytes[14], atom->u.as_decimal128.bytes[15]); case PN_UUID: return pn_string_addf(str, "UUID(%02hhx%02hhx%02hhx%02hhx-" "%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-" "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx)", atom->u.as_uuid.bytes[0], atom->u.as_uuid.bytes[1], atom->u.as_uuid.bytes[2], atom->u.as_uuid.bytes[3], atom->u.as_uuid.bytes[4], atom->u.as_uuid.bytes[5], atom->u.as_uuid.bytes[6], atom->u.as_uuid.bytes[7], atom->u.as_uuid.bytes[8], atom->u.as_uuid.bytes[9], atom->u.as_uuid.bytes[10], atom->u.as_uuid.bytes[11], atom->u.as_uuid.bytes[12], atom->u.as_uuid.bytes[13], atom->u.as_uuid.bytes[14], atom->u.as_uuid.bytes[15]); case PN_BINARY: case PN_STRING: case PN_SYMBOL: { int err; const char *pfx; pn_bytes_t bin = atom->u.as_bytes; bool quote; switch (atom->type) { case PN_BINARY: pfx = "b"; quote = true; break; case PN_STRING: pfx = ""; quote = true; break; case PN_SYMBOL: pfx = ":"; quote = false; for (unsigned i = 0; i < bin.size; i++) { if (!isalpha(bin.start[i])) { quote = true; break; } } break; default: assert(false); return PN_ERR; } if ((err = pn_string_addf(str, "%s", pfx))) return err; if (quote) if ((err = pn_string_addf(str, "\""))) return err; if ((err = pn_quote(str, bin.start, bin.size))) return err; if (quote) if ((err = pn_string_addf(str, "\""))) return err; return 0; } case PN_LIST: return pn_string_addf(str, ""); case PN_MAP: return pn_string_addf(str, ""); case PN_ARRAY: return pn_string_addf(str, ""); case PN_DESCRIBED: return pn_string_addf(str, ""); default: return pn_string_addf(str, "", atom->type); } } int pni_inspect_enter(void *ctx, pn_data_t *data, pni_node_t *node) { pn_string_t *str = (pn_string_t *) ctx; pn_atom_t *atom = (pn_atom_t *) &node->atom; pni_node_t *parent = pn_data_node(data, node->parent); const pn_fields_t *fields = pni_node_fields(data, parent); pni_node_t *grandparent = parent ? pn_data_node(data, parent->parent) : NULL; const pn_fields_t *grandfields = pni_node_fields(data, grandparent); int index = pni_node_index(data, node); int err; if (grandfields) { if (atom->type == PN_NULL) { return 0; } const char *name = (index < grandfields->field_count) ? FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[grandfields->first_field_index+index] : NULL; if (name) { err = pn_string_addf(str, "%s=", name); if (err) return err; } } switch (atom->type) { case PN_DESCRIBED: return pn_string_addf(str, "@"); case PN_ARRAY: // XXX: need to fix for described arrays return pn_string_addf(str, "@%s[", pn_type_name(node->type)); case PN_LIST: return pn_string_addf(str, "["); case PN_MAP: return pn_string_addf(str, "{"); default: if (fields && index == 0) { err = pn_string_addf(str, "%s", FIELD_STRINGPOOL.STRING0+FIELD_NAME[fields->name_index]); if (err) return err; err = pn_string_addf(str, "("); if (err) return err; err = pni_inspect_atom(atom, str); if (err) return err; return pn_string_addf(str, ")"); } else { return pni_inspect_atom(atom, str); } } } pni_node_t *pni_next_nonnull(pn_data_t *data, pni_node_t *node) { while (node) { node = pn_data_node(data, node->next); if (node && node->atom.type != PN_NULL) { return node; } } return NULL; } int pni_inspect_exit(void *ctx, pn_data_t *data, pni_node_t *node) { pn_string_t *str = (pn_string_t *) ctx; pni_node_t *parent = pn_data_node(data, node->parent); pni_node_t *grandparent = parent ? pn_data_node(data, parent->parent) : NULL; const pn_fields_t *grandfields = pni_node_fields(data, grandparent); pni_node_t *next = pn_data_node(data, node->next); int err; switch (node->atom.type) { case PN_ARRAY: case PN_LIST: err = pn_string_addf(str, "]"); if (err) return err; break; case PN_MAP: err = pn_string_addf(str, "}"); if (err) return err; break; default: break; } if (!grandfields || node->atom.type != PN_NULL) { if (next) { int index = pni_node_index(data, node); if (parent && parent->atom.type == PN_MAP && (index % 2) == 0) { err = pn_string_addf(str, "="); } else if (parent && parent->atom.type == PN_DESCRIBED && index == 0) { err = pn_string_addf(str, " "); if (err) return err; } else { if (!grandfields || pni_next_nonnull(data, node)) { err = pn_string_addf(str, ", "); if (err) return err; } } } } return 0; } static int pn_data_inspect(void *obj, pn_string_t *dst) { pn_data_t *data = (pn_data_t *) obj; return pni_data_traverse(data, pni_inspect_enter, pni_inspect_exit, dst); } #define pn_data_initialize NULL #define pn_data_hashcode NULL #define pn_data_compare NULL pn_data_t *pn_data(size_t capacity) { static const pn_class_t clazz = PN_CLASS(pn_data); pn_data_t *data = (pn_data_t *) pn_class_new(&clazz, sizeof(pn_data_t)); data->capacity = capacity; data->size = 0; data->nodes = capacity ? (pni_node_t *) malloc(capacity * sizeof(pni_node_t)) : NULL; data->buf = pn_buffer(64); data->parent = 0; data->current = 0; data->base_parent = 0; data->base_current = 0; data->decoder = pn_decoder(); data->encoder = pn_encoder(); data->error = pn_error(); data->str = pn_string(NULL); return data; } void pn_data_free(pn_data_t *data) { pn_free(data); } int pn_data_errno(pn_data_t *data) { return pn_error_code(data->error); } pn_error_t *pn_data_error(pn_data_t *data) { return data->error; } size_t pn_data_size(pn_data_t *data) { return data ? data->size : 0; } void pn_data_clear(pn_data_t *data) { if (data) { data->size = 0; data->parent = 0; data->current = 0; data->base_parent = 0; data->base_current = 0; pn_buffer_clear(data->buf); } } static int pni_data_grow(pn_data_t *data) { size_t capacity = data->capacity ? data->capacity : 2; if (capacity >= PNI_NID_MAX) return PN_OUT_OF_MEMORY; else if (capacity < PNI_NID_MAX/2) capacity *= 2; else capacity = PNI_NID_MAX; pni_node_t *new_nodes = (pni_node_t *)realloc(data->nodes, capacity * sizeof(pni_node_t)); if (new_nodes == NULL) return PN_OUT_OF_MEMORY; data->capacity = capacity; data->nodes = new_nodes; return 0; } static ssize_t pni_data_intern(pn_data_t *data, const char *start, size_t size) { size_t offset = pn_buffer_size(data->buf); int err = pn_buffer_append(data->buf, start, size); if (err) return err; err = pn_buffer_append(data->buf, "\0", 1); if (err) return err; return offset; } static pn_bytes_t *pni_data_bytes(pn_data_t *data, pni_node_t *node) { switch (node->atom.type) { case PN_BINARY: case PN_STRING: case PN_SYMBOL: return &node->atom.u.as_bytes; default: return NULL; } } static void pni_data_rebase(pn_data_t *data, char *base) { for (unsigned i = 0; i < data->size; i++) { pni_node_t *node = &data->nodes[i]; if (node->data) { pn_bytes_t *bytes = pni_data_bytes(data, node); bytes->start = base + node->data_offset; } } } static int pni_data_intern_node(pn_data_t *data, pni_node_t *node) { pn_bytes_t *bytes = pni_data_bytes(data, node); if (!bytes) return 0; size_t oldcap = pn_buffer_capacity(data->buf); ssize_t offset = pni_data_intern(data, bytes->start, bytes->size); if (offset < 0) return offset; node->data = true; node->data_offset = offset; node->data_size = bytes->size; pn_rwbytes_t buf = pn_buffer_memory(data->buf); bytes->start = buf.start + offset; if (pn_buffer_capacity(data->buf) != oldcap) { pni_data_rebase(data, buf.start); } return 0; } int pn_data_vfill(pn_data_t *data, const char *fmt, va_list ap) { int err = 0; const char *begin = fmt; while (*fmt) { char code = *(fmt++); if (!code) return 0; switch (code) { case 'n': err = pn_data_put_null(data); break; case 'o': err = pn_data_put_bool(data, va_arg(ap, int)); break; case 'B': err = pn_data_put_ubyte(data, va_arg(ap, unsigned int)); break; case 'b': err = pn_data_put_byte(data, va_arg(ap, int)); break; case 'H': err = pn_data_put_ushort(data, va_arg(ap, unsigned int)); break; case 'h': err = pn_data_put_short(data, va_arg(ap, int)); break; case 'I': err = pn_data_put_uint(data, va_arg(ap, uint32_t)); break; case 'i': err = pn_data_put_int(data, va_arg(ap, uint32_t)); break; case 'L': err = pn_data_put_ulong(data, va_arg(ap, uint64_t)); break; case 'l': err = pn_data_put_long(data, va_arg(ap, int64_t)); break; case 't': err = pn_data_put_timestamp(data, va_arg(ap, pn_timestamp_t)); break; case 'f': err = pn_data_put_float(data, va_arg(ap, double)); break; case 'd': err = pn_data_put_double(data, va_arg(ap, double)); break; case 'Z': { // For maximum portability, caller must pass these as two separate args, not a single struct size_t size = va_arg(ap, size_t); char *start = va_arg(ap, char *); err = pn_data_put_binary(data, pn_bytes(size, start)); } break; case 'z': { // For maximum portability, caller must pass these as two separate args, not a single struct size_t size = va_arg(ap, size_t); char *start = va_arg(ap, char *); if (start) { err = pn_data_put_binary(data, pn_bytes(size, start)); } else { err = pn_data_put_null(data); } } break; case 'S': case 's': { char *start = va_arg(ap, char *); size_t size; if (start) { size = strlen(start); if (code == 'S') { err = pn_data_put_string(data, pn_bytes(size, start)); } else { err = pn_data_put_symbol(data, pn_bytes(size, start)); } } else { err = pn_data_put_null(data); } } break; case 'D': /* The next 2 args are the descriptor, value for a described value. */ err = pn_data_put_described(data); pn_data_enter(data); break; case 'T': { pni_node_t *parent = pn_data_node(data, data->parent); if (parent->atom.type == PN_ARRAY) { parent->type = (pn_type_t) va_arg(ap, int); } else { return pn_error_format(data->error, PN_ERR, "naked type"); } } break; case '@': { bool described; if (*(fmt + 1) == 'D') { fmt++; described = true; } else { described = false; } err = pn_data_put_array(data, described, (pn_type_t) 0); pn_data_enter(data); } break; case '[': if (fmt < (begin + 2) || *(fmt - 2) != 'T') { err = pn_data_put_list(data); if (err) return err; pn_data_enter(data); } break; case '{': err = pn_data_put_map(data); if (err) return err; pn_data_enter(data); break; case '}': case ']': if (!pn_data_exit(data)) return pn_error_format(data->error, PN_ERR, "exit failed"); break; case '?': /* Consumes 2 args: bool, value. Insert null if bool is false else value */ if (!va_arg(ap, int)) { err = pn_data_put_null(data); if (err) return err; pn_data_enter(data); } break; case '*': { int count = va_arg(ap, int); void *ptr = va_arg(ap, void *); char c = *(fmt++); switch (c) { case 's': { char **sptr = (char **) ptr; for (int i = 0; i < count; i++) { char *sym = *(sptr++); err = pn_data_fill(data, "s", sym); if (err) return err; } } break; default: pn_logf("unrecognized * code: 0x%.2X '%c'", code, code); return PN_ARG_ERR; } } break; case 'C': { pn_data_t *src = va_arg(ap, pn_data_t *); if (src && pn_data_size(src) > 0) { err = pn_data_appendn(data, src, 1); if (err) return err; } else { err = pn_data_put_null(data); if (err) return err; } } break; default: pn_logf("unrecognized fill code: 0x%.2X '%c'", code, code); return PN_ARG_ERR; } if (err) return err; pni_node_t *parent = pn_data_node(data, data->parent); pni_node_t *current = pn_data_node(data, data->current); while (parent) { if (parent->atom.type == PN_DESCRIBED && parent->children == 2) { current->described = true; pn_data_exit(data); current = pn_data_node(data, data->current); parent = pn_data_node(data, data->parent); } else if (parent->atom.type == PN_NULL && parent->children == 1) { pn_data_exit(data); current = pn_data_node(data, data->current); current->down = 0; current->children = 0; parent = pn_data_node(data, data->parent); } else { break; } } } return 0; } int pn_data_fill(pn_data_t *data, const char *fmt, ...) { va_list ap; va_start(ap, fmt); int err = pn_data_vfill(data, fmt, ap); va_end(ap); return err; } static bool pn_scan_next(pn_data_t *data, pn_type_t *type, bool suspend) { if (suspend) return false; bool found = pn_data_next(data); if (found) { *type = pn_data_type(data); return true; } else { pni_node_t *parent = pn_data_node(data, data->parent); if (parent && parent->atom.type == PN_DESCRIBED) { pn_data_exit(data); return pn_scan_next(data, type, suspend); } else { *type = PN_INVALID; return false; } } } static pni_node_t *pni_data_peek(pn_data_t *data); int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap) { pn_data_rewind(data); bool *scanarg = NULL; bool at = false; int level = 0; int count_level = -1; int resume_count = 0; while (*fmt) { char code = *(fmt++); bool found = false; pn_type_t type; bool scanned = false; bool suspend = resume_count > 0; switch (code) { case 'n': found = pn_scan_next(data, &type, suspend); if (found && type == PN_NULL) { scanned = true; } else { scanned = false; } if (resume_count && level == count_level) resume_count--; break; case 'o': { bool *value = va_arg(ap, bool *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_BOOL) { *value = pn_data_get_bool(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'B': { uint8_t *value = va_arg(ap, uint8_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_UBYTE) { *value = pn_data_get_ubyte(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'b': { int8_t *value = va_arg(ap, int8_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_BYTE) { *value = pn_data_get_byte(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'H': { uint16_t *value = va_arg(ap, uint16_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_USHORT) { *value = pn_data_get_ushort(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'h': { int16_t *value = va_arg(ap, int16_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_SHORT) { *value = pn_data_get_short(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'I': { uint32_t *value = va_arg(ap, uint32_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_UINT) { *value = pn_data_get_uint(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'i': { int32_t *value = va_arg(ap, int32_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_INT) { *value = pn_data_get_int(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'c': { pn_char_t *value = va_arg(ap, pn_char_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_CHAR) { *value = pn_data_get_char(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'L': { uint64_t *value = va_arg(ap, uint64_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_ULONG) { *value = pn_data_get_ulong(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'l': { int64_t *value = va_arg(ap, int64_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_LONG) { *value = pn_data_get_long(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 't': { pn_timestamp_t *value = va_arg(ap, pn_timestamp_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_TIMESTAMP) { *value = pn_data_get_timestamp(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'f': { float *value = va_arg(ap, float *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_FLOAT) { *value = pn_data_get_float(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'd': { double *value = va_arg(ap, double *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_DOUBLE) { *value = pn_data_get_double(data); scanned = true; } else { *value = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'z': { pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_BINARY) { *bytes = pn_data_get_binary(data); scanned = true; } else { bytes->start = 0; bytes->size = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'S': { pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_STRING) { *bytes = pn_data_get_string(data); scanned = true; } else { bytes->start = 0; bytes->size = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 's': { pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *); found = pn_scan_next(data, &type, suspend); if (found && type == PN_SYMBOL) { *bytes = pn_data_get_symbol(data); scanned = true; } else { bytes->start = 0; bytes->size = 0; scanned = false; } } if (resume_count && level == count_level) resume_count--; break; case 'D': found = pn_scan_next(data, &type, suspend); if (found && type == PN_DESCRIBED) { pn_data_enter(data); scanned = true; } else { if (!suspend) { resume_count = 3; count_level = level; } scanned = false; } if (resume_count && level == count_level) resume_count--; break; case '@': found = pn_scan_next(data, &type, suspend); if (found && type == PN_ARRAY) { pn_data_enter(data); scanned = true; at = true; } else { if (!suspend) { resume_count = 3; count_level = level; } scanned = false; } if (resume_count && level == count_level) resume_count--; break; case '[': if (at) { scanned = true; at = false; } else { found = pn_scan_next(data, &type, suspend); if (found && type == PN_LIST) { pn_data_enter(data); scanned = true; } else { if (!suspend) { resume_count = 1; count_level = level; } scanned = false; } } level++; break; case '{': found = pn_scan_next(data, &type, suspend); if (found && type == PN_MAP) { pn_data_enter(data); scanned = true; } else { if (resume_count) { resume_count = 1; count_level = level; } scanned = false; } level++; break; case ']': case '}': level--; if (!suspend && !pn_data_exit(data)) return pn_error_format(data->error, PN_ERR, "exit failed"); if (resume_count && level == count_level) resume_count--; break; case '.': found = pn_scan_next(data, &type, suspend); scanned = found; if (resume_count && level == count_level) resume_count--; break; case '?': if (!*fmt || *fmt == '?') return pn_error_format(data->error, PN_ARG_ERR, "codes must follow a ?"); scanarg = va_arg(ap, bool *); break; case 'C': { pn_data_t *dst = va_arg(ap, pn_data_t *); if (!suspend) { size_t old = pn_data_size(dst); pni_node_t *next = pni_data_peek(data); if (next && next->atom.type != PN_NULL) { pn_data_narrow(data); int err = pn_data_appendn(dst, data, 1); pn_data_widen(data); if (err) return err; scanned = pn_data_size(dst) > old; } else { scanned = false; } pn_data_next(data); } else { scanned = false; } } if (resume_count && level == count_level) resume_count--; break; default: return pn_error_format(data->error, PN_ARG_ERR, "unrecognized scan code: 0x%.2X '%c'", code, code); } if (scanarg && code != '?') { *scanarg = scanned; scanarg = NULL; } } return 0; } int pn_data_scan(pn_data_t *data, const char *fmt, ...) { va_list ap; va_start(ap, fmt); int err = pn_data_vscan(data, fmt, ap); va_end(ap); return err; } static int pni_data_inspectify(pn_data_t *data) { int err = pn_string_set(data->str, ""); if (err) return err; return pn_data_inspect(data, data->str); } int pn_data_print(pn_data_t *data) { int err = pni_data_inspectify(data); if (err) return err; printf("%s", pn_string_get(data->str)); return 0; } int pn_data_format(pn_data_t *data, char *bytes, size_t *size) { int err = pni_data_inspectify(data); if (err) return err; if (pn_string_size(data->str) >= *size) { return PN_OVERFLOW; } else { pn_string_put(data->str, bytes); *size = pn_string_size(data->str); return 0; } } static size_t pni_data_id(pn_data_t *data, pni_node_t *node) { return node - data->nodes + 1; } static pni_node_t *pni_data_new(pn_data_t *data) { if ((data->capacity <= data->size) && (pni_data_grow(data) != 0)) return NULL; pni_node_t *node = pn_data_node(data, ++(data->size)); node->next = 0; node->down = 0; node->children = 0; return node; } void pn_data_rewind(pn_data_t *data) { data->parent = data->base_parent; data->current = data->base_current; } static pni_node_t *pni_data_current(pn_data_t *data) { return pn_data_node(data, data->current); } void pn_data_narrow(pn_data_t *data) { data->base_parent = data->parent; data->base_current = data->current; } void pn_data_widen(pn_data_t *data) { data->base_parent = 0; data->base_current = 0; } pn_handle_t pn_data_point(pn_data_t *data) { if (data->current) { return (pn_handle_t)(uintptr_t)data->current; } else { return (pn_handle_t)(uintptr_t)-data->parent; } } bool pn_data_restore(pn_data_t *data, pn_handle_t point) { pn_shandle_t spoint = (pn_shandle_t) point; if (spoint <= 0 && ((size_t) (-spoint)) <= data->size) { data->parent = -((pn_shandle_t) point); data->current = 0; return true; } else if (spoint && spoint <= data->size) { data->current = spoint; pni_node_t *current = pni_data_current(data); data->parent = current->parent; return true; } else { return false; } } static pni_node_t *pni_data_peek(pn_data_t *data) { pni_node_t *current = pni_data_current(data); if (current) { return pn_data_node(data, current->next); } pni_node_t *parent = pn_data_node(data, data->parent); if (parent) { return pn_data_node(data, parent->down); } return NULL; } bool pn_data_next(pn_data_t *data) { pni_node_t *current = pni_data_current(data); pni_node_t *parent = pn_data_node(data, data->parent); size_t next; if (current) { next = current->next; } else if (parent && parent->down) { next = parent->down; } else if (!parent && data->size) { next = 1; } else { return false; } if (next) { data->current = next; return true; } else { return false; } } bool pn_data_prev(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->prev) { data->current = node->prev; return true; } else { return false; } } int pni_data_traverse(pn_data_t *data, int (*enter)(void *ctx, pn_data_t *data, pni_node_t *node), int (*exit)(void *ctx, pn_data_t *data, pni_node_t *node), void *ctx) { pni_node_t *node = data->size ? pn_data_node(data, 1) : NULL; while (node) { pni_node_t *parent = pn_data_node(data, node->parent); int err = enter(ctx, data, node); if (err) return err; size_t next = 0; if (node->down) { next = node->down; } else if (node->next) { err = exit(ctx, data, node); if (err) return err; next = node->next; } else { err = exit(ctx, data, node); if (err) return err; while (parent) { err = exit(ctx, data, parent); if (err) return err; if (parent->next) { next = parent->next; break; } else { parent = pn_data_node(data, parent->parent); } } } node = pn_data_node(data, next); } return 0; } pn_type_t pn_data_type(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node) { return node->atom.type; } else { return PN_INVALID; } } pn_type_t pni_data_parent_type(pn_data_t *data) { pni_node_t *node = pn_data_node(data, data->parent); if (node) { return node->atom.type; } else { return PN_INVALID; } } size_t pn_data_siblings(pn_data_t *data) { pni_node_t *node = pn_data_node(data, data->parent); if (node) { return node->children; } else { return 0; } } bool pn_data_enter(pn_data_t *data) { if (data->current) { data->parent = data->current; data->current = 0; return true; } else { return false; } } bool pn_data_exit(pn_data_t *data) { if (data->parent) { pni_node_t *parent = pn_data_node(data, data->parent); data->current = data->parent; data->parent = parent->parent; return true; } else { return false; } } bool pn_data_lookup(pn_data_t *data, const char *name) { while (pn_data_next(data)) { pn_type_t type = pn_data_type(data); switch (type) { case PN_STRING: case PN_SYMBOL: { pn_bytes_t bytes = pn_data_get_bytes(data); if (pn_bytes_equal(bytes, pn_bytes(strlen(name), name))) { return pn_data_next(data); } } break; default: break; } // skip the value pn_data_next(data); } return false; } void pn_data_dump(pn_data_t *data) { printf("{current=%" PN_ZI ", parent=%" PN_ZI "}\n", (size_t) data->current, (size_t) data->parent); for (unsigned i = 0; i < data->size; i++) { pni_node_t *node = &data->nodes[i]; pn_string_set(data->str, ""); pni_inspect_atom((pn_atom_t *) &node->atom, data->str); printf("Node %i: prev=%" PN_ZI ", next=%" PN_ZI ", parent=%" PN_ZI ", down=%" PN_ZI ", children=%" PN_ZI ", type=%s (%s)\n", i + 1, (size_t) node->prev, (size_t) node->next, (size_t) node->parent, (size_t) node->down, (size_t) node->children, pn_type_name(node->atom.type), pn_string_get(data->str)); } } static pni_node_t *pni_data_add(pn_data_t *data) { pni_node_t *current = pni_data_current(data); pni_node_t *parent = pn_data_node(data, data->parent); pni_node_t *node; if (current) { if (current->next) { node = pn_data_node(data, current->next); } else { node = pni_data_new(data); if (!node) return NULL; // refresh the pointers in case we grew current = pni_data_current(data); parent = pn_data_node(data, data->parent); node->prev = data->current; current->next = pni_data_id(data, node); node->parent = data->parent; if (parent) { if (!parent->down) { parent->down = pni_data_id(data, node); } parent->children++; } } } else if (parent) { if (parent->down) { node = pn_data_node(data, parent->down); } else { node = pni_data_new(data); if (!node) return NULL; // refresh the pointers in case we grew parent = pn_data_node(data, data->parent); node->prev = 0; node->parent = data->parent; parent->down = pni_data_id(data, node); parent->children++; } } else if (data->size) { node = pn_data_node(data, 1); } else { node = pni_data_new(data); if (!node) return NULL; node->prev = 0; node->parent = 0; } node->down = 0; node->children = 0; node->data = false; node->described = false; node->data_offset = 0; node->data_size = 0; data->current = pni_data_id(data, node); return node; } ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size) { return pn_encoder_encode(data->encoder, data, bytes, size); } ssize_t pn_data_encoded_size(pn_data_t *data) { return pn_encoder_size(data->encoder, data); } ssize_t pn_data_decode(pn_data_t *data, const char *bytes, size_t size) { return pn_decoder_decode(data->decoder, bytes, size, data); } int pn_data_put_list(pn_data_t *data) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_LIST; return 0; } int pn_data_put_map(pn_data_t *data) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_MAP; return 0; } int pn_data_put_array(pn_data_t *data, bool described, pn_type_t type) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_ARRAY; node->described = described; node->type = type; return 0; } void pni_data_set_array_type(pn_data_t *data, pn_type_t type) { pni_node_t *array = pni_data_current(data); if (array) array->type = type; } int pn_data_put_described(pn_data_t *data) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_DESCRIBED; return 0; } int pn_data_put_null(pn_data_t *data) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; pni_atom_init(&node->atom, PN_NULL); return 0; } int pn_data_put_bool(pn_data_t *data, bool b) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_BOOL; node->atom.u.as_bool = b; return 0; } int pn_data_put_ubyte(pn_data_t *data, uint8_t ub) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_UBYTE; node->atom.u.as_ubyte = ub; return 0; } int pn_data_put_byte(pn_data_t *data, int8_t b) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_BYTE; node->atom.u.as_byte = b; return 0; } int pn_data_put_ushort(pn_data_t *data, uint16_t us) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_USHORT; node->atom.u.as_ushort = us; return 0; } int pn_data_put_short(pn_data_t *data, int16_t s) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_SHORT; node->atom.u.as_short = s; return 0; } int pn_data_put_uint(pn_data_t *data, uint32_t ui) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_UINT; node->atom.u.as_uint = ui; return 0; } int pn_data_put_int(pn_data_t *data, int32_t i) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_INT; node->atom.u.as_int = i; return 0; } int pn_data_put_char(pn_data_t *data, pn_char_t c) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_CHAR; node->atom.u.as_char = c; return 0; } int pn_data_put_ulong(pn_data_t *data, uint64_t ul) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_ULONG; node->atom.u.as_ulong = ul; return 0; } int pn_data_put_long(pn_data_t *data, int64_t l) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_LONG; node->atom.u.as_long = l; return 0; } int pn_data_put_timestamp(pn_data_t *data, pn_timestamp_t t) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_TIMESTAMP; node->atom.u.as_timestamp = t; return 0; } int pn_data_put_float(pn_data_t *data, float f) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_FLOAT; node->atom.u.as_float = f; return 0; } int pn_data_put_double(pn_data_t *data, double d) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_DOUBLE; node->atom.u.as_double = d; return 0; } int pn_data_put_decimal32(pn_data_t *data, pn_decimal32_t d) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_DECIMAL32; node->atom.u.as_decimal32 = d; return 0; } int pn_data_put_decimal64(pn_data_t *data, pn_decimal64_t d) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_DECIMAL64; node->atom.u.as_decimal64 = d; return 0; } int pn_data_put_decimal128(pn_data_t *data, pn_decimal128_t d) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_DECIMAL128; memmove(node->atom.u.as_decimal128.bytes, d.bytes, 16); return 0; } int pn_data_put_uuid(pn_data_t *data, pn_uuid_t u) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_UUID; memmove(node->atom.u.as_uuid.bytes, u.bytes, 16); return 0; } int pn_data_put_binary(pn_data_t *data, pn_bytes_t bytes) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_BINARY; node->atom.u.as_bytes = bytes; return pni_data_intern_node(data, node); } int pn_data_put_string(pn_data_t *data, pn_bytes_t string) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_STRING; node->atom.u.as_bytes = string; return pni_data_intern_node(data, node); } int pn_data_put_symbol(pn_data_t *data, pn_bytes_t symbol) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom.type = PN_SYMBOL; node->atom.u.as_bytes = symbol; return pni_data_intern_node(data, node); } int pn_data_put_atom(pn_data_t *data, pn_atom_t atom) { pni_node_t *node = pni_data_add(data); if (node == NULL) return PN_OUT_OF_MEMORY; node->atom = atom; return pni_data_intern_node(data, node); } size_t pn_data_get_list(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_LIST) { return node->children; } else { return 0; } } size_t pn_data_get_map(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_MAP) { return node->children; } else { return 0; } } size_t pn_data_get_array(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_ARRAY) { if (node->described) { return node->children - 1; } else { return node->children; } } else { return 0; } } bool pn_data_is_array_described(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_ARRAY) { return node->described; } else { return false; } } pn_type_t pn_data_get_array_type(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_ARRAY) { return node->type; } else { return PN_INVALID; } } bool pn_data_is_described(pn_data_t *data) { pni_node_t *node = pni_data_current(data); return node && node->atom.type == PN_DESCRIBED; } bool pn_data_is_null(pn_data_t *data) { pni_node_t *node = pni_data_current(data); return node && node->atom.type == PN_NULL; } bool pn_data_get_bool(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_BOOL) { return node->atom.u.as_bool; } else { return false; } } uint8_t pn_data_get_ubyte(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_UBYTE) { return node->atom.u.as_ubyte; } else { return 0; } } int8_t pn_data_get_byte(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_BYTE) { return node->atom.u.as_byte; } else { return 0; } } uint16_t pn_data_get_ushort(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_USHORT) { return node->atom.u.as_ushort; } else { return 0; } } int16_t pn_data_get_short(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_SHORT) { return node->atom.u.as_short; } else { return 0; } } uint32_t pn_data_get_uint(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_UINT) { return node->atom.u.as_uint; } else { return 0; } } int32_t pn_data_get_int(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_INT) { return node->atom.u.as_int; } else { return 0; } } pn_char_t pn_data_get_char(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_CHAR) { return node->atom.u.as_char; } else { return 0; } } uint64_t pn_data_get_ulong(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_ULONG) { return node->atom.u.as_ulong; } else { return 0; } } int64_t pn_data_get_long(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_LONG) { return node->atom.u.as_long; } else { return 0; } } pn_timestamp_t pn_data_get_timestamp(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_TIMESTAMP) { return node->atom.u.as_timestamp; } else { return 0; } } float pn_data_get_float(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_FLOAT) { return node->atom.u.as_float; } else { return 0; } } double pn_data_get_double(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_DOUBLE) { return node->atom.u.as_double; } else { return 0; } } pn_decimal32_t pn_data_get_decimal32(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_DECIMAL32) { return node->atom.u.as_decimal32; } else { return 0; } } pn_decimal64_t pn_data_get_decimal64(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_DECIMAL64) { return node->atom.u.as_decimal64; } else { return 0; } } pn_decimal128_t pn_data_get_decimal128(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_DECIMAL128) { return node->atom.u.as_decimal128; } else { pn_decimal128_t t = {{0}}; return t; } } pn_uuid_t pn_data_get_uuid(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_UUID) { return node->atom.u.as_uuid; } else { pn_uuid_t t = {{0}}; return t; } } pn_bytes_t pn_data_get_binary(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_BINARY) { return node->atom.u.as_bytes; } else { pn_bytes_t t = {0}; return t; } } pn_bytes_t pn_data_get_string(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_STRING) { return node->atom.u.as_bytes; } else { pn_bytes_t t = {0}; return t; } } pn_bytes_t pn_data_get_symbol(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && node->atom.type == PN_SYMBOL) { return node->atom.u.as_bytes; } else { pn_bytes_t t = {0}; return t; } } pn_bytes_t pn_data_get_bytes(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node && (node->atom.type == PN_BINARY || node->atom.type == PN_STRING || node->atom.type == PN_SYMBOL)) { return node->atom.u.as_bytes; } else { pn_bytes_t t = {0}; return t; } } pn_atom_t pn_data_get_atom(pn_data_t *data) { pni_node_t *node = pni_data_current(data); if (node) { return *((pn_atom_t *) &node->atom); } else { pn_atom_t t = {PN_NULL, {0,}}; return t; } } int pn_data_copy(pn_data_t *data, pn_data_t *src) { pn_data_clear(data); int err = pn_data_append(data, src); pn_data_rewind(data); return err; } int pn_data_append(pn_data_t *data, pn_data_t *src) { return pn_data_appendn(data, src, -1); } int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit) { int err = 0; int level = 0, count = 0; bool stop = false; pn_handle_t point = pn_data_point(src); pn_data_rewind(src); while (true) { while (!pn_data_next(src)) { if (level > 0) { pn_data_exit(data); pn_data_exit(src); level--; continue; } if (!pn_data_next(src)) { stop = true; } break; } if (stop) break; if (level == 0 && count == limit) break; pn_type_t type = pn_data_type(src); switch (type) { case PN_NULL: err = pn_data_put_null(data); if (level == 0) count++; break; case PN_BOOL: err = pn_data_put_bool(data, pn_data_get_bool(src)); if (level == 0) count++; break; case PN_UBYTE: err = pn_data_put_ubyte(data, pn_data_get_ubyte(src)); if (level == 0) count++; break; case PN_BYTE: err = pn_data_put_byte(data, pn_data_get_byte(src)); if (level == 0) count++; break; case PN_USHORT: err = pn_data_put_ushort(data, pn_data_get_ushort(src)); if (level == 0) count++; break; case PN_SHORT: err = pn_data_put_short(data, pn_data_get_short(src)); if (level == 0) count++; break; case PN_UINT: err = pn_data_put_uint(data, pn_data_get_uint(src)); if (level == 0) count++; break; case PN_INT: err = pn_data_put_int(data, pn_data_get_int(src)); if (level == 0) count++; break; case PN_CHAR: err = pn_data_put_char(data, pn_data_get_char(src)); if (level == 0) count++; break; case PN_ULONG: err = pn_data_put_ulong(data, pn_data_get_ulong(src)); if (level == 0) count++; break; case PN_LONG: err = pn_data_put_long(data, pn_data_get_long(src)); if (level == 0) count++; break; case PN_TIMESTAMP: err = pn_data_put_timestamp(data, pn_data_get_timestamp(src)); if (level == 0) count++; break; case PN_FLOAT: err = pn_data_put_float(data, pn_data_get_float(src)); if (level == 0) count++; break; case PN_DOUBLE: err = pn_data_put_double(data, pn_data_get_double(src)); if (level == 0) count++; break; case PN_DECIMAL32: err = pn_data_put_decimal32(data, pn_data_get_decimal32(src)); if (level == 0) count++; break; case PN_DECIMAL64: err = pn_data_put_decimal64(data, pn_data_get_decimal64(src)); if (level == 0) count++; break; case PN_DECIMAL128: err = pn_data_put_decimal128(data, pn_data_get_decimal128(src)); if (level == 0) count++; break; case PN_UUID: err = pn_data_put_uuid(data, pn_data_get_uuid(src)); if (level == 0) count++; break; case PN_BINARY: err = pn_data_put_binary(data, pn_data_get_binary(src)); if (level == 0) count++; break; case PN_STRING: err = pn_data_put_string(data, pn_data_get_string(src)); if (level == 0) count++; break; case PN_SYMBOL: err = pn_data_put_symbol(data, pn_data_get_symbol(src)); if (level == 0) count++; break; case PN_DESCRIBED: err = pn_data_put_described(data); if (level == 0) count++; if (err) { pn_data_restore(src, point); return err; } pn_data_enter(data); pn_data_enter(src); level++; break; case PN_ARRAY: err = pn_data_put_array(data, pn_data_is_array_described(src), pn_data_get_array_type(src)); if (level == 0) count++; if (err) { pn_data_restore(src, point); return err; } pn_data_enter(data); pn_data_enter(src); level++; break; case PN_LIST: err = pn_data_put_list(data); if (level == 0) count++; if (err) { pn_data_restore(src, point); return err; } pn_data_enter(data); pn_data_enter(src); level++; break; case PN_MAP: err = pn_data_put_map(data); if (level == 0) count++; if (err) { pn_data_restore(src, point); return err; } pn_data_enter(data); pn_data_enter(src); level++; break; default: break; } if (err) { pn_data_restore(src, point); return err; } } pn_data_restore(src, point); return 0; } qpid-proton-0.22.0/proton-c/src/core/buffer.h0000664000000000000000000000353613257152177015662 0ustar #ifndef PROTON_BUFFER_H #define PROTON_BUFFER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct pn_buffer_t pn_buffer_t; pn_buffer_t *pn_buffer(size_t capacity); void pn_buffer_free(pn_buffer_t *buf); size_t pn_buffer_size(pn_buffer_t *buf); size_t pn_buffer_capacity(pn_buffer_t *buf); size_t pn_buffer_available(pn_buffer_t *buf); int pn_buffer_ensure(pn_buffer_t *buf, size_t size); int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size); int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size); size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst); int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right); void pn_buffer_clear(pn_buffer_t *buf); int pn_buffer_defrag(pn_buffer_t *buf); pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf); pn_rwbytes_t pn_buffer_memory(pn_buffer_t *buf); int pn_buffer_quote(pn_buffer_t *buf, pn_string_t *string, size_t n); #ifdef __cplusplus } #endif #endif /* buffer.h */ qpid-proton-0.22.0/proton-c/src/core/buffer.c0000664000000000000000000001552513257152177015656 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #ifndef __cplusplus #include #endif #include #include #include #include "buffer.h" #include "util.h" struct pn_buffer_t { size_t capacity; size_t start; size_t size; char *bytes; }; pn_buffer_t *pn_buffer(size_t capacity) { pn_buffer_t *buf = (pn_buffer_t *) malloc(sizeof(pn_buffer_t)); if (buf != NULL) { buf->capacity = capacity; buf->start = 0; buf->size = 0; if (capacity > 0) { buf->bytes = (char *)malloc(capacity); if (buf->bytes == NULL) { free(buf); buf = NULL; } } else { buf->bytes = NULL; } } return buf; } void pn_buffer_free(pn_buffer_t *buf) { if (buf) { free(buf->bytes); free(buf); } } size_t pn_buffer_size(pn_buffer_t *buf) { return buf->size; } size_t pn_buffer_capacity(pn_buffer_t *buf) { return buf->capacity; } size_t pn_buffer_available(pn_buffer_t *buf) { return buf->capacity - buf->size; } static size_t pni_buffer_head(pn_buffer_t *buf) { return buf->start; } static size_t pni_buffer_tail(pn_buffer_t *buf) { size_t tail = buf->start + buf->size; if (tail >= buf->capacity) tail -= buf->capacity; return tail; } static bool pni_buffer_wrapped(pn_buffer_t *buf) { return buf->size && pni_buffer_head(buf) >= pni_buffer_tail(buf); } static size_t pni_buffer_tail_space(pn_buffer_t *buf) { if (pni_buffer_wrapped(buf)) { return pn_buffer_available(buf); } else { return buf->capacity - pni_buffer_tail(buf); } } static size_t pni_buffer_head_space(pn_buffer_t *buf) { if (pni_buffer_wrapped(buf)) { return pn_buffer_available(buf); } else { return pni_buffer_head(buf); } } static size_t pni_buffer_head_size(pn_buffer_t *buf) { if (pni_buffer_wrapped(buf)) { return buf->capacity - pni_buffer_head(buf); } else { return pni_buffer_tail(buf) - pni_buffer_head(buf); } } static size_t pni_buffer_tail_size(pn_buffer_t *buf) { if (pni_buffer_wrapped(buf)) { return pni_buffer_tail(buf); } else { return 0; } } int pn_buffer_ensure(pn_buffer_t *buf, size_t size) { size_t old_capacity = buf->capacity; size_t old_head = pni_buffer_head(buf); bool wrapped = pni_buffer_wrapped(buf); while (pn_buffer_available(buf) < size) { buf->capacity = 2*(buf->capacity ? buf->capacity : 16); } if (buf->capacity != old_capacity) { char* new_bytes = (char *)realloc(buf->bytes, buf->capacity); if (new_bytes) { buf->bytes = new_bytes; if (wrapped) { size_t n = old_capacity - old_head; memmove(buf->bytes + buf->capacity - n, buf->bytes + old_head, n); buf->start = buf->capacity - n; } } } return 0; } int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size) { if (!size) return 0; int err = pn_buffer_ensure(buf, size); if (err) return err; size_t tail = pni_buffer_tail(buf); size_t tail_space = pni_buffer_tail_space(buf); size_t n = pn_min(tail_space, size); memmove(buf->bytes + tail, bytes, n); memmove(buf->bytes, bytes + n, size - n); buf->size += size; return 0; } int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size) { int err = pn_buffer_ensure(buf, size); if (err) return err; size_t head = pni_buffer_head(buf); size_t head_space = pni_buffer_head_space(buf); size_t n = pn_min(head_space, size); memmove(buf->bytes + head - n, bytes + size - n, n); memmove(buf->bytes + buf->capacity - (size - n), bytes, size - n); if (buf->start >= size) { buf->start -= size; } else { buf->start = buf->capacity - (size - buf->start); } buf->size += size; return 0; } static size_t pni_buffer_index(pn_buffer_t *buf, size_t index) { size_t result = buf->start + index; if (result >= buf->capacity) result -= buf->capacity; return result; } size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst) { size = pn_min(size, buf->size); size_t start = pni_buffer_index(buf, offset); size_t stop = pni_buffer_index(buf, offset + size); if (size == 0) return 0; size_t sz1; size_t sz2; if (start >= stop) { sz1 = buf->capacity - start; sz2 = stop; } else { sz1 = stop - start; sz2 = 0; } memmove(dst, buf->bytes + start, sz1); memmove(dst + sz1, buf->bytes, sz2); return sz1 + sz2; } int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right) { if (left + right > buf->size) return PN_ARG_ERR; // In special case where we trim everything just clear buffer if (left + right == buf->size) { pn_buffer_clear(buf); return 0; } buf->start += left; if (buf->start >= buf->capacity) buf->start -= buf->capacity; buf->size -= left + right; return 0; } void pn_buffer_clear(pn_buffer_t *buf) { buf->start = 0; buf->size = 0; } static void pn_buffer_rotate (pn_buffer_t *buf, size_t sz) { if (sz == 0) return; unsigned c = 0, v = 0; for (; c < buf->capacity; v++) { unsigned t = v, tp = v + sz; char tmp = buf->bytes[v]; c++; while (tp != v) { buf->bytes[t] = buf->bytes[tp]; t = tp; tp += sz; if (tp >= buf->capacity) tp -= buf->capacity; c++; } buf->bytes[t] = tmp; } } int pn_buffer_defrag(pn_buffer_t *buf) { pn_buffer_rotate(buf, buf->start); buf->start = 0; return 0; } pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf) { if (buf) { pn_buffer_defrag(buf); return pn_bytes(buf->size, buf->bytes); } else { return pn_bytes(0, NULL); } } pn_rwbytes_t pn_buffer_memory(pn_buffer_t *buf) { if (buf) { pn_buffer_defrag(buf); pn_rwbytes_t r = {buf->size, buf->bytes}; return r; } else { pn_rwbytes_t r = {0, NULL}; return r; } } int pn_buffer_quote(pn_buffer_t *buf, pn_string_t *str, size_t n) { size_t hsize = pni_buffer_head_size(buf); size_t tsize = pni_buffer_tail_size(buf); if (hsize >= n) { pn_quote(str, buf->bytes + pni_buffer_head(buf), n); return 0; } pn_quote(str, buf->bytes + pni_buffer_head(buf), hsize); pn_quote(str, buf->bytes, pn_min(tsize, n-hsize)); return 0; } qpid-proton-0.22.0/proton-c/src/core/autodetect.h0000664000000000000000000000233213257152177016543 0ustar #ifndef PROTON_AUTODETECT_H #define PROTON_AUTODETECT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/types.h" typedef enum { PNI_PROTOCOL_INSUFFICIENT, PNI_PROTOCOL_UNKNOWN, PNI_PROTOCOL_SSL, PNI_PROTOCOL_AMQP_SSL, PNI_PROTOCOL_AMQP_SASL, PNI_PROTOCOL_AMQP1, PNI_PROTOCOL_AMQP_OTHER } pni_protocol_type_t; pni_protocol_type_t pni_sniff_header(const char *data, size_t len); const char* pni_protocol_name(pni_protocol_type_t p); #endif qpid-proton-0.22.0/proton-c/src/core/autodetect.c0000664000000000000000000000773113257152177016546 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "autodetect.h" #define SASL_HEADER ("AMQP\x03\x01\x00\x00") #define SSL_HEADER ("AMQP\x02\x01\x00\x00") #define AMQP_HEADER ("AMQP\x00\x01\x00\x00") #define SASL_HEADER_LEN 8 /* * SSLv2 Client Hello format * http://www.mozilla.org/projects/security/pki/nss/ssl/draft02.html * * Bytes 0-1: RECORD-LENGTH * Byte 2: MSG-CLIENT-HELLO (1) * Byte 3: CLIENT-VERSION-MSB * Byte 4: CLIENT-VERSION-LSB * * Allowed versions: * 2.0 - SSLv2 * 3.0 - SSLv3 * 3.1 - TLS 1.0 * 3.2 - TLS 1.1 * 3.3 - TLS 1.2 * * The version sent in the Client-Hello is the latest version supported by * the client. NSS may send version 3.x in an SSLv2 header for * maximum compatibility. */ /* * SSLv3/TLS Client Hello format * RFC 2246 * * Byte 0: ContentType (handshake - 22) * Bytes 1-2: ProtocolVersion {major, minor} * * Allowed versions: * 3.0 - SSLv3 * 3.1 - TLS 1.0 * 3.2 - TLS 1.1 * 3.3 - TLS 1.2 */ /* * AMQP 1.0 Header * * Bytes 0-3: "AMQP" * Byte 4: 0==AMQP, 2==SSL, 3==SASL * Byte 5: 1 * Bytes 6-7: 0 */ /* * AMQP Pre 1.0 Header * * Bytes 0-3: 'AMQP' * Byte 4: 1 * Byte 5: 1 * Byte 6: 0 (major version) * Byte 7: Minor version */ pni_protocol_type_t pni_sniff_header(const char *buf, size_t len) { if (len < 3) return PNI_PROTOCOL_INSUFFICIENT; bool isSSL3Handshake = buf[0]==22 && // handshake buf[1]==3 && buf[2]<=3; // SSL 3.0 & TLS 1.0-1.2 (v3.1-3.3) if (isSSL3Handshake) return PNI_PROTOCOL_SSL; bool isFirst3AMQP = buf[0]=='A' && buf[1]=='M' && buf[2]=='Q'; bool isFirst3SSL2CLientHello = buf[2]==1; // Client Hello if (!isFirst3AMQP && !isFirst3SSL2CLientHello) return PNI_PROTOCOL_UNKNOWN; if (len < 4) return PNI_PROTOCOL_INSUFFICIENT; bool isAMQP = isFirst3AMQP && buf[3]=='P'; bool isFirst4SSL2ClientHello = isFirst3SSL2CLientHello && (buf[3]==2 || buf[3]==3); if (!isAMQP && !isFirst4SSL2ClientHello) return PNI_PROTOCOL_UNKNOWN; if (len < 5) return PNI_PROTOCOL_INSUFFICIENT; bool isSSL2Handshake = buf[2] == 1 && // MSG-CLIENT-HELLO ((buf[3] == 3 && buf[4] <= 3) || // SSL 3.0 & TLS 1.0-1.2 (v3.1-3.3) (buf[3] == 2 && buf[4] == 0)); // SSL 2 if (isSSL2Handshake) return PNI_PROTOCOL_SSL; bool isFirst5OldAMQP = isAMQP && buf[4]==1; bool isFirst5AMQP = isAMQP && (buf[4]==0 || buf[4]==2 || buf[4]==3); if (!isFirst5AMQP && !isFirst5OldAMQP) return PNI_PROTOCOL_UNKNOWN; if (len < 6) return PNI_PROTOCOL_INSUFFICIENT; // Both old and new versions of AMQP have 1 in byte 5 if (buf[5]!=1) return PNI_PROTOCOL_UNKNOWN; // From here on it must be some sort of AMQP if (len < 8) return PNI_PROTOCOL_INSUFFICIENT; if (buf[6]==0 && buf[7]==0) { // AM #include // [v]snprintf on Windows only matches C99 when no errors or overflow. // Note: [v]snprintf behavior changed in VS2015 to be C99 compliant. // vsnprintf_s is unchanged. This platform code can go away some day. int pni_vsnprintf(char *buf, size_t count, const char *fmt, va_list ap) { if (fmt == NULL) return -1; if ((buf == NULL) && (count > 0)) return -1; if (count > 0) { int n = vsnprintf_s(buf, count, _TRUNCATE, fmt, ap); if (n >= 0) // no overflow return n; // same as C99 buf[count-1] = '\0'; } // separate call to get needed buffer size on overflow int n = _vscprintf(fmt, ap); if (n >= (int) count) return n; return -1; } int pni_snprintf(char *buf, size_t count, const char *fmt, ...) { va_list ap; va_start(ap, fmt); int n = pni_vsnprintf(buf, count, fmt, ap); va_end(ap); return n; } qpid-proton-0.22.0/proton-c/src/ProtonConfig.cmake.in0000664000000000000000000000344513257152177017325 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Name: Proton # Description: Qpid Proton C library # Version: @PN_VERSION@ # URL: http://qpid.apache.org/proton/ set (Proton_VERSION @PN_VERSION@) set (Proton_INCLUDE_DIRS @INCLUDEDIR@) set (Proton_LIBRARIES optimized @LIBDIR@/@PROTONLIB@ debug @LIBDIR@/@PROTONLIBDEBUG@) set (Proton_FOUND True) set (Proton_Core_INCLUDE_DIRS @INCLUDEDIR@) set (Proton_Core_LIBRARIES optimized @LIBDIR@/@PROTONCORELIB@ debug @LIBDIR@/@PROTONCORELIBDEBUG@) set (Proton_Core_FOUND True) set (HAS_PROACTOR @HAS_PROACTOR@) if (HAS_PROACTOR) set (Proton_Proactor_INCLUDE_DIRS @INCLUDEDIR@) set (Proton_Proactor_LIBRARIES optimized @LIBDIR@/@PROTONPROACTORLIB@ debug @LIBDIR@/@PROTONPROACTORLIBDEBUG@) set (Proton_Proactor_FOUND True) endif() # Check for all required components foreach(comp ${Proton_FIND_COMPONENTS}) if(NOT Proton_${comp}_FOUND) if(Proton_FIND_REQUIRED_${comp}) set(Proton_FOUND FALSE) set(Proton_NOT_FOUND_MESSAGE "Didn't find required component ${comp}") endif() endif() endforeach() qpid-proton-0.22.0/proton-c/mllib/0000775000000000000000000000000013257152177013611 5ustar qpid-proton-0.22.0/proton-c/mllib/transforms.py0000664000000000000000000000715713257152177016373 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ Useful transforms for dom objects. """ from __future__ import absolute_import from . import dom try: from io import StringIO except ImportError: from cStringIO import StringIO class Visitor: def descend(self, node): for child in node.children: child.dispatch(self) def node(self, node): self.descend(node) def leaf(self, leaf): pass class Identity: def descend(self, node): result = [] for child in node.children: result.append(child.dispatch(self)) return result def default(self, tag): result = dom.Tag(tag.name, *tag.attrs) result.extend(self.descend(tag)) return result def tree(self, tree): result = dom.Tree() result.extend(self.descend(tree)) return result def tag(self, tag): return self.default(tag) def leaf(self, leaf): return leaf.__class__(leaf.data) class Sexp(Identity): def __init__(self): self.stack = [] self.level = 0 self.out = "" def open(self, s): self.out += "(%s" % s self.level += len(s) + 1 self.stack.append(s) def line(self, s = ""): self.out = self.out.rstrip() self.out += "\n" + " "*self.level + s def close(self): s = self.stack.pop() self.level -= len(s) + 1 self.out = self.out.rstrip() self.out += ")" def tree(self, tree): self.open("+ ") for child in tree.children: self.line(); child.dispatch(self) self.close() def tag(self, tag): self.open("Node(%s) " % tag.name) for child in tag.children: self.line(); child.dispatch(self) self.close() def leaf(self, leaf): self.line("%s(%s)" % (leaf.__class__.__name__, leaf.data)) class Output: def descend(self, node): out = StringIO() for child in node.children: out.write(child.dispatch(self)) return out.getvalue() def default(self, tag): out = StringIO() out.write("<%s" % tag.name) for k, v in tag.attrs: out.write(' %s="%s"' % (k, v)) out.write(">") out.write(self.descend(tag)) if not tag.singleton: out.write("" % tag.name) return out.getvalue() def tree(self, tree): return self.descend(tree) def tag(self, tag): return self.default(tag) def data(self, leaf): return leaf.data def entity(self, leaf): return "&%s;" % leaf.data def character(self, leaf): raise Exception("TODO") def comment(self, leaf): return "" % leaf.data class Empty(Output): def tag(self, tag): return self.descend(tag) def data(self, leaf): return "" def entity(self, leaf): return "" def character(self, leaf): return "" def comment(self, leaf): return "" class Text(Empty): def data(self, leaf): return leaf.data def entity(self, leaf): return "&%s;" % leaf.data def character(self, leaf): # XXX: is this right? return "&#%s;" % leaf.data qpid-proton-0.22.0/proton-c/mllib/parsers.py0000664000000000000000000000523713257152177015651 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ Parsers for XML to dom. """ from __future__ import absolute_import import xml.sax.handler from .dom import * class Parser: def __init__(self): self.tree = Tree() self.node = self.tree self.nodes = [] def line(self, id, lineno, colno): while self.nodes: n = self.nodes.pop() n._line(id, lineno, colno) def add(self, node): self.node.add(node) self.nodes.append(node) def start(self, name, attrs): tag = Tag(name, *attrs) self.add(tag) self.node = tag def end(self, name): self.balance(name) self.node = self.node.parent def data(self, data): children = self.node.children if children and isinstance(children[-1], Data): children[-1].data += data else: self.add(Data(data)) def comment(self, comment): self.add(Comment(comment)) def entity(self, ref): self.add(Entity(ref)) def character(self, ref): self.add(Character(ref)) def balance(self, name = None): while self.node != self.tree and name != self.node.name: self.node.parent.extend(self.node.children) del self.node.children[:] self.node.singleton = True self.node = self.node.parent class XMLParser(xml.sax.handler.ContentHandler): def __init__(self): self.parser = Parser() self.locator = None def line(self): if self.locator != None: self.parser.line(self.locator.getSystemId(), self.locator.getLineNumber(), self.locator.getColumnNumber()) def setDocumentLocator(self, locator): self.locator = locator def startElement(self, name, attrs): self.parser.start(name, attrs.items()) self.line() def endElement(self, name): self.parser.end(name) self.line() def characters(self, content): self.parser.data(content) self.line() def skippedEntity(self, name): self.parser.entity(name) self.line() qpid-proton-0.22.0/proton-c/mllib/dom.py0000664000000000000000000001500113257152177014737 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ Simple DOM for both SGML and XML documents. """ from __future__ import division from __future__ import generators from __future__ import nested_scopes from __future__ import absolute_import import sys if sys.version_info[0] == 2: STRING_TYPES = (basestring,) else: STRING_TYPES = (str,) class Container: def __init__(self): self.children = [] def add(self, child): child.parent = self self.children.append(child) def extend(self, children): for child in children: child.parent = self self.children.append(child) class Component: def __init__(self): self.parent = None def index(self): if self.parent: return self.parent.children.index(self) else: return 0 def _line(self, file, line, column): self.file = file self.line = line self.column = column class DispatchError(Exception): def __init__(self, scope, f): msg = "no such attribute" class Dispatcher: def is_type(self, type): cls = self while cls != None: if cls.type == type: return True cls = cls.base return False def dispatch(self, f, attrs = ""): cls = self while cls != None: if hasattr(f, cls.type): return getattr(f, cls.type)(self) else: cls = cls.base cls = self while cls != None: if attrs: sep = ", " if cls.base == None: sep += "or " else: sep = "" attrs += "%s'%s'" % (sep, cls.type) cls = cls.base raise AttributeError("'%s' object has no attribute %s" % (f.__class__.__name__, attrs)) class Node(Container, Component, Dispatcher): type = "node" base = None def __init__(self): Container.__init__(self) Component.__init__(self) self.query = Query([self]) def __getitem__(self, name): for nd in self.query[name]: return nd def text(self): from . import transforms return self.dispatch(transforms.Text()) def tag(self, name, *attrs, **kwargs): t = Tag(name, *attrs, **kwargs) self.add(t) return t def data(self, s): d = Data(s) self.add(d) return d def entity(self, s): e = Entity(s) self.add(e) return e class Tree(Node): type = "tree" base = Node class Tag(Node): type = "tag" base = Node def __init__(self, _name, *attrs, **kwargs): Node.__init__(self) self.name = _name self.attrs = list(attrs) self.attrs.extend(kwargs.items()) self.singleton = False def get_attr(self, name): for k, v in self.attrs: if name == k: return v def _idx(self, attr): idx = 0 for k, v in self.attrs: if k == attr: return idx idx += 1 return None def set_attr(self, name, value): idx = self._idx(name) if idx is None: self.attrs.append((name, value)) else: self.attrs[idx] = (name, value) def dispatch(self, f): try: attr = "do_" + self.name method = getattr(f, attr) except AttributeError: return Dispatcher.dispatch(self, f, "'%s'" % attr) return method(self) class Leaf(Component, Dispatcher): type = "leaf" base = None def __init__(self, data): assert isinstance(data, STRING_TYPES) self.data = data class Data(Leaf): type = "data" base = Leaf class Entity(Leaf): type = "entity" base = Leaf class Character(Leaf): type = "character" base = Leaf class Comment(Leaf): type = "comment" base = Leaf ################### ## Query Classes ## ########################################################################### class Adder: def __add__(self, other): return Sum(self, other) class Sum(Adder): def __init__(self, left, right): self.left = left self.right = right def __iter__(self): for x in self.left: yield x for x in self.right: yield x class View(Adder): def __init__(self, source): self.source = source class Filter(View): def __init__(self, predicate, source): View.__init__(self, source) self.predicate = predicate def __iter__(self): for nd in self.source: if self.predicate(nd): yield nd class Flatten(View): def __iter__(self): sources = [iter(self.source)] while sources: try: nd = next(sources[-1]) if isinstance(nd, Tree): sources.append(iter(nd.children)) else: yield nd except StopIteration: sources.pop() class Children(View): def __iter__(self): for nd in self.source: for child in nd.children: yield child class Attributes(View): def __iter__(self): for nd in self.source: for a in nd.attrs: yield a class Values(View): def __iter__(self): for name, value in self.source: yield value def flatten_path(path): if isinstance(path, STRING_TYPES): for part in path.split("/"): yield part elif callable(path): yield path else: for p in path: for fp in flatten_path(p): yield fp class Query(View): def __iter__(self): for nd in self.source: yield nd def __getitem__(self, path): query = self.source for p in flatten_path(path): if callable(p): select = Query pred = p source = query elif isinstance(p, STRING_TYPES): if p[0] == "@": select = Values pred = lambda x, n=p[1:]: x[0] == n source = Attributes(query) elif p[0] == "#": select = Query pred = lambda x, t=p[1:]: x.is_type(t) source = Children(query) else: select = Query pred = lambda x, n=p: isinstance(x, Tag) and x.name == n source = Flatten(Children(query)) else: raise ValueError(p) query = select(Filter(pred, source)) return query qpid-proton-0.22.0/proton-c/mllib/__init__.py0000664000000000000000000000436313257152177015730 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ This module provides document parsing and transformation utilities for XML. """ from __future__ import absolute_import import os, sys import xml.sax, types from xml.sax.handler import ErrorHandler from xml.sax.xmlreader import InputSource try: from io import StringIO except ImportError: from cStringIO import StringIO if sys.version_info[0] == 2: import types CLASS_TYPES = (type, types.ClassType) else: CLASS_TYPES = (type,) from . import dom from . import transforms from . import parsers def transform(node, *args): result = node for t in args: if isinstance(t, CLASS_TYPES): t = t() result = result.dispatch(t) return result class Resolver: def __init__(self, path): self.path = path def resolveEntity(self, publicId, systemId): for p in self.path: fname = os.path.join(p, systemId) if os.path.exists(fname): source = InputSource(systemId) source.setByteStream(open(fname)) return source return InputSource(systemId) def xml_parse(filename, path=()): if sys.version_info[0:2] == (2,3): # XXX: this is for older versions of python source = "file://%s" % os.path.abspath(filename) else: source = filename h = parsers.XMLParser() p = xml.sax.make_parser() p.setContentHandler(h) p.setErrorHandler(ErrorHandler()) p.setEntityResolver(Resolver(path)) p.parse(source) return h.parser.tree def sexp(node): s = transforms.Sexp() node.dispatch(s) return s.out qpid-proton-0.22.0/proton-c/include/0000775000000000000000000000000013257152177014135 5ustar qpid-proton-0.22.0/proton-c/include/proton/0000775000000000000000000000000013257152177015456 5ustar qpid-proton-0.22.0/proton-c/include/proton/version.h.in0000664000000000000000000000200213257152177017713 0ustar #ifndef _PROTON_VERSION_H #define _PROTON_VERSION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #define PN_VERSION_MAJOR @PN_VERSION_MAJOR@ #define PN_VERSION_MINOR @PN_VERSION_MINOR@ #define PN_VERSION_POINT @PN_VERSION_POINT@ #endif /* version.h */ qpid-proton-0.22.0/proton-c/include/proton/url.h0000664000000000000000000000617413257152177016441 0ustar #ifndef PROTON_URL_H #define PROTON_URL_H 1 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief url * * @addtogroup url * @{ */ /** * A parsed URL */ typedef struct pn_url_t pn_url_t; /** * Create an empty URL */ PNX_EXTERN pn_url_t *pn_url(void); /** * Parse a string URL as a pn_url_t. * * URL syntax: * * [ :// ] [ [ : ] @ ] [ : ] [ / ] * * `scheme`, `user`, `password`, `port` cannot contain any of '@', ':', '/' * * If the first character of `host` is '[' then it can contain any character up * to ']' (this is to allow IPv6 literal syntax). Otherwise it also cannot * contain '@', ':', '/' * * `path` can contain any character * * @param[in] url A URL string. * @return The parsed pn_url_t or NULL if url is not a valid URL string. */ PNX_EXTERN pn_url_t *pn_url_parse(const char *url); /** * Free a URL */ PNX_EXTERN void pn_url_free(pn_url_t *url); /** * Clear the contents of the URL. */ PNX_EXTERN void pn_url_clear(pn_url_t *url); /** * Return the string form of a URL. * * The returned string is owned by the pn_url_t and will become * invalid if it is modified. */ PNX_EXTERN const char *pn_url_str(pn_url_t *url); /** * @name Getters for parts of the URL. * * Values belong to the URL. May return NULL if the value is not set. * * @{ */ PNX_EXTERN const char *pn_url_get_scheme(pn_url_t *url); PNX_EXTERN const char *pn_url_get_username(pn_url_t *url); PNX_EXTERN const char *pn_url_get_password(pn_url_t *url); PNX_EXTERN const char *pn_url_get_host(pn_url_t *url); PNX_EXTERN const char *pn_url_get_port(pn_url_t *url); PNX_EXTERN const char *pn_url_get_path(pn_url_t *url); /** * @} */ /** * @name Setters for parts of the URL. * * Values are copied. Value can be NULL to indicate the part is not * set. * * @{ */ PNX_EXTERN void pn_url_set_scheme(pn_url_t *url, const char *scheme); PNX_EXTERN void pn_url_set_username(pn_url_t *url, const char *username); PNX_EXTERN void pn_url_set_password(pn_url_t *url, const char *password); PNX_EXTERN void pn_url_set_host(pn_url_t *url, const char *host); PNX_EXTERN void pn_url_set_port(pn_url_t *url, const char *port); PNX_EXTERN void pn_url_set_path(pn_url_t *url, const char *path); /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* url.h */ qpid-proton-0.22.0/proton-c/include/proton/types.h0000664000000000000000000003027513257152177017002 0ustar #ifndef PROTON_TYPES_H #define PROTON_TYPES_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include /** * @file * * @copybrief types * * @defgroup core Core * @brief Core protocol entities and event handling. * * @defgroup connection Connection * @brief A connection to a remote AMQP peer. * @ingroup core * * @defgroup session Session * @brief A container of links. * @ingroup core * * @defgroup link Link * @brief A channel for transferring messages. * @ingroup core * * @defgroup terminus Terminus * @brief A source or target for messages. * @ingroup core * * @defgroup message Message * @brief A mutable holder of application content. * @ingroup core * * @defgroup delivery Delivery * @brief A message transfer. * @ingroup core * * @defgroup condition Condition * @brief An endpoint error state. * @ingroup core * * @defgroup event Event * @brief Protocol and transport events. * @ingroup core * * @defgroup transport Transport * @brief A network channel supporting an AMQP connection. * @ingroup core * * @defgroup sasl SASL * @brief SASL secure transport layer. * @ingroup core * * @defgroup ssl SSL * @brief SSL secure transport layer. * @ingroup core * * @defgroup error Error * @brief A Proton API error. * @ingroup core * * @defgroup types Types * @brief AMQP and API data types. * * @defgroup amqp_types AMQP data types * @brief AMQP data types. * @ingroup types * * @defgroup api_types API data types * @brief Additional data types used in the API. * @ingroup types * * @defgroup codec Codec * @brief AMQP data encoding and decoding. * * @defgroup data Data * @brief A data structure for AMQP data. * @ingroup codec * * @defgroup io IO * @brief **Unsettled API** - Interfaces for IO integration. * * @defgroup proactor Proactor * @brief **Unsettled API** - An API for multithreaded IO. * @ingroup io * * @defgroup proactor_events Proactor events * @brief **Unsettled API** - Events used by the proactor. * @ingroup io * * @defgroup listener Listener * @brief **Unsettled API** - A listener for incoming connections. * @ingroup io * * @defgroup connection_driver Connection driver * @brief **Unsettled API** - An API for low-level IO integration. * @ingroup io * * @defgroup messenger Messenger * @brief **Deprecated** - Use the @ref proactor API or Qpid Proton C++. * * @defgroup url URL * @brief **Deprecated** - Use a third-party URL library. */ #ifdef __cplusplus extern "C" { #endif /** * A sequence number. * * @ingroup api_types */ typedef int32_t pn_sequence_t; /** * A span of time in milliseconds. * * @ingroup api_types */ typedef uint32_t pn_millis_t; /** * The maximum value for @ref pn_millis_t. * * @ingroup api_types */ #define PN_MILLIS_MAX (~0U) /** * A span of time in seconds. * * @ingroup api_types */ typedef uint32_t pn_seconds_t; /** * A 64-bit timestamp in milliseconds since the Unix epoch. * * @ingroup amqp_types */ typedef int64_t pn_timestamp_t; /** * A 32-bit Unicode code point. * * @ingroup amqp_types */ typedef uint32_t pn_char_t; /** * A 32-bit decimal floating-point number. * * @ingroup amqp_types */ typedef uint32_t pn_decimal32_t; /** * A 64-bit decimal floating-point number. * * @ingroup amqp_types */ typedef uint64_t pn_decimal64_t; /** * A 128-bit decimal floating-point number. * * @ingroup amqp_types */ typedef struct { char bytes[16]; } pn_decimal128_t; /** * A 16-byte universally unique identifier. * * @ingroup amqp_types */ typedef struct { char bytes[16]; } pn_uuid_t; /** * A const byte buffer. * * @ingroup api_types */ typedef struct pn_bytes_t { size_t size; const char *start; } pn_bytes_t; /** * Create a @ref pn_bytes_t * * @ingroup api_types */ PN_EXTERN pn_bytes_t pn_bytes(size_t size, const char *start); static const pn_bytes_t pn_bytes_null = { 0, NULL }; /** * A non-const byte buffer. * * @ingroup api_types */ typedef struct pn_rwbytes_t { size_t size; char *start; } pn_rwbytes_t; /** * Create a @ref pn_rwbytes_t * * @ingroup api_types */ PN_EXTERN pn_rwbytes_t pn_rwbytes(size_t size, char *start); static const pn_rwbytes_t pn_rwbytes_null = { 0, NULL }; /** * Holds the state flags for an AMQP endpoint. * * A pn_state_t is an integral value with flags that encode both the * local and remote state of an AMQP Endpoint (@link pn_connection_t * Connection @endlink, @link pn_session_t Session @endlink, or @link * pn_link_t Link @endlink). The local portion of the state may be * accessed using ::PN_LOCAL_MASK, and the remote portion may be * accessed using ::PN_REMOTE_MASK. Individual bits may be accessed * using ::PN_LOCAL_UNINIT, ::PN_LOCAL_ACTIVE, ::PN_LOCAL_CLOSED, and * ::PN_REMOTE_UNINIT, ::PN_REMOTE_ACTIVE, ::PN_REMOTE_CLOSED. * * Every AMQP endpoint (@link pn_connection_t Connection @endlink, * @link pn_session_t Session @endlink, or @link pn_link_t Link * @endlink) starts out in an uninitialized state and then proceeds * linearly to an active and then closed state. This lifecycle occurs * at both endpoints involved, and so the state model for an endpoint * includes not only the known local state, but also the last known * state of the remote endpoint. * * @ingroup connection */ typedef int pn_state_t; /** * An AMQP Connection object. * * A pn_connection_t object encapsulates all of the endpoint state * associated with an AMQP Connection. A pn_connection_t object * contains zero or more ::pn_session_t objects, which in turn contain * zero or more ::pn_link_t objects. Each ::pn_link_t object contains * an ordered sequence of ::pn_delivery_t objects. A link is either a * sender or a receiver but never both. * * @ingroup connection */ typedef struct pn_connection_t pn_connection_t; /** * An AMQP Session object. * * A pn_session_t object encapsulates all of the endpoint state * associated with an AMQP Session. A pn_session_t object contains * zero or more ::pn_link_t objects. * * @ingroup session */ typedef struct pn_session_t pn_session_t; /** * An AMQP Link object. * * A pn_link_t object encapsulates all of the endpoint state * associated with an AMQP Link. A pn_link_t object contains an * ordered sequence of ::pn_delivery_t objects representing in-flight * deliveries. A pn_link_t may be either sender or a receiver but * never both. * * A pn_link_t object maintains a pointer to the *current* delivery * within the ordered sequence of deliveries contained by the link * (See ::pn_link_current). The *current* delivery is the target of a * number of operations associated with the link, such as sending * (::pn_link_send) and receiving (::pn_link_recv) message data. * * @ingroup link */ typedef struct pn_link_t pn_link_t; /** * An AMQP Delivery object. * * A pn_delivery_t object encapsulates all of the endpoint state * associated with an AMQP Delivery. Every delivery exists within the * context of a ::pn_link_t object. * * The AMQP model for settlement is based on the lifecycle of a * delivery at an endpoint. At each end of a link, a delivery is * created, it exists for some period of time, and finally it is * forgotten, aka settled. Note that because this lifecycle happens * independently at both the sender and the receiver, there are * actually four events of interest in the combined lifecycle of a * given delivery: * * - created at sender * - created at receiver * - settled at sender * - settled at receiver * * Because the sender and receiver are operating concurrently, these * events can occur in a variety of different orders, and the order of * these events impacts the types of failures that may occur when * transferring a delivery. Eliminating scenarios where the receiver * creates the delivery first, we have the following possible * sequences of interest: * * Sender presettles (aka at-most-once): * ------------------------------------- * * 1. created at sender * 2. settled at sender * 3. created at receiver * 4. settled at receiver * * In this configuration the sender settles (i.e. forgets about) the * delivery before it even reaches the receiver, and if anything * should happen to the delivery in-flight, there is no way to * recover, hence the "at most once" semantics. * * Receiver settles first (aka at-least-once): * ------------------------------------------- * * 1. created at sender * 2. created at receiver * 3. settled at receiver * 4. settled at sender * * In this configuration the receiver settles the delivery first, and * the sender settles once it sees the receiver has settled. Should * anything happen to the delivery in-flight, the sender can resend, * however the receiver may have already forgotten the delivery and so * it could interpret the resend as a new delivery, hence the "at * least once" semantics. * * Receiver settles second (aka exactly-once): * ------------------------------------------- * * 1. created at sender * 2. created at receiver * 3. settled at sender * 4. settled at receiver * * In this configuration the receiver settles only once it has seen * that the sender has settled. This provides the sender the option to * retransmit, and the receiver has the option to recognize (and * discard) duplicates, allowing for exactly once semantics. * * Note that in the last scenario the sender needs some way to know * when it is safe to settle. This is where delivery state comes in. * In addition to these lifecycle related events surrounding * deliveries there is also the notion of a delivery state that can * change over the lifetime of a delivery, e.g. it might start out as * nothing, transition to ::PN_RECEIVED and then transition to * ::PN_ACCEPTED. In the first two scenarios the delivery state isn't * required, however in final scenario the sender would typically * trigger settlement based on seeing the delivery state transition to * a terminal state like ::PN_ACCEPTED or ::PN_REJECTED. * * In practice settlement is controlled by application policy, so * there may well be more options here, e.g. a sender might not settle * strictly based on what has happened at the receiver, it might also * choose to impose some time limit and settle after that period has * expired, or it could simply have a sliding window of the last N * deliveries and settle the oldest whenever a new one comes along. * * @ingroup delivery */ typedef struct pn_delivery_t pn_delivery_t; /** * An event collector. * * A pn_collector_t may be used to register interest in being notified * of high level events that can occur to the various objects * representing AMQP endpoint state. See ::pn_event_t for more * details. * * @ingroup event */ typedef struct pn_collector_t pn_collector_t; /** * A listener for incoming connections. * * @ingroup listener */ typedef struct pn_listener_t pn_listener_t; /** * A network channel supporting an AMQP connection. * * A pn_transport_t encapsulates the transport related state of all * AMQP endpoint objects associated with a physical network connection * at a given point in time. * * @ingroup transport */ typedef struct pn_transport_t pn_transport_t; /** * A harness for multithreaded IO. * * @ingroup proactor */ typedef struct pn_proactor_t pn_proactor_t; /** * @cond INTERNAL * * An event handler * * A pn_handler_t is target of ::pn_event_t dispatched by the pn_reactor_t */ typedef struct pn_handler_t pn_handler_t; /** * @endcond */ #ifdef __cplusplus } #endif #endif /* types.h */ qpid-proton-0.22.0/proton-c/include/proton/type_compat.h0000664000000000000000000000742113257152177020157 0ustar #ifndef PROTON_TYPE_COMPAT_H #define PROTON_TYPE_COMPAT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /** * @cond INTERNAL */ /* Get Boolean */ #if !defined(__cplusplus) && !defined(__bool_true_false_are_defined) # if __STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || _MSC_VER >=1800 # include # else /* Need to get bool/true/false manually */ # if _MSC_VER # define bool char # define false 0 # define true 1 # define __bool_true_false_are_defined # else # error "No definitions for bool/true/false" # endif # endif #endif /* * Handle special cases for stdint.h and the definition for ssize_t. * Third party libraries (e.g. Boost) may provide competing solutions. * * The effects of this include file may be controlled by overrides: * PN_DEFINE_STDINT/PN_NODEFINE_STDINT : turn on/off definition of int64_t etc. * PN_DEFINE_SSIZE_T/PN_NODEFINE_SSIZE_T : turn on/off definition of ssize_t * PN_INCLUDE_STDINT/PN_NOINCLUDE_STDINT : include (or not) stdint.h */ /* Honor positive overrides */ #if defined(PN_DEFINE_STDINT) # define PNI_DEFINE_STDINT #endif #if defined(PN_INCLUDE_STDINT) # define PNI_INCLUDE_STDINT) #endif #if defined(PN_DEFINE_SSIZE_T) # define PNI_DEFINE_SSIZE_T #endif /* Determine default action */ #ifndef _MSC_VER /* Not Windows and not using Visual Studio */ /* MBED_BUILD_TIMESTAMP is used to detect whether Proton is being built on www.mbed.org with the ARM compiler. In that case ssize_t needs to be defined in this file. */ #if defined(MBED_BUILD_TIMESTAMP) # define PNI_DEFINE_SSIZE_T #else #include #endif /* defined(MBED_LIBRARY_VERSION) */ # ifndef PNI_INCLUDE_STDINT # define PNI_INCLUDE_STDINT # endif #else /* all versions of Visual Studio */ # ifndef PNI_DEFINE_SSIZE_T /* ssize_t def is needed, unless third party definition interferes, e.g. python/swig */ # ifndef Py_CONFIG_H # define PNI_DEFINE_SSIZE_T # endif # endif # if (_MSC_VER < 1600) /* VS 2008 and earlier */ # ifndef PNI_DEFINE_STDINT # define PNI_DEFINE_STDINT # endif # else /* VS 2010 and newer */ # ifndef PNI_INCLUDE_STDINT # define PNI_INCLUDE_STDINT # endif # endif /* (_MSC_VER < 1600) */ #endif /*_MSC_VER */ /* Honor negative overrides */ #ifdef PN_NODEFINE_SSIZE_T # undef PNI_DEFINE_SSIZE_T #endif #ifdef PN_NODEFINE_STDINT # undef PNI_DEFINE_STDINT #endif #ifdef PN_NOINCLUDE_STDINT # undef PNI_INCLUDE_STDINT #endif #ifdef PNI_INCLUDE_STDINT # include #endif #ifdef PNI_DEFINE_SSIZE_T # ifdef _MSC_VER # include typedef SSIZE_T ssize_t; # else typedef intptr_t ssize_t; # endif #endif /* PNI_DEFINE_SSIZE_T */ #ifdef PNI_DEFINE_STDINT # ifdef _MSC_VER typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef signed __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; # else /* _MSC_VER */ # error stdint.h definitions not kown # endif #endif /* PNI_DEFINE_SSIZE_T */ /** * @endcond */ #endif /* type_compat.h */ qpid-proton-0.22.0/proton-c/include/proton/transport.h0000664000000000000000000005124013257152177017665 0ustar #ifndef PROTON_TRANSPORT_H #define PROTON_TRANSPORT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief transport * * @addtogroup transport * @{ */ /** * Holds the trace flags for an AMQP transport. * * The trace flags for an AMQP transport control what sort of * information is logged by an AMQP transport. The following bits can * be set: * * - ::PN_TRACE_OFF * - ::PN_TRACE_RAW * - ::PN_TRACE_FRM * - ::PN_TRACE_DRV * - ::PN_TRACE_EVT * */ typedef int pn_trace_t; /** * Callback for customizing logging behaviour. */ typedef void (*pn_tracer_t)(pn_transport_t *transport, const char *message); /** * Turn logging off entirely. */ #define PN_TRACE_OFF (0) /** * Log raw binary data going in and out of the transport. */ #define PN_TRACE_RAW (1) /** * Log protocol frames going in and out of the transport. */ #define PN_TRACE_FRM (2) /** * Log driver-related events. For example, initialization, end of * stream, and so on. */ #define PN_TRACE_DRV (4) /** * Log events. */ #define PN_TRACE_EVT (8) /** * Factory for creating a transport. * * A transport is used by a connection to interface with the network. * There can only be one connection associated with a transport. See * pn_transport_bind(). * * Initially a transport is configured to be a client transport. Use * pn_transport_set_server() to configure the transport as a server * transport. * * A client transport initiates outgoing connections. * * A client transport must be configured with the protocol layers to * use and cannot configure itself automatically. * * A server transport accepts incoming connections. It can * automatically configure itself to include the various protocol * layers depending on the incoming protocol headers. * * @return pointer to new transport */ PN_EXTERN pn_transport_t *pn_transport(void); /** * Configure a transport as a server * * @param[in] transport a transport object */ PN_EXTERN void pn_transport_set_server(pn_transport_t *transport); /** * Free a transport object. * * When a transport is freed, it is automatically unbound from its * associated connection. * * @param[in] transport a transport object or NULL */ PN_EXTERN void pn_transport_free(pn_transport_t *transport); /** * Retrieve the authenticated user. * * This is usually used at the the server end to find the name of the * authenticated user. On the client it will merely return whatever * user was passed in to the pn_connection_set_user() API of the bound * connection. * * The returned value is only reliable after the * PN_TRANSPORT_AUTHENTICATED event has been received. * * @param[in] transport the transport * * @return If a the user is anonymous (either no SASL layer is * negotiated or the SASL ANONYMOUS mechanism is used) then the user * will be "anonymous" Otherwise a string containing the user is * returned. */ PN_EXTERN const char *pn_transport_get_user(pn_transport_t *transport); /** * Set whether a non-authenticated transport connection is allowed. * * There are several ways within the AMQP protocol suite to get * unauthenticated connections: * * - Use no SASL layer (with either no TLS or TLS without client certificates) * - Use a SASL layer but the ANONYMOUS mechanism * * The default if this option is not set is to allow unauthenticated connections. * * @param[in] transport the transport * @param[in] required boolean is true when authenticated connections are required */ PN_EXTERN void pn_transport_require_auth(pn_transport_t *transport, bool required); /** * Tell whether the transport connection is authenticated * * Note that this property may not be stable until the PN_CONNECTION_REMOTE_OPEN * event is received. * * @param[in] transport the transport * @return bool representing authentication */ PN_EXTERN bool pn_transport_is_authenticated(pn_transport_t *transport); /** * Set whether a non encrypted transport connection is allowed * * There are several ways within the AMQP protocol suite to get encrypted connections: * - Use TLS * - Use a SASL with a mechanism that supports security layers * * The default if this option is not set is to allow unencrypted connections. * * @param[in] transport the transport * @param[in] required boolean is true when encrypted connections are required */ PN_EXTERN void pn_transport_require_encryption(pn_transport_t *transport, bool required); /** * Tell whether the transport connection is encrypted * * Note that this property may not be stable until the PN_CONNECTION_REMOTE_OPEN * event is received. * * @param[in] transport the transport * @return bool representing encryption */ PN_EXTERN bool pn_transport_is_encrypted(pn_transport_t *transport); /** * Get additional information about the condition of the transport. * * When a PN_TRANSPORT_ERROR event occurs, this operation can be used * to access the details of the error condition. * * The pointer returned by this operation is valid until the * transport object is freed. * * @param[in] transport the transport object * @return the transport's condition object */ PN_EXTERN pn_condition_t *pn_transport_condition(pn_transport_t *transport); /** * **Deprecated** */ PN_EXTERN pn_error_t *pn_transport_error(pn_transport_t *transport); /** * Binds the transport to an AMQP connection. * * @return an error code, or 0 on success */ PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection); /** * Unbinds a transport from its AMQP connection. * * @return an error code, or 0 on success */ PN_EXTERN int pn_transport_unbind(pn_transport_t *transport); /** * Update a transports trace flags. * * The trace flags for a transport control what sort of information is * logged. See ::pn_trace_t for more details. * * @param[in] transport a transport object * @param[in] trace the trace flags * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace); /** * Set the tracing function used by a transport. * * The tracing function is called to perform logging. Overriding this * function allows embedding applications to divert the engine's * logging to a place of their choice. * * @param[in] transport a transport object * @param[in] tracer the tracing function * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t tracer); /** * Get the tracing function used by a transport. * * @param[in] transport a transport object * @return the tracing function used by a transport * * @internal XXX Deprecate! */ PN_EXTERN pn_tracer_t pn_transport_get_tracer(pn_transport_t *transport); /** * **Deprecated** - Use ::pn_transport_attachments(). * * Get the application context that is associated with a transport object. * * The application context for a transport may be set using * ::pn_transport_set_context. * * @param[in] transport the transport whose context is to be returned. * @return the application context for the transport object */ PN_EXTERN void *pn_transport_get_context(pn_transport_t *transport); /** * **Deprecated** - Use ::pn_transport_attachments(). * * Set a new application context for a transport object. * * The application context for a transport object may be retrieved using * ::pn_transport_get_context. * * @param[in] transport the transport object * @param[in] context the application context */ PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context); /** * Get the attachments that are associated with a transport object. * * @param[in] transport the transport whose attachments are to be returned. * @return the attachments for the transport object */ PN_EXTERN pn_record_t *pn_transport_attachments(pn_transport_t *transport); /** * Log a message using a transport's logging mechanism. * * This can be useful in a debugging context as the log message will * be prefixed with the transport's identifier. * * @param[in] transport a transport object * @param[in] message the message to be logged * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message); /** * Log a printf formatted message using a transport's logging * mechanism. * * This can be useful in a debugging context as the log message will * be prefixed with the transport's identifier. * * @param[in] transport a transport object * @param[in] fmt the printf formatted message to be logged * @param[in] ap a vector containing the format arguments * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_vlogf(pn_transport_t *transport, const char *fmt, va_list ap); /** * Log a printf formatted message using a transport's logging * mechanism. * * This can be useful in a debugging context as the log message will * be prefixed with the transport's identifier. * * @param[in] transport a transport object * @param[in] fmt the printf formatted message to be logged * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...); /** * Get the maximum allowed channel for a transport. * This will be the minimum of * 1. limit imposed by this proton implementation * 2. limit imposed by remote peer * 3. limit imposed by this application, using pn_transport_set_channel_max() * * @param[in] transport a transport object * @return the maximum allowed channel * * @internal XXX Deprecate! */ PN_EXTERN uint16_t pn_transport_get_channel_max(pn_transport_t *transport); /** * Set the maximum allowed channel number for a transport. * Note that this is the maximum channel number allowed, giving a * valid channel number range of [0..channel_max]. Therefore the * maximum number of simultaneously active channels will be * channel_max plus 1. * You can call this function more than once to raise and lower * the limit your application imposes on max channels for this * transport. However, smaller limits may be imposed by this * library, or by the remote peer. * After the OPEN frame has been sent to the remote peer, * further calls to this function will have no effect. * * @param[in] transport a transport object * @param[in] channel_max the maximum allowed channel * @return PN_OK, or PN_STATE_ERR if it is too late to change channel_max * * @internal XXX Deprecate! */ PN_EXTERN int pn_transport_set_channel_max(pn_transport_t *transport, uint16_t channel_max); /** * Get the maximum allowed channel of a transport's remote peer. * * @param[in] transport a transport object * @return the maximum allowed channel of the transport's remote peer * * @internal XXX Deprecate! */ PN_EXTERN uint16_t pn_transport_remote_channel_max(pn_transport_t *transport); /** * Get the maximum frame size of a transport. * * @param[in] transport a transport object * @return the maximum frame size of the transport object * * @internal XXX Deprecate! */ PN_EXTERN uint32_t pn_transport_get_max_frame(pn_transport_t *transport); /** * Set the maximum frame size of a transport. * * @param[in] transport a transport object * @param[in] size the maximum frame size for the transport object * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size); /** * Get the maximum frame size of a transport's remote peer. * * @param[in] transport a transport object * @return the maximum frame size of the transport's remote peer * * @internal XXX Deprecate! */ PN_EXTERN uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport); /** * Get the idle timeout for a transport. * * A zero idle timeout means heartbeats are disabled. * * @param[in] transport a transport object * @return the transport's idle timeout * * @internal XXX Deprecate! */ PN_EXTERN pn_millis_t pn_transport_get_idle_timeout(pn_transport_t *transport); /** * Set the idle timeout for a transport. * * A zero idle timeout means heartbeats are disabled. * * @param[in] transport a transport object * @param[in] timeout the idle timeout for the transport object * * @internal XXX Deprecate! */ PN_EXTERN void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout); /** * Get the idle timeout for a transport's remote peer. * * A zero idle timeout means heartbeats are disabled. * * @param[in] transport a transport object * @return the idle timeout for the transport's remote peer * * @internal XXX Deprecate! */ PN_EXTERN pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport); /** * **Deprecated** */ PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available); /** * **Deprecated** */ PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size); /** * Get the amount of free space for input following the transport's * tail pointer. * * If the engine is in an exceptional state such as encountering an * error condition or reaching the end of stream state, a negative * value will be returned indicating the condition. If an error is * indicated, further details can be obtained from * ::pn_transport_error. Calls to ::pn_transport_process may alter the * value of this pointer. See ::pn_transport_process for details. * * @param[in] transport the transport * @return the free space in the transport, PN_EOS or error code if < 0 */ PN_EXTERN ssize_t pn_transport_capacity(pn_transport_t *transport); /** * Get the transport's tail pointer. * * The amount of free space following this pointer is reported by * ::pn_transport_capacity. Calls to ::pn_transport_process may alter * the value of this pointer. See ::pn_transport_process for details. * * @param[in] transport the transport * @return a pointer to the transport's input buffer, NULL if no capacity available. */ PN_EXTERN char *pn_transport_tail(pn_transport_t *transport); /** * Pushes the supplied bytes into the tail of the transport. * * This is equivalent to copying @c size bytes after the tail pointer * and then calling ::pn_transport_process with an argument of @c * size. Only some of the bytes will be copied if there is * insufficient capacity available. Use ::pn_transport_capacity to * determine how much capacity the transport has. * * @param[in] transport the transport * @param[in] src the start of the data to push into the transport * @param[in] size the amount of data to push into the transport * * @return the number of bytes pushed on success, or error code if < 0 */ PN_EXTERN ssize_t pn_transport_push(pn_transport_t *transport, const char *src, size_t size); /** * Process input data following the tail pointer. * * Calling this function will cause the transport to consume @c size * bytes of input occupying the free space following the tail pointer. * Calls to this function may change the value of ::pn_transport_tail, * as well as the amount of free space reported by * ::pn_transport_capacity. * * @param[in] transport the transport * @param[in] size the amount of data written to the transport's input buffer * @return 0 on success, or error code if < 0 */ PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size); /** * Indicate that the input has reached End Of Stream (EOS). * * This tells the transport that no more input will be forthcoming. * * @param[in] transport the transport * @return 0 on success, or error code if < 0 */ PN_EXTERN int pn_transport_close_tail(pn_transport_t *transport); /** * Get the number of pending output bytes following the transport's * head pointer. * * If the engine is in an exceptional state such as encountering an * error condition or reaching the end of stream state, a negative * value will be returned indicating the condition. If an error is * indicated, further details can be obtained from * ::pn_transport_error. Calls to ::pn_transport_pop may alter the * value of this pointer. See ::pn_transport_pop for details. * * @param[in] transport the transport * @return the number of pending output bytes, or an error code */ PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport); /** * Get the transport's head pointer. * * This pointer references queued output data. The * ::pn_transport_pending function reports how many bytes of output * data follow this pointer. Calls to ::pn_transport_pop may alter * this pointer and any data it references. See ::pn_transport_pop for * details. * * @param[in] transport the transport * @return a pointer to the transport's output buffer, or NULL if no pending output. */ PN_EXTERN const char *pn_transport_head(pn_transport_t *transport); /** * Copies @c size bytes from the head of the transport to the @c dst * pointer. * * It is an error to call this with a value of @c size that is greater * than the value reported by ::pn_transport_pending. * * @param[in] transport the transport * @param[out] dst the destination buffer * @param[in] size the capacity of the destination buffer * @return number of bytes copied on success, or error code if < 0 */ PN_EXTERN ssize_t pn_transport_peek(pn_transport_t *transport, char *dst, size_t size); /** * Removes @c size bytes of output from the pending output queue * following the transport's head pointer. * * Calls to this function may alter the transport's head pointer as * well as the number of pending bytes reported by * ::pn_transport_pending. * * @param[in] transport the transport * @param[in] size the number of bytes to remove */ PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size); /** * Indicate that the output has closed. * * This tells the transport that no more output will be popped. * * @param[in] transport the transport * @return 0 on success, or error code if < 0 */ PN_EXTERN int pn_transport_close_head(pn_transport_t *transport); /** * Check if a transport has buffered data. * * @param[in] transport a transport object * @return true if the transport has buffered data, false otherwise */ PN_EXTERN bool pn_transport_quiesced(pn_transport_t *transport); /** * True if pn_transport_close_head() has been called. */ PN_EXTERN bool pn_transport_head_closed(pn_transport_t *transport); /** * True if pn_transport_close_tail() has been called. */ PN_EXTERN bool pn_transport_tail_closed(pn_transport_t *transport); /** * Equivalent to pn_transport_head_closed(transport) && pn_transport_tail_closed(transport) */ PN_EXTERN bool pn_transport_closed(pn_transport_t *transport); /** * Process any pending transport timer events. * * This method should be called after all pending input has been * processed by the transport (see ::pn_transport_input), and before * generating output (see ::pn_transport_output). It returns the * deadline for the next pending timer event, if any are present. * * @param[in] transport the transport to process. * @param[in] now the current time * * @return if non-zero, then the expiration time of the next pending timer event for the * transport. The caller must invoke pn_transport_tick again at least once at or before * this deadline occurs. */ PN_EXTERN pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now); /** * Get the number of frames output by a transport. * * @param[in] transport a transport object * @return the number of frames output by the transport */ PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport); /** * Get the number of frames input by a transport. * * @param[in] transport a transport object * @return the number of frames input by the transport */ PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport); /** * Access the AMQP Connection associated with the transport. * * @param[in] transport a transport object * @return the connection context for the transport, or NULL if * none */ PN_EXTERN pn_connection_t *pn_transport_connection(pn_transport_t *transport); #ifdef __cplusplus } #endif /** * @} */ #endif /* transport.h */ qpid-proton-0.22.0/proton-c/include/proton/terminus.h0000664000000000000000000002421213257152177017476 0ustar #ifndef PROTON_TERMINUS_H #define PROTON_TERMINUS_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief terminus * * @addtogroup terminus * @{ */ /** * Encapsulates the endpoint state associated with an AMQP Terminus. * * An AMQP Terminus acts as either a source or target for messages, * but never both. Every AMQP link is associated with both a source * terminus and a target terminus that is negotiated during link * establishment. A terminus consists of an AMQP address, along with a * number of other properties defining the quality of service and * behaviour of the link. */ typedef struct pn_terminus_t pn_terminus_t; /** * Type of an AMQP terminus. */ typedef enum { PN_UNSPECIFIED = 0, /**< indicates a nonexistent terminus, may used as a source or target */ PN_SOURCE = 1, /**< indicates a source of messages */ PN_TARGET = 2, /**< indicates a target for messages */ PN_COORDINATOR = 3 /**< a special target identifying a transaction coordinator */ } pn_terminus_type_t; /** * Durability mode of an AMQP terminus. * * An AMQP terminus may provide durable storage for its state, thereby * permitting link recovery in the event of endpoint failures. This * durability may be applied to the configuration of the terminus * only, or to all delivery state as well. */ typedef enum { PN_NONDURABLE = 0, /**< indicates a non durable terminus */ PN_CONFIGURATION = 1, /**< indicates a terminus with durably held configuration, but not delivery state */ PN_DELIVERIES = 2 /**< indicates a terminus with both durably held configuration and durably held delivery state. */ } pn_durability_t; /** * Expiry policy of an AMQP terminus. * * An orphaned terminus can only exist for the timeout configured by * ::pn_terminus_set_timeout. The expiry policy determines when a * terminus is considered orphaned, i.e. when the expiry timer starts * counting down. */ typedef enum { PN_EXPIRE_WITH_LINK, /**< the terminus is orphaned when the parent link is closed */ PN_EXPIRE_WITH_SESSION, /**< the terminus is orphaned when the parent session is closed */ PN_EXPIRE_WITH_CONNECTION, /**< the terminus is orphaned when the parent connection is closed */ PN_EXPIRE_NEVER /**< the terminus is never considered orphaned */ } pn_expiry_policy_t; /** * Distribution mode of an AMQP terminus. * * The distribution mode of a source terminus defines the behaviour * when multiple receiving links provide addresses that resolve to the * same node. */ typedef enum { PN_DIST_MODE_UNSPECIFIED = 0, /**< the behaviour is defined by the node */ PN_DIST_MODE_COPY = 1, /**< the receiver gets all messages */ PN_DIST_MODE_MOVE = 2 /**< the receiver competes for messages */ } pn_distribution_mode_t; /** * Get the type of a terminus object. * * @param[in] terminus a terminus object * @return the terminus type */ PN_EXTERN pn_terminus_type_t pn_terminus_get_type(pn_terminus_t *terminus); /** * Set the type of a terminus object. * * @param[in] terminus a terminus object * @param[in] type the terminus type * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_type(pn_terminus_t *terminus, pn_terminus_type_t type); /** * Get the address of a terminus object. * * The pointer returned by this operation is valid until * ::pn_terminus_set_address is called or until the terminus is freed * due to its parent link being freed. * * @param[in] terminus a terminus object * @return a pointer to the address */ PN_EXTERN const char *pn_terminus_get_address(pn_terminus_t *terminus); /** * Set the address of a terminus object. * * @param[in] terminus a terminus object * @param[in] address an AMQP address string * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_address(pn_terminus_t *terminus, const char *address); /** * Get the distribution mode of a terminus object. * * @param[in] terminus a terminus object * @return the distribution mode of the terminus */ PN_EXTERN pn_distribution_mode_t pn_terminus_get_distribution_mode(const pn_terminus_t *terminus); /** * Set the distribution mode of a terminus object. * * @param[in] terminus a terminus object * @param[in] mode the distribution mode for the terminus * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_distribution_mode(pn_terminus_t *terminus, pn_distribution_mode_t mode); /** * Get the durability mode of a terminus object. * * @param[in] terminus a terminus object * @return the terminus durability mode */ PN_EXTERN pn_durability_t pn_terminus_get_durability(pn_terminus_t *terminus); /** * Set the durability mode of a terminus object. * * @param[in] terminus a terminus object * @param[in] durability the terminus durability mode * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_durability(pn_terminus_t *terminus, pn_durability_t durability); /** * Get the expiry policy of a terminus object. * * @param[in] terminus a terminus object * @return the expiry policy of the terminus */ PN_EXTERN pn_expiry_policy_t pn_terminus_get_expiry_policy(pn_terminus_t *terminus); /** * Set the expiry policy of a terminus object. * * @param[in] terminus a terminus object * @param[in] policy the expiry policy for the terminus * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_expiry_policy(pn_terminus_t *terminus, pn_expiry_policy_t policy); /** * Get the timeout of a terminus object. * * @param[in] terminus a terminus object * @return the timeout of the terminus */ PN_EXTERN pn_seconds_t pn_terminus_get_timeout(pn_terminus_t *terminus); /** * Set the timeout of a terminus object. * * @param[in] terminus a terminus object * @param[in] timeout the timeout for the terminus * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_timeout(pn_terminus_t *terminus, pn_seconds_t timeout); /** * Get the dynamic flag for a terminus object. * * @param[in] terminus a terminus object * @return true if the dynamic flag is set for the terminus, false otherwise */ PN_EXTERN bool pn_terminus_is_dynamic(pn_terminus_t *terminus); /** * Set the dynamic flag for a terminus object. * * @param[in] terminus a terminus object * @param[in] dynamic the dynamic flag for the terminus * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic); /** * Access/modify the AMQP properties data for a terminus object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the terminus object is freed due to its parent link * being freed. Any data contained by the ::pn_data_t object will be * sent as the AMQP properties for the parent terminus object. Note * that this MUST take the form of a symbol keyed map to be valid. * * @param[in] terminus a terminus object * @return a pointer to a pn_data_t representing the terminus properties */ PN_EXTERN pn_data_t *pn_terminus_properties(pn_terminus_t *terminus); /** * Access/modify the AMQP capabilities data for a terminus object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the terminus object is freed due to its parent link * being freed. Any data contained by the ::pn_data_t object will be * sent as the AMQP capabilities for the parent terminus object. Note * that this MUST take the form of an array of symbols to be valid. * * @param[in] terminus a terminus object * @return a pointer to a pn_data_t representing the terminus capabilities */ PN_EXTERN pn_data_t *pn_terminus_capabilities(pn_terminus_t *terminus); /** * Access/modify the AMQP outcomes for a terminus object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the terminus object is freed due to its parent link * being freed. Any data contained by the ::pn_data_t object will be * sent as the AMQP outcomes for the parent terminus object. Note * that this MUST take the form of an array of symbols to be valid. * * @param[in] terminus a terminus object * @return a pointer to a pn_data_t representing the terminus outcomes */ PN_EXTERN pn_data_t *pn_terminus_outcomes(pn_terminus_t *terminus); /** * Access/modify the AMQP filter set for a terminus object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the terminus object is freed due to its parent link * being freed. Any data contained by the ::pn_data_t object will be * sent as the AMQP filter set for the parent terminus object. Note * that this MUST take the form of a symbol keyed map to be valid. * * @param[in] terminus a source terminus object * @return a pointer to a pn_data_t representing the terminus filter set */ PN_EXTERN pn_data_t *pn_terminus_filter(pn_terminus_t *terminus); /** * Copy a terminus object. * * @param[in] terminus the terminus object to be copied into * @param[in] src the terminus to be copied from * @return 0 on success or an error code on failure */ PN_EXTERN int pn_terminus_copy(pn_terminus_t *terminus, pn_terminus_t *src); /** * @} */ #ifdef __cplusplus } #endif #endif /* terminus.h */ qpid-proton-0.22.0/proton-c/include/proton/ssl.h0000664000000000000000000004551313257152177016440 0ustar #ifndef PROTON_SSL_H #define PROTON_SSL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief ssl * * @addtogroup ssl * @{ */ /** * API for using SSL with the Transport Layer. * * A Transport may be configured to use SSL for encryption and/or authentication. A * Transport can be configured as either an "SSL client" or an "SSL server". An SSL * client is the party that proactively establishes a connection to an SSL server. An SSL * server is the party that accepts a connection request from a remote SSL client. * * This SSL implementation defines the following objects: * @li A top-level object that stores the configuration used by one or more SSL * sessions (pn_ssl_domain_t). * @li A per-connection SSL session object that performs the encryption/authentication * associated with the transport (pn_ssl_t). * @li The encryption parameters negotiated for the SSL session (pn_ssl_state_t). * * A pn_ssl_domain_t object must be created and configured before an SSL session can be * established. The pn_ssl_domain_t is used to construct an SSL session (pn_ssl_t). The * session "adopts" its configuration from the pn_ssl_domain_t that was used to create it. * For example, pn_ssl_domain_t can be configured as either a "client" or a "server". SSL * sessions constructed from this domain will perform the corresponding role (either * client or server). * * If either an SSL server or client needs to identify itself with the remote node, it * must have its SSL certificate configured (see ::pn_ssl_domain_set_credentials()). * * If either an SSL server or client needs to verify the identity of the remote node, it * must have its database of trusted CAs configured (see ::pn_ssl_domain_set_trusted_ca_db()). * * An SSL server connection may allow the remote client to connect without SSL (eg. "in * the clear"), see ::pn_ssl_domain_allow_unsecured_client(). * * The level of verification required of the remote may be configured (see * ::pn_ssl_domain_set_peer_authentication) * * Support for SSL Client Session resume is provided (see ::pn_ssl_init, * ::pn_ssl_resume_status). */ typedef struct pn_ssl_domain_t pn_ssl_domain_t; /** * @see pn_ssl */ typedef struct pn_ssl_t pn_ssl_t; /** * Determines the type of SSL endpoint. */ typedef enum { PN_SSL_MODE_CLIENT = 1, /**< Local connection endpoint is an SSL client */ PN_SSL_MODE_SERVER /**< Local connection endpoint is an SSL server */ } pn_ssl_mode_t; /** * Indicates whether an SSL session has been resumed. */ typedef enum { PN_SSL_RESUME_UNKNOWN, /**< Session resume state unknown/not supported */ PN_SSL_RESUME_NEW, /**< Session renegotiated - not resumed */ PN_SSL_RESUME_REUSED /**< Session resumed from previous session. */ } pn_ssl_resume_status_t; /** * Tests for SSL implementation present * * @return true if we support SSL, false if not */ PN_EXTERN bool pn_ssl_present( void ); /** * Create an SSL configuration domain * * This method allocates an SSL domain object. This object is used to hold the SSL * configuration for one or more SSL sessions. The SSL session object (pn_ssl_t) is * allocated from this object. * * @param[in] mode the role, client or server, assumed by all SSL sessions created * with this domain. * @return a pointer to the SSL domain, if SSL support is present. */ PN_EXTERN pn_ssl_domain_t *pn_ssl_domain(pn_ssl_mode_t mode); /** * Release an SSL configuration domain * * This method frees an SSL domain object allocated by ::pn_ssl_domain. * @param[in] domain the domain to destroy. */ PN_EXTERN void pn_ssl_domain_free(pn_ssl_domain_t *domain); /** * Set the certificate that identifies the local node to the remote. * * This certificate establishes the identity for the local node for all SSL sessions * created from this domain. It will be sent to the remote if the remote needs to verify * the identity of this node. This may be used for both SSL servers and SSL clients (if * client authentication is required by the server). * * @note This setting effects only those pn_ssl_t objects created after this call * returns. pn_ssl_t objects created before invoking this method will use the domain's * previous setting. * * @param[in] domain the ssl domain that will use this certificate. * @param[in] credential_1 specifier for the file/database containing the identifying * certificate. For Openssl users, this is a PEM file. For Windows SChannel users, this is * the PKCS#12 file or system store. * @param[in] credential_2 an optional key to access the identifying certificate. For * Openssl users, this is an optional PEM file containing the private key used to sign the * certificate. For Windows SChannel users, this is the friendly name of the * self-identifying certificate if there are multiple certificates in the store. * @param[in] password the password used to sign the key, else NULL if key is not * protected. * @return 0 on success */ PN_EXTERN int pn_ssl_domain_set_credentials(pn_ssl_domain_t *domain, const char *credential_1, const char *credential_2, const char *password); /** * Configure the set of trusted CA certificates used by this domain to verify peers. * * If the local SSL client/server needs to verify the identity of the remote, it must * validate the signature of the remote's certificate. This function sets the database of * trusted CAs that will be used to verify the signature of the remote's certificate. * * @note This setting effects only those pn_ssl_t objects created after this call * returns. pn_ssl_t objects created before invoking this method will use the domain's * previous setting. * * @param[in] domain the ssl domain that will use the database. * @param[in] certificate_db database of trusted CAs, used to authenticate the peer. * @return 0 on success */ PN_EXTERN int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain, const char *certificate_db); /** * Determines the level of peer validation. * * ANONYMOUS_PEER does not require a valid certificate, and permits * use of ciphers that do not provide authentication. * * VERIFY_PEER will only connect to those peers that provide a valid * identifying certificate signed by a trusted CA and are using an * authenticated cipher. * * VERIFY_PEER_NAME is like VERIFY_PEER, but also requires the peer's * identity as contained in the certificate to be valid (see * ::pn_ssl_set_peer_hostname). * * ANONYMOUS_PEER is configured by default. */ typedef enum { PN_SSL_VERIFY_NULL = 0, /**< internal use only */ PN_SSL_VERIFY_PEER, /**< require peer to provide a valid identifying certificate */ PN_SSL_ANONYMOUS_PEER, /**< do not require a certificate nor cipher authorization */ PN_SSL_VERIFY_PEER_NAME /**< require valid certificate and matching name */ } pn_ssl_verify_mode_t; /** * Configure the level of verification used on the peer certificate. * * This method controls how the peer's certificate is validated, if at all. By default, * neither servers nor clients attempt to verify their peers (PN_SSL_ANONYMOUS_PEER). * Once certificates and trusted CAs are configured, peer verification can be enabled. * * @note In order to verify a peer, a trusted CA must be configured. See * ::pn_ssl_domain_set_trusted_ca_db(). * * @note Servers must provide their own certificate when verifying a peer. See * ::pn_ssl_domain_set_credentials(). * * @note This setting effects only those pn_ssl_t objects created after this call * returns. pn_ssl_t objects created before invoking this method will use the domain's * previous setting. * * @param[in] domain the ssl domain to configure. * @param[in] mode the level of validation to apply to the peer * @param[in] trusted_CAs path to a database of trusted CAs that the server will advertise * to the peer client if the server has been configured to verify its peer. * @return 0 on success */ PN_EXTERN int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_ssl_verify_mode_t mode, const char *trusted_CAs); /** * Configure the list of permitted TLS protocols * * @param[in] domain the ssl domain to configure. * @param[in] protocols string representing the protocol list. * This list is a space separated string of the allowed TLS protocols, * The current possibilities are TLSv1 TLSv1.1 TLSv1.2. None of the earlier SSL * protocols are allowed for security reason. * * @note If this API not called then all the TLS protocols are allowed. The API only acts to * restrict the allowed protocols to the specified set. * @return 0 on success */ PN_EXTERN int pn_ssl_domain_set_protocols(pn_ssl_domain_t *domain, const char *protocols); /** * Configure the list of permitted ciphers * * @note The syntax of the permitted list is undefined and will depend on the * underlying SSL implementation. * * @param[in] domain the ssl domain to configure. * @param[in] ciphers string representing the cipher list * @return 0 on success */ PN_EXTERN int pn_ssl_domain_set_ciphers(pn_ssl_domain_t *domain, const char *ciphers); /** * Permit a server to accept connection requests from non-SSL clients. * * This configures the server to "sniff" the incoming client data stream, and dynamically * determine whether SSL/TLS is being used. This option is disabled by default: only * clients using SSL/TLS are accepted. * * @param[in] domain the domain (server) that will accept the client connections. * @return 0 on success */ PN_EXTERN int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain); /** * Create a new SSL session object associated with a transport. * * A transport must have an SSL object in order to "speak" SSL over its connection. This * method allocates an SSL object associates it with the transport. * * @param[in] transport the transport that will own the new SSL session. * @return a pointer to the SSL object configured for this transport. Returns NULL if * no SSL session is associated with the transport. */ PN_EXTERN pn_ssl_t *pn_ssl(pn_transport_t *transport); /** * Initialize an SSL session. * * This method configures an SSL object using the configuration provided by the given * domain. * * @param[in] ssl the ssl session to configured. * @param[in] domain the ssl domain used to configure the SSL session. * @param[in] session_id if supplied, attempt to resume a previous SSL * session that used the same session_id. If no previous SSL session * is available, a new session will be created using the session_id * and stored for future session restore (see ::::pn_ssl_resume_status). * @return 0 on success, else an error code. */ PN_EXTERN int pn_ssl_init(pn_ssl_t *ssl, pn_ssl_domain_t *domain, const char *session_id); /** * Get the name of the Cipher that is currently in use. * * Gets a text description of the cipher that is currently active, or * returns FALSE if SSL is not active (no cipher). Note that the * cipher in use may change over time due to renegotiation or other * changes to the SSL state. * * @param[in] ssl the ssl client/server to query. * @param[in,out] buffer buffer of size bytes to hold cipher name * @param[in] size maximum number of bytes in buffer. * @return True if cipher name written to buffer, False if no cipher in use. */ PN_EXTERN bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size); /** * Get the SSF (security strength factor) of the Cipher that is currently in use. * * @param[in] ssl the ssl client/server to query. * @return the ssf, note that 0 means no security. */ PN_EXTERN int pn_ssl_get_ssf(pn_ssl_t *ssl); /** * Get the name of the SSL protocol that is currently in use. * * Gets a text description of the SSL protocol that is currently active, or returns FALSE if SSL * is not active. Note that the protocol may change over time due to renegotiation. * * @param[in] ssl the ssl client/server to query. * @param[in,out] buffer buffer of size bytes to hold the version identifier * @param[in] size maximum number of bytes in buffer. * @return True if the version information was written to buffer, False if SSL connection * not ready. */ PN_EXTERN bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size); /** * Check whether the state has been resumed. * * Used for client session resume. When called on an active session, indicates whether * the state has been resumed from a previous session. * * @note This is a best-effort service - there is no guarantee that the remote server will * accept the resumed parameters. The remote server may choose to ignore these * parameters, and request a re-negotiation instead. * * @param[in] ssl the ssl session to check * @return status code indicating whether or not the session has been resumed. */ PN_EXTERN pn_ssl_resume_status_t pn_ssl_resume_status(pn_ssl_t *ssl); /** * Set the expected identity of the remote peer. * * By default, SSL will use the hostname associated with the connection that * the transport is bound to (see ::pn_connection_set_hostname). This method * allows the caller to override that default. * * The hostname is used for two purposes: 1) when set on an SSL client, it is sent to the * server during the handshake (if Server Name Indication is supported), and 2) it is used * to check against the identifying name provided in the peer's certificate. If the * supplied name does not exactly match a SubjectAltName (type DNS name), or the * CommonName entry in the peer's certificate, the peer is considered unauthenticated * (potential imposter), and the SSL connection is aborted. * * @note Verification of the hostname is only done if PN_SSL_VERIFY_PEER_NAME is enabled. * See ::pn_ssl_domain_set_peer_authentication. * * @param[in] ssl the ssl session. * @param[in] hostname the expected identity of the remote. Must conform to the syntax as * given in RFC1034, Section 3.5. * @return 0 on success. */ PN_EXTERN int pn_ssl_set_peer_hostname(pn_ssl_t *ssl, const char *hostname); /** * Access the configured peer identity. * * Return the expected identity of the remote peer, as set by ::pn_ssl_set_peer_hostname. * * @param[in] ssl the ssl session. * @param[out] hostname buffer to hold the null-terminated name string. If null, no string * is written. * @param[in,out] bufsize on input set to the number of octets in hostname. On output, set * to the number of octets needed to hold the value of hostname plus a null byte. Zero if * no hostname set. * @return 0 on success. */ PN_EXTERN int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *hostname, size_t *bufsize); /** * Get the subject from the peers certificate. * * @param[in] ssl the ssl client/server to query. * @return A null terminated string representing the full subject, * which is valid until the ssl object is destroyed. */ PN_EXTERN const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl); /** * Enumeration identifying the sub fields of the subject field in the ssl certificate. */ typedef enum { PN_SSL_CERT_SUBJECT_COUNTRY_NAME, PN_SSL_CERT_SUBJECT_STATE_OR_PROVINCE, PN_SSL_CERT_SUBJECT_CITY_OR_LOCALITY, PN_SSL_CERT_SUBJECT_ORGANIZATION_NAME, PN_SSL_CERT_SUBJECT_ORGANIZATION_UNIT, PN_SSL_CERT_SUBJECT_COMMON_NAME } pn_ssl_cert_subject_subfield; /** * Enumeration identifying hashing algorithm. */ typedef enum { PN_SSL_SHA1, /* Produces hash that is 20 bytes long */ PN_SSL_SHA256, /* Produces hash that is 32 bytes long */ PN_SSL_SHA512, /* Produces hash that is 64 bytes long */ PN_SSL_MD5 /* Produces hash that is 16 bytes long */ } pn_ssl_hash_alg; /** * Get the fingerprint of the certificate. The certificate fingerprint (as displayed in the Fingerprints section when * looking at a certificate with say the Firefox browser) is the hexadecimal hash of the entire certificate. * The fingerprint is not part of the certificate, rather it is computed from the certificate and can be used to uniquely identify a certificate. * @param[in] ssl0 the ssl client/server to query * @param[in] fingerprint char pointer. The certificate fingerprint (in hex format) will be populated in this array. * If sha1 is the digest name, the fingerprint is 41 characters long (40 + 1 '\0' character), 65 characters long for * sha256 and 129 characters long for sha512 and 33 characters for md5. * @param[in] fingerprint_length - Must be at >= 33 for md5, >= 41 for sha1, >= 65 for sha256 and >=129 for sha512. * @param[in] hash_alg the hash algorithm to use. Must be of type pn_ssl_hash_alg (currently supports sha1, sha256, sha512 and md5) * @return error code - Returns 0 on success. Return a value less than zero if there were any errors. Upon execution of this function, * char *fingerprint will contain the appropriate null terminated hex fingerprint */ PN_EXTERN int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg); /** * Returns a char pointer that contains the value of the sub field of the subject field in the ssl certificate. The subject field usually contains the following sub fields - * C = ISO3166 two character country code * ST = state or province * L = Locality; generally means city * O = Organization - Company Name * OU = Organization Unit - division or unit * CN = CommonName * @param[in] ssl0 the ssl client/server to query * @param[in] field The enumeration pn_ssl_cert_subject_subfield representing the required sub field. * @return A null terminated string which contains the requested sub field value which is valid until the ssl object is destroyed. */ PN_EXTERN const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field); /** * @} */ #ifdef __cplusplus } #endif #endif /* ssl.h */ qpid-proton-0.22.0/proton-c/include/proton/session.h0000664000000000000000000002222713257152177017317 0ustar #ifndef PROTON_SESSION_H #define PROTON_SESSION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief session * * @addtogroup session * @{ */ /** * Factory for creating a new session on a given connection object. * * Creates a new session object and adds it to the set of sessions * maintained by the connection object. * * @param[in] connection the connection object * @return a pointer to the new session */ PN_EXTERN pn_session_t *pn_session(pn_connection_t *connection); /** * Free a session object. * * When a session is freed it will no longer be retained by the * connection once any internal references to the session are no * longer needed. Freeing a session will free all links on that * session and settle any deliveries on those links. * * @param[in] session the session object to free (or NULL) */ PN_EXTERN void pn_session_free(pn_session_t *session); /** * **Deprecated** - Use ::pn_session_attachments(). * * Get the application context that is associated with a session * object. * * The application context for a session may be set using * ::pn_session_set_context. * * @param[in] session the session whose context is to be returned. * @return the application context for the session object */ PN_EXTERN void *pn_session_get_context(pn_session_t *session); /** * **Deprecated** - Use ::pn_session_attachments(). * * Set a new application context for a session object. * * The application context for a session object may be retrieved * using ::pn_session_get_context. * * @param[in] session the session object * @param[in] context the application context */ PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context); /** * Get the attachments that are associated with a session object. * * @param[in] session the session whose attachments are to be returned. * @return the attachments for the session object */ PN_EXTERN pn_record_t *pn_session_attachments(pn_session_t *session); /** * Get the endpoint state flags for a session. * * @param[in] session the session object * @return the session's state flags */ PN_EXTERN pn_state_t pn_session_state(pn_session_t *session); /** * **Deprecated** * * Get additional error information associated with the session. * * Whenever a session operation fails (i.e. returns an error code), * additional error details can be obtained using this function. The * error object that is returned may also be used to clear the error * condition. * * The pointer returned by this operation is valid until the * session object is freed. * * @param[in] session the session object * @return the session's error object */ PN_EXTERN pn_error_t *pn_session_error(pn_session_t *session); /** * Get the local condition associated with the session endpoint. * * The ::pn_condition_t object retrieved may be modified prior to * closing the session in order to indicate a particular condition * exists when the session closes. This is normally used to * communicate error conditions to the remote peer, however it may * also be used in non error cases. See ::pn_condition_t for more * details. * * The pointer returned by this operation is valid until the session * object is freed. * * @param[in] session the session object * @return the session's local condition object */ PN_EXTERN pn_condition_t *pn_session_condition(pn_session_t *session); /** * Get the remote condition associated with the session endpoint. * * The ::pn_condition_t object retrieved may be examined in order to * determine whether the remote peer was indicating some sort of * exceptional condition when the remote session endpoint was * closed. The ::pn_condition_t object returned may not be modified. * * The pointer returned by this operation is valid until the * session object is freed. * * @param[in] session the session object * @return the session's remote condition object */ PN_EXTERN pn_condition_t *pn_session_remote_condition(pn_session_t *session); /** * Get the parent connection for a session object. * * This operation retrieves the parent pn_connection_t object that * contains the given pn_session_t object. * * @param[in] session the session object * @return the parent connection object */ PN_EXTERN pn_connection_t *pn_session_connection(pn_session_t *session); /** * Open a session. * * Once this operation has completed, the PN_LOCAL_ACTIVE state flag * will be set. * * @param[in] session the session object */ PN_EXTERN void pn_session_open(pn_session_t *session); /** * Close a session. * * Once this operation has completed, the PN_LOCAL_CLOSED state flag * will be set. This may be called without calling * ::pn_session_open, in this case it is equivalent to calling * ::pn_session_open followed by ::pn_session_close. * * @param[in] session the session object */ PN_EXTERN void pn_session_close(pn_session_t *session); /** * Get the incoming capacity of the session measured in bytes. * * The incoming capacity of a session determines how much incoming * message data the session will buffer. Note that if this value is * less than the negotiated frame size of the transport, it will be * rounded up to one full frame. * * @param[in] session the session object * @return the incoming capacity of the session in bytes */ PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *session); /** * Set the incoming capacity for a session object. * * The incoming capacity of a session determines how much incoming * message data the session will buffer. Note that if this value is * less than the negotiated frame size of the transport, it will be * rounded up to one full frame. * * @param[in] session the session object * @param[in] capacity the incoming capacity for the session */ PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity); /** * Get the outgoing window for a session object. * * @param[in] session the session object * @return the outgoing window for the session */ PN_EXTERN size_t pn_session_get_outgoing_window(pn_session_t *session); /** * Set the outgoing window for a session object. * * @param[in] session the session object * @param[in] window the outgoing window for the session */ PN_EXTERN void pn_session_set_outgoing_window(pn_session_t *session, size_t window); /** * Get the number of outgoing bytes currently buffered by a session. * * @param[in] session the session object * @return the number of outgoing bytes currently buffered */ PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *session); /** * Get the number of incoming bytes currently buffered by a session. * * @param[in] session the session object * @return the number of incoming bytes currently buffered */ PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *session); /** * Retrieve the first session from a given connection that matches the * specified state mask. * * Examines the state of each session owned by the connection, and * returns the first session that matches the given state mask. If * state contains both local and remote flags, then an exact match * against those flags is performed. If state contains only local or * only remote flags, then a match occurs if any of the local or * remote flags are set respectively. * * @param[in] connection to be searched for matching sessions * @param[in] state mask to match * @return the first session owned by the connection that matches the * mask, else NULL if no sessions match */ PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state); /** * Retrieve the next session from a given connection that matches the * specified state mask. * * When used with ::pn_session_head, application can access all * sessions on the connection that match the given state. See * ::pn_session_head for description of match behavior. * * @param[in] session the previous session obtained from * ::pn_session_head or ::pn_session_next * @param[in] state mask to match. * @return the next session owned by the connection that matches the * mask, else NULL if no sessions match */ PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state); /** * @} */ #ifdef __cplusplus } #endif #endif /* session.h */ qpid-proton-0.22.0/proton-c/include/proton/selectable.h0000664000000000000000000002046513257152177017741 0ustar #ifndef PROTON_SELECTABLE_H #define PROTON_SELECTABLE_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @cond INTERNAL */ /** * An iterator for selectables. */ typedef pn_iterator_t pn_selectables_t; /** * A ::pn_socket_t provides an abstract handle to an IO stream. The * pipe version is uni-directional. The network socket version is * bi-directional. Both are non-blocking. * * pn_socket_t handles from pn_pipe() may only be used with * pn_read(), pn_write(), pn_close() and pn_selector_select(). * * pn_socket_t handles from pn_listen(), pn_accept() and * pn_connect() must perform further IO using Proton functions. * Mixing Proton io.h functions with native IO functions on the same * handles will result in undefined behavior. * * pn_socket_t handles may only be used with a single pn_io_t during * their lifetime. */ #if defined(_WIN32) && ! defined(__CYGWIN__) #ifdef _WIN64 typedef unsigned __int64 pn_socket_t; #else typedef unsigned int pn_socket_t; #endif #define PN_INVALID_SOCKET (pn_socket_t)(~0) #else typedef int pn_socket_t; #define PN_INVALID_SOCKET (-1) #endif /** * A selectable object provides an interface that can be used to * incorporate proton's I/O into third party event loops. * * Every selectable is associated with exactly one file descriptor. * Selectables may be interested in three kinds of events, read * events, write events, and timer events. * * When a read, write, or timer event occurs, the selectable must be * notified by calling ::pn_selectable_readable(), * ::pn_selectable_writable(), and ::pn_selectable_expired() as * appropriate. * * Once a selectable reaches a terminal state (see * ::pn_selectable_is_terminal()), it will never be interested in * events of any kind. When this occurs it should be removed from the * external event loop and discarded using ::pn_selectable_free(). */ typedef struct pn_selectable_t pn_selectable_t; /** * Construct a new selectables iterator. * * @return a pointer to a new selectables iterator */ PNX_EXTERN pn_selectables_t *pn_selectables(void); /** * Get the next selectable from an iterator. * * @param[in] selectables a selectable iterator * @return the next selectable from the iterator */ PNX_EXTERN pn_selectable_t *pn_selectables_next(pn_selectables_t *selectables); /** * Free a selectables iterator. * * @param[in] selectables a selectables iterator (or NULL) */ PNX_EXTERN void pn_selectables_free(pn_selectables_t *selectables); PNX_EXTERN pn_selectable_t *pn_selectable(void); PNX_EXTERN void pn_selectable_on_readable(pn_selectable_t *sel, void (*readable)(pn_selectable_t *)); PNX_EXTERN void pn_selectable_on_writable(pn_selectable_t *sel, void (*writable)(pn_selectable_t *)); PNX_EXTERN void pn_selectable_on_expired(pn_selectable_t *sel, void (*expired)(pn_selectable_t *)); PNX_EXTERN void pn_selectable_on_error(pn_selectable_t *sel, void (*error)(pn_selectable_t *)); PNX_EXTERN void pn_selectable_on_release(pn_selectable_t *sel, void (*release)(pn_selectable_t *)); PNX_EXTERN void pn_selectable_on_finalize(pn_selectable_t *sel, void (*finalize)(pn_selectable_t *)); PNX_EXTERN pn_record_t *pn_selectable_attachments(pn_selectable_t *sel); /** * Get the file descriptor associated with a selectable. * * @param[in] selectable a selectable object * @return the file descriptor associated with the selectable */ PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable); /** * Set the file descriptor associated with a selectable. * * @param[in] selectable a selectable object * @param[in] fd the file descriptor */ PNX_EXTERN void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd); /** * Check if a selectable is interested in readable events. * * @param[in] selectable a selectable object * @return true iff the selectable is interested in read events */ PNX_EXTERN bool pn_selectable_is_reading(pn_selectable_t *selectable); PNX_EXTERN void pn_selectable_set_reading(pn_selectable_t *sel, bool reading); /** * Check if a selectable is interested in writable events. * * @param[in] selectable a selectable object * @return true iff the selectable is interested in writable events */ PNX_EXTERN bool pn_selectable_is_writing(pn_selectable_t *selectable); PNX_EXTERN void pn_selectable_set_writing(pn_selectable_t *sel, bool writing); /** * Get the next deadline for a selectable. * * A selectable with a deadline is interested in being notified when * that deadline expires. Zero indicates there is currently no * deadline. * * @param[in] selectable a selectable object * @return the next deadline or zero */ PNX_EXTERN pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable); PNX_EXTERN void pn_selectable_set_deadline(pn_selectable_t *sel, pn_timestamp_t deadline); /** * Notify a selectable that the file descriptor is readable. * * @param[in] selectable a selectable object */ PNX_EXTERN void pn_selectable_readable(pn_selectable_t *selectable); /** * Notify a selectable that the file descriptor is writable. * * @param[in] selectable a selectable object */ PNX_EXTERN void pn_selectable_writable(pn_selectable_t *selectable); /** * Notify a selectable that there is an error on the file descriptor. * * @param[in] selectable a selectable object */ PNX_EXTERN void pn_selectable_error(pn_selectable_t *selectable); /** * Notify a selectable that its deadline has expired. * * @param[in] selectable a selectable object */ PNX_EXTERN void pn_selectable_expired(pn_selectable_t *selectable); /** * Check if a selectable is registered. * * This flag is set via ::pn_selectable_set_registered() and can be * used for tracking whether a given selectable has been registered * with an external event loop. * * @param[in] selectable * @return true if the selectable is registered */ PNX_EXTERN bool pn_selectable_is_registered(pn_selectable_t *selectable); /** * Set the registered flag for a selectable. * * See ::pn_selectable_is_registered() for details. * * @param[in] selectable a selectable object * @param[in] registered the registered flag */ PNX_EXTERN void pn_selectable_set_registered(pn_selectable_t *selectable, bool registered); /** * Check if a selectable is in the terminal state. * * A selectable that is in the terminal state will never be interested * in being notified of events of any kind ever again. Once a * selectable reaches this state it should be removed from any * external I/O loops and freed in order to reclaim any resources * associated with it. * * @param[in] selectable a selectable object * @return true if the selectable is in the terminal state, false otherwise */ PNX_EXTERN bool pn_selectable_is_terminal(pn_selectable_t *selectable); /** * Terminate a selectable. * * @param[in] selectable a selectable object */ PNX_EXTERN void pn_selectable_terminate(pn_selectable_t *selectable); PNX_EXTERN void pn_selectable_release(pn_selectable_t *selectable); /** * Free a selectable object. * * @param[in] selectable a selectable object (or NULL) */ PNX_EXTERN void pn_selectable_free(pn_selectable_t *selectable); /** * Configure a selectable with a set of callbacks that emit readable, * writable, and expired events into the supplied collector. * * @param[in] selectable a selectable object * @param[in] collector a collector object */ PNX_EXTERN void pn_selectable_collect(pn_selectable_t *selectable, pn_collector_t *collector); /** * @endcond */ #ifdef __cplusplus } #endif #endif /* selectable.h */ qpid-proton-0.22.0/proton-c/include/proton/sasl.h0000664000000000000000000001511513257152177016574 0ustar #ifndef PROTON_SASL_H #define PROTON_SASL_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief sasl * * @addtogroup sasl * @{ */ /** * The SASL layer is responsible for establishing an authenticated * and/or encrypted tunnel over which AMQP frames are passed between * peers. The peer acting as the SASL Client must provide * authentication credentials. The peer acting as the SASL Server must * provide authentication against the received credentials. */ typedef struct pn_sasl_t pn_sasl_t; /** * The result of the SASL negotiation. */ typedef enum { PN_SASL_NONE = -1, /** negotiation not completed */ PN_SASL_OK = 0, /** authentication succeeded */ PN_SASL_AUTH = 1, /** failed due to bad credentials */ PN_SASL_SYS = 2, /** failed due to a system error */ PN_SASL_PERM = 3, /** failed due to unrecoverable error */ PN_SASL_TEMP = 4 /** failed due to transient error */ } pn_sasl_outcome_t; /** * Construct an Authentication and Security Layer object. * * This will return the SASL layer object for the supplied transport * object. If there is currently no SASL layer one will be created. * * On the client side of an AMQP connection this will have the effect * of ensuring that the AMQP SASL layer is used for that connection. * * @return an object representing the SASL layer. */ PN_EXTERN pn_sasl_t *pn_sasl(pn_transport_t *transport); /** * Do we support extended SASL negotiation * * Do we support extended SASL negotiation? * All implementations of Proton support ANONYMOUS and EXTERNAL on both * client and server sides and PLAIN on the client side. * * Extended SASL implementations use an external library (Cyrus SASL) * to support other mechanisms beyond these basic ones. * * @return true if we support extended SASL negotiation, false if we only support basic negotiation. */ PN_EXTERN bool pn_sasl_extended(void); /** * Set the outcome of SASL negotiation * * Used by the server to set the result of the negotiation process. * * @todo */ PN_EXTERN void pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome); /** * Retrieve the outcome of SASL negotiation. * * @todo */ PN_EXTERN pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl); /** * Retrieve the authenticated user * * This is usually used at the the server end to find the name of the authenticated user. * On the client it will merely return whatever user was passed in to the * pn_transport_set_user_password() API. * * If pn_sasl_outcome() returns a value other than PN_SASL_OK, then there will be no user to return. * The returned value is only reliable after the PN_TRANSPORT_AUTHENTICATED event has been received. * * @param[in] sasl the sasl layer * * @return * If the SASL layer was not negotiated then 0 is returned * If the ANONYMOUS mechanism is used then the user will be "anonymous" * Otherwise a string containing the user is returned. */ PN_EXTERN const char *pn_sasl_get_user(pn_sasl_t *sasl); /** * Return the selected SASL mechanism * * The returned value is only reliable after the PN_TRANSPORT_AUTHENTICATED event has been received. * * @param[in] sasl the SASL layer * * @return The authentication mechanism selected by the SASL layer */ PN_EXTERN const char *pn_sasl_get_mech(pn_sasl_t *sasl); /** * SASL mechanisms that are to be considered for authentication * * This can be used on either the client or the server to restrict the SASL * mechanisms that may be used to the mechanisms on the list. * * @param[in] sasl the SASL layer * @param[in] mechs space separated list of mechanisms that are allowed for authentication */ PN_EXTERN void pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechs); /** * Boolean to allow use of clear text authentication mechanisms * * By default the SASL layer is configured not to allow mechanisms that disclose * the clear text of the password over an unencrypted AMQP connection. This specifically * will disallow the use of the PLAIN mechanism without using SSL encryption. * * This default is to avoid disclosing password information accidentally over an * insecure network. * * If you actually wish to use a clear text password unencrypted then you can use this * API to set allow_insecure_mechs to true. * * @param[in] sasl the SASL layer * @param[in] insecure set this to true to allow unencrypted PLAIN authentication. * */ PN_EXTERN void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl, bool insecure); /** * Return the current value for allow_insecure_mechs * * @param[in] sasl the SASL layer */ PN_EXTERN bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl); /** * Set the sasl configuration name * * This is used to construct the SASL configuration filename. In the current implementation * it ".conf" is added to the name and the file is looked for in the configuration directory. * * If not set it will default to "proton-server" for a sasl server and "proton-client" * for a client. * * @param[in] sasl the SASL layer * @param[in] name the configuration name */ PN_EXTERN void pn_sasl_config_name(pn_sasl_t *sasl, const char *name); /** * Set the sasl configuration path * * This is used to tell SASL where to look for the configuration file. * In the current implementation it can be a colon separated list of directories. * * The environment variable PN_SASL_CONFIG_PATH can also be used to set this path, * but if both methods are used then this pn_sasl_config_path() will take precedence. * * If not set the underlying implementation default will be used. * for a client. * * @param[in] sasl the SASL layer * @param[in] path the configuration path */ PN_EXTERN void pn_sasl_config_path(pn_sasl_t *sasl, const char *path); /** * @} */ #ifdef __cplusplus } #endif #endif /* sasl.h */ qpid-proton-0.22.0/proton-c/include/proton/sasl-plugin.h0000664000000000000000000001334113257152177020067 0ustar #ifndef PROTON_SASL_PLUGIN_H #define PROTON_SASL_PLUGIN_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #ifdef __cplusplus extern "C" { #endif /** @cond INTERNAL */ /* Internal SASL authenticator interface: These are the entry points to a SASL implementations Free up all data structures allocated by the SASL implementation void free(pn_transport_t *transport); Return space separated list of supported mechanisms (client and server) If the returned string is dynamically allocated by the SASL implemetation it must stay valid until the free entry point is called. const char *list_mechs(pn_transport_t *transport); Initialise for either client or server (can't call both for a given transport/connection): bool init_server(pn_transport_t *transport); bool init_client(pn_transport_t *transport); Writing: void prepare_write(pn_transport_t *transport); Reading: Server side (process server SASL messages): void process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv); void process_response(pn_transport_t *transport, const pn_bytes_t *recv); Client side (process client SASL messages) bool process_mechanisms(pn_transport_t *transport, const char *mechs); void process_challenge(pn_transport_t *transport, const pn_bytes_t *recv); void process_outcome(pn_transport_t *transport); Security layer interface (active after SASL succeeds) bool can_encrypt(pn_transport_t *transport); ssize_t max_encrypt_size(pn_transport_t *transport); ssize_t encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); ssize_t decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); */ typedef struct pnx_sasl_implementation { void (*free)(pn_transport_t *transport); const char* (*list_mechs)(pn_transport_t *transport); bool (*init_server)(pn_transport_t *transport); bool (*init_client)(pn_transport_t *transport); void (*prepare_write)(pn_transport_t *transport); void (*process_init)(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv); void (*process_response)(pn_transport_t *transport, const pn_bytes_t *recv); bool (*process_mechanisms)(pn_transport_t *transport, const char *mechs); void (*process_challenge)(pn_transport_t *transport, const pn_bytes_t *recv); void (*process_outcome)(pn_transport_t *transport); bool (*can_encrypt)(pn_transport_t *transport); ssize_t (*max_encrypt_size)(pn_transport_t *transport); ssize_t (*encode)(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); ssize_t (*decode)(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out); } pnx_sasl_implementation; /* Shared SASL API used by the actual SASL authenticators */ enum pnx_sasl_state { SASL_NONE, SASL_POSTED_INIT, SASL_POSTED_MECHANISMS, SASL_POSTED_RESPONSE, SASL_POSTED_CHALLENGE, SASL_RECVED_OUTCOME_SUCCEED, SASL_RECVED_OUTCOME_FAIL, SASL_POSTED_OUTCOME, SASL_ERROR }; /* APIs used by sasl implementations */ PN_EXTERN void pnx_sasl_logf(pn_transport_t *transport, const char *format, ...); PN_EXTERN void *pnx_sasl_get_context(pn_transport_t *transport); PN_EXTERN void pnx_sasl_set_context(pn_transport_t *transport, void *context); PN_EXTERN bool pnx_sasl_is_client(pn_transport_t *transport); PN_EXTERN bool pnx_sasl_is_included_mech(pn_transport_t *transport, pn_bytes_t s); PN_EXTERN bool pnx_sasl_is_transport_encrypted(pn_transport_t *transport); PN_EXTERN bool pnx_sasl_get_allow_insecure_mechs(pn_transport_t *transport); PN_EXTERN bool pnx_sasl_get_auth_required(pn_transport_t *transport); PN_EXTERN const char *pnx_sasl_get_external_username(pn_transport_t *transport); PN_EXTERN int pnx_sasl_get_external_ssf(pn_transport_t *transport); PN_EXTERN const char *pnx_sasl_get_username(pn_transport_t *transport); PN_EXTERN const char *pnx_sasl_get_password(pn_transport_t *transport); PN_EXTERN void pnx_sasl_clear_password(pn_transport_t *transport); PN_EXTERN const char *pnx_sasl_get_remote_fqdn(pn_transport_t *transport); PN_EXTERN const char *pnx_sasl_get_selected_mechanism(pn_transport_t *transport); PN_EXTERN void pnx_sasl_set_bytes_out(pn_transport_t *transport, pn_bytes_t bytes); PN_EXTERN void pnx_sasl_set_desired_state(pn_transport_t *transport, enum pnx_sasl_state desired_state); PN_EXTERN void pnx_sasl_set_selected_mechanism(pn_transport_t *transport, const char *mechanism); PN_EXTERN void pnx_sasl_set_local_hostname(pn_transport_t * transport, const char * fqdn); PN_EXTERN void pnx_sasl_succeed_authentication(pn_transport_t *transport, const char *username); PN_EXTERN void pnx_sasl_fail_authentication(pn_transport_t *transport); PN_EXTERN void pnx_sasl_set_implementation(pn_transport_t *transport, const pnx_sasl_implementation *impl, void *context); PN_EXTERN void pnx_sasl_set_default_implementation(const pnx_sasl_implementation *impl); /** @endcond */ #ifdef __cplusplus } #endif #endif /* sasl-plugin.h */ qpid-proton-0.22.0/proton-c/include/proton/reactor.h0000664000000000000000000002011013257152177017260 0ustar #ifndef PROTON_REACTOR_H #define PROTON_REACTOR_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @cond INTERNAL */ typedef struct pn_reactor_t pn_reactor_t; typedef struct pn_acceptor_t pn_acceptor_t; typedef struct pn_timer_t pn_timer_t; typedef struct pn_task_t pn_task_t; PNX_EXTERN pn_handler_t *pn_handler(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t)); PNX_EXTERN pn_handler_t *pn_handler_new(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t), size_t size, void (*finalize)(pn_handler_t *)); PNX_EXTERN void pn_handler_free(pn_handler_t *handler); PNX_EXTERN void *pn_handler_mem(pn_handler_t *handler); PNX_EXTERN void pn_handler_add(pn_handler_t *handler, pn_handler_t *child); PNX_EXTERN void pn_handler_clear(pn_handler_t *handler); PNX_EXTERN void pn_handler_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type); PNX_EXTERN pn_reactor_t *pn_reactor(void); PNX_EXTERN pn_record_t *pn_reactor_attachments(pn_reactor_t *reactor); PNX_EXTERN pn_millis_t pn_reactor_get_timeout(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_set_timeout(pn_reactor_t *reactor, pn_millis_t timeout); PNX_EXTERN pn_timestamp_t pn_reactor_mark(pn_reactor_t *reactor); PNX_EXTERN pn_timestamp_t pn_reactor_now(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_yield(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_free(pn_reactor_t *reactor); PNX_EXTERN pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor); PNX_EXTERN pn_handler_t *pn_reactor_get_global_handler(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_set_global_handler(pn_reactor_t *reactor, pn_handler_t *handler); PNX_EXTERN pn_handler_t *pn_reactor_get_handler(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_set_handler(pn_reactor_t *reactor, pn_handler_t *handler); PNX_EXTERN pn_list_t *pn_reactor_children(pn_reactor_t *reactor); PNX_EXTERN pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable); PNX_EXTERN pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port, pn_handler_t *handler); PNX_EXTERN pn_error_t *pn_reactor_error(pn_reactor_t *reactor); /** * Create an outgoing connection that will be managed by the reactor. * * The reactor's pn_iohandler will create a socket connection to the host * once the connection is opened. * * @param[in] reactor the reactor that will own the connection. * @param[in] host the address of the remote host. e.g. "localhost" * @param[in] port the port to connect to. e.g. "5672" * @param[in] handler the handler that will process all events generated by * this connection. * @return a connection object */ PNX_EXTERN pn_connection_t *pn_reactor_connection_to_host(pn_reactor_t *reactor, const char *host, const char *port, pn_handler_t *handler); /** * **Deprecated** - Use ::pn_reactor_connection_to_host(). * * Create an outgoing connection that will be managed by the reactor. * * The host address for the connection must be set via * ::pn_reactor_set_connection_host() prior to opening the connection. * Typically this can be done by the handler when processing the * ::PN_CONNECTION_INIT event. * * @param[in] reactor the reactor that will own the connection. * @param[in] handler the handler that will process all events generated by * this connection. * @return a connection object */ PNX_EXTERN pn_connection_t *pn_reactor_connection(pn_reactor_t *reactor, pn_handler_t *handler); /** * Change the host address used by an outgoing reactor connection. * * The address is used by the reactor's iohandler to create an outgoing socket * connection. This must be set prior to (re)opening the connection. * * @param[in] reactor the reactor that owns the connection. * @param[in] connection the connection created by the reactor. * @param[in] host the network address or DNS name of the host to connect to. * @param[in] port the network port to use. Optional - default is "5672" */ PNX_EXTERN void pn_reactor_set_connection_host(pn_reactor_t *reactor, pn_connection_t *connection, const char *host, const char *port); /** * Retrieve the peer host address for a reactor connection. * * This may be used to retrieve the host address used by the reactor to * establish the outgoing socket connection. In the case of an accepted * connection the returned value is the address of the remote. * * @note Note that the returned address may be in numeric IP format. * * The pointer returned by this operation is valid until either the address is * changed via ::pn_reactor_set_connection_host() or the connection object * is freed. * * @param[in] reactor the reactor that owns the connection. * @param[in] connection the reactor connection * @return a C string containing the address in URL format or NULL if no * address available. ::pn_url_parse() may be used to create a Proton pn_url_t * instance from the returned value. */ PNX_EXTERN const char *pn_reactor_get_connection_address(pn_reactor_t *reactor, pn_connection_t *connection); PNX_EXTERN int pn_reactor_wakeup(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_start(pn_reactor_t *reactor); PNX_EXTERN bool pn_reactor_quiesced(pn_reactor_t *reactor); PNX_EXTERN bool pn_reactor_process(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_stop(pn_reactor_t *reactor); PNX_EXTERN void pn_reactor_run(pn_reactor_t *reactor); PNX_EXTERN pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor, int delay, pn_handler_t *handler); PNX_EXTERN void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain); PNX_EXTERN void pn_acceptor_close(pn_acceptor_t *acceptor); PNX_EXTERN pn_acceptor_t *pn_connection_acceptor(pn_connection_t *connection); PNX_EXTERN pn_timer_t *pn_timer(pn_collector_t *collector); PNX_EXTERN pn_timestamp_t pn_timer_deadline(pn_timer_t *timer); PNX_EXTERN void pn_timer_tick(pn_timer_t *timer, pn_timestamp_t now); PNX_EXTERN pn_task_t *pn_timer_schedule(pn_timer_t *timer, pn_timestamp_t deadline); PNX_EXTERN int pn_timer_tasks(pn_timer_t *timer); PNX_EXTERN pn_record_t *pn_task_attachments(pn_task_t *task); PNX_EXTERN void pn_task_cancel(pn_task_t *task); PNX_EXTERN pn_reactor_t *pn_class_reactor(const pn_class_t *clazz, void *object); PNX_EXTERN pn_reactor_t *pn_object_reactor(void *object); PNX_EXTERN pn_reactor_t *pn_event_reactor(pn_event_t *event); PNX_EXTERN pn_handler_t *pn_record_get_handler(pn_record_t *record); PNX_EXTERN void pn_record_set_handler(pn_record_t *record, pn_handler_t *handler); /** * Get the root handler the current event was dispatched to. */ PNX_EXTERN pn_handler_t *pn_event_root(pn_event_t *event); /** * @endcond */ #ifdef __cplusplus } #endif #endif /* reactor.h */ qpid-proton-0.22.0/proton-c/include/proton/proactor.h0000664000000000000000000003466713257152177017500 0ustar #ifndef PROTON_PROACTOR_H #define PROTON_PROACTOR_H 1 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief proactor * * @addtogroup proactor * @{ * * The proactor associates an abstract AMQP protocol @ref connection * with a concrete IO @ref transport implementation for outgoing and * incoming connections. pn_proactor_wait() returns @ref * proactor_events to application threads for handling. * * The `pn_proactor_*` functions are thread-safe, but to handle @ref * proactor_events you must also use the @ref core APIs, which are * not. @ref core objects associated with different connections can be * used concurrently, but objects associated with a single connection * can only be used from their own thread. * * The proactor *serializes* @ref proactor_events for each connection * - it never returns @ref proactor_events for the same connection * concurrently in different threads. Event-handling code can safely * use any @ref core object obtained from the current event. You can * attach application data to @ref core objects (for example with * pn_connection_attachments()). * * pn_connection_wake() allows any thread to "wake up" a * connection. It causes pn_proactor_wait() to return a @ref * PN_CONNECTION_WAKE event that is serialized with the connection's * other @ref proactor_events. You can use this to implement * communication between different connections, or from non-proactor * threads. * * Serialization and pn_connection_wake() simplify building * applications with a shared thread pool, which serialize work per * connection. Many other variations are possible, but you are * responsible for any additional synchronization needed. */ /** * Size of buffer that can hold the largest connection or listening address. */ #define PN_MAX_ADDR 1060 /** * Format a host:port address string for pn_proactor_connect2() or pn_proactor_listen2() * * @param[out] addr address is copied to this buffer, with trailing '\0' * @param[in] size size of addr buffer * @param[in] host network host name, DNS name or IP address * @param[in] port network service name or decimal port number, e.g. "amqp" or "5672" * @return the length of network address (excluding trailing '\0'), if >= size * then the address was truncated */ PNP_EXTERN int pn_proactor_addr(char *addr, size_t size, const char *host, const char *port); /** * Create a proactor. Must be freed with pn_proactor_free() */ PNP_EXTERN pn_proactor_t *pn_proactor(void); /** * Free the proactor. Abort open connections/listeners, clean up all resources. */ PNP_EXTERN void pn_proactor_free(pn_proactor_t *proactor); /** * Connect @p transport to @p addr and bind to @p connection. * Errors are returned as @ref PN_TRANSPORT_CLOSED events by pn_proactor_wait(). * * @note Thread-safe * * @param[in] proactor the proactor object * * @param[in] connection If NULL a new connection is created. * @p proactor *takes ownership* of @p connection and will * automatically call pn_connection_free() after the final @ref * PN_TRANSPORT_CLOSED event is handled, or when pn_proactor_free() is * called. You can prevent the automatic free with * pn_proactor_release_connection() * * @param[in] transport If NULL a new transport is created. * @p proactor *takes ownership* of @p transport, it will be freed even * if pn_proactor_release_connection() is called. * * @param[in] addr the "host:port" network address, constructed by pn_proactor_addr() * An empty host will connect to the local host via the default protocol (IPV6 or IPV4). * An empty port will connect to the standard AMQP port (5672). * */ PNP_EXTERN void pn_proactor_connect2(pn_proactor_t *proactor, pn_connection_t *connection, pn_transport_t *transport, const char *addr); /** * @deprecated Equivalent to pn_proactor_connect2(proactor, connection, NULL, addr) */ PNP_EXTERN void pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection, const char *addr); /** * Start listening for incoming connections. * * pn_proactor_wait() will return a @ref PN_LISTENER_OPEN event when the * listener is ready to accept connections, or a PN_LISTENER_CLOSE if the listen * operation fails. If the listen failed, pn_listener_condition() will be set. * * When the listener is closed by pn_listener_close(), or because of an error, a * PN_LISTENER_CLOSE event will be returned and pn_listener_condition() will be set * for an error. * * @note Thread-safe * * @param[in] proactor the proactor object * * @param[in] listener @p proactor *takes ownership* of @p listener, and will * automatically call pn_listener_free() after the final PN_LISTENER_CLOSE event * is handled, or when pn_proactor_free() is called. * * @param[in] addr the "host:port" network address, constructed by pn_proactor_addr() * An empty host will listen for all protocols (IPV6 and IPV4) on all local interfaces. * An empty port will listen on the standard AMQP port (5672). * * @param[in] backlog of un-handled connection requests to allow before refusing * connections. If @p addr resolves to multiple interface/protocol combinations, * the backlog applies to each separately. */ PNP_EXTERN void pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener, const char *addr, int backlog); /** * Disconnect all connections and listeners belonging to the proactor. * * @ref PN_LISTENER_CLOSE, @ref PN_TRANSPORT_CLOSED and other @ref proactor_events are * generated as usual. * * A @ref PN_PROACTOR_INACTIVE event will be generated when all connections and * listeners are disconnected and no timeout is pending. The event will also be * generated if there are no listeners, connections or timeout when * pn_proactor_disconnect() is called. * * Creating new connections and listeners after this call and before the * PN_PROACTOR_INACTIVE event may prevent the proactor from becoming inactive. * After the PN_PROACTOR_INACTIVE event, the proactor can be used normally. * * @note Thread-safe * * @param proactor the proactor * * @param condition if not NULL the condition data is copied to each * disconnected transports and listener and is available in the close event. */ PNP_EXTERN void pn_proactor_disconnect(pn_proactor_t *proactor, pn_condition_t *condition); /** * Wait until there are @ref proactor_events to handle. * * You must call pn_proactor_done() when you are finished with the batch, you * must not use the batch pointer after calling pn_proactor_done(). * * Normally it is most efficient to handle the entire batch in the calling * thread and then call pn_proactor_done(), but see pn_proactor_done() for more options. * * pn_proactor_get() is a non-blocking version of this call. * * @note Thread-safe * * @return a non-empty batch of events that must be processed in sequence. * */ PNP_EXTERN pn_event_batch_t *pn_proactor_wait(pn_proactor_t *proactor); /** * Return @ref proactor_events if any are available immediately. If not, return NULL. * If the return value is not NULL, the behavior is the same as pn_proactor_wait() * * @note Thread-safe */ PNP_EXTERN pn_event_batch_t *pn_proactor_get(pn_proactor_t *proactor); /** * Call when finished handling a batch of events. * * Must be called exactly once to match each call to pn_proactor_wait(). * * @note Thread-safe: May be called from any thread provided the exactly once * rule is respected. */ PNP_EXTERN void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events); /** * Return a @ref PN_PROACTOR_INTERRUPT event as soon as possible. * * At least one PN_PROACTOR_INTERRUPT event will be returned after this call. * Interrupts can be "coalesced" - if several pn_proactor_interrupt() calls * happen close together, there may be only one PN_PROACTOR_INTERRUPT event that * occurs after all of them. * * @note Thread-safe and async-signal-safe: can be called in a signal handler. * This is the only pn_proactor function that is async-signal-safe. */ PNP_EXTERN void pn_proactor_interrupt(pn_proactor_t *proactor); /** * Return a @ref PN_PROACTOR_TIMEOUT after @p timeout milliseconds elapse. If no * threads are blocked in pn_proactor_wait() when the timeout elapses, the event * will be delivered to the next available thread. * * Calling pn_proactor_set_timeout() again before the PN_PROACTOR_TIMEOUT * is delivered will cancel the previous timeout and deliver an event only after * the new timeout. * * @note Thread-safe */ PNP_EXTERN void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout); /** * Cancel the pending timeout set by pn_proactor_set_timeout(). Does nothing * if no timeout is set. * * @note Thread-safe */ PNP_EXTERN void pn_proactor_cancel_timeout(pn_proactor_t *proactor); /** * Release ownership of @p connection, disassociate it from its proactor. * * The connection and related objects (@ref session "sessions", @ref link "links" * and so on) remain intact, but the transport is closed and unbound. The * proactor will not return any more events for this connection. The caller must * call pn_connection_free(), either directly or indirectly by re-using @p * connection in another call to pn_proactor_connect2() or pn_proactor_listen2(). * * @note **Not thread-safe**. Call this function from a connection * event handler. * * @note If @p connection does not belong to a proactor, this call does nothing. * * @note This has nothing to do with pn_connection_release(). */ PNP_EXTERN void pn_proactor_release_connection(pn_connection_t *connection); /** * Return a @ref PN_CONNECTION_WAKE event for @p connection as soon as possible. * * At least one wake event will be returned, serialized with other @ref proactor_events * for the same connection. Wakes can be "coalesced" - if several * pn_connection_wake() calls happen close together, there may be only one * PN_CONNECTION_WAKE event that occurs after all of them. * * @note If @p connection does not belong to a proactor, this call does nothing. * * @note Thread-safe */ PNP_EXTERN void pn_connection_wake(pn_connection_t *connection); /** * Return the proactor associated with a connection. * * @note **Not thread-safe** * * @return the proactor or NULL if the connection does not belong to a proactor. */ PNP_EXTERN pn_proactor_t *pn_connection_proactor(pn_connection_t *connection); /** * Return the proactor associated with an event. * * @note **Not thread-safe** * * @return the proactor or NULL if the connection does not belong to a proactor. */ PNP_EXTERN pn_proactor_t *pn_event_proactor(pn_event_t *event); /** * Get the real elapsed time since an arbitrary point in the past in milliseconds. * * This may be used as a portable way to get a process-local timestamp for the * current time. It is monotonically increasing and will never go backwards. * * Note: this is not a suitable value for an AMQP timestamp to be sent as part * of a message. Such a timestamp should use the real time in milliseconds * since the epoch. * * @note Thread-safe */ PNP_EXTERN pn_millis_t pn_proactor_now(void); /** * @} */ /** * pn_proactor_wait() returns a subset of the event types defined by * @ref pn_event_type_t. The PN_REACTOR_\*, PN_SELECTABLE_\*, and * PN_\*_FINAL events are not returned. * * @addtogroup proactor_events * @{ * * Enumeration | Brief description, see @ref pn_event_type_t for more * :-- | :-- * @ref PN_CONNECTION_INIT | @copybrief PN_CONNECTION_INIT * @ref PN_CONNECTION_BOUND | @copybrief PN_CONNECTION_BOUND * @ref PN_TIMER_TASK | @copybrief PN_TIMER_TASK * @ref PN_CONNECTION_INIT | @copybrief PN_CONNECTION_INIT * @ref PN_CONNECTION_BOUND | @copybrief PN_CONNECTION_BOUND * @ref PN_CONNECTION_UNBOUND | @copybrief PN_CONNECTION_UNBOUND * @ref PN_CONNECTION_LOCAL_OPEN | @copybrief PN_CONNECTION_LOCAL_OPEN * @ref PN_CONNECTION_REMOTE_OPEN | @copybrief PN_CONNECTION_REMOTE_OPEN * @ref PN_CONNECTION_LOCAL_CLOSE | @copybrief PN_CONNECTION_LOCAL_CLOSE * @ref PN_CONNECTION_REMOTE_CLOSE | @copybrief PN_CONNECTION_REMOTE_CLOSE * @ref PN_SESSION_INIT | @copybrief PN_SESSION_INIT * @ref PN_SESSION_LOCAL_OPEN | @copybrief PN_SESSION_LOCAL_OPEN * @ref PN_SESSION_REMOTE_OPEN | @copybrief PN_SESSION_REMOTE_OPEN * @ref PN_SESSION_LOCAL_CLOSE | @copybrief PN_SESSION_LOCAL_CLOSE * @ref PN_SESSION_REMOTE_CLOSE | @copybrief PN_SESSION_REMOTE_CLOSE * @ref PN_LINK_INIT | @copybrief PN_LINK_INIT * @ref PN_LINK_LOCAL_OPEN | @copybrief PN_LINK_LOCAL_OPEN * @ref PN_LINK_REMOTE_OPEN | @copybrief PN_LINK_REMOTE_OPEN * @ref PN_LINK_LOCAL_CLOSE | @copybrief PN_LINK_LOCAL_CLOSE * @ref PN_LINK_REMOTE_CLOSE | @copybrief PN_LINK_REMOTE_CLOSE * @ref PN_LINK_LOCAL_DETACH | @copybrief PN_LINK_LOCAL_DETACH * @ref PN_LINK_REMOTE_DETACH | @copybrief PN_LINK_REMOTE_DETACH * @ref PN_LINK_FLOW | @copybrief PN_LINK_FLOW * @ref PN_DELIVERY | @copybrief PN_DELIVERY * @ref PN_TRANSPORT | @copybrief PN_TRANSPORT * @ref PN_TRANSPORT_AUTHENTICATED | @copybrief PN_TRANSPORT_AUTHENTICATED * @ref PN_TRANSPORT_ERROR | @copybrief PN_TRANSPORT_ERROR * @ref PN_TRANSPORT_HEAD_CLOSED | @copybrief PN_TRANSPORT_HEAD_CLOSED * @ref PN_TRANSPORT_TAIL_CLOSED | @copybrief PN_TRANSPORT_TAIL_CLOSED * @ref PN_TRANSPORT_CLOSED | The final event for a proactor connection, the transport is closed. * @ref PN_LISTENER_OPEN | @copybrief PN_LISTENER_OPEN * @ref PN_LISTENER_ACCEPT | @copybrief PN_LISTENER_ACCEPT * @ref PN_LISTENER_CLOSE | @copybrief PN_LISTENER_CLOSE * @ref PN_PROACTOR_INTERRUPT | @copybrief PN_PROACTOR_INTERRUPT * @ref PN_PROACTOR_TIMEOUT | @copybrief PN_PROACTOR_TIMEOUT * @ref PN_PROACTOR_INACTIVE | @copybrief PN_PROACTOR_INACTIVE * @ref PN_CONNECTION_WAKE | @copybrief PN_CONNECTION_WAKE * * @} */ #ifdef __cplusplus } #endif #endif /* proactor.h */ qpid-proton-0.22.0/proton-c/include/proton/object.h0000664000000000000000000004071313257152177017102 0ustar #ifndef PROTON_OBJECT_H #define PROTON_OBJECT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @cond INTERNAL */ typedef const void* pn_handle_t; typedef intptr_t pn_shandle_t; typedef struct pn_class_t pn_class_t; typedef struct pn_string_t pn_string_t; typedef struct pn_list_t pn_list_t; typedef struct pn_map_t pn_map_t; typedef struct pn_hash_t pn_hash_t; typedef void *(*pn_iterator_next_t)(void *state); typedef struct pn_iterator_t pn_iterator_t; typedef struct pn_record_t pn_record_t; struct pn_class_t { const char *name; const pn_cid_t cid; void *(*newinst)(const pn_class_t *, size_t); void (*initialize)(void *); void (*incref)(void *); void (*decref)(void *); int (*refcount)(void *); void (*finalize)(void *); void (*free)(void *); const pn_class_t *(*reify)(void *); uintptr_t (*hashcode)(void *); intptr_t (*compare)(void *, void *); int (*inspect)(void *, pn_string_t *); }; /* Hack alert: Declare these as arrays so we can treat the name of the single object as the address */ PN_EXTERN extern const pn_class_t PN_OBJECT[]; PN_EXTERN extern const pn_class_t PN_VOID[]; PN_EXTERN extern const pn_class_t PN_WEAKREF[]; #define PN_CLASSDEF(PREFIX) \ static void PREFIX ## _initialize_cast(void *object) { \ PREFIX ## _initialize((PREFIX ## _t *) object); \ } \ \ static void PREFIX ## _finalize_cast(void *object) { \ PREFIX ## _finalize((PREFIX ## _t *) object); \ } \ \ static uintptr_t PREFIX ## _hashcode_cast(void *object) { \ uintptr_t (*fp)(PREFIX ## _t *) = PREFIX ## _hashcode; \ if (fp) { \ return fp((PREFIX ## _t *) object); \ } else { \ return (uintptr_t) object; \ } \ } \ \ static intptr_t PREFIX ## _compare_cast(void *a, void *b) { \ intptr_t (*fp)(PREFIX ## _t *, PREFIX ## _t *) = PREFIX ## _compare; \ if (fp) { \ return fp((PREFIX ## _t *) a, (PREFIX ## _t *) b); \ } else { \ return (intptr_t) a - (intptr_t) b; \ } \ } \ \ static int PREFIX ## _inspect_cast(void *object, pn_string_t *str) { \ int (*fp)(PREFIX ## _t *, pn_string_t *) = PREFIX ## _inspect; \ if (fp) { \ return fp((PREFIX ## _t *) object, str); \ } else { \ return pn_string_addf(str, "%s<%p>", #PREFIX, object); \ } \ } \ \ const pn_class_t *PREFIX ## __class(void) { \ static const pn_class_t clazz = { \ #PREFIX, \ CID_ ## PREFIX, \ pn_object_new, \ PREFIX ## _initialize_cast, \ pn_object_incref, \ pn_object_decref, \ pn_object_refcount, \ PREFIX ## _finalize_cast, \ pn_object_free, \ pn_object_reify, \ PREFIX ## _hashcode_cast, \ PREFIX ## _compare_cast, \ PREFIX ## _inspect_cast \ }; \ return &clazz; \ } \ \ PREFIX ## _t *PREFIX ## _new(void) { \ return (PREFIX ## _t *) pn_class_new(PREFIX ## __class(), \ sizeof(PREFIX ## _t)); \ } #define PN_CLASS(PREFIX) { \ #PREFIX, \ CID_ ## PREFIX, \ pn_object_new, \ PREFIX ## _initialize, \ pn_object_incref, \ pn_object_decref, \ pn_object_refcount, \ PREFIX ## _finalize, \ pn_object_free, \ pn_object_reify, \ PREFIX ## _hashcode, \ PREFIX ## _compare, \ PREFIX ## _inspect \ } #define PN_METACLASS(PREFIX) { \ #PREFIX, \ CID_ ## PREFIX, \ PREFIX ## _new, \ PREFIX ## _initialize, \ PREFIX ## _incref, \ PREFIX ## _decref, \ PREFIX ## _refcount, \ PREFIX ## _finalize, \ PREFIX ## _free, \ PREFIX ## _reify, \ PREFIX ## _hashcode, \ PREFIX ## _compare, \ PREFIX ## _inspect \ } /* Class to identify a plain C struct in a pn_event_t. No refcounting or memory management. */ #define PN_STRUCT_CLASSDEF(PREFIX, CID) \ const pn_class_t *PREFIX ## __class(void); \ static const pn_class_t *PREFIX ## _reify(void *p) { return PREFIX ## __class(); } \ const pn_class_t *PREFIX ## __class(void) { \ static const pn_class_t clazz = { \ #PREFIX, \ CID, \ NULL, /*_new*/ \ NULL, /*_initialize*/ \ pn_void_incref, \ pn_void_decref, \ pn_void_refcount, \ NULL, /* _finalize */ \ NULL, /* _free */ \ PREFIX ## _reify, \ pn_void_hashcode, \ pn_void_compare, \ pn_void_inspect \ }; \ return &clazz; \ } PN_EXTERN pn_cid_t pn_class_id(const pn_class_t *clazz); PN_EXTERN const char *pn_class_name(const pn_class_t *clazz); PN_EXTERN void *pn_class_new(const pn_class_t *clazz, size_t size); /* pn_incref, pn_decref and pn_refcount are for internal use by the proton library, the should not be called by application code. Application code should use the appropriate pn_*_free function (pn_link_free, pn_session_free etc.) when it is finished with a proton value. Proton values should only be used when handling a pn_event_t that refers to them. */ PN_EXTERN void *pn_class_incref(const pn_class_t *clazz, void *object); PN_EXTERN int pn_class_refcount(const pn_class_t *clazz, void *object); PN_EXTERN int pn_class_decref(const pn_class_t *clazz, void *object); PN_EXTERN void pn_class_free(const pn_class_t *clazz, void *object); PN_EXTERN const pn_class_t *pn_class_reify(const pn_class_t *clazz, void *object); PN_EXTERN uintptr_t pn_class_hashcode(const pn_class_t *clazz, void *object); PN_EXTERN intptr_t pn_class_compare(const pn_class_t *clazz, void *a, void *b); PN_EXTERN bool pn_class_equals(const pn_class_t *clazz, void *a, void *b); PN_EXTERN int pn_class_inspect(const pn_class_t *clazz, void *object, pn_string_t *dst); PN_EXTERN void *pn_void_new(const pn_class_t *clazz, size_t size); PN_EXTERN void pn_void_incref(void *object); PN_EXTERN void pn_void_decref(void *object); PN_EXTERN int pn_void_refcount(void *object); PN_EXTERN uintptr_t pn_void_hashcode(void *object); PN_EXTERN intptr_t pn_void_compare(void *a, void *b); PN_EXTERN int pn_void_inspect(void *object, pn_string_t *dst); PN_EXTERN void *pn_object_new(const pn_class_t *clazz, size_t size); PN_EXTERN const pn_class_t *pn_object_reify(void *object); PN_EXTERN void pn_object_incref(void *object); PN_EXTERN int pn_object_refcount(void *object); PN_EXTERN void pn_object_decref(void *object); PN_EXTERN void pn_object_free(void *object); PN_EXTERN void *pn_incref(void *object); PN_EXTERN int pn_decref(void *object); PN_EXTERN int pn_refcount(void *object); PN_EXTERN void pn_free(void *object); PN_EXTERN const pn_class_t *pn_class(void* object); PN_EXTERN uintptr_t pn_hashcode(void *object); PN_EXTERN intptr_t pn_compare(void *a, void *b); PN_EXTERN bool pn_equals(void *a, void *b); PN_EXTERN int pn_inspect(void *object, pn_string_t *dst); #define PN_REFCOUNT (0x1) PN_EXTERN pn_list_t *pn_list(const pn_class_t *clazz, size_t capacity); PN_EXTERN size_t pn_list_size(pn_list_t *list); PN_EXTERN void *pn_list_get(pn_list_t *list, int index); PN_EXTERN void pn_list_set(pn_list_t *list, int index, void *value); PN_EXTERN int pn_list_add(pn_list_t *list, void *value); PN_EXTERN void *pn_list_pop(pn_list_t *list); PN_EXTERN ssize_t pn_list_index(pn_list_t *list, void *value); PN_EXTERN bool pn_list_remove(pn_list_t *list, void *value); PN_EXTERN void pn_list_del(pn_list_t *list, int index, int n); PN_EXTERN void pn_list_clear(pn_list_t *list); PN_EXTERN void pn_list_iterator(pn_list_t *list, pn_iterator_t *iter); PN_EXTERN void pn_list_minpush(pn_list_t *list, void *value); PN_EXTERN void *pn_list_minpop(pn_list_t *list); #define PN_REFCOUNT_KEY (0x2) #define PN_REFCOUNT_VALUE (0x4) PN_EXTERN pn_map_t *pn_map(const pn_class_t *key, const pn_class_t *value, size_t capacity, float load_factor); PN_EXTERN size_t pn_map_size(pn_map_t *map); PN_EXTERN int pn_map_put(pn_map_t *map, void *key, void *value); PN_EXTERN void *pn_map_get(pn_map_t *map, void *key); PN_EXTERN void pn_map_del(pn_map_t *map, void *key); PN_EXTERN pn_handle_t pn_map_head(pn_map_t *map); PN_EXTERN pn_handle_t pn_map_next(pn_map_t *map, pn_handle_t entry); PN_EXTERN void *pn_map_key(pn_map_t *map, pn_handle_t entry); PN_EXTERN void *pn_map_value(pn_map_t *map, pn_handle_t entry); PN_EXTERN pn_hash_t *pn_hash(const pn_class_t *clazz, size_t capacity, float load_factor); PN_EXTERN size_t pn_hash_size(pn_hash_t *hash); PN_EXTERN int pn_hash_put(pn_hash_t *hash, uintptr_t key, void *value); PN_EXTERN void *pn_hash_get(pn_hash_t *hash, uintptr_t key); PN_EXTERN void pn_hash_del(pn_hash_t *hash, uintptr_t key); PN_EXTERN pn_handle_t pn_hash_head(pn_hash_t *hash); PN_EXTERN pn_handle_t pn_hash_next(pn_hash_t *hash, pn_handle_t entry); PN_EXTERN uintptr_t pn_hash_key(pn_hash_t *hash, pn_handle_t entry); PN_EXTERN void *pn_hash_value(pn_hash_t *hash, pn_handle_t entry); PN_EXTERN pn_string_t *pn_string(const char *bytes); PN_EXTERN pn_string_t *pn_stringn(const char *bytes, size_t n); PN_EXTERN const char *pn_string_get(pn_string_t *string); PN_EXTERN size_t pn_string_size(pn_string_t *string); PN_EXTERN int pn_string_set(pn_string_t *string, const char *bytes); PN_EXTERN int pn_string_setn(pn_string_t *string, const char *bytes, size_t n); PN_EXTERN ssize_t pn_string_put(pn_string_t *string, char *dst); PN_EXTERN void pn_string_clear(pn_string_t *string); PN_EXTERN int pn_string_format(pn_string_t *string, const char *format, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; PN_EXTERN int pn_string_vformat(pn_string_t *string, const char *format, va_list ap); PN_EXTERN int pn_string_addf(pn_string_t *string, const char *format, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; PN_EXTERN int pn_string_vaddf(pn_string_t *string, const char *format, va_list ap); PN_EXTERN int pn_string_grow(pn_string_t *string, size_t capacity); PN_EXTERN char *pn_string_buffer(pn_string_t *string); PN_EXTERN size_t pn_string_capacity(pn_string_t *string); PN_EXTERN int pn_string_resize(pn_string_t *string, size_t size); PN_EXTERN int pn_string_copy(pn_string_t *string, pn_string_t *src); PN_EXTERN pn_iterator_t *pn_iterator(void); PN_EXTERN void *pn_iterator_start(pn_iterator_t *iterator, pn_iterator_next_t next, size_t size); PN_EXTERN void *pn_iterator_next(pn_iterator_t *iterator); #define PN_LEGCTX ((pn_handle_t) 0) /** PN_HANDLE is a trick to define a unique identifier by using the address of a static variable. You MUST NOT use it in a .h file, since it must be defined uniquely in one compilation unit. Your .h file can provide access to the handle (if needed) via a function. For example: /// my_thing.h pn_handle_t get_my_thing(void); /// my_thing.c PN_HANDLE(MY_THING); pn_handle_t get_my_thing(void) { return MY_THING; } Note that the name "MY_THING" is not exported and is not required to be unique except in the .c file. The linker will guarantee that the *address* of MY_THING, as returned by get_my_thing() *is* unique across the entire linked executable. */ #define PN_HANDLE(name) \ static const char _PN_HANDLE_ ## name = 0; \ static const pn_handle_t name = ((pn_handle_t) &_PN_HANDLE_ ## name); PN_EXTERN pn_record_t *pn_record(void); PN_EXTERN void pn_record_def(pn_record_t *record, pn_handle_t key, const pn_class_t *clazz); PN_EXTERN bool pn_record_has(pn_record_t *record, pn_handle_t key); PN_EXTERN void *pn_record_get(pn_record_t *record, pn_handle_t key); PN_EXTERN void pn_record_set(pn_record_t *record, pn_handle_t key, void *value); PN_EXTERN void pn_record_clear(pn_record_t *record); /** * @endcond */ #ifdef __cplusplus } #endif #endif /* object.h */ qpid-proton-0.22.0/proton-c/include/proton/netaddr.h0000664000000000000000000001004013257152177017243 0ustar #ifndef PROTON_NETADDR_H #define PROTON_NETADDR_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief pn_netaddr_t * * @addtogroup proactor * @{ */ /** * **Unsettled API** - The network address of a proactor transport. */ typedef struct pn_netaddr_t pn_netaddr_t; /** * Format a network address as a human-readable string in `buf`. * * @return the length of the string (excluding trailing '\0'), if >= size then * the address was truncated. */ PNP_EXTERN int pn_netaddr_str(const pn_netaddr_t *addr, char *buf, size_t size); /** * Get the local address of a transport. Return `NULL` if not available. * Pointer is invalid after the transport closes (PN_TRANSPORT_CLOSED event is handled) */ PNP_EXTERN const pn_netaddr_t *pn_transport_local_addr(pn_transport_t *t); /** * Get the local address of a transport. Return `NULL` if not available. * Pointer is invalid after the transport closes (PN_TRANSPORT_CLOSED event is handled) */ PNP_EXTERN const pn_netaddr_t *pn_transport_remote_addr(pn_transport_t *t); /** * Get the listening addresses of a listener. * Addresses are only available after the @ref PN_LISTENER_OPEN event for the listener. * * A listener can have more than one address for several reasons: * - DNS host records may indicate more than one address * - On a multi-homed host, listening on the default host "" will listen on all local addresses. * - Some IPv4/IPV6 configurations may expand a single address into a v4/v6 pair. * * pn_netaddr_next() will iterate over the addresses in the list. * * @param l points to the listener * @return The first listening address or NULL if there are no addresses are available. * Use pn_netaddr_next() to iterate over the list. * Pointer is invalid after the listener closes (PN_LISTENER_CLOSED event is handled) */ PNP_EXTERN const pn_netaddr_t *pn_listener_addr(pn_listener_t *l); /** * @return Pointer to the next address in a list of addresses, NULL if at the end of the list or * if this address is not part of a list. */ PNP_EXTERN const pn_netaddr_t *pn_netaddr_next(const pn_netaddr_t *na); struct sockaddr; /** * On POSIX or Windows, get the underlying `struct sockaddr`. * Return NULL if not available. */ PNP_EXTERN const struct sockaddr *pn_netaddr_sockaddr(const pn_netaddr_t *na); /** * On POSIX or Windows, get the size of the underlying `struct sockaddr`. * Return 0 if not available. */ PNP_EXTERN size_t pn_netaddr_socklen(const pn_netaddr_t *na); /** * Get the host and port name from na as separate strings. * Returns 0 if successful, non-0 on error. */ PNP_EXTERN int pn_netaddr_host_port(const pn_netaddr_t* na, char *host, size_t hlen, char *port, size_t plen); /* These function names will be deprecated in a future release of proton */ /** @deprecated @{ */ /* PN_DEPRECATED("use pn_transport_local_addr") */ PNP_EXTERN const pn_netaddr_t *pn_netaddr_local(pn_transport_t *t); /* PN_DEPRECATED("use pn_transport_remote_addr()") */ PNP_EXTERN const pn_netaddr_t *pn_netaddr_remote(pn_transport_t *t); /* PN_DEPRECATED("use pn_listener_addr()") */ PNP_EXTERN const pn_netaddr_t *pn_netaddr_listening(pn_listener_t *l); /** @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* PROTON_NETADDR_H */ qpid-proton-0.22.0/proton-c/include/proton/messenger.h0000664000000000000000000011121113257152177017614 0ustar #ifndef PROTON_MESSENGER_H #define PROTON_MESSENGER_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief messenger * * @addtogroup messenger * @{ */ /** * A ::pn_messenger_t provides a high level interface for sending and * receiving messages (See ::pn_message_t). * * Every messenger contains a single logical queue of incoming * messages and a single logical queue of outgoing messages. The * messages in these queues may be destined for, or originate from, a * variety of addresses. * * The messenger interface is single-threaded. All methods except one * (::pn_messenger_interrupt()) are intended to be used by one thread * at a time. * * * Address Syntax * ============== * * An address has the following form:: * * [ amqp[s]:// ] [user[:password]@] domain [/[name]] * * Where domain can be one of:: * * host | host:port | ip | ip:port | name * * The following are valid examples of addresses: * * - example.org * - example.org:1234 * - amqp://example.org * - amqps://example.org * - example.org/incoming * - amqps://example.org/outgoing * - amqps://fred:trustno1@example.org * - 127.0.0.1:1234 * - amqps://127.0.0.1:1234 * * Sending & Receiving Messages * ============================ * * The messenger API works in conjunction with the ::pn_message_t API. * A ::pn_message_t is a mutable holder of message content. * * The ::pn_messenger_put() operation copies content from the supplied * ::pn_message_t to the outgoing queue, and may send queued messages * if it can do so without blocking. The ::pn_messenger_send() * operation blocks until it has sent the requested number of * messages, or until a timeout interrupts the attempt. * * * pn_messenger_t *messenger = pn_messenger(NULL); * pn_message_t *message = pn_message(); * char subject[1024]; * for (int i = 0; i < 3; i++) { * pn_message_set_address(message, "amqp://host/queue"); * sprintf(subject, "Hello World! %i", i); * pn_message_set_subject(message, subject); * pn_messenger_put(messenger, message) * pn_messenger_send(messenger); * * Similarly, the ::pn_messenger_recv() method receives messages into * the incoming queue, and may block as it attempts to receive up to * the requested number of messages, or until the timeout is reached. * It may receive fewer than the requested number. The * ::pn_messenger_get() method pops the eldest message off the * incoming queue and copies its content into the supplied * ::pn_message_t object. It will not block. * * * pn_messenger_t *messenger = pn_messenger(NULL); * pn_message_t *message = pn_message() * pn_messenger_recv(messenger): * while (pn_messenger_incoming(messenger) > 0) { * pn_messenger_get(messenger, message); * printf("%s", message.subject); * } * * Output: * Hello World 0 * Hello World 1 * Hello World 2 * * The blocking flag allows you to turn off blocking behavior * entirely, in which case ::pn_messenger_send() and * ::pn_messenger_recv() will do whatever they can without blocking, * and then return. You can then look at the number of incoming and * outgoing messages to see how much outstanding work still remains. * * Authentication Mechanisms * ======================== * * The messenger API authenticates using some specific mechanisms. In prior versions * of Proton the only authentication mechanism available was the PLAIN mechanism * which transports the user's password over the network unencrypted. The Proton versions * 0.10 and newer support other more secure mechanisms which avoid sending the users's * password over the network unencrypted. For backwards compatibility the 0.10 version * of the messenger API will also allow the use of the unencrypted PLAIN mechanism. From the * 0.11 version and onwards you will need to set the flag PN_FLAGS_ALLOW_INSECURE_MECHS to * carry on using the unencrypted PLAIN mechanism. * * The code for this looks like: * * ... * pn_messenger_set_flags(messenger, PN_FLAGS_ALLOW_INSECURE_MECHS); * ... * * Note that the use of the PLAIN mechanism over an SSL connection is allowed as the * password is not sent unencrypted. */ typedef struct pn_messenger_t pn_messenger_t; /** * A subscription is a request for incoming messages. * * @todo currently the subscription API is under developed, this * should allow more explicit control over subscription properties and * behaviour */ typedef struct pn_subscription_t pn_subscription_t; /** * Trackers provide a lightweight handle used to track the status of * incoming and outgoing deliveries. */ typedef int64_t pn_tracker_t; /** * Describes all the possible states for a message associated with a * given tracker. */ typedef enum { PN_STATUS_UNKNOWN = 0, /**< The tracker is unknown. */ PN_STATUS_PENDING = 1, /**< The message is in flight. For outgoing messages, use ::pn_messenger_buffered to see if it has been sent or not. */ PN_STATUS_ACCEPTED = 2, /**< The message was accepted. */ PN_STATUS_REJECTED = 3, /**< The message was rejected. */ PN_STATUS_RELEASED = 4, /**< The message was released. */ PN_STATUS_MODIFIED = 5, /**< The message was modified. */ PN_STATUS_ABORTED = 6, /**< The message was aborted. */ PN_STATUS_SETTLED = 7 /**< The remote party has settled the message. */ } pn_status_t; /** * Construct a new ::pn_messenger_t with the given name. The name is * global. If a NULL name is supplied, a UUID based name will be * chosen. * * @param[in] name the name of the messenger or NULL * * @return pointer to a new ::pn_messenger_t */ PNX_EXTERN pn_messenger_t *pn_messenger(const char *name); /** * Get the name of a messenger. * * @param[in] messenger a messenger object * @return the name of the messenger */ PNX_EXTERN const char *pn_messenger_name(pn_messenger_t *messenger); /** * Sets the path that will be used to get the certificate that will be * used to identify this messenger to its peers. The validity of the * path is not checked by this function. * * @param[in] messenger the messenger * @param[in] certificate a path to a certificate file * @return an error code of zero if there is no error */ PNX_EXTERN int pn_messenger_set_certificate(pn_messenger_t *messenger, const char *certificate); /** * Get the certificate path. This value may be set by * pn_messenger_set_certificate. The default certificate path is null. * * @param[in] messenger the messenger * @return the certificate file path */ PNX_EXTERN const char *pn_messenger_get_certificate(pn_messenger_t *messenger); /** * Set path to the private key that was used to sign the certificate. * See ::pn_messenger_set_certificate * * @param[in] messenger a messenger object * @param[in] private_key a path to a private key file * @return an error code of zero if there is no error */ PNX_EXTERN int pn_messenger_set_private_key(pn_messenger_t *messenger, const char *private_key); /** * Gets the private key file for a messenger. * * @param[in] messenger a messenger object * @return the messenger's private key file path */ PNX_EXTERN const char *pn_messenger_get_private_key(pn_messenger_t *messenger); /** * Sets the private key password for a messenger. * * @param[in] messenger a messenger object * @param[in] password the password for the private key file * * @return an error code of zero if there is no error */ PNX_EXTERN int pn_messenger_set_password(pn_messenger_t *messenger, const char *password); /** * Gets the private key file password for a messenger. * * @param[in] messenger a messenger object * @return password for the private key file */ PNX_EXTERN const char *pn_messenger_get_password(pn_messenger_t *messenger); /** * Sets the trusted certificates database for a messenger. * * The messenger will use this database to validate the certificate * provided by the peer. * * @param[in] messenger a messenger object * @param[in] cert_db a path to the certificates database * * @return an error code of zero if there is no error */ PNX_EXTERN int pn_messenger_set_trusted_certificates(pn_messenger_t *messenger, const char *cert_db); /** * Gets the trusted certificates database for a messenger. * * @param[in] messenger a messenger object * @return path to the trusted certificates database */ PNX_EXTERN const char *pn_messenger_get_trusted_certificates(pn_messenger_t *messenger); /** * Set the default timeout for a messenger. * * Any messenger call that blocks during execution will stop blocking * and return control when this timeout is reached, if you have set it * to a value greater than zero. The timeout is expressed in * milliseconds. * * @param[in] messenger a messenger object * @param[in] timeout a new timeout for the messenger, in milliseconds * @return an error code or zero if there is no error */ PNX_EXTERN int pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout); /** * Gets the timeout for a messenger object. * * See ::pn_messenger_set_timeout() for details. * * @param[in] messenger a messenger object * @return the timeout for the messenger, in milliseconds */ PNX_EXTERN int pn_messenger_get_timeout(pn_messenger_t *messenger); /** * Check if a messenger is in blocking mode. * * @param[in] messenger a messenger object * @return true if blocking has been enabled, false otherwise */ PNX_EXTERN bool pn_messenger_is_blocking(pn_messenger_t *messenger); /** * Enable or disable blocking behavior for a messenger during calls to * ::pn_messenger_send and ::pn_messenger_recv. * * @param[in] messenger a messenger object * @param[in] blocking the value of the blocking flag * @return an error code or zero if there is no error */ PNX_EXTERN int pn_messenger_set_blocking(pn_messenger_t *messenger, bool blocking); /** * Check if a messenger is in passive mode. * * A messenger that is in passive mode will never attempt to perform * I/O internally, but instead will make all internal file descriptors * accessible through ::pn_messenger_selectable() to be serviced * externally. This can be useful for integrating messenger into an * external event loop. * * @param[in] messenger a messenger object * @return true if the messenger is in passive mode, false otherwise */ PNX_EXTERN bool pn_messenger_is_passive(pn_messenger_t *messenger); /** * Set the passive mode for a messenger. * * See ::pn_messenger_is_passive() for details on passive mode. * * @param[in] messenger a messenger object * @param[in] passive true to enable passive mode, false to disable * passive mode * @return an error code or zero on success */ PNX_EXTERN int pn_messenger_set_passive(pn_messenger_t *messenger, bool passive); /** Frees a Messenger. * * @param[in] messenger the messenger to free (or NULL), no longer * valid on return */ PNX_EXTERN void pn_messenger_free(pn_messenger_t *messenger); /** * Get the code for a messenger's most recent error. * * The error code is initialized to zero at messenger creation. The * error number is "sticky" i.e. error codes are not reset to 0 at the * end of successful API calls. You can use ::pn_messenger_error to * access the messenger's error object and clear explicitly if * desired. * * @param[in] messenger the messenger to check for errors * @return an error code or zero if there is no error * @see error.h */ PNX_EXTERN int pn_messenger_errno(pn_messenger_t *messenger); /** * Get a messenger's error object. * * Returns a pointer to a pn_error_t that is valid until the messenger * is freed. The pn_error_* API allows you to access the text, error * number, and lets you set or clear the error code explicitly. * * @param[in] messenger the messenger to check for errors * @return a pointer to the messenger's error descriptor * @see error.h */ PNX_EXTERN pn_error_t *pn_messenger_error(pn_messenger_t *messenger); /** * Get the size of a messenger's outgoing window. * * The size of the outgoing window limits the number of messages whose * status you can check with a tracker. A message enters this window * when you call pn_messenger_put on the message. For example, if your * outgoing window size is 10, and you call pn_messenger_put 12 times, * new status information will no longer be available for the first 2 * messages. * * The default outgoing window size is 0. * * @param[in] messenger a messenger object * @return the outgoing window for the messenger */ PNX_EXTERN int pn_messenger_get_outgoing_window(pn_messenger_t *messenger); /** * Set the size of a messenger's outgoing window. * * See ::pn_messenger_get_outgoing_window() for details. * * @param[in] messenger a messenger object * @param[in] window the number of deliveries to track * @return an error or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_set_outgoing_window(pn_messenger_t *messenger, int window); /** * Get the size of a messenger's incoming window. * * The size of a messenger's incoming window limits the number of * messages that can be accepted or rejected using trackers. Messages * *do not* enter this window when they have been received * (::pn_messenger_recv) onto you incoming queue. Messages only enter * this window only when you access them using pn_messenger_get. If * your incoming window size is N, and you get N+1 messages without * explicitly accepting or rejecting the oldest message, then it will * be implicitly accepted when it falls off the edge of the incoming * window. * * The default incoming window size is 0. * * @param[in] messenger a messenger object * @return the incoming window for the messenger */ PNX_EXTERN int pn_messenger_get_incoming_window(pn_messenger_t *messenger); /** * Set the size of a messenger's incoming window. * * See ::pn_messenger_get_incoming_window() for details. * * @param[in] messenger a messenger object * @param[in] window the number of deliveries to track * @return an error or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_set_incoming_window(pn_messenger_t *messenger, int window); /** * Currently a no-op placeholder. For future compatibility, do not * send or receive messages before starting the messenger. * * @param[in] messenger the messenger to start * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_start(pn_messenger_t *messenger); /** * Stops a messenger. * * Stopping a messenger will perform an orderly shutdown of all * underlying connections. This may require some time. If the * messenger is in non blocking mode (see ::pn_messenger_is_blocking), * this operation will return PN_INPROGRESS if it cannot finish * immediately. In that case, you can use ::pn_messenger_stopped() to * determine when the messenger has finished stopping. * * @param[in] messenger the messenger to stop * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_stop(pn_messenger_t *messenger); /** * Returns true if a messenger is in the stopped state. This function * does not block. * * @param[in] messenger the messenger to stop * */ PNX_EXTERN bool pn_messenger_stopped(pn_messenger_t *messenger); /** * Subscribes a messenger to messages from the specified source. * * @param[in] messenger the messenger to subscribe * @param[in] source * @return a subscription */ PNX_EXTERN pn_subscription_t *pn_messenger_subscribe(pn_messenger_t *messenger, const char *source); /** * Subscribes a messenger to messages from the specified source with the given * timeout for the subscription's lifetime. * * @param[in] messenger the messenger to subscribe * @param[in] source * @param[in] timeout the maximum time to keep the subscription alive once the * link is closed. * @return a subscription */ PNX_EXTERN pn_subscription_t * pn_messenger_subscribe_ttl(pn_messenger_t *messenger, const char *source, pn_seconds_t timeout); /** * Get a link based on link name and whether the link is a sender or receiver * * @param[in] messenger the messenger to get the link from * @param[in] address the link address that identifies the link to receive * @param[in] sender true if the link is a sender, false if the link is a * receiver * @return a link, or NULL if no link matches the address / sender parameters */ PNX_EXTERN pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger, const char *address, bool sender); /** * Get a subscription's application context. * * See ::pn_subscription_set_context(). * * @param[in] sub a subscription object * @return the subscription's application context */ PNX_EXTERN void *pn_subscription_get_context(pn_subscription_t *sub); /** * Set an application context for a subscription. * * @param[in] sub a subscription object * @param[in] context the application context for the subscription */ PNX_EXTERN void pn_subscription_set_context(pn_subscription_t *sub, void *context); /** * Get the source address of a subscription. * * @param[in] sub a subscription object * @return the subscription's source address */ PNX_EXTERN const char *pn_subscription_address(pn_subscription_t *sub); /** * Puts a message onto the messenger's outgoing queue. The message may * also be sent if transmission would not cause blocking. This call * will not block. * * @param[in] messenger a messenger object * @param[in] msg a message to put on the messenger's outgoing queue * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg); /** * Track the status of a delivery. * * Get the current status of the delivery associated with the supplied * tracker. This may return PN_STATUS_UNKOWN if the tracker has fallen * outside the incoming/outgoing tracking windows of the messenger. * * @param[in] messenger the messenger * @param[in] tracker the tracker identifying the delivery * @return a status code for the delivery */ PNX_EXTERN pn_status_t pn_messenger_status(pn_messenger_t *messenger, pn_tracker_t tracker); /** * Get delivery information about a delivery. * * Returns the delivery information associated with the supplied tracker. * This may return NULL if the tracker has fallen outside the * incoming/outgoing tracking windows of the messenger. * * @param[in] messenger the messenger * @param[in] tracker the tracker identifying the delivery * @return a pn_delivery_t representing the delivery. */ PNX_EXTERN pn_delivery_t *pn_messenger_delivery(pn_messenger_t *messenger, pn_tracker_t tracker); /** * Check if the delivery associated with a given tracker is still * waiting to be sent. * * Note that returning false does not imply that the delivery was * actually sent over the wire. * * @param[in] messenger the messenger * @param[in] tracker the tracker identifying the delivery * * @return true if the delivery is still buffered */ PNX_EXTERN bool pn_messenger_buffered(pn_messenger_t *messenger, pn_tracker_t tracker); /** * Frees a Messenger from tracking the status associated with a given * tracker. Use the PN_CUMULATIVE flag to indicate everything up to * (and including) the given tracker. * * @param[in] messenger the Messenger * @param[in] tracker identifies a delivery * @param[in] flags 0 or PN_CUMULATIVE * * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_settle(pn_messenger_t *messenger, pn_tracker_t tracker, int flags); /** * Get a tracker for the outgoing message most recently given to * pn_messenger_put. * * This tracker may be used with pn_messenger_status to determine the * delivery status of the message, as long as the message is still * within your outgoing window. * * @param[in] messenger the messenger * * @return a pn_tracker_t or an undefined value if pn_messenger_get * has never been called for the given messenger */ PNX_EXTERN pn_tracker_t pn_messenger_outgoing_tracker(pn_messenger_t *messenger); /** * Sends or receives any outstanding messages queued for a messenger. * This will block for the indicated timeout. * * @param[in] messenger the Messenger * @param[in] timeout the maximum time to block in milliseconds, -1 == * forever, 0 == do not block * * @return 0 if no work to do, < 0 if error, or 1 if work was done. */ PNX_EXTERN int pn_messenger_work(pn_messenger_t *messenger, int timeout); /** * Interrupt a messenger object that may be blocking in another * thread. * * The messenger interface is single-threaded. This is the only * messenger function intended to be concurrently called from another * thread. It will interrupt any messenger function which is currently * blocking and cause it to return with a status of ::PN_INTR. * * @param[in] messenger the Messenger to interrupt */ PNX_EXTERN int pn_messenger_interrupt(pn_messenger_t *messenger); /** * Send messages from a messenger's outgoing queue. * * If a messenger is in blocking mode (see * ::pn_messenger_is_blocking()), this operation will block until N * messages have been sent from the outgoing queue. A value of -1 for * N means "all messages in the outgoing queue". See below for a full * definition of what sent from the outgoing queue means. * * Any blocking will end once the messenger's configured timeout (if * any) has been reached. When this happens an error code of * ::PN_TIMEOUT is returned. * * If the messenger is in non blocking mode, this call will return an * error code of ::PN_INPROGRESS if it is unable to send the requested * number of messages without blocking. * * A message is considered to be sent from the outgoing queue when its * status has been fully determined. This does not necessarily mean * the message was successfully sent to the final recipient though, * for example of the receiver rejects the message, the final status * will be ::PN_STATUS_REJECTED. Similarly, if a message is sent to an * invalid address, it may be removed from the outgoing queue without * ever even being transmitted. In this case the final status will be * ::PN_STATUS_ABORTED. * * @param[in] messenger a messenger object * @param[in] n the number of messages to send * * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_send(pn_messenger_t *messenger, int n); /** * Retrieve messages into a messenger's incoming queue. * * Instructs a messenger to receive up to @c limit messages into the * incoming message queue of a messenger. If @c limit is -1, the * messenger will receive as many messages as it can buffer * internally. If the messenger is in blocking mode, this call will * block until at least one message is available in the incoming * queue. * * Each call to pn_messenger_recv replaces the previous receive * operation, so pn_messenger_recv(messenger, 0) will cancel any * outstanding receive. * * After receiving messages onto your incoming queue use * ::pn_messenger_get() to access message content. * * @param[in] messenger the messenger * @param[in] limit the maximum number of messages to receive or -1 to * to receive as many messages as it can buffer * internally. * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_recv(pn_messenger_t *messenger, int limit); /** * Get the capacity of the incoming message queue of a messenger. * * Note this count does not include those messages already available * on the incoming queue (@see pn_messenger_incoming()). Rather it * returns the number of incoming queue entries available for * receiving messages. * * @param[in] messenger the messenger */ PNX_EXTERN int pn_messenger_receiving(pn_messenger_t *messenger); /** * Get the next message from the head of a messenger's incoming queue. * * The get operation copies the message data from the head of the * messenger's incoming queue into the provided ::pn_message_t object. * If provided ::pn_message_t pointer is NULL, the head message will be * discarded. This operation will return ::PN_EOS if there are no * messages left on the incoming queue. * * @param[in] messenger a messenger object * @param[out] message upon return contains the message from the head of the queue * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_get(pn_messenger_t *messenger, pn_message_t *message); /** * Get a tracker for the message most recently retrieved by * ::pn_messenger_get(). * * A tracker for an incoming message allows you to accept or reject * the associated message. It can also be used for cumulative * accept/reject operations for the associated message and all prior * messages as well. * * @param[in] messenger a messenger object * @return a pn_tracker_t or an undefined value if pn_messenger_get * has never been called for the given messenger */ PNX_EXTERN pn_tracker_t pn_messenger_incoming_tracker(pn_messenger_t *messenger); /** * Get the subscription of the message most recently retrieved by ::pn_messenger_get(). * * This operation will return NULL if ::pn_messenger_get() has never * been successfully called. * * @param[in] messenger a messenger object * @return a pn_subscription_t or NULL */ PNX_EXTERN pn_subscription_t *pn_messenger_incoming_subscription(pn_messenger_t *messenger); /** * Indicates that an accept or reject should operate cumulatively. */ #define PN_CUMULATIVE (0x1) /** * Signal successful processing of message(s). * * With no flags this operation will signal the sender that the * message referenced by the tracker was accepted. If the * PN_CUMULATIVE flag is set, this operation will also reject all * pending messages prior to the message indicated by the tracker. * * Note that when a message is accepted or rejected multiple times, * either explicitly, or implicitly through use of the ::PN_CUMULATIVE * flag, only the first outcome applies. For example if a sequence of * three messages are received: M1, M2, M3, and M2 is rejected, and M3 * is cumulatively accepted, M2 will remain rejected and only M1 and * M3 will be considered accepted. * * @param[in] messenger a messenger object * @param[in] tracker an incoming tracker * @param[in] flags 0 or PN_CUMULATIVE * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_accept(pn_messenger_t *messenger, pn_tracker_t tracker, int flags); /** * Signal unsuccessful processing of message(s). * * With no flags this operation will signal the sender that the * message indicated by the tracker was rejected. If the PN_CUMULATIVE * flag is used this operation will also reject all pending messages * prior to the message indicated by the tracker. * * Note that when a message is accepted or rejected multiple times, * either explicitly, or implicitly through use of the ::PN_CUMULATIVE * flag, only the first outcome applies. For example if a sequence of * three messages are received: M1, M2, M3, and M2 is accepted, and M3 * is cumulatively rejected, M2 will remain accepted and only M1 and * M3 will be considered rejected. * * @param[in] messenger a messenger object * @param[in] tracker an incoming tracker * @param[in] flags 0 or PN_CUMULATIVE * @return an error code or zero on success * @see error.h */ PNX_EXTERN int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int flags); /** * Get link for the message referenced by the given tracker. * * @param[in] messenger a messenger object * @param[in] tracker a tracker object * @return a pn_link_t or NULL if the link could not be determined. */ PNX_EXTERN pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger, pn_tracker_t tracker); /** * Get the number of messages in the outgoing message queue of a * messenger. * * @param[in] messenger a messenger object * @return the outgoing queue depth */ PNX_EXTERN int pn_messenger_outgoing(pn_messenger_t *messenger); /** * Get the number of messages in the incoming message queue of a messenger. * * @param[in] messenger a messenger object * @return the incoming queue depth */ PNX_EXTERN int pn_messenger_incoming(pn_messenger_t *messenger); //! Adds a routing rule to a Messenger's internal routing table. //! //! The route procedure may be used to influence how a messenger will //! internally treat a given address or class of addresses. Every call //! to the route procedure will result in messenger appending a routing //! rule to its internal routing table. //! //! Whenever a message is presented to a messenger for delivery, it //! will match the address of this message against the set of routing //! rules in order. The first rule to match will be triggered, and //! instead of routing based on the address presented in the message, //! the messenger will route based on the address supplied in the rule. //! //! The pattern matching syntax supports two types of matches, a '%' //! will match any character except a '/', and a '*' will match any //! character including a '/'. //! //! A routing address is specified as a normal AMQP address, however it //! may additionally use substitution variables from the pattern match //! that triggered the rule. //! //! Any message sent to "foo" will be routed to "amqp://foo.com": //! //! pn_messenger_route("foo", "amqp://foo.com"); //! //! Any message sent to "foobar" will be routed to //! "amqp://foo.com/bar": //! //! pn_messenger_route("foobar", "amqp://foo.com/bar"); //! //! Any message sent to bar/<path> will be routed to the corresponding //! path within the amqp://bar.com domain: //! //! pn_messenger_route("bar/*", "amqp://bar.com/$1"); //! //! Route all messages over TLS: //! //! pn_messenger_route("amqp:*", "amqps:$1") //! //! Supply credentials for foo.com: //! //! pn_messenger_route("amqp://foo.com/*", "amqp://user:password@foo.com/$1"); //! //! Supply credentials for all domains: //! //! pn_messenger_route("amqp://*", "amqp://user:password@$1"); //! //! Route all addresses through a single proxy while preserving the //! original destination: //! //! pn_messenger_route("amqp://%/*", "amqp://user:password@proxy/$1/$2"); //! //! Route any address through a single broker: //! //! pn_messenger_route("*", "amqp://user:password@broker/$1"); //! //! @param[in] messenger the Messenger //! @param[in] pattern a glob pattern //! @param[in] address an address indicating alternative routing //! //! @return an error code or zero on success //! @see error.h PNX_EXTERN int pn_messenger_route(pn_messenger_t *messenger, const char *pattern, const char *address); /** * Rewrite message addresses prior to transmission. * * This operation is similar to pn_messenger_route, except that the * destination of the message is determined before the message address * is rewritten. * * The outgoing address is only rewritten after routing has been * finalized. If a message has an outgoing address of * "amqp://0.0.0.0:5678", and a rewriting rule that changes its * outgoing address to "foo", it will still arrive at the peer that * is listening on "amqp://0.0.0.0:5678", but when it arrives there, * the receiver will see its outgoing address as "foo". * * The default rewrite rule removes username and password from * addresses before they are transmitted. * * @param[in] messenger a messenger object * @param[in] pattern a glob pattern to select messages * @param[in] address an address indicating outgoing address rewrite * @return an error code or zero on success */ PNX_EXTERN int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern, const char *address); /** * Extract selectables from a passive messenger. * * A messenger that is in passive mode (see * ::pn_messenger_is_passive()) will never attempt to perform any I/O * internally, but instead make its internal file descriptors * available for external processing via the * ::pn_messenger_selectable() operation. * * An application wishing to perform I/O on behalf of a passive * messenger must extract all available selectables by calling this * operation until it returns NULL. The selectable interface may then * be used by the application to perform I/O outside the messenger. * * All selectables returned by this operation must be serviced until * they reach a terminal state and then freed. See * `pn_selectable_is_terminal()` for more details. * * By default any given selectable will only ever be returned once by * this operation, however if the selectable's registered flag is set * to true (see `pn_selectable_set_registered()`), then the selectable * will be returned whenever its interest set may have changed. * * @param[in] messenger a messenger object * @return the next selectable, or NULL if there are none left */ PNX_EXTERN pn_selectable_t *pn_messenger_selectable(pn_messenger_t *messenger); /** * Get the nearest deadline for selectables associated with a messenger. * * @param[in] messenger a messenger object * @return the nearest deadline */ PNX_EXTERN pn_timestamp_t pn_messenger_deadline(pn_messenger_t *messenger); #define PN_FLAGS_CHECK_ROUTES \ (0x1) /**< Messenger flag to indicate that a call \ to pn_messenger_start should check that \ any defined routes are valid */ #define PN_FLAGS_ALLOW_INSECURE_MECHS \ (0x2) /**< Messenger flag to indicate that the PLAIN \ mechanism is allowed on an unencrypted \ connection */ /** * Sets control flags to enable additional function for the Messenger. * * @param[in] messenger the messenger * @param[in] flags 0 or PN_FLAGS_CHECK_ROUTES * * @return an error code of zero if there is no error */ PNX_EXTERN int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags); /** * Gets the flags for a Messenger. * * @param[in] messenger the messenger * @return The flags set for the messenger */ PNX_EXTERN int pn_messenger_get_flags(pn_messenger_t *messenger); /** * Set the local sender settle mode for the underlying link. * * @param[in] messenger the messenger * @param[in] mode the sender settle mode */ PNX_EXTERN int pn_messenger_set_snd_settle_mode(pn_messenger_t *messenger, const pn_snd_settle_mode_t mode); /** * Set the local receiver settle mode for the underlying link. * * @param[in] messenger the messenger * @param[in] mode the receiver settle mode */ PNX_EXTERN int pn_messenger_set_rcv_settle_mode(pn_messenger_t *messenger, const pn_rcv_settle_mode_t mode); /** * Set the tracer associated with a messenger. * * @param[in] messenger a messenger object * @param[in] tracer the tracer callback */ PNX_EXTERN void pn_messenger_set_tracer(pn_messenger_t *messenger, pn_tracer_t tracer); /** * Gets the remote idle timeout for the specified remote service address * * @param[in] messenger a messenger object * @param[in] address of remote service whose idle timeout is required * @return the timeout in milliseconds or -1 if an error occurs */ PNX_EXTERN pn_millis_t pn_messenger_get_remote_idle_timeout(pn_messenger_t *messenger, const char *address); /** * Sets the SSL peer authentication mode required when a trust * certificate is used. * * @param[in] messenger a messenger object * @param[in] mode the mode required (see pn_ssl_verify_mode_t * enum for valid values) * @return 0 if successful or -1 if an error occurs */ PNX_EXTERN int pn_messenger_set_ssl_peer_authentication_mode(pn_messenger_t *messenger, const pn_ssl_verify_mode_t mode); /** * @} */ #ifdef __cplusplus } #endif #endif /* messenger.h */ qpid-proton-0.22.0/proton-c/include/proton/message.h0000664000000000000000000006116013257152177017257 0ustar #ifndef PROTON_MESSAGE_H #define PROTON_MESSAGE_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief message * * @addtogroup message * @{ */ /** * An AMQP Message object. * * An AMQP Message object is a mutable holder of message content that * may be used to generate and encode or decode and access AMQP * formatted message data. */ typedef struct pn_message_t pn_message_t; /** * Default priority for messages. */ #define PN_DEFAULT_PRIORITY (4) /** * Construct a new ::pn_message_t. * * Every message that is constructed must be freed using * ::pn_message_free(). * * @return pointer to a new ::pn_message_t */ PN_EXTERN pn_message_t * pn_message(void); /** * Free a previously constructed ::pn_message_t. * * @param[in] msg pointer to a ::pn_message_t or NULL */ PN_EXTERN void pn_message_free(pn_message_t *msg); /** * Clears the content of a ::pn_message_t. * * When pn_message_clear returns, the supplied ::pn_message_t will be * emptied of all content and effectively returned to the same state * as if it was just created. * * @param[in] msg pointer to the ::pn_message_t to be cleared */ PN_EXTERN void pn_message_clear(pn_message_t *msg); /** * Access the error code of a message. * * Every operation on a message that can result in an error will set * the message's error code in case of error. The pn_message_errno() * call will access the error code of the most recent failed * operation. * * @param[in] msg a message * @return the message's error code */ PN_EXTERN int pn_message_errno(pn_message_t *msg); /** * Access the error information for a message. * * Every operation on a message that can result in an error will * update the error information held by its error descriptor should * that operation fail. The pn_message_error() call will access the * error information of the most recent failed operation. The pointer * returned by this call is valid until the message is freed. * * @param[in] msg a message * @return the message's error descriptor */ PN_EXTERN pn_error_t *pn_message_error(pn_message_t *msg); /** * Get the inferred flag for a message. * * The inferred flag for a message indicates how the message content * is encoded into AMQP sections. If inferred is true then binary and * list values in the body of the message will be encoded as AMQP DATA * and AMQP SEQUENCE sections, respectively. If inferred is false, * then all values in the body of the message will be encoded as AMQP * VALUE sections regardless of their type. Use * ::pn_message_set_inferred to set the value. * * @param[in] msg a message object * @return the value of the inferred flag for the message */ PN_EXTERN bool pn_message_is_inferred(pn_message_t *msg); /** * Set the inferred flag for a message. * * See ::pn_message_is_inferred() for a description of what the * inferred flag is. * * @param[in] msg a message object * @param[in] inferred the new value of the inferred flag * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_inferred(pn_message_t *msg, bool inferred); /** * Get the durable flag for a message. * * The durable flag indicates that any parties taking responsibility * for the message must durably store the content. * * @param[in] msg a message object * @return the value of the durable flag */ PN_EXTERN bool pn_message_is_durable (pn_message_t *msg); /** * Set the durable flag for a message. * * See ::pn_message_is_durable() for a description of the durable * flag. * * @param[in] msg a message object * @param[in] durable the new value of the durable flag * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_durable (pn_message_t *msg, bool durable); /** * Get the priority for a message. * * The priority of a message impacts ordering guarantees. Within a * given ordered context, higher priority messages may jump ahead of * lower priority messages. * * @param[in] msg a message object * @return the message priority */ PN_EXTERN uint8_t pn_message_get_priority (pn_message_t *msg); /** * Set the priority for a message. * * See ::pn_message_get_priority() for details on message priority. * * @param[in] msg a message object * @param[in] priority the new priority for the message * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_priority (pn_message_t *msg, uint8_t priority); /** * Get the ttl for a message. * * The ttl for a message determines how long a message is considered * live. When a message is held for retransmit, the ttl is * decremented. Once the ttl reaches zero, the message is considered * dead. Once a message is considered dead it may be dropped. Use * ::pn_message_set_ttl() to set the ttl for a message. * * @param[in] msg a message object * @return the ttl in milliseconds */ PN_EXTERN pn_millis_t pn_message_get_ttl (pn_message_t *msg); /** * Set the ttl for a message. * * See ::pn_message_get_ttl() for a detailed description of message ttl. * * @param[in] msg a message object * @param[in] ttl the new value for the message ttl * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_ttl (pn_message_t *msg, pn_millis_t ttl); /** * Get the first acquirer flag for a message. * * When set to true, the first acquirer flag for a message indicates * that the recipient of the message is the first recipient to acquire * the message, i.e. there have been no failed delivery attempts to * other acquirers. Note that this does not mean the message has not * been delivered to, but not acquired, by other recipients. * * @param[in] msg a message object * @return the first acquirer flag for the message */ PN_EXTERN bool pn_message_is_first_acquirer (pn_message_t *msg); /** * Set the first acquirer flag for a message. * * See ::pn_message_is_first_acquirer() for details on the first * acquirer flag. * * @param[in] msg a message object * @param[in] first the new value for the first acquirer flag * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_first_acquirer (pn_message_t *msg, bool first); /** * Get the delivery count for a message. * * The delivery count field tracks how many attempts have been made to * delivery a message. Use ::pn_message_set_delivery_count() to set * the delivery count for a message. * * @param[in] msg a message object * @return the delivery count for the message */ PN_EXTERN uint32_t pn_message_get_delivery_count (pn_message_t *msg); /** * Set the delivery count for a message. * * See ::pn_message_get_delivery_count() for details on what the * delivery count means. * * @param[in] msg a message object * @param[in] count the new delivery count * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_delivery_count (pn_message_t *msg, uint32_t count); /** * Get/set the id for a message. * * The message id provides a globally unique identifier for a message. * A message id can be an a string, an unsigned long, a uuid or a * binary value. This operation returns a pointer to a ::pn_data_t * that can be used to access and/or modify the value of the message * id. The pointer is valid until the message is freed. See * ::pn_data_t for details on how to get/set the value. * * @param[in] msg a message object * @return pointer to a ::pn_data_t holding the id */ PN_EXTERN pn_data_t * pn_message_id (pn_message_t *msg); /** * Get the id for a message. * * The message id provides a globally unique identifier for a message. * A message id can be an a string, an unsigned long, a uuid or a * binary value. This operation returns the value of the id using the * ::pn_atom_t discriminated union. See ::pn_atom_t for details on how * to access the value. * * @param[in] msg a message object * @return the message id */ PN_EXTERN pn_atom_t pn_message_get_id (pn_message_t *msg); /** * Set the id for a message. * * See ::pn_message_get_id() for more details on the meaning of the * message id. Note that only string, unsigned long, uuid, or binary * values are permitted. * * @param[in] msg a message object * @param[in] id the new value of the message id * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_id (pn_message_t *msg, pn_atom_t id); /** * Get the user id for a message. * * The pointer referenced by the ::pn_bytes_t struct will be valid * until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_user_id() * * @param[in] msg a message object * @return a pn_bytes_t referencing the message's user_id */ PN_EXTERN pn_bytes_t pn_message_get_user_id (pn_message_t *msg); /** * Set the user id for a message. * * This operation copies the bytes referenced by the provided * ::pn_bytes_t struct. * * @param[in] msg a message object * @param[in] user_id the new user_id for the message * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_user_id (pn_message_t *msg, pn_bytes_t user_id); /** * Get the address for a message. * * This operation will return NULL if no address has been set or if * the address has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_address() * * @param[in] msg a message object * @return a pointer to the address of the message (or NULL) */ PN_EXTERN const char * pn_message_get_address (pn_message_t *msg); /** * Set the address for a message. * * The supplied address pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the address of the * message is set to NULL. When the pointer is non NULL, the contents * are copied into the message. * * @param[in] msg a message object * @param[in] address a pointer to the new address (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_address (pn_message_t *msg, const char *address); /** * Get the subject for a message. * * This operation will return NULL if no subject has been set or if * the subject has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_subject() * * @param[in] msg a message object * @return a pointer to the subject of the message (or NULL) */ PN_EXTERN const char * pn_message_get_subject (pn_message_t *msg); /** * Set the subject for a message. * * The supplied subject pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the subject is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] subject a pointer to the new subject (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_subject (pn_message_t *msg, const char *subject); /** * Get the reply_to for a message. * * This operation will return NULL if no reply_to has been set or if * the reply_to has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_reply_to() * * @param[in] msg a message object * @return a pointer to the reply_to of the message (or NULL) */ PN_EXTERN const char * pn_message_get_reply_to (pn_message_t *msg); /** * Set the reply_to for a message. * * The supplied reply_to pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the reply_to is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] reply_to a pointer to the new reply_to (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_reply_to (pn_message_t *msg, const char *reply_to); /** * Get/set the correlation id for a message. * * A correlation id can be an a string, an unsigned long, a uuid or a * binary value. This operation returns a pointer to a ::pn_data_t * that can be used to access and/or modify the value of the * correlation id. The pointer is valid until the message is freed. * See ::pn_data_t for details on how to get/set the value. * * @param[in] msg a message object * @return pointer to a ::pn_data_t holding the correlation id */ PN_EXTERN pn_data_t * pn_message_correlation_id (pn_message_t *msg); /** * Get the correlation id for a message. * * A correlation id can be an a string, an unsigned long, a uuid or a * binary value. This operation returns the value of the id using the * ::pn_atom_t discriminated union. See ::pn_atom_t for details on how * to access the value. * * @param[in] msg a message object * @return the message id */ PN_EXTERN pn_atom_t pn_message_get_correlation_id (pn_message_t *msg); /** * Set the correlation id for a message. * * See ::pn_message_get_correlation_id() for more details on the * meaning of the correlation id. Note that only string, unsigned * long, uuid, or binary values are permitted. * * @param[in] msg a message object * @param[in] id the new value of the message id * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_correlation_id (pn_message_t *msg, pn_atom_t id); /** * Get the content_type for a message. * * This operation will return NULL if no content_type has been set or if * the content_type has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_content_type() * * @param[in] msg a message object * @return a pointer to the content_type of the message (or NULL) */ PN_EXTERN const char * pn_message_get_content_type (pn_message_t *msg); /** * Set the content_type for a message. * * The supplied content_type pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the content_type is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] type a pointer to the new content_type (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_content_type (pn_message_t *msg, const char *type); /** * Get the content_encoding for a message. * * This operation will return NULL if no content_encoding has been set or if * the content_encoding has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_content_encoding() * * @param[in] msg a message object * @return a pointer to the content_encoding of the message (or NULL) */ PN_EXTERN const char * pn_message_get_content_encoding (pn_message_t *msg); /** * Set the content_encoding for a message. * * The supplied content_encoding pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the content_encoding is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] encoding a pointer to the new content_encoding (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_content_encoding (pn_message_t *msg, const char *encoding); /** * Get the expiry time for a message. * * A zero value for the expiry time indicates that the message will * never expire. This is the default value. * * @param[in] msg a message object * @return the expiry time for the message */ PN_EXTERN pn_timestamp_t pn_message_get_expiry_time (pn_message_t *msg); /** * Set the expiry time for a message. * * See ::pn_message_get_expiry_time() for more details. * * @param[in] msg a message object * @param[in] time the new expiry time for the message * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_expiry_time (pn_message_t *msg, pn_timestamp_t time); /** * Get the creation time for a message. * * A zero value for the creation time indicates that the creation time * has not been set. This is the default value. * * @param[in] msg a message object * @return the creation time for the message */ PN_EXTERN pn_timestamp_t pn_message_get_creation_time (pn_message_t *msg); /** * Set the creation time for a message. * * See ::pn_message_get_creation_time() for more details. * * @param[in] msg a message object * @param[in] time the new creation time for the message * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_creation_time (pn_message_t *msg, pn_timestamp_t time); /** * Get the group_id for a message. * * This operation will return NULL if no group_id has been set or if * the group_id has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_group_id() * * @param[in] msg a message object * @return a pointer to the group_id of the message (or NULL) */ PN_EXTERN const char * pn_message_get_group_id (pn_message_t *msg); /** * Set the group_id for a message. * * The supplied group_id pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the group_id is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] group_id a pointer to the new group_id (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_group_id (pn_message_t *msg, const char *group_id); /** * Get the group sequence for a message. * * The group sequence of a message identifies the relative ordering of * messages within a group. The default value for the group sequence * of a message is zero. * * @param[in] msg a message object * @return the group sequence for the message */ PN_EXTERN pn_sequence_t pn_message_get_group_sequence (pn_message_t *msg); /** * Set the group sequence for a message. * * See ::pn_message_get_group_sequence() for details on what the group * sequence means. * * @param[in] msg a message object * @param[in] n the new group sequence for the message * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_group_sequence (pn_message_t *msg, pn_sequence_t n); /** * Get the reply_to_group_id for a message. * * This operation will return NULL if no reply_to_group_id has been set or if * the reply_to_group_id has been set to NULL. The pointer returned by this * operation is valid until any one of the following operations occur: * * - ::pn_message_free() * - ::pn_message_clear() * - ::pn_message_set_reply_to_group_id() * * @param[in] msg a message object * @return a pointer to the reply_to_group_id of the message (or NULL) */ PN_EXTERN const char * pn_message_get_reply_to_group_id (pn_message_t *msg); /** * Set the reply_to_group_id for a message. * * The supplied reply_to_group_id pointer must either be NULL or reference a NUL * terminated string. When the pointer is NULL, the reply_to_group_id is set to * NULL. When the pointer is non NULL, the contents are copied into * the message. * * @param[in] msg a message object * @param[in] reply_to_group_id a pointer to the new reply_to_group_id (or NULL) * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_set_reply_to_group_id (pn_message_t *msg, const char *reply_to_group_id); /** * Get/set the delivery instructions for a message. * * This operation returns a pointer to a ::pn_data_t representing the * content of the delivery instructions section of a message. The * pointer is valid until the message is freed and may be used to both * access and modify the content of the delivery instructions section * of a message. * * The ::pn_data_t must either be empty or consist of a symbol keyed * map in order to be considered valid delivery instructions. * * @param[in] msg a message object * @return a pointer to the delivery instructions */ PN_EXTERN pn_data_t *pn_message_instructions(pn_message_t *msg); /** * Get/set the annotations for a message. * * This operation returns a pointer to a ::pn_data_t representing the * content of the annotations section of a message. The pointer is * valid until the message is freed and may be used to both access and * modify the content of the annotations section of a message. * * The ::pn_data_t must either be empty or consist of a symbol keyed * map in order to be considered valid message annotations. * * @param[in] msg a message object * @return a pointer to the message annotations */ PN_EXTERN pn_data_t *pn_message_annotations(pn_message_t *msg); /** * Get and set the properties for a message. * * This operation returns a pointer to a ::pn_data_t representing the * content of the properties section of a message. The pointer is * valid until the message is freed and may be used to both access and * modify the content of the properties section of a message. * * The ::pn_data_t must either be empty or consist of a string keyed * map in order to be considered valid message properties. * * @param[in] msg a message object * @return a pointer to the message properties */ PN_EXTERN pn_data_t *pn_message_properties(pn_message_t *msg); /** * Get and set the body of a message. * * This operation returns a pointer to a ::pn_data_t representing the * body of a message. The pointer is valid until the message is freed * and may be used to both access and modify the content of the * message body. * * @param[in] msg a message object * @return a pointer to the message body */ PN_EXTERN pn_data_t *pn_message_body(pn_message_t *msg); /** * Decode/load message content from AMQP formatted binary data. * * Upon invoking this operation, any existing message content will be * cleared and replaced with the content from the provided binary * data. * * @param[in] msg a message object * @param[in] bytes the start of the encoded AMQP data * @param[in] size the size of the encoded AMQP data * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size); /** * Encode/save message content as AMQP formatted binary data. * * If the buffer space provided is insufficient to store the content * held in the message, the operation will fail and return a * PN_OVERFLOW error code. * * @param[in] msg a message object * @param[in] bytes the start of empty buffer space * @param[in] size the amount of empty buffer space * @param[out] size the amount of data written * @return zero on success or an error code on failure */ PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size); /** * Save message content into a pn_data_t object data. The data object will first be cleared. */ PN_EXTERN int pn_message_data(pn_message_t *msg, pn_data_t *data); /** @} */ #ifdef __cplusplus } #endif #endif /* message.h */ qpid-proton-0.22.0/proton-c/include/proton/log.h0000664000000000000000000000340313257152177016410 0ustar #ifndef LOG_H #define LOG_H /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #ifdef __cplusplus extern "C" { #endif /** * @cond INTERNAL */ /** * @file * * Control log messages that are not associated with a transport. * See pn_transport_trace for transport-related logging. */ /** * Callback for customized logging. */ typedef void (*pn_logger_t)(const char *message); /** * Enable/disable global logging. * * By default, logging is enabled by environment variable PN_TRACE_LOG. * Calling this function overrides the environment setting. */ PN_EXTERN void pn_log_enable(bool enabled); /** * Set the logger. * * By default a logger that prints to stderr is installed. * * @param logger is called with each log message if logging is enabled. * Passing 0 disables logging regardless of pn_log_enable() or environment settings. */ PN_EXTERN void pn_log_logger(pn_logger_t logger); /** * @endcond */ #ifdef __cplusplus } #endif #endif qpid-proton-0.22.0/proton-c/include/proton/listener.h0000664000000000000000000000713013257152177017455 0ustar #ifndef PROTON_LISTENER_H #define PROTON_LISTENER_H 1 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief listener * * @addtogroup listener * @{ * * @note Thread safety: Listener has the same thread-safety rules as a * @ref core object. Calls to a single listener must be serialized * with the exception of pn_listener_close(). */ /** * Create a listener to pass to pn_proactor_listen() * * You can use pn_listener_attachments() to set application data that can be * accessed when accepting connections. */ PNP_EXTERN pn_listener_t *pn_listener(void); /** * Free a listener. You don't need to call this unless you create a listener * with pn_listen() but never pass it to pn_proactor_listen() */ PNP_EXTERN void pn_listener_free(pn_listener_t *l); /** * Accept an incoming connection request using @p transport and @p connection, * which can be configured before the call. * * Call after a @ref PN_LISTENER_ACCEPT event. * * Errors are returned as @ref PN_TRANSPORT_CLOSED events by pn_proactor_wait(). * * @param[in] listener the listener * @param[in] connection If NULL a new connection is created. * Memory management is the same as for pn_proactor_connect2() * @param[in] transport If NULL a new transport is created. * Memory management is the same as for pn_proactor_connect2() */ PNP_EXTERN void pn_listener_accept2(pn_listener_t *listener, pn_connection_t *connection, pn_transport_t *transport); /** * @deprecated Equivalent to pn_listener_accept2(listener, connection, NULL) */ PNP_EXTERN void pn_listener_accept(pn_listener_t* listener, pn_connection_t *connection); /** * Get the error condition for a listener. */ PNP_EXTERN pn_condition_t *pn_listener_condition(pn_listener_t *l); /** * @cond INTERNAL */ PNP_EXTERN void *pn_listener_get_context(pn_listener_t *listener); PNP_EXTERN void pn_listener_set_context(pn_listener_t *listener, void *context); /** * @endcond */ /** * Get the attachments that are associated with a listener object. */ PNP_EXTERN pn_record_t *pn_listener_attachments(pn_listener_t *listener); /** * Close the listener. * The PN_LISTENER_CLOSE event is generated when the listener has stopped listening. * * @note Thread safe. Must not be called after the PN_LISTENER_CLOSE event has * been handled as the listener may be freed . */ PNP_EXTERN void pn_listener_close(pn_listener_t *l); /** * The proactor associated with a listener. */ PNP_EXTERN pn_proactor_t *pn_listener_proactor(pn_listener_t *c); /** * Return the listener associated with an event. * * @return NULL if the event is not associated with a listener. */ PNP_EXTERN pn_listener_t *pn_event_listener(pn_event_t *event); /** *@} */ #ifdef __cplusplus } #endif #endif /* listener.h */ qpid-proton-0.22.0/proton-c/include/proton/link.h0000664000000000000000000005311513257152177016571 0ustar #ifndef PROTON_LINK_H #define PROTON_LINK_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief link * * @addtogroup link * @{ */ /** * Construct a new sender on a session. * * Each sending link between two AMQP containers must be uniquely * named. Note that this uniqueness cannot be enforced at the API * level, so some consideration should be taken in choosing link * names. * * @param[in] session the session object * @param[in] name the name of the link * @return a newly constructed sender link or NULL on error */ PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name); /** * Construct a new receiver on a session. * * Each receiving link between two AMQP containers must be uniquely * named. Note that this uniqueness cannot be enforced at the API * level, so some consideration should be taken in choosing link * names. * * @param[in] session the session object * @param[in] name the name of the link * @return a newly constructed receiver link or NULL on error */ PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name); /** * Free a link object. * * When a link object is freed, all ::pn_delivery_t objects associated * with the session are also freed. Freeing a link will settle any * unsettled deliveries on the link. * * @param[in] link a link object to free (or NULL) */ PN_EXTERN void pn_link_free(pn_link_t *link); /** * **Deprecated** - Use ::pn_link_attachments(). * * Get the application context that is associated with a link object. * * The application context for a link may be set using * ::pn_link_set_context. * * @param[in] link the link whose context is to be returned. * @return the application context for the link object */ PN_EXTERN void *pn_link_get_context(pn_link_t *link); /** * **Deprecated** - Use ::pn_link_attachments(). * * Set a new application context for a link object. * * The application context for a link object may be retrieved using * ::pn_link_get_context. * * @param[in] link the link object * @param[in] context the application context */ PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context); /** * Get the attachments that are associated with a link object. * * @param[in] link the link whose attachments are to be returned. * @return the attachments for the link object */ PN_EXTERN pn_record_t *pn_link_attachments(pn_link_t *link); /** * Get the name of a link. * * @param[in] link a link object * @return the name of the link */ PN_EXTERN const char *pn_link_name(pn_link_t *link); /** * Test if a link is a sender. * * @param[in] link a link object * @return true if and only if the link is a sender */ PN_EXTERN bool pn_link_is_sender(pn_link_t *link); /** * Test if a link is a receiver. * * @param[in] link a link object * @return true if and only if the link is a receiver */ PN_EXTERN bool pn_link_is_receiver(pn_link_t *link); /** * Get the endpoint state flags for a link. * * @param[in] link the link * @return the link's state flags */ PN_EXTERN pn_state_t pn_link_state(pn_link_t *link); /** * **Deprecated** * * Get additional error information associated with the link. * * Whenever a link operation fails (i.e. returns an error code), * additional error details can be obtained using this function. The * error object that is returned may also be used to clear the error * condition. * * The pointer returned by this operation is valid until the * link object is freed. * * @param[in] link the link object * @return the link's error object */ PN_EXTERN pn_error_t *pn_link_error(pn_link_t *link); /** * Get the local condition associated with a link endpoint. * * The ::pn_condition_t object retrieved may be modified prior to * closing a link in order to indicate a particular condition * exists when the link closes. This is normally used to * communicate error conditions to the remote peer, however it may * also be used in non error cases. See ::pn_condition_t for more * details. * * The pointer returned by this operation is valid until the link * object is freed. * * @param[in] link the link object * @return the link's local condition object */ PN_EXTERN pn_condition_t *pn_link_condition(pn_link_t *link); /** * Get the remote condition associated with a link endpoint. * * The ::pn_condition_t object retrieved may be examined in order to * determine whether the remote peer was indicating some sort of * exceptional condition when the remote link endpoint was * closed. The ::pn_condition_t object returned may not be modified. * * The pointer returned by this operation is valid until the * link object is freed. * * @param[in] link the link object * @return the link's remote condition object */ PN_EXTERN pn_condition_t *pn_link_remote_condition(pn_link_t *link); /** * Get the parent session for a link object. * * This operation retrieves the parent ::pn_session_t object that * contains the given ::pn_link_t object. * * @param[in] link the link object * @return the parent session object */ PN_EXTERN pn_session_t *pn_link_session(pn_link_t *link); /** * Retrieve the first link that matches the given state mask. * * Examines the state of each link owned by the connection and returns * the first link that matches the given state mask. If state contains * both local and remote flags, then an exact match against those * flags is performed. If state contains only local or only remote * flags, then a match occurs if any of the local or remote flags are * set respectively. state==0 matches all links. * * @param[in] connection to be searched for matching Links * @param[in] state mask to match * @return the first link owned by the connection that matches the * mask, else NULL if no links match */ PN_EXTERN pn_link_t *pn_link_head(pn_connection_t *connection, pn_state_t state); /** * Retrieve the next link that matches the given state mask. * * When used with pn_link_head, the application can access all links * on the connection that match the given state. See pn_link_head for * description of match behavior. * * @param[in] link the previous link obtained from pn_link_head or * pn_link_next * @param[in] state mask to match * @return the next session owned by the connection that matches the * mask, else NULL if no sessions match */ PN_EXTERN pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state); /** * Open a link. * * Once this operation has completed, the PN_LOCAL_ACTIVE state flag * will be set. * * @param[in] link a link object */ PN_EXTERN void pn_link_open(pn_link_t *link); /** * Close a link. * * Once this operation has completed, the PN_LOCAL_CLOSED state flag * will be set. This may be called without calling * ::pn_link_open, in this case it is equivalent to calling * ::pn_link_open followed by ::pn_link_close. * * @param[in] link a link object */ PN_EXTERN void pn_link_close(pn_link_t *link); /** * Detach a link. * * @param[in] link a link object */ PN_EXTERN void pn_link_detach(pn_link_t *link); /** * Access the locally defined source definition for a link. * * The pointer returned by this operation is valid until the link * object is freed. * * @param[in] link a link object * @return a pointer to a source terminus */ PN_EXTERN pn_terminus_t *pn_link_source(pn_link_t *link); /** * Access the locally defined target definition for a link. * * The pointer returned by this operation is valid until the link * object is freed. * * @param[in] link a link object * @return a pointer to a target terminus */ PN_EXTERN pn_terminus_t *pn_link_target(pn_link_t *link); /** * Access the remotely defined source definition for a link. * * The pointer returned by this operation is valid until the link * object is freed. The remotely defined terminus will be empty until * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE * flag. * * @param[in] link a link object * @return a pointer to the remotely defined source terminus */ PN_EXTERN pn_terminus_t *pn_link_remote_source(pn_link_t *link); /** * Access the remotely defined target definition for a link. * * The pointer returned by this operation is valid until the link * object is freed. The remotely defined terminus will be empty until * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE * flag. * * @param[in] link a link object * @return a pointer to the remotely defined target terminus */ PN_EXTERN pn_terminus_t *pn_link_remote_target(pn_link_t *link); /** * Get the current delivery for a link. * * Each link maintains a sequence of deliveries in the order they were * created, along with a pointer to the *current* delivery. All * send/recv operations on a link take place on the *current* * delivery. If a link has no current delivery, the current delivery * is automatically initialized to the next delivery created on the * link. Once initialized, the current delivery remains the same until * it is changed through use of ::pn_link_advance or until it is * settled via ::pn_delivery_settle. * * @param[in] link a link object * @return the current delivery for the link, or NULL if there is none */ PN_EXTERN pn_delivery_t *pn_link_current(pn_link_t *link); /** * Advance the current delivery of a link to the next delivery on the * link. * * For sending links this operation is used to finish sending message * data for the current outgoing delivery and move on to the next * outgoing delivery (if any). * * For receiving links, this operation is used to finish accessing * message data from the current incoming delivery and move on to the * next incoming delivery (if any). * * Each link maintains a sequence of deliveries in the order they were * created, along with a pointer to the *current* delivery. The * pn_link_advance operation will modify the *current* delivery on the * link to point to the next delivery in the sequence. If there is no * next delivery in the sequence, the current delivery will be set to * NULL. This operation will return true if invoking it caused the * value of the current delivery to change, even if it was set to * NULL. * * @param[in] link a link object * @return true if the current delivery was changed */ PN_EXTERN bool pn_link_advance(pn_link_t *link); /** * Get the credit balance for a link. * * Links use a credit based flow control scheme. Every receiver * maintains a credit balance that corresponds to the number of * deliveries that the receiver can accept at any given moment. As * more capacity becomes available at the receiver (see * ::pn_link_flow), it adds credit to this balance and communicates * the new balance to the sender. Whenever a delivery is * sent/received, the credit balance maintained by the link is * decremented by one. Once the credit balance at the sender reaches * zero, the sender must pause sending until more credit is obtained * from the receiver. * * Note that a sending link may still be used to send deliveries even * if pn_link_credit reaches zero, however those deliveries will end * up being buffered by the link until enough credit is obtained from * the receiver to send them over the wire. In this case the balance * reported by ::pn_link_credit will go negative. * * @param[in] link a link object * @return the credit balance for the link */ PN_EXTERN int pn_link_credit(pn_link_t *link); /** * Get the number of queued deliveries for a link. * * Links may queue deliveries for a number of reasons, for example * there may be insufficient credit to send them to the receiver (see * ::pn_link_credit), or they simply may not have yet had a chance to * be written to the wire. This operation will return the number of * queued deliveries on a link. * * @param[in] link a link object * @return the number of queued deliveries for the link */ PN_EXTERN int pn_link_queued(pn_link_t *link); /** * Get the remote view of the credit for a link. * * The remote view of the credit for a link differs from local view of * credit for a link by the number of queued deliveries. In other * words ::pn_link_remote_credit is defined to be ::pn_link_credit - * ::pn_link_queued. * * @param[in] link a link object * @return the remote view of the credit for a link */ PN_EXTERN int pn_link_remote_credit(pn_link_t *link); /** * Get the drain flag for a link. * * If a link is in drain mode, then the sending endpoint of a link * must immediately use up all available credit on the link. If this * is not possible, the excess credit must be returned by invoking * ::pn_link_drained. Only the receiving endpoint can set the drain * mode. See ::pn_link_set_drain for details. * * @param[in] link a link object * @return true if and only if the link is in drain mode */ PN_EXTERN bool pn_link_get_drain(pn_link_t *link); /** * Drain excess credit for a link. * * When a link is in drain mode, the sender must use all excess credit * immediately, and release any excess credit back to the receiver if * there are no deliveries available to send. * * When invoked on a sending link that is in drain mode, this * operation will release all excess credit back to the receiver and * return the number of credits released back to the sender. If the * link is not in drain mode, this operation is a noop. * * When invoked on a receiving link, this operation will return and * reset the number of credits the sender has released back to the * receiver. * * @param[in] link a link object * @return the number of credits drained */ PN_EXTERN int pn_link_drained(pn_link_t *link); /** * Get the available deliveries hint for a link. * * The available count for a link provides a hint as to the number of * deliveries that might be able to be sent if sufficient credit were * issued by the receiving link endpoint. See ::pn_link_offered for * more details. * * @param[in] link a link object * @return the available deliveries hint */ PN_EXTERN int pn_link_available(pn_link_t *link); /** * Describes the permitted/expected settlement behaviours of a sending * link. * * The sender settle mode describes the permitted and expected * behaviour of a sending link with respect to settling of deliveries. * See ::pn_delivery_settle for more details. */ typedef enum { PN_SND_UNSETTLED = 0, /**< The sender will send all deliveries initially unsettled. */ PN_SND_SETTLED = 1, /**< The sender will send all deliveries settled to the receiver. */ PN_SND_MIXED = 2 /**< The sender may send a mixture of settled and unsettled deliveries. */ } pn_snd_settle_mode_t; /** * Describes the permitted/expected settlement behaviours of a * receiving link. * * The receiver settle mode describes the permitted and expected * behaviour of a receiving link with respect to settling of * deliveries. See ::pn_delivery_settle for more details. */ typedef enum { PN_RCV_FIRST = 0, /**< The receiver will settle deliveries regardless of what the sender does. */ PN_RCV_SECOND = 1 /**< The receiver will only settle deliveries after the sender settles. */ } pn_rcv_settle_mode_t; /** * Get the local sender settle mode for a link. * * @param[in] link a link object * @return the local sender settle mode */ PN_EXTERN pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link); /** * Get the local receiver settle mode for a link. * * @param[in] link a link object * @return the local receiver settle mode */ PN_EXTERN pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link); /** * Set the local sender settle mode for a link. * * @param[in] link a link object * @param[in] mode the sender settle mode */ PN_EXTERN void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t mode); /** * Set the local receiver settle mode for a link. * * @param[in] link a link object * @param[in] mode the receiver settle mode */ PN_EXTERN void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t mode); /** * Get the remote sender settle mode for a link. * * @param[in] link a link object * @return the remote sender settle mode */ PN_EXTERN pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link); /** * Get the remote receiver settle mode for a link. * * @param[in] link a link object * @return the remote receiver settle mode */ PN_EXTERN pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link); /** * Get the number of unsettled deliveries for a link. * * @param[in] link a link object * @return the number of unsettled deliveries */ PN_EXTERN int pn_link_unsettled(pn_link_t *link); /** * Get the first unsettled delivery for a link. * " @param[in] link a link object * @return a pointer to the first unsettled delivery on the link */ PN_EXTERN pn_delivery_t *pn_unsettled_head(pn_link_t *link); /** * Get the next unsettled delivery on a link. * * @param[in] delivery a delivery object * @return the next unsettled delivery on the link */ PN_EXTERN pn_delivery_t *pn_unsettled_next(pn_delivery_t *delivery); /** * Signal the availability of deliveries for a link. * * @param[in] sender a sender link object * @param[in] credit the number of deliveries potentially available * for transfer */ PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit); /** * Send message data for the current delivery on a link. * * @param[in] sender a sender link object * @param[in] bytes the start of the message data * @param[in] n the number of bytes of message data * @return the number of bytes sent, or an error code */ PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n); /** * Grant credit for incoming deliveries on a receiver. * * @param[in] receiver a receiving link object * @param[in] credit the amount to increment the link credit */ PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit); /** * Grant credit for incoming deliveries on a receiver, and set drain * mode to true. * * Use ::pn_link_set_drain to set the drain mode explicitly. * * @param[in] receiver a receiving link object * @param[in] credit the amount to increment the link credit */ PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit); /** * Set the drain mode on a link. * * @param[in] receiver a receiving link object * @param[in] drain the drain mode */ PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain); /** * Receive message data for the current delivery on a link. * * Use ::pn_delivery_pending on the current delivery to figure out how * much buffer space is needed. * * Note that the link API can be used to stream large messages across * the network, so just because there is no data to read does not * imply the message is complete. To ensure the entirety of the * message data has been read, either invoke ::pn_link_recv until * PN_EOS is returned, or verify that * * (!pn_delivery_partial(d) && !pn_delivery_aborted(d) && pn_delivery_pending(d)==0) * * @param[in] receiver a receiving link object * @param[in] bytes a pointer to an empty buffer * @param[in] n the buffer capacity * @return The number of bytes received, or an error code: * - ::PN_EOS: The message has been completely received * - 0: No data available now. * If pn_delivery_partial() there will be further ::PN_DELIVERY events with more data. * - ::PN_STATE_ERR: The link has no current delivery * - ::PN_ABORTED: See pn_delivery_aborted() */ PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n); /** * Check if a link is currently draining. * * A link is defined to be draining when drain mode is set to true, * and the sender still has excess credit. * * @param[in] receiver a receiving link object * @return true if the link is currently draining, false otherwise */ PN_EXTERN bool pn_link_draining(pn_link_t *receiver); /** * **Unsettled API** - Get the maximum message size for a link. * * A zero maximum message size means the size is unlimited. * * @param[in] link a link object * @return the maximum message size for a link. */ PN_EXTERN uint64_t pn_link_max_message_size(pn_link_t *link); /** * **Unsettled API** - Set the maximum message size for a link. * * A zero maximum message size means the size is unlimited. * * @param[in] link a link object * @param[in] size the maximum message size for the link */ PN_EXTERN void pn_link_set_max_message_size(pn_link_t *link, uint64_t size); /** * **Unsettled API** - Get the remote view of the maximum message size for a link. * * A zero maximum message size means the size is unlimited. * * @param[in] link a link object * @return the remote view of the maximum message size for a link */ PN_EXTERN uint64_t pn_link_remote_max_message_size(pn_link_t *link); /** * @} */ #ifdef __cplusplus } #endif #endif /* link.h */ qpid-proton-0.22.0/proton-c/include/proton/import_export.h0000664000000000000000000000462313257152177020547 0ustar #ifndef PROTON_IMPORT_EXPORT_H #define PROTON_IMPORT_EXPORT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /** * @cond INTERNAL */ /* Compiler specific mechanisms for managing the import and export of symbols between shared objects. PN_EXPORT - Export declaration PN_IMPORT - Import declaration */ #if defined(WIN32) && !defined(PROTON_DECLARE_STATIC) /* Import and Export definitions for Windows: */ # define PN_EXPORT __declspec(dllexport) # define PN_IMPORT __declspec(dllimport) #else /* Non-Windows (Linux, etc.) definitions */ # define PN_EXPORT __attribute ((visibility ("default"))) # define PN_IMPORT #endif /* For core proton library symbols */ #if defined(qpid_proton_core_EXPORTS) || defined(qpid_proton_EXPORTS) # define PN_EXTERN PN_EXPORT #else # define PN_EXTERN PN_IMPORT #endif /* For proactor proton symbols */ #if defined(qpid_proton_proactor_EXPORTS) || defined(qpid_proton_EXPORTS) # define PNP_EXTERN PN_EXPORT #else # define PNP_EXTERN PN_IMPORT #endif /* For extra proton symbols */ #if defined(qpid_proton_EXPORTS) # define PNX_EXTERN PN_EXPORT #else # define PNX_EXTERN PN_IMPORT #endif #if ! defined(PN_USE_DEPRECATED_API) # if defined(WIN32) # define PN_DEPRECATED(message) __declspec(deprecated(message)) # elif defined __GNUC__ # if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40500 # define PN_DEPRECATED(message) __attribute__((deprecated)) # else # define PN_DEPRECATED(message) __attribute__((deprecated(message))) # endif # endif #endif #ifndef PN_DEPRECATED # define PN_DEPRECATED(message) #endif /** * @endcond */ #endif /* import_export.h */ qpid-proton-0.22.0/proton-c/include/proton/handlers.h0000664000000000000000000000255013257152177017431 0ustar #ifndef PROTON_HANDLERS_H #define PROTON_HANDLERS_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @cond INTERNAL */ typedef pn_handler_t pn_handshaker_t; typedef pn_handler_t pn_iohandler_t; typedef pn_handler_t pn_flowcontroller_t; PNX_EXTERN pn_handshaker_t *pn_handshaker(void); PNX_EXTERN pn_iohandler_t *pn_iohandler(void); PNX_EXTERN pn_flowcontroller_t *pn_flowcontroller(int window); /** * @endcond */ #ifdef __cplusplus } #endif #endif /* handlers.h */ qpid-proton-0.22.0/proton-c/include/proton/event.h0000664000000000000000000004013613257152177016754 0ustar #ifndef PROTON_EVENT_H #define PROTON_EVENT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief event * * @addtogroup event * @{ */ /** * Notification of a state change in the protocol engine. * * The AMQP endpoint state modeled by the protocol engine is captured * by the following object types: @link pn_delivery_t Deliveries * @endlink, @link pn_link_t Links @endlink, @link pn_session_t * Sessions @endlink, @link pn_connection_t Connections @endlink, and * @link pn_transport_t Transports @endlink. These objects are related * as follows: * * - @link pn_delivery_t Deliveries @endlink always have a single * parent Link * - @link pn_link_t Links @endlink always have a single parent * Session * - @link pn_session_t Sessions @endlink always have a single parent * Connection * - @link pn_connection_t Connections @endlink optionally have at * most one associated Transport * - @link pn_transport_t Transports @endlink optionally have at most * one associated Connection * * Every event has a type (see ::pn_event_type_t) that identifies what * sort of state change has occurred along with a pointer to the * object whose state has changed (as well as its associated objects). * * Events are accessed by creating a @link pn_collector_t Collector * @endlink with ::pn_collector() and registering it with the @link * pn_connection_t Connection @endlink of interest through use of * ::pn_connection_collect(). Once a collector has been registered, * ::pn_collector_peek() and ::pn_collector_pop() are used to access * and process events. */ typedef struct pn_event_t pn_event_t; /** * An event type. */ typedef enum { /** * Defined as a programming convenience. No event of this type will * ever be generated. */ PN_EVENT_NONE = 0, /** * A reactor has been started. Events of this type point to the reactor. */ PN_REACTOR_INIT, /** * A reactor has no more events to process. Events of this type * point to the reactor. */ PN_REACTOR_QUIESCED, /** * A reactor has been stopped. Events of this type point to the reactor. */ PN_REACTOR_FINAL, /** * A timer event has occurred. */ PN_TIMER_TASK, /** * The connection has been created. This is the first event that * will ever be issued for a connection. Events of this type point * to the relevant connection. */ PN_CONNECTION_INIT, /** * The connection has been bound to a transport. This event is * issued when the ::pn_transport_bind() operation is invoked. */ PN_CONNECTION_BOUND, /** * The connection has been unbound from its transport. This event is * issued when the ::pn_transport_unbind() operation is invoked. */ PN_CONNECTION_UNBOUND, /** * The local connection endpoint has been closed. Events of this * type point to the relevant connection. */ PN_CONNECTION_LOCAL_OPEN, /** * The remote endpoint has opened the connection. Events of this * type point to the relevant connection. */ PN_CONNECTION_REMOTE_OPEN, /** * The local connection endpoint has been closed. Events of this * type point to the relevant connection. */ PN_CONNECTION_LOCAL_CLOSE, /** * The remote endpoint has closed the connection. Events of this * type point to the relevant connection. */ PN_CONNECTION_REMOTE_CLOSE, /** * The connection has been freed and any outstanding processing has * been completed. This is the final event that will ever be issued * for a connection. */ PN_CONNECTION_FINAL, /** * The session has been created. This is the first event that will * ever be issued for a session. */ PN_SESSION_INIT, /** * The local session endpoint has been opened. Events of this type * point ot the relevant session. */ PN_SESSION_LOCAL_OPEN, /** * The remote endpoint has opened the session. Events of this type * point to the relevant session. */ PN_SESSION_REMOTE_OPEN, /** * The local session endpoint has been closed. Events of this type * point ot the relevant session. */ PN_SESSION_LOCAL_CLOSE, /** * The remote endpoint has closed the session. Events of this type * point to the relevant session. */ PN_SESSION_REMOTE_CLOSE, /** * The session has been freed and any outstanding processing has * been completed. This is the final event that will ever be issued * for a session. */ PN_SESSION_FINAL, /** * The link has been created. This is the first event that will ever * be issued for a link. */ PN_LINK_INIT, /** * The local link endpoint has been opened. Events of this type * point ot the relevant link. */ PN_LINK_LOCAL_OPEN, /** * The remote endpoint has opened the link. Events of this type * point to the relevant link. */ PN_LINK_REMOTE_OPEN, /** * The local link endpoint has been closed. Events of this type * point ot the relevant link. */ PN_LINK_LOCAL_CLOSE, /** * The remote endpoint has closed the link. Events of this type * point to the relevant link. */ PN_LINK_REMOTE_CLOSE, /** * The local link endpoint has been detached. Events of this type * point to the relevant link. */ PN_LINK_LOCAL_DETACH, /** * The remote endpoint has detached the link. Events of this type * point to the relevant link. */ PN_LINK_REMOTE_DETACH, /** * The flow control state for a link has changed. Events of this * type point to the relevant link. */ PN_LINK_FLOW, /** * The link has been freed and any outstanding processing has been * completed. This is the final event that will ever be issued for a * link. Events of this type point to the relevant link. */ PN_LINK_FINAL, /** * A delivery has been created or updated. Events of this type point * to the relevant delivery. */ PN_DELIVERY, /** * The transport has new data to read and/or write. Events of this * type point to the relevant transport. */ PN_TRANSPORT, /** * The transport has authenticated. If this is received by a server * the associated transport has authenticated an incoming connection * and pn_transport_get_user() can be used to obtain the authenticated * user. */ PN_TRANSPORT_AUTHENTICATED, /** * Indicates that a transport error has occurred. Use * ::pn_transport_condition() to access the details of the error * from the associated transport. */ PN_TRANSPORT_ERROR, /** * Indicates that the "head" or writing end of the transport has been closed. This * means the transport will never produce more bytes for output to * the network. Events of this type point to the relevant transport. */ PN_TRANSPORT_HEAD_CLOSED, /** * Indicates that the tail of the transport has been closed. This * means the transport will never be able to process more bytes from * the network. Events of this type point to the relevant transport. */ PN_TRANSPORT_TAIL_CLOSED, /** * Indicates that the both the head and tail of the transport are * closed. Events of this type point to the relevant transport. */ PN_TRANSPORT_CLOSED, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_READABLE, PN_SELECTABLE_WRITABLE, PN_SELECTABLE_ERROR, PN_SELECTABLE_EXPIRED, PN_SELECTABLE_FINAL, /** * pn_connection_wake() was called. * Events of this type point to the @ref pn_connection_t. */ PN_CONNECTION_WAKE, /** * Indicates the listener has an incoming connection, call pn_listener_accept2() * to accept it. * Events of this type point to the @ref pn_listener_t. */ PN_LISTENER_ACCEPT, /** * Indicates the listener has closed. pn_listener_condition() provides error information. * Events of this type point to the @ref pn_listener_t. */ PN_LISTENER_CLOSE, /** * Indicates pn_proactor_interrupt() was called to interrupt a proactor thread. * Events of this type point to the @ref pn_proactor_t. */ PN_PROACTOR_INTERRUPT, /** * Timeout set by pn_proactor_set_timeout() time limit expired. * Events of this type point to the @ref pn_proactor_t. */ PN_PROACTOR_TIMEOUT, /** * The proactor has become inactive: all listeners and connections were closed * and the timeout (if set) expired or was cancelled. There will be no * further events unless new listeners or connections are opened, or a new * timeout is set (possibly in other threads in a multi-threaded program.) * * Events of this type point to the @ref pn_proactor_t. */ PN_PROACTOR_INACTIVE, /** * The listener is listening. * Events of this type point to the @ref pn_listener_t. */ PN_LISTENER_OPEN } pn_event_type_t; /** * Get a human readable name for an event type. * * @param[in] type an event type * @return a human readable name */ PN_EXTERN const char *pn_event_type_name(pn_event_type_t type); /** * Construct a collector. * * A collector is used to register interest in events produced by one * or more ::pn_connection_t objects. Collectors are not currently * thread safe, so synchronization must be used if they are to be * shared between multiple connection objects. */ PN_EXTERN pn_collector_t *pn_collector(void); /** * Free a collector. * * @param[in] collector a collector to free, or NULL */ PN_EXTERN void pn_collector_free(pn_collector_t *collector); /** * Release a collector. Once in a released state a collector will * drain any internally queued events (thereby releasing any pointers * they may hold), shrink it's memory footprint to a minimum, and * discard any newly created events. * * @param[in] collector a collector object */ PN_EXTERN void pn_collector_release(pn_collector_t *collector); /** * Drain a collector: remove and discard all events. * * @param[in] collector a collector object */ PN_EXTERN void pn_collector_drain(pn_collector_t *collector); /** * Place a new event on a collector. * * This operation will create a new event of the given type and * context and return a pointer to the newly created event. In some * cases an event of the given type and context can be elided. When * this happens, this operation will return a NULL pointer. * * @param[in] collector a collector object * @param[in] clazz class of the context * @param[in] context the event context * @param[in] type the event type * * @return a pointer to the newly created event or NULL if the event * was elided */ PN_EXTERN pn_event_t *pn_collector_put(pn_collector_t *collector, const pn_class_t *clazz, void *context, pn_event_type_t type); /** * Access the head event contained by a collector. * * This operation will continue to return the same event until it is * cleared by using ::pn_collector_pop. The pointer return by this * operation will be valid until ::pn_collector_pop is invoked or * ::pn_collector_free is called, whichever happens sooner. * * @param[in] collector a collector object * @return a pointer to the head event contained in the collector */ PN_EXTERN pn_event_t *pn_collector_peek(pn_collector_t *collector); /** * Remove the head event on a collector. * * @param[in] collector a collector object * @return true if the event was popped, false if the collector is empty */ PN_EXTERN bool pn_collector_pop(pn_collector_t *collector); /** * Pop and return the head event, returns NULL if the collector is empty. * The returned pointer is valid till the next call of pn_collector_next(). * * @param[in] collector a collector object * @return the next event. */ PN_EXTERN pn_event_t *pn_collector_next(pn_collector_t *collector); /** * Return the same pointer as the most recent call to pn_collector_next(). * * @param[in] collector a collector object * @return a pointer to the event returned by previous call to pn_collector_next() */ PN_EXTERN pn_event_t *pn_collector_prev(pn_collector_t *collector); /** * Check if there are more events after the current head event. If this * returns true, then pn_collector_peek() will return an event even * after pn_collector_pop() is called. * * @param[in] collector a collector object * @return true if the collector has more than the current event */ PN_EXTERN bool pn_collector_more(pn_collector_t *collector); /** * Get the type of an event. * * @param[in] event an event object * @return the type of the event */ PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event); /** * Get the class associated with the event context. * * @param[in] event an event object * @return the class associated with the event context */ PN_EXTERN const pn_class_t *pn_event_class(pn_event_t *event); /** * Get the context associated with an event. */ PN_EXTERN void *pn_event_context(pn_event_t *event); /** * Get the connection associated with an event. * * @param[in] event an event object * @return the connection associated with the event (or NULL) */ PN_EXTERN pn_connection_t *pn_event_connection(pn_event_t *event); /** * Get the session associated with an event. * * @param[in] event an event object * @return the session associated with the event (or NULL) */ PN_EXTERN pn_session_t *pn_event_session(pn_event_t *event); /** * Get the link associated with an event. * * @param[in] event an event object * @return the link associated with the event (or NULL) */ PN_EXTERN pn_link_t *pn_event_link(pn_event_t *event); /** * Get the delivery associated with an event. * * @param[in] event an event object * @return the delivery associated with the event (or NULL) */ PN_EXTERN pn_delivery_t *pn_event_delivery(pn_event_t *event); /** * Get the transport associated with an event. * * @param[in] event an event object * @return the transport associated with the event (or NULL) */ PN_EXTERN pn_transport_t *pn_event_transport(pn_event_t *event); /** * Get any attachments associated with an event. * * @param[in] event an event object * @return the record holding the attachments */ PN_EXTERN pn_record_t *pn_event_attachments(pn_event_t *event); /** * If the event context object has a condition and the condition is set * return it, otherwise return NULL. * If the event context object has remote and local conditions, * try the remote condition first, then the local. */ PN_EXTERN struct pn_condition_t *pn_event_condition(pn_event_t *event); /** * **Unsettled API** - A batch of events that must be handled in sequence. * Call pn_event_batch_next() in a loop until it returns NULL to extract * the events. */ typedef struct pn_event_batch_t pn_event_batch_t; /* NOTE: there is deliberately no peek(), more() or other look-ahead on an event * batch. We want to know exactly which events have been handled, next() only * allows the user to get each event exactly once, in order. */ /** * **Unsettled API** - Remove the next event from the batch and return * it. NULL means the batch is empty. The returned event pointer is * valid until pn_event_batch_next() is called again on the same * batch. */ PN_EXTERN pn_event_t *pn_event_batch_next(pn_event_batch_t *batch); /** * @cond INTERNAL * * pn_event_batch_next() can be re-implemented for different behaviors in different contexts. */ struct pn_event_batch_t { pn_event_t *(*next_event)(pn_event_batch_t *batch); }; /** * @endcond */ #ifdef __cplusplus } #endif /** * @} */ #endif /* event.h */ qpid-proton-0.22.0/proton-c/include/proton/error.h0000664000000000000000000000620013257152177016756 0ustar #ifndef PROTON_ERROR_H #define PROTON_ERROR_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief error * * @addtogroup error * @{ */ /** * An int error `code` and some string `text` to describe the error. */ typedef struct pn_error_t pn_error_t; #define PN_OK (0) /**< No error */ #define PN_EOS (-1) /**< End of stream */ #define PN_ERR (-2) /**< General error */ #define PN_OVERFLOW (-3) /**< Overflow error */ #define PN_UNDERFLOW (-4) /**< Underflow error */ #define PN_STATE_ERR (-5) /**< State error */ #define PN_ARG_ERR (-6) /**< Argument error */ #define PN_TIMEOUT (-7) /**< Timeout */ #define PN_INTR (-8) /**< Interrupt */ #define PN_INPROGRESS (-9) /**< In-progress */ #define PN_OUT_OF_MEMORY (-10) /**< Out-of-memory error */ #define PN_ABORTED (-11) /**< Delivery aborted error */ /** * Get the name of the error code. Returned pointer is to a static * constant, do not delete. */ PN_EXTERN const char *pn_code(int code); /** * Create an error object. */ PN_EXTERN pn_error_t *pn_error(void); /** * Free an error object. */ PN_EXTERN void pn_error_free(pn_error_t *error); /** * Reset the error to a "no error" state with code == 0. */ PN_EXTERN void pn_error_clear(pn_error_t *error); /** * Set the error code and text. Makes a copy of text. */ PN_EXTERN int pn_error_set(pn_error_t *error, int code, const char *text); /** * Set the code and set the text using a printf-style formatted * string. */ PN_EXTERN int pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap); /** * Set the code and set the text using a printf-style formatted * string. */ PN_EXTERN int pn_error_format(pn_error_t *error, int code, const char *fmt, ...); /** * Get the the error code. */ PN_EXTERN int pn_error_code(pn_error_t *error); /** * Get the error text. The returned pointer is owned by the * pn_error_t. */ PN_EXTERN const char *pn_error_text(pn_error_t *error); /** * Copy the src error. */ PN_EXTERN int pn_error_copy(pn_error_t *error, pn_error_t *src); /** * @cond INTERNAL */ #define PN_RETURN_IF_ERROR(x) \ do {\ int r = (x);\ if (r < 0) return r; \ } while (0) /** * @endcond */ /** * @} */ #ifdef __cplusplus } #endif #endif /* error.h */ qpid-proton-0.22.0/proton-c/include/proton/engine.h0000664000000000000000000000221513257152177017074 0ustar #ifndef PROTON_ENGINE_H #define PROTON_ENGINE_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /** * @cond INTERNAL */ #include #include #include #include #include #include #include #include /** * @endcond */ #endif /* engine.h */ qpid-proton-0.22.0/proton-c/include/proton/disposition.h0000664000000000000000000001640113257152177020175 0ustar #ifndef PROTON_DISPOSITION_H #define PROTON_DISPOSITION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief pn_disposition_t * * @addtogroup delivery * @{ */ /** * A delivery state. * * Dispositions record the current state or final outcome of a * transfer. Every delivery contains both a local and remote * disposition. The local disposition holds the local state of the * delivery, and the remote disposition holds the last known remote * state of the delivery. */ typedef struct pn_disposition_t pn_disposition_t; /** * The PN_RECEIVED delivery state is a non terminal state indicating * how much (if any) message data has been received for a delivery. */ #define PN_RECEIVED (0x0000000000000023) /** * The PN_ACCEPTED delivery state is a terminal state indicating that * the delivery was successfully processed. Once in this state there * will be no further state changes prior to the delivery being * settled. */ #define PN_ACCEPTED (0x0000000000000024) /** * The PN_REJECTED delivery state is a terminal state indicating that * the delivery could not be processed due to some error condition. * Once in this state there will be no further state changes prior to * the delivery being settled. */ #define PN_REJECTED (0x0000000000000025) /** * The PN_RELEASED delivery state is a terminal state indicating that * the delivery is being returned to the sender. Once in this state * there will be no further state changes prior to the delivery being * settled. */ #define PN_RELEASED (0x0000000000000026) /** * The PN_MODIFIED delivery state is a terminal state indicating that * the delivery is being returned to the sender and should be * annotated by the sender prior to further delivery attempts. Once in * this state there will be no further state changes prior to the * delivery being settled. */ #define PN_MODIFIED (0x0000000000000027) /** * Get the type of a disposition. * * Defined values are: * * - ::PN_RECEIVED * - ::PN_ACCEPTED * - ::PN_REJECTED * - ::PN_RELEASED * - ::PN_MODIFIED * * @param[in] disposition a disposition object * @return the type of the disposition */ PN_EXTERN uint64_t pn_disposition_type(pn_disposition_t *disposition); /** * Name of a disposition type for logging and debugging: "received", "accepted" etc. */ PN_EXTERN const char *pn_disposition_type_name(uint64_t disposition_type); /** * Access the condition object associated with a disposition. * * The ::pn_condition_t object retrieved by this operation may be * modified prior to updating a delivery. When a delivery is updated, * the condition described by the disposition is reported to the peer * if applicable to the current delivery state, e.g. states such as * ::PN_REJECTED. * * The pointer returned by this operation is valid until the parent * delivery is settled. * * @param[in] disposition a disposition object * @return a pointer to the disposition condition */ PN_EXTERN pn_condition_t *pn_disposition_condition(pn_disposition_t *disposition); /** * Access the disposition as a raw pn_data_t. * * Dispositions are an extension point in the AMQP protocol. The * disposition interface provides setters/getters for those * dispositions that are predefined by the specification, however * access to the raw disposition data is provided so that other * dispositions can be used. * * The ::pn_data_t pointer returned by this operation is valid until * the parent delivery is settled. * * @param[in] disposition a disposition object * @return a pointer to the raw disposition data */ PN_EXTERN pn_data_t *pn_disposition_data(pn_disposition_t *disposition); /** * Get the section number associated with a disposition. * * @param[in] disposition a disposition object * @return a section number */ PN_EXTERN uint32_t pn_disposition_get_section_number(pn_disposition_t *disposition); /** * Set the section number associated with a disposition. * * @param[in] disposition a disposition object * @param[in] section_number a section number */ PN_EXTERN void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number); /** * Get the section offset associated with a disposition. * * @param[in] disposition a disposition object * @return a section offset */ PN_EXTERN uint64_t pn_disposition_get_section_offset(pn_disposition_t *disposition); /** * Set the section offset associated with a disposition. * * @param[in] disposition a disposition object * @param[in] section_offset a section offset */ PN_EXTERN void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset); /** * Check if a disposition has the failed flag set. * * @param[in] disposition a disposition object * @return true if the disposition has the failed flag set, false otherwise */ PN_EXTERN bool pn_disposition_is_failed(pn_disposition_t *disposition); /** * Set the failed flag on a disposition. * * @param[in] disposition a disposition object * @param[in] failed the value of the failed flag */ PN_EXTERN void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed); /** * Check if a disposition has the undeliverable flag set. * * @param[in] disposition a disposition object * @return true if the disposition has the undeliverable flag set, false otherwise */ PN_EXTERN bool pn_disposition_is_undeliverable(pn_disposition_t *disposition); /** * Set the undeliverable flag on a disposition. * * @param[in] disposition a disposition object * @param[in] undeliverable the value of the undeliverable flag */ PN_EXTERN void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable); /** * Access the annotations associated with a disposition. * * The ::pn_data_t object retrieved by this operation may be modified * prior to updating a delivery. When a delivery is updated, the * annotations described by the ::pn_data_t are reported to the peer * if applicable to the current delivery state, e.g. states such as * ::PN_MODIFIED. The ::pn_data_t must be empty or contain a symbol * keyed map. * * The pointer returned by this operation is valid until the parent * delivery is settled. * * @param[in] disposition a disposition object * @return the annotations associated with the disposition */ PN_EXTERN pn_data_t *pn_disposition_annotations(pn_disposition_t *disposition); /** * @} */ #ifdef __cplusplus } #endif #endif /* disposition.h */ qpid-proton-0.22.0/proton-c/include/proton/delivery.h0000664000000000000000000002432413257152177017457 0ustar #ifndef PROTON_DELIVERY_H #define PROTON_DELIVERY_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief delivery * * @addtogroup delivery * @{ */ /** * An AMQP delivery tag. */ typedef pn_bytes_t pn_delivery_tag_t; /** * Construct a delivery tag. * * @param[in] bytes a pointer to the beginning of the tag * @param[in] size the size of the tag * @return the delivery tag */ PN_EXTERN pn_delivery_tag_t pn_dtag(const char *bytes, size_t size); /** * Create a delivery on a link. * * Every delivery object within a link must be supplied with a unique * tag. Links maintain a sequence of delivery object in the order that * they are created. * * @param[in] link a link object * @param[in] tag the delivery tag * @return a newly created delivery, or NULL if there was an error */ PN_EXTERN pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag); /** * **Deprecated** - Use ::pn_delivery_attachments(). * * Get the application context that is associated with a delivery object. * * The application context for a delivery may be set using * ::pn_delivery_set_context. * * @param[in] delivery the delivery whose context is to be returned. * @return the application context for the delivery object */ PN_EXTERN void *pn_delivery_get_context(pn_delivery_t *delivery); /** * **Deprecated** - Use ::pn_delivery_attachments(). * * Set a new application context for a delivery object. * * The application context for a delivery object may be retrieved using * ::pn_delivery_get_context. * * @param[in] delivery the delivery object * @param[in] context the application context */ PN_EXTERN void pn_delivery_set_context(pn_delivery_t *delivery, void *context); /** * Get the attachments that are associated with a delivery object. * * @param[in] delivery the delivery whose attachments are to be returned. * @return the attachments for the delivery object */ PN_EXTERN pn_record_t *pn_delivery_attachments(pn_delivery_t *delivery); /** * Get the tag for a delivery object. * * @param[in] delivery a delivery object * @return the delivery tag */ PN_EXTERN pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery); /** * Get the parent link for a delivery object. * * @param[in] delivery a delivery object * @return the parent link */ PN_EXTERN pn_link_t *pn_delivery_link(pn_delivery_t *delivery); /** * Get the local disposition for a delivery. * * The pointer returned by this object is valid until the delivery is * settled. * * @param[in] delivery a delivery object * @return a pointer to the local disposition */ PN_EXTERN pn_disposition_t *pn_delivery_local(pn_delivery_t *delivery); /** * Get the local disposition state for a delivery. * * @param[in] delivery a delivery object * @return the local disposition state */ PN_EXTERN uint64_t pn_delivery_local_state(pn_delivery_t *delivery); /** * Get the remote disposition for a delivery. * * The pointer returned by this object is valid until the delivery is * settled. * * @param[in] delivery a delivery object * @return a pointer to the remote disposition */ PN_EXTERN pn_disposition_t *pn_delivery_remote(pn_delivery_t *delivery); /** * Get the remote disposition state for a delivery. * * @param[in] delivery a delivery object * @return the remote disposition state */ PN_EXTERN uint64_t pn_delivery_remote_state(pn_delivery_t *delivery); /** * Check if a delivery is remotely settled. * * @param[in] delivery a delivery object * @return true if the delivery is settled at the remote endpoint, false otherwise */ PN_EXTERN bool pn_delivery_settled(pn_delivery_t *delivery); /** * Get the amount of pending message data for a delivery. * * @param[in] delivery a delivery object * @return the amount of pending message data in bytes */ PN_EXTERN size_t pn_delivery_pending(pn_delivery_t *delivery); /** * Check if a delivery only has partial message data. * * The receiver can expect more ::PN_DELIVERY events for this delivery containing * the remainder of this message. * * @param[in] delivery a delivery object * @return true if the delivery only contains part of a message, false otherwise */ PN_EXTERN bool pn_delivery_partial(pn_delivery_t *delivery); /** * Check if a received delivery has been aborted. * * An aborted delivery means the sender cannot complete this message and the * receiver should discard any data already received. The link remains open for * future messages. * * You must still call pn_delivery_settle() to free local resources. An aborted * delivery consumes a credit, use pn_link_flow() to issue new credit as for a * successful delivery. * * Calling pn_link_recv() when the current delivery is aborted returns * ::PN_ABORTED. * * @see pn_delivery_abort() * @param[in] delivery a delivery object * @return true if the delivery has been aborted, false otherwise */ PN_EXTERN bool pn_delivery_aborted(pn_delivery_t *delivery); /** * Check if a delivery is writable. * * A delivery is considered writable if it is the current delivery on * an outgoing link, and the link has positive credit. * * @param[in] delivery a delivery object * @return true if the delivery is writable, false otherwise */ PN_EXTERN bool pn_delivery_writable(pn_delivery_t *delivery); /** * Check if a delivery is readable. * * A delivery is considered readable if it is the current delivery on * an incoming link. * * @param[in] delivery a delivery object * @return true if the delivery is readable, false otherwise */ PN_EXTERN bool pn_delivery_readable(pn_delivery_t *delivery); /** * Check if a delivery is updated. * * A delivery is considered updated whenever the peer communicates a * new disposition for the delivery. Once a delivery becomes updated, * it will remain so until ::pn_delivery_clear is called. * * @param[in] delivery a delivery object * @return true if the delivery is updated, false otherwise */ PN_EXTERN bool pn_delivery_updated(pn_delivery_t *delivery); /** * Update the disposition of a delivery. * * When update is invoked the updated disposition of the delivery will * be communicated to the peer. * * @param[in] delivery a delivery object * @param[in] state the updated delivery state */ PN_EXTERN void pn_delivery_update(pn_delivery_t *delivery, uint64_t state); /** * Clear the updated flag for a delivery. * * See ::pn_delivery_updated. * * @param[in] delivery a delivery object */ PN_EXTERN void pn_delivery_clear(pn_delivery_t *delivery); /** * Return true if delivery is the current delivery for its link. * * @param[in] delivery a delivery object * @return true if delivery is the current delivery for its link. */ PN_EXTERN bool pn_delivery_current(pn_delivery_t *delivery); /** * Abort a delivery being sent. * * Aborting means the sender cannot complete this message. It will not send any * more data, and data sent so far should be discarded by the receiver. The * link remains open for future messages. * * If some data has already been sent on the network, an AMQP "aborted" frame * will be sent to inform the peer. If no data has yet been sent, the delivery * will simply be forgotten. * * The delivery will be freed, and cannot be used after the call. * * @see pn_delivery_aborted() * * @param[in] delivery a delivery object */ PN_EXTERN void pn_delivery_abort(pn_delivery_t *delivery); /** * Settle a delivery. * * A settled delivery can never be used again. * * @note If pn_delivery_current(delivery) is true before the call then * pn_link_advance(pn_delivery_link(deliver)) is called automatically. * * @param[in] delivery a delivery object */ PN_EXTERN void pn_delivery_settle(pn_delivery_t *delivery); /** * Utility function for printing details of a delivery. * * @param[in] delivery a delivery object */ PN_EXTERN void pn_delivery_dump(pn_delivery_t *delivery); /** * Check if a delivery is buffered. * * A delivery that is buffered has not yet been written to the wire. * * Note that returning false does not imply that a delivery was * definitely written to the wire. If false is returned, it is not * known whether the delivery was actually written to the wire or not. * * @param[in] delivery a delivery object * @return true if the delivery is buffered */ PN_EXTERN bool pn_delivery_buffered(pn_delivery_t *delivery); /** * Extracts the first delivery on the connection that has pending * operations. * * Retrieves the first delivery on the Connection that has pending * operations. A readable delivery indicates message data is waiting * to be read. A writable delivery indicates that message data may be * sent. An updated delivery indicates that the delivery's disposition * has changed. A delivery will never be both readable and writable, * but it may be both readable and updated or both writable and * updated. * * @param[in] connection the connection * @return the first delivery object that needs to be serviced, else * NULL if none */ PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection); /** * Get the next delivery on the connection that needs has pending * operations. * * @param[in] delivery the previous delivery retrieved from * either pn_work_head or pn_work_next * @return the next delivery that has pending operations, else * NULL if none */ PN_EXTERN pn_delivery_t *pn_work_next(pn_delivery_t *delivery); /** * @} */ #ifdef __cplusplus } #endif #endif /* delivery.h */ qpid-proton-0.22.0/proton-c/include/proton/cproton.i0000664000000000000000000004530413257152177017322 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ typedef unsigned int size_t; typedef signed int ssize_t; typedef unsigned char uint8_t; typedef signed char int8_t; typedef unsigned short uint16_t; typedef signed short int16_t; typedef unsigned long int uint32_t; typedef long int int32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; typedef unsigned long int uintptr_t; /* Parse these interface header files to generate APIs for script languages */ %include "proton/import_export.h" %ignore _PROTON_VERSION_H; %include "proton/version.h" /* We cannot safely just wrap pn_bytes_t but each language binding must have a typemap for it - presumably to a string type */ %ignore pn_bytes_t; %ignore pn_rwbytes_t; /* pn_event_batch_t is not used directly by bindings */ %ignore pn_event_batch_t; /* There is no need to wrap pn_class_t aa it is an internal implementation detail and cannot be used outside the library */ %ignore pn_class_t; /* Ignore C APIs related to pn_atom_t - they can all be achieved with pn_data_t */ %ignore pn_atom_t; %ignore pn_atom_t_u; /* Seem to need this even though its nested in pn_atom_t */ %ignore pn_data_get_atom; %ignore pn_data_put_atom; %ignore pn_delivery_tag_t; %ignore pn_decimal128_t; %ignore pn_uuid_t; %include "proton/types.h" %ignore pn_string_vformat; %ignore pn_string_vaddf; %immutable PN_OBJECT; %immutable PN_VOID; %immutable PN_WEAKREF; /* Treat pn_handle_t like uintptr_t - syntactically it is a C void* but really it's just an int */ %apply uintptr_t { pn_handle_t }; %include "proton/object.h" %ignore pn_error_format; %ignore pn_error_vformat; %ignore pn_condition_format; %ignore pn_condition_vformat; /* checks that ensure only allowed values are supplied or returned */ %aggregate_check(int, check_error, PN_EOS, PN_ERR, PN_OVERFLOW, PN_UNDERFLOW, PN_STATE_ERR, PN_ARG_ERR, PN_TIMEOUT); %aggregate_check(int, check_state, PN_LOCAL_UNINIT, PN_LOCAL_ACTIVE, PN_LOCAL_CLOSED, PN_REMOTE_UNINIT, PN_REMOTE_ACTIVE, PN_REMOTE_CLOSED); %aggregate_check(int, check_disposition, 0, PN_RECEIVED, PN_ACCEPTED, PN_REJECTED, PN_RELEASED, PN_MODIFIED); %aggregate_check(int, check_trace, PN_TRACE_OFF, PN_TRACE_RAW, PN_TRACE_FRM, PN_TRACE_DRV); %aggregate_check(int, check_sasl_outcome, PN_SASL_NONE, PN_SASL_OK, PN_SASL_AUTH, PN_SASL_SYS, PN_SASL_PERM, PN_SASL_TEMP); %contract pn_code(int code) { require: check_error(code); } %contract pn_error() { ensure: pn_error != NULL; } %contract pn_error_free(pn_error_t *error) { require: error != NULL; } %contract pn_error_clear(pn_error_t *error) { require: error != NULL; } %contract pn_error_set(pn_error_t *error, int code, const char *text) { require: error != NULL; } %contract pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap) { require: error != NULL; } %contract pn_error_format(pn_error_t *error, int code, const char *fmt, ...) { require: error != NULL; } %contract pn_error_code(pn_error_t *error) { require: error != NULL; } %contract pn_error_text(pn_error_t *error) { require: error != NULL; } %include "proton/error.h" %contract pn_connection(void) { ensure: pn_connection != NULL; } %contract pn_connection_state(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_error(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_get_container(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_set_container(pn_connection_t *connection, const char *container) { require: connection != NULL; } %contract pn_connection_get_hostname(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_set_hostname(pn_connection_t *connection, const char *hostname) { require: connection != NULL; } %contract pn_connection_remote_container(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_remote_hostname(pn_connection_t *connection) { require: connection != NULL; } %contract pn_work_head(pn_connection_t *connection) { require: connection != NULL; } %contract pn_work_next(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_session(pn_connection_t *connection) { require: connection != NULL; } %contract pn_transport(pn_connection_t *connection) { require: connection != NULL; ensure: pn_transport != NULL; } %contract pn_session_head(pn_connection_t *connection, pn_state_t state) { require: connection != NULL; } %contract pn_session_next(pn_session_t *session, pn_state_t state) { require: session != NULL; } %contract pn_link_head(pn_connection_t *connection, pn_state_t state) { require: connection != NULL; } %contract pn_link_next(pn_link_t *link, pn_state_t state) { require: link != NULL; } %contract pn_connection_open(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_close(pn_connection_t *connection) { require: connection != NULL; } %contract pn_connection_free(pn_connection_t *connection) { require: connection != NULL; } %contract pn_transport_error(pn_transport_t *transport) { require: transport != NULL; } %contract pn_transport_input(pn_transport_t *transport, char *bytes, size_t available) { require: transport != NULL; } %contract pn_transport_output(pn_transport_t *transport, char *bytes, size_t size) { require: transport != NULL; } #%contract pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now) #{ # # this method currently always returns 0 #} %contract pn_transport_trace(pn_transport_t *transport, pn_trace_t trace) { require: transport != NULL; } %contract pn_transport_free(pn_transport_t *transport) { require: transport != NULL; } %contract pn_session_state(pn_session_t *session) { require: session != NULL; } %contract pn_session_error(pn_session_t *session) { require: session != NULL; } %contract pn_sender(pn_session_t *session, const char *name) { require: session != NULL; ensure: pn_sender != NULL; } %contract pn_receiver(pn_session_t *session, const char *name) { require: session != NULL; ensure: pn_receiver != NULL; } %contract pn_session_connection(pn_session_t *session) { require: session != NULL; ensure: pn_session_connection != NULL; } %contract pn_session_open(pn_session_t *session) { require: session != NULL; } %contract pn_session_close(pn_session_t *session) { require: session != NULL; } %contract pn_session_free(pn_session_t *session) { require: session != NULL; } %contract pn_link_name(pn_link_t *link) { require: link != NULL; } %contract pn_link_is_sender(pn_link_t *link) { require: link != NULL; } %contract pn_link_is_receiver(pn_link_t *link) { require: link != NULL; } %contract pn_link_state(pn_link_t *link) { require: link != NULL; } %contract pn_link_error(pn_link_t *link) { require: link != NULL; } %contract pn_link_session(pn_link_t *link) { require: link != NULL; ensure: pn_link_session != NULL; } %contract pn_link_get_target(pn_link_t *link) { require: link != NULL; } %contract pn_link_get_source(pn_link_t *link) { require: link != NULL; } %contract pn_link_set_source(pn_link_t *link, const char *source) { require: link != NULL; } %contract pn_link_set_target(pn_link_t *link, const char *target) { require: link != NULL; } %contract pn_link_remote_source(pn_link_t *link) { require: link != NULL; } %contract pn_link_remote_target(pn_link_t *link) { require: link != NULL; } %contract pn_delivery(pn_link_t *link, pn_delivery_tag_t tag) { require: link != NULL; ensure: pn_delivery != NULL; } %contract pn_link_current(pn_link_t *link) { require: link != NULL; } %contract pn_link_advance(pn_link_t *link) { require: link != NULL; } %contract pn_link_credit(pn_link_t *link) { require: link != NULL; } %contract pn_link_queued(pn_link_t *link) { require: link != NULL; } %contract pn_link_unsettled(pn_link_t *link) { require: link != NULL; } %contract pn_unsettled_head(pn_link_t *link) { require: link != NULL; } %contract pn_unsettled_next(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_link_open(pn_link_t *sender) { require: sender != NULL; } %contract pn_link_close(pn_link_t *sender) { require: sender != NULL; } %contract pn_link_free(pn_link_t *sender) { require: sender != NULL; } %contract pn_link_send(pn_link_t *sender, const char *bytes, size_t n) { require: sender != NULL; } %contract pn_link_drained(pn_link_t *sender) { require: sender != NULL; } %contract pn_link_flow(pn_link_t *receiver, int credit) { require: receiver != NULL; } %contract pn_link_drain(pn_link_t *receiver, int credit) { require: receiver != NULL; } %contract pn_link_recv(pn_link_t *receiver, char *bytes, size_t n) { require: receiver != NULL; } %contract pn_delivery_tag(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_link(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_local_state(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_remote_state(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_settled(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_pending(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_writable(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_readable(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_updated(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_clear(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_update(pn_delivery_t *delivery, pn_disposition_t disposition) { require: delivery != NULL; check_disposition(disposition); } %contract pn_delivery_settle(pn_delivery_t *delivery) { require: delivery != NULL; } %contract pn_delivery_dump(pn_delivery_t *delivery) { require: delivery != NULL; } %include "proton/condition.h" %include "proton/connection.h" %include "proton/session.h" %include "proton/link.h" %include "proton/terminus.h" %include "proton/delivery.h" %include "proton/disposition.h" %ignore pn_transport_vlogf; %include "proton/transport.h" %include "proton/event.h" %inline %{ /* assume the binding does the incref in the wrapper */ pn_event_t* pn_event_copy(pn_event_t *evt) { return evt; } %} %contract pn_event_copy(pn_event_t *evt) { require: evt != NULL; } %contract pn_message_free(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_clear(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_errno(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_error(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_is_durable(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_durable(pn_message_t *msg, bool durable) { require: msg != NULL; } %contract pn_message_get_priority(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_priority(pn_message_t *msg, uint8_t priority) { require: msg != NULL; } %contract pn_message_get_ttl(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_ttl(pn_message_t *msg, pn_millis_t ttl) { require: msg != NULL; } %contract pn_message_is_first_acquirer(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_first_acquirer(pn_message_t *msg, bool first) { require: msg != NULL; } %contract pn_message_get_delivery_count(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_delivery_count(pn_message_t *msg, uint32_t count) { require: msg != NULL; } %contract pn_message_get_id(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_id(pn_message_t *msg, pn_atom_t id) { require: msg != NULL; } %contract pn_message_get_user_id(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_user_id(pn_message_t *msg, pn_bytes_t user_id) { require: msg != NULL; } %contract pn_message_get_address(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_address(pn_message_t *msg, const char *address) { require: msg != NULL; } %contract pn_message_get_subject(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_subject(pn_message_t *msg, const char *subject) { require: msg != NULL; } %contract pn_message_get_reply_to(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_reply_to(pn_message_t *msg, const char *reply_to) { require: msg != NULL; } %contract pn_message_get_correlation_id(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_correlation_id(pn_message_t *msg, pn_atom_t atom) { require: msg != NULL; } %contract pn_message_get_content_type(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_content_type(pn_message_t *msg, const char *type) { require: msg != NULL; } %contract pn_message_get_content_encoding(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_content_encoding(pn_message_t *msg, const char *encoding) { require: msg != NULL; } %contract pn_message_get_expiry_time(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_expiry_time(pn_message_t *msg, pn_timestamp_t time) { require: msg != NULL; } %contract pn_message_get_creation_time(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_creation_time(pn_message_t *msg, pn_timestamp_t time) { require: msg != NULL; } %contract pn_message_get_group_id(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_group_id(pn_message_t *msg, const char *group_id) { require: msg != NULL; } %contract pn_message_get_group_sequence(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_group_sequence(pn_message_t *msg, pn_sequence_t n) { require: msg != NULL; } %contract pn_message_get_reply_to_group_id(pn_message_t *msg) { require: msg != NULL; } %contract pn_message_set_reply_to_group_id(pn_message_t *msg, const char *reply_to_group_id) { require: msg != NULL; } %contract pn_message_decode(pn_message_t *msg, const char *bytes, size_t size) { require: msg != NULL; } %contract pn_message_encode(pn_message_t *msg, char *bytes, size_t *size) { require: msg != NULL; *size >= 0; } %include "proton/message.h" %contract pn_sasl() { ensure: pn_sasl != NULL; } %contract pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechanisms) { require: sasl != NULL; } %contract pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome) { require: sasl != NULL; check_sasl_outcome(outcome); } %contract pn_sasl_outcome(pn_sasl_t *sasl) { require: sasl != NULL; ensure: check_sasl_outcome(pn_sasl_outcome); } %include "proton/sasl.h" %contract pn_messenger_name(pn_messenger_t *messenger) { require: messenger != NULL; ensure: pn_messenger_name != NULL; } %contract pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout) { require: messenger != NULL; } %contract pn_messenger_get_timeout(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_free(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_errno(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_error(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_start(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_stop(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_subscribe(pn_messenger_t *messenger, const char *source) { require: messenger != NULL; source != NULL; } %contract pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg) { require: messenger != NULL; msg != NULL; } %contract pn_messenger_send(pn_messenger_t *messenger) { require: messenger != NULL; } %contract pn_messenger_recv(pn_messenger_t *messenger, int n) { require: messenger != NULL; } %contract pn_messenger_get(pn_messenger_t *messenger, pn_message_t *msg) { require: messenger != NULL; } %contract pn_messenger_outgoing(pn_messenger_t *messenger) { require: messenger != NULL; ensure: pn_messenger_outgoing >= 0; } %contract pn_messenger_incoming(pn_messenger_t *messenger) { require: messenger != NULL; ensure: pn_messenger_incoming >= 0; } %include "proton/messenger.h" %include "proton/selectable.h" %include "proton/ssl.h" %ignore pn_decode_atoms; %ignore pn_encode_atoms; %ignore pn_decode_one; %ignore pn_print_atom; %ignore pn_type_str; %ignore pn_print_atoms; %ignore pn_format_atoms; %ignore pn_format_atom; %ignore pn_fill_atoms; %ignore pn_vfill_atoms; %ignore pn_ifill_atoms; %ignore pn_vifill_atoms; %ignore pn_scan_atoms; %ignore pn_vscan_atoms; %ignore pn_data_vfill; %ignore pn_data_vscan; %include "proton/codec.h" %inline %{ pn_connection_t *pn_cast_pn_connection(void *x) { return (pn_connection_t *) x; } pn_session_t *pn_cast_pn_session(void *x) { return (pn_session_t *) x; } pn_link_t *pn_cast_pn_link(void *x) { return (pn_link_t *) x; } pn_delivery_t *pn_cast_pn_delivery(void *x) { return (pn_delivery_t *) x; } pn_transport_t *pn_cast_pn_transport(void *x) { return (pn_transport_t *) x; } pn_reactor_t *pn_cast_pn_reactor(void *x) { return (pn_reactor_t *) x; } pn_task_t *pn_cast_pn_task(void *x) { return (pn_task_t *) x; } pn_selectable_t *pn_cast_pn_selectable(void *x) { return (pn_selectable_t *) x; } %} /* Connection driver */ %{ #include %} /* Don't wrap the pn_connection_driver_t struct, just the functions */ %ignore pn_connection_driver_t; %ignore pn_connection_driver_verrorf; %ignore pn_connection_driver_logf; %ignore pn_connection_driver_vlogf; %include "proton/connection_driver.h" %include "proton/url.h" %include "proton/reactor.h" %include "proton/handlers.h" %include "proton/cid.h" qpid-proton-0.22.0/proton-c/include/proton/connection_driver.h0000664000000000000000000002275613257152177021355 0ustar #ifndef PROTON_CONNECTION_DRIVER_H #define PROTON_CONNECTION_DRIVER_H 1 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file * * @copybrief connection_driver * * @addtogroup connection_driver * @{ * * Associate a @ref connection and @ref transport with AMQP byte * streams from any source. * * - process AMQP-encoded bytes from some input byte stream * - generate ::pn_event_t events for your application to handle * - encode resulting AMQP output bytes for some output byte stream * * The `pn_connection_driver_*` functions provide a simplified API and * extra logic to use ::pn_connection_t and ::pn_transport_t as a * unit. You can also access them directly for features that do not * have `pn_connection_driver_*` functions. * * The driver buffers events and data. You should run it until * pn_connection_driver_finished() is true, to ensure all reading, * writing, and event handling (including `ERROR` and `FINAL` events) * is finished. * * ## Error handling * * The `pn_connection_driver_*` functions do not return an error * code. IO errors are set on the transport condition and are returned * as a `PN_TRANSPORT_ERROR`. The integration code can set errors * using pn_connection_driver_errorf(). * * ## IO patterns * * This API supports asynchronous, proactive, non-blocking and * reactive IO. An integration does not have to follow the * dispatch-read-write sequence above, but note that you should handle * all available events before calling * pn_connection_driver_read_buffer() and check that `size` is * non-zero before starting a blocking or asynchronous read call. A * `read` started while there are unprocessed `CLOSE` events in the * buffer may never complete. * * AMQP is a full-duplex, asynchronous protocol. The "read" and * "write" sides of an AMQP connection can close separately. * * ## Thread safety * * The @ref connection_driver types are not thread safe, but each * connection and its associated types form an independent * unit. Different connections can be processed concurrently by * different threads. */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * The elements needed to drive AMQP IO and events. */ typedef struct pn_connection_driver_t { pn_connection_t *connection; pn_transport_t *transport; pn_collector_t *collector; pn_event_batch_t batch; } pn_connection_driver_t; /** * Set connection and transport to the provided values, or create a new * @ref pn_connection_t or @ref pn_transport_t if either is NULL. * The provided values belong to the connection driver and will be freed by * pn_connection_driver_destroy(). * * The transport is bound automatically after the PN_CONNECTION_INIT has been is * handled by the application. It can be bound earlier with * pn_connection_driver_bind(). * * The following functions must be called before the transport is * bound to have effect: pn_connection_set_username(), pn_connection_set_password(), * pn_transport_set_server(). * * @return PN_OUT_OF_MEMORY if any allocation fails. */ PN_EXTERN int pn_connection_driver_init(pn_connection_driver_t*, pn_connection_t*, pn_transport_t*); /** * Force binding of the transport. This happens automatically after * the PN_CONNECTION_INIT is processed. * * @return PN_STATE_ERR if the transport is already bound. */ PN_EXTERN int pn_connection_driver_bind(pn_connection_driver_t *d); /** * Unbind, release and free the connection and transport. Set all pointers to * NULL. Does not free the @ref pn_connection_driver_t struct itself. */ PN_EXTERN void pn_connection_driver_destroy(pn_connection_driver_t *); /** * Disassociate the driver's connection from its transport and collector and * sets d->connection = NULL. Returns the previous value, which must be freed * by the caller. * * The transport and collector are still owned by the driver and will be freed by * pn_connection_driver_destroy(). * * @note This has nothing to do with pn_connection_release() */ PN_EXTERN pn_connection_t *pn_connection_driver_release_connection(pn_connection_driver_t *d); /** * Get the read buffer. * * Copy data from your input byte source to buf.start, up to buf.size. * Call pn_connection_driver_read_done() when reading is complete. * * buf.size==0 means reading is not possible: no buffer space or the read side is closed. */ PN_EXTERN pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *); /** * Process the first n bytes of data in pn_connection_driver_read_buffer() and * reclaim the buffer space. */ PN_EXTERN void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n); /** * Close the read side. Call when the IO can no longer be read. */ PN_EXTERN void pn_connection_driver_read_close(pn_connection_driver_t *); /** * True if read side is closed. */ PN_EXTERN bool pn_connection_driver_read_closed(pn_connection_driver_t *); /** * Get the write buffer. * * Write data from buf.start to your IO destination, up to a max of buf.size. * Call pn_connection_driver_write_done() when writing is complete. * * buf.size==0 means there is nothing to write. */ PN_EXTERN pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *); /** * Call when the first n bytes of pn_connection_driver_write_buffer() have been * written to IO. Reclaims the buffer space and reset the write buffer. */ PN_EXTERN void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n); /** * Close the write side. Call when IO can no longer be written to. */ PN_EXTERN void pn_connection_driver_write_close(pn_connection_driver_t *); /** * True if write side is closed. */ PN_EXTERN bool pn_connection_driver_write_closed(pn_connection_driver_t *); /** * Close both sides. */ PN_EXTERN void pn_connection_driver_close(pn_connection_driver_t * c); /** * Get the next event to handle. * * @return pointer is valid till the next call of * pn_connection_driver_next(). NULL if there are no more events available now, * reading/writing may produce more. */ PN_EXTERN pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *); /** * True if pn_connection_driver_next_event() will return a non-NULL event. */ PN_EXTERN bool pn_connection_driver_has_event(pn_connection_driver_t *); /** * Return true if the the driver is closed for reading and writing and there are * no more events. * * Call pn_connection_driver_free() to free all related memory. */ PN_EXTERN bool pn_connection_driver_finished(pn_connection_driver_t *); /** * Set transport error. * * The name and formatted description are set on the transport condition, and * returned as a PN_TRANSPORT_ERROR event from pn_connection_driver_next_event(). * * You must call this *before* pn_connection_driver_read_close() or * pn_connection_driver_write_close() to ensure the error is processed. */ PN_EXTERN void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...); /** * Set transport error via a va_list, see pn_connection_driver_errorf() */ PN_EXTERN void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list); /** * If batch is part of a connection_driver, return the connection_driver address, * else return NULL */ PN_EXTERN pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch); /** * The write side of the transport is closed, it will no longer produce bytes to write to * external IO. Synonym for PN_TRANSPORT_HEAD_CLOSED */ #define PN_TRANSPORT_WRITE_CLOSED PN_TRANSPORT_HEAD_CLOSED /** * The read side of the transport is closed, it will no longer read bytes from external * IO. Alias for PN_TRANSPORT_TAIL_CLOSED */ #define PN_TRANSPORT_READ_CLOSED PN_TRANSPORT_TAIL_CLOSED /** * **Deprecated** - Use pn_transport_log(). */ PN_EXTERN void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg); /** * **Deprecated** - Use pn_transport_logf(). */ PN_EXTERN void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt, ...); /** * **Deprecated** - Use pn_transport_vlogf(). */ PN_EXTERN void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap); /** * Associate a pn_connection_t with its pn_connection_driver_t. * * **NOTE**: this is only for use by IO integration writers. If you are using the standard * pn_proactor_t you *must not* use this function. * * @return pointer to the pn_connection_driver_t* field in a pn_connection_t. * * Return type is pointer to a pointer so that the caller can (if desired) use * atomic operations when loading and storing the value. */ PN_EXTERN pn_connection_driver_t **pn_connection_driver_ptr(pn_connection_t *connection); /** * @} */ #ifdef __cplusplus } #endif #endif /* connection_driver.h */ qpid-proton-0.22.0/proton-c/include/proton/connection.h0000664000000000000000000004131613257152177017773 0ustar #ifndef PROTON_CONNECTION_H #define PROTON_CONNECTION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief connection * * @addtogroup connection * @{ */ /** * The local @link pn_state_t endpoint state @endlink is uninitialized. */ #define PN_LOCAL_UNINIT (1) /** * The local @link pn_state_t endpoint state @endlink is active. */ #define PN_LOCAL_ACTIVE (2) /** * The local @link pn_state_t endpoint state @endlink is closed. */ #define PN_LOCAL_CLOSED (4) /** * The remote @link pn_state_t endpoint state @endlink is uninitialized. */ #define PN_REMOTE_UNINIT (8) /** * The remote @link pn_state_t endpoint state @endlink is active. */ #define PN_REMOTE_ACTIVE (16) /** * The remote @link pn_state_t endpoint state @endlink is closed. */ #define PN_REMOTE_CLOSED (32) /** * A mask for values of ::pn_state_t that preserves only the local * bits of an endpoint's state. */ #define PN_LOCAL_MASK (PN_LOCAL_UNINIT | PN_LOCAL_ACTIVE | PN_LOCAL_CLOSED) /** * A mask for values of ::pn_state_t that preserves only the remote * bits of an endpoint's state. */ #define PN_REMOTE_MASK (PN_REMOTE_UNINIT | PN_REMOTE_ACTIVE | PN_REMOTE_CLOSED) PN_EXTERN pn_connection_t *pn_connection(void); /** * Factory to construct a new Connection. * * @return pointer to a new connection object. */ PN_EXTERN pn_connection_t *pn_connection(void); /** * Free a connection object. * * When a connection object is freed, all ::pn_session_t, ::pn_link_t, * and ::pn_delivery_t objects associated with the connection are also * freed. * * @param[in] connection the connection object to free (or NULL) */ PN_EXTERN void pn_connection_free(pn_connection_t *connection); /** * Release a connection object. * * When a connection object is released, all ::pn_session_t and * ::pn_link_t, objects associated with the connection are also * released and all ::pn_delivery_t objects are settled. * * @param[in] connection the connection object to be released */ PN_EXTERN void pn_connection_release(pn_connection_t *connection); /** * **Deprecated** * * Get additional error information associated with the connection. * * Whenever a connection operation fails (i.e. returns an error code), * additional error details can be obtained using this function. The * error object that is returned may also be used to clear the error * condition. * * The pointer returned by this operation is valid until the * connection object is freed. * * @param[in] connection the connection object * @return the connection's error object */ PN_EXTERN pn_error_t *pn_connection_error(pn_connection_t *connection); /** * Associate a connection object with an event collector. * * By associating a connection object with an event collector, key * changes in endpoint state are reported to the collector via * ::pn_event_t objects that can be inspected and processed. See * ::pn_event_t for more details on the kinds of events. * * Note that by registering a collector, the user is requesting that * an indefinite number of events be queued up on his behalf. This * means that unless the application eventually processes these * events, the storage requirements for keeping them will grow without * bound. In other words, don't register a collector with a connection * if you never intend to process any of the events. * * @param[in] connection the connection object * @param[in] collector the event collector */ PN_EXTERN void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector); /** * Get the collector set with pn_connection_collect() * @return NULL if pn_connection_collect() has not been called. */ PN_EXTERN pn_collector_t* pn_connection_collector(pn_connection_t *connection); /** * **Deprecated** - Use ::pn_connection_attachments(). * * Get the application context that is associated with a connection * object. * * The application context for a connection may be set using * ::pn_connection_set_context. * * @param[in] connection the connection whose context is to be returned. * @return the application context for the connection object */ PN_EXTERN void *pn_connection_get_context(pn_connection_t *connection); /** * **Deprecated** - Use ::pn_connection_attachments(). * * Set a new application context for a connection object. * * The application context for a connection object may be retrieved * using ::pn_connection_get_context. * * @param[in] connection the connection object * @param[in] context the application context */ PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context); /** * Get the attachments that are associated with a connection object. * * @param[in] connection the connection whose attachments are to be returned. * @return the attachments for the connection object */ PN_EXTERN pn_record_t *pn_connection_attachments(pn_connection_t *connection); /** * Get the endpoint state flags for a connection. * * @param[in] connection the connection * @return the connection's state flags */ PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection); /** * Open a connection. * * Once this operation has completed, the PN_LOCAL_ACTIVE state flag * will be set. * * @param[in] connection the connection object */ PN_EXTERN void pn_connection_open(pn_connection_t *connection); /** * Close a connection. * * Once this operation has completed, the PN_LOCAL_CLOSED state flag * will be set. This may be called without calling * ::pn_connection_open, in this case it is equivalent to calling * ::pn_connection_open followed by ::pn_connection_close. * * @param[in] connection the connection object */ PN_EXTERN void pn_connection_close(pn_connection_t *connection); /** * Reset a connection object back to the uninitialized state. * * Note that this does *not* remove any contained ::pn_session_t, * ::pn_link_t, and ::pn_delivery_t objects. * * @param[in] connection the connection object */ PN_EXTERN void pn_connection_reset(pn_connection_t *connection); /** * Get the local condition associated with the connection endpoint. * * The ::pn_condition_t object retrieved may be modified prior to * closing the connection in order to indicate a particular condition * exists when the connection closes. This is normally used to * communicate error conditions to the remote peer, however it may * also be used in non error cases such as redirects. See * ::pn_condition_t for more details. * * The pointer returned by this operation is valid until the * connection object is freed. * * @param[in] connection the connection object * @return the connection's local condition object */ PN_EXTERN pn_condition_t *pn_connection_condition(pn_connection_t *connection); /** * Get the remote condition associated with the connection endpoint. * * The ::pn_condition_t object retrieved may be examined in order to * determine whether the remote peer was indicating some sort of * exceptional condition when the remote connection endpoint was * closed. The ::pn_condition_t object returned may not be modified. * * The pointer returned by this operation is valid until the * connection object is freed. * * @param[in] connection the connection object * @return the connection's remote condition object */ PN_EXTERN pn_condition_t *pn_connection_remote_condition(pn_connection_t *connection); /** * Get the AMQP Container name advertised by a connection object. * * The pointer returned by this operation is valid until * ::pn_connection_set_container is called, or until the connection * object is freed, whichever happens sooner. * * @param[in] connection the connection object * @return a pointer to the container name */ PN_EXTERN const char *pn_connection_get_container(pn_connection_t *connection); /** * Set the AMQP Container name advertised by a connection object. * * @param[in] connection the connection object * @param[in] container the container name */ PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container); /** * Set the authentication username for a client connection * * It is necessary to set the username and password before binding the connection * to a transport and it isn't allowed to change them after the binding. * * If not set then no authentication will be negotiated unless the client * sasl layer is explicitly created (this would be for something like Kerberos * where the credentials are implicit in the environment, or to explicitly use * the ANONYMOUS SASL mechanism) * * @param[in] connection the connection * @param[in] user the username */ PN_EXTERN void pn_connection_set_user(pn_connection_t *connection, const char *user); /** * Set the authentication password for a client connection * * It is necessary to set the username and password before binding the connection * to a transport and it isn't allowed to change them after the binding. * * Note that the password is write only and has no accessor as the underlying * implementation should be zeroing the password after use to avoid the password * being present in memory longer than necessary * * @param[in] connection the connection * @param[in] password the password corresponding to the username - this will be copied and zeroed out after use */ PN_EXTERN void pn_connection_set_password(pn_connection_t *connection, const char *password); /** * Get the authentication username for a client connection * * @param[in] connection the connection * @return the username passed into the connection */ PN_EXTERN const char *pn_connection_get_user(pn_connection_t *connection); /** * Get the value of the AMQP Hostname used by a connection object. * * The pointer returned by this operation is valid until * ::pn_connection_set_hostname is called, or until the connection * object is freed, whichever happens sooner. * * @param[in] connection the connection object * @return a pointer to the hostname */ PN_EXTERN const char *pn_connection_get_hostname(pn_connection_t *connection); /** * Set the name of the virtual host (either fully qualified or relative) to * which this connection is connecting to. This information may be used by the * remote peer to determine the correct back-end service to connect the client * to. This value will be sent in the Open performative, and will be used by * SSL and SASL layers to identify the peer. * * @note Note: the virtual host string is passed verbatim, it is not parsed as * a URL or modified in any way. It should not contain numeric IP addresses or * port numbers unless that is what you intend to send as the virtual host name * @param[in] connection the connection object * @param[in] hostname the virtual host name */ PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname); /** * Get the AMQP Container name advertised by the remote connection * endpoint. * * This will return NULL until the ::PN_REMOTE_ACTIVE state is * reached. See ::pn_state_t for more details on endpoint state. * * Any non null pointer returned by this operation will be valid until * the connection object is unbound from a transport or freed, * whichever happens sooner. * * @param[in] connection the connection object * @return a pointer to the remote container name */ PN_EXTERN const char *pn_connection_remote_container(pn_connection_t *connection); /** * Get the AMQP Hostname set by the remote connection endpoint. * * This will return NULL until the ::PN_REMOTE_ACTIVE state is * reached. See ::pn_state_t for more details on endpoint state. * * Any non null pointer returned by this operation will be valid until * the connection object is unbound from a transport or freed, * whichever happens sooner. * * @param[in] connection the connection object * @return a pointer to the remote hostname */ PN_EXTERN const char *pn_connection_remote_hostname(pn_connection_t *connection); /** * Access/modify the AMQP offered capabilities data for a connection * object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. Any data contained * by the ::pn_data_t object will be sent as the offered capabilities * for the parent connection object. Note that this MUST take the form * of an array of symbols to be valid. * * The ::pn_data_t pointer returned is valid until the connection * object is freed. * * @param[in] connection the connection object * @return a pointer to a pn_data_t representing the offered capabilities */ PN_EXTERN pn_data_t *pn_connection_offered_capabilities(pn_connection_t *connection); /** * Access/modify the AMQP desired capabilities data for a connection * object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. Any data contained * by the ::pn_data_t object will be sent as the desired capabilities * for the parent connection object. Note that this MUST take the form * of an array of symbols to be valid. * * The ::pn_data_t pointer returned is valid until the connection * object is freed. * * @param[in] connection the connection object * @return a pointer to a pn_data_t representing the desired capabilities */ PN_EXTERN pn_data_t *pn_connection_desired_capabilities(pn_connection_t *connection); /** * Access/modify the AMQP properties data for a connection object. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. Any data contained * by the ::pn_data_t object will be sent as the AMQP properties for * the parent connection object. Note that this MUST take the form of * a symbol keyed map to be valid. * * The ::pn_data_t pointer returned is valid until the connection * object is freed. * * @param[in] connection the connection object * @return a pointer to a pn_data_t representing the connection properties */ PN_EXTERN pn_data_t *pn_connection_properties(pn_connection_t *connection); /** * Access the AMQP offered capabilities supplied by the remote * connection endpoint. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. This data object * will be empty until the remote connection is opened as indicated by * the ::PN_REMOTE_ACTIVE flag. * * @param[in] connection the connection object * @return the remote offered capabilities */ PN_EXTERN pn_data_t *pn_connection_remote_offered_capabilities(pn_connection_t *connection); /** * Access the AMQP desired capabilities supplied by the remote * connection endpoint. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. This data object * will be empty until the remote connection is opened as indicated by * the ::PN_REMOTE_ACTIVE flag. * * @param[in] connection the connection object * @return the remote desired capabilities */ PN_EXTERN pn_data_t *pn_connection_remote_desired_capabilities(pn_connection_t *connection); /** * Access the AMQP connection properties supplied by the remote * connection endpoint. * * This operation will return a pointer to a ::pn_data_t object that * is valid until the connection object is freed. This data object * will be empty until the remote connection is opened as indicated by * the ::PN_REMOTE_ACTIVE flag. * * @param[in] connection the connection object * @return the remote connection properties */ PN_EXTERN pn_data_t *pn_connection_remote_properties(pn_connection_t *connection); /** * Get the transport bound to a connection object. * * If the connection is unbound, then this operation will return NULL. * * @param[in] connection the connection object * @return the transport bound to a connection, or NULL if the * connection is unbound */ PN_EXTERN pn_transport_t *pn_connection_transport(pn_connection_t *connection); /** * @} */ #ifdef __cplusplus } #endif #endif /* connection.h */ qpid-proton-0.22.0/proton-c/include/proton/condition.h0000664000000000000000000001413213257152177017616 0ustar #ifndef PROTON_CONDITION_H #define PROTON_CONDITION_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief condition * * @addtogroup condition * @{ */ /** * An AMQP Condition object. Conditions hold exception information * pertaining to the closing of an AMQP endpoint such as a Connection, * Session, or Link. Conditions also hold similar information * pertaining to deliveries that have reached terminal states. * Connections, Sessions, Links, and Deliveries may all have local and * remote conditions associated with them. * * The local condition may be modified by the local endpoint to signal * a particular condition to the remote peer. The remote condition may * be examined by the local endpoint to detect whatever condition the * remote peer may be signaling. Although often conditions are used to * indicate errors, not all conditions are errors per/se, e.g. * conditions may be used to redirect a connection from one host to * another. * * Every condition has a short symbolic name, a longer description, * and an additional info map associated with it. The name identifies * the formally defined condition, and the map contains additional * information relevant to the identified condition. */ typedef struct pn_condition_t pn_condition_t; /** * Returns true if the condition object is holding some information, * i.e. if the name is set to some non NULL value. Returns false * otherwise. * * @param[in] condition the condition object to test * @return true iff some condition information is set */ PN_EXTERN bool pn_condition_is_set(pn_condition_t *condition); /** * Clears the condition object of any exceptional information. After * calling ::pn_condition_clear(), ::pn_condition_is_set() is * guaranteed to return false and ::pn_condition_get_name() as well as * ::pn_condition_get_description() will return NULL. The ::pn_data_t * returned by ::pn_condition_info() will still be valid, but will * have been cleared as well (See ::pn_data_clear()). * * @param[in] condition the condition object to clear */ PN_EXTERN void pn_condition_clear(pn_condition_t *condition); /** * Returns the name associated with the exceptional condition, or NULL * if there is no conditional information set. * * @param[in] condition the condition object * @return a pointer to the name, or NULL */ PN_EXTERN const char *pn_condition_get_name(pn_condition_t *condition); /** * Sets the name associated with the exceptional condition. * * @param[in] condition the condition object * @param[in] name the desired name * @return an error code or 0 on success */ PN_EXTERN int pn_condition_set_name(pn_condition_t *condition, const char *name); /** * Gets the description associated with the exceptional condition. * * @param[in] condition the condition object * @return a pointer to the description, or NULL */ PN_EXTERN const char *pn_condition_get_description(pn_condition_t *condition); /** * Sets the description associated with the exceptional condition. * * @param[in] condition the condition object * @param[in] description the desired description * @return an error code or 0 on success */ PN_EXTERN int pn_condition_set_description(pn_condition_t *condition, const char *description); /** * Returns a data object that holds the additional information * associated with the condition. The data object may be used both to * access and to modify the additional information associated with the * condition. * * @param[in] condition the condition object * @return a data object holding the additional information for the condition */ PN_EXTERN pn_data_t *pn_condition_info(pn_condition_t *condition); /** * Set the name and printf-style formatted description. */ PN_EXTERN int pn_condition_vformat(pn_condition_t *, const char *name, const char *fmt, va_list ap); /** * Set the name and printf-style formatted description. */ PN_EXTERN int pn_condition_format(pn_condition_t *, const char *name, const char *fmt, ...); /** * Returns true if the condition is a redirect. * * @param[in] condition the condition object * @return true if the condition is a redirect, false otherwise */ PN_EXTERN bool pn_condition_is_redirect(pn_condition_t *condition); /** * Retrieves the redirect host from the additional information * associated with the condition. If the condition is not a redirect, * this will return NULL. * * @param[in] condition the condition object * @return the redirect host or NULL */ PN_EXTERN const char *pn_condition_redirect_host(pn_condition_t *condition); /** * Retrieves the redirect port from the additional information * associated with the condition. If the condition is not a redirect, * this will return an error code. * * @param[in] condition the condition object * @return the redirect port or an error code */ PN_EXTERN int pn_condition_redirect_port(pn_condition_t *condition); /** * Copy the src condition to the dst condition. */ PN_EXTERN int pn_condition_copy(pn_condition_t *dest, pn_condition_t *src); /** * Create a condition object. */ PN_EXTERN pn_condition_t *pn_condition(void); /** * Free a condition object. */ PN_EXTERN void pn_condition_free(pn_condition_t *); /** * @} */ #ifdef __cplusplus } #endif #endif /* condition.h */ qpid-proton-0.22.0/proton-c/include/proton/codec.h0000664000000000000000000010243713257152177016713 0ustar #ifndef PROTON_CODEC_H #define PROTON_CODEC_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /** * @file * * @copybrief codec */ /** * Identifies an AMQP type. * * @ingroup amqp_types */ typedef enum { /** * The NULL AMQP type. */ PN_NULL = 1, /** * The boolean AMQP type. */ PN_BOOL = 2, /** * The unsigned byte AMQP type. An 8 bit unsigned integer. */ PN_UBYTE = 3, /** * The byte AMQP type. An 8 bit signed integer. */ PN_BYTE = 4, /** * The unsigned short AMQP type. A 16 bit unsigned integer. */ PN_USHORT = 5, /** * The short AMQP type. A 16 bit signed integer. */ PN_SHORT = 6, /** * The unsigned int AMQP type. A 32 bit unsigned integer. */ PN_UINT = 7, /** * The signed int AMQP type. A 32 bit signed integer. */ PN_INT = 8, /** * The char AMQP type. A 32 bit unicode character. */ PN_CHAR = 9, /** * The ulong AMQP type. An unsigned 32 bit integer. */ PN_ULONG = 10, /** * The long AMQP type. A signed 32 bit integer. */ PN_LONG = 11, /** * The timestamp AMQP type. A signed 64 bit value measuring * milliseconds since the epoch. */ PN_TIMESTAMP = 12, /** * The float AMQP type. A 32 bit floating point value. */ PN_FLOAT = 13, /** * The double AMQP type. A 64 bit floating point value. */ PN_DOUBLE = 14, /** * The decimal32 AMQP type. A 32 bit decimal floating point value. */ PN_DECIMAL32 = 15, /** * The decimal64 AMQP type. A 64 bit decimal floating point value. */ PN_DECIMAL64 = 16, /** * The decimal128 AMQP type. A 128 bit decimal floating point value. */ PN_DECIMAL128 = 17, /** * The UUID AMQP type. A 16 byte UUID. */ PN_UUID = 18, /** * The binary AMQP type. A variable length sequence of bytes. */ PN_BINARY = 19, /** * The string AMQP type. A variable length sequence of unicode * characters. */ PN_STRING = 20, /** * The symbol AMQP type. A variable length sequence of unicode * characters. */ PN_SYMBOL = 21, /** * A described AMQP type. */ PN_DESCRIBED = 22, /** * An AMQP array. A monomorphic sequence of other AMQP values. */ PN_ARRAY = 23, /** * An AMQP list. A polymorphic sequence of other AMQP values. */ PN_LIST = 24, /** * An AMQP map. A polymorphic container of other AMQP values formed * into key/value pairs. */ PN_MAP = 25, /** * A special invalid type value that is returned when no valid type * is available. */ PN_INVALID = -1 } pn_type_t; /** * Return a string name for an AMQP type. * * @ingroup amqp_types * @param type an AMQP type * @return the string name of the given type */ PN_EXTERN const char *pn_type_name(pn_type_t type); /** * A discriminated union that holds any scalar AMQP value. The type * field indicates the AMQP type of the value, and the union may be * used to access the value for a given type. * * @ingroup api_types */ typedef struct { /** * Indicates the type of value the atom is currently pointing to. * See ::pn_type_t for details on AMQP types. */ pn_type_t type; union { /** * Valid when type is ::PN_BOOL. */ bool as_bool; /** * Valid when type is ::PN_UBYTE. */ uint8_t as_ubyte; /** * Valid when type is ::PN_BYTE. */ int8_t as_byte; /** * Valid when type is ::PN_USHORT. */ uint16_t as_ushort; /** * Valid when type is ::PN_SHORT. */ int16_t as_short; /** * Valid when type is ::PN_UINT. */ uint32_t as_uint; /** * Valid when type is ::PN_INT. */ int32_t as_int; /** * Valid when type is ::PN_CHAR. */ pn_char_t as_char; /** * Valid when type is ::PN_ULONG. */ uint64_t as_ulong; /** * Valid when type is ::PN_LONG. */ int64_t as_long; /** * Valid when type is ::PN_TIMESTAMP. */ pn_timestamp_t as_timestamp; /** * Valid when type is ::PN_FLOAT. */ float as_float; /** * Valid when type is ::PN_DOUBLE. */ double as_double; /** * Valid when type is ::PN_DECIMAL32. */ pn_decimal32_t as_decimal32; /** * Valid when type is ::PN_DECIMAL64. */ pn_decimal64_t as_decimal64; /** * Valid when type is ::PN_DECIMAL128. */ pn_decimal128_t as_decimal128; /** * Valid when type is ::PN_UUID. */ pn_uuid_t as_uuid; /** * Valid when type is ::PN_BINARY or ::PN_STRING or ::PN_SYMBOL. * When the type is ::PN_STRING the field will point to utf8 * encoded unicode. When the type is ::PN_SYMBOL, the field will * point to 7-bit ASCII. In the latter two cases, the bytes * pointed to are *not* necessarily null terminated. */ pn_bytes_t as_bytes; } u; } pn_atom_t; /** * @addtogroup data * @{ */ /** * An AMQP Data object. * * A pn_data_t object provides an interface for decoding, extracting, * creating, and encoding arbitrary AMQP data. A pn_data_t object * contains a tree of AMQP values. Leaf nodes in this tree correspond * to scalars in the AMQP type system such as @link ::PN_INT ints * @endlink or @link ::PN_STRING strings @endlink. Non-leaf nodes in * this tree correspond to compound values in the AMQP type system * such as @link ::PN_LIST lists @endlink, @link ::PN_MAP maps * @endlink, @link ::PN_ARRAY arrays @endlink, or @link ::PN_DESCRIBED * described @endlink values. The root node of the tree is the * pn_data_t object itself and can have an arbitrary number of * children. * * A pn_data_t object maintains the notion of the current node and the * current parent node. Siblings are ordered within their parent. * Values are accessed and/or added by using the ::pn_data_next(), * ::pn_data_prev(), ::pn_data_enter(), and ::pn_data_exit() * operations to navigate to the desired location in the tree and * using the supplied variety of pn_data_put_* / pn_data_get_* * operations to access or add a value of the desired type. * * The pn_data_put_* operations will always add a value _after_ the * current node in the tree. If the current node has a next sibling * the pn_data_put_* operations will overwrite the value on this node. * If there is no current node or the current node has no next sibling * then one will be added. The pn_data_put_* operations always set the * added/modified node to the current node. The pn_data_get_* * operations read the value of the current node and do not change * which node is current. * * The following types of scalar values are supported: * * - ::PN_NULL * - ::PN_BOOL * - ::PN_UBYTE * - ::PN_USHORT * - ::PN_SHORT * - ::PN_UINT * - ::PN_INT * - ::PN_ULONG * - ::PN_LONG * - ::PN_FLOAT * - ::PN_DOUBLE * - ::PN_BINARY * - ::PN_STRING * - ::PN_SYMBOL * * The following types of compound values are supported: * * - ::PN_DESCRIBED * - ::PN_ARRAY * - ::PN_LIST * - ::PN_MAP */ typedef struct pn_data_t pn_data_t; /** * Construct a pn_data_t object with the supplied initial capacity. A * pn_data_t will grow automatically as needed, so an initial capacity * of 0 is permitted. * * @param capacity the initial capacity * @return the newly constructed pn_data_t */ PN_EXTERN pn_data_t *pn_data(size_t capacity); /** * Free a pn_data_t object. * * @param data a pn_data_t object or NULL */ PN_EXTERN void pn_data_free(pn_data_t *data); /** * Access the current error code for a given pn_data_t. * * @param data a pn_data_t object * @return the current error code */ PN_EXTERN int pn_data_errno(pn_data_t *data); /** * Access the current error for a given pn_data_t. * * Every pn_data_t has an error descriptor that is created with the * pn_data_t and dies with the pn_data_t. The error descriptor is * updated whenever an operation fails. The ::pn_data_error() function * may be used to access a pn_data_t's error descriptor. * * @param data a pn_data_t object * @return a pointer to the pn_data_t's error descriptor */ PN_EXTERN pn_error_t *pn_data_error(pn_data_t *data); /** * @cond INTERNAL */ PN_EXTERN int pn_data_vfill(pn_data_t *data, const char *fmt, va_list ap); PN_EXTERN int pn_data_fill(pn_data_t *data, const char *fmt, ...); PN_EXTERN int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap); PN_EXTERN int pn_data_scan(pn_data_t *data, const char *fmt, ...); /** * @endcond */ /** * Clears a pn_data_t object. * * A cleared pn_data_t object is equivalent to a newly constructed * one. * * @param data the pn_data_t object to clear */ PN_EXTERN void pn_data_clear(pn_data_t *data); /** * Returns the total number of nodes contained in a pn_data_t object. * This includes all parents, children, siblings, grandchildren, etc. * In other words the count of all ancestors and descendants of the * current node, along with the current node if there is one. * * @param data a pn_data_t object * @return the total number of nodes in the pn_data_t object */ PN_EXTERN size_t pn_data_size(pn_data_t *data); /** * Clears current node pointer and sets the parent to the root node. * Clearing the current node sets it _before_ the first node, calling * ::pn_data_next() will advance to the first node. */ PN_EXTERN void pn_data_rewind(pn_data_t *data); /** * Advances the current node to its next sibling and returns true. If * there is no next sibling the current node remains unchanged and * false is returned. * * @param data a pn_data_t object * @return true iff the current node was changed */ PN_EXTERN bool pn_data_next(pn_data_t *data); /** * Moves the current node to its previous sibling and returns true. If * there is no previous sibling the current node remains unchanged and * false is returned. * * @param data a pn_data_t object * @return true iff the current node was changed */ PN_EXTERN bool pn_data_prev(pn_data_t *data); /** * Sets the parent node to the current node and clears the current * node. Clearing the current node sets it _before_ the first child, * calling ::pn_data_next() advances to the first child. This * operation will return false if there is no current node or if the * current node is not a compound type. * * @param data a pn_data_object * @return true iff the pointers to the current/parent nodes are changed */ PN_EXTERN bool pn_data_enter(pn_data_t *data); /** * Sets the current node to the parent node and the parent node to its * own parent. This operation will return false if there is no current * node or parent node. * * @param data a pn_data object * @return true iff the pointers to the current/parent nodes are * changed */ PN_EXTERN bool pn_data_exit(pn_data_t *data); /** * @cond INTERNAL */ PN_EXTERN bool pn_data_lookup(pn_data_t *data, const char *name); /** * @endcond */ /** * Access the type of the current node. Returns PN_INVALID if there is no * current node. * * @param data a data object * @return the type of the current node */ PN_EXTERN pn_type_t pn_data_type(pn_data_t *data); /** * Prints the contents of a pn_data_t object using ::pn_data_format() * to stdout. * * @param data a pn_data_t object * @return zero on success or an error on failure */ PN_EXTERN int pn_data_print(pn_data_t *data); /** * Formats the contents of a pn_data_t object in a human readable way * and writes them to the indicated location. The size pointer must * hold the amount of free space following the bytes pointer, and upon * success will be updated to indicate how much space has been used. * * @param data a pn_data_t object * @param bytes a buffer to write the output to * @param size a pointer to the size of the buffer * @return zero on success, or an error on failure */ PN_EXTERN int pn_data_format(pn_data_t *data, char *bytes, size_t *size); /** * Writes the contents of a data object to the given buffer as an AMQP * data stream. * * @param data the data object to encode * @param bytes the buffer for encoded data * @param size the size of the buffer * * @return the size of the encoded data on success or an error code on failure */ PN_EXTERN ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size); /** * Returns the number of bytes needed to encode a data object. * * @param data the data object * * @return the size of the encoded data or an error code if data is invalid. */ PN_EXTERN ssize_t pn_data_encoded_size(pn_data_t *data); /** * Decodes a single value from the contents of the AMQP data stream * into the current data object. Note that if the pn_data_t object is * pointing to a current node, the decoded value will overwrite the * current one. If the pn_data_t object has no current node then a * node will be appended to the current parent. If there is no current * parent then a node will be appended to the pn_data_t itself. * * Upon success, this operation returns the number of bytes consumed * from the AMQP data stream. Upon failure, this operation returns an * error code. * * @param data a pn_data_t object * @param bytes a pointer to an encoded AMQP data stream * @param size the size of the encoded AMQP data stream * @return the number of bytes consumed from the AMQP data stream or an error code */ PN_EXTERN ssize_t pn_data_decode(pn_data_t *data, const char *bytes, size_t size); /** * Puts an empty list value into a pn_data_t. Elements may be filled * by entering the list node using ::pn_data_enter() and using * pn_data_put_* to add the desired contents. Once done, * ::pn_data_exit() may be used to return to the current level in the * tree and put more values. * * @code * pn_data_t *data = pn_data(0); * ... * pn_data_put_list(data); * pn_data_enter(data); * pn_data_put_int(data, 1); * pn_data_put_int(data, 2); * pn_data_put_int(data, 3); * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_list(pn_data_t *data); /** * Puts an empty map value into a pn_data_t. Elements may be filled by * entering the map node and putting alternating key value pairs. * * @code * pn_data_t *data = pn_data(0); * ... * pn_data_put_map(data); * pn_data_enter(data); * pn_data_put_string(data, pn_bytes(3, "key")); * pn_data_put_string(data, pn_bytes(5, "value")); * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_map(pn_data_t *data); /** * Puts an empty array value into a pn_data_t. Elements may be filled * by entering the array node and putting the element values. The * values must all be of the specified array element type. If an array * is described then the first child value of the array is the * descriptor and may be of any type. * * @code * pn_data_t *data = pn_data(0); * ... * pn_data_put_array(data, false, PN_INT); * pn_data_enter(data); * pn_data_put_int(data, 1); * pn_data_put_int(data, 2); * pn_data_put_int(data, 3); * pn_data_exit(data); * ... * pn_data_put_array(data, True, Data.DOUBLE); * pn_data_enter(data); * pn_data_put_symbol(data, "array-descriptor"); * pn_data_put_double(data, 1.1); * pn_data_put_double(data, 1.2); * pn_data_put_double(data, 1.3); * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @param described specifies whether the array is described * @param type the type of the array * * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_array(pn_data_t *data, bool described, pn_type_t type); /** * Puts a described value into a pn_data_t object. A described node * has two children, the descriptor and the value. These are specified * by entering the node and putting the desired values. * * @code * pn_data_t *data = pn_data(0); * ... * pn_data_put_described(data); * pn_data_enter(data); * pn_data_put_symbol(data, pn_bytes(16, "value-descriptor")); * pn_data_put_string(data, pn_bytes(9, "the value")); * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_described(pn_data_t *data); /** * Puts a ::PN_NULL value. * * @param data a pn_data_t object * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_null(pn_data_t *data); /** * Puts a ::PN_BOOL value. * * @param data a pn_data_t object * @param b the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_bool(pn_data_t *data, bool b); /** * Puts a ::PN_UBYTE value. * * @param data a pn_data_t object * @param ub the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_ubyte(pn_data_t *data, uint8_t ub); /** * Puts a ::PN_BYTE value. * * @param data a pn_data_t object * @param b the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_byte(pn_data_t *data, int8_t b); /** * Puts a ::PN_USHORT value. * * @param data a pn_data_t object * @param us the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_ushort(pn_data_t *data, uint16_t us); /** * Puts a ::PN_SHORT value. * * @param data a pn_data_t object * @param s the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_short(pn_data_t *data, int16_t s); /** * Puts a ::PN_UINT value. * * @param data a pn_data_t object * @param ui the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_uint(pn_data_t *data, uint32_t ui); /** * Puts a ::PN_INT value. * * @param data a pn_data_t object * @param i the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_int(pn_data_t *data, int32_t i); /** * Puts a ::PN_CHAR value. * * @param data a pn_data_t object * @param c the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_char(pn_data_t *data, pn_char_t c); /** * Puts a ::PN_ULONG value. * * @param data a pn_data_t object * @param ul the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_ulong(pn_data_t *data, uint64_t ul); /** * Puts a ::PN_LONG value. * * @param data a pn_data_t object * @param l the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_long(pn_data_t *data, int64_t l); /** * Puts a ::PN_TIMESTAMP value. * * @param data a pn_data_t object * @param t the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_timestamp(pn_data_t *data, pn_timestamp_t t); /** * Puts a ::PN_FLOAT value. * * @param data a pn_data_t object * @param f the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_float(pn_data_t *data, float f); /** * Puts a ::PN_DOUBLE value. * * @param data a pn_data_t object * @param d the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_double(pn_data_t *data, double d); /** * Puts a ::PN_DECIMAL32 value. * * @param data a pn_data_t object * @param d the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_decimal32(pn_data_t *data, pn_decimal32_t d); /** * Puts a ::PN_DECIMAL64 value. * * @param data a pn_data_t object * @param d the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_decimal64(pn_data_t *data, pn_decimal64_t d); /** * Puts a ::PN_DECIMAL128 value. * * @param data a pn_data_t object * @param d the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_decimal128(pn_data_t *data, pn_decimal128_t d); /** * Puts a ::PN_UUID value. * * @param data a pn_data_t object * @param u the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_uuid(pn_data_t *data, pn_uuid_t u); /** * Puts a ::PN_BINARY value. The bytes referenced by the pn_bytes_t * argument are copied and stored inside the pn_data_t object. * * @param data a pn_data_t object * @param bytes the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_binary(pn_data_t *data, pn_bytes_t bytes); /** * Puts a ::PN_STRING value. The bytes referenced by the pn_bytes_t * argument are copied and stored inside the pn_data_t object. * * @param data a pn_data_t object * @param string utf8 encoded unicode * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_string(pn_data_t *data, pn_bytes_t string); /** * Puts a ::PN_SYMBOL value. The bytes referenced by the pn_bytes_t * argument are copied and stored inside the pn_data_t object. * * @param data a pn_data_t object * @param symbol ascii encoded symbol * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_symbol(pn_data_t *data, pn_bytes_t symbol); /** * Puts any scalar value value. * * @param data a pn_data_t object * @param atom the value * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_put_atom(pn_data_t *data, pn_atom_t atom); /** * If the current node is a list, return the number of elements, * otherwise return zero. List elements can be accessed by entering * the list. * * @code * ... * size_t count = pn_data_get_list(data); * pn_data_enter(data); * for (size_t i = 0; i < count; i++) { * if (pn_data_next(data)) { * switch (pn_data_type(data)) { * case PN_STRING: * ... * break; * case PN_INT: * ... * break; * } * } * pn_data_exit(data); * ... * @endcode .* * @param data a pn_data_t object * @return the size of a list node */ PN_EXTERN size_t pn_data_get_list(pn_data_t *data); /** * If the current node is a map, return the number of child elements, * otherwise return zero. Key value pairs can be accessed by entering * the map. * * @code * ... * size_t count = pn_data_get_map(data); * pn_data_enter(data); * for (size_t i = 0; i < count/2; i++) { * // read key * if (pn_data_next(data)) { * switch (pn_data_type(data)) { * case PN_STRING: * ... * break; * ... * } * } * ... * // read value * if (pn_data_next(data)) { * switch (pn_data_type(data)) { * case PN_INT: * ... * break; * ... * } * } * ... * } * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @return the number of child elements of a map node */ PN_EXTERN size_t pn_data_get_map(pn_data_t *data); /** * If the current node is an array, return the number of elements in * the array, otherwise return 0. Array data can be accessed by * entering the array. If the array is described, the first child node * will be the descriptor, and the remaining count child nodes * will be the elements of the array. * * @code * ... * size_t count = pn_data_get_array(data); * bool described = pn_data_is_array_described(data); * pn_type_t type = pn_data_get_array_type(data); * * pn_data_enter(data); * * if (described && pn_data_next(data)) { * // the descriptor could be another type, but let's assume it's a symbol * pn_bytes_t descriptor = pn_data_get_symbol(data); * } * * for (size_t i = 0; i < count; i++) { * if (pn_data_next(data)) { * // all elements will be values of the array type retrieved above * ... * } * } * pn_data_exit(data); * ... * @endcode * * @param data a pn_data_t object * @return the number of elements of an array node */ PN_EXTERN size_t pn_data_get_array(pn_data_t *data); /** * Returns true if the current node points to a described array. * * @param data a pn_data_t object * @return true if the current node points to a described array */ PN_EXTERN bool pn_data_is_array_described(pn_data_t *data); /** * Return the array type if the current node points to an array, * PN_INVALID otherwise. * * @param data a pn_data_t object * @return the element type of an array node */ PN_EXTERN pn_type_t pn_data_get_array_type(pn_data_t *data); /** * Checks if the current node is a described value. The descriptor and * value may be accessed by entering the described value node. * * @code * ... * // read a symbolically described string * if (pn_data_is_described(data)) { * pn_data_enter(data); * pn_data_next(data); * assert(pn_data_type(data) == PN_SYMBOL); * pn_bytes_t symbol = pn_data_get_symbol(data); * pn_data_next(data); * assert(pn_data_type(data) == PN_STRING); * pn_bytes_t utf8 = pn_data_get_string(data); * pn_data_exit(data); * } * ... * @endcode * * @param data a pn_data_t object * @return true if the current node is a described type */ PN_EXTERN bool pn_data_is_described(pn_data_t *data); /** * Checks if the current node is a ::PN_NULL. * * @param data a pn_data_t object * @return true iff the current node is ::PN_NULL */ PN_EXTERN bool pn_data_is_null(pn_data_t *data); /** * If the current node is a ::PN_BOOL, returns its value. * * @param data a pn_data_t object */ PN_EXTERN bool pn_data_get_bool(pn_data_t *data); /** * If the current node is a ::PN_UBYTE, return its value, otherwise * return 0. * * @param data a pn_data_t object */ PN_EXTERN uint8_t pn_data_get_ubyte(pn_data_t *data); /** * If the current node is a signed byte, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN int8_t pn_data_get_byte(pn_data_t *data); /** * If the current node is an unsigned short, returns its value, * returns 0 otherwise. * * @param data a pn_data_t object */ PN_EXTERN uint16_t pn_data_get_ushort(pn_data_t *data); /** * If the current node is a signed short, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN int16_t pn_data_get_short(pn_data_t *data); /** * If the current node is an unsigned int, returns its value, returns * 0 otherwise. * * @param data a pn_data_t object */ PN_EXTERN uint32_t pn_data_get_uint(pn_data_t *data); /** * If the current node is a signed int, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN int32_t pn_data_get_int(pn_data_t *data); /** * If the current node is a char, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN pn_char_t pn_data_get_char(pn_data_t *data); /** * If the current node is an unsigned long, returns its value, returns * 0 otherwise. * * @param data a pn_data_t object */ PN_EXTERN uint64_t pn_data_get_ulong(pn_data_t *data); /** * If the current node is an signed long, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN int64_t pn_data_get_long(pn_data_t *data); /** * If the current node is a timestamp, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN pn_timestamp_t pn_data_get_timestamp(pn_data_t *data); /** * If the current node is a float, returns its value, raises 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN float pn_data_get_float(pn_data_t *data); /** * If the current node is a double, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN double pn_data_get_double(pn_data_t *data); /** * If the current node is a decimal32, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN pn_decimal32_t pn_data_get_decimal32(pn_data_t *data); /** * If the current node is a decimal64, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN pn_decimal64_t pn_data_get_decimal64(pn_data_t *data); /** * If the current node is a decimal128, returns its value, returns 0 * otherwise. * * @param data a pn_data_t object */ PN_EXTERN pn_decimal128_t pn_data_get_decimal128(pn_data_t *data); /** * If the current node is a UUID, returns its value, returns None * otherwise. * * @param data a pn_data_t object * @return a uuid value */ PN_EXTERN pn_uuid_t pn_data_get_uuid(pn_data_t *data); /** * If the current node is binary, returns its value, returns "" * otherwise. The pn_bytes_t returned will point to memory held inside * the pn_data_t. When the pn_data_t is cleared or freed, this memory * will be reclaimed. * * @param data a pn_data_t object */ PN_EXTERN pn_bytes_t pn_data_get_binary(pn_data_t *data); /** * If the current node is a string, returns its value, returns "" * otherwise. The pn_bytes_t returned will point to memory held inside * the pn_data_t. When the pn_data_t is cleared or freed, this memory * will be reclaimed. * * @param data a pn_data_t object * @return a pn_bytes_t pointing to utf8 */ PN_EXTERN pn_bytes_t pn_data_get_string(pn_data_t *data); /** * If the current node is a symbol, returns its value, returns "" * otherwise. The pn_bytes_t returned will point to memory held inside * the pn_data_t. When the pn_data_t is cleared or freed, this memory * will be reclaimed. * * @param data a pn_data_t object * @return a pn_bytes_t pointing to ascii */ PN_EXTERN pn_bytes_t pn_data_get_symbol(pn_data_t *data); /** * If the current node is a symbol, string, or binary, return the * bytes representing its value. The pn_bytes_t returned will point to * memory held inside the pn_data_t. When the pn_data_t is cleared or * freed, this memory will be reclaimed. * * @param data a pn_data_t object * @return a pn_bytes_t pointing to the node's value */ PN_EXTERN pn_bytes_t pn_data_get_bytes(pn_data_t *data); /** * If the current node is a scalar value, return it as a pn_atom_t. * * @param data a pn_data_t object * @return the value of the current node as pn_atom_t */ PN_EXTERN pn_atom_t pn_data_get_atom(pn_data_t *data); /** * Copy the contents of another pn_data_t object. Any values in the * data object will be lost. * * @param data a pn_data_t object * @param src the source pn_data_t to copy from * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_copy(pn_data_t *data, pn_data_t *src); /** * Append the contents of another pn_data_t object. * * @param data a pn_data_t object * @param src the source pn_data_t to append from * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_append(pn_data_t *data, pn_data_t *src); /** * Append up to _n_ values from the contents of another pn_data_t * object. * * @param data a pn_data_t object * @param src the source pn_data_t to append from * @param limit the maximum number of values to append * @return zero on success or an error code on failure */ PN_EXTERN int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit); /** * Modify a pn_data_t object to behave as if the current node is the * root node of the tree. This impacts the behaviour of * ::pn_data_rewind(), ::pn_data_next(), ::pn_data_prev(), and * anything else that depends on the navigational state of the * pn_data_t object. Use ::pn_data_widen() to reverse the effect of * this operation. * * @param data a pn_data_t object */ PN_EXTERN void pn_data_narrow(pn_data_t *data); /** * Reverse the effect of ::pn_data_narrow(). * * @param data a pn_data_t object */ PN_EXTERN void pn_data_widen(pn_data_t *data); /** * Returns a handle for the current navigational state of a pn_data_t * so that it can be later restored using ::pn_data_restore(). * * @param data a pn_data_t object * @return a handle for the current navigational state */ PN_EXTERN pn_handle_t pn_data_point(pn_data_t *data); /** * Restores a prior navigational state that was saved using * ::pn_data_point(). If the data object has been modified in such a * way that the prior navigational state cannot be restored, then this * will return false and the navigational state will remain unchanged, * otherwise it will return true. * * @param data a pn_data_t object * @param point a handle referencing the saved navigational state * @return true iff the prior navigational state was restored */ PN_EXTERN bool pn_data_restore(pn_data_t *data, pn_handle_t point); /** * Dumps a debug representation of the internal state of the pn_data_t * object that includes its navigational state to stdout for debugging * purposes. * * @param data a pn_data_t object that is behaving in a confusing way */ PN_EXTERN void pn_data_dump(pn_data_t *data); /** * @} */ #ifdef __cplusplus } #endif #endif /* codec.h */ qpid-proton-0.22.0/proton-c/include/proton/cid.h0000664000000000000000000000272413257152177016373 0ustar #ifndef PROTON_CID_H #define PROTON_CID_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /** * @cond INTERNAL */ typedef enum { CID_pn_object = 1, CID_pn_void, CID_pn_weakref, CID_pn_string, CID_pn_list, CID_pn_map, CID_pn_hash, CID_pn_record, CID_pn_collector, CID_pn_event, CID_pn_encoder, CID_pn_decoder, CID_pn_data, CID_pn_connection, CID_pn_session, CID_pn_link, CID_pn_delivery, CID_pn_transport, CID_pn_message, CID_pn_reactor, CID_pn_handler, CID_pn_timer, CID_pn_task, CID_pn_io, CID_pn_selector, CID_pn_selectable, CID_pn_url, CID_pn_listener, CID_pn_proactor, CID_pn_listener_socket } pn_cid_t; /** * @endcond */ #endif /* cid.h */ qpid-proton-0.22.0/proton-c/env.py0000664000000000000000000000461413257152177013661 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # # A platform-agnostic tool for running a program in a modified environment. # import sys import os import subprocess from optparse import OptionParser def main(argv=None): parser = OptionParser(usage="Usage: %prog [options] [--] VAR=VALUE... command [options] arg1 arg2...") parser.add_option("-i", "--ignore-environment", action="store_true", default=False, help="Start with an empty environment (do not inherit current environment)") (options, args) = parser.parse_args(args=argv) if options.ignore_environment: new_env = {} else: new_env = os.environ.copy() # pull out each name value pair while (len(args)): z = args[0].split("=",1) if len(z) != 2: break; # done with env args if len(z[0]) == 0: raise Exception("Error: incorrect format for env var: '%s'" % str(args[x])) del args[0] if len(z[1]) == 0: # value is not present, so delete it if z[0] in new_env: del new_env[z[0]] else: new_env[z[0]] = z[1] if len(args) == 0 or len(args[0]) == 0: raise Exception("Error: syntax error in command arguments") if new_env.get("VALGRIND") and new_env.get("VALGRIND_ALL"): # Python generates a lot of possibly-lost errors that are not errors, don't show them. args = [new_env.get("VALGRIND"), "--show-reachable=no", "--show-possibly-lost=no", "--error-exitcode=42"] + args p = subprocess.Popen(args, env=new_env) return p.wait() if __name__ == "__main__": sys.exit(main()) qpid-proton-0.22.0/proton-c/docs/0000775000000000000000000000000013257152177013442 5ustar qpid-proton-0.22.0/proton-c/docs/api/0000775000000000000000000000000013257152177014213 5ustar qpid-proton-0.22.0/proton-c/docs/api/user.doxygen.in0000664000000000000000000000621713257152177017203 0ustar ## ## Licensed to the Apache Software Foundation (ASF) under one ## or more contributor license agreements. See the NOTICE file ## distributed with this work for additional information ## regarding copyright ownership. The ASF licenses this file ## to you under the Apache License, Version 2.0 (the ## "License"); you may not use this file except in compliance ## with the License. You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, ## software distributed under the License is distributed on an ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ## KIND, either express or implied. See the License for the ## specific language governing permissions and limitations ## under the License. ## # Project options PROJECT_NAME = "Qpid Proton C" PROJECT_NUMBER = @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@ OUTPUT_DIRECTORY = . OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = YES JAVADOC_AUTOBRIEF = YES INHERIT_DOCS = YES INLINE_SIMPLE_STRUCTS = YES HIDE_UNDOC_CLASSES = YES HIDE_COMPOUND_REFERENCE = YES HIDE_SCOPE_NAMES = YES MAX_INITIALIZER_LINES = 0 ALPHABETICAL_INDEX = NO SORT_MEMBER_DOCS = NO # Redefine protected as private and strip out the PN_EXTERN and # PNX_EXTERN macros ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES PREDEFINED = PN_EXTERN= PNX_EXTERN= # Configuration options related to warning and progress messages QUIET = YES WARNINGS = YES # Configuration options related to the input files INPUT = @CMAKE_SOURCE_DIR@/proton-c/include @CMAKE_SOURCE_DIR@/proton-c/docs @CMAKE_SOURCE_DIR@/examples/c FILE_PATTERNS = *.h *.md *.dox EXCLUDE_PATTERNS = */examples/*.c \ */examples/*.h \ */include/proton/cid.h \ */include/proton/engine.h \ */include/proton/handlers.h \ */include/proton/import_export.h \ */include/proton/log.h \ */include/proton/object.h \ */include/proton/reactor.h \ */include/proton/sasl-plugin.h \ */include/proton/selectable.h \ */include/proton/type_compat.h FULL_PATH_NAMES = YES RECURSIVE = YES STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/proton-c/include EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/examples/c EXAMPLE_RECURSIVE = YES # View and list options DISABLE_INDEX = YES GENERATE_TREEVIEW = YES GENERATE_TODOLIST = NO GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST = NO IGNORE_PREFIX = pn_ PN_ # Configuration options related to the output format GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html GENERATE_LATEX = NO qpid-proton-0.22.0/proton-c/docs/api/main.md0000664000000000000000000000227313257152177015465 0ustar # Introduction {#mainpage} The Qpid Proton C API enables writing clients and servers that send and receive messages using the AMQP protocol. It is part of the [Qpid Proton](https://qpid.apache.org/proton/index.html) suite of messaging APIs. ## Modules The @ref core module is a collection of types and functions representing AMQP concepts and key elements of the API. Together they form a "protocol engine" API to create AMQP @ref connection "connections" and @ref link "links", handle @ref event "events", and send and receive @ref message "messages". The @ref types module contains C types and functions for handling AMQP- and API-specific data types. The @ref codec module has functions for AMQP data encoding and decoding. The @ref io module contains interfaces for integrating with platform-native network IO. See @ref io_page for more information. ## Conventions Elements of the API marked as **Unsettled API**, including any elements contained within them, are still evolving and thus are subject to change. They are available to use, but newer versions of Proton may require changes to your application source code. Elements marked **Deprecated** are slated for removal in a future release. qpid-proton-0.22.0/proton-c/docs/api/io.md0000664000000000000000000000121613257152177015144 0ustar ## IO integration {#io_page} **Unsettled API** - The IO interfaces are new and remain subject to change. The @ref proactor is a portable, proactive, asynchronous API for single- or multithreaded applications. It associates AMQP @ref connection "connections" with network connections (@ref transport "transports") and allows one or more threads to handle @ref event "events". The @ref connection\_driver is a low-level SPI to feed byte streams from any source to the protocol engine. You can use it to integrate Proton directly with a foreign event loop or IO library, or to implement your own @ref proactor to transparently replace Proton's IO layer. qpid-proton-0.22.0/proton-c/docs/api/CMakeLists.txt0000664000000000000000000000255213257152177016757 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # find_package(Doxygen) if (DOXYGEN_FOUND) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen) add_custom_target (docs-c COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen) add_dependencies (docs docs-c) # HTML files are generated to ./html - put those in the install. install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "${PROTON_SHARE}/docs/api-c" COMPONENT documentation OPTIONAL) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html) endif (DOXYGEN_FOUND) qpid-proton-0.22.0/proton-c/bindings/0000775000000000000000000000000013257152177014307 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/0000775000000000000000000000000013257152177015270 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/0000775000000000000000000000000013257152177016227 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/templates/0000775000000000000000000000000013257152177020225 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/templates/default/0000775000000000000000000000000013257152177021651 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/templates/default/layout/0000775000000000000000000000000013257152177023166 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/templates/default/layout/html/0000775000000000000000000000000013257152177024132 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/yard/templates/default/layout/html/footer.erb0000664000000000000000000000014213257152177026117 0ustar g<%# Suppress footers with timestamps so documentation generates without spurious differences -%> qpid-proton-0.22.0/proton-c/bindings/ruby/tests/0000775000000000000000000000000013257152177016432 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_uri.rb0000664000000000000000000000607613257152177020626 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'test_tools' require 'qpid_proton' class TestURI < MiniTest::Test PARTS=[:scheme, :userinfo, :host, :port, :path] # Interesting URI components def uri(u) Qpid::Proton::uri(u); end def uri_parts(u) uri(u).select(*PARTS); end # Extension to standard URI parser def test_standard u = URI("amqp://u:p@h/x") assert_equal URI::AMQP, u.class assert_equal ['amqp', 'u:p', 'h', 5672, '/x'], u.select(*PARTS) u = URI("amqps://u:p@h/x") assert_equal URI::AMQPS, u.class assert_equal ['amqps', 'u:p', 'h', 5671, '/x'], u.select(*PARTS) assert_equal ['amqp', nil, '[::1:2:3]', 5672, ""], URI('amqp://[::1:2:3]').select(*PARTS) end # Proton::uri on valid URIs def test_valid u = uri("amqp://u:p@h:1/x") assert_equal URI::AMQP, u.class assert_equal ['amqp', 'u:p', 'h', 1, '/x'], u.select(*PARTS) u = uri("amqps://u:p@h:1/x") assert_equal URI::AMQPS, u.class assert_equal ['amqps', 'u:p', 'h', 1, '/x'], u.select(*PARTS) # Schemeless string -> amqp assert_equal ["amqp", nil, "h", 1, "/x"], uri_parts("//h:1/x") assert_equal ["amqp", nil, "", 5672, "/x"], uri_parts("/x") assert_equal ["amqp", nil, "[::1]", 5672, ""], uri_parts("//[::1]") # Schemeless URI gets amqp: scheme assert_equal ["amqp", nil, nil, 5672, "/x"], uri_parts(URI("/x")) # Pass-through u = uri('') assert_same u, uri(u) end # Proton::uri non-standard shortcuts def test_shortcut assert_equal URI("amqp://u:p@h:1/x"), uri("u:p@h:1/x") assert_equal URI("amqp://h:1"), uri("h:1") assert_equal URI("amqp://h"), uri("h") assert_equal URI("amqp://h"), uri("h:") assert_equal ["amqp", nil, "", 5672, ""], uri_parts("") assert_equal ["amqp", nil, "", 5672, ""], uri_parts(":") assert_equal ["amqp", nil, "", 1, ""], uri_parts(":1") assert_equal ["amqp", nil, "", 1, ""], uri_parts("amqp://:1") assert_equal URI("amqp://[::1:2]:1"), uri("[::1:2]:1") assert_equal URI("amqp://[::1:2]"), uri("[::1:2]") end def test_error assert_raises(::ArgumentError) { uri(nil) } assert_raises(URI::BadURIError) { uri(URI("http://x")) } # Don't re-parse a URI with wrong scheme assert_raises(URI::InvalidURIError) { uri("x:y:z") } # Nonsense assert_raises(URI::InvalidURIError) { uri("amqp://[foobar]") } # Bad host end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_tools.rb0000664000000000000000000001130413257152177021155 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # Tools for tests. Only minitest is used. require 'minitest/autorun' require 'qpid_proton' require 'socket' begin MiniTest::Test rescue NameError # For older versions of MiniTest MiniTest::Test = MiniTest::Unit::TestCase end class TestError < RuntimeError; end # Normal error class TestException < Exception; end # Not caught by default rescue def wait_port(port, timeout=5) deadline = Time.now + timeout begin # Wait for the port to be connectible TCPSocket.open("", $port).close rescue Errno::ECONNREFUSED if Time.now > deadline then raise TestError, "timed out waiting for port #{port}" end sleep(0.1) retry end end # Handler that records some common events that are checked by tests class TestHandler < Qpid::Proton::MessagingHandler attr_reader :errors, :connections, :sessions, :links, :messages # Pass optional extra handlers and options to the Container # @param raise_errors if true raise an exception for error events, if false, store them in #errors def initialize(raise_errors=true) super() @raise_errors = raise_errors @errors, @connections, @sessions, @links, @messages = 5.times.collect { [] } end # If the handler has errors, raise a TestError with all the error text def raise_errors() return if @errors.empty? text = "" while @errors.size > 0 text << @errors.pop + "\n" end raise TestError.new("TestHandler has errors:\n #{text}") end def on_error(condition) @errors.push "#{condition}" raise_errors if @raise_errors end def endpoint_open(queue, endpoint) queue.push(endpoint) end def on_connection_open(c) endpoint_open(@connections, c) end def on_session_open(s) endpoint_open(@sessions, s) end def on_receiver_open(l) endpoint_open(@links, l) end def on_sender_open(l) endpoint_open(@links, l) end def on_message(d, m) @messages.push(m) end end # ListenHandler that closes the Listener after first (or n) accepts class ListenOnceHandler < Qpid::Proton::Listener::Handler def initialize(opts, n=1) super(opts); @n=n; end def on_error(l, e) raise e; end def on_accept(l) l.close if (@n -= 1).zero?; super; end end # Add port/url to Listener, assuming a TCP socket class Qpid::Proton::Listener def url() "amqp://:#{port}"; end end # A client/server pair of ConnectionDrivers linked by a socket pair DriverPair = Struct.new(:client, :server) do def initialize(client_handler, server_handler) s = Socket.pair(:LOCAL, :STREAM, 0) self.client = HandlerDriver.new(s[0], client_handler) self.server = HandlerDriver.new(s[1], server_handler) server.transport.set_server end # Process each driver once, return time of next timed event def process(now = Time.now, max_time=nil) t = collect { |d| d.process(now) }.compact.min t = max_time if max_time && t > max_time t end def active() can_read = self.select { |d| d.can_read? } can_write = self.select {|d| d.can_write? } IO.select(can_read, can_write, [], 0) end def names() collect { |x| x.handler.names }; end def clear() each { |x| x.handler.clear; } end # Run till there is nothing else to do - not handle waiting for timed events # but does pass +now+ to process and returns the min returned timed event time def run(now=Time.now) t = nil begin t = process(now, t) end while active t end end # Container that listens on a random port class ServerContainer < Qpid::Proton::Container include Qpid::Proton def initialize(id=nil, listener_opts=nil, n=1) super id @listener = listen_io(TCPServer.open(0), ListenOnceHandler.new(listener_opts, n)) end attr_reader :listener def port() @listener.port; end def url() "amqp://:#{port}"; end end class ServerContainerThread < ServerContainer def initialize(id=nil, listener_opts=nil, n=1) super @thread = Thread.new { run } end attr_reader :thread def join() @thread.join; end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_old_adapter.rb0000664000000000000000000002306713257152177022304 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'minitest/autorun' require 'qpid_proton' require 'test_tools' include Qpid::Proton OldMessagingHandler = Qpid::Proton::Handler::MessagingHandler #Use the old handler. # Records every call class AllHandler < OldMessagingHandler def initialize(*args) super(*args) @calls = [] end attr_accessor :calls def names; @calls.map { |c| c[0] }; end def events; @calls.map { |c| c[1] }; end def method_missing(name, *args) (/^on_/ =~ name) ? (@calls << [name] + args) : super; end def respond_to_missing?(name, private=false); (/^on_/ =~ name); end def respond_to?(name, all=false) super || respond_to_missing?(name); end # For ruby < 1.9.2 end # Tests with Mock handler that handles all methods, expect both old and new calls class TestOldHandler < MiniTest::Test def setup @h = [AllHandler.new, AllHandler.new] @ch, @sh = *@h @d = DriverPair.new(*@h) end def clear; @d.each { |d| h = d.handler; h.calls.clear }; end def test_handler_defaults want = { :prefetch => 10, :auto_settle => true, :auto_accept => true, :auto_open => true, :auto_close => true, :peer_close_is_error => false } assert_equal want, @ch.options assert_equal want, @sh.options end def test_auto_open_close @d.client.connection.open; @d.client.connection.open_sender; @d.run assert_equal [:on_connection_opened, :on_session_opened, :on_link_opened, :on_sendable], @ch.names assert_equal [:on_connection_opening, :on_session_opening, :on_link_opening, :on_connection_opened, :on_session_opened, :on_link_opened], @sh.names clear @d.client.connection.close; @d.run assert_equal [:on_connection_closed, :on_transport_closed], @ch.names assert_equal [:on_connection_closing, :on_connection_closed, :on_transport_closed], @sh.names end def test_no_auto_open_close [:auto_close, :auto_open].each { |k| @ch.options[k] = @sh.options[k] = false } @d.client.connection.open; @d.run assert_equal [:on_connection_opening], @sh.names assert_equal [], @ch.names @d.server.connection.open; @d.run assert_equal [:on_connection_opened], @ch.names assert_equal [:on_connection_opening, :on_connection_opened], @sh.names clear @d.client.connection.session.open; @d.run assert_equal [:on_session_opening], @sh.names assert_equal [], @ch.names clear @d.client.connection.close; 3.times { @d.process } assert_equal [:on_connection_closing], @sh.names assert_equal [], @ch.names @d.server.connection.close; @d.run assert_equal [:on_connection_closed, :on_transport_closed], @ch.names assert_equal [:on_connection_closing, :on_connection_closed, :on_transport_closed], @sh.names end def test_transport_error @d.client.connection.open; @d.run clear @d.client.close "stop that"; @d.run assert_equal [:on_transport_closed], @ch.names assert_equal [:on_transport_error, :on_transport_closed], @sh.names assert_equal Condition.new("proton:io", "stop that (connection aborted)"), @d.client.transport.condition assert_equal Condition.new("amqp:connection:framing-error", "connection aborted"), @d.server.transport.condition end def test_connection_error @ch.options[:auto_open] = @sh.options[:auto_open] = false @d.client.connection.open; @d.run @d.server.connection.close "bad dog"; @d.run assert_equal [:on_connection_opened, :on_connection_error, :on_connection_closed, :on_transport_closed], @ch.names assert_equal "bad dog", @ch.calls[2][1].condition.description assert_equal [:on_connection_opening, :on_connection_closed, :on_transport_closed], @sh.names end def test_session_error @d.client.connection.open s = @d.client.connection.session; s.open; @d.run s.close "bad dog"; @d.run assert_equal [:on_connection_opened, :on_session_opened, :on_session_closed], @ch.names assert_equal [:on_connection_opening, :on_session_opening, :on_connection_opened, :on_session_opened, :on_session_error, :on_session_closed], @sh.names assert_equal "bad dog", @sh.calls[-3][1].condition.description end def test_link_error @d.client.connection.open s = @d.client.connection.open_sender; @d.run s.close "bad dog"; @d.run assert_equal [:on_connection_opened, :on_session_opened, :on_link_opened, :on_sendable, :on_link_closed], @ch.names assert_equal [:on_connection_opening, :on_session_opening, :on_link_opening, :on_connection_opened, :on_session_opened, :on_link_opened, :on_link_error, :on_link_closed], @sh.names assert_equal "bad dog", @sh.calls[-3][1].condition.description end def test_options_off off = {:prefetch => 0, :auto_settle => false, :auto_accept => false, :auto_open => false, :auto_close => false} @ch.options.replace(off) @sh.options.replace(off) @d.client.connection.open; @d.run assert_equal [[], [:on_connection_opening]], [@ch.names, @sh.names] @d.server.connection.open; @d.run assert_equal [[:on_connection_opened], [:on_connection_opening, :on_connection_opened]], [@ch.names, @sh.names] clear s = @d.client.connection.open_sender; @d.run assert_equal [[], [:on_session_opening, :on_link_opening]], [@ch.names, @sh.names] @sh.events[1].session.open r = @sh.events[1].link r.open; @d.run assert_equal [[:on_session_opened, :on_link_opened], [:on_session_opening, :on_link_opening, :on_session_opened, :on_link_opened]], [@ch.names, @sh.names] clear r.flow(1); @d.run assert_equal [[:on_sendable], []], [@ch.names, @sh.names] assert_equal 1, s.credit clear s.send Message.new("foo"); @d.run assert_equal [[], [:on_message]], [@ch.names, @sh.names] end def test_peer_close_is_error @ch.options[:peer_close_is_error] = true @d.client.connection.open; @d.run @d.server.connection.close; @d.run assert_equal [:on_connection_opened, :on_connection_error, :on_connection_closed, :on_transport_closed], @ch.names assert_equal [:on_connection_opening, :on_connection_opened, :on_connection_closed, :on_transport_closed], @sh.names end end # Test with real handlers that implement a few methods class TestOldUnhandled < MiniTest::Test def test_message handler_class = Class.new(OldMessagingHandler) do def on_message(event) @message = event.message; end def on_accepted(event) @accepted = true; end attr_accessor :message, :accepted, :sender end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; s = d.client.connection.open_sender; d.run assert_equal 10, s.credit # Default prefetch s.send(Message.new("foo")); d.run assert_equal "foo", d.server.handler.message.body assert d.client.handler.accepted end # Verify on_unhandled is called def test_unhandled handler_class = Class.new(OldMessagingHandler) do def initialize() super; @unhandled = []; end def on_unhandled(event) @unhandled << event.method; end attr_accessor :unhandled end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; d.run assert_equal [:on_connection_opened], d.client.handler.unhandled assert_equal [:on_connection_opening, :on_connection_opened], d.server.handler.unhandled end # Verify on_error is called def test_on_error handler_class = Class.new(OldMessagingHandler) do def initialize() super; @error = []; @unhandled = []; end def on_error(event) @error << event.method; end def on_unhandled(event) @unhandled << event.method; end attr_accessor :error, :unhandled end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open r = d.client.connection.open_receiver; d.run r.close "oops"; d.run assert_equal [:on_connection_opened, :on_session_opened, :on_link_opened, :on_link_closed], d.client.handler.unhandled assert_equal [:on_connection_opening, :on_session_opening, :on_link_opening, :on_connection_opened, :on_session_opened, :on_link_opened, :on_sendable, :on_link_closed], d.server.handler.unhandled assert_equal [:on_link_error], d.server.handler.error end # Verify on_unhandled is called even for errors if there is no on_error def test_unhandled_error handler_class = Class.new(OldMessagingHandler) do def initialize() super; @unhandled = []; end def on_unhandled(event) @unhandled << event.method; end attr_accessor :unhandled end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; d.run d.client.connection.close "oops"; d.run assert_equal [:on_connection_opened, :on_connection_closed, :on_transport_closed], d.client.handler.unhandled assert_equal [:on_connection_opening, :on_connection_opened, :on_connection_error, :on_connection_closed, :on_transport_closed], d.server.handler.unhandled end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_messaging_adapter.rb0000664000000000000000000002301113257152177023470 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'minitest/autorun' require 'qpid_proton' require 'test_tools' include Qpid::Proton # Records every call, never provokes "on_unhandled" class RecordingHandler < Qpid::Proton::MessagingHandler def initialize(*args) super(*args); @calls = []; end attr_accessor :calls def names() @calls.collect { |c| c[0] }; end def clear() @calls.clear; end def method_missing(name, *args) respond_to_missing?(name) ? (@calls << [name, *args]) : super; end def respond_to_missing?(name, private=false); (/^on_/ =~ name); end def respond_to?(name, all=false) super || respond_to_missing?(name); end # For ruby < 1.9.2 end class NoAutoOpenClose < RecordingHandler def initialize() super; @endpoints = []; end def on_connection_open(x) @connection = x; super; raise StopAutoResponse; end def on_session_open(x) @session = x; super; raise StopAutoResponse; end def on_sender_open(x) @link = x; super; raise StopAutoResponse; end def on_receiver_open(x) @link = x; super; raise StopAutoResponse; end def on_connection_close(x) super; raise StopAutoResponse; end def on_session_close(x) super; raise StopAutoResponse; end def on_sender_close(x) super; raise StopAutoResponse; end def on_receiver_close(x) super; raise StopAutoResponse; end attr_reader :connection, :session, :link end class TestMessagingHandler < MiniTest::Test def test_auto_open_close d = DriverPair.new(RecordingHandler.new, RecordingHandler.new) d.client.connection.open; d.client.connection.open_sender; d.run assert_equal [:on_connection_open, :on_session_open, :on_sender_open, :on_sendable], d.client.handler.names assert_equal [:on_connection_open, :on_session_open, :on_receiver_open], d.server.handler.names d.clear d.client.connection.close; d.run assert_equal [:on_connection_close, :on_transport_close], d.server.handler.names assert_equal [:on_connection_close, :on_transport_close], d.client.handler.names end def test_no_auto_open_close d = DriverPair.new(NoAutoOpenClose.new, NoAutoOpenClose.new) d.client.connection.open; d.run assert_equal [:on_connection_open], d.server.handler.names assert_equal [], d.client.handler.names d.server.connection.open; d.run assert_equal [:on_connection_open], d.client.handler.names assert_equal [:on_connection_open], d.server.handler.names d.clear d.client.connection.open_session; d.run assert_equal [:on_session_open], d.server.handler.names assert_equal [], d.client.handler.names d.clear d.client.connection.close; 3.times { d.process } assert_equal [:on_connection_close], d.server.handler.names assert_equal [], d.client.handler.names d.server.connection.close; d.run assert_equal [:on_connection_close, :on_transport_close], d.client.handler.names assert_equal [:on_connection_close, :on_transport_close], d.server.handler.names end def test_transport_error d = DriverPair.new(RecordingHandler.new, RecordingHandler.new) d.client.connection.open; d.run d.clear d.client.close "stop that"; d.run assert_equal [:on_transport_close], d.client.handler.names assert_equal [:on_transport_error, :on_transport_close], d.server.handler.names assert_equal Condition.new("proton:io", "stop that (connection aborted)"), d.client.transport.condition assert_equal Condition.new("amqp:connection:framing-error", "connection aborted"), d.server.transport.condition end # Close on half-open def test_connection_error d = DriverPair.new(NoAutoOpenClose.new, NoAutoOpenClose.new) d.client.connection.open; d.run d.server.connection.close "bad dog"; d.run d.client.connection.close; d.run assert_equal [:on_connection_open, :on_connection_error, :on_connection_close, :on_transport_close], d.client.handler.names assert_equal "bad dog", d.client.handler.calls[1][1].condition.description assert_equal [:on_connection_open, :on_connection_error, :on_connection_close, :on_transport_close], d.server.handler.names end def test_session_error d = DriverPair.new(RecordingHandler.new, RecordingHandler.new) d.client.connection.open s = d.client.connection.default_session; s.open; d.run assert_equal [:on_connection_open, :on_session_open], d.client.handler.names assert_equal [:on_connection_open, :on_session_open], d.server.handler.names d.clear s.close "bad dog"; d.run assert_equal [:on_session_error, :on_session_close], d.client.handler.names assert_equal [:on_session_error, :on_session_close], d.server.handler.names assert_equal "bad dog", d.server.handler.calls[0][1].condition.description end def test_sender_receiver_error d = DriverPair.new(RecordingHandler.new, RecordingHandler.new) d.client.connection.open s = d.client.connection.open_sender; d.run assert_equal [:on_connection_open, :on_session_open, :on_sender_open, :on_sendable], d.client.handler.names assert_equal [:on_connection_open, :on_session_open, :on_receiver_open], d.server.handler.names d.clear s.close "bad dog"; d.run assert_equal [:on_sender_error, :on_sender_close], d.client.handler.names assert_equal [:on_receiver_error, :on_receiver_close], d.server.handler.names assert_equal "bad dog", d.server.handler.calls[0][1].condition.description end def test_options_off linkopts = {:credit_window=>0, :auto_settle=>false, :auto_accept=>false} d = DriverPair.new(NoAutoOpenClose.new, NoAutoOpenClose.new) d.client.connection.open; d.run assert_equal [[], [:on_connection_open]], d.names d.server.connection.open; d.run assert_equal [[:on_connection_open], [:on_connection_open]], d.names d.clear s = d.client.connection.open_sender(linkopts); d.run assert_equal [[], [:on_session_open, :on_receiver_open]], d.names d.server.handler.session.open # Return session open d.server.handler.link.open(linkopts) # Return link open d.run assert_equal [[:on_session_open, :on_sender_open], [:on_session_open, :on_receiver_open]], d.names d.clear d.server.handler.link.flow(1); d.run assert_equal [[:on_sendable], []], d.names assert_equal 1, s.credit d.clear s.send Message.new("foo"); d.run assert_equal [[], [:on_message]], d.names end def test_message handler_class = Class.new(MessagingHandler) do def on_message(delivery, message) @message = message; end def on_tracker_accept(event) @accepted = true; end attr_accessor :message, :accepted end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; s = d.client.connection.open_sender; d.run assert_equal 10, s.credit # Default prefetch s.send(Message.new("foo")); d.run assert_equal "foo", d.server.handler.message.body assert d.client.handler.accepted end # Verify on_unhandled is called def test_unhandled handler_class = Class.new(MessagingHandler) do def initialize() super; @unhandled = []; end def on_unhandled(method, *args) @unhandled << method; end attr_accessor :unhandled end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; d.run assert_equal [:on_connection_open], d.client.handler.unhandled assert_equal [:on_connection_open], d.server.handler.unhandled end # Verify on_error is called def test_on_error handler_class = Class.new(MessagingHandler) do def initialize() super; @error = []; @unhandled = []; end def on_error(condition) @error << condition; end def on_unhandled(method, *args) @unhandled << method; end attr_accessor :error, :unhandled end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open r = d.client.connection.open_receiver; d.run assert_equal [:on_connection_open, :on_session_open, :on_receiver_open], d.client.handler.unhandled assert_equal [:on_connection_open, :on_session_open, :on_sender_open, :on_sendable], d.server.handler.unhandled r.close Condition.new("goof", "oops"); d.run assert_equal [Condition.new("goof", "oops")], d.client.handler.error assert_equal [:on_connection_open, :on_session_open, :on_sender_open, :on_sendable, :on_sender_close], d.server.handler.unhandled assert_equal [Condition.new("goof", "oops")], d.server.handler.error end # Verify on_unhandled is called for errors if there is no on_error def test_unhandled_error handler_class = Class.new(MessagingHandler) do def on_unhandled(method, *args) @error = args[0].condition if method == :on_connection_error; end attr_accessor :error end d = DriverPair.new(handler_class.new, handler_class.new) d.client.connection.open; d.run d.client.connection.close "oops"; d.run assert_equal [Condition.new("error", "oops")]*2, d.collect { |x| x.handler.error } end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_interop.rb0000775000000000000000000000673513257152177021514 0ustar #!/usr/bin/env ruby require 'test_tools' require 'qpid_proton' if ((RUBY_VERSION.split(".").map {|x| x.to_i} <=> [1, 9]) < 0) require 'pathname' class File def self.absolute_path(name) return Pathname.new(name).realpath end end end class InteropTest < MiniTest::Test include Qpid::Proton def setup @data = Codec::Data.new @message = Message.new end # Walk up the directory tree to find the tests directory. def get_data(name) path = File.join(File.dirname(__FILE__), "../../../../tests/interop/#{name}.amqp") raise "Can't find test/interop directory from #{__FILE__}" unless File.exist?(path) File.open(path, "rb") { |f| f.read } end # Decode encoded bytes as a Data object def decode_data(encoded) buffer = encoded while buffer.size > 0 n = @data.decode(buffer) buffer = buffer[n..-1] end @data.rewind reencoded = @data.encode # Test the round-trip re-encoding gives the same result. assert_equal(encoded, reencoded) end def decode_data_file(name) decode_data(get_data(name)); end def decode_message_file(name) message = Message.new() message.decode(self.get_data(name)) self.decode_data(message.body) end def assert_next(type, value) assert @data.next assert_equal(type, @data.type) assert_equal(value, @data.object) end def assert_array_next(expected) result = @data.next_object assert_equal(expected, result) end def test_message decode_message_file("message") assert_next(Codec::STRING, "hello") assert !@data.next end def test_primitives decode_data_file("primitives") assert_next(Codec::BOOL, true) assert_next(Codec::BOOL, false) assert_next(Codec::UBYTE, 42) assert_next(Codec::USHORT, 42) assert_next(Codec::SHORT, -42) assert_next(Codec::UINT, 12345) assert_next(Codec::INT, -12345) assert_next(Codec::ULONG, 12345) assert_next(Codec::LONG, -12345) assert_next(Codec::FLOAT, 0.125) assert_next(Codec::DOUBLE, 0.125) assert !@data.next end def test_strings decode_data_file("strings") assert_next(Codec::BINARY, "abc\0defg") assert_next(Codec::STRING, "abcdefg") assert_next(Codec::SYMBOL, :abcdefg) assert_next(Codec::BINARY, "") assert_next(Codec::STRING, "") assert_next(Codec::SYMBOL, :"") assert !@data.next end def test_described decode_data_file("described") assert_next(Codec::DESCRIBED, Types::Described.new(:"foo-descriptor", "foo-value")) assert(@data.described?) assert_next(Codec::DESCRIBED, Types::Described.new(12, 13)) assert(@data.described?) assert !@data.next end def test_described_array decode_data_file("described_array") assert_array_next(Types::UniformArray.new(Types::INT, (0...10).to_a, :"int-array")) end def test_arrays decode_data_file("arrays") assert_array_next(Types::UniformArray.new(Codec::INT, (0...100).to_a)) assert_array_next(Types::UniformArray.new(Codec::STRING, ["a", "b", "c"])) assert_array_next(Types::UniformArray.new(Codec::INT)) assert !@data.next end def test_lists decode_data_file("lists") assert_next(Codec::LIST, [32, "foo", true]) assert_next(Codec::LIST, []) assert !@data.next end def test_maps decode_data_file("maps") assert_next(Codec::MAP, {"one" => 1, "two" => 2, "three" => 3 }) assert_next(Codec::MAP, {1 => "one", 2 => "two", 3 => "three"}) assert_next(Codec::MAP, {}) assert !@data.next end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_delivery.rb0000664000000000000000000001103513257152177021641 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'minitest/autorun' require 'qpid_proton' require 'test_tools' include Qpid::Proton # Test Delivery and Tracker class TestDelivery < MiniTest::Test class NoAutoHandler < MessagingHandler def on_sender_open(l) l.open({:auto_settle=>false, :auto_accept=>false}); end def on_receiver_open(l) l.open({:auto_settle=>false, :auto_accept=>false}); end end class SendHandler < NoAutoHandler def initialize(to_send) @unsent = to_send end def on_connection_open(connection) @outcomes = [] @sender = connection.open_sender("x") @unsettled = {} # Awaiting remote settlement end attr_reader :outcomes, :unsent, :unsettled def on_sendable(sender) return if @unsent.empty? m = Message.new(@unsent.shift) tracker = sender.send(m) @unsettled[tracker] = m end def outcome(method, tracker) t = tracker m = @unsettled.delete(t) @outcomes << [m.body, method, t.id, t.state, t.modifications] tracker.connection.close if @unsettled.empty? end def on_tracker_accept(tracker) outcome(__method__, tracker); end def on_tracker_reject(tracker) outcome(__method__, tracker); end def on_tracker_release(tracker) outcome(__method__, tracker); end def on_tracker_modify(tracker) outcome(__method__, tracker); end end class ReceiveHandler < NoAutoHandler def initialize @received = [] end attr_reader :received def on_message(delivery, message) @received << message.body case message.body when "accept" then delivery.accept when "reject" then delivery.reject when "release-really" then delivery.release({:failed=>false}) # AMQP RELEASED when "release" then delivery.release # AMQP MODIFIED{ :failed => true } when "modify" then delivery.release({:undeliverable => true, :annotations => {:x => 42 }}) when "modify-empty" then delivery.release({:failed => false, :undeliverable => false, :annotations => {}}) when "modify-nil" then delivery.release({:failed => false, :undeliverable => false, :annotations => nil}) when "reject-raise" then raise Reject when "release-raise" then raise Release else raise inspect end end end def test_outcomes rh = ReceiveHandler.new sh = SendHandler.new(["accept", "reject", "release-really", "release", "modify", "modify-empty", "modify-nil", "reject-raise", "release-raise"]) c = Container.new(nil, __method__) l = c.listen_io(TCPServer.new(0), ListenOnceHandler.new({ :handler => rh })) c.connect(l.url, {:handler => sh}) c.run o = sh.outcomes assert_equal ["accept", :on_tracker_accept, "1", Transfer::ACCEPTED, nil], o.shift assert_equal ["reject", :on_tracker_reject, "2", Transfer::REJECTED, nil], o.shift assert_equal ["release-really", :on_tracker_release, "3", Transfer::RELEASED, nil], o.shift assert_equal ["release", :on_tracker_modify, "4", Transfer::MODIFIED, {:failed=>true, :undeliverable=>false, :annotations=>nil}], o.shift assert_equal ["modify", :on_tracker_modify, "5", Transfer::MODIFIED, {:failed=>true, :undeliverable=>true, :annotations=>{:x => 42}}], o.shift assert_equal ["modify-empty", :on_tracker_release, "6", Transfer::RELEASED, nil], o.shift assert_equal ["modify-nil", :on_tracker_release, "7", Transfer::RELEASED, nil], o.shift assert_equal ["reject-raise", :on_tracker_reject, "8", Transfer::REJECTED, nil], o.shift assert_equal ["release-raise", :on_tracker_modify, "9", Transfer::MODIFIED, {:failed=>true, :undeliverable=>false, :annotations=>nil}], o.shift assert_empty o assert_equal ["accept", "reject", "release-really", "release", "modify", "modify-empty", "modify-nil", "reject-raise", "release-raise"], rh.received assert_empty sh.unsettled end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_data.rb0000664000000000000000000000360113257152177020727 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'test_tools' require "securerandom" require 'qpid_proton' class TestData < MiniTest::Test include Qpid::Proton def assert_from_to(*values) d = Codec::Data.new values.each do |x| Codec::Data.from_object(d.impl, x) assert_equal x, Codec::Data.to_object(d.impl) end end def test_from_to assert_from_to({ 1 => :one, 2=>:two }) assert_from_to([{:a => 1, "b" => 2}, 3, 4.4, :five]) assert_from_to(Types::UniformArray.new(Types::INT, [1, 2, 3, 4])) end def rnum(*arg) SecureRandom.random_number(*arg); end def rstr(*arg) SecureRandom.base64(*arg); end def test_nil() assert_nil((Codec::Data.new << nil).object) end def assert_convert(*values) values.each { |x| assert_equal x, ((Codec::Data.new << x).object) } end def test_bool() assert_convert(true, false) end def test_float() assert_convert(0.0, 1.0, -1.0, 1.23e123, rnum(), rnum(), rnum(), rnum()) end def test_string() assert_convert("", "foo", rstr(100000), rstr(rnum(1000)), rstr(rnum(1000))) end def test_symbol() assert_convert(:"", :foo, rstr(256).to_sym) end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_container_sasl.rb0000664000000000000000000001164613257152177023032 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'test_tools' require 'minitest/unit' require 'socket' # Container that listens on a random port class TestContainer < Qpid::Proton::Container def initialize(handler, listener_opts, id) super handler, id @listener = listen_io(TCPServer.open(0), ListenOnceHandler.new(listener_opts)) end attr_reader :listener end class ContainerSASLTest < MiniTest::Test include Qpid::Proton # Handler for test client/server that sets up server and client SASL options class SASLHandler < TestHandler def initialize(url="amqp://", opts=nil) super() @url, @opts = url, opts end def on_container_start(container) @client = container.connect("#{@url}:#{container.listener.port}", @opts) end attr_reader :auth_user def on_connection_open(connection) super if connection == @client connection.close else @auth_user = connection.user end end end # Generate SASL server configuration files and database, initialize proton SASL class SASLConfig include Qpid::Proton attr_reader :conf_dir, :conf_file, :conf_name, :database, :error def initialize() if SASL.extended? # Configure cyrus SASL @conf_dir = File.expand_path('sasl_conf') @conf_name = "proton-server" @database = File.join(@conf_dir, "proton.sasldb") @conf_file = File.join(conf_dir,"#{@conf_name}.conf") Dir::mkdir(@conf_dir) unless File.directory?(@conf_dir) # Same user name in different realms make_user("user", "password", "proton") # proton realm make_user("user", "default_password") # Default realm File.open(@conf_file, 'w') do |f| f.write(" sasldb_path: #{database} mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS ") end # Tell proton library to use the new configuration SASL.config_path = conf_dir SASL.config_name = conf_name end rescue => e @error = e end private SASLPASSWD = (ENV['SASLPASSWD'] or 'saslpasswd2') def make_user(user, password, realm=nil) realm_opt = (realm ? "-u #{realm}" : "") cmd = "echo '#{password}' | #{SASLPASSWD} -c -p -f #{database} #{realm_opt} #{user}" system(cmd) or raise RuntimeError.new("saslpasswd2 failed: #{cmd}") end INSTANCE = SASLConfig.new end def begin_extended_test skip("Extended SASL not enabled") unless SASL.extended? skip("Extended SASL setup error: #{SASLConfig::INSTANCE.error}") if SASLConfig::INSTANCE.error end def test_sasl_anonymous() s = SASLHandler.new("amqp://", {:sasl_allowed_mechs => "ANONYMOUS"}) TestContainer.new(s, {:sasl_allowed_mechs => "ANONYMOUS"}, __method__).run assert_equal "anonymous", s.connections[0].user end def test_sasl_plain_url() begin_extended_test # Use default realm with URL, should authenticate with "default_password" opts = {:sasl_allowed_mechs => "PLAIN", :sasl_allow_insecure_mechs => true} s = SASLHandler.new("amqp://user:default_password@", opts) TestContainer.new(s, opts, __method__).run assert_equal(2, s.connections.size) assert_equal("user", s.auth_user) end def test_sasl_plain_options() begin_extended_test # Use default realm with connection options, should authenticate with "default_password" opts = {:sasl_allowed_mechs => "PLAIN",:sasl_allow_insecure_mechs => true, :user => 'user', :password => 'default_password' } s = SASLHandler.new("amqp://", opts) TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN",:sasl_allow_insecure_mechs => true}, __method__).run assert_equal(2, s.connections.size) assert_equal("user", s.auth_user) end # Ensure we don't allow PLAIN if allow_insecure_mechs = true is not explicitly set def test_disallow_insecure() # Don't set allow_insecure_mechs, but try to use PLAIN s = SASLHandler.new("amqp://user:password@", {:sasl_allowed_mechs => "PLAIN", :sasl_allow_insecure_mechs => true}) e = assert_raises(TestError) { TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN"}, __method__).run } assert_match(/amqp:unauthorized-access.*Authentication failed/, e.to_s) end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_container.rb0000664000000000000000000003334313257152177022006 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'test_tools' require 'minitest/unit' require 'socket' # MessagingHandler that raises in on_error to catch unexpected errors class ExceptionMessagingHandler def on_error(e) raise e; end end class ContainerTest < MiniTest::Test include Qpid::Proton def test_simple() send_handler = Class.new(ExceptionMessagingHandler) do attr_reader :accepted, :sent def initialize() @sent, @accepted = nil; end def on_sendable(sender) unless @sent m = Message.new("hello") m[:foo] = :bar sender.send m end @sent = true end def on_tracker_accept(tracker) @accepted = true tracker.connection.close end end.new receive_handler = Class.new(ExceptionMessagingHandler) do attr_reader :message, :link def on_receiver_open(link) @link = link @link.open @link.flow(1) end def on_message(delivery, message) @message = message; delivery.update Disposition::ACCEPTED delivery.settle end end.new c = ServerContainer.new(__method__, {:handler => receive_handler}) c.connect(c.url, {:handler => send_handler}).open_sender({:name => "testlink"}) c.run assert send_handler.accepted assert_equal "testlink", receive_handler.link.name assert_equal "hello", receive_handler.message.body assert_equal :bar, receive_handler.message[:foo] assert_equal "test_simple", receive_handler.link.connection.container_id end class CloseOnOpenHandler < TestHandler def on_connection_open(c) super; c.close; end end def test_auto_stop_one # A listener and a connection start_stop_handler = Class.new do def on_container_start(c) @start = c; end def on_container_stop(c) @stop = c; end attr_reader :start, :stop end.new c = Container.new(start_stop_handler, __method__) threads = 3.times.collect { Thread.new { c.run } } sleep(0.01) while c.running < 3 assert_equal c, start_stop_handler.start l = c.listen_io(TCPServer.new(0), ListenOnceHandler.new({ :handler => CloseOnOpenHandler.new})) c.connect("amqp://:#{l.to_io.addr[1]}", { :handler => CloseOnOpenHandler.new} ) threads.each { |t| assert t.join(1) } assert_equal c, start_stop_handler.stop assert_raises(Container::StoppedError) { c.run } end def test_auto_stop_two # Connect between different containers c1, c2 = Container.new("#{__method__}-1"), Container.new("#{__method__}-2") threads = [ Thread.new {c1.run }, Thread.new {c2.run } ] l = c2.listen_io(TCPServer.new(0), ListenOnceHandler.new({ :handler => CloseOnOpenHandler.new})) c1.connect(l.url, { :handler => CloseOnOpenHandler.new} ) assert threads.each { |t| t.join(1) } assert_raises(Container::StoppedError) { c1.run } assert_raises(Container::StoppedError) { c2.connect("") } end def test_auto_stop_listener_only c = Container.new(__method__) # Listener only, external close t = Thread.new { c.run } l = c.listen_io(TCPServer.new(0)) l.close assert t.join(1) end def test_stop_empty c = Container.new(__method__) threads = 3.times.collect { Thread.new { c.run } } sleep(0.01) while c.running < 3 assert_nil threads[0].join(0.001) # Not stopped c.stop assert c.stopped assert_raises(Container::StoppedError) { c.connect("") } assert_raises(Container::StoppedError) { c.run } threads.each { |t| assert t.join(1) } end def test_stop c = Container.new(__method__) c.auto_stop = false l = c.listen_io(TCPServer.new(0)) threads = 3.times.collect { Thread.new { c.run } } sleep(0.01) while c.running < 3 l.close assert_nil threads[0].join(0.001) # Not stopped, no auto_stop l = c.listen_io(TCPServer.new(0)) # New listener conn = c.connect("amqp://:#{l.to_io.addr[1]}") c.stop assert c.stopped threads.each { |t| assert t.join(1) } assert_raises(Container::StoppedError) { c.run } assert_equal 0, c.running assert_nil l.condition assert_nil conn.condition end def test_bad_host cont = Container.new(__method__) assert_raises (SocketError) { cont.listen("badlisten.example.com:999") } assert_raises (SocketError) { cont.connect("badconnect.example.com:999") } end # Verify that connection options are sent to the peer def test_connection_options # Note: user, password and sasl_xxx options are tested by ContainerSASLTest below server_handler = Class.new(ExceptionMessagingHandler) do def on_connection_open(c) @connection = c c.open({ :virtual_host => "server.to.client", :properties => { :server => :client }, :offered_capabilities => [ :s1 ], :desired_capabilities => [ :s2 ], :container_id => "box", }) c.close end attr_reader :connection end.new # Transport options set by listener, by Connection#open it is too late cont = ServerContainer.new(__method__, { :handler => server_handler, :idle_timeout => 88, :max_sessions =>1000, :max_frame_size => 8888, }) client = cont.connect(cont.url, {:virtual_host => "client.to.server", :properties => { "foo" => :bar, "str" => "str" }, :offered_capabilities => [:c1 ], :desired_capabilities => [:c2 ], :idle_timeout => 42, :max_sessions =>100, :max_frame_size => 4096, :container_id => "bowl" }) cont.run c = server_handler.connection assert_equal "client.to.server", c.virtual_host assert_equal({ "foo" => :bar, "str" => "str" }, c.properties) assert_equal([:c1], c.offered_capabilities) assert_equal([:c2], c.desired_capabilities) assert_equal 21, c.idle_timeout # Proton divides by 2 assert_equal 100, c.max_sessions assert_equal 4096, c.max_frame_size assert_equal "bowl", c.container_id c = client assert_equal "server.to.client", c.virtual_host assert_equal({ :server => :client }, c.properties) assert_equal([:s1], c.offered_capabilities) assert_equal([:s2], c.desired_capabilities) assert_equal "box", c.container_id assert_equal 8888, c.max_frame_size assert_equal 44, c.idle_timeout # Proton divides by 2 assert_equal 100, c.max_sessions end def test_link_options server_handler = Class.new(ExceptionMessagingHandler) do def initialize() @links = []; end attr_reader :links def on_sender_open(l) @links << l; end def on_receiver_open(l) @links << l; end end.new client_handler = Class.new(ExceptionMessagingHandler) do def on_connection_open(c) @links = []; @links << c.open_sender("s1") @links << c.open_sender({:name => "s2-n", :target => "s2-t", :source => "s2-s"}) @links << c.open_receiver("r1") @links << c.open_receiver({:name => "r2-n", :target => "r2-t", :source => "r2-s"}) c.close end attr_reader :links end.new cont = ServerContainer.new(__method__, {:handler => server_handler }, 1) cont.connect(cont.url, :handler => client_handler) cont.run expect = ["test_link_options/1", "s2-n", "test_link_options/2", "r2-n"] assert_equal expect, server_handler.links.map(&:name) assert_equal expect, client_handler.links.map(&:name) expect = [[nil,"s1"], ["s2-s","s2-t"], ["r1",nil], ["r2-s","r2-t"]] assert_equal expect, server_handler.links.map { |l| [l.remote_source.address, l.remote_target.address] } assert_equal expect, client_handler.links.map { |l| [l.source.address, l.target.address] } end def extract_terminus_options(t) opts = Hash[[:address, :distribution_mode, :durability_mode, :timeout, :expiry_policy].map { |m| [m, t.send(m)] }] opts[:filter] = t.filter.map opts[:capabilities] = t.capabilities.map opts[:dynamic] = t.dynamic? opts end def test_terminus_options opts = { :distribution_mode => Terminus::DIST_MODE_COPY, :durability_mode => Terminus::DELIVERIES, :timeout => 5, :expiry_policy => Terminus::EXPIRE_WITH_LINK, :filter => { :try => 'me' }, :capabilities => { :cap => 'len' }, } src_opts = { :address => "src", :dynamic => true }.update(opts) tgt_opts = { :address => "tgt", :dynamic => false }.update(opts) cont = ServerContainer.new(__method__, {}, 1) c = cont.connect(cont.url) s = c.open_sender({:target => tgt_opts, :source => src_opts }) assert_equal src_opts, extract_terminus_options(s.source) assert_equal tgt_opts, extract_terminus_options(s.target) assert s.source.dynamic? assert !s.target.dynamic? end # Test for time out on connecting to an unresponsive server def test_idle_timeout_server_no_open s = TCPServer.new(0) cont = Container.new(__method__) cont.connect(":#{s.addr[1]}", {:idle_timeout => 0.1, :handler => ExceptionMessagingHandler.new }) ex = assert_raises(Qpid::Proton::Condition) { cont.run } assert_match(/resource-limit-exceeded/, ex.to_s) ensure s.close if s end # Test for time out on unresponsive client def test_idle_timeout_client server = ServerContainerThread.new("#{__method__}.server", {:idle_timeout => 0.1}) client_handler = Class.new(ExceptionMessagingHandler) do def initialize() @ready, @block = Queue.new, Queue.new; end attr_reader :ready, :block def on_connection_open(c) @ready.push nil # Tell the main thread we are now open @block.pop # Block the client so the server will time it out end end.new client = Container.new(nil, "#{__method__}.client") client.connect(server.url, {:handler => client_handler}) client_thread = Thread.new { client.run } client_handler.ready.pop # Wait till the client has connected server.join # Exits when the connection closes from idle-timeout client_handler.block.push nil # Unblock the client ex = assert_raises(Qpid::Proton::Condition) { client_thread.join } assert_match(/resource-limit-exceeded/, ex.to_s) end # Make sure we stop and clean up if an aborted connection causes a handler to raise. # https://issues.apache.org/jira/browse/PROTON-1791 def test_handler_raise cont = ServerContainer.new(__method__, {}, 0) # Don't auto-close the listener client_handler = Class.new(MessagingHandler) do # TestException is < Exception so not handled by default rescue clause def on_connection_open(c) raise TestException.new("Bad Dog"); end end.new threads = 3.times.collect { Thread.new { cont.run } } sleep 0.01 while cont.running < 3 # Wait for all threads to be running sockets = 2.times.collect { TCPSocket.new("", cont.port) } cont.connect_io(sockets[1]) # No exception cont.connect_io(sockets[0], {:handler => client_handler}) # Should stop container threads.each { |t| assert_equal("Bad Dog", assert_raises(TestException) {t.join}.message) } sockets.each { |s| assert s.closed? } assert cont.listener.to_io.closed? assert_raises(Container::StoppedError) { cont.run } assert_raises(Container::StoppedError) { cont.listen "" } end # Make sure Container::Scheduler puts tasks in proper order. def test_scheduler a = [] s = Schedule.new assert_equal true, s.add(Time.at 3) { a << 3 } assert_equal false, s.process(Time.at 2) # Should not run assert_equal [], a assert_equal true, s.process(Time.at 3) # Should run assert_equal [3], a a = [] assert_equal true, s.add(Time.at 3) { a << 3 } assert_equal false, s.add(Time.at 5) { a << 5 } assert_equal false, s.add(Time.at 1) { a << 1 } assert_equal false, s.add(Time.at 4) { a << 4 } assert_equal false, s.add(Time.at 4) { a << 4.1 } assert_equal false, s.add(Time.at 4) { a << 4.2 } assert_equal false, s.process(Time.at 4) assert_equal [1, 3, 4, 4.1, 4.2], a a = [] assert_equal true, s.process(Time.at 5) assert_equal [5], a end def test_container_schedule c = Container.new __method__ delays = [0.1, 0.03, 0.02, 0.04] a = [] delays.each { |d| c.schedule(d) { a << [d, Time.now] } } start = Time.now c.run delays.sort.each do |d| x = a.shift assert_equal d, x[0] assert_in_delta start + d, x[1], 0.01 end end def test_work_queue cont = ServerContainer.new(__method__, {}, 1) c = cont.connect(cont.url) t = Thread.new { cont.run } q = Queue.new start = Time.now c.work_queue.schedule(0.02) { q << [3, Thread.current] } c.work_queue.add { q << [1, Thread.current] } c.work_queue.schedule(0.04) { q << [4, Thread.current] } c.work_queue.add { q << [2, Thread.current] } assert_equal [1, t], q.pop assert_equal [2, t], q.pop assert_in_delta 0.0, Time.now - start, 0.01 assert_equal [3, t], q.pop assert_in_delta 0.02, Time.now - start, 0.01 assert_equal [4, t], q.pop assert_in_delta 0.04, Time.now - start, 0.01 c.work_queue.add { c.close } t.join assert_raises(EOFError) { c.work_queue.add { } } end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/test_connection_driver.rb0000664000000000000000000001244413257152177023535 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'test_tools' require 'minitest/unit' include Qpid::Proton # Test delivery of raw proton events class RawDriverTest < MiniTest::Test # Raw handler to record all on_xxx calls class RecordingHandler def initialize() @calls =[]; end def proton_adapter_class() nil; end # Raw adapter attr_reader :calls def method_missing(name, *args) respond_to_missing?(name) ? @calls << name : super; end def respond_to_missing?(name, private=false); (/^on_/ =~ name); end def respond_to?(name, all=false) super || respond_to_missing?(name); end # For ruby < 1.9.2 end def test_send_recv send_class = Class.new do def proton_adapter_class() nil; end # Raw adapter attr_reader :outcome def on_link_flow(event) event.sender.send Message.new("foo"); end def on_delivery(event) @outcome = event.delivery.state event.connection.close; end end recv_class = Class.new do def proton_adapter_class() nil; end # Raw adapter attr_reader :message def on_connection_remote_open(event) event.context.open; end def on_session_remote_open(event) event.context.open; end def on_link_remote_open(event) event.link.open; event.link.flow(1); end def on_delivery(event) @message = event.message; event.delivery.accept; end end d = DriverPair.new(send_class.new, recv_class.new) d.client.connection.open(:container_id => __method__); d.client.connection.open_sender() d.run assert_equal(d.server.handler.message.body, "foo") assert_equal Transfer::ACCEPTED, d.client.handler.outcome end def test_idle d = DriverPair.new(RecordingHandler.new, RecordingHandler.new) ms = 444 secs = Rational(ms, 1000) # Use rationals to keep it accurate opts = {:idle_timeout => secs} d.client.transport.apply(opts) assert_equal(ms, d.client.transport.idle_timeout) # Transport converts to ms d.server.transport.set_server d.client.connection.open(opts) start = Time.at(1) # Dummy timeline tick = d.run start # Process all IO events assert_equal(secs/4, tick - start) assert_equal [:on_connection_init, :on_connection_local_open, :on_connection_bound], d.client.handler.calls assert_equal [:on_connection_init, :on_connection_bound, :on_connection_remote_open, :on_transport], d.server.handler.calls assert_equal (ms), d.client.transport.idle_timeout assert_equal (ms/2), d.server.transport.remote_idle_timeout # proton changes the value assert_equal (secs/2), d.server.connection.idle_timeout # Now update the time till we get connections closing d.each { |x| x.handler.calls.clear } d.run(start + secs - 0.001) # Should nothing, timeout not reached assert_equal [[],[]], d.collect { |x| x.handler.calls } d.run(start + secs*2) # After 2x timeout, connections should close assert_equal [[:on_transport_error, :on_transport_tail_closed, :on_transport_head_closed, :on_transport_closed], [:on_connection_remote_close, :on_transport_tail_closed, :on_transport_head_closed, :on_transport_closed]], d.collect { |x| x.handler.calls } end # Test each_session/each_link methods both with a block and returning Enumerator def test_enumerators connection = Connection.new() (3.times.collect { connection.open_session }).each { |s| s.open_sender; s.open_receiver } assert_equal 3, connection.each_session.to_a.size assert_equal 6, connection.each_link.to_a.size # Build Session => Set map using connection link enumerator map1 = {} connection.each_link { |l| map1[l.session] ||= Set.new; map1[l.session] << l } assert_equal 3, map1.size map1.each do |session,links| assert_equal 2, links.size links.each { |l| assert_equal session, l.session } end # Build Session => Set map using connection and session blocks map2 = {} connection.each_session do |session| map2[session] = Set.new session.each_link { |l| map2[session] << l } end assert_equal map1, map2 # Build Session => Set map using connection session and session enumerators map3 = Hash[connection.each_session.collect { |s| [s, Set.new(s.each_link)] }] assert_equal map1, map3 assert_equal [true, true, true], connection.each_sender.collect { |l| l.is_a? Sender } assert_equal [true, true, true], connection.each_receiver.collect { |l| l.is_a? Receiver } connection.each_session { |session| assert_equal [true], session.each_sender.collect { |l| l.is_a? Sender } assert_equal [true], session.each_receiver.collect { |l| l.is_a? Receiver } } end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/0000775000000000000000000000000013257152177021106 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/simple_send.rb0000664000000000000000000000314113257152177023734 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' require_relative 'lib/send_and_receive' options = { :address => "localhost:5672/examples", :messages => 10, } class SimpleSend < ExampleSend def initialize(url, messages) super(url, messages) end def on_start(event) event.container.create_sender(url) end end OptionParser.new do |opts| opts.banner = "Usage: simple_send.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}", OptionParser::DecimalInteger) do |messages| options[:messages] = messages end end.parse! Qpid::Proton::Reactor::Container.new(SimpleSend.new(options[:address], options[:messages])).run qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/simple_recv.rb0000664000000000000000000000317113257152177023745 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' require_relative 'lib/send_and_receive' class Receiver < ExampleReceive def initialize(url, count) super(url, count) end def on_start(event) event.container.create_receiver(@url) end end options = { :address => "localhost:5672/examples", :messages => 10, } OptionParser.new do |opts| opts.banner = "Usage: simple_send.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}", OptionParser::DecimalInteger) do |messages| options[:messages] = messages end end.parse! begin Qpid::Proton::Reactor::Container.new(Receiver.new(options[:address], options[:messages])).run rescue Interrupt end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/server.rb0000664000000000000000000000444313257152177022746 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' class Server < Qpid::Proton::Handler::MessagingHandler def initialize(url) super() @url = Qpid::Proton::URL.new url @address = @url.path @senders = {} end def on_start(event) @container = event.container @conn = @container.connect(:url => @url) @receiver = @container.create_receiver(@conn, :source => @address) @relay = nil end def on_connection_opened(event) if event.connection.offered_capabilities && event.connection.offered_capabilities.contain?("ANONYMOUS-RELAY") @relay = @container.create_sender(@conn, nil) end end def on_message(event) msg = event.message puts "<- #{msg.body}" sender = @relay || @senders[msg.reply_to] if sender.nil? sender = @container.create_sender(@conn, :target => msg.reply_to) @senders[msg.reply_to] = sender end reply = Qpid::Proton::Message.new reply.address = msg.reply_to reply.body = msg.body.upcase puts "-> #{reply.body}" reply.correlation_id = msg.correlation_id sender.send(reply) end def on_transport_error(event) raise "Connection error: #{event.transport.condition}" end end options = { :address => "localhost:5672/examples", } OptionParser.new do |opts| opts.banner = "Usage: server.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") { |address| options[:address] = address } end.parse! Qpid::Proton::Reactor::Container.new(Server.new(options[:address])).run() qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/old_example_test.rb0000775000000000000000000000632213257152177024771 0ustar #!/usr/bin/env ruby # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require 'minitest/autorun' require 'qpid_proton' require 'socket' require 'rbconfig' begin MiniTest::Test rescue NameError # For older versions of MiniTest MiniTest::Test = MiniTest::Unit::TestCase end def unused_port; TCPServer.open(0) { |s| s.addr[1] } end def make_url(port, path) "amqp://:#{port}/#{path}"; end class OldExampleTest < MiniTest::Test def run_script(*args) IO.popen [RbConfig.ruby, *args]; end def assert_output(want, args) assert_equal want.strip, run_script(*args).read.strip end def test_helloworld assert_output "Hello world!", ["helloworld.rb", "-a", make_url($port, __method__)] end def test_send_recv assert_output "All 10 messages confirmed!", ["simple_send.rb", "-a", make_url($port, __method__)] want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_output want, ["simple_recv.rb", "-a", make_url($port, __method__)] end def test_client_server want = < Twas brillig, and the slithy toves <- TWAS BRILLIG, AND THE SLITHY TOVES -> Did gire and gymble in the wabe. <- DID GIRE AND GYMBLE IN THE WABE. -> All mimsy were the borogroves, <- ALL MIMSY WERE THE BOROGROVES, -> And the mome raths outgrabe. <- AND THE MOME RATHS OUTGRABE. EOS srv = run_script("server.rb", "-a", make_url($port, __method__)) assert_output(want, ["client.rb", "-a", make_url($port, __method__)]) ensure Process.kill :TERM, srv.pid if srv end def test_direct_recv url = make_url unused_port, __method__ p = run_script("direct_recv.rb", "-a", url) p.readline # Wait till ready assert_output("All 10 messages confirmed!", ["simple_send.rb", "-a", url]) want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_equal(want.strip, p.read.strip) end def test_direct_send url = make_url unused_port, __method__ p = run_script("direct_send.rb", "-a", url) p.readline # Wait till ready want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_output(want, ["simple_recv.rb", "-a", url]) assert_equal("All 10 messages confirmed!", p.read.strip) end end # Start the broker before all tests. $port = unused_port $broker = IO.popen [RbConfig.ruby, "broker.rb", "-a", ":#{$port}"] $broker.readline # Wait for "Listening" # Kill the broker after all tests MiniTest.after_run do Process.kill(:TERM, $broker.pid) if $broker end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/0000775000000000000000000000000013257152177021654 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/send_and_receive.rb0000664000000000000000000000425713257152177025466 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. class ExampleSend < Qpid::Proton::Handler::MessagingHandler attr_reader :url def initialize(url, expected) super() @url = url @sent = 0 @confirmed = 0 @expected = expected end def on_sendable(event) while event.sender.credit > 0 && @sent < @expected msg = Qpid::Proton::Message.new msg.body = "sequence #{@sent}" msg.id = @sent event.sender.send(msg) @sent = @sent + 1 end end def on_accepted(event) @confirmed = @confirmed + 1 if self.finished? puts "#{@expected > 1 ? 'All ' : ''}#{@expected} message#{@expected > 1 ? 's' : ''} confirmed!" event.connection.close end end def on_disconnected(event) @sent = @confirmed end def finished? @confirmed == @expected end end class ExampleReceive < Qpid::Proton::Handler::MessagingHandler attr_reader :url def initialize(url, expected) super() @url = url @expected = expected @received = 0 end def on_message(event) if event.message.id.nil? || event.message.id < @received puts "Missing or old message id: id=#{event.message.id}" return end if @expected.zero? || (@received < @expected) puts "Received: #{event.message.body}" @received = @received + 1 if finished? event.receiver.close event.connection.close end end end def finished? @received == @expected end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/selectable.rb0000664000000000000000000000505013257152177024304 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. class Selectable attr_reader :transport def initialize(transport, socket) @transport = transport @socket = socket @socket.autoclose = true @write_done = false @read_done = false end def closed? return true if @socket.closed? return false if !@read_done && !@write_done @socket.close true end def fileno @socket.fileno unless @socket.closed? end def to_io @socket end def reading? return false if @read_done c = @transport.capacity if c > 0 return true elsif c < 0 @read_done = true return false else return false end end def writing? return false if @write_done begin p = @transport.pending if p > 0 return true elsif p < 0 @write_done = true return false else return false end rescue Qpid::Proton::TransportError => error @write_done = true return false end end def readable c = @transport.capacity if c > 0 begin data = @socket.recv(c) if data @transport.push(data) else @transport.close_tail end rescue Exception => error puts "read error; #{error}" @transport.close_tail @read_done = true end elsif c < 0 @read_done = true end end def writable begin p = @transport.pending if p > 0 data = @transport.peek(p) n = @socket.send(data, 0) @transport.pop(n) elsif p < 0 @write_done = true end rescue Exception => error puts "write error: #{error}" puts error.backtrace.join("\n") @transport.close_head @write_done = true end end def tick(now) @transport.tick(now) end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/qpid_examples.rb0000664000000000000000000000161613257152177025040 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require "qpid_proton" require "selectable" require "driver" require "socket" require "monitor" include Socket::Constants qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/driver.rb0000664000000000000000000000343413257152177023500 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. class Driver def initialize @selectables = {} end def add(selectable) @selectables[selectable.fileno] = selectable end def process reading = [] writing = [] @selectables.each_value do |sel| if sel.closed? || sel.fileno.nil? @selectables.delete(sel.fileno) else begin reading << sel.to_io if sel.reading? writing << sel.to_io if sel.writing? rescue Exception => error puts "Error: #{error}" puts error.backtrace.join("\n"); # @selectables.delete(sel.fileno) end end end read_from, write_to = IO.select(reading, writing, [], 0) unless read_from.nil? read_from.each do |r| sel = @selectables[r.fileno] sel.readable unless sel.nil? || sel.closed? end end begin unless write_to.nil? write_to.each do |w| sel = @selectables[w.fileno] sel.writable unless sel.nil? || sel.closed? end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/lib/debugging.rb0000664000000000000000000000156513257152177024143 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Debugging def debug(text) print "[#{Time.now.strftime('%s')}] #{text}\n" end end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/helloworld_direct.rb0000664000000000000000000000350313257152177025141 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' options = { :address => "localhost:5672/examples", } class HelloWorldDirect < Qpid::Proton::Handler::MessagingHandler include Qpid::Proton::Util::Wrapper def initialize(url) super() @url = url end def on_start(event) @acceptor = event.container.listen(@url) event.container.create_sender(@url) end def on_sendable(event) msg = Qpid::Proton::Message.new msg.body = "Hello world!" event.sender.send(msg) event.sender.close end def on_message(event) puts "#{event.message.body}" end def on_accepted(event) event.connection.close end def on_connection_closed(event) @acceptor.close end end OptionParser.new do |opts| opts.banner = "Usage: helloworld_direct.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end end.parse! begin Qpid::Proton::Reactor::Container.new(HelloWorldDirect.new(options[:address])).run rescue Interrupt => error end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/helloworld.rb0000664000000000000000000000402613257152177023610 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' class HelloWorld < Qpid::Proton::Handler::MessagingHandler def initialize(server, address) super() @server = server @address = address end def on_start(event) conn = event.container.connect(:address => @server) event.container.create_sender(conn, :target => @address) event.container.create_receiver(conn, :source => @address) end def on_sendable(event) msg = Qpid::Proton::Message.new msg.body = "Hello world!" event.sender.send(msg) event.sender.close end def on_message(event) puts event.message.body event.connection.close end def on_transport_error(event) raise "Connection error: #{event.transport.condition}" end end options = { :address => "localhost:5672", :queue => "examples" } OptionParser.new do |opts| opts.banner = "Usage: helloworld_direct.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end opts.on("-q", "--queue=QUEUE", "Send messages to QUEUE (def. #{options[:queue]})") do |queue| options[:queue] = queue end end.parse! hw = HelloWorld.new(options[:address], "examples") Qpid::Proton::Reactor::Container.new(hw).run qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/direct_send.rb0000664000000000000000000000344613257152177023725 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' require_relative 'lib/send_and_receive' options = { :address => "localhost:5672/examples", :messages => 10, } class SimpleSend < ExampleSend def initialize(url, messages) super(url, messages) end def on_start(event) @acceptor = event.container.listen(url) puts "Listening"; STDOUT.flush end def on_connection_opening(event) @acceptor.close end end OptionParser.new do |opts| opts.banner = "Usage: simple_send.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}", OptionParser::DecimalInteger) do |messages| options[:messages] = messages end end.parse! begin Qpid::Proton::Reactor::Container.new(SimpleSend.new(options[:address], options[:messages]), {:container_id=> "direct_send"}).run rescue Interrupt => error puts "ERROR: #{error}" end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/direct_recv.rb0000664000000000000000000000343313257152177023727 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' require_relative 'lib/send_and_receive' class DirectReceive < ExampleReceive def initialize(url, expected) super end def on_start(event) @acceptor = event.container.listen(self.url) puts "Listening"; STDOUT.flush end def on_connection_opening(event) @acceptor.close end def on_message(event) super(event) @acceptor.close if self.finished? end end options = { :address => "localhost:5672/examples", :messages => 10, } OptionParser.new do |opts| opts.banner = "Usage: simple_send.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address| options[:address] = address end opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}", OptionParser::DecimalInteger) do |messages| options[:messages] = messages end end.parse! Qpid::Proton::Reactor::Container.new(DirectReceive.new(options[:address], options[:messages])).run qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/client.rb0000664000000000000000000000442113257152177022712 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' class Client < Qpid::Proton::Handler::MessagingHandler def initialize(url, requests) super() @url = url @requests = requests end def on_start(event) @sender = event.container.create_sender(@url) @receiver = event.container.create_receiver(@sender.connection, :dynamic => true) end def next_request if @receiver.remote_source.address req = Qpid::Proton::Message.new req.reply_to = @receiver.remote_source.address req.body = @requests.first puts "-> #{req.body}" @sender.send(req) end end def on_link_opened(event) if event.receiver == @receiver next_request end end def on_message(event) puts "<- #{event.message.body}" @requests.delete_at(0) if !@requests.empty? next_request else event.connection.close end end def on_transport_error(event) raise "Connection error: #{event.transport.condition}" end end REQUESTS = ["Twas brillig, and the slithy toves", "Did gire and gymble in the wabe.", "All mimsy were the borogroves,", "And the mome raths outgrabe."] options = { :address => "localhost:5672/examples", } OptionParser.new do |opts| opts.banner = "Usage: client.rb [options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") { |address| options[:address] = address } end.parse! Qpid::Proton::Reactor::Container.new(Client.new(options[:address], REQUESTS)).run qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/broker.rb0000664000000000000000000001274613257152177022731 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'qpid_proton' require 'optparse' require 'pathname' require_relative 'lib/debugging' class Exchange include Debugging def initialize(dynamic = false) @dynamic = dynamic @queue = Queue.new @consumers = [] end def subscribe(consumer) debug("subscribing #{consumer}") if $options[:debug] @consumers << (consumer) debug(" there are #{@consumers.size} consumers") if $options[:debug] end def unsubscribe(consumer) debug("unsubscribing #{consumer}") if $options[:debug] if @consumers.include?(consumer) @consumers.delete(consumer) else debug(" consumer doesn't exist") if $options[:debug] end debug(" there are #{@consumers.size} consumers") if $options[:debug] @consumers.empty? && (@dynamic || @queue.empty?) end def publish(message) debug("queueing message: #{message.body}") if $options[:debug] @queue << message self.dispatch end def dispatch(consumer = nil) debug("dispatching: consumer=#{consumer}") if $options[:debug] if consumer c = [consumer] else c = @consumers end while self.deliver_to(c) do end end def deliver_to(consumers) debug("delivering to #{consumers.size} consumer(s)") if $options[:debug] result = false consumers.each do |consumer| debug(" current consumer=#{consumer} credit=#{consumer.credit}") if $options[:debug] if consumer.credit > 0 && !@queue.empty? consumer.send(@queue.pop(true)) result = true end end return result end end class Broker < Qpid::Proton::Handler::MessagingHandler include Debugging def initialize(url) super() @url = url @queues = {} end def on_start(event) debug("on_start event") if $options[:debug] @acceptor = event.container.listen(@url) print "Listening on #{@url}\n" STDOUT.flush end def queue(address) debug("fetching queue for #{address}: (there are #{@queues.size} queues)") if $options[:debug] unless @queues.has_key?(address) debug(" creating new queue") if $options[:debug] @queues[address] = Exchange.new else debug(" using existing queue") if $options[:debug] end result = @queues[address] debug(" returning #{result}") if $options[:debug] return result end def on_link_opening(event) debug("processing on_link_opening") if $options[:debug] debug("link is#{event.link.sender? ? '' : ' not'} a sender") if $options[:debug] if event.link.sender? if event.link.remote_source.dynamic? address = SecureRandom.uuid event.link.source.address = address q = Exchange.new(true) @queues[address] = q q.subscribe(event.link) elsif event.link.remote_source.address event.link.source.address = event.link.remote_source.address self.queue(event.link.source.address).subscribe(event.link) end elsif event.link.remote_target.address event.link.target.address = event.link.remote_target.address end end def unsubscribe(link) debug("unsubscribing #{link.address}") if $options[:debug] if @queues.has_key?(link.source.address) if @queues[link.source.address].unsubscribe(link) @queues.delete(link.source.address) end end end def on_link_closing(event) self.unsubscribe(event.link) if event.link.sender? end def on_connection_closing(event) self.remove_stale_consumers(event.connection) end def on_disconnected(event) self.remove_stale_consumers(event.connection) end def remove_stale_consumers(connection) l = connection.link_head(Qpid::Proton::Endpoint::REMOTE_ACTIVE) while !l.nil? self.unsubscribe(l) if l.sender? l = l.next(Qpid::Proton::Endpoint::REMOTE_ACTIVE) end end def on_sendable(event) debug("on_sendable event") if $options[:debug] q = self.queue(event.link.source.address) debug(" dispatching #{event.message} to #{q}") if $options[:debug] q.dispatch(event.link) end def on_message(event) debug("on_message event") if $options[:debug] q = self.queue(event.link.target.address) debug(" dispatching #{event.message} to #{q}") if $options[:debug] q.publish(event.message) end end $options = { :address => "localhost:5672", :debug => false } OptionParser.new do |opts| opts.banner = "Usage: #{Pathname.new(__FILE__).basename} [$options]" opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{$options[:address]}).") do |address| $options[:address] = address end opts.on("-d", "--debug", "Enable debugging output (def. #{$options[:debug]})") do $options[:debug] = true end end.parse! begin Qpid::Proton::Reactor::Container.new(Broker.new($options[:address])).run rescue Interrupt end qpid-proton-0.22.0/proton-c/bindings/ruby/tests/old_examples/README.md0000664000000000000000000000043113257152177022363 0ustar # OLD EXAMPLES FOR BACKWARDS COMPATIBILITY TESTING These examples are from 0.18.1, before the ruby IO refactoring. They are run as part of the regression test suite to catch breaks in backwards compatibility. They will be removed when all deprecated features have been removed. qpid-proton-0.22.0/proton-c/bindings/ruby/spec/0000775000000000000000000000000013257152177016222 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/spec/spec_helper.rb0000664000000000000000000000614613257152177021047 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require 'minitest/autorun' require "securerandom" require "qpid_proton" # in Ruby 1.8 there is no SecureRandom module if RUBY_VERSION < "1.9" module SecureRandom class << self def method_missing(method_sym, *arguments, &block) case method_sym when :urlsafe_base64 r19_urlsafe_base64(*arguments) when :uuid r19_uuid(*arguments) else super end end private def r19_urlsafe_base64(n=nil, padding=false) s = [random_bytes(n)].pack("m*") s.delete!("\n") s.tr!("+/", "-_") s.delete!("=") if !padding s end def r19_uuid ary = random_bytes(16).unpack("NnnnnN") ary[2] = (ary[2] & 0x0fff) | 0x4000 ary[3] = (ary[3] & 0x3fff) | 0x8000 "%08x-%04x-%04x-%04x-%04x%08x" % ary end end end end # Generates a random string of the specified length def random_string(length = 8) (0...length).map{65.+(rand(25)).chr}.join end # Generates a random list of the specified length. def random_list(length) result = [] (0...length).each do |element| low = rand(512) high = rand(8192) case when element == 0 then result << rand(128) when element == 1 then result << random_string(rand(128)) when element == 2 then result << rand * (low - high).abs + low when element == 3 then result << SecureRandom.uuid end end return result end # Generates a random array of a random type. # Returns both the array and the type. def random_array(length, described = false, description = nil) choice = rand(128) % 4 type = [Qpid::Proton::Types::INT, Qpid::Proton::Types::STRING, Qpid::Proton::Types::DOUBLE, Qpid::Proton::Types::UUID][choice] result = Qpid::Proton::Types::UniformArray.new(type) low = rand(512) high = rand(8192) (0...length).each do |element| case when choice == 0 then result << rand(1024) when choice == 1 then result << random_string(rand(128)) when choice == 2 then result << rand * (low - high).abs + low when choice == 3 then result << SecureRandom.uuid end end return result end # Generates a random hash of values. def random_hash(length) result = {} values = random_list(length) values.each do |value| result[random_string(64)] = value end return result end qpid-proton-0.22.0/proton-c/bindings/ruby/spec/message_spec.rb0000664000000000000000000004070413257152177021212 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require "spec_helper" module Qpid module Proton describe "A message" do before (:each) do @message = Qpid::Proton::Message.new end it "can be created" do @message.wont_be_nil end it "can be cleared" do subject = random_string(16) @message.subject = subject @message.subject.must_equal(subject) @message.clear @message.subject.wont_equal(subject) end it "can be durable" do @message.durable = true @message.durable.must_equal(true) @message.durable = false @message.durable.must_equal(false) end it "raises an error when setting durable to nil" do proc { @message.durable = nil }.must_raise(TypeError) end it "raises an error when setting the priority to nil" do proc { @message.priority = nil }.must_raise(TypeError) end it "raises an error when setting the priority to a non-number" do proc { @message.priority = "abck" }.must_raise(TypeError) end it "sets the priority to the integer portion when a float" do priority = rand(100) / 10 @message.priority = priority @message.priority.must_equal(priority.floor) end it "rejects a priority with too large of a value" do proc { @message.priority = (rand(100) + 256) }.must_raise(RangeError) end it "rejects a negative priority" do proc { @message.priority = (0 - (rand(255) + 1)) }.must_raise(RangeError) end it "has a priority" do priority = rand(256) @message.priority = priority @message.priority.must_equal(priority) end it "raises an error when setting the time-to-live to nil" do proc { @message.ttl = nil }.must_raise(TypeError) end it "raises an error when setting the time-to-live to a non-number" do proc { @message.ttl = random_string(5) }.must_raise(TypeError) end it "sets the time-to-live to the integer portion when a float" do ttl = (rand(32767) / 10) @message.ttl = ttl @message.ttl.must_equal(ttl.floor) end it "raises an error when the time-to-live is negative" do proc { @message.ttl = (0 - rand(1000)) }.must_raise(RangeError) end it "has a time-to-live" do ttl = rand(32767) @message.ttl = ttl @message.ttl.must_equal(ttl) end it "raises an error when setting first acquirer to nil" do proc { @message.first_acquirer = nil }.must_raise(TypeError) end it "raises and error when setting first acquirer to a non-boolean" do proc { @message.first_acquirer = random_string(16) }.must_raise(TypeError) end it "has a first acquirer" do @message.first_acquirer = true @message.first_acquirer?.must_equal(true) @message.first_acquirer = false @message.first_acquirer?.must_equal(false) end it "raises an error on a nil delivery count" do proc { @message.delivery_count = nil }.must_raise(::ArgumentError) end it "raises an error on a negative delivery count" do proc { @message.delivery_count = -1 }.must_raise(RangeError) end it "raises an error on a non-numeric delivery count" do proc { @message.delivery_count = "farkle" }.must_raise(::ArgumentError) end it "converts a floating point delivery count to its integer portion" do count = rand(255) / 10.0 @message.delivery_count = count @message.delivery_count.must_equal(count.floor) end it "has a delivery count" do count = rand(255) @message.delivery_count = count @message.delivery_count.must_equal(count) end it "allows setting a nil id" do @message.id = nil @message.id.must_be_nil end it "has an id" do id = random_string(16) @message.id = id @message.id.must_equal(id) end it "allows setting a nil user id" do @message.user_id = nil @message.user_id.must_equal("") end it "has a user id" do id = random_string(16) @message.user_id = id @message.user_id.must_equal(id) end it "allows setting a nil address" do @message.address = nil @message.address.must_be_nil end it "has an address" do address = "//0.0.0.0/#{random_string(16)}" @message.address = address @message.address.must_equal(address) end it "allows setting a nil subject" do @message.subject = nil @message.subject.must_be_nil end it "has a subject" do subject = random_string(50) @message.subject = subject @message.subject.must_equal(subject) end it "will allow a nil reply-to address" do @message.reply_to = nil @message.reply_to.must_be_nil end it "has a reply-to address" do address = "//0.0.0.0/#{random_string(16)}" @message.reply_to = address @message.reply_to.must_equal(address) end it "will allow a nil correlation id" do @message.correlation_id = nil @message.correlation_id.must_be_nil end it "has a correlation id" do id = random_string(25) @message.correlation_id = id @message.correlation_id.must_equal(id) end it "will allow a nil content type" do @message.content_type = nil @message.content_type.must_be_nil end it "will allow an empty content type" do @message.content_type = "" @message.content_type.must_equal("") end it "has a content type" do content_type = random_string(32) @message.content_type = content_type @message.content_type.must_equal(content_type) end it "can have nil content encoding" do @message.content_encoding = nil @message.content_encoding.must_be_nil end it "has a content encoding" do encoding = "#{random_string(8)}/#{random_string(8)}" @message.content_encoding = encoding @message.content_encoding.must_equal(encoding) end it "raises an error on a nil expiry time" do proc { @message.expires = nil }.must_raise(TypeError) end it "raises an error on a negative expiry time" do proc { @message.expires = (0-(rand(65535))) }.must_raise(::ArgumentError) end it "can have a zero expiry time" do @message.expires = 0 @message.expires.must_equal(0) end it "has an expiry time" do time = rand(65535) @message.expires = time @message.expires.must_equal(time) end it "raises an error on a nil creation time" do proc { @message.creation_time = nil }.must_raise(TypeError) end it "raises an error on a negative creation time" do proc { @message.creation_time = (0 - rand(65535)) }.must_raise(::ArgumentError) end it "can have a zero creation time" do @message.creation_time = 0 @message.creation_time.must_equal(0) end it "has a creation time" do time = rand(65535) @message.creation_time = time @message.creation_time.must_equal(time) end it "can have a nil group id" do @message.group_id = nil @message.group_id.must_be_nil end it "can have an empty group id" do @message.group_id = "" @message.group_id.must_equal("") end it "has a group id" do id = random_string(16) @message.group_id = id @message.group_id.must_equal(id) end it "raises an error on a nil group sequence" do proc { @message.group_sequence = nil }.must_raise(TypeError) end it "can have a negative group sequence" do seq = (0 - rand(32767)) @message.group_sequence = seq @message.group_sequence.must_equal(seq) end it "can have a zero group sequence" do @message.group_sequence = 0 @message.group_sequence.must_equal(0) end it "has a group sequence" do id = rand(32767) @message.group_sequence = id @message.group_sequence.must_equal(id) end it "can have a nil reply-to group id" do @message.reply_to_group_id = nil @message.reply_to_group_id.must_be_nil end it "can have an empty reply-to group id" do @message.reply_to_group_id = "" @message.reply_to_group_id.must_equal("") end it "has a reply-to group id" do id = random_string(16) @message.reply_to_group_id = id @message.reply_to_group_id.must_equal(id) end it "has properties" do @message.must_respond_to(:properties) @message.must_respond_to(:properties=) @message.must_respond_to(:[]) @message.must_respond_to(:[]=) @message.properties.must_be_kind_of({}.class) end it "can replace the set of properties" do values = random_hash(128) @message.properties = values.clone @message.properties.must_equal(values) end it "can set properties" do name = random_string(16) value = random_string(128) @message[name] = value @message[name].must_equal(value) end it "can update properties" do name = random_string(16) value = random_string(128) @message[name] = value @message[name].must_equal(value) value = random_string(128) @message[name] = value @message[name].must_equal(value) end it "can hold a null property" do name = random_string(16) value = random_string(128) @message[name] = value @message[name].must_equal(value) @message[name] = nil @message[name].must_be_nil end it "can delete a property" do name = random_string(16) value = random_string(128) @message[name] = value @message[name].must_equal(value) @message.delete_property(name) @message.properties.keys.wont_include(name) end it "has no properties after being cleared" do name = random_string(16) value = random_string(128) @message[name] = value @message[name].must_equal(value) @message.clear @message.properties.must_be_empty end it "has instructions" do @message.must_respond_to(:instructions) @message.must_respond_to("instructions=".to_sym) end it "can set an instruction" do name = random_string(16) value = random_string(128) @message.instructions[name] = value @message.instructions[name].must_equal(value) end it "can update an instruction" do name = random_string(16) value = random_string(128) @message.instructions[name] = value @message.instructions[name].must_equal(value) value = random_string(128) @message.instructions[name] = value @message.instructions[name].must_equal(value) end it "can delete the instructions" do name = random_string(16) value = random_string(128) @message.instructions[name] = value @message.instructions.wont_be_empty @message.instructions = nil @message.instructions.must_be_nil end it "can replace the instructions" do values = random_hash(rand(128) + 1) @message.instructions = values.clone @message.instructions.must_equal(values) values = random_hash(rand(64) + 1) @message.instructions = values.clone @message.instructions.must_equal(values) end it "can delete the set of instructions" do values = random_hash(rand(128) + 1) @message.instructions = values.clone @message.instructions.must_equal(values) @message.instructions = nil @message.instructions.must_be_nil end it "has no instructions after being cleared" do value = random_hash(128) @message.instructions = value.clone @message.instructions.must_equal(value) @message.clear @message.instructions.must_be_empty end it "has annotations" do @message.must_respond_to(:annotations) @message.must_respond_to(:annotations=) end it "can set an annotation" do name = random_hash(32) value = random_hash(256) @message.annotations[name] = value.clone @message.annotations[name].must_equal(value) end it "can update an annotation" do name = random_hash(32) value = random_hash(256) @message.annotations[name] = value.clone @message.annotations[name].must_equal(value) value = random_hash(128) @message.annotations[name] = value.clone @message.annotations[name].must_equal(value) end it "can delete an annotation" do name = random_hash(32) value = random_hash(256) @message.annotations[name] = value.clone @message.annotations[name].must_equal(value) @message.annotations[name] = nil @message.annotations[name].must_be_nil end it "can replace all annotations" do values = random_hash(rand(128) + 1) @message.annotations = values.clone @message.annotations.must_equal(values) values = random_hash(rand(64) + 1) @message.annotations = values.clone @message.annotations.must_equal(values) end it "can delete the set of annotations" do value = random_hash(rand(128) + 1) @message.annotations = value.clone @message.annotations.must_equal(value) @message.annotations = nil @message.annotations.must_be_nil end it "has no annotations after being cleared" do value = random_hash(16) @message.annotations = value @message.annotations.must_equal(value) @message.clear @message.annotations.must_be_empty end it "has a body property" do @message.must_respond_to(:body) @message.must_respond_to(:body=) end it "has a default body that is nil" do @message.body.must_be_nil end it "has no body after being cleared" do value = random_string(128) @message.body = value @message.body.must_equal(value) @message.clear @message.body.must_be_nil end it "can set the body property" do (1..3).each do |which| case which when 0 value = random_string(32) when 1 value = random_array(100) when 2 value = random_hash(100) when 3 value = rand(512) end @message.body = value @message.body.must_equal(value) end end it "can update the body property" do (1..3).each do |which| case which when 0 value = random_string(32) when 1 value = random_array(100) when 2 value = random_hash(100) when 3 value = rand(512) end @message.body = value @message.body.must_equal(value) @message.body = nil @message.body.must_be_nil end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/spec/hash_spec.rb0000664000000000000000000000245413257152177020511 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require "spec_helper" describe "The extended hash type" do before :each do @data = Qpid::Proton::Codec::Data.new @hash = random_hash(rand(128) + 64) end it "can be put into an instance of Data" do @data.map = @hash result = @data.map result.keys.must_equal(@hash.keys) result.values.must_equal(@hash.values) end it "raises an error when trying to get what is not a Hash" do @data.string = random_string(128) @data.rewind proc { @data.map }.must_raise(TypeError) end end qpid-proton-0.22.0/proton-c/bindings/ruby/spec/exception_handling_spec.rb0000664000000000000000000000520013257152177023420 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require "spec_helper" module Qpid module Proton class ExceptionHandlingClass include Qpid::Proton::Util::ErrorHandler def error "This is a test error: #{Time.new}" end end describe "The exception handling mixin" do before (:each) do @handler = Qpid::Proton::ExceptionHandlingClass.new end it "does not raise an error on a zero code" do @handler.check_for_error(0) end it "raises EOS on PN_EOS" do proc { @handler.check_for_error(Qpid::Proton::Error::EOS) }.must_raise(Qpid::Proton::EOSError) end it "raises Error on PN_ERR" do proc { @handler.check_for_error(Qpid::Proton::Error::ERROR) }.must_raise(Qpid::Proton::ProtonError) end it "raises Overflow on PN_OVERFLOW" do proc { @handler.check_for_error(Qpid::Proton::Error::OVERFLOW) }.must_raise(Qpid::Proton::OverflowError) end it "raises Underflow on PN_UNDERFLOW" do proc { @handler.check_for_error(Qpid::Proton::Error::UNDERFLOW) }.must_raise(Qpid::Proton::UnderflowError) end it "raises Argument on PN_ARG_ERR" do proc { @handler.check_for_error(Qpid::Proton::Error::ARGUMENT) }.must_raise(Qpid::Proton::ArgumentError) end it "raises TimeoutError on PN_TIMEOUT" do proc { @handler.check_for_error(Qpid::Proton::Error::TIMEOUT) }.must_raise(Qpid::Proton::TimeoutError) end it "raises an Ruby ArgumentError on a nil code" do proc { @handler.check_for_error(nil) }.must_raise(::ArgumentError) end it "raises a Ruby ArgumentError on an unknown value" do proc { @handler.check_for_error("farkle") }.must_raise(::ArgumentError) end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/spec/data_spec.rb0000664000000000000000000003020313257152177020470 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require "spec_helper" module Qpid module Proton describe "A data object" do before :each do @data = Qpid::Proton::Codec::Data.new end it "can be initialized" do @data.wont_be_nil end it "can hold a null" do @data.null = nil @data.null?.must_equal(true) end it "can hold a true boolean" do @data.bool = true @data.bool.must_equal(true) end it "can hold a false boolean" do @data.bool = false @data.bool.must_equal(false) end it "raises an error on a negative ubyte" do proc { @data.ubyte = (0 - (rand(127) + 1)) }.must_raise(RangeError) end it "raises an error on a null ubyte" do proc { @data.ubyte = nil }.must_raise(TypeError) end it "can hold an unsigned byte" do value = rand(255) @data.ubyte = value @data.ubyte.must_equal(value) end it "can hold a byte" do value = rand(128) @data.byte = value @data.byte.must_equal(value) end it "can hold a negative byte" do value = 0 - (rand(126) + 1) @data.byte = value @data.byte.must_equal(value) end it "raises an error on a negative ushort" do proc { @data.ushort = (0 - (rand(65535) + 1)) }.must_raise(RangeError) end it "raises an error on a nil ushort" do proc { @data.ushort = nil }.must_raise(TypeError) end it "can hold a zero unsigned short" do @data.ushort = 0 @data.ushort.must_equal(0) end it "can hold an unsigned short" do value = rand(2**15) + 1 @data.ushort = value @data.ushort.must_equal(value) end it "raises an error on a nil short" do proc { @data.short = nil }.must_raise(TypeError) end it "can hold a short" do value = rand(2**15) + 1 @data.short = value @data.short.must_equal(value) end it "can hold a zero short" do @data.short = 0 @data.short.must_equal(0) end it "can hold a negative short" do value = (0 - (rand(2**15) + 1)) @data.short = value @data.short.must_equal(value) end it "raises an error on a nil uint" do proc { @data.uint = nil }.must_raise(TypeError) end it "raises an error on a negative uint" do proc { @data.uint = (0 - (rand(2**32) + 1)) }.must_raise(RangeError) end it "can hold an unsigned integer" do value = rand(2**32) + 1 @data.uint = value @data.uint.must_equal(value) end it "can hold a zero unsigned integer" do @data.uint = 0 @data.uint.must_equal(0) end it "raise an error on a null integer" do proc { @data.int = nil }.must_raise(TypeError) end it "can hold an integer" do value = rand(2**31) + 1 @data.int = value @data.int.must_equal(value) end it "can hold zero as an integer" do @data.int = 0 @data.int.must_equal(0) end it "raises an error on a null character" do proc { @data.char = nil }.must_raise(TypeError) end it "can hold a character" do source = random_string(256) index = rand(source.length) value = source[index,1].bytes.to_a[0] @data.char = value @data.char.must_equal(value) end it "raises an error on a null ulong" do proc { @data.ulong = nil }.must_raise(TypeError) end it "raises an error on a negative ulong" do proc { @data.ulong = (0 - (rand(2**63) + 1)) }.must_raise(RangeError) end it "can have a zero unsigned long" do @data.ulong = 0 @data.ulong.must_equal(0) end it "can hold an unsigned long" do value = rand(2**63) + 1 @data.ulong = value @data.ulong.must_equal(value) end it "raises an error on a null long" do proc { @data.long = nil }.must_raise(TypeError) end it "can have a zero long" do @data.long = 0 @data.long.must_equal(0) end it "can hold a long" do value = rand(2**63) + 1 @data.long = value @data.long.must_equal(value) end it "raise an error on a null timestamp" do proc { @data.timestamp = nil }.must_raise(TypeError) end it "can handle a negative timestamp" do last_year = Time.now - (60*60*24*365) @data.timestamp = last_year @data.timestamp.must_equal(last_year.to_i) end it "can handle a zero timestamp" do @data.timestamp = 0 @data.timestamp.must_equal(0) end it "can hold a timestamp" do next_year = Time.now + (60*60*24*365) @data.timestamp = next_year @data.timestamp.must_equal(next_year.to_i) end it "raises an error on a null float" do proc { @data.float = nil }.must_raise(TypeError) end it "can hold a negative float" do value = 0.0 - (1.0 + rand(2.0**15)).to_f @data.float = value @data.float.must_equal(value) end it "can hold a zero float" do @data.float = 0.0 @data.float.must_equal(0.0) end it "can hold a float" do value = (1.0 + rand(2.0**15)).to_f @data.float = value @data.float.must_equal(value) end it "raise an error on a null double" do proc { @data.double = nil }.must_raise(TypeError) end it "can hold a negative double" do value = 0.0 - (1.0 + rand(2.0**31)).to_f @data.double = value @data.double.must_equal(value) end it "can hold a zero double" do @data.double = 0.0 @data.double.must_equal(0.0) end it "can hold a double" do value = (1.0 + rand(2.0**31)).to_f @data.double = value @data.double.must_equal(value) end it "raises an error on a null decimal32" do proc { @data.decimal32 = nil }.must_raise(TypeError) end it "can hold a zero decimal32" do @data.decimal32 = 0 @data.decimal32.must_equal(0) end it "can hold a decimal32" do value = 1 + rand(2**31) @data.decimal32 = value @data.decimal32.must_equal(value) end it "raises an error on a null decimal64" do proc { @data.decimal64 = nil }.must_raise(TypeError) end it "can hold a zero decimal64" do @data.decimal64 = 0 @data.decimal64.must_equal(0) end it "can hold a decimal64" do value = 1 + rand(2**63) @data.decimal64 = value @data.decimal64.must_equal(value) end it "raises an error on a null decimal128" do proc { @data.decimal128 = nil }.must_raise(TypeError) end it "can hold a zero decimal128" do @data.decimal128 = 0 @data.decimal128.must_equal(0) end it "can hold a decimal128" do value = rand(2**127) @data.decimal128 = value @data.decimal128.must_equal(value) end it "raises an error on a null UUID" do proc { @data.uuid = nil }.must_raise(::ArgumentError) end it "raises an error on a malformed UUID" do proc { @data.uuid = random_string(36) }.must_raise(::ArgumentError) end it "can set a UUID from an integer value" do @data.uuid = 336307859334295828133695192821923655679 @data.uuid.must_equal("fd0289a5-8eec-4a08-9283-81d02c9d2fff") end it "can hold a UUID" do value = "fd0289a5-8eec-4a08-9283-81d02c9d2fff" @data.uuid = value @data.uuid.must_equal(value) end it "can hold a null binary" do @data.binary = nil @data.binary.must_equal("") end it "can hold a binary" do value = random_string(128) @data.binary = value @data.binary.must_equal(value) end it "can hold a null string" do @data.string = nil @data.string.must_equal("") end it "can hold a string" do value = random_string(128) @data.string = value @data.string.must_equal(value) end it "can hold a null symbol" do @data.symbol = nil @data.symbol.must_equal(:"") end it "can hold a symbol" do value = random_string(128).to_sym @data.symbol = value @data.symbol.must_equal(value) end it "can hold a described value" do name = random_string(16).to_sym value = random_string(16) @data.put_described @data.enter @data.symbol = name @data.string = value @data.exit @data.described?.must_equal(true) @data.enter @data.next @data.symbol.must_equal(name) @data.next @data.string.must_equal(value) end it "raises an error when setting the wrong type in an array" do proc { @data << Qpid::Proton::Types::UniformArray.new(Qpid::Proton::Types::INT, [1, 2.0, :a, "b"]) }.must_raise(TypeError) end it "can hold an array" do values = [] (1..(rand(100) + 5)).each { values << rand(2**16) } @data.put_array false, Qpid::Proton::Codec::INT.code @data.enter values.each { |value| @data.int = value } @data.exit @data.enter values.each do |value| @data.next @data.int.must_equal(value) end end it "can hold a described array" do values = [] (1..(rand(100) + 5)).each { values << random_string(64) } descriptor = random_string(32).to_sym @data.put_array true, Qpid::Proton::Codec::STRING.code @data.enter @data.symbol = descriptor values.each { |value| @data.string = value } @data.exit @data.get_array.must_equal([values.size, true, Qpid::Proton::Codec::STRING.code]) @data.enter @data.next @data.symbol.must_equal(descriptor) values.each do |value| @data.next @data.string.must_equal(value) end end it "can hold a list" do values = [] (1..(rand(100) + 5)).each { values << random_string(128) } @data.put_list @data.enter values.each {|value| @data.string = value} @data.exit @data.enter values.each do |value| @data.next @data.string.must_equal(value) end end it "can hold a map" do keys = [] (1..(rand(100) + 5)).each {keys << random_string(128)} values = {} keys.each {|key| values[key] = random_string(128)} @data.put_map @data.enter keys.each do |key| @data.string = key @data.string = values[key] end @data.exit @data.enter keys.each do |key| @data.next @data.string.must_equal(key) @data.next @data.string.must_equal(values[key]) end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/spec/array_spec.rb0000664000000000000000000000441413257152177020702 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require 'spec_helper' describe "The extended array type" do before :each do @data = Qpid::Proton::Codec::Data.new @list = random_list(rand(100)) @undescribed = random_array(rand(100)) @description = random_string(128) @described = random_array(rand(100), true, @description) end it "can be created like a normal array" do value = [] value.must_respond_to(:proton_put) value.must_respond_to(:proton_array_header) value.class.must_respond_to(:proton_get) end it "raises an error when the current object is not a list" do @data.string = random_string(128) @data.rewind proc { @data.list }.must_raise(TypeError) end it "can be put into a Data object as a list" do @data.list= @list result = @data.list result.must_equal(@list) end it "raises an error when the elements of an Array are dissimilar and is put into a Data object" do value = Qpid::Proton::Types::UniformArray.new(Qpid::Proton::Codec::INT) value << random_string(16) proc { @data << value }.must_raise(TypeError) end it "can be put into a Data object as an undescribed array" do @data << @undescribed result = @data.array result.must_be_kind_of Qpid::Proton::Types::UniformArray @undescribed.must_equal(result) end it "can be put into a Data object as a described array" do @data << @described result = @data.array @described.must_equal(result) result.must_be_kind_of Qpid::Proton::Types::UniformArray end end qpid-proton-0.22.0/proton-c/bindings/ruby/qpid_proton.gemspec.in0000664000000000000000000000223713257152177021604 0ustar # -- encoding: utf-8 -- lib = File.expand_path('lib/', __FILE__) $:.unshift lib unless $:.include?(lib) Gem::Specification.new do |s| s.name = "qpid_proton" s.version = "@PN_VERSION@" s.licenses = ['Apache-2.0'] s.platform = Gem::Platform::RUBY s.authors = ["Darryl L. Pierce", "Alan Conway"] s.email = ["proton@qpid.apache.org"] s.homepage = "http://qpid.apache.org/proton" s.summary = "Ruby language bindings for the Qpid Proton messaging framework" s.description = <<-EOF Proton is a high performance, lightweight messaging library. It can be used in the widest range of messaging applications including brokers, client libraries, routers, bridges, proxies, and more. Proton is based on the AMQP 1.0 messaging standard. EOF s.extensions = "ext/cproton/extconf.rb" s.files = Dir[ "LICENSE", "TODO", "ChangeLog", "ext/cproton/*.rb", "ext/cproton/*.c", "lib/**/*.rb", "tests/**/*.rb", "examples/**/*" ] s.require_path = 'lib' s.required_ruby_version = '>= 1.9.3' end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/0000775000000000000000000000000013257152177016036 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/0000775000000000000000000000000013257152177017013 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/wrapper.rb0000664000000000000000000001323313257152177021022 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton module Util # @private # Class methods to help wrapper classes define forwarding methods to proton-C functions # # The extending class must define PROTON_METHOD_PREFIX, the functions here # make it easy to define ruby methods to forward calls to C functions. # module SWIGClassHelper # Define ruby method +name+ to forward arguments to # CProton.PROTON_METHOD_PREFIX_+pn_name+(@impl, ...) def proton_forward(name, pn_name) pn_name = pn_name[0..-2] if pn_name.to_s.end_with? "?" # Drop trailing ? for ruby bool methods pn_name = "#{self::PROTON_METHOD_PREFIX}_#{pn_name}".to_sym define_method(name.to_sym) { |*args| Cproton.__send__(pn_name, @impl, *args) } end def proton_caller(*names) names.each { |name| proton_forward(name, name) }; end def proton_set(*names) names.each { |name| proton_forward("#{name}=", "set_#{name}") }; end def proton_get(*names) names.each { |name| proton_forward(name, "get_#{name}") }; end def proton_is(*names) names.each { |name| proton_forward("#{name}?", "is_#{name}") }; end def proton_set_get(*names) names.each { |name| proton_get(name); proton_set(name) }; end def proton_set_is(*names) names.each { |name| proton_is(name); proton_set(name) }; end # Store ruby wrappers as attachments so they can be retrieved from the C pointer. # # Wrappers are stored in a registry using a key. The key is then attached to # the Proton structure as a record. That record lives for as long as the # Proton structure lives, and when the structure is released the record acts # as hook to also delete the Ruby wrapper object from the registry. @@registry = {} # @private def get_key(impl) ("%032x" % Cproton.pni_address_of(impl)) end # @private # Stores the given object for later retrieval. # # @param object [Object] The object. # @param attachment_method [Symbol] The Proton attachment method. # def store_instance(object, attachment_method = nil) # ensure the impl has a reference to the wrapper object object.impl.instance_eval { @proton_wrapper = object } registry_key = get_key(object.impl) unless attachment_method.nil? record = Cproton.__send__(attachment_method, object.impl) rbkey = Cproton.Pn_rbkey_new Cproton.Pn_rbkey_set_registry(rbkey, Cproton.pn_rb2void(Qpid::Proton::Util::Wrapper.registry)) Cproton.Pn_rbkey_set_method(rbkey, "delete") Cproton.Pn_rbkey_set_key_value(rbkey, registry_key) Cproton.pn_record_def(record, RBCTX, Cproton.Pn_rbkey__class()); Cproton.pn_record_set(record, RBCTX, rbkey) end @@registry[registry_key] = object end # Retrieves the wrapper object with the supplied Proton struct. # # @param impl [Object] The wrapper for the Proton struct. # @param attachment_method [Symbol] The Proton attachment method. # # @return [Object] The Ruby wrapper object. # def fetch_instance(impl, attachment_method = nil) # if the impl has a wrapper already attached, then return it if impl.instance_variable_defined?(:@proton_wrapper) return impl.instance_variable_get(:@proton_wrapper) end unless attachment_method.nil? record = Cproton.__send__(attachment_method, impl) rbkey = Cproton.pni_void2rbkey(Cproton.pn_record_get(record, RBCTX)) # if we don't have a key, then we don't have an object return nil if rbkey.nil? registry_key = Cproton.Pn_rbkey_get_key_value(rbkey) else registry_key = get_key(impl) end # if the object's not in the registry then return return nil unless @@registry.has_key?(registry_key) result = @@registry[registry_key] # result = nil unless result.weakref_alive? if result.nil? raise Qpid::Proton::ProtonError.new("missing object for key=#{registry_key}") else # update the impl since the Swig wrapper for it may have changed result.impl = impl end return result end RBCTX = self.hash.to_i end # @private # # Instance methods to include in classes that wrap pn_object types # that support pn_inspect etc. Automatically extends SWIGClassHelper # module Wrapper def self.included(base) base.extend(SWIGClassHelper) end attr_accessor :impl def inspect return "#{self.class}" unless @impl pstr = Cproton.pn_string("") begin Cproton.pn_inspect(@impl, pstr) return Cproton.pn_string_get(pstr) ensure Cproton.pn_free(pstr) end end def to_s() inspect; end def self.registry @registry ||= {} end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/version.rb0000664000000000000000000000203013257152177021020 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton::Util # The major version for the underlying Proton library. # @private VERSION_MAJOR = Cproton::PN_VERSION_MAJOR # The minor version for the underlying Proton library. # @private VERSION_MINOR = Cproton::PN_VERSION_MINOR end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/schedule.rb0000664000000000000000000000507113257152177021137 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @private module TimeCompare # t1 <= t2, where nil is treated as "distant future" def before_eq(t1, t2) (t1 && t2) ? (t1 <= t2) : t1; end # min(t1, t2) where nil is treated as "distant future" def earliest(t1, t2) before_eq(t1, t2) ? t1 : t2; end end # @private # A sorted, thread-safe list of scheduled Proc. # Note: calls to #process are always serialized, but calls to #add may be concurrent. class Schedule include TimeCompare Item = Struct.new(:time, :proc) def initialize() @lock = Mutex.new @items = [] @closed = false end def next_tick() @lock.synchronize { @items.first.time unless @items.empty? } end # @return true if the Schedule was previously empty # @raise EOFError if schedule is closed # @raise ThreadError if +non_block+ and operation would block def add(time, non_block=false, &proc) # non_block ignored for now, but we may implement a bounded schedule in future. @lock.synchronize do raise EOFError if @closed if at = (0...@items.size).bsearch { |i| @items[i].time > time } @items.insert(at, Item.new(time, proc)) else @items << Item.new(time, proc) end return @items.size == 1 end end # @return true if the Schedule became empty as a result of this call def process(now) due = [] empty = @lock.synchronize do due << @items.shift while (!@items.empty? && before_eq(@items.first.time, now)) @items.empty? end due.each { |i| i.proc.call() } return empty && !due.empty? end # #add raises EOFError after #close. # #process can still be called to drain the schedule. def close() @lock.synchronize { @closed = true } end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/error_handler.rb0000664000000000000000000000661113257152177022172 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton::Util # Provides mixin functionality for dealing with exception conditions. # # @private module ErrorHandler def self.included(other) other.extend(self); end def can_raise_error(method_names, options = {}) error_class = options[:error_class] below = options[:below] || 0 # coerce the names to be an array Array(method_names).each do |method_name| raise "missing method #{method_name.inspect}" unless method_defined?(method_name) || private_method_defined?(method_name) create_exception_handler_wrapper(method_name, error_class, below) end end def create_exception_handler_wrapper(method_name, error_class = nil, below = 0) original_method_name = method_name.to_s wrapped_method_name = "_excwrap_#{original_method_name}" alias_method wrapped_method_name, original_method_name define_method original_method_name do |*args, &block| # need to get a reference to the method object itself since # calls to Class.send interfere with Messenger.send method = self.method(wrapped_method_name.to_sym) rc = method.call(*args, &block) check_for_error(rc, error_class) if rc < below return rc end end # Raises an Proton-specific error if a return code is non-zero. # # Expects the class to provide an +error+ method. def check_for_error(code, error_class = nil) raise ::ArgumentError.new("Invalid error code: #{code}") if code.nil? return code if code > 0 case(code) when Qpid::Proton::Error::NONE return when Qpid::Proton::Error::EOS raise Qpid::Proton::EOSError.new(self.error) when Qpid::Proton::Error::ERROR raise Qpid::Proton::ProtonError.new(self.error) when Qpid::Proton::Error::OVERFLOW raise Qpid::Proton::OverflowError.new(self.error) when Qpid::Proton::Error::UNDERFLOW raise Qpid::Proton::UnderflowError.new(self.error) when Qpid::Proton::Error::ARGUMENT raise Qpid::Proton::ArgumentError.new(self.error) when Qpid::Proton::Error::STATE raise Qpid::Proton::StateError.new(self.error) when Qpid::Proton::Error::TIMEOUT raise Qpid::Proton::TimeoutError.new(self.error) when Qpid::Proton::Error::INPROGRESS return when Qpid::Proton::Error::INTERRUPTED raise Qpid::Proton::InterruptedError.new(self.error) when Qpid::Proton::Error::INPROGRESS raise Qpid::Proton::InProgressError.new(self.error) else raise ::ArgumentError.new("Unknown error code: #{code}") end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/util/deprecation.rb0000664000000000000000000000314213257152177021635 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton::Util # @private module Deprecation MATCH_DIR = /#{File.dirname(File.dirname(__FILE__))}/ DEPRECATE_FULL_TRACE = false def self.deprecated(old, new=nil) replace = new ? "use `#{new}`" : "internal use only" from = DEPRECATE_FULL_TRACE ? caller(2).join("\n") : caller.find { |l| not MATCH_DIR.match(l) } warn "[DEPRECATION] `#{old}` is deprecated, #{replace}. Called from #{from}" end def deprecated(*arg) Deprecation.deprecated(*arg); end module ClassMethods def deprecated_alias(bad, good) bad, good = bad.to_sym, good.to_sym define_method(bad) do |*args, &block| self.deprecated bad, good self.__send__(good, *args, &block) end end end def self.included(other) other.extend ClassMethods end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/0000775000000000000000000000000013257152177017202 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/type.rb0000664000000000000000000000473113257152177020515 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ module Qpid::Proton module Types # Represents an AMQP Type class Type private @@builtin = {} def initialize(code) @code = code; @@builtin[code] = self; end public def self.try_convert(code) code.is_a?(Type) ? code : @@builtin[code]; end def self.[](code) try_convert(code) or raise IndexError, "unknown type code #{code}"; end attr_reader :code def name() Cproton.pn_type_name(@code); end alias to_s name def <=>(x) @code <=> x; end def hash() @code.hash; end end # @!group NULL = Type.new(Cproton::PN_NULL) BOOL = Type.new(Cproton::PN_BOOL) UBYTE = Type.new(Cproton::PN_UBYTE) BYTE = Type.new(Cproton::PN_BYTE) USHORT = Type.new(Cproton::PN_USHORT) SHORT = Type.new(Cproton::PN_SHORT) UINT = Type.new(Cproton::PN_UINT) INT = Type.new(Cproton::PN_INT) CHAR = Type.new(Cproton::PN_CHAR) ULONG = Type.new(Cproton::PN_ULONG) LONG = Type.new(Cproton::PN_LONG) TIMESTAMP = Type.new(Cproton::PN_TIMESTAMP) FLOAT = Type.new(Cproton::PN_FLOAT) DOUBLE = Type.new(Cproton::PN_DOUBLE) DECIMAL32 = Type.new(Cproton::PN_DECIMAL32) DECIMAL64 = Type.new(Cproton::PN_DECIMAL64) DECIMAL128 = Type.new(Cproton::PN_DECIMAL128) UUID = Type.new(Cproton::PN_UUID) BINARY = Type.new(Cproton::PN_BINARY) STRING = Type.new(Cproton::PN_STRING) SYMBOL = Type.new(Cproton::PN_SYMBOL) DESCRIBED = Type.new(Cproton::PN_DESCRIBED) ARRAY = Type.new(Cproton::PN_ARRAY) LIST = Type.new(Cproton::PN_LIST) MAP = Type.new(Cproton::PN_MAP) #@!endgroup end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/strings.rb0000664000000000000000000000364613257152177021231 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton::Types # @private def self.is_valid_utf?(value) # In Ruby 1.9+ we have encoding methods that can check the content of # the string, so use them to see if what we have is unicode. If so, # good! If not, then just treat is as binary. # # No such thing in Ruby 1.8. So there we need to use Iconv to try and # convert it to unicode. If it works, good! But if it raises an # exception then we'll treat it as binary. if RUBY_VERSION < "1.9" return true if value.isutf8 return false else return true if (value.encoding == "UTF-8" || value.encode("UTF-8").valid_encoding?) return false end end # UTFString lets an application explicitly state that a # string of characters is to be UTF-8 encoded. # class UTFString < ::String def initialize(value) if !Qpid::Proton::Types.is_valid_utf?(value) raise RuntimeError.new("invalid UTF string") end super(value) end end # BinaryString lets an application explicitly declare that # a string value represents arbitrary data. # class BinaryString < ::String; end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/hash.rb0000664000000000000000000000232713257152177020456 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #-- # Patch the Hash class to provide methods for adding its contents # to a Qpid::Proton::Codec::Data instance. #++ # @private class Hash # :nodoc: # @deprecated def proton_data_put(data) Qpid::Proton::Util::Deprecation.deprecated(__method__, "Codec::Data#map=") data.map = self end # @deprecated def self.proton_data_get(data) Qpid::Proton::Util::Deprecation.deprecated(__method__, "Codec::Data#map") data.map end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/described.rb0000664000000000000000000000154013257152177021453 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton::Types Described = Struct.new(:descriptor, :value) end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/types/array.rb0000664000000000000000000000777113257152177020661 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #-- # Patch the Array class to provide methods for adding its contents # to a Qpid::Proton::Codec::Data instance. #++ module Qpid::Proton module Types # @deprecated use {UniformArray} class ArrayHeader def initialize(type, descriptor = nil) Util::Deprecation.deprecated ArrayHeader, "UniformArray" @type, @descriptor = Codec::Mapping[type], descriptor end attr_reader :type, :descriptor def described?() !@descriptor.nil?; end def <=>(x) [@type, @descriptor] <=> [x.type, x.descriptor]; end include Comparable end # *Unsettled API* - An array that is converted to/from an AMQP array of uniform element type. # A plain ruby +::Array+ is converted to/from an AMQP list, which can contain mixed type elements. # If invalid elements are included, then {TypeError} will be raised when encoding to AMQP. class UniformArray < ::Array # Construct a uniform array, which will be converted to an AMQP array. # A plain ruby +::Array+ is converted to/from an AMQP list, containing mixed type elements. # # @param type [Type] Elements must be convertible to this AMQP type. # @param elements [Enumerator] Initial elements for the array # @param descriptor [Object] Optional array descriptor def initialize(type, elements=nil, descriptor=nil) @type, @descriptor = type, descriptor @proton_array_header = nil raise ArgumentError, "no type specified for array" if @type.nil? super elements if elements end # @deprecated backwards compatibility {UniformArray} def proton_array_header @proton_array_header ||= ArrayHeader.new(@type, @descriptor) # Deprecated end # @return [Type] Array elements must be convertible to this AMQP type attr_reader :type # @return [Object] Optional descriptor. attr_reader :descriptor def inspect() "#{self.class.name}<#{type}>#{super}"; end def <=>(x) ret = [@type, @descriptor] <=> [x.type, x.descriptor] ret == 0 ? super : ret end end end end # {Array} is converted to/from an AMQP list, which is allowed to hold mixed-type elements. # Use {UniformArray} to convert/from an AMQP array with uniform element type. class ::Array # @deprecated use {UniformArray} def proton_array_header Qpid::Proton::Util::Deprecation.deprecated __method__, UniformArray @proton_array_header end # @deprecated use {UniformArray} def proton_array_header=(h) Qpid::Proton::Util::Deprecation.deprecated __method__, UniformArray @proton_array_header= h end # @deprecated use {UniformArray} def proton_described?() Qpid::Proton::Util::Deprecation.deprecated __method__, UniformArray @proton_array_header && @proton_array_header.described? end # @deprecated def proton_put(data) Qpid::Proton::Util::Deprecation.deprecated __method__, "Codec::Data#array=, Codec::Data#list=" raise TypeError, "nil data" unless data if @proton_array_header && @proton_array_header.type data.array = self else data.list = self end end # @deprecated def self.proton_get(data) Qpid::Proton::Util::Deprecation.deprecated __method__, "Codec::Data#list" data.list end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/reactor/0000775000000000000000000000000013257152177017475 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/reactor/container.rb0000664000000000000000000000457513257152177022017 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton module Reactor # @deprecated use {Qpid::Proton::Container} class Container < Qpid::Proton::Container include Util::Deprecation private alias super_connect connect # Access to superclass method public # @deprecated use {Qpid::Proton::Container} def initialize(handlers, opts=nil) deprecated Qpid::Proton::Reactor::Container, Qpid::Proton::Container h = handlers || (opts && opts[:global_handler]) || Handler::ReactorMessagingAdapter.new(nil) id = opts && opts[:container_id] super(h, id) end alias container_id id alias global_handler handler def connect(opts=nil) url = opts && (opts[:url] || opts[:address]) raise ::ArgumentError.new, "no :url or :address option provided" unless url super(url, opts) end def create_sender(context, opts=nil) c = context if context.is_a? Qpid::Proton::Connection unless c url = Qpid::Proton::uri context c = super_connect(url, opts) opts ||= {} opts[:target] ||= url.amqp_address end c.open_sender opts end def create_receiver(context, opts=nil) c = context if context.is_a? Qpid::Proton::Connection unless c url = Qpid::Proton::uri context c = super_connect(url, opts) opts ||= {} opts[:source] ||= url.amqp_address end c.open_receiver opts end def listen(url, ssl_domain = nil) # TODO aconway 2017-11-29: ssl_domain super(url) end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/qpid_proton.rb0000664000000000000000000000505413257152177020725 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require "cproton" require "date" require "weakref" begin require "securerandom" rescue LoadError require "kconv" # Ruby < 1.9 end # @api qpid # Qpid is the top level module for the Qpid project http://qpid.apache.org # Definitions for this library are in module {Qpid::Proton} module Qpid # Proton is a ruby API for sending and receiving AMQP messages in clients or servers. # See the {overview}[../file.README.html] for more. module Proton # Only opened here for module doc comment end end # Exception classes require "core/exceptions" # Utility classes require "util/deprecation" require "util/version" require "util/error_handler" require "util/schedule" require "util/wrapper" # Types require "types/type" require "types/strings" require "types/hash" require "types/array" require "types/described" # Codec classes require "codec/mapping" require "codec/data" # Main Proton classes require "core/condition" require "core/event" require "core/uri" require "core/message" require "core/endpoint" require "core/session" require "core/terminus" require "core/disposition" require "core/transfer" require "core/delivery" require "core/tracker" require "core/link" require "core/sender" require "core/receiver" require "core/connection" require "core/sasl" require "core/ssl_domain" require "core/ssl_details" require "core/ssl" require "core/transport" require "core/url" require "core/connection_driver" # Handlers and adapters require "handler/adapter" require "handler/messaging_adapter" require "core/messaging_handler" # Main container class require "core/container" # DEPRECATED Backwards compatibility shims for Reactor API require "handler/reactor_messaging_adapter" require "handler/messaging_handler" # Keep original name for compatibility require "reactor/container" qpid-proton-0.22.0/proton-c/bindings/ruby/lib/handler/0000775000000000000000000000000013257152177017453 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/handler/reactor_messaging_adapter.rb0000664000000000000000000001344613257152177025204 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # @private module Qpid::Proton module Handler # Adapter to convert raw proton events for the old {Handler::MessagingHandler} # used by the Reactor. class ReactorMessagingAdapter < Adapter def initialize handler super @opts = (handler.options if handler.respond_to?(:options)) || {} @opts[:prefetch] ||= 10 @opts[:peer_close_is_error] = false unless @opts.include? :peer_close_is_error [:auto_accept, :auto_settle, :auto_open, :auto_close].each do |k| @opts[k] = true unless @opts.include? k end end alias dispatch forward def delegate(method, event) event.method = method # Update the event with the new method event.dispatch(@handler) or dispatch(:on_unhandled, event) end def delegate_error(method, event) event.method = method unless event.dispatch(@handler) || dispatch(:on_error, event) dispatch(:on_unhandled, event) event.connection.close(event.context.condition) if @opts[:auto_close] end end def on_container_start(container) delegate(:on_start, Event.new(nil, nil, container)); end def on_container_stop(container) delegate(:on_stop, Event.new(nil, nil, container)); end # Define repetative on_xxx_open/close methods for each endpoint type def self.open_close(endpoint) on_opening = :"on_#{endpoint}_opening" on_opened = :"on_#{endpoint}_opened" on_closing = :"on_#{endpoint}_closing" on_closed = :"on_#{endpoint}_closed" on_error = :"on_#{endpoint}_error" Module.new do define_method(:"on_#{endpoint}_local_open") do |event| delegate(on_opened, event) if event.context.remote_open? end define_method(:"on_#{endpoint}_remote_open") do |event| if event.context.local_open? delegate(on_opened, event) elsif event.context.local_uninit? delegate(on_opening, event) event.context.open if @opts[:auto_open] end end define_method(:"on_#{endpoint}_local_close") do |event| delegate(on_closed, event) if event.context.remote_closed? end define_method(:"on_#{endpoint}_remote_close") do |event| if event.context.remote_condition delegate_error(on_error, event) elsif event.context.local_closed? delegate(on_closed, event) elsif @opts[:peer_close_is_error] Condition.assign(event.context.__send__(:_remote_condition), "unexpected peer close") delegate_error(on_error, event) else delegate(on_closing, event) end event.context.close if @opts[:auto_close] end end end # Generate and include open_close modules for each endpoint type [:connection, :session, :link].each { |endpoint| include open_close(endpoint) } def on_transport_error(event) delegate_error(:on_transport_error, event); end def on_transport_closed(event) delegate(:on_transport_closed, event); end # Add flow control for link opening events def on_link_local_open(event) super; add_credit(event); end def on_link_remote_open(event) super; add_credit(event); end def on_delivery(event) if event.link.receiver? # Incoming message d = event.delivery if d.aborted? delegate(:on_aborted, event) d.settle elsif d.complete? if d.link.local_closed? && @opts[:auto_accept] d.release else begin delegate(:on_message, event) d.accept if @opts[:auto_accept] && !d.settled? rescue Qpid::Proton::Reject d.reject rescue Qpid::Proton::Release d.release(true) end end end delegate(:on_settled, event) if d.settled? add_credit(event) else # Outgoing message t = event.tracker if t.updated? case t.state when Qpid::Proton::Delivery::ACCEPTED then delegate(:on_accepted, event) when Qpid::Proton::Delivery::REJECTED then delegate(:on_rejected, event) when Qpid::Proton::Delivery::RELEASED then delegate(:on_released, event) when Qpid::Proton::Delivery::MODIFIED then delegate(:on_modified, event) end delegate(:on_settled, event) if t.settled? t.settle if @opts[:auto_settle] end end end def on_link_flow(event) add_credit(event) l = event.link delegate(:on_sendable, event) if l.sender? && l.open? && l.credit > 0 end def add_credit(event) r = event.receiver prefetch = @opts[:prefetch] if r && r.open? && (r.drained == 0) && prefetch && (prefetch > r.credit) r.flow(prefetch - r.credit) end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/handler/messaging_handler.rb0000664000000000000000000001537613257152177023466 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton module Handler # @deprecated use {Qpid::Proton::MessagingHandler} class MessagingHandler include Util::Deprecation # @private def proton_adapter_class() Handler::ReactorMessagingAdapter; end # @overload initialize(opts) # Create a {MessagingHandler} with options +opts+ # @option opts [Integer] :prefetch (10) # The number of messages to fetch in advance, 0 disables prefetch. # @option opts [Boolean] :auto_accept (true) # If true, incoming messages are accepted automatically after {#on_message}. # If false, the application can accept, reject or release the message # by calling methods on {Delivery} when the message has been processed. # @option opts [Boolean] :auto_settle (true) If true, outgoing # messages are settled automatically when the remote peer settles. If false, # the application must call {Delivery#settle} explicitly. # @option opts [Boolean] :auto_open (true) # If true, incoming connections are opened automatically. # If false, the application must call {Connection#open} to open incoming connections. # @option opts [Boolean] :auto_close (true) # If true, respond to a remote close automatically with a local close. # If false, the application must call {Connection#close} to finish closing connections. # @option opts [Boolean] :peer_close_is_error (false) # If true, and the remote peer closes the connection without an error condition, # the set the local error condition {Condition}("error", "unexpected peer close") # # @overload initialize(prefetch=10, auto_accept=true, auto_settle=true, peer_close_is_error=false) # @deprecated use +initialize(opts)+ overload def initialize(*args) deprecated MessagingHandler, Qpid::Proton::MessagingHandler @options = {} if args.size == 1 && args[0].is_a?(Hash) @options.replace(args[0]) else # Fill options from deprecated fixed arguments [:prefetch, :auto_accept, :auto_settle, :peer_close_is_error].each do |k| opts[k] = args.shift unless args.empty? end end # NOTE: the options are processed by {Handler::Adapater} end public # @return [Hash] handler options, see {#initialize} attr_reader :options # @!method on_transport_error(event) # Called when the transport fails or closes unexpectedly. # @param event [Event] The event. # !@method on_connection_error(event) # Called when the peer closes the connection with an error condition. # @param event [Event] The event. # @!method on_session_error(event) # Called when the peer closes the session with an error condition. # @param event [Qpid:Proton::Event] The event. # @!method on_link_error(event) # Called when the peer closes the link with an error condition. # @param event [Event] The event. # @!method on_start(event) # Called when the event loop starts. # @param event [Event] The event. # @!method on_connection_closed(event) # Called when the connection is closed. # @param event [Event] The event. # @!method on_session_closed(event) # Called when the session is closed. # @param event [Event] The event. # @!method on_link_closed(event) # Called when the link is closed. # @param event [Event] The event. # @!method on_connection_closing(event) # Called when the peer initiates the closing of the connection. # @param event [Event] The event. # @!method on_session_closing(event) # Called when the peer initiates the closing of the session. # @param event [Event] The event. # @!method on_link_closing(event) # Called when the peer initiates the closing of the link. # @param event [Event] The event. # @!method on_disconnected(event) # Called when the socket is disconnected. # @param event [Event] The event. # @!method on_sendable(event) # Called when the sender link has credit and messages can therefore # be transferred. # @param event [Event] The event. # @!method on_accepted(event) # Called when the remote peer accepts an outgoing message. # @param event [Event] The event. # @!method on_rejected(event) # Called when the remote peer rejects an outgoing message. # @param event [Event] The event. # @!method on_released(event) # Called when the remote peer releases an outgoing message for re-delivery as-is. # @param event [Event] The event. # @!method on_modified(event) # Called when the remote peer releases an outgoing message for re-delivery with modifications. # @param event [Event] The event. # @!method on_settled(event) # Called when the remote peer has settled hte outgoing message. # This is the point at which it should never be retransmitted. # @param event [Event] The event. # @!method on_message(event) # Called when a message is received. # # The message is available from {Event#message}, to accept or reject the message # use {Event#delivery} # @param event [Event] The event. # @!method on_aborted(event) # Called when message delivery is aborted by the sender. # The {Event#delivery} provides information about the delivery, but the message should be ignored. # @!method on_error(event) # If +on_xxx_error+ method is missing, {#on_error} is called instead. # If {#on_error} is missing, the connection is closed with the error. # @param event [Event] the event, {Event#method} provides the original method name. # @!method on_unhandled(event) # If an +on_xxx+ method is missing, {#on_unhandled} is called instead. # @param event [Event] the event, {Event#method} provides the original method name. end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/handler/messaging_adapter.rb0000664000000000000000000001233413257152177023460 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # @private module Qpid::Proton module Handler # Adapt raw proton events to {MessagingHandler} events. class MessagingAdapter < Adapter def delegate(method, *args) forward(method, *args) or forward(:on_unhandled, method, *args) end def delegate_error(method, context) unless forward(method, context) || forward(:on_error, context.condition) forward(:on_unhandled, method, context) # Close the whole connection on an un-handled error context.connection.close(context.condition) end end def on_container_start(container) delegate(:on_container_start, container); end def on_container_stop(container) delegate(:on_container_stop, container); end # Define repetative on_xxx_open/close methods for session and connection def self.open_close(endpoint) Module.new do define_method(:"on_#{endpoint}_remote_open") do |event| begin delegate(:"on_#{endpoint}_open", event.context) event.context.open if event.context.local_uninit? rescue StopAutoResponse end end define_method(:"on_#{endpoint}_remote_close") do |event| delegate_error(:"on_#{endpoint}_error", event.context) if event.context.condition begin delegate(:"on_#{endpoint}_close", event.context) event.context.close if event.context.local_active? rescue StopAutoResponse end end end end # Generate and include open_close modules for each endpoint type # Using modules so we can override to extend the behavior later in the handler. [:connection, :session].each { |endpoint| include open_close(endpoint) } # Link open/close is handled separately because links are split into # sender and receiver on the messaging API def on_link_remote_open(event) delegate(event.link.sender? ? :on_sender_open : :on_receiver_open, event.link) event.link.open if event.link.local_uninit? add_credit(event) rescue StopAutoResponse end def on_link_remote_close(event) s = event.link.sender? delegate_error(s ? :on_sender_error : :on_receiver_error, event.link) if event.link.condition delegate(s ? :on_sender_close : :on_receiver_close, event.link) event.link.close if event.link.local_active? rescue StopAutoResponse end def on_transport_error(event) delegate_error(:on_transport_error, event.context) end def on_transport_closed(event) delegate(:on_transport_close, event.context) rescue StopAutoResponse end # Add flow control for local link open def on_link_local_open(event) add_credit(event); end def on_delivery(event) if event.link.receiver? # Incoming message d = event.delivery if d.aborted? delegate(:on_delivery_abort, d) elsif d.complete? if d.link.local_closed? && d.receiver.auto_accept d.release # Auto release after close else begin delegate(:on_message, d, d.message) d.accept if d.receiver.auto_accept && !d.settled? rescue Reject d.reject unless d.settled? rescue Release d.release unless d.settled? end end end delegate(:on_delivery_settle, d) if d.settled? add_credit(event) else # Outgoing message t = event.tracker case t.state when Delivery::ACCEPTED then delegate(:on_tracker_accept, t) when Delivery::REJECTED then delegate(:on_tracker_reject, t) when Delivery::RELEASED then delegate(:on_tracker_release, t) when Delivery::MODIFIED then delegate(:on_tracker_modify, t) end delegate(:on_tracker_settle, t) if t.settled? t.settle if t.sender.auto_settle end end def on_link_flow(event) add_credit(event) sender = event.sender delegate(:on_sendable, sender) if sender && sender.open? && sender.credit > 0 end def add_credit(event) return unless (r = event.receiver) if r.open? && (r.drained == 0) && r.credit_window && (r.credit_window > r.credit) r.flow(r.credit_window - r.credit) end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/handler/adapter.rb0000664000000000000000000000527613257152177021432 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # @private module Qpid::Proton module Handler def self.handler_method?(method) /^on_/ =~ name; end # Handler for an array of handlers of uniform type, with non-conflicting options class ArrayHandler def initialize(handlers) raise "empty handler array" if handlers.empty? adapters = (handlers.map { |h| Adapter.adapter(h) }).uniq raise "handler array not uniform, adapters requested: #{adapters}" if adapters.size > 1 @proton_adapter_class = adapters[0] @methods = Set.new handlers.each do |h| @methods.merge(h.methods.select { |m| handler_method? m }) # Collect handler methods end end attr_reader :options, :proton_adapter_class def method_missing(name, *args) if respond_to_missing?(name) @adapters.each { |a| a.__send__(name, *args) if a.respond_to? name} else super end end def respond_to_missing?(name, private=false); @methods.include?(name); end def respond_to?(name, all=false) super || respond_to_missing?(name); end # For ruby < 1.9.2 end # Base adapter for raw proton events class Adapter def initialize(h) @handler = h; end # Create and return an adapter for handler, or return h if it does not need adapting. def self.adapt(handler) return unless handler a = Array(handler) h = (a.size == 1) ? a[0] : ArrayHandler.new(a) ac = adapter(h) ac ? ac.new(h) : h end # Adapter class if requested by handler, else default to MessagingHandler def self.adapter(handler) handler.respond_to?(:proton_adapter_class) ? handler.proton_adapter_class : MessagingAdapter end def proton_adapter_class() nil; end # Adapters don't need adapting def forward(method, *args) (@handler.__send__(method, *args); true) if @handler.respond_to? method end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/0000775000000000000000000000000013257152177016766 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/work_queue.rb0000664000000000000000000000565713257152177021516 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # A thread-safe queue of work for multi-threaded programs. # # Instances of {Connection} and objects associated with it ({Session}, {Sender}, # {Receiver}, {Delivery}, {Tracker}) are not thread-safe and must be # used correctly when multiple threads call {Container#run} # # Calls to {MessagingHandler} methods by the {Container} are automatically # serialized for each connection instance. Other threads may have code # similarly serialized by adding it to the {Connection#work_queue} for the # connection. Each object related to a {Connection} also provides a # +work_queue+ method. # class WorkQueue # Add code to be executed in series with other {Container} operations on the # work queue's owner. The code will be executed as soon as possible. # # @note Thread Safe: may be called in any thread. # @param non_block [Boolean] if true raise {ThreadError} if the operation would block. # @yield [ ] the block will be invoked with no parameters in the {WorkQueue} context, # which may be a different thread. # @return [void] # @raise [ThreadError] if +non_block+ is true and the operation would block # @raise [EOFError] if the queue is closed and cannot accept more work def add(non_block=false, &block) @schedule.add(Time.at(0), non_block, &block) @container.send :wake end # Schedule code to be executed after +delay+ seconds in series with other # {Container} operations on the work queue's owner. # # Work scheduled for after the {WorkQueue} has closed will be silently dropped. # # @note (see #add) # @param delay delay in seconds until the block is added to the queue. # @param (see #add) # @yield (see #add) # @return [void] # @raise (see #add) def schedule(delay, non_block=false, &block) @schedule.add(Time.now + delay, non_block, &block) @container.send :wake end private def initialize(container) @schedule = Schedule.new @container = container end def close() @schedule.close; end def process(now) @schedule.process(now); end def next_tick() @schedule.next_tick; end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/url.rb0000664000000000000000000000445313257152177020123 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @deprecated use {URI} or {String} class URL include Util::Deprecation attr_reader :scheme attr_reader :username alias user username attr_reader :password attr_reader :host attr_reader :path # Parse a string, return a new URL # @param url [#to_s] the URL string def initialize(url = nil) deprecated self.class, 'URI or String' if url @url = Cproton.pn_url_parse(url.to_s) if @url.nil? raise ::ArgumentError.new("invalid url: #{url}") end else @url = Cproton.pn_url end @scheme = Cproton.pn_url_get_scheme(@url) @username = Cproton.pn_url_get_username(@url) @password = Cproton.pn_url_get_password(@url) @host = Cproton.pn_url_get_host(@url) @port = Cproton.pn_url_get_port(@url) @path = Cproton.pn_url_get_path(@url) defaults end def port=(port) if port.nil? Cproton.pn_url_set_port(@url, nil) else Cproton.pn_url_set_port(@url, port) end end def port Cproton.pn_url_get_port(@url).to_i end # @return [String] Convert to string def to_s "#{@scheme}://#{@username.nil? ? '' : @username}#{@password.nil? ? '' : '@' + @password + ':'}#{@host}:#{@port}/#{@path}" end # @return [String] Allow implicit conversion by {String#try_convert} alias to_str to_s private def defaults @scheme = @scheme || "amqp" @host = @host || "0.0.0.0" @port = @port || 5672 end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/uri.rb0000664000000000000000000000565713257152177020127 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'uri' # Extend the standard ruby {URI} with AMQP and AMQPS schemes module URI # AMQP URI scheme for the AMQP protocol class AMQP < Generic DEFAULT_PORT = 5672 # @return [String] The AMQP address is the {#path} stripped of any leading "/" def amqp_address() path[0] == "/" ? path[1..-1] : path; end end @@schemes['AMQP'] = AMQP # AMQPS URI scheme for the AMQP protocol over TLS class AMQPS < AMQP DEFAULT_PORT = 5671 end @@schemes['AMQPS'] = AMQPS end module Qpid::Proton private # Make sure to allow empty hostnames, Ruby 2.0.0 does not. DEFAULT_URI_PARSER = URI::Parser.new(:HOSTNAME => /(?:#{URI::PATTERN::HOSTNAME})|/) public # Convert +s+ to an amqp: or amqps: URI # # This does not give the same result as the standard URI parser in all cases. # Short-cut strings like "host:port" are allowed, an "amqp://" prefix is added if +s+ does # not already look like an 'amqp:' or 'amqps:' URI. # # @param s [String,URI] String to convert to a URI, or a URI object. # @return [URI] A valid AMQP or AMQPS URI # @raise [URI::BadURIError] s is a URI object with a non-AMQP scheme # @raise [URI::InvalidURIError] s cannot be parsed as a URI or shortcut # @raise [::ArgumentError] s is not a string or URI # def self.uri(s) case s when URI::AMQP then s # This is already an AMQP or AMQPS URL. when URI::Generic # Re-parse a generic URI that was not parsed as AMQP/AMQPS class s.scheme ||= 'amqp' # Default to amqp: scheme u = DEFAULT_URI_PARSER.parse(s.to_s) raise URI::BadURIError, "Not an AMQP URI: '#{u}'" unless u.is_a? URI::AMQP u else s = String.try_convert s raise ::ArgumentError, "bad argument (expected URI object or URI string)" unless s case s when %r{^amqps?:} then DEFAULT_URI_PARSER.parse(s) # Looks like an AMQP URI when %r{^//} then DEFAULT_URI_PARSER.parse("amqp:#{s}") # Looks like an authority with no scheme else DEFAULT_URI_PARSER.parse("amqp://#{s}") # Treat as a bare host:port/path string end end rescue =>e raise e.class, "#{self}.#{__method__}(#{s.inspect}): #{e}" end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/transport.rb0000664000000000000000000002723513257152177021360 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @deprecated all important features are available from {#Connection} class Transport include Util::Deprecation # @private PROTON_METHOD_PREFIX = "pn_transport" # @private include Util::Wrapper # Turn logging off entirely. TRACE_OFF = Cproton::PN_TRACE_OFF # Log raw binary data into/out of the transport. TRACE_RAW = Cproton::PN_TRACE_RAW # Log frames into/out of the transport. TRACE_FRM = Cproton::PN_TRACE_FRM # Log driver related events; i.e., initialization, end of stream, etc. TRACE_DRV = Cproton::PN_TRACE_DRV proton_get :user # @!attribute channel_max # # @return [Integer] The maximum allowed channel. # proton_set_get :channel_max # @!attribute [r] remote_channel_max # # @return [Integer] The maximum allowed channel of a transport's remote peer. # proton_caller :remote_channel_max # @!attribute max_frame_size # # @return [Integer] The maximum frame size. proton_set_get :max_frame proton_get :remote_max_frame # @!attribute [r] remote_max_frame_size # # @return [Integer] The maximum frame size of the transport's remote peer. # proton_get :remote_max_frame_size # @!attribute idle_timeout # # @deprecated use {Connection#open} with the +:idle_timeout+ option to set # the timeout, and {Connection#idle_timeout} to query the remote timeout. # # The Connection timeout values are in *seconds* and are automatically # converted. # # @return [Integer] The idle timeout in *milliseconds*. # proton_set_get :idle_timeout # @!attribute [r] remote_idle_timeout in milliseconds # # @deprecated Use {Connection#idle_timeout} to query the remote timeout. # # @return [Integer] The idle timeout for the transport's remote peer. # proton_set_get :remote_idle_timeout # @!attribute [r] capacity # # If the engine is in an exception state such as encountering an error # condition or reaching the end of stream state, a negative value will # be returned indicating the condition. # # If an error is indicated, further deteails can be obtained from # #error. # # Calls to #process may alter the value of this value. See #process for # more details # # @return [Integer] The amount of free space for input following the # transport's tail pointer. # proton_caller :capacity # @!attribute [r] head # # This referneces queued output data. It reports the bytes of output data. # # Calls to #pop may alter this attribute, and any data it references. # # @return [String] The transport's head pointer. # proton_caller :head # @!attribute [r] tail # # The amount of free space following this data is reported by #capacity. # # Calls to #process may alter the value of this attribute. # # @return [String] The transport's tail pointer. # proton_caller :tail # @!attribute [r] pending # # If the ending is in an exceptional state, such as encountering an error # condition or reachign the end of the stream state, a negative value will # be returned indicating the condition. # # If an error is indicated, further details can be obtained from #error. # # Calls to #pop may alter the value of this pointer as well. # # @return [Integer] The number of pending output bytes following the header # pointer. # # @raise [TransportError] If any error other than an end of stream occurs. # proton_caller :pending # @!attribute [r] closed? # # A transport is defined to be closed when both the tail and the head are # closed. In other words, when both #capacity < 0 and #pending < 0. # # @return [Boolean] Returns true if the tranpsort is closed. # proton_caller :closed? # @!attribute [r] frames_output # # @return [Integer] The number of frames output by a transport. # proton_get :frames_output # @!attribute [r] frames_input # # @return [Integer] The number of frames input by a transport. # proton_get :frames_input # @private include Util::ErrorHandler # @private def self.wrap(impl) return nil if impl.nil? self.fetch_instance(impl, :pn_transport_attachments) || Transport.new(impl) end # Creates a new transport instance. def initialize(impl = Cproton.pn_transport) @impl = impl @ssl = nil self.class.store_instance(self, :pn_transport_attachments) end # Set server mode for this tranport - enables protocol detection # and server-side authentication for incoming connections def set_server() Cproton.pn_transport_set_server(@impl); end # Returns whether the transport has any buffered data. # # @return [Boolean] True if the transport has no buffered data. # def quiesced? Cproton.pn_transport_quiesced(@impl) end # @return [Condition, nil] transport error condition or nil if there is no error. def condition Condition.convert(Cproton.pn_transport_condition(@impl)) end # Set the error condition for the transport. # @param c [Condition] The condition to set def condition=(c) Condition.assign(Cproton.pn_transport_condition(@impl), c) end # Binds to the given connection. # # @param connection [Connection] The connection. # def bind(connection) Cproton.pn_transport_bind(@impl, connection.impl) end # Unbinds from the previous connection. # def unbind Cproton.pn_transport_unbind(@impl) end # Updates the transports trace flags. # # @param level [Integer] The trace level. # # @see TRACE_OFF # @see TRACE_RAW # @see TRACE_FRM # @see TRACE_DRV # def trace(level) Cproton.pn_transport_trace(@impl, level) end # Return the AMQP connection associated with the transport. # # @return [Connection, nil] The bound connection, or nil. # def connection Connection.wrap(Cproton.pn_transport_connection(@impl)) end # Log a message to the transport's logging mechanism. # # This can be using in a debugging scenario as the message will be # prepended with the transport's identifier. # # @param message [String] The message to be logged. # def log(message) Cproton.pn_transport_log(@impl, message) end # Pushes the supplied bytes into the tail of the transport. # # @param data [String] The bytes to be pushed. # # @return [Integer] The number of bytes pushed. # def push(data) Cproton.pn_transport_push(@impl, data, data.length) end # Process input data following the tail pointer. # # Calling this function will cause the transport to consume the specified # number of bytes of input occupying the free space following the tail # pointer. It may also change the value for #tail, as well as the amount of # free space reported by #capacity. # # @param size [Integer] The number of bytes to process. # # @raise [TransportError] If an error occurs. # def process(size) Cproton.pn_transport_process(@impl, size) end # Indicate that the input has reached EOS (end of stream). # # This tells the transport that no more input will be forthcoming. # # @raise [TransportError] If an error occurs. # def close_tail Cproton.pn_transport_close_tail(@impl) end # Returns the specified number of bytes from the transport's buffers. # # @param size [Integer] The number of bytes to return. # # @return [String] The data peeked. # # @raise [TransportError] If an error occurs. # def peek(size) cd, out = Cproton.pn_transport_peek(@impl, size) return nil if cd == Qpid::Proton::Error::EOS raise TransportError.new if cd < -1 out end # Removes the specified number of bytes from the pending output queue # following the transport's head pointer. # # @param size [Integer] The number of bytes to remove. # def pop(size) Cproton.pn_transport_pop(@impl, size) end # Indicate that the output has closed. # # Tells the transport that no more output will be popped. # # @raise [TransportError] If an error occurs. # def close_head Cproton.pn_transport_close_head(@impl) end # Process any pending transport timer events. # # This method should be called after all pending input has been # processed by the transport (see #input), and before generating # output (see #output). # # It returns the deadline for the next pending timer event, if any # art present. # # @param now [Time] The timestamp. # # @return [Integer] If non-zero, the expiration time of the next pending # timer event for the transport. The caller must invoke #tick again at # least once at or before this deadline occurs. # def tick(now) Cproton.pn_transport_tick(@impl, now) end # Create, or return existing, SSL object for the transport. # @return [SASL] the SASL object def sasl SASL.new(self) end # Creates, or returns an existing, SSL object for the transport. # # @param domain [SSLDomain] The SSL domain. # @param session_details [SSLDetails] The SSL session details. # # @return [SSL] The SSL object. # def ssl(domain = nil, session_details = nil) @ssl ||= SSL.create(self, domain, session_details) end # @private def ssl? !@ssl.nil? end # @private # Options are documented {Connection#open}, keep that consistent with this def apply opts sasl if opts[:sasl_enabled] # Explicitly enabled unless opts.include?(:sasl_enabled) && !opts[:sasl_enabled] # Not explicitly disabled sasl.allowed_mechs = opts[:sasl_allowed_mechs] if opts.include? :sasl_allowed_mechs sasl.allow_insecure_mechs = opts[:sasl_allow_insecure_mechs] if opts.include? :sasl_allow_insecure_mechs end self.channel_max= opts[:max_sessions] if opts.include? :max_sessions self.max_frame = opts[:max_frame_size] if opts.include? :max_frame_size # NOTE: The idle_timeout option is in Numeric *seconds*, can be Integer, Float or Rational. # This is consistent with idiomatic ruby. # The transport #idle_timeout property is in *milliseconds* passed direct to C. # Direct use of the transport is deprecated. self.idle_timeout= (opts[:idle_timeout]*1000).round if opts.include? :idle_timeout self.ssl(opts[:ssl_domain]) if opts[:ssl_domain] end can_raise_error :process, :error_class => TransportError can_raise_error :close_tail, :error_class => TransportError can_raise_error :pending, :error_class => TransportError, :below => Error::EOS can_raise_error :close_head, :error_class => TransportError end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/transfer.rb0000664000000000000000000001020313257152177021133 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Status of a message transfer on a {Link} # Common base class for {Tracker} and {Delivery}. class Transfer include Util::Deprecation # @!private PROTON_METHOD_PREFIX = "pn_delivery" # @!private include Util::Wrapper def self.wrap(impl) return unless impl self.fetch_instance(impl, :pn_delivery_attachments) || (Cproton.pn_link_is_sender(Cproton.pn_delivery_link(impl)) ? Tracker : Delivery).new(impl) end def initialize(impl) @impl = impl @inspect = nil self.class.store_instance(self, :pn_delivery_attachments) end public # AMQP Delivery States describing the outcome of a message transfer module State # Message was successfully processed by the receiver ACCEPTED = Cproton::PN_ACCEPTED # Message rejected as invalid and unprocessable by the receiver. REJECTED = Cproton::PN_REJECTED # Message was not (and will not be) processed by the receiver, but may be # acceptable if re-delivered to another receiver RELEASED = Cproton::PN_RELEASED # Like {RELEASED}, but there are modifications (see {Tracker#modifications}) # that must be applied to the message by the {Sender} before re-delivering it. MODIFIED = Cproton::PN_MODIFIED # Partial message data received. Only used during link recovery. RECEIVED = Cproton::PN_RECEIVED end include State # @return [String] Unique ID for the transfer in the context of the {#link} def id() Cproton.pn_delivery_tag(@impl); end # @deprecated use {#id} deprecated_alias :tag, :id # @return [Boolean] True if the transfer has is remotely settled. proton_caller :settled? # @return [Integer] Remote state of the transfer, one of the values in {State} def state() Cproton.pn_delivery_remote_state(@impl); end # @return [Link] The parent link. def link() Link.wrap(Cproton.pn_delivery_link(@impl)); end # @return [Session] The parent session. def session() link.session; end # @return [Connection] The parent connection. def connection() self.session.connection; end # @return [Transport] The parent connection's transport. def transport() self.connection.transport; end # @return [WorkQueue] The parent connection's work-queue. def work_queue() self.connection.work_queue; end # @deprecated internal use only proton_caller :writable? # @deprecated internal use only proton_caller :readable? # @deprecated internal use only proton_caller :updated? # @deprecated internal use only proton_caller :clear # @deprecated internal use only proton_caller :pending # @deprecated internal use only proton_caller :partial? # @deprecated internal use only def update(state) Cproton.pn_delivery_update(@impl, state); end # @deprecated internal use only proton_caller :buffered? # @deprecated internal use only def local_state() Cproton.pn_delivery_local_state(@impl); end # @deprecated use {#state} deprecated_alias :remote_state, :state # @deprecated internal use only def settle(state = nil) update(state) unless state.nil? Cproton.pn_delivery_settle(@impl) @inspect = inspect # Save the inspect string, the delivery pointer will go bad. end def inspect() @inspect || super; end def to_s() inspect; end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/tracker.rb0000664000000000000000000000323413257152177020750 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Track the {Transfer::State} of a sent message. class Tracker < Transfer # @return [Sender] The parent {Sender} link. def sender() link; end # Re-delivery modifications sent by the receiver in {Delivery#release} # @return [Hash] See the {Delivery#release} +opts+ parameter. # @return [nil] If no modifications were requested by the receiver. def modifications() return nil if (state != MODIFIED) d = Cproton.pn_delivery_remote(@impl) { :failed => Cproton.pn_disposition_is_failed(d), :undeliverable => Cproton.pn_disposition_is_undeliverable(d), :annotations => Codec::Data.to_object(Cproton.pn_disposition_annotations(d)) } end # Abort a partially-sent message. # The tracker can no longer be used after calling {#abort}. def abort() Cproton.pn_delivery_abort(@impl) end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/terminus.rb0000664000000000000000000002056613257152177021172 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Represents an endpoint for an AMQP connection.. # # An AMQP terminus acts as either a source or a target for messages, # but never as both. Every Link is associated iwth both a source and # a target Terminus that is negotiated during link establishment. # # A terminus is composed of an AMQP address along with a number of # other properties defining the quality of service and behavior of # the Link. # class Terminus include Util::Deprecation # Indicates a non-existent source or target terminus. UNSPECIFIED = Cproton::PN_UNSPECIFIED # Indicates a source for messages. SOURCE = Cproton::PN_SOURCE # Indicates a target for messages. TARGET = Cproton::PN_TARGET # A special target identifying a transaction coordinator. COORDINATOR = Cproton::PN_COORDINATOR # The terminus is orphaned when the parent link is closed. EXPIRE_WITH_LINK = Cproton::PN_EXPIRE_WITH_LINK # The terminus is orphaned whent he parent sessio is closed. EXPIRE_WITH_SESSION = Cproton::PN_EXPIRE_WITH_SESSION # The terminus is orphaned when the parent connection is closed. EXPIRE_WITH_CONNECTION = Cproton::PN_EXPIRE_WITH_CONNECTION # The terminus is never considered orphaned. EXPIRE_NEVER = Cproton::PN_EXPIRE_NEVER # Indicates a non-durable Terminus. NONDURABLE = Cproton::PN_NONDURABLE # Indicates a Terminus with durably held configuration, but # not the delivery state. CONFIGURATION = Cproton::PN_CONFIGURATION # Indicates a Terminus with both durably held configuration and # durably held delivery states. DELIVERIES = Cproton::PN_DELIVERIES # The behavior is defined by the nod.e DIST_MODE_UNSPECIFIED = Cproton::PN_DIST_MODE_UNSPECIFIED # The receiver gets all messages. DIST_MODE_COPY = Cproton::PN_DIST_MODE_COPY # The receives compete for messages. DIST_MODE_MOVE = Cproton::PN_DIST_MODE_MOVE # @private PROTON_METHOD_PREFIX = "pn_terminus" # @private extend Util::SWIGClassHelper # @!attribute type # # @return [Integer] The terminus type. # # @see SOURCE # @see TARGET # @see COORDINATOR # proton_set_get :type # @!attribute address # # @return [String] The terminus address. # proton_set_get :address # @!attribute durability_mode # # @return [Integer] The durability mode of the terminus. # # @see NONDURABLE # @see CONFIGURATION # @see DELIVERIES # proton_forward :durability_mode, :get_durability proton_forward :durability_mode=, :set_durability deprecated_alias :durability, :durability_mode deprecated_alias :durability=, :durability_mode= # @!attribute expiry_policy # # @return [Integer] The expiry policy. # # @see EXPIRE_WITH_LINK # @see EXPIRE_WITH_SESSION # @see EXPIRE_WITH_CONNECTION # @see EXPIRE_NEVER # proton_set_get :expiry_policy # @!attribute timeout # # @return [Integer] The timeout period. # proton_set_get :timeout # @!attribute dynamic? # # @return [Boolean] True if the terminus is dynamic. # proton_set_is :dynamic # @!attribute distribution_mode # # @return [Integer] The distribution mode. Only relevant for a message source. # # @see DIST_MODE_UNSPECIFIED # @see DIST_MODE_COPY # @see DIST_MODE_MOVE # proton_set_get :distribution_mode # @private include Util::ErrorHandler # @private attr_reader :impl # @private def initialize(impl) @impl = impl end # Access and modify the AMQP properties data for the Terminus. # # This operation will return an instance of Data that is valid until the # Terminus is freed due to its parent being freed. Any data contained in # the object will be sent as the AMQP properties for the parent Terminus # instance. # # NOTE: this MUST take the form of a symbol keyed map to be valid. # # @return [Data] The terminus properties. # def properties Codec::Data.new(Cproton.pn_terminus_properties(@impl)) end # Access and modify the AMQP capabilities data for the Terminus. # # This operation will return an instance of Data that is valid until the # Terminus is freed due to its parent being freed. Any data contained in # the object will be sent as the AMQP properties for the parent Terminus # instance. # # NOTE: this MUST take the form of a symbol keyed map to be valid. # # @return [Data] The terminus capabilities. # def capabilities Codec::Data.new(Cproton.pn_terminus_capabilities(@impl)) end # Access and modify the AMQP outcomes for the Terminus. # # This operaiton will return an instance of Data that is valid until the # Terminus is freed due to its parent being freed. Any data contained in # the object will be sent as the AMQP properties for the parent Terminus # instance. # # NOTE: this MUST take the form of a symbol keyed map to be valid. # # @return [Data] The terminus outcomes. # def outcomes Codec::Data.new(Cproton.pn_terminus_outcomes(@impl)) end # Access and modify the AMQP filter set for a source terminus. # Only relevant for a message source. # # This operation will return an instance of Data that is valid until the # Terminus is freed due to its parent being freed. Any data contained in # the object will be sent as the AMQP properties for the parent Terminus # instance. # # NOTE: this MUST take the form of a symbol keyed map to be valid. # # @return [Data] The terminus filter. # def filter Codec::Data.new(Cproton.pn_terminus_filter(@impl)) end # Replace the data in this Terminus with the contents of +other+ # @param other [Terminus] The other instance. def replace(other) Cproton.pn_terminus_copy(@impl, other.impl) self end deprecated_alias :copy, :replace # Apply options to this terminus. # @option opts [String] :address the node address # @option opts [Boolean] :dynamic (false) # if true, request a new node with a unique address to be created. +:address+ is ignored. # @option opts [Integer] :distribution_mode see {#distribution_mode}, only for source nodes # @option opts [Integer] :durability_mode see {#durability_mode} # @option opts [Integer] :timeout see {#timeout} # @option opts [Integer] :expiry_policy see {#expiry_policy} # @option opts [Hash] :filter see {#filter}, only for source nodes # @option opts [Hash] :capabilities see {#capabilities} def apply(opts=nil) return unless opts if opts.is_a? String # Shorthand for address self.address = opts else opts.each_pair do |k,v| case k when :address then self.address = v when :dynamic then self.dynamic = !!v when :distribution_mode then self.distribution_mode = v when :durability_mode then self.durability_mode = v when :timeout then self.timeout = v.round # Should be integer seconds when :expiry_policy then self.expiry_policy = v when :filter then self.filter << v when :capabilities then self.capabilities << v end end end end def inspect() "\#<#{self.class}: address=#{address.inspect} dynamic?=#{dynamic?.inspect}>" end def to_s() inspect; end can_raise_error([:type=, :address=, :durability=, :expiry_policy=, :timeout=, :dynamic=, :distribution_mode=, :copy], :error_class => Qpid::Proton::LinkError) end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/ssl_domain.rb0000664000000000000000000001423213257152177021445 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The top-level object that stores the configuration used by one or more # SSL sessions. # # @see SSL # class SSLDomain # The local connection endpoint is an SSL client. # @private MODE_CLIENT = Cproton::PN_SSL_MODE_CLIENT # The local connection endpoint is an SSL server. # @private MODE_SERVER = Cproton::PN_SSL_MODE_SERVER # Require the peer to provide a valid identifying certificate. VERIFY_PEER = Cproton::PN_SSL_VERIFY_PEER # Do no require a certificate nor a cipher authorization. ANONYMOUS_PEER = Cproton::PN_SSL_ANONYMOUS_PEER # Require a valid certficate and matching name. VERIFY_PEER_NAME = Cproton::PN_SSL_VERIFY_PEER_NAME # @private include Util::ErrorHandler # @private attr_reader :impl # @private def initialize(mode) @impl = Cproton.pn_ssl_domain(mode) raise Qpid::Proton::SSLError, "SSL Unavailable" if @impl.nil? end # Set the certificate that identifies the local node to the remote. # # This certificate establishes the identity for thelocal node for all SSL # sessions created from this domain. It will be sent to the remote if the # remote needs to verify the dientify of this node. This may be used for # both SSL servers and SSL clients (if client authentication is required by # the server). # # *NOTE:* This setting affects only those instances of SSL created *after* # this call returns. SSL objects created before invoking this method will # use the domain's previous settings. # # @param cert_file [String] The filename containing the identify # certificate. For OpenSSL users, this is a PEM file. For Windows SChannel # users, this is the PKCS\#12 file or system store. # @param key_file [String] An option key to access the identifying # certificate. For OpenSSL users, this is an optional PEM file containing # the private key used to sign the certificate. For Windows SChannel users, # this is the friendly name of the self-identifying certficate if there are # multiple certfificates in the store. # @param password [String] The password used to sign the key, or *nil* if # the key is not protected. # # @raise [SSLError] If an error occurs. # def credentials(cert_file, key_file, password) Cproton.pn_ssl_domain_set_credentials(@impl, cert_file, key_file, password) end # Configures the set of trusted CA certificates used by this domain to # verify peers. # # If the local SSL client/server needs to verify the identify of the remote, # it must validate the signature of the remote's certificate. This function # sets the database of trusted CAs that will be used to verify the signature # of the remote's certificate. # # *NOTE:# This setting affects only those SSL instances created *after* this # call returns. SSL objects created before invoking this method will use the # domain's previous setting. # # @param certificate_db [String] The filename for the databse of trusted # CAs, used to authenticate the peer. # # @raise [SSLError] If an error occurs. # def trusted_ca_db(certificate_db) Cproton.pn_ssl_domain_set_trusted_ca_db(@impl, certificate_db) end # Configures the level of verification used on the peer certificate. # # This method congtrols how the peer's certificate is validated, if at all. # By default, neither servers nor clients attempt to verify their peers # (*ANONYMOUS_PEER*). Once certficates and trusted CAs are configured, peer # verification can be enabled. # # *NOTE:* In order to verify a peer, a trusted CA must be configured. # # *NOTE:* Servers must provide their own certficate when verifying a peer. # # *NOTE:* This setting affects only those SSL instances created after this # call returns. SSL instances created before invoking this method will use # the domain's previous setting. # # @param verify_mode [Integer] The level of validation to apply to the peer. # @param trusted_CAs [String] The path to a database of trusted CAs that # the server will advertise to the peer client if the server has been # configured to verify its peer. # # @see VERIFY_PEER # @see ANONYMOUS_PEER # @see VERIFY_PEER_NAME # # @raise [SSLError] If an error occurs. # def peer_authentication(verify_mode, trusted_CAs = nil) Cproton.pn_ssl_domain_set_peer_authentication(@impl, verify_mode, trusted_CAs) end # Permit a server to accept connection requests from non-SSL clients. # # This configures the server to "sniff" the incomfing client data stream and # dynamically determine whether SSL/TLS is being used. This option is # disabled by default: only clients using SSL/TLS are accepted by default. # # @raise [SSLError] If an error occurs. # def allow_unsecured_client Cproton.pn_ssl_domain_allow_unsecured_client(@impl); end can_raise_error :credentials, :error_class => Qpid::Proton::SSLError can_raise_error :trusted_ca_db, :error_class => Qpid::Proton::SSLError can_raise_error :peer_authentication, :error_class => Qpid::Proton::SSLError can_raise_error :allow_unsecured_client, :error_class => Qpid::Proton::SSLError end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/ssl_details.rb0000664000000000000000000000167713257152177021634 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @private class SSLSessionDetails attr_reader :session_id def initialize(session_id) @session_id = session_id end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/ssl.rb0000664000000000000000000001234213257152177020116 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The SSL support for Transport. # # A Transport may be configured ot use SLL for encryption and/or # authentication. A Transport can be configured as either the SSL # client or the server. An SSL client is the party that proctively # establishes a connection to an SSL server. An SSL server is the # party that accepts a connection request from the remote SSL client. # # If either the client or the server needs to identify itself with the # remote node, it must have its SSL certificate configured. # # @see SSLDomain#credentials For setting the SSL certificate. # # If either the client or the server needs to verify the identify of the # remote node, it must have its database of trusted CAs configured. # # @see SSLDomain#trusted_ca_db Setting the CA database. # # An SSL server connection may allow the remote client to connect without # SS (i.e., "in the clear"). # # @see SSLDomain#allow_unsecured_client Allowing unsecured clients. # # The level of verification required of the remote may be configured. # # @see SSLDomain#peer_authentication Setting peer authentication. # # Support for SSL client session resume is provided as well. # # @see SSLDomain # @see #resume_status # class SSL # Session resume state is unkonnwn or not supported. RESUME_UNKNOWN = Cproton::PN_SSL_RESUME_UNKNOWN # Session renegotiated and not resumed. RESUME_NEW = Cproton::PN_SSL_RESUME_NEW # Session resumed from the previous session. RESUME_REUSED = Cproton::PN_SSL_RESUME_REUSED # @private PROTON_METHOD_PREFIX = "pn_ssl" # @private include Util::Wrapper # @private include Util::ErrorHandler # Returns whether SSL is supported. # # @return [Boolean] True if SSL support is available. # def self.present? Cproton.pn_ssl_present end # @private def self.create(transport, domain, session_details = nil) result = nil # like python, make sure we're not creating a different SSL # object for a transport with an existing SSL object if transport.ssl? transport.instance_eval { result = @ssl } if ((!domain.nil? && (result.domain != domain)) || (!session_details.nil? && (result.session_details != session_details))) raise SSLException.new("cannot re-configure existing SSL object") end else impl = Cproton.pn_ssl(transport.impl) session_id = nil session_id = session_details.session_id unless session_details.nil? result = SSL.new(impl, domain, session_details, session_id) end return result end private def initialize(impl, domain, session_details, session_id) @impl = impl @domain = domain.impl unless domain.nil? @session_details = session_details @session_id = session_id Cproton.pn_ssl_init(@impl, @domain, @session_id) end public # Returns the cipher name that is currently in used. # # Gets the text description of the cipher that is currently active, or # returns nil if SSL is not active. Note that the cipher in use my change # over time due to renegotiation or other changes to the SSL layer. # # @return [String, nil] The cipher name. # def cipher_name rc, name = Cproton.pn_ssl_get_cipher_name(@impl, 128) return name if rc nil end # Returns the name of the SSL protocol that is currently active, or # returns nil if SSL is nota ctive. Not that the protocol may change over # time due to renegotation. # # @return [String, nil] The protocol name. # def protocol_name rc, name = Cproton.pn_ssl_get_protocol_name(@impl, 128) name if rc end # Checks whether or not the state has resumed. # # Used for client session resume. When called on an active session, it # indicates wehther the state has been resumed from a previous session. # # *NOTE:* This is a best-effort service - there is no guarantee that the # remote server will accept the resumed parameters. The remote server may # choose to ignore these parameters, and request a renegotation instead. # def resume_status Cproton.pn_ssl_resume_status(@impl) end # Gets the peer hostname. # # @return [String] The peer hostname. def peer_hostname (error, name) = Cproton.pn_ssl_get_peer_hostname(@impl, 1024) raise SSLError.new if error < 0 return name end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/session.rb0000664000000000000000000001136513257152177021004 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # A session is the parent for senders and receivers. # # A Session has a single parent Qpid::Proton::Connection instance. # class Session < Endpoint include Util::Deprecation # @private PROTON_METHOD_PREFIX = "pn_session" # @private include Util::Wrapper # @!attribute incoming_capacity # # The incoming capacity of a session determines how much incoming message # data the session will buffer. Note that if this value is less than the # negotatied frame size of the transport, it will be rounded up to one full # frame. # # @return [Integer] The incoing capacity of the session, measured in bytes. # proton_set_get :incoming_capacity # @private proton_get :attachments # @!attribute [r] outgoing_bytes # # @return [Integer] The number of outgoing bytes currently being buffered. # proton_caller :outgoing_bytes # @!attribute [r] incoming_bytes # # @return [Integer] The number of incomign bytes currently being buffered. # proton_caller :incoming_bytes # Open the session proton_caller :open # @!attribute [r] state # # @return [Integer] The endpoint state. # proton_caller :state # @private def self.wrap(impl) return nil if impl.nil? self.fetch_instance(impl, :pn_session_attachments) || Session.new(impl) end # @private def initialize(impl) @impl = impl self.class.store_instance(self, :pn_session_attachments) end # Close the local end of the session. The remote end may or may not be closed. # @param error [Condition] Optional error condition to send with the close. def close(error=nil) Condition.assign(_local_condition, error) Cproton.pn_session_close(@impl) end # @deprecated use {Connection#each_session} def next(state_mask) deprecated __method__, "Connection#each_session" Session.wrap(Cproton.pn_session_next(@impl, state_mask)) end # Returns the parent connection. # # @return [Connection] The connection. # def connection Connection.wrap(Cproton.pn_session_connection(@impl)) end # @deprecated use {#open_sender} def sender(name) deprecated __method__, "open_sender" Sender.new(Cproton.pn_sender(@impl, name)); end # @deprecated use {#open_receiver} def receiver(name) deprecated __method__, "open_receiver" Receiver.new(Cproton.pn_receiver(@impl, name)) end # Create and open a {Receiver} link, see {Receiver#open} # @param opts [Hash] receiver options, see {Receiver#open} # @return [Receiver] def open_receiver(opts=nil) Receiver.new(Cproton.pn_receiver(@impl, link_name(opts))).open(opts) end # Create and open a {Sender} link, see {#open} # @param opts [Hash] sender options, see {Sender#open} # @return [Sender] def open_sender(opts=nil) Sender.new(Cproton.pn_sender(@impl, link_name(opts))).open(opts) end # Get the links on this Session. # @overload each_link # @yieldparam l [Link] pass each link to block # @overload each_link # @return [Enumerator] enumerator over links def each_link return enum_for(:each_link) unless block_given? l = Cproton.pn_link_head(Cproton.pn_session_connection(@impl), 0); while l link = Link.wrap(l) yield link if link.session == self l = Cproton.pn_link_next(l, 0) end self end # Get the {Sender} links - see {#each_link} def each_sender() each_link.select { |l| l.sender? }; end # Get the {Receiver} links - see {#each_link} def each_receiver() each_link.select { |l| l.receiver? }; end private def link_name(opts) (opts.respond_to?(:to_hash) && opts[:name]) || connection.link_name end def _local_condition Cproton.pn_session_condition(@impl) end def _remote_condition # :nodoc: Cproton.pn_session_remote_condition(@impl) end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/sender.rb0000664000000000000000000000643313257152177020601 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The sending endpoint. # # @see Receiver # class Sender < Link # @private include Util::ErrorHandler # Open the {Sender} link # # @overload open_sender(address) # @param address [String] address of the target to send to # @overload open_sender(opts) # @option opts [Boolean] :auto_settle (true) if true, automatically settle transfers # @option opts [Boolean] :dynamic (false) dynamic property for source {Terminus#dynamic} # @option opts [String,Hash] :source source address or source options, see {Terminus#apply} # @option opts [String,Hash] :target target address or target options, see {Terminus#apply} # @option opts [String] :name (generated) unique name for the link. def open(opts=nil) opts = { :target => opts } if opts.is_a? String opts ||= {} target.apply opts[:target] source.apply opts[:source] target.dynamic = !!opts[:dynamic] @auto_settle = opts.fetch(:auto_settle, true) super() self end # @return [Boolean] auto_settle flag, see {#open} attr_reader :auto_settle # Hint to the remote receiver about the number of messages available. # The receiver may use this to optimize credit flow, or may ignore it. # @param n [Integer] The number of deliveries potentially available. def offered(n) Cproton.pn_link_offered(@impl, n) end # TODO aconway 2017-12-05: incompatible, used to return bytes sent. # @!method send(message) # Send a message. # @param message [Message] The message to send. # @return [Tracker] Tracks the outcome of the message. def send(message, *args) tag = nil if args.size > 0 # deprecated: allow tag in args[0] for backwards compat raise ArgumentError("too many arguments") if args.size > 1 tag = args[0] end tag ||= next_tag t = Tracker.new(Cproton.pn_delivery(@impl, tag)) Cproton.pn_link_send(@impl, message.encode) Cproton.pn_link_advance(@impl) t.settle if snd_settle_mode == SND_SETTLED return t end # @deprecated use {#send} def stream(bytes) deprecated __method__, "send" Cproton.pn_link_send(@impl, bytes) end # @deprecated internal use only def delivery_tag() deprecated(__method__); next_tag; end private def initialize(*arg) super; @tag_count = 0; end def next_tag() (@tag_count += 1).to_s(32); end can_raise_error :stream, :error_class => Qpid::Proton::LinkError end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/sasl.rb0000664000000000000000000001014513257152177020256 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The SASL layer is responsible for establishing an authenticated and/or # encrypted tunnel over which AMQP frames are passed between peers. # # The peer acting as the SASL client must provide authentication # credentials. # # The peer acting as the SASL server must provide authentication against the # received credentials. # # @note Do not instantiate directly, use {Transport#sasl} to create a SASL object. class SASL include Util::Deprecation # Negotation has not completed. NONE = Cproton::PN_SASL_NONE # Authentication succeeded. OK = Cproton::PN_SASL_OK # Authentication failed due to bad credentials. AUTH = Cproton::PN_SASL_AUTH private extend Util::SWIGClassHelper PROTON_METHOD_PREFIX = "pn_sasl" public # @private # @note Do not instantiate directly, use {Transport#sasl} to create a SASL object. def initialize(transport) @impl = Cproton.pn_sasl(transport.impl) end # @!attribute allow_insecure_mechs # @return [Bool] true if clear text authentication is allowed on insecure connections. proton_set_get :allow_insecure_mechs # @!attribute user [r] # @return [String] the authenticated user name proton_get :user # Set the mechanisms allowed for SASL negotation # @param mechanisms [String] space-delimited list of allowed mechanisms def allowed_mechs=(mechanisms) Cproton.pn_sasl_allowed_mechs(@impl, mechanisms) end # @deprecated use {#allowed_mechs=} deprecated_alias :mechanisms, :allowed_mechs= # True if extended SASL negotiation is supported # # All implementations of Proton support ANONYMOUS and EXTERNAL on both # client and server sides and PLAIN on the client side. # # Extended SASL implememtations use an external library (Cyrus SASL) # to support other mechanisms. # # @return [Bool] true if extended SASL negotiation is supported def self.extended?() Cproton.pn_sasl_extended() end class << self include Util::Deprecation # Set the sasl configuration path # # This is used to tell SASL where to look for the configuration file. # In the current implementation it can be a colon separated list of directories. # # The environment variable PN_SASL_CONFIG_PATH can also be used to set this path, # but if both methods are used then this pn_sasl_config_path() will take precedence. # # If not set the underlying implementation default will be used. # # @param path the configuration path # def config_path=(path) Cproton.pn_sasl_config_path(nil, path) path end # Set the configuration file name, without extension # # The name with an a ".conf" extension will be searched for in the # configuration path. If not set, it defaults to "proton-server" or # "proton-client" for a server (incoming) or client (outgoing) connection # respectively. # # @param name the configuration file name without extension # def config_name=(name) Cproton.pn_sasl_config_name(nil, name) end # @deprecated use {config_path=} deprecated_alias :config_path, :config_path= # @deprecated use {config_name=} deprecated_alias :config_name, :config_name= end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/receiver.rb0000664000000000000000000001042313257152177021117 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The receiving endpoint. # # @see Sender # class Receiver < Link # @private PROTON_METHOD_PREFIX = "pn_link" # @private include Util::Wrapper # Open {Receiver} link # # @overload open_receiver(address) # @param address [String] address of the source to receive from # @overload open_receiver(opts) # @param opts [Hash] Receiver options, see {Receiver#open} # @option opts [Integer] :credit_window automatically maintain this much credit # for messages to be pre-fetched while the current message is processed. # @option opts [Boolean] :auto_accept if true, deliveries that are not settled by # the application in {MessagingHandler#on_message} are automatically accepted. # @option opts [Boolean] :dynamic (false) dynamic property for source {Terminus#dynamic} # @option opts [String,Hash] :source source address or source options, see {Terminus#apply} # @option opts [String,Hash] :target target address or target options, see {Terminus#apply} # @option opts [String] :name (generated) unique name for the link. def open(opts=nil) opts ||= {} opts = { :source => opts } if opts.is_a? String @credit_window = opts.fetch(:credit_window, 10) @auto_accept = opts.fetch(:auto_accept, true) source.apply(opts[:source]) target.apply(opts[:target]) source.dynamic = !!opts[:dynamic] super() self end # @return [Integer] credit window, see {#open} attr_reader :credit_window # @return [Boolean] auto_accept flag, see {#open} attr_reader :auto_accept # @!attribute drain # # The drain mode. # # If a receiver is in drain mode, then the sending endpoint of a link must # immediately use up all available credit on the link. If this is not # possible, the excess credit must be returned by invoking #drained. # # Only the receiving endpoint can set the drain mode. # # @return [Boolean] True if drain mode is set. # proton_set_get :drain # @!attribute [r] draining? # # Returns if a link is currently draining. # # A link is defined to be draining when drain mode is set to true and # the sender still has excess credit. # # @return [Boolean] True if the receiver is currently draining. # proton_caller :draining? # Grants credit for incoming deliveries. # # @param n [Integer] The amount to increment the link credit. # def flow(n) Cproton.pn_link_flow(@impl, n) end # Allows receiving up to the specified limit of data from the remote # endpoint. # # Note that large messages can be streamed across the network, so just # because there is no data to read does not imply the message is complete. # # To ensure the entirety of the message data has been read, either call # #receive until nil is returned, or verify that #partial? is false and # Delivery#pending is 0. # # @param limit [Integer] The maximum bytes to receive. # # @return [Integer, nil] The number of bytes received, or nil if the end of # the stream was reached. # # @see Deliver#pending To see how much buffer space is needed. # # @raise [LinkError] If an error occurs. # def receive(limit) (n, bytes) = Cproton.pn_link_recv(@impl, limit) return nil if n == Qpid::Proton::Error::EOS raise LinkError.new("[#{n}]: #{Cproton.pn_link_error(@impl)}") if n < 0 return bytes end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/messaging_handler.rb0000664000000000000000000001421313257152177022766 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # A handler for AMQP messaging events. # # Subclass the handler and provide the #on_xxx methods with your event-handling code. # # An AMQP endpoint (connection, session or link) must be opened and closed at # each end. Normally proton responds automatically to an incoming # open/close. You can prevent the automatic response by raising # {StopAutoResponse} from +#on_xxx_open+ or +#on_xxx_close+. The application becomes responsible # for calling +#open/#close+ at a later point. # # *Note*: If a {MessagingHandler} method raises an exception, it will stop the {Container} # that the handler is running in. See {Container#run} # class MessagingHandler # @return [Hash] handler options, see {#initialize} attr_reader :options # @!group Most common events # @!method on_container_start(container) # The container event loop is started # @param container [Container] The container. # @!method on_container_stop(container) # The container event loop is stopped # @param container [Container] The container. # @!method on_message(delivery, message) # A message is received. # @param delivery [Delivery] The delivery. # @param message [Message] The message # @!method on_sendable(sender) # A message can be sent # @param sender [Sender] The sender. # @!endgroup # @!group Endpoint lifecycle events # @!method on_connection_open(connection) # The remote peer opened the connection # @param connection # @!method on_connection_close(connection) # The remote peer closed the connection # @param connection # @!method on_connection_error(connection) # The remote peer closed the connection with an error condition # @param connection # @!method on_session_open(session) # The remote peer opened the session # @param session # @!method on_session_close(session) # The remote peer closed the session # @param session # @!method on_session_error(session) # The remote peer closed the session with an error condition # @param session # @!method on_sender_open(sender) # The remote peer opened the sender # @param sender # @!method on_sender_detach(sender) # The remote peer detached the sender # @param sender # @!method on_sender_close(sender) # The remote peer closed the sender # @param sender # @!method on_sender_error(sender) # The remote peer closed the sender with an error condition # @param sender # @!method on_receiver_open(receiver) # The remote peer opened the receiver # @param receiver # @!method on_receiver_detach(receiver) # The remote peer detached the receiver # @param receiver # @!method on_receiver_close(receiver) # The remote peer closed the receiver # @param receiver # @!method on_receiver_error(receiver) # The remote peer closed the receiver with an error condition # @param receiver # @!endgroup # @!group Delivery events # @!method on_tracker_accept(tracker) # The receiving end accepted a delivery # @param tracker [Tracker] The tracker. # @!method on_tracker_reject(tracker) # The receiving end rejected a delivery # @param tracker [Tracker] The tracker. # @!method on_tracker_release(tracker) # The receiving end released a delivery # @param tracker [Tracker] The tracker. # @!method on_tracker_modify(tracker) # The receiving end modified a delivery # @param tracker [Tracker] The tracker. # @!method on_tracker_settle(tracker) # The receiving end settled a delivery # @param tracker [Tracker] The tracker. # @!method on_delivery_settle(delivery) # The sending end settled a delivery # @param delivery [Delivery] The delivery. # @!method on_delivery_abort(delivery) # A message was begun but aborted by the sender, so was not received. # @param delivery [Delivery] The delivery. # @!endgroup # @!group Flow control events # @!method on_sender_drain_start(sender) # The remote end of the sender requested draining # @param sender [Sender] The sender. # @!method on_receiver_drain_finish(receiver) # The remote end of the receiver completed draining # @param receiver [Receiver] The receiver. # @!endgroup # @!group Transport events # @!method on_transport_open(transport) # The underlying network channel opened # @param transport [Transport] The transport. # @!method on_transport_close(transport) # The underlying network channel closed # @param transport [Transport] The transport. # @!method on_transport_error(transport) # The underlying network channel is closing due to an error. # @param transport [Transport] The transport. # @!endgroup # @!group Unhandled events # @!method on_error(error_condition) # Called on an error if no more specific on_xxx_error method is provided. # If on_error() is also not defined, the connection is closed with error_condition # @param error_condition [Condition] Provides information about the error. # @!method on_unhandled(method_name, *args) # Called for events with no handler. Similar to ruby's standard #method_ # @param method_name [Symbol] Name of the event method that would have been called. # @param args [Array] Arguments that would have been passed # @!endgroup end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/message.rb0000664000000000000000000003171413257152177020745 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Messsage data and headers that can sent or received on a {Link} # # {#body} is the main message content. # {#properties} is a {Hash} of extra properties that can be attached to the message. # # @example Create a message containing a Unicode string # msg = Qpid::Proton::Message.new "this is a string" # # @example Create a message containing binary data # msg = Qpid::Proton::Message.new # msg.body = Qpid::Proton::BinaryString.new(File.binread("/home/qpid/binfile.tar.gz")) # class Message include Util::Deprecation # @private PROTON_METHOD_PREFIX = "pn_message" # @private include Util::Wrapper # Decodes a message from AMQP binary data. # @param encoded [String] the encoded bytes # @return[Integer] the number of bytes consumed def decode(encoded) check(Cproton.pn_message_decode(@impl, encoded, encoded.length)) post_decode end # @private def post_decode # decode elements from the message @properties = Codec::Data.to_object(Cproton::pn_message_properties(@impl)) || {} @instructions = Codec:: Data.to_object(Cproton::pn_message_instructions(@impl)) || {} @annotations = Codec::Data.to_object(Cproton::pn_message_annotations(@impl)) || {} @body = Codec::Data.to_object(Cproton::pn_message_body(@impl)) end # Encodes the message. def encode pre_encode size = 16 loop do error, data = Cproton::pn_message_encode(@impl, size) if error == Qpid::Proton::Error::OVERFLOW size *= 2 else check(error) return data end end end # @private def pre_encode # encode elements from the message Codec::Data.from_object(Cproton::pn_message_properties(@impl), !@properties.empty? && @properties) Codec::Data.from_object(Cproton::pn_message_instructions(@impl), !@instructions.empty? && @instructions) Codec::Data.from_object(Cproton::pn_message_annotations(@impl), !@annotations.empty? && @annotations) Codec::Data.from_object(Cproton::pn_message_body(@impl), @body) end # Creates a new +Message+ instance. # @param body the body of the message, equivalent to calling m.body=(body) # @param opts [Hash] additional options, equivalent to +Message#key=value+ for each +key=>value+ def initialize(body = nil, opts={}) @impl = Cproton.pn_message ObjectSpace.define_finalizer(self, self.class.finalize!(@impl)) @properties = {} @instructions = {} @annotations = {} @body = nil self.body = body unless body.nil? if !opts.nil? then opts.each do |k, v| setter = (k.to_s+"=").to_sym() self.send setter, v end end end # Invoked by garbage collection to clean up resources used # by the underlying message implementation. def self.finalize!(impl) # :nodoc: proc { Cproton.pn_message_free(impl) } end # Returns the underlying message implementation. def impl # :nodoc: @impl end # Clears the state of the +Message+. This allows a single instance of # +Message+ to be reused. # def clear Cproton.pn_message_clear(@impl) @properties.clear unless @properties.nil? @instructions.clear unless @instructions.nil? @annotations.clear unless @annotations.nil? @body = nil end # Returns the most recent error number. # def errno Cproton.pn_message_errno(@impl) end # Returns the most recent error message. # def error Cproton.pn_error_text(Cproton.pn_message_error(@impl)) end # Returns whether there is currently an error reported. # def error? !Cproton.pn_message_errno(@impl).zero? end # Sets the durable flag. # # See ::durable for more details on message durability. # # ==== Options # # * state - the durable state # def durable=(state) raise TypeError.new("state cannot be nil") if state.nil? Cproton.pn_message_set_durable(@impl, state) end # Returns the durable property. # # The durable property indicates that the emessage should be held durably # by any intermediaries taking responsibility for the message. # # ==== Examples # # msg = Qpid::Proton::Message.new # msg.durable = true # def durable Cproton.pn_message_is_durable(@impl) end # Sets the priority. # # +NOTE:+ Priority values are limited to the range [0,255]. # # ==== Options # # * priority - the priority value # def priority=(priority) raise TypeError.new("invalid priority: #{priority}") if not priority.is_a?(Numeric) raise RangeError.new("priority out of range: #{priority}") if ((priority > 255) || (priority < 0)) Cproton.pn_message_set_priority(@impl, priority.floor) end # Returns the priority. # def priority Cproton.pn_message_get_priority(@impl) end # Sets the time-to-live for the message. # # ==== Options # # * time - the time in milliseconds # def ttl=(time) raise TypeError.new("invalid ttl: #{time}") if not time.is_a?(Numeric) raise RangeError.new("ttl out of range: #{time}") if ((time.to_i < 0)) Cproton.pn_message_set_ttl(@impl, time.floor) end # Returns the time-to-live, in milliseconds. # def ttl Cproton.pn_message_get_ttl(@impl) end # Sets whether this is the first time the message was acquired. # # See ::first_acquirer? for more details. # # ==== Options # # * state - true if claiming the message # def first_acquirer=(state) raise TypeError.new("invalid state: #{state}") if state.nil? || !([TrueClass, FalseClass].include?(state.class)) Cproton.pn_message_set_first_acquirer(@impl, state) end # Sets the delivery count for the message. # # See ::delivery_count for more details. # # ==== Options # # * count - the delivery count # def delivery_count=(count) raise ::ArgumentError.new("invalid count: #{count}") if not count.is_a?(Numeric) raise RangeError.new("count out of range: #{count}") if count < 0 Cproton.pn_message_set_delivery_count(@impl, count.floor) end # Returns the delivery count for the message. # # This is the number of delivery attempts for the given message. # def delivery_count Cproton.pn_message_get_delivery_count(@impl) end # Returns whether this is the first acquirer. # # def first_acquirer? Cproton.pn_message_is_first_acquirer(@impl) end # Sets the message id. # # ==== Options # # * id = the id # def id=(id) Cproton.pn_message_set_id(@impl, id) end # Returns the message id. # def id Cproton.pn_message_get_id(@impl) end # Sets the user id. # # ==== Options # # * id - the user id # def user_id=(id) Cproton.pn_message_set_user_id(@impl, id) end # Returns the user id. # def user_id Cproton.pn_message_get_user_id(@impl) end # Sets the destination address. # # ==== Options # # * address - the address # def address=(address) Cproton.pn_message_set_address(@impl, address) end # Returns the destination address. # def address Cproton.pn_message_get_address(@impl) end # Sets the subject. # # ==== Options # # * subject - the subject # def subject=(subject) Cproton.pn_message_set_subject(@impl, subject) end # Returns the subject # def subject Cproton.pn_message_get_subject(@impl) end # Sets the reply-to address. # # ==== Options # # * address - the reply-to address # def reply_to=(address) Cproton.pn_message_set_reply_to(@impl, address) end # Returns the reply-to address # def reply_to Cproton.pn_message_get_reply_to(@impl) end # Sets the correlation id. # # ==== Options # # * id - the correlation id # def correlation_id=(id) Cproton.pn_message_set_correlation_id(@impl, id) end # Returns the correlation id. # def correlation_id Cproton.pn_message_get_correlation_id(@impl) end # Sets the content type. # # ==== Options # # * content_type - the content type # def content_type=(content_type) Cproton.pn_message_set_content_type(@impl, content_type) end # Returns the content type # def content_type Cproton.pn_message_get_content_type(@impl) end # @deprecated use {#body=} def content=(content) deprecated __method__, "body=" Cproton.pn_message_load(@impl, content) end # @deprecated use {#body} def content deprecated __method__, "body" size = 16 loop do result = Cproton.pn_message_save(@impl, size) error = result[0] data = result[1] if error == Qpid::Proton::Error::OVERFLOW size = size * 2 else check(error) return data end end end # Sets the content encoding type. # # ==== Options # # * encoding - the content encoding # def content_encoding=(encoding) Cproton.pn_message_set_content_encoding(@impl, encoding) end # Returns the content encoding type. # def content_encoding Cproton.pn_message_get_content_encoding(@impl) end # Sets the expiration time. # # ==== Options # # * time - the expiry time # def expires=(time) raise TypeError.new("invalid expiry time: #{time}") if time.nil? raise ::ArgumentError.new("expiry time cannot be negative: #{time}") if time < 0 Cproton.pn_message_set_expiry_time(@impl, time) end # Returns the expiration time. # def expires Cproton.pn_message_get_expiry_time(@impl) end # Sets the creation time. # # ==== Options # # * time - the creation time # def creation_time=(time) raise TypeError.new("invalid time: #{time}") if time.nil? raise ::ArgumentError.new("time cannot be negative") if time < 0 Cproton.pn_message_set_creation_time(@impl, time) end # Returns the creation time. # def creation_time Cproton.pn_message_get_creation_time(@impl) end # Sets the group id. # # ==== Options # # * id - the group id # def group_id=(id) Cproton.pn_message_set_group_id(@impl, id) end # Returns the group id. # def group_id Cproton.pn_message_get_group_id(@impl) end # Sets the group sequence number. # # ==== Options # # * seq - the sequence number # def group_sequence=(seq) raise TypeError.new("invalid seq: #{seq}") if seq.nil? Cproton.pn_message_set_group_sequence(@impl, seq) end # Returns the group sequence number. # def group_sequence Cproton.pn_message_get_group_sequence(@impl) end # Sets the reply-to group id. # # ==== Options # # * id - the id # def reply_to_group_id=(id) Cproton.pn_message_set_reply_to_group_id(@impl, id) end # Returns the reply-to group id. # def reply_to_group_id Cproton.pn_message_get_reply_to_group_id(@impl) end # @return [Hash] Application properties for the message attr_accessor :properties # Equivalent to +{#properties}[name] = value+ def []=(name, value) @properties[name] = value; end # Equivalent to +{#properties}[name]+ def [](name) @properties[name]; end # Equivalent to +{#properties}.delete(name)+ def delete_property(name) @properties.delete(name); end # @return [Hash] Delivery instructions for this message. attr_accessor :instructions # @return [Hash] Delivery annotations for this message. attr_accessor :annotations # @return [Object] body of the message. attr_accessor :body def inspect() pre_encode; super; end private def check(err) # :nodoc: if err < 0 raise TypeError, "[#{err}]: #{Cproton.pn_message_error(@data)}" else return err end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/listener.rb0000664000000000000000000000622113257152177021141 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # A listener for incoming connections. # # Create with {Container#listen} or {Container#listen_io}. # To control the handler and connection options applied to incoming connections, # pass a {ListenerHandler} on creation. # class Listener # Class that handles listener events and provides options for accepted # connections. This class simply returns a fixed set of options for every # connection accepted, but you can subclass and override all of the on_ # methods to provide more interesting behaviour. # # *Note*: If a {Listener} method raises an exception, it will stop the {Container} # that the handler is running in. See {Container#run} class Handler # @param opts [Hash] Options to return from on_accept. def initialize(opts=nil) @opts = opts || {}; end # Called when the listener is ready to accept connections. # @param listener [Listener] The listener def on_open(listener) end # Called if an error occurs. # If there is an error while opening the listener, this method is # called and {#on_open} is not # @param listener [Listener] # @param what [Condition] Information about the error. def on_error(listener, what) end # Called when a listener accepts a new connection. # @param listener [Listener] The listener # @return [Hash] Options to apply to the incoming connection, see {#connect} def on_accept(listener) @opts; end # Called when the listener closes. # @param listener [Listener] The listener accepting the connection. def on_close(listener) end end # @return [Container] The listener's container attr_reader :container # @return [Condition] The error condition if there is one attr_reader :condition # Close the listener # @param error [Condition] Optional error condition. def close(error=nil) @closing = true @condition ||= Condition.convert error @io.close_read rescue nil # Cause listener to wake out of IO.select nil end # Get the {IO} server socket used by the listener def to_io() @io; end # Get the IP port used by the listener def port() to_io.addr[1]; end private # Called by {Container} def initialize(io, handler, container) @io, @handler = io, handler @container = container end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/link.rb0000664000000000000000000002460313257152177020255 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # The base for both Sender and Receiver, providing common functionality # between both ends. # # A Link has a single parent Qpid::Proton::Session instance. # class Link < Endpoint # @private PROTON_METHOD_PREFIX = "pn_link" # @private include Util::Wrapper # The sender will send all deliveries initially unsettled. SND_UNSETTLED = Cproton::PN_SND_UNSETTLED # The sender will send all deliveries settled to the receiver. SND_SETTLED = Cproton::PN_SND_SETTLED # The sender may send a mixture of settled and unsettled deliveries. SND_MIXED = Cproton::PN_SND_MIXED # The receiver will settle deliveries regardless of what the sender does. RCV_FIRST = Cproton::PN_RCV_FIRST # The receiver will only settle deliveries after the sender settles. RCV_SECOND = Cproton::PN_RCV_SECOND # @!attribute [r] state # # Returns the endpoint state flags. # proton_caller :state # @deprecated Use {Sender#open} or {Receiver#open} proton_caller :open # Close the local end of the link. The remote end may or may not be closed. # @param error [Condition] Optional error condition to send with the close. def close(error=nil) Condition.assign(_local_condition, error) Cproton.pn_link_close(@impl) end # @!method detach # # Detaches the link. proton_caller :detach # Advance the current delivery to the next on the link. # # For sending links, this operation is used to finish sending message data # for the current outgoing delivery and move on to the next outgoing # delivery (if any). # # For receiving links, this operatoin is used to finish accessing message # data from the current incoming delivery and move on to the next incoming # delivery (if any). # # @return [Boolean] True if the current delivery was changed. # # @see #current # proton_caller :advance proton_caller :unsettled # @!attribute [r] credit # # Returns the credit balance for a link. # # Links use a credit based flow control scheme. Every receiver maintains a # credit balance that corresponds to the number of deliveries that the # receiver can accept at any given moment. # # As more capacity becomes available at the receiver, it adds credit to this # balance and communicates the new balance to the sender. Whenever a # delivery is sent/received, the credit balance maintained by the link is # decremented by one. # # Once the credit balance at the sender reaches zero, the sender must pause # sending until more credit is obtained from the receiver. # # NOte that a sending link may still be used to send deliveries eve if # credit reaches zero. However those deliveries will end up being buffer by # the link until enough credit is obtained from the receiver to send them # over the wire. In this case the balance reported will go negative. # # @return [Integer] The credit balance. # # @see #flow # proton_caller :credit # @!attribute [r] remote_credit # # Returns the remote view of the credit. # # The remote view of the credit for a link differs from the local view of # credit for a link by the number of queued deliveries. In other words, # remote credit is defined as credit - queued. # # @see #queued # @see #credit # # @return [Integer] The remove view of the credit. # proton_caller :remote_credit # @!attribute [r] available # # Returns the available deliveries hint for a link. # # The available count for a link provides a hint as to the number of # deliveries that might be able to be sent if sufficient credit were issued # by the receiving link endpoint. # # @return [Integer] The available deliveries hint. # # @see Sender#offered # proton_caller :available # @!attribute [r] queued # # Returns the number of queued deliveries for a link. # # Links may queue deliveries for a number of reasons. For example, there may # be insufficient credit to send them to the receiver, or they simply may # not have yet had a chance to be written to the wire. # # @return [Integer] The number of queued deliveries. # # @see #credit # proton_caller :queued # @!attribute [r] name # # Returns the name of the link. # # @return [String] The name. # proton_caller :name # @!attribute [r] sender? # # Returns if the link is a sender. # # @return [Boolean] True if the link is a sender. # proton_is :sender # @!attribute [r] receiver? # # Returns if the link is a receiver. # # @return [Boolean] True if the link is a receiver. # proton_is :receiver # @private proton_get :attachments # Drains excess credit. # # When a link is in drain mode, the sender must use all excess credit # immediately and release any excess credit back to the receiver if there # are no deliveries available to send. # # When invoked on a Sender that is in drain mode, this operation will # release all excess credit back to the receiver and return the number of # credits released back to the sender. If the link is not in drain mode, # this operation is a noop. # # When invoked on a Receiver, this operation will return and reset the # number of credits the sender has released back to it. # # @return [Integer] The number of credits drained. # proton_caller :drained # @private def self.wrap(impl) return unless impl return fetch_instance(impl, :pn_link_attachments) || (Cproton.pn_link_is_sender(impl) ? Sender : Receiver).new(impl) end # @private def initialize(impl) @impl = impl self.class.store_instance(self, :pn_link_attachments) end # Returns additional error information. # # Whenever a link operation fails (i.e., returns an error code) additional # error details can be obtained from this method. Ther error object that is # returned may also be used to clear the error condition. # # @return [Error] The error. # def error Cproton.pn_link_error(@impl) end # @deprecated use {Session#each_link, Connection#each_link} def next(state_mask) deprecated __method__, "Session#each_link, Connection#each_link" return Link.wrap(Cproton.pn_link_next(@impl, state_mask)) end # Returns the locally defined source terminus. # # @return [Terminus] The terminus def source Terminus.new(Cproton.pn_link_source(@impl)) end # Returns the locally defined target terminus. # # @return [Terminus] The terminus. # def target Terminus.new(Cproton.pn_link_target(@impl)) end # Returns a representation of the remotely defined source terminus. # # @return [Terminus] The terminus. # def remote_source Terminus.new(Cproton.pn_link_remote_source(@impl)) end # Returns a representation of the remotely defined target terminus. # # @return [Terminus] The terminus. # def remote_target Terminus.new(Cproton.pn_link_remote_target(@impl)) end # Returns the parent session. # # @return [Session] The session. # def session Session.wrap(Cproton.pn_link_session(@impl)) end # Returns the parent connection. # # @return [Connection] The connection. # def connection self.session.connection end # @deprecated use {Sender#send} def delivery(tag) deprecated __method__, "Sender#send" Delivery.new(Cproton.pn_delivery(@impl, tag)) end # Returns the current delivery. # # Each link maintains a sequence of deliveries in the order they were # created, along with a reference to the *current* delivery. All send and # receive operations on a link take place on the *current* delivery. If a # link has no current delivery, the current delivery is automatically # pointed to the *next* delivery created on the link. # # Once initialized, the current delivery remains the same until it is # changed by advancing, or until it is settled. # # @see #next # @see Delivery#settle # # @return [Delivery] The current delivery. # def current Delivery.wrap(Cproton.pn_link_current(@impl)) end # Sets the local sender settle mode. # # @param mode [Integer] The settle mode. # # @see #SND_UNSETTLED # @see #SND_SETTLED # @see #SND_MIXED # def snd_settle_mode=(mode) Cproton.pn_link_set_snd_settle_mode(@impl, mode) end # Returns the local sender settle mode. # # @return [Integer] The local sender settle mode. # # @see #snd_settle_mode # def snd_settle_mode Cproton.pn_link_snd_settle_mode(@impl) end # Sets the local receiver settle mode. # # @param mode [Integer] The settle mode. # # @see #RCV_FIRST # @see #RCV_SECOND # def rcv_settle_mode=(mode) Cproton.pn_link_set_rcv_settle_mode(@impl, mode) end # Returns the local receiver settle mode. # # @return [Integer] The local receiver settle mode. # def rcv_settle_mode Cproton.pn_link_rcv_settle_mode(@impl) end # @private def _local_condition Cproton.pn_link_condition(@impl) end # @private def _remote_condition Cproton.pn_link_remote_condition(@impl) end def ==(other) other.respond_to?(:impl) && (Cproton.pni_address_of(other.impl) == Cproton.pni_address_of(@impl)) end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/exceptions.rb0000664000000000000000000000574313257152177021505 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @private module Error NONE = 0 EOS = Cproton::PN_EOS ERROR = Cproton::PN_ERR OVERFLOW = Cproton::PN_OVERFLOW UNDERFLOW = Cproton::PN_UNDERFLOW STATE = Cproton::PN_STATE_ERR ARGUMENT = Cproton::PN_ARG_ERR TIMEOUT = Cproton::PN_TIMEOUT INTERRUPTED = Cproton::PN_INTR INPROGRESS = Cproton::PN_INPROGRESS end # Represents a generic error at the messaging level. # class ProtonError < RuntimeError end # Represents an end-of-stream error while messaging. # class EOSError < ProtonError end # Represents a data overflow exception while messaging. # class OverflowError < ProtonError end # Represents a data underflow exception while messaging. # class UnderflowError < ProtonError end # Represents an invalid, missing or illegal argument while messaging. # class ArgumentError < ProtonError end # Represents that the client has got into an unexpected state during # messaging. # class StateError < ProtonError end # Represents a timeout during messaging. # class TimeoutError < ProtonError end # Represents an interrupting during a blocking I/O operation. # class InterruptedError < ProtonError end class InProgressError < ProtonError end # Raised by instances of Transport. # class TransportError < ProtonError end # Raised by instances of SASL # class SASLError < TransportError end # Raised by Session. # class SessionError < ProtonError end # Raised when an attempt is made to change an attribute that is read-only. # class AttributeError < ProtonError end # Raised by link components. # class LinkError < ProtonError end class SSLError < TransportError end class SSLUnavailableError < SSLError end # Raised when a message is rejected. # class Reject < ProtonError end # Raised when a message is released. # class Release < ProtonError end # Raised when a message is aborted by the sender. # class AbortedError < ProtonError end # Raised to stop an automatic response to an endpoint open/close, # so that the application can delay completing the open/close to a later time. class StopAutoResponse < ProtonError end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/event.rb0000664000000000000000000001375313257152177020445 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @deprecated Only used with the deprecated {Handler::MessagingHandler} API. class Event private include Util::Deprecation PROTON_METHOD_PREFIX = "pn_disposition" include Util::Wrapper EVENT_TYPE_NAMES = [:PN_EVENT_NONE, :PN_CONNECTION_INIT, :PN_CONNECTION_BOUND, :PN_CONNECTION_UNBOUND, :PN_CONNECTION_LOCAL_OPEN, :PN_CONNECTION_REMOTE_OPEN, :PN_CONNECTION_LOCAL_CLOSE, :PN_CONNECTION_REMOTE_CLOSE, :PN_CONNECTION_FINAL, :PN_SESSION_INIT, :PN_SESSION_LOCAL_OPEN, :PN_SESSION_REMOTE_OPEN, :PN_SESSION_LOCAL_CLOSE, :PN_SESSION_REMOTE_CLOSE, :PN_SESSION_FINAL, :PN_LINK_INIT, :PN_LINK_LOCAL_OPEN, :PN_LINK_REMOTE_OPEN, :PN_LINK_LOCAL_CLOSE, :PN_LINK_REMOTE_CLOSE, :PN_LINK_LOCAL_DETACH, :PN_LINK_REMOTE_DETACH, :PN_LINK_FLOW, :PN_LINK_FINAL, :PN_DELIVERY, :PN_TRANSPORT, :PN_TRANSPORT_AUTHENTICATED, :PN_TRANSPORT_ERROR, :PN_TRANSPORT_HEAD_CLOSED, :PN_TRANSPORT_TAIL_CLOSED, :PN_TRANSPORT_CLOSED] TYPE_METHODS = EVENT_TYPE_NAMES.each_with_object({}) do |n, h| type = Cproton.const_get(n) h[type] = "on_#{Cproton.pn_event_type_name(type)[3..-1]}".downcase.to_sym end # Use Event.new(impl) to wrap a C event, or Event.new(nil, method, context) # to create a pure-ruby event. def initialize(impl, method=nil, context=nil) @impl, @method, @context = impl, method, context @method ||= TYPE_METHODS[Cproton.pn_event_type(@impl)] if @impl end # Get the context if it is_a?(clazz), else call method on the context def get(clazz, method=nil) (ctx = context).is_a?(clazz) ? ctx : ctx.__send__(method) rescue nil end def _context x = Cproton.pn_event_context(@impl) case Cproton.pn_class_id(Cproton.pn_event_class(@impl)) when Cproton::CID_pn_transport then Transport.wrap(Cproton.pn_cast_pn_transport(x)) when Cproton::CID_pn_connection then Connection.wrap(Cproton.pn_cast_pn_connection(x)) when Cproton::CID_pn_session then Session.wrap(Cproton.pn_cast_pn_session(x)) when Cproton::CID_pn_link then Link.wrap(Cproton.pn_cast_pn_link(x)) when Cproton::CID_pn_delivery then Delivery.wrap(Cproton.pn_cast_pn_delivery(x)) end end public # Call handler.{#method}(self) if handler.respond_to? {#method} # @return [Boolean] true if handler responded to the method, nil if not. def dispatch(handler) (handler.__send__(@method, self); true) if handler.respond_to? @method end # @return [Symbol] method name that this event will call in {#dispatch} attr_accessor :method alias type method # @return [Object] the event context object def context; return @context ||= _context; end # @return [Container, nil] container for this event def container() @container ||= get(Container, :container); end # @return [Transport, nil] transport for this event def transport() @transport ||= get(Transport, :transport); end # @return [Connection, nil] the connection for this event def connection() @connection ||= get(Connection, :connection); end # @return [Session, nil] session for this event def session() @session ||= get(Session, :session); end # @return [Link, nil] link for this event def link() @link ||= get(Link, :link); end # @return [Sender, nil] sender associated with this event def sender() link if link && link.sender?; end # @return [Receiver, nil] receiver associated with this event def receiver() link if link && link.receiver?; end # @return [Delivery, nil] delivery for this event def delivery() @delivery ||= case context when Delivery then @delivery = @context # deprecated: for backwards compat allow a Tracker to be treated as a Delivery when Tracker then @delivery = Delivery.new(context.impl) end end # @return [Tracker, nil] delivery for this event def tracker() @tracker ||= get(Tracker); end # @return [Message, nil] message for this event def message() @message ||= delivery.message if delivery; end def to_s() "#{self.class}(#{method}, #{context})"; end def inspect() "#{self.class}(#{method.inspect}, #{context.inspect})"; end # @return [Condition] Error condition associated with this event or nil if none. def condition (context.remote_condition if context.respond_to? :remote_condition) || (context.condition if context.respond_to? :condition) end # @deprecated use {#container} deprecated_alias :reactor, :container # @private Event = self end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/endpoint.rb0000664000000000000000000000663613257152177021146 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Endpoint is the parent classes for Link and Session. # # It provides a namespace for constant values that relate to the current # state of both links and sessions. # # @example # # conn = Qpid::Proton::Connection.new # puts "Local connection flags : #{conn.state || Qpid::Proton::Endpoint::LOCAL_MASK}" # puts "Remote connection flags: #{conn.state || Qpid::Proton::Endpoint::REMOTE_MASK}" # class Endpoint include Util::Deprecation # The local connection is uninitialized. LOCAL_UNINIT = Cproton::PN_LOCAL_UNINIT # The local connection is active. LOCAL_ACTIVE = Cproton::PN_LOCAL_ACTIVE # The local connection is closed. LOCAL_CLOSED = Cproton::PN_LOCAL_CLOSED # The remote connection is unitialized. REMOTE_UNINIT = Cproton::PN_REMOTE_UNINIT # The remote connection is active. REMOTE_ACTIVE = Cproton::PN_REMOTE_ACTIVE # The remote connection is closed. REMOTE_CLOSED = Cproton::PN_REMOTE_CLOSED # Bitmask for the local-only flags. LOCAL_MASK = Cproton::PN_LOCAL_UNINIT | Cproton::PN_LOCAL_ACTIVE | Cproton::PN_LOCAL_CLOSED # Bitmask for the remote-only flags. REMOTE_MASK = Cproton::PN_REMOTE_UNINIT | Cproton::PN_REMOTE_ACTIVE | Cproton::PN_REMOTE_CLOSED # @private def condition; remote_condition || local_condition; end # @private def remote_condition; Condition.convert(_remote_condition); end # @private def local_condition; Condition.convert(_local_condition); end # Return the transport associated with this endpoint. # # @return [Transport] The transport. # def transport self.connection.transport end # @return [WorkQueue] the work queue for work on this endpoint. def work_queue() connection.work_queue; end # @private # @return [Bool] true if {#state} has all the bits of `mask` set def check_state(mask) (self.state & mask) == mask; end # @return [Bool] true if endpoint has sent and received a CLOSE frame def closed?() check_state(LOCAL_CLOSED | REMOTE_CLOSED); end # @return [Bool] true if endpoint has sent and received an OPEN frame def open?() check_state(LOCAL_ACTIVE | REMOTE_ACTIVE); end def local_uninit? check_state(LOCAL_UNINIT) end def local_open? check_state(LOCAL_ACTIVE) end def local_closed? check_state(LOCAL_CLOSED) end def remote_uninit? check_state(REMOTE_UNINIT) end def remote_open? check_state(REMOTE_ACTIVE) end def remote_closed? check_state(REMOTE_CLOSED) end alias local_active? local_open? alias remote_active? remote_open? end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/disposition.rb0000664000000000000000000000711413257152177021662 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @deprecated use {Delivery} class Disposition include Util::Deprecation # @private PROTON_METHOD_PREFIX = "pn_disposition" # @private extend Util::SWIGClassHelper ACCEPTED = Cproton::PN_ACCEPTED REJECTED = Cproton::PN_REJECTED RELEASED = Cproton::PN_RELEASED MODIFIED = Cproton::PN_MODIFIED RECEIVED = Cproton::PN_RECEIVED attr_reader :impl # @private def initialize(impl, local) deprecated self.class, Delivery @impl = impl @local = local @data = nil @condition = nil @annotations = nil end # @!attribute section_number # # @return [Integer] The section number of the disposition. # proton_set_get :section_number # @!attribute section_offset # # @return [Integer] The section offset of the disposition. # proton_set_get :section_offset # @!attribute failed? # # @return [Boolean] The failed flag. # proton_set_is :failed # @!attribute undeliverable? # # @return [Boolean] The undeliverable flag. # proton_set_is :undeliverable # Sets the data for the disposition. # # @param data [Codec::Data] The data. # # @raise [AttributeError] If the disposition is remote. # def data=(data) raise AttributeError.new("data attribute is read-only") unless @local @data = data end # Returns the data for the disposition. # # @return [Codec::Data] The data. # def data if @local @data else Codec::Data.to_object(Cproton.pn_disposition_data(@impl)) end end # Sets the annotations for the disposition. # # @param annotations [Codec::Data] The annotations. # # @raise [AttributeError] If the disposition is remote. # def annotations=(annotations) raise AttributeError.new("annotations attribute is read-only") unless @local @annotations = annotations end # Returns the annotations for the disposition. # # @return [Codec::Data] The annotations. # def annotations if @local @annotations else Codec::Data.to_object(Cproton.pn_disposition_annotations(@impl)) end end # Sets the condition for the disposition. # # @param condition [Codec::Data] The condition. # # @raise [AttributeError] If the disposition is remote. # def condition=(condition) raise AttributeError.new("condition attribute is read-only") unless @local @condition = condition end # Returns the condition of the disposition. # # @return [Codec::Data] The condition of the disposition. # def condition if @local @condition else Condition.convert(Cproton.pn_disposition_condition(@impl)) end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/delivery.rb0000664000000000000000000000770213257152177021144 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # Allow a {Receiver} to indicate the status of a received message to the {Sender} class Delivery < Transfer def initialize(*args) super; @message = nil; end # @return [Receiver] The parent {Receiver} link. def receiver() link; end # Accept the receiveed message. def accept() settle ACCEPTED; end # Reject a message, indicating to the sender that is invalid and should # never be delivered again to this or any other receiver. def reject() settle REJECTED; end # Release a message, indicating to the sender that it was not processed # but may be delivered again to this or another receiver. # # @param opts [Hash] Instructions to the sender to modify re-delivery. # To allow re-delivery with no modifications at all use +release(nil)+ # # @option opts [Boolean] :failed (true) Instruct the sender to increase # {Message#delivery_count} so future receivers will know there was a # previous failed delivery. # # @option opts [Boolean] :undeliverable (false) Instruct the sender that this # message should never be re-delivered to this receiver, although it may be # delivered other receivers. # # @option opts [Hash] :annotations Instruct the sender to update the # {Message#annotations} with these +key=>value+ pairs before re-delivery, # replacing existing entries in {Message#annotations} with the same key. def release(opts = nil) opts = { :failed => false } if (opts == false) # deprecated failed = !opts || opts.fetch(:failed, true) undeliverable = opts && opts[:undeliverable] annotations = opts && opts[:annotations] annotations = nil if annotations && annotations.empty? if failed || undeliverable || annotations d = Cproton.pn_delivery_local(@impl) Cproton.pn_disposition_set_failed(d, true) if failed Cproton.pn_disposition_set_undeliverable(d, true) if undeliverable Codec::Data.from_object(Cproton.pn_disposition_annotations(d), annotations) if annotations settle(MODIFIED) else settle(RELEASED) end end # @deprecated use {#release} with modification options def modify() deprecated __method__, "release(modification_options)" release failed=>true end # @return [Boolean] True if the transfer was aborted by the sender. proton_caller :aborted? # @return true if the incoming message is complete, call {#message} to retrieve it. def complete?() readable? && !aborted? && !partial?; end # Get the message from the delivery. # @return [Message] The message # @raise [AbortedError] if the message has been aborted (check with {#aborted?} # @raise [UnderflowError] if the message is incomplete (check with {#complete?} # @raise [::ArgumentError] if the delivery is not the current delivery on a receiving link. def message unless @message raise AbortedError, "message aborted by sender" if aborted? raise UnderflowError, "incoming message incomplete" if partial? raise ArgumentError, "no incoming message" unless readable? @message = Message.new @message.decode(link.receive(pending)) link.advance end @message end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/container.rb0000664000000000000000000004251513257152177021304 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'thread' require 'set' require_relative 'listener' require_relative 'work_queue' module Qpid::Proton public # An AMQP container manages a set of {Listener}s and {Connection}s which # contain {#Sender} and {#Receiver} links to transfer messages. Usually, each # AMQP client or server process has a single container for all of its # connections and links. # # One or more threads can call {#run}, events generated by all the listeners and # connections will be dispatched in the {#run} threads. class Container include TimeCompare # Error raised if the container is used after {#stop} has been called. class StoppedError < RuntimeError def initialize(*args) super("container has been stopped"); end end # Create a new Container # @overload initialize(id=nil) # @param id [String,Symbol] A unique ID for this container, use random UUID if nil. # # @overload initialize(handler=nil, id=nil) # @param id [String,Symbol] A unique ID for this container, use random UUID if nil. # @param handler [MessagingHandler] Optional default handler for connections # that do not have their own handler (see {#connect} and {#listen}) # # *Note*: For multi-threaded code, it is recommended to use a separate # handler instance for each connection, as a shared handler may be called # concurrently. # def initialize(*args) @handler, @id, @panic = nil case args.size when 2 then @handler, @id = args when 1 then @id = String.try_convert(args[0]) || (args[0].to_s if args[0].is_a? Symbol) @handler = args[0] unless @id when 0 then else raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 0..2" end # Use an empty messaging adapter to give default behaviour if there's no global handler. @adapter = Handler::Adapter.adapt(@handler) || Handler::MessagingAdapter.new(nil) @id = (@id || SecureRandom.uuid).freeze # Implementation note: # # - #run threads take work items from @work, process them, and rearm them for select # - work items are: ConnectionTask, ListenTask, :start, :select, :schedule # - nil on the @work queue makes a #run thread exit @work = Queue.new @work << :start @work << :select @wake = SelectWaker.new # Wakes #run thread in IO.select @auto_stop = true # Stop when @active drops to 0 @schedule = Schedule.new @schedule_working = false # True if :schedule is on the work queue # Following instance variables protected by lock @lock = Mutex.new @active = 0 # All active tasks, in @selectable, @work or being processed @selectable = Set.new # Tasks ready to block in IO.select @running = 0 # Count of #run threads @stopped = false # #stop called @stop_err = nil # Optional error to pass to tasks, from #stop end # @return [MessagingHandler] The container-wide handler attr_reader :handler # @return [String] unique identifier for this container attr_reader :id # Auto-stop flag. # # True (the default) means that the container will stop automatically, as if {#stop} # had been called, when the last listener or connection closes. # # False means {#run} will not return unless {#stop} is called. # # @return [Bool] auto-stop state attr_accessor :auto_stop # True if the container has been stopped and can no longer be used. # @return [Bool] stopped state attr_accessor :stopped # Number of threads in {#run} # @return [Bool] {#run} thread count def running() @lock.synchronize { @running }; end # Open an AMQP connection. # # @param url [String, URI] Open a {TCPSocket} to url.host, url.port. # url.scheme must be "amqp" or "amqps", url.scheme.nil? is treated as "amqp" # url.user, url.password are used as defaults if opts[:user], opts[:password] are nil # @option (see Connection#open) # @return [Connection] The new AMQP connection def connect(url, opts=nil) not_stopped url = Qpid::Proton::uri url opts ||= {} if url.user || url.password opts[:user] ||= url.user opts[:password] ||= url.password end opts[:ssl_domain] ||= SSLDomain.new(SSLDomain::MODE_CLIENT) if url.scheme == "amqps" connect_io(TCPSocket.new(url.host, url.port), opts) end # Open an AMQP protocol connection on an existing {IO} object # @param io [IO] An existing {IO} object, e.g. a {TCPSocket} # @option (see Connection#open) def connect_io(io, opts=nil) not_stopped cd = connection_driver(io, opts) cd.connection.open() add(cd) cd.connection end # Listen for incoming AMQP connections # # @param url [String,URI] Listen on host:port of the AMQP URL # @param handler [Listener::Handler] A {Listener::Handler} object that will be called # with events for this listener and can generate a new set of options for each one. # @return [Listener] The AMQP listener. # def listen(url, handler=Listener::Handler.new) not_stopped url = Qpid::Proton::uri url # TODO aconway 2017-11-01: amqps, SSL listen_io(TCPServer.new(url.host, url.port), handler) end # Listen for incoming AMQP connections on an existing server socket. # @param io A server socket, for example a {TCPServer} # @param handler [Listener::Handler] Handler for events from this listener # def listen_io(io, handler=Listener::Handler.new) not_stopped l = ListenTask.new(io, handler, self) add(l) l end # Run the container: wait for IO activity, dispatch events to handlers. # # *Multi-threaading* : More than one thread can call {#run} concurrently, # the container will use all {#run} threads as a thread pool. Calls to # {MessagingHandler} or {Listener::Handler} methods are serialized for each # connection or listener. See {WorkQueue} for coordinating with other # threads. # # *Exceptions*: If any handler method raises an exception it will stop the # container, and the exception will be raised by all calls to {#run}. For # single threaded code this is often desirable. Multi-threaded server # applications should normally rescue exceptions in the handler and deal # with them in another way: logging, closing the connection with an error # condition, signalling another thread etc. # # @return [void] Returns when the container stops, see {#stop} and {#auto_stop} # # @raise [StoppedError] If the container has already been stopped when {#run} was called. # # @raise [Exception] If any {MessagingHandler} or {Listener::Handler} managed by # the container raises an exception, that exception will be raised by {#run} # def run @lock.synchronize do @running += 1 # Note: ensure clause below will decrement @running raise StoppedError if @stopped end while task = @work.pop run_one(task, Time.now) end raise @panic if @panic ensure @lock.synchronize do if (@running -= 1) > 0 work_wake nil # Signal the next thread else @adapter.on_container_stop(self) if @adapter.respond_to? :on_container_stop end end end # Stop the container. # # Close all listeners and abort all connections without doing AMQP protocol close. # # {#stop} returns immediately, calls to {#run} will return when all activity # is finished. # # The container can no longer be used, using a stopped container raises # {StoppedError} on attempting. Create a new container if you want to # resume activity. # # @param error [Condition] Optional error condition passed to # {MessagingHandler#on_transport_error} for each connection and # {Listener::Handler::on_error} for each listener. # # @param panic [Exception] Optional exception raised by all concurrent calls # to run() # def stop(error=nil, panic=nil) @lock.synchronize do return if @stopped @stop_err = Condition.convert(error) @panic = panic @stopped = true check_stop_lh # NOTE: @stopped => # - no new run threads can join # - no more select calls after next wakeup # - once @active == 0, all threads will be stopped with nil end @wake.wake end # Schedule code to be executed after a delay. # @param delay [Numeric] delay in seconds, must be >= 0 # @yield [ ] the block is invoked with no parameters in a {#run} thread after +delay+ has elapsed # @return [void] # @raise [ThreadError] if +non_block+ is true and the operation would block def schedule(delay, non_block=false, &block) not_stopped @lock.synchronize { @active += 1 } if @schedule.add(Time.now + delay, non_block, &block) @wake.wake end private def wake() @wake.wake; end # Container driver applies options and adds container context to events class ConnectionTask < Qpid::Proton::HandlerDriver include TimeCompare def initialize container, io, opts, server=false super io, opts[:handler] transport.set_server if server transport.apply opts connection.apply opts @work_queue = WorkQueue.new container connection.instance_variable_set(:@work_queue, @work_queue) end def next_tick() earliest(super, @work_queue.send(:next_tick)); end def process(now) @work_queue.send(:process, now); super(); end def dispatch # Intercept dispatch to close work_queue super @work_queue.send(:close) if read_closed? && write_closed? end end class ListenTask < Listener def initialize(io, handler, container) super @closing = @closed = nil env = ENV['PN_TRACE_EVT'] if env && ["true", "1", "yes", "on"].include?(env.downcase) @log_prefix = "[0x#{object_id.to_s(16)}](PN_LISTENER_" else @log_prefix = nil end dispatch(:on_open); end def process return if @closed unless @closing begin return @io.accept, dispatch(:on_accept) rescue IO::WaitReadable, Errno::EINTR rescue IOError, SystemCallError => e close e end end ensure if @closing @io.close rescue nil @closed = true dispatch(:on_error, @condition) if @condition dispatch(:on_close) end end def can_read?() !finished?; end def can_write?() false; end def finished?() @closed; end def dispatch(method, *args) # TODO aconway 2017-11-27: better logging STDERR.puts "#{@log_prefix}#{([method[3..-1].upcase]+args).join ', '})" if @log_prefix @handler.__send__(method, self, *args) if @handler && @handler.respond_to?(method) end def next_tick() nil; end end # Selectable object that can be used to wake IO.select from another thread class SelectWaker def initialize @rd, @wr = IO.pipe @lock = Mutex.new @set = false end def to_io() @rd; end def wake @lock.synchronize do return if @set # Don't write if already has data @set = true begin @wr.write_nonblock('x') rescue IO::WaitWritable end end end def reset @lock.synchronize do return unless @set begin @rd.read_nonblock(1) rescue IO::WaitReadable end @set = false end end def close @rd.close @wr.close end end # Handle a single item from the @work queue, this is the heart of the #run loop. def run_one(task, now) case task when :start @adapter.on_container_start(self) if @adapter.respond_to? :on_container_start when :select # Compute read/write select sets and minimum next_tick for select timeout r, w = [@wake], [] next_tick = @schedule.next_tick @lock.synchronize do @selectable.each do |s| r << s if s.send :can_read? w << s if s.send :can_write? next_tick = earliest(s.next_tick, next_tick) end end timeout = ((next_tick > now) ? next_tick - now : 0) if next_tick r, w = IO.select(r, w, nil, timeout) now = Time.now unless timeout == 0 @wake.reset if r && r.delete(@wake) # selected is a Set to eliminate duplicates between r, w and next_tick due. selected = Set.new selected.merge(r) if r selected.merge(w) if w @lock.synchronize do if @stopped # close everything @selectable.each { |s| s.close @stop_err; @work << s } @selectable.clear @wake.close return end if !@schedule_working && before_eq(@schedule.next_tick, now) @schedule_working = true @work << :schedule end selected.merge(@selectable.select { |s| before_eq(s.next_tick, now) }) @selectable -= selected # Remove selected tasks from @selectable end selected.each { |s| @work << s } # Queue up tasks needing #process @work << :select # Enable next select when ConnectionTask then maybe_panic { task.process now } rearm task when ListenTask then io, opts = maybe_panic { task.process } add(connection_driver(io, opts, true)) if io rearm task when :schedule then if maybe_panic { @schedule.process now } @lock.synchronize { @active -= 1; check_stop_lh } else @lock.synchronize { @schedule_working = false } end end end def do_select # Compute the sets to select for read and write, and the minimum next_tick for the timeout r, w = [@wake], [] next_tick = nil @lock.synchronize do @selectable.each do |s| r << s if s.can_read? w << s if s.can_write? next_tick = earliest(s.next_tick, next_tick) end end next_tick = earliest(@schedule.next_tick, next_tick) # Do the select and queue up all resulting work now = Time.now timeout = next_tick - now if next_tick r, w = (timeout.nil? || timeout > 0) && IO.select(r, w, nil, timeout) @wake.reset selected = Set.new @lock.synchronize do if @stopped @selectable.each { |s| s.close @stop_err; @work << s } @wake.close return end # Check if schedule has items due and is not already working if !@schedule_working && before_eq(@schedule.next_tick, now) @work << :schedule @schedule_working = true end # Eliminate duplicates between r, w and next_tick due. selected.merge(r) if r selected.delete(@wake) selected.merge(w) if w @selectable -= selected selected.merge(@selectable.select { |s| before_eq(s.next_tick, now) }) @selectable -= selected end selected.each { |s| @work << s } # Queue up tasks needing #process @work << :select end # Rescue any exception raised by the block and stop the container. def maybe_panic begin yield rescue Exception => e stop(nil, e) nil end end # Normally if we add work we need to set a wakeup to ensure a single #run # thread doesn't get stuck in select while there is other work on the queue. def work_wake(task) @work << task @wake.wake end def connection_driver(io, opts=nil, server=false) opts ||= {} opts[:container] = self opts[:handler] ||= @adapter ConnectionTask.new(self, io, opts, server) end # All new tasks are added here def add task @lock.synchronize do @active += 1 task.close @stop_err if @stopped end work_wake task end def rearm task @lock.synchronize do if task.finished? @active -= 1 check_stop_lh elsif @stopped task.close @stop_err work_wake task else @selectable << task end end @wake.wake end def check_stop_lh if @active.zero? && (@auto_stop || @stopped) @stopped = true work_wake nil # Signal threads to stop true end end def not_stopped() raise StoppedError if @lock.synchronize { @stopped }; end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/connection_driver.rb0000664000000000000000000001677013257152177023040 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. require 'socket' module Qpid::Proton # Associate an AMQP {Connection} and {Transport} with an {IO} # # - {#read} reads AMQP binary data from the {IO} and generates events # - {#tick} generates timing-related events # - {#event} gets events to be dispatched to {Handler::MessagingHandler}s # - {#write} writes AMQP binary data to the {IO} # # Thread safety: The {ConnectionDriver} is not thread safe but separate # {ConnectionDriver} instances can be processed concurrently. The # {Container} handles multiple connections concurrently in multiple threads. # class ConnectionDriver # Create a {Connection} and {Transport} associated with +io+ # @param io [IO] An {IO} or {IO}-like object that responds # to {IO#read_nonblock} and {IO#write_nonblock} def initialize(io) @impl = Cproton.pni_connection_driver or raise NoMemoryError @io = io @rbuf = "" # String for re-usable read buffer end # @return [Connection] def connection() @connection ||= Connection.wrap(Cproton.pni_connection_driver_connection(@impl)) end # @return [Transport] def transport() @transport ||= Transport.wrap(Cproton.pni_connection_driver_transport(@impl)) end # @return [IO] Allows ConnectionDriver to be passed directly to {IO#select} def to_io() @io; end # @return [Bool] True if the driver can read more data def can_read?() Cproton.pni_connection_driver_read_size(@impl) > 0; end # @return [Bool] True if the driver has data to write def can_write?() Cproton.pni_connection_driver_write_size(@impl) > 0; end # True if the ConnectionDriver has nothing left to do: both sides of the # transport are closed and there are no events to dispatch. def finished?() Cproton.pn_connection_driver_finished(@impl); end # Get the next event to dispatch, nil if no events available def event() e = Cproton.pn_connection_driver_next_event(@impl) Event.new(e) if e end # True if {#event} will return non-nil def event?() Cproton.pn_connection_driver_has_event(@impl); end # Iterator for all available events def each_event() while e = event yield e end end # Non-blocking read from {#io}, generate events for {#event} # IO errors are returned as transport errors by {#event}, not raised def read size = Cproton.pni_connection_driver_read_size(@impl) return if size <= 0 @io.read_nonblock(size, @rbuf) # Use the same string rbuf for reading each time Cproton.pni_connection_driver_read_copy(@impl, @rbuf) unless @rbuf.empty? rescue Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EINTR # Try again later. rescue EOFError # EOF is not an error close_read rescue IOError, SystemCallError => e close e end # Non-blocking write to {#io} # IO errors are returned as transport errors by {#event}, not raised def write data = Cproton.pn_connection_driver_write_buffer(@impl) return unless data && data.size > 0 n = @io.write_nonblock(data) Cproton.pn_connection_driver_write_done(@impl, n) if n > 0 rescue Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EINTR # Try again later. rescue IOError, SystemCallError => e close e end # Handle time-related work, for example idle-timeout events. # May generate events for {#event} and change {#can_read?}, {#can_write?} # # @param [Time] now the current time, defaults to {Time#now}. # # @return [Time] time of the next scheduled event, or nil if there are no # scheduled events. If non-nil you must call {#tick} again no later than # this time. def tick(now=Time.now) transport = Cproton.pni_connection_driver_transport(@impl) ms = Cproton.pn_transport_tick(transport, (now.to_r * 1000).to_i) @next_tick = ms.zero? ? nil : Time.at(ms.to_r / 1000); unless @next_tick idle = Cproton.pn_transport_get_idle_timeout(transport); @next_tick = now + (idle.to_r / 1000) unless idle.zero? end @next_tick end # Time returned by the last call to {#tick} attr_accessor :next_tick # Disconnect the write side of the transport, *without* sending an AMQP # close frame. To close politely, you should use {Connection#close}, the # transport will close itself once the protocol close is complete. # def close_write error=nil set_error error Cproton.pn_connection_driver_write_close(@impl) @io.close_write rescue nil # Allow double-close end # Is the read side of the driver closed? def read_closed?() Cproton.pn_connection_driver_read_closed(@impl); end # Is the write side of the driver closed? def write_closed?() Cproton.pn_connection_driver_read_closed(@impl); end # Disconnect the read side of the transport, without waiting for an AMQP # close frame. See comments on {#close_write} def close_read error=nil set_error error Cproton.pn_connection_driver_read_close(@impl) @io.close_read rescue nil # Allow double-close end # Disconnect both sides of the transport sending/waiting for AMQP close # frames. See comments on {#close_write} def close error=nil close_write error close_read end private def set_error err transport.condition ||= Condition.convert(err, "proton:io") if err end end # A {ConnectionDriver} that feeds raw proton events to a handler. class HandlerDriver < ConnectionDriver # Combine an {IO} with a handler and provide # a simplified way to run the driver via {#process} # # @param io [IO] # @param handler [Handler::MessagingHandler] to receive raw events in {#dispatch} and {#process} def initialize(io, handler) super(io) @handler = handler @adapter = Handler::Adapter.adapt(handler) end # @return [MessagingHandler] The handler dispatched to by {#process} attr_reader :handler # Dispatch all available raw proton events from {#event} to {#handler} def dispatch() each_event do |e| case e.method # Events that affect the driver when :on_transport_tail_closed then close_read when :on_transport_head_closed then close_write when :on_transport_closed then @io.close rescue nil # Allow double-close end e.dispatch @adapter end end # Do {#read}, {#tick}, {#write} and {#dispatch} without blocking. # @param [Time] now the current time # @return [Time] Latest time to call {#process} again for scheduled events, # or nil if there are no scheduled events def process(now=Time.now) read dispatch next_tick = tick(now) dispatch write dispatch return next_tick end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/connection.rb0000664000000000000000000002526113257152177021460 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # An AMQP connection. class Connection < Endpoint PROTON_METHOD_PREFIX = "pn_connection" include Util::Wrapper include Util::Deprecation # @private def self.wrap(impl) return nil if impl.nil? self.fetch_instance(impl, :pn_connection_attachments) || Connection.new(impl) end # @private def initialize(impl = Cproton.pn_connection) super() @impl = impl @overrides = nil @session_policy = nil @link_count = 0 @link_prefix = "" self.class.store_instance(self, :pn_connection_attachments) end # @return [String] The AMQP hostname for the connection. def virtual_host() Cproton.pn_connection_remote_hostname(@impl); end deprecated_alias :remote_hostname, :virtual_host # @!attribute hostname # @deprecated use {#virtual_host} proton_set_get :hostname # @return [String] User name used for authentication (outgoing connection) # or the authenticated user name (incoming connection) def user() Cproton.pn_connection_get_user(impl) or (connection.transport && connection.transport.user) end # @deprecated no replacement def overrides?() deprecated __method__; false; end # @deprecated no replacement def session_policy?() deprecated __method__; false; end # @return [Connection] self def connection() self; end # @return [Transport, nil] transport bound to this connection, or nil if unbound. def transport() Transport.wrap(Cproton.pn_connection_transport(@impl)); end # @return AMQP container ID advertised by the remote peer. # To get the local container ID use {#container} and {Container#id} def container_id() Cproton.pn_connection_remote_container(@impl); end deprecated_alias :remote_container, :container_id # @return [Container] the container managing this connection attr_reader :container # @return [Array] offered capabilities provided by the remote peer def offered_capabilities Codec::Data.to_object(Cproton.pn_connection_remote_offered_capabilities(@impl)) end deprecated_alias :remote_offered_capabilities, :offered_capabilities # @return [Array] desired capabilities provided by the remote peer def desired_capabilities Codec::Data.to_object(Cproton.pn_connection_remote_desired_capabilities(@impl)) end deprecated_alias :remote_desired_capabilities, :desired_capabilities # @return [Hash] connection-properties provided by the remote peer def properties Codec::Data.to_object(Cproton.pn_connection_remote_properties(@impl)) end deprecated_alias :remote_properties, :properties # Open the local end of the connection. # # @option opts [MessagingHandler] :handler handler for events related to this connection. # # @option opts [String] :user User name for authentication # @option opts [String] :password Authentication secret # @option opts [String] :virtual_host Virtual host name # @option opts [String] :container_id (provided by {Container}) override advertised container-id # # @option opts [HashObject>] :properties Application-defined properties # @option opts [Array] :offered_capabilities Extensions the endpoint supports # @option opts [Array] :desired_capabilities Extensions the endpoint can use # # @option opts [Numeric] :idle_timeout Seconds before closing an idle connection # @option opts [Integer] :max_sessions Limit the number of active sessions # @option opts [Integer] :max_frame_size Limit the size of AMQP frames # # @option opts [Boolean] :sasl_enabled (false) Enable or disable SASL. # @option opts [Boolean] :sasl_allow_insecure_mechs (false) Allow mechanisms send secrets in clear text # @option opts [String] :sasl_allowed_mechs SASL mechanisms allowed by this end of the connection # # @option opts [SSLDomain] :ssl_domain SSL configuration domain. # def open(opts=nil) return if local_active? apply opts if opts Cproton.pn_connection_open(@impl) end # @private def apply opts # NOTE: Only connection options are set here. # Transport options must be applied with {Transport#apply} @container = opts[:container] cid = opts[:container_id] || (@container && @container.id) || SecureRandom.uuid cid = cid.to_s if cid.is_a? Symbol # Allow symbols as container name Cproton.pn_connection_set_container(@impl, cid) Cproton.pn_connection_set_user(@impl, opts[:user]) if opts[:user] Cproton.pn_connection_set_password(@impl, opts[:password]) if opts[:password] Cproton.pn_connection_set_hostname(@impl, opts[:virtual_host]) if opts[:virtual_host] @link_prefix = opts[:link_prefix] || cid Codec::Data.from_object(Cproton.pn_connection_offered_capabilities(@impl), opts[:offered_capabilities]) Codec::Data.from_object(Cproton.pn_connection_desired_capabilities(@impl), opts[:desired_capabilities]) Codec::Data.from_object(Cproton.pn_connection_properties(@impl), opts[:properties]) end # Idle-timeout advertised by the remote peer, in seconds. # @return [Numeric] Idle-timeout advertised by the remote peer, in seconds. # @return [nil] if the peer does not advertise an idle time-out def idle_timeout() if transport && (t = transport.remote_idle_timeout) Rational(t, 1000) # More precise than Float end end # Session limit advertised by the remote peer. See {Connection#open :max_sessions} # @return [Integer] maximum number of sessions per connection allowed by remote peer. # @return [nil] no specific limit is set. def max_sessions() raise StateError, "connection not bound to transport" unless transport max = transport.remote_channel_max return max.zero? ? nil : max end # Maximum frame size, in bytes, advertised by the remote peer. # See {Connection#open :max_frame_size} # @return [Integer] maximum frame size # @return [nil] no limit def max_frame_size() raise StateError, "connection not bound to transport" unless transport max = transport.remote_max_frame return max.zero? ? nil : max end # Closes the local end of the connection. The remote end may or may not be closed. # @param error [Condition] Optional error condition to send with the close. def close(error=nil) Condition.assign(_local_condition, error) Cproton.pn_connection_close(@impl) end # Gets the endpoint current state flags # # @see Endpoint#LOCAL_UNINIT # @see Endpoint#LOCAL_ACTIVE # @see Endpoint#LOCAL_CLOSED # @see Endpoint#LOCAL_MASK # # @return [Integer] The state flags. # def state Cproton.pn_connection_state(@impl) end # Returns the default session for this connection. # # @return [Session] The session. # def default_session @session ||= open_session end # @deprecated use #default_session() deprecated_alias :session, :default_session # Open a new session on this connection. def open_session s = Session.wrap(Cproton.pn_session(@impl)) s.open return s end # Open a sender on the default_session # @option opts (see Session#open_sender) def open_sender(opts=nil) default_session.open_sender(opts) end # Open a on the default_session # @option opts (see Session#open_receiver) def open_receiver(opts=nil) default_session.open_receiver(opts) end # @deprecated use {#each_session} def session_head(mask) deprecated __method__, "#each_session" Session.wrap(Cproton.pn_session_head(@impl, mask)) end # Get the sessions on this connection. # @overload each_session # @yieldparam s [Session] pass each session to block # @overload each_session # @return [Enumerator] enumerator over sessions def each_session(&block) return enum_for(:each_session) unless block_given? s = Cproton.pn_session_head(@impl, 0); while s yield Session.wrap(s) s = Cproton.pn_session_next(s, 0) end self end # @deprecated use {#each_link} def link_head(mask) deprecated __method__, "#each_link" Link.wrap(Cproton.pn_link_head(@impl, mask)) end # Get the links on this connection. # @overload each_link # @yieldparam l [Link] pass each link to block # @overload each_link # @return [Enumerator] enumerator over links def each_link return enum_for(:each_link) unless block_given? l = Cproton.pn_link_head(@impl, 0); while l l2 = l # get next before yield, in case yield closes l and unlinks it l = Cproton.pn_link_next(l, 0) yield Link.wrap(l2) end self end # Get the {Sender} links - see {#each_link} def each_sender() return enum_for(:each_sender) unless block_given? each_link.select { |l| yield l if l.sender? } end # Get the {Receiver} links - see {#each_link} def each_receiver() return enum_for(:each_receiver) unless block_given? each_link.select { |l| yield l if l.receiver? } end # @deprecated use {#MessagingHandler} to handle work def work_head deprecated __method__ Delivery.wrap(Cproton.pn_work_head(@impl)) end # @deprecated use {#condition} def error deprecated __method__, "#condition" Cproton.pn_error_code(Cproton.pn_connection_error(@impl)) end # @private Generate a unique link name, internal use only. def link_name() @link_prefix + "/" + (@link_count += 1).to_s(32) end # @return [WorkQueue] work queue to execute code serialized correctly for this connection attr_reader :work_queue protected def _local_condition Cproton.pn_connection_condition(@impl) end def _remote_condition Cproton.pn_connection_remote_condition(@impl) end proton_get :attachments end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/core/condition.rb0000664000000000000000000000622613257152177021307 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # An AMQP error condition. # # An error sent across an AMQP connection has a name, description and optional extra info. # The {Connectin}, {Session} and {Link} endpoint classes all have a #condition method to # check for errors. # # {Condition} can also be raised as an exception. # class Condition < ProtonError attr_reader :name, :description, :info def initialize(name, description = nil, info = nil) @name = name @description = description @info = info super(to_s) end def to_s() "#{@name}: #{@description}"; end def inspect() "#{self.class.name}(#{@name.inspect}, #{@description.inspect}, #{@info.inspect})"; end def ==(other) ((other.is_a? Condition) && (other.name == self.name) && (other.description == self.description) && (other.info == self.info)) end # Convert an object to a condition. # @param obj the object to turn into a condition # @param default_name name to use if obj does not imply a name # @return [Condition] Conversion depends on the type of obj # - Condition: return obj # - Exception: return Condition(obj.class.name, obj.to_s) # - String-like: return String.try_convert(obj) # - nil: return nil # @raise ::ArgumentError if obj is not convertible to {Condition} def self.convert(obj, default_name="error") case obj when nil then nil when Condition then obj when Exception then Condition.new(obj.class.name, obj.to_s) when SWIG::TYPE_p_pn_condition_t if Cproton.pn_condition_is_set(obj) Condition.new(Cproton.pn_condition_get_name(obj), Cproton.pn_condition_get_description(obj), Codec::Data.to_object(Cproton.pn_condition_info(obj))) end else raise ::ArgumentError, "can't convert #{obj.class.name} to #{self.class.name}" unless obj.respond_to? :to_str Condition.new(default_name, obj.to_str) end end private def self.assign(impl, cond) Cproton.pn_condition_clear(impl) if cond cond = self.convert(cond) Cproton.pn_condition_set_name(impl, cond.name) if cond.name Cproton.pn_condition_set_description(impl, cond.description) if cond.description Codec::Data.from_object(Cproton.pn_condition_info(impl), cond.info) if cond.info end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/codec/0000775000000000000000000000000013257152177017113 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/lib/codec/mapping.rb0000664000000000000000000001335413257152177021101 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton module Codec # Maps between Proton types and their Ruby native language counterparts. # # @private class Mapping attr_reader :code attr_reader :put_method attr_reader :get_method @@by_code = {} @@by_class = {} # Creates a new mapping. # # ==== Arguments # # * code - the AMQP code for this type # * name - the AMQP name for this type # * klasses - native Ruby classes that are mapped to this AMQP type # * getter - overrides the get method for the type def initialize(code, name, klasses = nil, getter = nil) @code = code @name = name @@by_code[code] = self unless klasses.nil? klasses.each do |klass| raise "entry exists for #{klass}" if @@by_class.keys.include? klass @@by_class[klass] = self unless klass.nil? end end @put_method = (name + "=").intern if getter.nil? @get_method = name.intern else @get_method = getter.intern end end def to_s; @name; end def put(data, value) data.__send__(@put_method, value) end def get(data) data.__send__(@get_method) end def self.for_class(klass) c = klass c = c.superclass while c && (x = @@by_class[c]).nil? raise TypeError, "#{klass} cannot be converted to AMQP" unless x x end def self.for_code(code) @@by_code[code] end # Convert x to a Mapping def self.[](x) case x when Mapping then x when Integer then @@by_code[x] when Types::Type then @@by_code[x.code] end end end NULL = Mapping.new(Cproton::PN_NULL, "null", [NilClass]) BOOL = Mapping.new(Cproton::PN_BOOL, "bool", [TrueClass, FalseClass]) UBYTE = Mapping.new(Cproton::PN_UBYTE, "ubyte") BYTE = Mapping.new(Cproton::PN_BYTE, "byte") USHORT = Mapping.new(Cproton::PN_USHORT, "ushort") SHORT = Mapping.new(Cproton::PN_SHORT, "short") UINT = Mapping.new(Cproton::PN_UINT, "uint") INT = Mapping.new(Cproton::PN_INT, "int") CHAR = Mapping.new(Cproton::PN_CHAR, "char") ULONG = Mapping.new(Cproton::PN_ULONG, "ulong") LONG = Mapping.new(Cproton::PN_LONG, "long", [Integer]) TIMESTAMP = Mapping.new(Cproton::PN_TIMESTAMP, "timestamp", [Date, Time]) FLOAT = Mapping.new(Cproton::PN_FLOAT, "float") DOUBLE = Mapping.new(Cproton::PN_DOUBLE, "double", [Float]) DECIMAL32 = Mapping.new(Cproton::PN_DECIMAL32, "decimal32") DECIMAL64 = Mapping.new(Cproton::PN_DECIMAL64, "decimal64") DECIMAL128 = Mapping.new(Cproton::PN_DECIMAL128, "decimal128") UUID = Mapping.new(Cproton::PN_UUID, "uuid") BINARY = Mapping.new(Cproton::PN_BINARY, "binary") STRING = Mapping.new(Cproton::PN_STRING, "string", [::String, Types::UTFString, Types::BinaryString]) SYMBOL = Mapping.new(Cproton::PN_SYMBOL, "symbol", [::Symbol]) DESCRIBED = Mapping.new(Cproton::PN_DESCRIBED, "described", [Types::Described]) ARRAY = Mapping.new(Cproton::PN_ARRAY, "array", [Types::UniformArray]) LIST = Mapping.new(Cproton::PN_LIST, "list", [::Array]) MAP = Mapping.new(Cproton::PN_MAP, "map", [::Hash]) private class << STRING def put(data, value) # if we have a symbol then convert it to a string value = value.to_s if value.is_a?(Symbol) isutf = false if value.is_a?(Types::UTFString) isutf = true else # For Ruby 1.8 we will just treat all strings as binary. # For Ruby 1.9+ we can check the encoding first to see what it is if RUBY_VERSION >= "1.9" # If the string is ASCII-8BIT then treat is as binary. Otherwise, # try to convert it to UTF-8 and, if successful, send as that. if value.encoding != Encoding::ASCII_8BIT && value.encode(Encoding::UTF_8).valid_encoding? isutf = true end end end data.string = value if isutf data.binary = value if !isutf end end class << MAP def put(data, map, options = {}) data.put_map data.enter map.each_pair do |key, value| if options[:keys] == :SYMBOL SYMBOL.put(data, key) else data.object = key end if value.nil? data.null else data.object = value end end data.exit end end class << DESCRIBED def put(data, described) data.put_described data.enter data.object = described.descriptor data.object = described.value data.exit end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/lib/codec/data.rb0000664000000000000000000004466213257152177020365 0ustar # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. module Qpid::Proton # @private module Codec DataError = ::TypeError # @private wrapper for pn_data_t* # Raises TypeError for invalid conversions class Data # @private PROTON_METHOD_PREFIX = "pn_data" # @private include Util::Wrapper # @private # Convert a pn_data_t* containing a single value to a ruby object. # @return [Object, nil] The ruby value extracted from +impl+ or nil if impl is empty def self.to_object(impl) if (Cproton.pn_data_size(impl) > 0) d = Data.new(impl) d.rewind d.next_object end end # @private # Clear a pn_data_t* and convert a ruby object into it. If x==nil leave it empty. def self.from_object(impl, x) d = Data.new(impl) d.clear d.object = x if x nil end # @overload initialize(capacity) # @param capacity [Integer] capacity for the new data instance. # @overload instance(impl) # @param impl [SWIG::pn_data_t*] wrap the C impl pointer. def initialize(capacity = 16) if capacity.is_a?(Integer) @impl = Cproton.pn_data(capacity.to_i) @free = true else # Assume non-integer capacity is a SWIG::pn_data_t* @impl = capacity @free = false end # destructor ObjectSpace.define_finalizer(self, self.class.finalize!(@impl, @free)) end # @private def self.finalize!(impl, free) proc { Cproton.pn_data_free(impl) if free } end proton_caller :clear, :rewind, :next, :prev, :enter, :exit def enter_exit() enter yield self ensure exit end def code() Cproton.pn_data_type(@impl); end def type() Mapping.for_code(Cproton.pn_data_type(@impl)); end # Returns a representation of the data encoded in AMQP format. def encode buffer = "\0"*1024 loop do cd = Cproton.pn_data_encode(@impl, buffer, buffer.length) if cd == Cproton::PN_OVERFLOW buffer *= 2 elsif cd >= 0 return buffer[0...cd] else check(cd) end end end # Decodes the first value from supplied AMQP data and returns the number # of bytes consumed. # # @param encoded [String] The encoded data. def decode(encoded) check(Cproton.pn_data_decode(@impl, encoded, encoded.length)) end proton_is :described, :array_described proton_caller :put_described proton_caller :put_list, :get_list, :put_map, :get_map proton_get :array_type proton_caller :put_array def get_array() [Cproton.pn_data_get_array(@impl), array_described?, array_type]; end def expect(code) unless code == self.code raise TypeError, "expected #{Cproton.pn_type_name(code)}, got #{Cproton.pn_type_name(self.code)}" end end def described expect Cproton::PN_DESCRIBED enter_exit { Types::Described.new(self.next_object, self.next_object) } end def described= d put_described enter_exit { self << d.descriptor << d.value } end def fill(a, count, what) a << self.object while self.next raise TypeError, "#{what} expected #{count} elements, got #{a.size}" unless a.size == count a end def list return array if code == Cproton::PN_ARRAY expect Cproton::PN_LIST count = get_list a = [] enter_exit { fill(a, count, __method__) } end def list=(a) put_list enter_exit { a.each { |x| self << x } } end def array return list if code == Cproton::PN_LIST expect Cproton::PN_ARRAY count, d, t = get_array enter_exit do desc = next_object if d a = Types::UniformArray.new(t, nil, desc) fill(a, count, "array") end end def array=(a) t = a.type if a.respond_to? :type d = a.descriptor if a.respond_to? :descriptor if (h = a.instance_variable_get(:@proton_array_header)) t ||= h.type d ||= h.descriptor end raise TypeError, "no type when converting #{a.class} to an array" unless t put_array(!d.nil?, t.code) m = Mapping[t] enter_exit do self << d unless d.nil? a.each { |e| m.put(self, e); } end end def map expect Cproton::PN_MAP count = self.get_map raise TypeError, "invalid map, total of keys and values is odd" if count.odd? enter_exit do m = {} m[object] = next_object while self.next raise TypeError, "map expected #{count/2} entries, got #{m.size}" unless m.size == count/2 m end end def map= m put_map enter_exit { m.each_pair { |k,v| self << k << v } } end # Return nil if vallue is null, raise exception otherwise. def null() raise TypeError, "expected null, got #{type || 'empty'}" unless null?; end # Set the current value to null def null=(dummy=nil) check(Cproton.pn_data_put_null(@impl)); end # Puts an arbitrary object type. # # The Data instance will determine which AMQP type is appropriate and will # use that to encode the object. # # @param object [Object] The value. # def object=(object) Mapping.for_class(object.class).put(self, object) object end # Add an arbitrary data value using object=, return self def <<(x) self.object=x; self; end # Move forward to the next value and return it def next_object self.next or raise TypeError, "not enough data" self.object end # Gets the current node, based on how it was encoded. # # @return [Object] The current node. # def object self.type.get(self) if self.type end # Checks if the current node is null. # # @return [Boolean] True if the node is null. # def null? Cproton.pn_data_is_null(@impl) end # Puts a boolean value. # # @param value [Boolean] The boolean value. # def bool=(value) check(Cproton.pn_data_put_bool(@impl, value)) end # If the current node is a boolean, then it returns the value. Otherwise, # it returns false. # # @return [Boolean] The boolean value. # def bool Cproton.pn_data_get_bool(@impl) end # Puts an unsigned byte value. # # @param value [Integer] The unsigned byte value. # def ubyte=(value) check(Cproton.pn_data_put_ubyte(@impl, value)) end # If the current node is an unsigned byte, returns its value. Otherwise, # it returns 0. # # @return [Integer] The unsigned byte value. # def ubyte Cproton.pn_data_get_ubyte(@impl) end # Puts a byte value. # # @param value [Integer] The byte value. # def byte=(value) check(Cproton.pn_data_put_byte(@impl, value)) end # If the current node is an byte, returns its value. Otherwise, # it returns 0. # # @return [Integer] The byte value. # def byte Cproton.pn_data_get_byte(@impl) end # Puts an unsigned short value. # # @param value [Integer] The unsigned short value # def ushort=(value) check(Cproton.pn_data_put_ushort(@impl, value)) end # If the current node is an unsigned short, returns its value. Otherwise, # it returns 0. # # @return [Integer] The unsigned short value. # def ushort Cproton.pn_data_get_ushort(@impl) end # Puts a short value. # # @param value [Integer] The short value. # def short=(value) check(Cproton.pn_data_put_short(@impl, value)) end # If the current node is a short, returns its value. Otherwise, # returns a 0. # # @return [Integer] The short value. # def short Cproton.pn_data_get_short(@impl) end # Puts an unsigned integer value. # # @param value [Integer] the unsigned integer value # def uint=(value) raise TypeError if value.nil? raise RangeError, "invalid uint: #{value}" if value < 0 check(Cproton.pn_data_put_uint(@impl, value)) end # If the current node is an unsigned int, returns its value. Otherwise, # returns 0. # # @return [Integer] The unsigned integer value. # def uint Cproton.pn_data_get_uint(@impl) end # Puts an integer value. # # ==== Options # # * value - the integer value def int=(value) check(Cproton.pn_data_put_int(@impl, value)) end # If the current node is an integer, returns its value. Otherwise, # returns 0. # # @return [Integer] The integer value. # def int Cproton.pn_data_get_int(@impl) end # Puts a character value. # # @param value [Integer] The character value. # def char=(value) check(Cproton.pn_data_put_char(@impl, value)) end # If the current node is a character, returns its value. Otherwise, # returns 0. # # @return [Integer] The character value. # def char Cproton.pn_data_get_char(@impl) end # Puts an unsigned long value. # # @param value [Integer] The unsigned long value. # def ulong=(value) raise TypeError if value.nil? raise RangeError, "invalid ulong: #{value}" if value < 0 check(Cproton.pn_data_put_ulong(@impl, value)) end # If the current node is an unsigned long, returns its value. Otherwise, # returns 0. # # @return [Integer] The unsigned long value. # def ulong Cproton.pn_data_get_ulong(@impl) end # Puts a long value. # # @param value [Integer] The long value. # def long=(value) check(Cproton.pn_data_put_long(@impl, value)) end # If the current node is a long, returns its value. Otherwise, returns 0. # # @return [Integer] The long value. def long Cproton.pn_data_get_long(@impl) end # Puts a timestamp value. # # @param value [Integer] The timestamp value. # def timestamp=(value) value = value.to_i if (!value.nil? && value.is_a?(Time)) check(Cproton.pn_data_put_timestamp(@impl, value)) end # If the current node is a timestamp, returns its value. Otherwise, # returns 0. # # @return [Integer] The timestamp value. # def timestamp Cproton.pn_data_get_timestamp(@impl) end # Puts a float value. # # @param value [Float] The floating point value. # def float=(value) check(Cproton.pn_data_put_float(@impl, value)) end # If the current node is a float, returns its value. Otherwise, # returns 0. # # @return [Float] The floating point value. # def float Cproton.pn_data_get_float(@impl) end # Puts a double value. # # @param value [Float] The double precision floating point value. # def double=(value) check(Cproton.pn_data_put_double(@impl, value)) end # If the current node is a double, returns its value. Otherwise, # returns 0. # # @return [Float] The double precision floating point value. # def double Cproton.pn_data_get_double(@impl) end # Puts a decimal32 value. # # @param value [Integer] The decimal32 value. # def decimal32=(value) check(Cproton.pn_data_put_decimal32(@impl, value)) end # If the current node is a decimal32, returns its value. Otherwise, # returns 0. # # @return [Integer] The decimal32 value. # def decimal32 Cproton.pn_data_get_decimal32(@impl) end # Puts a decimal64 value. # # @param value [Integer] The decimal64 value. # def decimal64=(value) check(Cproton.pn_data_put_decimal64(@impl, value)) end # If the current node is a decimal64, returns its value. Otherwise, # it returns 0. # # @return [Integer] The decimal64 value. # def decimal64 Cproton.pn_data_get_decimal64(@impl) end # Puts a decimal128 value. # # @param value [Integer] The decimal128 value. # def decimal128=(value) raise TypeError, "invalid decimal128 value: #{value}" if value.nil? value = value.to_s(16).rjust(32, "0") bytes = [] value.scan(/(..)/) {|v| bytes << v[0].to_i(16)} check(Cproton.pn_data_put_decimal128(@impl, bytes)) end # If the current node is a decimal128, returns its value. Otherwise, # returns 0. # # @return [Integer] The decimal128 value. # def decimal128 value = "" Cproton.pn_data_get_decimal128(@impl).each{|val| value += ("%02x" % val)} value.to_i(16) end # Puts a +UUID+ value. # # The UUID is expected to be in the format of a string or else a 128-bit # integer value. # # @param value [String, Numeric] A string or numeric representation of the UUID. # # @example # # # set a uuid value from a string value # require 'securerandom' # @impl.uuid = SecureRandom.uuid # # # or # @impl.uuid = "fd0289a5-8eec-4a08-9283-81d02c9d2fff" # # # set a uuid value from a 128-bit value # @impl.uuid = 0 # sets to 00000000-0000-0000-0000-000000000000 # def uuid=(value) raise ::ArgumentError, "invalid uuid: #{value}" if value.nil? # if the uuid that was submitted was numeric value, then translated # it into a hex string, otherwise assume it was a string represtation # and attempt to decode it if value.is_a? Numeric value = "%032x" % value else raise ::ArgumentError, "invalid uuid: #{value}" if !valid_uuid?(value) value = (value[0, 8] + value[9, 4] + value[14, 4] + value[19, 4] + value[24, 12]) end bytes = [] value.scan(/(..)/) {|v| bytes << v[0].to_i(16)} check(Cproton.pn_data_put_uuid(@impl, bytes)) end # If the current value is a +UUID+, returns its value. Otherwise, # it returns nil. # # @return [String] The string representation of the UUID. # def uuid value = "" Cproton.pn_data_get_uuid(@impl).each{|val| value += ("%02x" % val)} value.insert(8, "-").insert(13, "-").insert(18, "-").insert(23, "-") end # Puts a binary value. # # A binary string is encoded as an ASCII 8-bit string value. This is in # contranst to other strings, which are treated as UTF-8 encoded. # # @param value [String] An arbitrary string value. # # @see #string= # def binary=(value) check(Cproton.pn_data_put_binary(@impl, value)) end # If the current node is binary, returns its value. Otherwise, it returns # an empty string (""). # # @return [String] The binary string. # # @see #string # def binary Qpid::Proton::Types::BinaryString.new(Cproton.pn_data_get_binary(@impl)) end # Puts a UTF-8 encoded string value. # # *NOTE:* A nil value is stored as an empty string rather than as a nil. # # @param value [String] The UTF-8 encoded string value. # # @see #binary= # def string=(value) check(Cproton.pn_data_put_string(@impl, value)) end # If the current node is a string, returns its value. Otherwise, it # returns an empty string (""). # # @return [String] The UTF-8 encoded string. # # @see #binary # def string Qpid::Proton::Types::UTFString.new(Cproton.pn_data_get_string(@impl)) end # Puts a symbolic value. # # @param value [String|Symbol] The symbolic string value. # def symbol=(value) check(Cproton.pn_data_put_symbol(@impl, value.to_s)) end # If the current node is a symbol, returns its value. Otherwise, it # returns an empty string (""). # # @return [Symbol] The symbol value. # def symbol Cproton.pn_data_get_symbol(@impl).to_sym end # Get the current value as a single object. # # @return [Object] The current node's object. # # @see #type_code # @see #type # def get type.get(self); end # Puts a new value with the given type into the current node. # # @param value [Object] The value. # @param type_code [Mapping] The value's type. # # @private # def put(value, type_code); type_code.put(self, value); end private def valid_uuid?(value) # ensure that the UUID is in the right format # xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx value =~ /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/ end # @private def check(err) if err < 0 raise TypeError, "[#{err}]: #{Cproton.pn_data_error(@impl)}" else return err end end end end end qpid-proton-0.22.0/proton-c/bindings/ruby/ext/0000775000000000000000000000000013257152177016070 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/ext/cproton/0000775000000000000000000000000013257152177017554 5ustar qpid-proton-0.22.0/proton-c/bindings/ruby/ext/cproton/extconf.rb0000664000000000000000000000271113257152177021550 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require 'mkmf' # set the ruby version compiler flag runtime_version = RUBY_VERSION.gsub(/\./,'')[0,2] $CFLAGS << " -DRUBY#{runtime_version}" dir_config("qpid-proton") REQUIRED_LIBRARIES = [ "qpid-proton", ] REQUIRED_LIBRARIES.each do |library| abort "Missing library: #{library}" unless have_library library end REQUIRED_HEADERS = [ "proton/engine.h", "proton/message.h", "proton/sasl.h", "proton/messenger.h" ] REQUIRED_HEADERS.each do |header| abort "Missing header: #{header}" unless have_header header end create_makefile('cproton') qpid-proton-0.22.0/proton-c/bindings/ruby/cproton.i0000664000000000000000000003773113257152177017141 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ %module cproton %{ #include #include #include #include #include #include #include #include #include #include %} /* NOTE: According to ccache-swig man page: "Known problems are using preprocessor directives within %inline blocks and the use of ’#pragma SWIG’." This includes using macros in an %inline section. Keep preprocessor directives and macro expansions in the normal header section. */ %include %cstring_output_withsize(char *OUTPUT, size_t *OUTPUT_SIZE) %cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1)); %cstring_output_maxsize(char *OUTPUT, size_t MAX_OUTPUT_SIZE) %{ #if !defined(RSTRING_LEN) # define RSTRING_LEN(x) (RSTRING(x)->len) # define RSTRING_PTR(x) (RSTRING(x)->ptr) #endif %} %typemap(in) pn_bytes_t { if ($input == Qnil) { $1.start = NULL; $1.size = 0; } else { $1.start = RSTRING_PTR($input); if (!$1.start) { $1.size = 0; } $1.size = RSTRING_LEN($input); } } %typemap(out) pn_bytes_t { $result = rb_str_new($1.start, $1.size); } %typemap(in) pn_atom_t { if ($input == Qnil) { $1.type = PN_NULL; } else { switch(TYPE($input)) { case T_TRUE: $1.type = PN_BOOL; $1.u.as_bool = true; break; case T_FALSE: $1.type = PN_BOOL; $1.u.as_bool = false; break; case T_FLOAT: $1.type = PN_FLOAT; $1.u.as_float = NUM2DBL($input); break; case T_STRING: $1.type = PN_STRING; $1.u.as_bytes.start = RSTRING_PTR($input); if ($1.u.as_bytes.start) { $1.u.as_bytes.size = RSTRING_LEN($input); } else { $1.u.as_bytes.size = 0; } break; case T_FIXNUM: $1.type = PN_INT; $1.u.as_int = FIX2LONG($input); break; case T_BIGNUM: $1.type = PN_LONG; $1.u.as_long = NUM2LL($input); break; } } } %typemap(out) pn_atom_t { switch($1.type) { case PN_NULL: $result = Qnil; break; case PN_BOOL: $result = $1.u.as_bool ? Qtrue : Qfalse; break; case PN_BYTE: $result = INT2NUM($1.u.as_byte); break; case PN_UBYTE: $result = UINT2NUM($1.u.as_ubyte); break; case PN_SHORT: $result = INT2NUM($1.u.as_short); break; case PN_USHORT: $result = UINT2NUM($1.u.as_ushort); break; case PN_INT: $result = INT2NUM($1.u.as_int); break; case PN_UINT: $result = UINT2NUM($1.u.as_uint); break; case PN_LONG: $result = LL2NUM($1.u.as_long); break; case PN_ULONG: $result = ULL2NUM($1.u.as_ulong); break; case PN_FLOAT: $result = rb_float_new($1.u.as_float); break; case PN_DOUBLE: $result = rb_float_new($1.u.as_double); break; case PN_STRING: $result = rb_str_new($1.u.as_bytes.start, $1.u.as_bytes.size); break; default: break; } } %typemap (in) pn_decimal32_t { $1 = NUM2UINT($input); } %typemap (out) pn_decimal32_t { $result = UINT2NUM($1); } %typemap (in) pn_decimal64_t { $1 = NUM2ULL($input); } %typemap (out) pn_decimal64_t { $result = ULL2NUM($1); } %typemap (in) pn_decimal128_t { int index; for(index = 0; index < 16; index++) { VALUE element = rb_ary_entry($input, index); $1.bytes[16 - (index + 1)] = FIX2INT(element); } } %typemap (out) pn_decimal128_t { int index; $result = rb_ary_new2(16); for(index = 0; index < 16; index++) { rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index])); } } %typemap (in) pn_uuid_t { int index; for(index = 0; index < 16; index++) { VALUE element = rb_ary_entry($input, index); $1.bytes[16 - (index + 1)] = FIX2INT(element); } } %typemap (out) pn_uuid_t { int index; $result = rb_ary_new2(16); for(index = 0; index < 16; index++) { rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index])); } } int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE); %ignore pn_message_encode; ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH); %ignore pn_link_send; %rename(pn_link_recv) wrap_pn_link_recv; %inline %{ int wrap_pn_link_recv(pn_link_t *link, char *OUTPUT, size_t *OUTPUT_SIZE) { ssize_t sz = pn_link_recv(link, OUTPUT, *OUTPUT_SIZE); if (sz >= 0) { *OUTPUT_SIZE = sz; } else { *OUTPUT_SIZE = 0; } return sz; } %} %ignore pn_link_recv; ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGTH); %ignore pn_transport_input; %rename(pn_transport_output) wrap_pn_transport_output; %inline %{ int wrap_pn_transport_output(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) { ssize_t sz = pn_transport_output(transport, OUTPUT, *OUTPUT_SIZE); if (sz >= 0) { *OUTPUT_SIZE = sz; } else { *OUTPUT_SIZE = 0; } return sz; } %} %ignore pn_transport_output; %rename(pn_transport_peek) wrap_pn_transport_peek; %inline %{ int wrap_pn_transport_peek(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) { ssize_t sz = pn_transport_peek(transport, OUTPUT, *OUTPUT_SIZE); if(sz >= 0) { *OUTPUT_SIZE = sz; } else { *OUTPUT_SIZE = 0; } return sz; } %} %ignore pn_transport_peek; %rename(pn_delivery) wrap_pn_delivery; %inline %{ pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) { return pn_delivery(link, pn_dtag(STRING, LENGTH)); } %} %ignore pn_delivery; // Suppress "Warning(451): Setting a const char * variable may leak memory." on pn_delivery_tag_t %warnfilter(451) pn_delivery_tag_t; %rename(pn_delivery_tag) wrap_pn_delivery_tag; %inline %{ void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) { pn_delivery_tag_t tag = pn_delivery_tag(delivery); *ALLOC_OUTPUT = malloc(tag.size); *ALLOC_SIZE = tag.size; memcpy(*ALLOC_OUTPUT, tag.start, tag.size); } %} %ignore pn_delivery_tag; bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE); %ignore pn_ssl_get_cipher_name; bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE); %ignore pn_ssl_get_protocol_name; /* TODO aconway 2018-02-14: Remove RB_BLOCKING_CALL once messenger is deprecated */ /* Don't use %inline sections for #define */ %{ #if defined(RUBY_USE_rb_thread_call_without_gvl) #include typedef void *non_blocking_return_t; #define RB_BLOCKING_CALL (VALUE)rb_thread_call_without_gvl #elif defined(RUBY_USE_rb_thread_blocking_region) typedef VALUE non_blocking_return_t; #define RB_BLOCKING_CALL rb_thread_blocking_region #endif %} %rename(pn_messenger_send) wrap_pn_messenger_send; %rename(pn_messenger_recv) wrap_pn_messenger_recv; %rename(pn_messenger_work) wrap_pn_messenger_work; %inline %{ #if defined(RB_BLOCKING_CALL) static non_blocking_return_t pn_messenger_send_no_gvl(void *args) { VALUE result = Qnil; pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0]; int *limit = (int *)((void **)args)[1]; int rc = pn_messenger_send(messenger, *limit); result = INT2NUM(rc); return (non_blocking_return_t )result; } static non_blocking_return_t pn_messenger_recv_no_gvl(void *args) { VALUE result = Qnil; pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0]; int *limit = (int *)((void **)args)[1]; int rc = pn_messenger_recv(messenger, *limit); result = INT2NUM(rc); return (non_blocking_return_t )result; } static non_blocking_return_t pn_messenger_work_no_gvl(void *args) { VALUE result = Qnil; pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0]; int *timeout = (int *)((void **)args)[1]; int rc = pn_messenger_work(messenger, *timeout); result = INT2NUM(rc); return (non_blocking_return_t )result; } #endif int wrap_pn_messenger_send(pn_messenger_t *messenger, int limit) { int result = 0; #if defined(RB_BLOCKING_CALL) // only release the gil if we're blocking if(pn_messenger_is_blocking(messenger)) { VALUE rc; void* args[2]; args[0] = messenger; args[1] = &limit; rc = RB_BLOCKING_CALL(pn_messenger_send_no_gvl, &args, RUBY_UBF_PROCESS, NULL); if(RTEST(rc)) { result = FIX2INT(rc); } } #else // !defined(RB_BLOCKING_CALL) result = pn_messenger_send(messenger, limit); #endif // defined(RB_BLOCKING_CALL) return result; } int wrap_pn_messenger_recv(pn_messenger_t *messenger, int limit) { int result = 0; #if defined(RB_BLOCKING_CALL) // only release the gil if we're blocking if(pn_messenger_is_blocking(messenger)) { VALUE rc; void* args[2]; args[0] = messenger; args[1] = &limit; rc = RB_BLOCKING_CALL(pn_messenger_recv_no_gvl, &args, RUBY_UBF_PROCESS, NULL); if(RTEST(rc)) { result = FIX2INT(rc); } } else { result = pn_messenger_recv(messenger, limit); } #else // !defined(RB_BLOCKING_CALL) result = pn_messenger_recv(messenger, limit); #endif // defined(RB_BLOCKING_CALL) return result; } int wrap_pn_messenger_work(pn_messenger_t *messenger, int timeout) { int result = 0; #if defined(RB_BLOCKING_CALL) // only release the gil if we're blocking if(timeout) { VALUE rc; void* args[2]; args[0] = messenger; args[1] = &timeout; rc = RB_BLOCKING_CALL(pn_messenger_work_no_gvl, &args, RUBY_UBF_PROCESS, NULL); if(RTEST(rc)) { result = FIX2INT(rc); } } else { result = pn_messenger_work(messenger, timeout); } #else result = pn_messenger_work(messenger, timeout); #endif return result; } %} %ignore pn_messenger_send; %ignore pn_messenger_recv; %ignore pn_messenger_work; %{ typedef struct Pn_rbkey_t { void *registry; char *method; char *key_value; } Pn_rbkey_t; void Pn_rbkey_initialize(void *vp_rbkey) { Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_rbkey; assert(rbkey); rbkey->registry = NULL; rbkey->method = NULL; rbkey->key_value = NULL; } void Pn_rbkey_finalize(void *vp_rbkey) { Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_rbkey; if(rbkey && rbkey->registry && rbkey->method && rbkey->key_value) { rb_funcall((VALUE )rbkey->registry, rb_intern(rbkey->method), 1, rb_str_new2(rbkey->key_value)); } if(rbkey->key_value) { free(rbkey->key_value); rbkey->key_value = NULL; } } /* NOTE: no macro or preprocessor definitions in %inline sections */ #define CID_Pn_rbkey CID_pn_void #define Pn_rbkey_inspect NULL #define Pn_rbkey_compare NULL #define Pn_rbkey_hashcode NULL pn_class_t* Pn_rbkey__class(void) { static pn_class_t clazz = PN_CLASS(Pn_rbkey); return &clazz; } Pn_rbkey_t *Pn_rbkey_new(void) { return (Pn_rbkey_t *) pn_class_new(Pn_rbkey__class(), sizeof(Pn_rbkey_t)); } %} pn_class_t* Pn_rbkey__class(void); Pn_rbkey_t *Pn_rbkey_new(void); %inline %{ Pn_rbkey_t *Pn_rbkey_new(void); void Pn_rbkey_set_registry(Pn_rbkey_t *rbkey, void *registry) { assert(rbkey); rbkey->registry = registry; } void *Pn_rbkey_get_registry(Pn_rbkey_t *rbkey) { assert(rbkey); return rbkey->registry; } void Pn_rbkey_set_method(Pn_rbkey_t *rbkey, char *method) { assert(rbkey); rbkey->method = method; } char *Pn_rbkey_get_method(Pn_rbkey_t *rbkey) { assert(rbkey); return rbkey->method; } void Pn_rbkey_set_key_value(Pn_rbkey_t *rbkey, char *key_value) { assert(rbkey); rbkey->key_value = malloc(strlen(key_value) + 1); strncpy(rbkey->key_value, key_value, strlen(key_value) + 1); } char *Pn_rbkey_get_key_value(Pn_rbkey_t *rbkey) { assert(rbkey); return rbkey->key_value; } Pn_rbkey_t *pni_void2rbkey(void *object) { return (Pn_rbkey_t *)object; } VALUE pn_void2rb(void *object) { return (VALUE )object; } void *pn_rb2void(VALUE object) { return (void *)object; } VALUE pni_address_of(void *object) { return ULL2NUM((unsigned long )object); } %} int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *OUTPUT, size_t *OUTPUT_SIZE); %ignore pn_ssl_get_peer_hostname; %inline %{ VALUE pni_ruby_get_proton_module() { VALUE mQpid = rb_define_module("Qpid"); return rb_define_module_under(mQpid, "Proton"); } void pni_ruby_add_to_registry(VALUE key, VALUE value) { VALUE result = rb_funcall(pni_ruby_get_proton_module(), rb_intern("add_to_registry"), 2, key, value); } VALUE pni_ruby_get_from_registry(VALUE key) { return rb_funcall(pni_ruby_get_proton_module(), rb_intern("get_from_registry"), 1, key); } void pni_ruby_delete_from_registry(VALUE stored_key) { rb_funcall(pni_ruby_get_proton_module(), rb_intern("delete_from_registry"), 1, stored_key); } typedef struct { VALUE handler_key; } Pni_rbhandler_t; static Pni_rbhandler_t *pni_rbhandler(pn_handler_t *handler) { return (Pni_rbhandler_t *) pn_handler_mem(handler); } static void pni_rbdispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { Pni_rbhandler_t *rbh = pni_rbhandler(handler); VALUE rbhandler = pni_ruby_get_from_registry(rbh->handler_key); rb_funcall(rbhandler, rb_intern("dispatch"), 2, SWIG_NewPointerObj(event, SWIGTYPE_p_pn_event_t, 0), INT2FIX(type)); } static void pni_rbhandler_finalize(pn_handler_t *handler) { Pni_rbhandler_t *rbh = pni_rbhandler(handler); pni_ruby_delete_from_registry(rbh->handler_key); } pn_handler_t *pn_rbhandler(VALUE handler) { pn_handler_t *chandler = pn_handler_new(pni_rbdispatch, sizeof(Pni_rbhandler_t), pni_rbhandler_finalize); Pni_rbhandler_t *rhy = pni_rbhandler(chandler); VALUE ruby_key = rb_class_new_instance(0, NULL, rb_cObject); pni_ruby_add_to_registry(ruby_key, handler); rhy->handler_key = ruby_key; return chandler; } /* Helpers for working with pn_connection_driver_t */ size_t pni_connection_driver_read_size(pn_connection_driver_t* d) { return pn_connection_driver_read_buffer(d).size; } size_t pni_connection_driver_write_size(pn_connection_driver_t* d) { return pn_connection_driver_write_buffer(d).size; } pn_connection_t *pni_connection_driver_connection(pn_connection_driver_t* d) { return d->connection; } pn_transport_t *pni_connection_driver_transport(pn_connection_driver_t* d) { return d->transport; } size_t pni_connection_driver_read_copy(pn_connection_driver_t* d, char *STRING, size_t LENGTH ) { pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(d); size_t n = LENGTH < rbuf.size ? LENGTH : rbuf.size; memcpy(rbuf.start, STRING, n); pn_connection_driver_read_done(d, n); return n; } pn_connection_driver_t *pni_connection_driver() { pn_connection_driver_t *d = (pn_connection_driver_t*)malloc(sizeof(*d)); if (pn_connection_driver_init(d, NULL, NULL) != 0) { free(d); return NULL; } return d; } %} %include "proton/cproton.i" qpid-proton-0.22.0/proton-c/bindings/ruby/changelog.rb0000775000000000000000000000137513257152177017555 0ustar #!/bin/env ruby # # Generate a changelog from git history. # - Assume each version has a 0.0[.0] tag # - Write the subject line from each commit with a JIRA number that touches files under this dir # if ARGV.size != 2 STDERR.puts "Usage: #{$0} " end rubydir = ARGV[0] outfile = ARGV[1] version_re = /^[0-9]+(\.[0-9]+)+$/ releases = `git tag --sort=-creatordate`.split.select { |t| version_re.match(t) } exit(1) unless $?.success? def tag(x) x ? "tags/#{x}" : ""; end changelog="" while r = releases.shift do changelog << "\nversion #{r}:\n" p = releases[0] changelog << `git log --grep='^PROTON-' #{tag(p)}..#{tag(r)} --format=' * %s' -- #{rubydir}` exit(1) unless $?.success? end File.open(outfile, "w") { |f| f.puts(changelog) } qpid-proton-0.22.0/proton-c/bindings/ruby/TODO0000664000000000000000000000053113257152177015757 0ustar Proton Ruby bindings TODO List ======================================================================== You can find the list of bugs and enhacements to be fixed at: https://issues.apache.org/jira/issues/?jql=project%20%3D%20PROTON%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component%20%3D%20ruby-binding qpid-proton-0.22.0/proton-c/bindings/ruby/README.rdoc0000664000000000000000000001511613257152177017102 0ustar = Qpid Proton AMQP Library This is a library for sending and receiving AMQP messages. It can be used to build clients and servers. == Installing You can install the latest published Gem with gem install qpid_proton *NOTE:* before installing the Gem, you must install the proton-C library. The proton-C library can be installed by the package manager on many platforms, e.g. yum install qpid-proton-c # Fedora < 25, RHEL < 7 dnf install qpid-proton-c # Fedora >= 25, RHEL >= 7 You can also download a source release or the latest development code from http://qpid.apache.org/proton. To build from source: cmake -DBUILD_BINDINGS=ruby && make This produces a Gem file at: ${CMAKE_BUILD_DIR}/proton-c/bindings/ruby/qpid_proton-${PN_VERSION}.gem You can install the gem with +gem install+ == Overview {Qpid::Proton::Message} represents a message that can be sent or received. A message body can be a string or byte sequence encoded any way you choose. However, AMQP also provides standard, interoperable encodings for basic data types like {Hash} and {Array}. The equivalent AMQP encodings can be understood as maps or sequences in any programming langauge with an AMQP library. {Qpid::Proton::Link} allows messages to be transferred to or from a remote AMQP process. The {Qpid::Proton::Sender} subclass sends messages, the {Qpid::Proton::Receiver} subclass receives them. Links have a source and target address, as explained below. Links are grouped in a {Qpid::Proton::Session}. Messages in the same session are sent sequentially, while those on different sessions can be interleaved. A large message being sent on one session does not block messages being sent on another session. Sessions belong to a {Qpid::Proton::Connection}. If you don't need multiple sessions, a connection will create links directly using a default session. A {Qpid::Proton::Transfer} represents the transfer of a message, the {Qpid::Proton::Delivery} subclass allows a receiver to accept or reject an incoming message. The {Qpid::Proton::Tracker} subclass allows a sender to track the status of a sent message and find out if it was accepted or rejected. A transfer is _settled_ when both ends are done with it. Different settlement methods give different levels of reliability: at-most-once, at-least-once, and exactly-once. See below. == Anatomy of a Proton application {Qpid::Proton::Container} is the top-level object in a Proton application. A client uses {Qpid::Proton::Container#connect} to establish connections. A server uses {Qpid::Proton::Container#listen} to accept connections. Proton is an event-driven library. You implement one or more _handlers_ which subclass {Qpid::Proton::MessagingHandler MessagingHandler} and override functions to handle AMQP events, such as {Qpid::Proton::MessagingHandler#on_message #on_message}. Each connection is associated with a handler for its events. {Qpid::Proton::Container#run} polls all connections and listeners and calls the event handling functions on your handlers. A multi-threaded application can call {Qpid::Proton::Container#run} in more than one thread, the container will use all the {Qpid::Proton::Container#run #run} threads as a thread pool to dispatch events. == Sources and targets Every link has two addresses, _source_ and _target_. The most common pattern for using these addresses is as follows: When a client creates a {Qpid::Proton::Receiver Receiver} link, it sets the _source_ address. This means "I want to receive messages from this source". This is often referred to as "subscribing" to the source. When a client creates a {Qpid::Proton::Sender Sender} link, it sets the _target_ address. This means "I want to send to this target". In the case of a broker, the source or target usually refers to a queue or topic. In general they can refer to any AMQP-capable node. In the request-response pattern, a request message carries a reply-to address for the response message. This can be any AMQP address, but it is often useful to create a temporary address for the response message. The client creates a receiver with no source address and the dynamic flag set. The server generates a unique source address for the receiver, which is discarded when the link closes. The client uses this source address as the reply-to when it sends the request, so the response is delivered to the client's receiver. The server_direct.cpp example shows how to implement a request-response server. == Settling a Message Transfer A message transfer is _settled_ at one end of a link when that end of the link has finished with the message and forgotten it. _Pre-settled_ messages are settled by the sender before sending. This gives _at most once_ reliability(also known as _best effort_, _unreliable_ or _fire and forget_) since the sender never knows for sure if the message arrived. If the connection is lost before the message is received by the receiver, the message will not be delivered. If the sender does not pre-settle a message, then the receiver settles it once it has been processed. The sender is informed of the settlement via the {Qpid::Proton::Tracker Tracker}. If the connection is lost before the sender has received notice of settlement, the delivery is considered in-doubt and the sender can re-send it. This ensures it eventually gets delivered (provided the connection and link can be reestablished) but it is possible for multiple copies of the same message are delivered, so the receiver must be aware of that. This is known as _at_least_once_ reliability. == Multi-threaded applications {Qpid::Proton::Container#run} can be called by multiple threads concurrently, giving the container a thread-pool to execute handler methods in parallel. Instances of {Qpid::Proton::Connection} and objects associated with it ({Qpid::Proton::Session}, {Qpid::Proton::Sender}, {Qpid::Proton::Receiver}, {Qpid::Proton::Delivery}, {Qpid::Proton::Tracker}) are not thread-safe and must be used correctly when multiple threads call {Qpid::Proton::Container#run} Calls to {Qpid::Proton::MessagingHandler} and {Qpid::Proton::Listener::Handler} methods by the {Qpid::Proton::Container} are automatically serialized for each connection instance. Other threads may have code similarly serialized by adding it to the {Qpid::Proton::Connection#work_queue} for the connection. Each object related to a {Qpid::Proton::Connection} also provides a +work_queue+ method. You also need to use the {Qpid::Proton::WorkQueue} to communicate between a {Qpid::Proton::MessagingHandler} method call for one connection instance, and a different {Qpid::Proton::Connection} instance in the same container, as separate connections can be processed in parallel. qpid-proton-0.22.0/proton-c/bindings/ruby/LICENSE0000664000000000000000000002613713257152177016306 0ustar Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. qpid-proton-0.22.0/proton-c/bindings/ruby/ChangeLog0000664000000000000000000002275113257152177017051 0ustar version 0.17.0: version 0.16.0: * PROTON-1350 PROTON-1351: Introduce proton-c core library - Created new core proton library qpid-proton-core which only contains protocol processsing and no IO. - Rearranged source tree to separate core protocol code and io/reactor/extra code - Rearranged code so that compiler dependent code is isolated and platform (OS) dependent code is isolated version 0.15.0: * PROTON-1282: Seg Fault in Ruby Messenger pn_messenger_free version 0.14.0: version 0.13.1: version 0.13.0: version 0.12.2: version 0.12.1: version 0.12.0: * PROTON-1059: ruby binding broken in 0.11 release and on master * PROTON-949: fix proton build with ccache swig version 0.11.1: * PROTON-1059: ruby binding broken in 0.11 release and on master version 0.11.0: * PROTON-949: fix proton build with ccache swig version 0.10: * PROTON-904: No longer need to include libuuid header * PROTON-781: Update CMake to install new Ruby packages. * PROTON-781: Added the set of LinkOption classes to Ruby. * PROTON-781: Added support for reactors to the Ruby Endpoint class. * PROTON-781: Added Container to the Ruby reactive APIs. * PROTON-781: Added SessionPerConnection to the Ruby reactive APIs. * PROTON-781: Added Backoff to the Ruby reactive APIs. * PROTON-781: Added Connector to the Ruby reactive APIs. * PROTON-781: Added URLs to the Ruby reactive APIs. * PROTON-781: Added the URL class to the Ruby core APIs. * PROTON-781: Added Reactor and Task to the ClassWrapper * PROTON-781: Added the Reactor mixin to the Ruby reactive APIs. * PROTON-781: Added the Handler mixin to the Ruby reactive APIs. * PROTON-781: Added the Timeout mixin to the Ruby APIs. * PROTON-781: Added GlobalOverrides to the Ruby reactive APIs. * PROTON-781: Added SSLConfig to the Ruby reactive APIs. * PROTON-781: Added reactor support to the Ruby Event class. * PROTON-781: Added the Reactor class to the Ruby reactor APIs. * PROTON-781: Added Acceptor to the Ruby reactive APIs. * PROTON-781: Added the Task class to the Ruby reactor APIs. * PROTON-781: Added MessagingHandler to the Ruby reactive APIs. * PROTON-781: Added OutgoingMessageHandler to the Ruby reactive APIs. * PROTON-781: Added IncomingMessageHandler to the Ruby reactive APIs. * PROTON-781: Added the BaseHandler class to the Ruby reactive APIs. * PROTON-781: Added the CFlowController class to the Ruby reactive APIs. * PROTON-781: Added EndpointStateHandler to the Ruby reactive APIs. * PROTON-781: Added the Acking mixin to the Ruby reactive APIs. * PROTON-781: Refactored the Ruby Selectable class. * PROTON-781: Repackaged the Ruby Selectable class to Qpid::Proton. * PROTON-781: Deleted the Ruby Filter mixin. * PROTON-781: Added the WrappedHandler class to the Ruby reactor APIs. * PROTON-799: Update CMake INSTALL for 81a5449 * PROTON-914: Fix for getting the SSL peer hostname in Ruby. * PROTON-898: Update Ruby bindings to use pn_selectable_get_fd * PROTON-799: Test for the Wrapper and rbkey system * PROTON-799: Adjusted the Ruby error macro * PROTON-799: Added yardopts * PROTON-799: Added the Event classes to the Ruby engine APIs. * PROTON-799: Added the ClassWrapper mixin for the Ruby engine APIs. * PROTON-799: Added the Transport class to the Ruby engine APIs. * PROTON-799: Added the SSL classes to the Ruby engine APIs. * PROTON-799: Added the SASL class to the Ruby engine APIs. * PROTON-799: Added the SASLError and TransportError errors to Ruby. * PROTON-799: Added the Connection class to the Ruby engine APIs. * PROTON-799: Added the Receiver class to the Ruby engine APIs. * PROTON-799: Added the Sender class to the Ruby engine APIs. * PROTON-799: Added the Link class to the Ruby engine APIs. * PROTON-799: Added the Delivery class to the Ruby engine APIs. * PROTON-799: Added the Disposition class to the Ruby engine APIs. * PROTON-799: Added the Terminus class to the Ruby engine APIs. * PROTON-799: Added the Session class to the Ruby engine APIs. * PROTON-799: Added the Endpoint class to the Ruby engine APIs. * PROTON-799: Added the Wrapper mixin to the Ruby engine APIs. * PROTON-799: Added the Condition class to the Ruby engine APIs. * PROTON-799: Added the UUID mixin for the Ruby reactive APIs. * PROTON-799: Created a utility module for the Ruby Engine APIs. * PROTON-799: Added the Collector class to the Ruby engine APIs. * PROTON-799: Added the pn_rbkey_t type to the Ruby APIs. * PROTON-799: Created a wrapper helper module for Ruby bindings. * PROTON-799: Added a constants value mixin to the Ruby bindings. * PROTON-799: Added the object/object= methods to Ruby Data class * PROTON-799: Updated the Ruby namespaces. * PROTON-799: Rearranged Ruby library. * PROTON-883: Fixed using a pointer value as a size - It's not clear to me how the warning message this caused went ignored - It's also not clear to me why this error passed the tests without crashing, probably the ruby tests need improving. * PROTON-883: Wrap pn_transport_peek for Ruby. * PROTON-873: Replaced send with __send__ in Ruby Mapping class version 0.9.1: version 0.9: * PROTON-822: removed some references I missed in my prior purge of deprecated message cruft * PROTON-822: removed deprecated message save/load as it has been deprecated for a while now and was also the cause of a valgrind error * PROTON-775: Ensure that annotation keys in Ruby are encoded as symbols. * PROTON-737: add missing PN_STATE_ERR error to ruby * PROTON-765: Fix Ruby's support for 64-bit values on 32-bit systems * PROTON-755: Changed how the Data rspec test sets a single random character. * PROTON-755: Add SecureRandom for use by Ruby 1.8 tests * PROTON-755: Updated rspec tests to use the newer expect syntax * PROTON-752: Release the GIL on blocking calls in Ruby. * PROTON-736: Tweaked how Ruby 1.8 determines if a string is UTF-8 * PROTON-752: Provide a non-blocking means to receive messages in Ruby. * PROTON-747: Around wrappers for Ruby Messenger methods that raise errors * PROTON-736: Replace missed force_encoding with encode * PROTON-743: Provide a means to clear errors in a Ruby Messenger. * PROTON-746: Fix encoding a Ruby symbol into a message body. * PROTON-736: Default Ruby 1.8 encoding to be binary unless explicit * PROTON-736: Created the UTFString and BinaryString classes for Ruby. * PROTON-739: Add TTL to Ruby Messenger subscribe method. * PROTON-736: Only encode Ruby strings as UTF-8 if it says it's UTF-8 * PROTON-736: Ruby Message does not return all content. version 0.8: * PROTON-693: Python Url class to wrap C function pni_parse_url * PROTON-651: remove the extraineous 'PN_' if under the proton namespace. * PROTON-651: added version constants for python, php, and ruby bindings * PROTON-615: Fix binding dependencies * PROTON-549: fixed warnings from ruby binding * PROTON-531: Removed Selectable.killable? from Ruby bindings * PROTON-531: Created the Selectable class for Ruby. * PROTON-531: Expose the passive mode in Ruby bindings. version 0.7: * PROTON-550: Fail build if Ruby is enabled but missing dependencies. * PROTON-551: Fixed a typo in the Ruby Messenger blocking call. * PROTON-538: more readme fixes and install tweaks * PROTON-538: fixed install to not use irregular paths, marked a lot of noisy variables as advanced, removed extra level of caching from cmake variables that had confusing effects, updated the readme to match what the build actually does * PROTON-445: Dynamic languages honor CMAKE_INSTALL_PREFIX version 0.6: * PROTON-482: Fix the Ruby install directory. * PROTON-479: Fixed typo in status * PROTON-479: Added PENDING status to Ruby Trackers * PROTON-260 Improve API rdoc comments for Ruby. * PROTON-464: Install Ruby bindings to install prefix if specified. * PROTON-456: Added password property to Ruby Messenger class. * PROTON-455: Added rewrite method to Ruby Messenger class. * PROTON-454: Added the route method to Ruby's Messenger class. * PROTON-452: Expose the Messenger interrupt method in Ruby. * PROTON-450: Use random ports for Ruby Rspec tests. * PROTON-448: Backing out the Ruby data change. * PROTON-448: Added missed ChangeLog entry * PROTON-448: Added support for Data encode/decode to Ruby Swig. * PROTON-431: Fixed the Ruby spec tests. * PROTON-273: Removed the content Rspec test for Ruby. * PROTON-427: Removed the flag argument from Messenger.settle version 0.5: * PROTON-406: Fix installing the Ruby bindings. * PROTON-399: Ruby bindings now install with the rest of Proton. * PROTON-369: Add the properties= method to Ruby Message. * PROTON-380: Added the body property to Ruby Message class. * PROTON-379: Added annotations property to Ruby Message class. * PROTON-381: Fixed encoding a Ruby symbol into a Data object. * PROTON-378: Add instructions property to Ruby Message class. * PROTON-369: Ruby Message.clear clears out properties * PROTON-377: Ruby automatically encodes an instance of Time. * PROTON-376: Fix how a ::hash is automatically added to Data in Ruby * PROTON-369: Add properties field to Qpid:Proton::Message * PROTON-341: Update the Ruby interop tests. * PROTON-322: Extend the Ruby Hash class to work with the Data class. * PROTON-322: Extended the Ruby Array class to work with the Data class. * PROTON-306: Fixes to the Ruby list helper type for Data. * PROTON-304: Removed accept mode from the Ruby bindings. * PROTON-227: Added missing elements to the Rdoc for qpid::proton::Data * PROTON-215: Added ruby interop test. * PROTON-227: Created the Data class for the Ruby bindings. version 0.4: version 0.3: * PROTON-188: applied modified patch version 0.2: version 0.1: qpid-proton-0.22.0/proton-c/bindings/ruby/CMakeLists.txt0000664000000000000000000001332013257152177020027 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # set(src "${CMAKE_CURRENT_SOURCE_DIR}") set(bin "${CMAKE_CURRENT_BINARY_DIR}") set(c_lib_dir "$") # Location of qpid-proton library ## Build the swig library list(APPEND SWIG_MODULE_cproton-ruby_EXTRA_DEPS ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i ${PROTON_HEADERS} ) include_directories (${RUBY_INCLUDE_PATH}) swig_add_library(cproton-ruby LANGUAGE ruby SOURCES cproton.i) swig_link_libraries(cproton-ruby ${BINDING_DEPS} ${RUBY_LIBRARY}) # Set version-dependent compile flags if (RUBY_VERSION VERSION_LESS 1.9.0) # Don't have blocking control API elseif(RUBY_VERSION VERSION_LESS 2.0.0) set(RUBY_C_FLAGS "-DRUBY_USE_rb_thread_blocking_region") else() set(RUBY_C_FLAGS "-DRUBY_USE_rb_thread_call_without_gvl") endif() # Replace global CMAKE_C_FLAGS, -fvisibility=hidden causes an obscure failure with release builds. set(CMAKE_C_FLAGS "${RUBY_C_FLAGS}") set_target_properties(cproton-ruby PROPERTIES PREFIX "" OUTPUT_NAME "cproton" LINK_FLAGS "${CATCH_UNDEFINED}" ) ## Make a gem file(GLOB_RECURSE RUBY_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rb *.rdoc) find_program(GEM_EXE gem DOC "Program to build and install ruby gem packages") mark_as_advanced(GEM_EXE) if (GEM_EXE) set(GEM_FILE "${bin}/gem/qpid_proton-${PN_VERSION}.gem") # Copy source and generated files to the build tree so we can build the gem in one place # # NOTE: the gem does not need the cproton-ruby library, but it does need # cprotonRUBY_wrap.c which is generated as a side effect. We have to depend on # cproton-ruby as there's no parallel-safe way to generate only the C file. configure_file(${src}/qpid_proton.gemspec.in ${bin}/gem/qpid_proton.gemspec) add_custom_command( OUTPUT ${GEM_FILE} COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${bin}/gem COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/examples/ruby/ ${bin}/gem/examples COMMAND ${CMAKE_COMMAND} -E copy ${bin}/cprotonRUBY_wrap.c ${bin}/gem/ext/cproton/cproton.c COMMAND ${GEM_EXE} build qpid_proton.gemspec WORKING_DIRECTORY ${bin}/gem DEPENDS ${bin}/gem/qpid_proton.gemspec ${RUBY_SRC} ${src}/LICENSE ${src}/TODO ${src}/ChangeLog cproton-ruby ) add_custom_target(ruby-gem ALL DEPENDS ${GEM_FILE}) endif () ## CMake-based install if (CHECK_SYSINSTALL_RUBY) execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir'] || ''" RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) if(OUTPUT_RUBY_ARCHLIB_DIR STREQUAL "") execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['archdir'] || ''" RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) endif() set(RUBY_ARCHLIB_DIR_DEFAULT "${OUTPUT_RUBY_ARCHLIB_DIR}") else (CHECK_SYSINSTALL_RUBY) set (RUBY_ARCHLIB_DIR_DEFAULT ${BINDINGS_DIR}/ruby) endif (CHECK_SYSINSTALL_RUBY) if (NOT RUBY_ARCHLIB_DIR) set (RUBY_ARCHLIB_DIR ${RUBY_ARCHLIB_DIR_DEFAULT}) endif() install(TARGETS cproton-ruby DESTINATION ${RUBY_ARCHLIB_DIR} COMPONENT Ruby) install(DIRECTORY lib/ DESTINATION ${RUBY_ARCHLIB_DIR} COMPONENT Ruby) ## Tests to_native_path("${src}/lib;${src}/tests;${src}/spec;${bin};${c_lib_dir};$ENV{RUBYLIB}" RUBYLIB) to_native_path("${bin};${c_lib_dir};$ENV{PATH}" PATH) execute_process(COMMAND ${RUBY_EXECUTABLE} -r minitest -e "" RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) if (result EQUAL 0) # Have minitest set(test_env ${env_py} -- "PATH=${PATH}" "RUBYLIB=${RUBYLIB}" "SASLPASSWD=${SASLPASSWD_EXE}") macro(add_ruby_test script) get_filename_component(name ${script} NAME_WE) string(REPLACE "_" "-" name "ruby-${name}") add_test( NAME ${name} COMMAND ${test_env} ${RUBY_EXECUTABLE} ${script} -v ${ARGN}) endmacro() add_ruby_test(example_test.rb WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ruby) add_ruby_test(old_example_test.rb WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/old_examples) file(GLOB TESTS tests/test_*.rb) file(GLOB SPECS spec/*_spec.rb) foreach(t ${TESTS} ${SPECS}) add_ruby_test(${t}) endforeach() # Suppress deprecation warnings from backward-compatibility tests set_tests_properties( ruby-old-example-test ruby-test-old-adapter PROPERTIES ENVIRONMENT "RUBYOPT=-W0") else() # No minitest message(STATUS "Ruby tests will not run, minitest is not installed") endif() ## Documentation find_program(YARD_EXE "yard") if (YARD_EXE) add_custom_command( OUTPUT ${bin}/doc WORKING_DIRECTORY ${src} COMMAND ${YARD_EXE} -o ${bin}/doc -b ${bin}/.yardoc --yardopts ${src}/.yardopts -p ${src}/yard/templates DEPENDS ${RUBY_SRC} ) add_custom_target(docs-ruby DEPENDS ${bin}/doc) add_dependencies (docs docs-ruby) install(DIRECTORY "${bin}/doc/" DESTINATION "${PROTON_SHARE}/docs/api-ruby" COMPONENT documentation OPTIONAL) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES doc) endif() qpid-proton-0.22.0/proton-c/bindings/ruby/.yardopts0000664000000000000000000000017513257152177017141 0ustar --readme README.rdoc --quiet --no-progress --no-private --default-return "" --hide-void-return --template default --api qpid qpid-proton-0.22.0/proton-c/bindings/python/0000775000000000000000000000000013257152177015630 5ustar qpid-proton-0.22.0/proton-c/bindings/python/setuputils/0000775000000000000000000000000013257152177020051 5ustar qpid-proton-0.22.0/proton-c/bindings/python/setuputils/misc.py0000664000000000000000000000570213257152177021362 0ustar #----------------------------------------------------------------------------- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. # # This bundling code is largely adapted from pyzmq-static's get.sh by # Brandon Craig-Rhodes, which is itself BSD licensed. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # These functions were largely adapted from pyzmq's code # PyZMQ Developers, which is itself Modified BSD licensed. #----------------------------------------------------------------------------- import errno import os import subprocess import sys from . import log def _call_pkg_config(args): """Spawn a subprocess running pkg-config with the given args. :param args: list of strings to pass to pkg-config's command line. Refer to pkg-config's documentation for more detail. Return the Popen object, or None if the command failed """ try: return subprocess.Popen(['pkg-config'] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) except OSError as e: if e.errno == errno.ENOENT: log.warn("command not found: pkg-config") else: log.warn("Running pkg-config failed - %s." % e) return None def pkg_config_version_installed(package, version=None, atleast=None): """Check if version of a package is is installed This function returns True/False depending on whether the package is found and is the correct version. :param version: The exact version of the package required :param atleast: True if installed package is at least this version """ if version is None and atleast is None: log.fatal('package version string required') elif version and atleast: log.fatal('Specify either version or atleast, not both') check = 'exact' if version else 'atleast' p = _call_pkg_config(['--%s-version=%s' % (check, version or atleast), package]) if p: out,err = p.communicate() if p.returncode: log.info("Did not find %s via pkg-config: %s" % (package, err)) return False log.info("Using %s version %s (found via pkg-config)" % (package, _call_pkg_config(['--modversion', package]).communicate()[0].splitlines()[0])) return True return False def pkg_config_get_var(package, name): """Retrieve the value of the named package variable as a string """ p = _call_pkg_config(['--variable=%s' % name, package]) if not p: log.warn("pkg-config: var %s get failed, package %s", name, package) return "" out,err = p.communicate() if p.returncode: out = "" log.warn(err) return out.splitlines()[0] qpid-proton-0.22.0/proton-c/bindings/python/setuputils/log.py0000664000000000000000000000242513257152177021207 0ustar #----------------------------------------------------------------------------- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. # # This bundling code is largely adapted from pyzmq-static's get.sh by # Brandon Craig-Rhodes, which is itself BSD licensed. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Logging (adapted from h5py: http://h5py.googlecode.com) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # This log code is largely adapted from pyzmq's code # PyZMQ Developers, which is itself Modified BSD licensed. #----------------------------------------------------------------------------- import os import sys import logging logger = logging.getLogger() if os.environ.get('DEBUG'): logger.setLevel(logging.DEBUG) else: logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler(sys.stderr)) def debug(msg): logger.debug(msg) def info(msg): logger.info(msg) def fatal(msg, code=1): logger.error("Fatal: " + msg) exit(code) def warn(msg): logger.error("Warning: " + msg) qpid-proton-0.22.0/proton-c/bindings/python/setuputils/__init__.py0000664000000000000000000000000013257152177022150 0ustar qpid-proton-0.22.0/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD0000664000000000000000000000307413257152177022471 0ustar PyZMQ is licensed under the terms of the Modified BSD License (also known as New or Revised BSD), as follows: Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of PyZMQ nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. qpid-proton-0.22.0/proton-c/bindings/python/setup.py.in0000775000000000000000000003170313257152177017756 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. """ python-qpid-proton setup script DISCLAIMER: This script took lots of inspirations from PyZMQ, which is licensed under the 'MODIFIED BSD LICENSE'. Although inspired by the work in PyZMQ, this script and the modules it depends on were largely simplified to meet the requirements of the library. The behavior of this script is to build the registered `_cproton` extension using the installed Qpid Proton C library and header files. If the library and headers are not installed, or the installed version does not match the version of these python bindings, then the script will attempt to build the extension using the Proton C sources included in the python source distribution package. While the above removes the need of *always* having Qpid Proton C development files installed, it does not solve the need of having `swig` and the libraries qpid-proton requires installed to make this setup work. From the Python side, this scripts overrides 1 command - build_ext - and it adds a new one. The latter - Configure - is called from the former to setup/discover what's in the system. The rest of the commands and steps are done normally without any kind of monkey patching. """ import glob import os import subprocess import sys import distutils.spawn as ds_spawn import distutils.sysconfig as ds_sys from distutils.ccompiler import new_compiler, get_default_compiler from distutils.core import setup, Extension from distutils.command.build import build from distutils.command.build_ext import build_ext from distutils.command.sdist import sdist from distutils import errors from setuputils import log from setuputils import misc _PROTON_VERSION=(@PN_VERSION_MAJOR@, @PN_VERSION_MINOR@, @PN_VERSION_POINT@) _PROTON_VERSION_STR = "%d.%d.%d" % _PROTON_VERSION class CheckSDist(sdist): def run(self): self.distribution.run_command('configure') # Append the source that was removed during # the configuration step. _cproton = self.distribution.ext_modules[-1] _cproton.sources.append('cproton.i') try: sdist.run(self) finally: for src in ['cproton.py', 'cproton_wrap.c']: if os.path.exists(src): os.remove(src) class Configure(build_ext): description = "Discover Qpid Proton version" @property def compiler_type(self): compiler = self.compiler if compiler is None: return get_default_compiler() elif isinstance(compiler, str): return compiler else: return compiler.compiler_type def prepare_swig_wrap(self): """Run swig against the sources. This will cause swig to compile the cproton.i file into a .c file called cproton_wrap.c, and create cproton.py. """ ext = self.distribution.ext_modules[-1] if 'SWIG' in os.environ: self.swig = os.environ['SWIG'] try: # This will actually call swig to generate the files # and list the sources. self.swig_sources(ext.sources, ext) except (errors.DistutilsExecError, errors.DistutilsPlatformError) as e: if not (os.path.exists('cproton_wrap.c') or os.path.exists('cproton.py')): raise e # now remove the cproton.i file from the source list so we don't run # swig again. ext.sources = ext.sources[1:] ext.swig_opts = [] def use_bundled_proton(self): """The proper version of libqpid-proton is not installed on the system, so use the included proton-c sources to build the extension """ log.info("Building the bundled proton-c sources into the extension") setup_path = os.path.dirname(os.path.realpath(__file__)) base = self.get_finalized_command('build').build_base build_include = os.path.join(base, 'include') proton_base = os.path.abspath(os.path.join(setup_path, 'proton-c')) proton_src = os.path.join(proton_base, 'src') proton_include = os.path.join(proton_base, 'include') log.debug("Using Proton C sources: %s" % proton_base) # Collect all the Proton C files packaged in the sdist and strip out # anything windows and configuration-dependent sources = [x for x in "@all_src@".split(';') if x.endswith(".c") and x.find('windows') == -1] cfgdep = ['openssl.c', 'schannel.c', 'ssl_stub.c', 'cyrus_sasl.c', 'cyrus_stub.c'] sources = filter(lambda x: os.path.basename(x) not in cfgdep, sources) sources = [os.path.join(proton_base, x) for x in sources] # Look for any optional libraries that proton needs, and adjust the # source list and compile flags as necessary. libraries = [] includes = [] # -D flags (None means no value, just define) macros=[('qpid_proton_EXPORTS', None), ('USE_ATOLL', None), ('USE_STRERROR_R', None)] # Check whether openssl is installed by poking # pkg-config for a minimum version 0. If it's installed, it should # return True and we'll use it. Otherwise, we'll use the stub. if misc.pkg_config_version_installed('openssl', atleast='0'): libraries += ['ssl', 'crypto'] includes += [misc.pkg_config_get_var('openssl', 'includedir')] sources.append(os.path.join(proton_src, 'ssl', 'openssl.c')) else: sources.append(os.path.join(proton_src, 'ssl', 'ssl_stub.c')) log.warn("OpenSSL not installed - disabling SSL support!") # create a temp compiler to check for optional compile-time features cc = new_compiler(compiler=self.compiler_type) cc.output_dir = self.build_temp # Some systems need to link to `rt`. Check whether `clock_gettime` is # around and if librt is needed if cc.has_function('clock_gettime'): macros.append(('USE_CLOCK_GETTIME', None)) else: if cc.has_function('clock_gettime', libraries=['rt']): libraries.append('rt') macros.append(('USE_CLOCK_GETTIME', None)) # 0.10 added an implementation for cyrus. Check # if it is available before adding the implementation to the sources # list. Eventually, `sasl.c` will be added and one of the existing # implementations will be used. if cc.has_function('sasl_client_done', includes=['sasl/sasl.h'], libraries=['sasl2']): libraries.append('sasl2') sources.append(os.path.join(proton_src, 'sasl', 'cyrus_sasl.c')) else: log.warn("Cyrus SASL not installed - only the ANONYMOUS and" " PLAIN mechanisms will be supported!") sources.append(os.path.join(proton_src, 'sasl', 'cyrus_stub.c')) # compile all the proton sources. We'll add the resulting list of # objects to the _cproton extension as 'extra objects'. We do this # instead of just lumping all the sources into the extension to prevent # any proton-specific compilation flags from affecting the compilation # of the generated swig code cc = new_compiler(compiler=self.compiler_type) ds_sys.customize_compiler(cc) objects = cc.compile(sources, macros=macros, include_dirs=[build_include, proton_include, proton_src]+includes, # compiler command line options: extra_postargs=['-std=gnu99'], output_dir=self.build_temp) # # Now update the _cproton extension instance passed to setup to include # the objects and libraries # _cproton = self.distribution.ext_modules[-1] _cproton.extra_objects = objects _cproton.include_dirs.append(build_include) _cproton.include_dirs.append(proton_include) # swig will need to access the proton headers: _cproton.swig_opts.append('-I%s' % build_include) _cproton.swig_opts.append('-I%s' % proton_include) # lastly replace the libqpid-proton dependency with libraries required # by the Proton objects: _cproton.libraries=libraries def libqpid_proton_installed(self, version): """Check to see if the proper version of the Proton development library and headers are already installed """ return misc.pkg_config_version_installed('libqpid-proton', version) def use_installed_proton(self): """The Proton development headers and library are installed, update the _cproton extension to tell it where to find the library and headers. """ # update the Extension instance passed to setup() to use the installed # headers and link library _cproton = self.distribution.ext_modules[-1] incs = misc.pkg_config_get_var('libqpid-proton', 'includedir') for i in incs.split(): _cproton.swig_opts.append('-I%s' % i) _cproton.include_dirs.append(i) ldirs = misc.pkg_config_get_var('libqpid-proton', 'libdir') _cproton.library_dirs.extend(ldirs.split()) def run(self): # check if the Proton library and headers are installed and are # compatible with this version of the binding. if self.libqpid_proton_installed(_PROTON_VERSION_STR): self.use_installed_proton() else: # Proton not installed or compatible, use bundled proton-c sources self.use_bundled_proton() self.prepare_swig_wrap() class CustomBuildOrder(build): # The sole purpose of this class is to re-order # the commands execution so that `build_ext` is executed *before* # build_py. We need this to make sure `cproton.py` is generated # before the python modules are collected. Otherwise, it won't # be installed. sub_commands = [ ('build_ext', build.has_ext_modules), ('build_py', build.has_pure_modules), ('build_clib', build.has_c_libraries), ('build_scripts', build.has_scripts), ] class CheckingBuildExt(build_ext): """Subclass build_ext to build qpid-proton using `cmake`""" def run(self): # Discover qpid-proton in the system self.distribution.run_command('configure') build_ext.run(self) # Override `build_ext` and add `configure` cmdclass = {'configure': Configure, 'build': CustomBuildOrder, 'build_ext': CheckingBuildExt, 'sdist': CheckSDist} setup(name='python-qpid-proton', version=_PROTON_VERSION_STR + os.environ.get('PROTON_VERSION_SUFFIX', ''), description='An AMQP based messaging library.', author='Apache Qpid', author_email='users@qpid.apache.org', url='http://qpid.apache.org/proton/', packages=['proton'], py_modules=['cproton'], license="Apache Software License", classifiers=["License :: OSI Approved :: Apache Software License", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6"], cmdclass=cmdclass, # Note well: the following extension instance is modified during the # installation! If you make changes below, you may need to update the # Configure class above ext_modules=[Extension('_cproton', sources=['cproton.i', 'cproton_wrap.c'], swig_opts=['-threads'], extra_compile_args=['-pthread'], libraries=['qpid-proton'])]) qpid-proton-0.22.0/proton-c/bindings/python/proton/0000775000000000000000000000000013257152177017151 5ustar qpid-proton-0.22.0/proton-c/bindings/python/proton/wrapper.py0000664000000000000000000000714113257152177021206 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from cproton import * class EmptyAttrs: def __contains__(self, name): return False def __getitem__(self, name): raise KeyError(name) def __setitem__(self, name, value): raise TypeError("does not support item assignment") EMPTY_ATTRS = EmptyAttrs() class Wrapper(object): def __init__(self, impl_or_constructor, get_context=None): init = False if callable(impl_or_constructor): # we are constructing a new object impl = impl_or_constructor() if impl is None: self.__dict__["_impl"] = impl self.__dict__["_attrs"] = EMPTY_ATTRS self.__dict__["_record"] = None from proton import ProtonException raise ProtonException("Wrapper failed to create wrapped object. Check for file descriptor or memory exhaustion.") init = True else: # we are wrapping an existing object impl = impl_or_constructor pn_incref(impl) if get_context: record = get_context(impl) attrs = pn_void2py(pn_record_get(record, PYCTX)) if attrs is None: attrs = {} pn_record_def(record, PYCTX, PN_PYREF) pn_record_set(record, PYCTX, pn_py2void(attrs)) init = True else: attrs = EMPTY_ATTRS init = False record = None self.__dict__["_impl"] = impl self.__dict__["_attrs"] = attrs self.__dict__["_record"] = record if init: self._init() def __getattr__(self, name): attrs = self.__dict__["_attrs"] if name in attrs: return attrs[name] else: raise AttributeError(name + " not in _attrs") def __setattr__(self, name, value): if hasattr(self.__class__, name): object.__setattr__(self, name, value) else: attrs = self.__dict__["_attrs"] attrs[name] = value def __delattr__(self, name): attrs = self.__dict__["_attrs"] if attrs: del attrs[name] def __hash__(self): return hash(addressof(self._impl)) def __eq__(self, other): if isinstance(other, Wrapper): return addressof(self._impl) == addressof(other._impl) return False def __ne__(self, other): if isinstance(other, Wrapper): return addressof(self._impl) != addressof(other._impl) return True def __del__(self): pn_decref(self._impl) def __repr__(self): return '<%s.%s 0x%x ~ 0x%x>' % (self.__class__.__module__, self.__class__.__name__, id(self), addressof(self._impl)) PYCTX = int(pn_py2void(Wrapper)) addressof = int qpid-proton-0.22.0/proton-c/bindings/python/proton/utils.py0000664000000000000000000003702513257152177020672 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import collections, socket, time, threading from proton import ConnectionException, Delivery, Endpoint, Handler, Link, LinkException, Message from proton import ProtonException, Timeout, Url from proton.reactor import Container from proton.handlers import MessagingHandler, IncomingMessageHandler from cproton import pn_reactor_collector, pn_collector_release class BlockingLink(object): def __init__(self, connection, link): self.connection = connection self.link = link self.connection.wait(lambda: not (self.link.state & Endpoint.REMOTE_UNINIT), msg="Opening link %s" % link.name) self._checkClosed() def _waitForClose(self, timeout=1): try: self.connection.wait(lambda: self.link.state & Endpoint.REMOTE_CLOSED, timeout=timeout, msg="Opening link %s" % self.link.name) except Timeout as e: pass self._checkClosed() def _checkClosed(self): if self.link.state & Endpoint.REMOTE_CLOSED: self.link.close() if not self.connection.closing: raise LinkDetached(self.link) def close(self): self.link.close() self.connection.wait(lambda: not (self.link.state & Endpoint.REMOTE_ACTIVE), msg="Closing link %s" % self.link.name) # Access to other link attributes. def __getattr__(self, name): return getattr(self.link, name) class SendException(ProtonException): """ Exception used to indicate an exceptional state/condition on a send request """ def __init__(self, state): self.state = state def _is_settled(delivery): return delivery.settled or delivery.link.snd_settle_mode == Link.SND_SETTLED class BlockingSender(BlockingLink): def __init__(self, connection, sender): super(BlockingSender, self).__init__(connection, sender) if self.link.target and self.link.target.address and self.link.target.address != self.link.remote_target.address: #this may be followed by a detach, which may contain an error condition, so wait a little... self._waitForClose() #...but close ourselves if peer does not self.link.close() raise LinkException("Failed to open sender %s, target does not match" % self.link.name) def send(self, msg, timeout=False, error_states=None): delivery = self.link.send(msg) self.connection.wait(lambda: _is_settled(delivery), msg="Sending on sender %s" % self.link.name, timeout=timeout) if delivery.link.snd_settle_mode != Link.SND_SETTLED: delivery.settle() bad = error_states if bad is None: bad = [Delivery.REJECTED, Delivery.RELEASED] if delivery.remote_state in bad: raise SendException(delivery.remote_state) return delivery class Fetcher(MessagingHandler): def __init__(self, connection, prefetch): super(Fetcher, self).__init__(prefetch=prefetch, auto_accept=False) self.connection = connection self.incoming = collections.deque([]) self.unsettled = collections.deque([]) def on_message(self, event): self.incoming.append((event.message, event.delivery)) self.connection.container.yield_() # Wake up the wait() loop to handle the message. def on_link_error(self, event): if event.link.state & Endpoint.LOCAL_ACTIVE: event.link.close() if not self.connection.closing: raise LinkDetached(event.link) def on_connection_error(self, event): if not self.connection.closing: raise ConnectionClosed(event.connection) @property def has_message(self): return len(self.incoming) def pop(self): message, delivery = self.incoming.popleft() if not delivery.settled: self.unsettled.append(delivery) return message def settle(self, state=None): delivery = self.unsettled.popleft() if state: delivery.update(state) delivery.settle() class BlockingReceiver(BlockingLink): def __init__(self, connection, receiver, fetcher, credit=1): super(BlockingReceiver, self).__init__(connection, receiver) if self.link.source and self.link.source.address and self.link.source.address != self.link.remote_source.address: #this may be followed by a detach, which may contain an error condition, so wait a little... self._waitForClose() #...but close ourselves if peer does not self.link.close() raise LinkException("Failed to open receiver %s, source does not match" % self.link.name) if credit: receiver.flow(credit) self.fetcher = fetcher self.container = connection.container def __del__(self): self.fetcher = None # The next line causes a core dump if the Proton-C reactor finalizes # first. The self.container reference prevents out of order reactor # finalization. It may not be set if exception in BlockingLink.__init__ if hasattr(self, "container"): self.link.handler = None # implicit call to reactor def receive(self, timeout=False): if not self.fetcher: raise Exception("Can't call receive on this receiver as a handler was provided") if not self.link.credit: self.link.flow(1) self.connection.wait(lambda: self.fetcher.has_message, msg="Receiving on receiver %s" % self.link.name, timeout=timeout) return self.fetcher.pop() def accept(self): self.settle(Delivery.ACCEPTED) def reject(self): self.settle(Delivery.REJECTED) def release(self, delivered=True): if delivered: self.settle(Delivery.MODIFIED) else: self.settle(Delivery.RELEASED) def settle(self, state=None): if not self.fetcher: raise Exception("Can't call accept/reject etc on this receiver as a handler was provided") self.fetcher.settle(state) class LinkDetached(LinkException): def __init__(self, link): self.link = link if link.is_sender: txt = "sender %s to %s closed" % (link.name, link.target.address) else: txt = "receiver %s from %s closed" % (link.name, link.source.address) if link.remote_condition: txt += " due to: %s" % link.remote_condition self.condition = link.remote_condition.name else: txt += " by peer" self.condition = None super(LinkDetached, self).__init__(txt) class ConnectionClosed(ConnectionException): def __init__(self, connection): self.connection = connection txt = "Connection %s closed" % connection.hostname if connection.remote_condition: txt += " due to: %s" % connection.remote_condition self.condition = connection.remote_condition.name else: txt += " by peer" self.condition = None super(ConnectionClosed, self).__init__(txt) class BlockingConnection(Handler): """ A synchronous style connection wrapper. This object's implementation uses OS resources. To ensure they are released when the object is no longer in use, make sure that object operations are enclosed in a try block and that close() is always executed on exit. """ def __init__(self, url, timeout=None, container=None, ssl_domain=None, heartbeat=None, **kwargs): self.disconnected = False self.timeout = timeout or 60 self.container = container or Container() self.container.timeout = self.timeout self.container.start() self.url = Url(url).defaults() self.conn = None self.closing = False failed = True try: self.conn = self.container.connect(url=self.url, handler=self, ssl_domain=ssl_domain, reconnect=False, heartbeat=heartbeat, **kwargs) self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_UNINIT), msg="Opening connection") failed = False finally: if failed and self.conn: self.close() def create_sender(self, address, handler=None, name=None, options=None): return BlockingSender(self, self.container.create_sender(self.conn, address, name=name, handler=handler, options=options)) def create_receiver(self, address, credit=None, dynamic=False, handler=None, name=None, options=None): prefetch = credit if handler: fetcher = None if prefetch is None: prefetch = 1 else: fetcher = Fetcher(self, credit) return BlockingReceiver( self, self.container.create_receiver(self.conn, address, name=name, dynamic=dynamic, handler=handler or fetcher, options=options), fetcher, credit=prefetch) def close(self): # TODO: provide stronger interrupt protection on cleanup. See PEP 419 if self.closing: return self.closing = True self.container.errors = [] try: if self.conn: self.conn.close() self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_ACTIVE), msg="Closing connection") finally: self.conn.free() # Nothing left to block on. Allow reactor to clean up. self.run() self.conn = None self.container.global_handler = None # break circular ref: container to cadapter.on_error pn_collector_release(pn_reactor_collector(self.container._impl)) # straggling event may keep reactor alive self.container = None def _is_closed(self): return self.conn.state & (Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED) def run(self): """ Hand control over to the event loop (e.g. if waiting indefinitely for incoming messages) """ while self.container.process(): pass self.container.stop() self.container.process() def wait(self, condition, timeout=False, msg=None): """Call process until condition() is true""" if timeout is False: timeout = self.timeout if timeout is None: while not condition() and not self.disconnected: self.container.process() else: container_timeout = self.container.timeout self.container.timeout = timeout try: deadline = time.time() + timeout while not condition() and not self.disconnected: self.container.process() if deadline < time.time(): txt = "Connection %s timed out" % self.url if msg: txt += ": " + msg raise Timeout(txt) finally: self.container.timeout = container_timeout if self.disconnected or self._is_closed(): self.container.stop() self.conn.handler = None # break cyclical reference if self.disconnected and not self._is_closed(): raise ConnectionException( "Connection %s disconnected: %s" % (self.url, self.disconnected)) def on_link_remote_close(self, event): if event.link.state & Endpoint.LOCAL_ACTIVE: event.link.close() if not self.closing: raise LinkDetached(event.link) def on_connection_remote_close(self, event): if event.connection.state & Endpoint.LOCAL_ACTIVE: event.connection.close() if not self.closing: raise ConnectionClosed(event.connection) def on_transport_tail_closed(self, event): self.on_transport_closed(event) def on_transport_head_closed(self, event): self.on_transport_closed(event) def on_transport_closed(self, event): self.disconnected = event.transport.condition or "unknown" class AtomicCount(object): def __init__(self, start=0, step=1): """Thread-safe atomic counter. Start at start, increment by step.""" self.count, self.step = start, step self.lock = threading.Lock() def next(self): """Get the next value""" self.lock.acquire() self.count += self.step; result = self.count self.lock.release() return result class SyncRequestResponse(IncomingMessageHandler): """ Implementation of the synchronous request-response (aka RPC) pattern. @ivar address: Address for all requests, may be None. @ivar connection: Connection for requests and responses. """ correlation_id = AtomicCount() def __init__(self, connection, address=None): """ Send requests and receive responses. A single instance can send many requests to the same or different addresses. @param connection: A L{BlockingConnection} @param address: Address for all requests. If not specified, each request must have the address property set. Successive messages may have different addresses. """ super(SyncRequestResponse, self).__init__() self.connection = connection self.address = address self.sender = self.connection.create_sender(self.address) # dynamic=true generates a unique address dynamically for this receiver. # credit=1 because we want to receive 1 response message initially. self.receiver = self.connection.create_receiver(None, dynamic=True, credit=1, handler=self) self.response = None def call(self, request): """ Send a request message, wait for and return the response message. @param request: A L{proton.Message}. If L{self.address} is not set the L{self.address} must be set and will be used. """ if not self.address and not request.address: raise ValueError("Request message has no address: %s" % request) request.reply_to = self.reply_to request.correlation_id = correlation_id = str(self.correlation_id.next()) self.sender.send(request) def wakeup(): return self.response and (self.response.correlation_id == correlation_id) self.connection.wait(wakeup, msg="Waiting for response") response = self.response self.response = None # Ready for next response. self.receiver.flow(1) # Set up credit for the next response. return response @property def reply_to(self): """Return the dynamic address of our receiver.""" return self.receiver.remote_source.address def on_message(self, event): """Called when we receive a message for our receiver.""" self.response = event.message self.connection.container.yield_() # Wake up the wait() loop to handle the message. qpid-proton-0.22.0/proton-c/bindings/python/proton/reactor.py0000664000000000000000000010101013257152177021153 0ustar from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import logging, os, socket, time, types from heapq import heappush, heappop, nsmallest from proton import Collector, Connection, ConnectionException, Delivery, Described, dispatch from proton import Endpoint, Event, EventBase, EventType, generate_uuid, Handler, Link, Message from proton import ProtonException, PN_ACCEPTED, PN_PYREF, SASL, Session, SSL, SSLDomain, SSLUnavailable, symbol from proton import Terminus, Timeout, Transport, TransportException, ulong, Url from select import select from proton.handlers import OutgoingMessageHandler from proton import unicode2utf8, utf82unicode import traceback from proton import WrappedHandler, _chandler, secs2millis, millis2secs, timeout2millis, millis2timeout, Selectable from .wrapper import Wrapper, PYCTX from cproton import * from . import _compat try: import Queue except ImportError: import queue as Queue log = logging.getLogger("proton") class Task(Wrapper): @staticmethod def wrap(impl): if impl is None: return None else: return Task(impl) def __init__(self, impl): Wrapper.__init__(self, impl, pn_task_attachments) def _init(self): pass def cancel(self): pn_task_cancel(self._impl) class Acceptor(Wrapper): def __init__(self, impl): Wrapper.__init__(self, impl) def set_ssl_domain(self, ssl_domain): pn_acceptor_set_ssl_domain(self._impl, ssl_domain._domain) def close(self): pn_acceptor_close(self._impl) class Reactor(Wrapper): @staticmethod def wrap(impl): if impl is None: return None else: record = pn_reactor_attachments(impl) attrs = pn_void2py(pn_record_get(record, PYCTX)) if attrs and 'subclass' in attrs: return attrs['subclass'](impl=impl) else: return Reactor(impl=impl) def __init__(self, *handlers, **kwargs): Wrapper.__init__(self, kwargs.get("impl", pn_reactor), pn_reactor_attachments) for h in handlers: self.handler.add(h, on_error=self.on_error_delegate()) def _init(self): self.errors = [] # on_error relay handler tied to underlying C reactor. Use when the # error will always be generated from a callback from this reactor. # Needed to prevent reference cycles and be compatible with wrappers. class ErrorDelegate(object): def __init__(self, reactor): self.reactor_impl = reactor._impl def on_error(self, info): ractor = Reactor.wrap(self.reactor_impl) ractor.on_error(info) def on_error_delegate(self): return Reactor.ErrorDelegate(self).on_error def on_error(self, info): self.errors.append(info) self.yield_() def _get_global(self): return WrappedHandler.wrap(pn_reactor_get_global_handler(self._impl), self.on_error_delegate()) def _set_global(self, handler): impl = _chandler(handler, self.on_error_delegate()) pn_reactor_set_global_handler(self._impl, impl) pn_decref(impl) global_handler = property(_get_global, _set_global) def _get_timeout(self): return millis2timeout(pn_reactor_get_timeout(self._impl)) def _set_timeout(self, secs): return pn_reactor_set_timeout(self._impl, timeout2millis(secs)) timeout = property(_get_timeout, _set_timeout) def yield_(self): pn_reactor_yield(self._impl) def mark(self): return pn_reactor_mark(self._impl) def _get_handler(self): return WrappedHandler.wrap(pn_reactor_get_handler(self._impl), self.on_error_delegate()) def _set_handler(self, handler): impl = _chandler(handler, self.on_error_delegate()) pn_reactor_set_handler(self._impl, impl) pn_decref(impl) handler = property(_get_handler, _set_handler) def run(self): self.timeout = 3.14159265359 self.start() while self.process(): pass self.stop() self.process() self.global_handler = None self.handler = None def wakeup(self): n = pn_reactor_wakeup(self._impl) if n: raise IOError(pn_error_text(pn_reactor_error(self._impl))) def start(self): pn_reactor_start(self._impl) @property def quiesced(self): return pn_reactor_quiesced(self._impl) def _check_errors(self): if self.errors: for exc, value, tb in self.errors[:-1]: traceback.print_exception(exc, value, tb) exc, value, tb = self.errors[-1] _compat.raise_(exc, value, tb) def process(self): result = pn_reactor_process(self._impl) self._check_errors() return result def stop(self): pn_reactor_stop(self._impl) self._check_errors() def schedule(self, delay, task): impl = _chandler(task, self.on_error_delegate()) task = Task.wrap(pn_reactor_schedule(self._impl, secs2millis(delay), impl)) pn_decref(impl) return task def acceptor(self, host, port, handler=None): impl = _chandler(handler, self.on_error_delegate()) aimpl = pn_reactor_acceptor(self._impl, unicode2utf8(host), str(port), impl) pn_decref(impl) if aimpl: return Acceptor(aimpl) else: raise IOError("%s (%s:%s)" % (pn_error_text(pn_reactor_error(self._impl)), host, port)) def connection(self, handler=None): """Deprecated: use connection_to_host() instead """ impl = _chandler(handler, self.on_error_delegate()) result = Connection.wrap(pn_reactor_connection(self._impl, impl)) if impl: pn_decref(impl) return result def connection_to_host(self, host, port, handler=None): """Create an outgoing Connection that will be managed by the reactor. The reactor's pn_iohandler will create a socket connection to the host once the connection is opened. """ conn = self.connection(handler) self.set_connection_host(conn, host, port) return conn def set_connection_host(self, connection, host, port): """Change the address used by the connection. The address is used by the reactor's iohandler to create an outgoing socket connection. This must be set prior to opening the connection. """ pn_reactor_set_connection_host(self._impl, connection._impl, unicode2utf8(str(host)), unicode2utf8(str(port))) def get_connection_address(self, connection): """This may be used to retrieve the remote peer address. @return: string containing the address in URL format or None if no address is available. Use the proton.Url class to create a Url object from the returned value. """ _url = pn_reactor_get_connection_address(self._impl, connection._impl) return utf82unicode(_url) def selectable(self, handler=None): impl = _chandler(handler, self.on_error_delegate()) result = Selectable.wrap(pn_reactor_selectable(self._impl)) if impl: record = pn_selectable_attachments(result._impl) pn_record_set_handler(record, impl) pn_decref(impl) return result def update(self, sel): pn_reactor_update(self._impl, sel._impl) def push_event(self, obj, etype): pn_collector_put(pn_reactor_collector(self._impl), PN_PYREF, pn_py2void(obj), etype.number) from proton import wrappers as _wrappers _wrappers["pn_reactor"] = lambda x: Reactor.wrap(pn_cast_pn_reactor(x)) _wrappers["pn_task"] = lambda x: Task.wrap(pn_cast_pn_task(x)) class EventInjector(object): """ Can be added to a reactor to allow events to be triggered by an external thread but handled on the event thread associated with the reactor. An instance of this class can be passed to the Reactor.selectable() method of the reactor in order to activate it. The close() method should be called when it is no longer needed, to allow the event loop to end if needed. """ def __init__(self): self.queue = Queue.Queue() self.pipe = os.pipe() self._closed = False def trigger(self, event): """ Request that the given event be dispatched on the event thread of the reactor to which this EventInjector was added. """ self.queue.put(event) os.write(self.pipe[1], _compat.str2bin("!")) def close(self): """ Request that this EventInjector be closed. Existing events will be dispatched on the reactors event dispatch thread, then this will be removed from the set of interest. """ self._closed = True os.write(self.pipe[1], _compat.str2bin("!")) def fileno(self): return self.pipe[0] def on_selectable_init(self, event): sel = event.context sel.fileno(self.fileno()) sel.reading = True event.reactor.update(sel) def on_selectable_readable(self, event): os.read(self.pipe[0], 512) while not self.queue.empty(): requested = self.queue.get() event.reactor.push_event(requested.context, requested.type) if self._closed: s = event.context s.terminate() event.reactor.update(s) class ApplicationEvent(EventBase): """ Application defined event, which can optionally be associated with an engine object and or an arbitrary subject """ def __init__(self, typename, connection=None, session=None, link=None, delivery=None, subject=None): super(ApplicationEvent, self).__init__(PN_PYREF, self, EventType(typename)) self.connection = connection self.session = session self.link = link self.delivery = delivery if self.delivery: self.link = self.delivery.link if self.link: self.session = self.link.session if self.session: self.connection = self.session.connection self.subject = subject def __repr__(self): objects = [self.connection, self.session, self.link, self.delivery, self.subject] return "%s(%s)" % (self.type, ", ".join([str(o) for o in objects if o is not None])) class Transaction(object): """ Class to track state of an AMQP 1.0 transaction. """ def __init__(self, txn_ctrl, handler, settle_before_discharge=False): self.txn_ctrl = txn_ctrl self.handler = handler self.id = None self._declare = None self._discharge = None self.failed = False self._pending = [] self.settle_before_discharge = settle_before_discharge self.declare() def commit(self): self.discharge(False) def abort(self): self.discharge(True) def declare(self): self._declare = self._send_ctrl(symbol(u'amqp:declare:list'), [None]) def discharge(self, failed): self.failed = failed self._discharge = self._send_ctrl(symbol(u'amqp:discharge:list'), [self.id, failed]) def _send_ctrl(self, descriptor, value): delivery = self.txn_ctrl.send(Message(body=Described(descriptor, value))) delivery.transaction = self return delivery def send(self, sender, msg, tag=None): dlv = sender.send(msg, tag=tag) dlv.local.data = [self.id] dlv.update(0x34) return dlv def accept(self, delivery): self.update(delivery, PN_ACCEPTED) if self.settle_before_discharge: delivery.settle() else: self._pending.append(delivery) def update(self, delivery, state=None): if state: delivery.local.data = [self.id, Described(ulong(state), [])] delivery.update(0x34) def _release_pending(self): for d in self._pending: d.update(Delivery.RELEASED) d.settle() self._clear_pending() def _clear_pending(self): self._pending = [] def handle_outcome(self, event): if event.delivery == self._declare: if event.delivery.remote.data: self.id = event.delivery.remote.data[0] self.handler.on_transaction_declared(event) elif event.delivery.remote_state == Delivery.REJECTED: self.handler.on_transaction_declare_failed(event) else: log.warning("Unexpected outcome for declare: %s" % event.delivery.remote_state) self.handler.on_transaction_declare_failed(event) elif event.delivery == self._discharge: if event.delivery.remote_state == Delivery.REJECTED: if not self.failed: self.handler.on_transaction_commit_failed(event) self._release_pending() # make this optional? else: if self.failed: self.handler.on_transaction_aborted(event) self._release_pending() else: self.handler.on_transaction_committed(event) self._clear_pending() class LinkOption(object): """ Abstract interface for link configuration options """ def apply(self, link): """ Subclasses will implement any configuration logic in this method """ pass def test(self, link): """ Subclasses can override this to selectively apply an option e.g. based on some link criteria """ return True class AtMostOnce(LinkOption): def apply(self, link): link.snd_settle_mode = Link.SND_SETTLED class AtLeastOnce(LinkOption): def apply(self, link): link.snd_settle_mode = Link.SND_UNSETTLED link.rcv_settle_mode = Link.RCV_FIRST class SenderOption(LinkOption): def apply(self, sender): pass def test(self, link): return link.is_sender class ReceiverOption(LinkOption): def apply(self, receiver): pass def test(self, link): return link.is_receiver class DynamicNodeProperties(LinkOption): def __init__(self, props={}): self.properties = {} for k in props: if isinstance(k, symbol): self.properties[k] = props[k] else: self.properties[symbol(k)] = props[k] def apply(self, link): if link.is_receiver: link.source.properties.put_dict(self.properties) else: link.target.properties.put_dict(self.properties) class Filter(ReceiverOption): def __init__(self, filter_set={}): self.filter_set = filter_set def apply(self, receiver): receiver.source.filter.put_dict(self.filter_set) class Selector(Filter): """ Configures a link with a message selector filter """ def __init__(self, value, name='selector'): super(Selector, self).__init__({symbol(name): Described(symbol('apache.org:selector-filter:string'), value)}) class DurableSubscription(ReceiverOption): def apply(self, receiver): receiver.source.durability = Terminus.DELIVERIES receiver.source.expiry_policy = Terminus.EXPIRE_NEVER class Move(ReceiverOption): def apply(self, receiver): receiver.source.distribution_mode = Terminus.DIST_MODE_MOVE class Copy(ReceiverOption): def apply(self, receiver): receiver.source.distribution_mode = Terminus.DIST_MODE_COPY def _apply_link_options(options, link): if options: if isinstance(options, list): for o in options: if o.test(link): o.apply(link) else: if options.test(link): options.apply(link) def _create_session(connection, handler=None): session = connection.session() session.open() return session def _get_attr(target, name): if hasattr(target, name): return getattr(target, name) else: return None class SessionPerConnection(object): def __init__(self): self._default_session = None def session(self, connection): if not self._default_session: self._default_session = _create_session(connection) return self._default_session class GlobalOverrides(object): """ Internal handler that triggers the necessary socket connect for an opened connection. """ def __init__(self, base): self.base = base def on_unhandled(self, name, event): if not self._override(event): event.dispatch(self.base) def _override(self, event): conn = event.connection return conn and hasattr(conn, '_overrides') and event.dispatch(conn._overrides) class Connector(Handler): """ Internal handler that triggers the necessary socket connect for an opened connection. """ def __init__(self, connection): self.connection = connection self.address = None self.heartbeat = None self.reconnect = None self.ssl_domain = None self.allow_insecure_mechs = True self.allowed_mechs = None self.sasl_enabled = True self.user = None self.password = None self.virtual_host = None self.ssl_sni = None self.max_frame_size = None def _connect(self, connection, reactor): assert(reactor is not None) url = self.address.next() reactor.set_connection_host(connection, url.host, str(url.port)) # if virtual-host not set, use host from address as default if self.virtual_host is None: connection.hostname = url.host log.debug("connecting to %r..." % url) transport = Transport() if self.sasl_enabled: sasl = transport.sasl() sasl.allow_insecure_mechs = self.allow_insecure_mechs if url.username: connection.user = url.username elif self.user: connection.user = self.user if url.password: connection.password = url.password elif self.password: connection.password = self.password if self.allowed_mechs: sasl.allowed_mechs(self.allowed_mechs) transport.bind(connection) if self.heartbeat: transport.idle_timeout = self.heartbeat if url.scheme == 'amqps': if not self.ssl_domain: raise SSLUnavailable("amqps: SSL libraries not found") self.ssl = SSL(transport, self.ssl_domain) self.ssl.peer_hostname = self.ssl_sni or self.virtual_host or url.host if self.max_frame_size: transport.max_frame_size = self.max_frame_size def on_connection_local_open(self, event): self._connect(event.connection, event.reactor) def on_connection_remote_open(self, event): log.debug("connected to %s" % event.connection.hostname) if self.reconnect: self.reconnect.reset() self.transport = None def on_transport_tail_closed(self, event): self.on_transport_closed(event) def on_transport_closed(self, event): if self.connection is None: return if self.connection.state & Endpoint.LOCAL_ACTIVE: if self.reconnect: event.transport.unbind() delay = self.reconnect.next() if delay == 0: log.info("Disconnected, reconnecting...") self._connect(self.connection, event.reactor) return else: log.info("Disconnected will try to reconnect after %s seconds" % delay) event.reactor.schedule(delay, self) return else: log.debug("Disconnected") # See connector.cpp: conn.free()/pn_connection_release() here? self.connection = None def on_timer_task(self, event): self._connect(self.connection, event.reactor) class Backoff(object): """ A reconnect strategy involving an increasing delay between retries, up to a maximum or 10 seconds. """ def __init__(self): self.delay = 0 def reset(self): self.delay = 0 def next(self): current = self.delay if current == 0: self.delay = 0.1 else: self.delay = min(10, 2*current) return current class Urls(object): def __init__(self, values): self.values = [Url(v) for v in values] self.i = iter(self.values) def __iter__(self): return self def next(self): try: return next(self.i) except StopIteration: self.i = iter(self.values) return next(self.i) class SSLConfig(object): def __init__(self): self.client = SSLDomain(SSLDomain.MODE_CLIENT) self.server = SSLDomain(SSLDomain.MODE_SERVER) def set_credentials(self, cert_file, key_file, password): self.client.set_credentials(cert_file, key_file, password) self.server.set_credentials(cert_file, key_file, password) def set_trusted_ca_db(self, certificate_db): self.client.set_trusted_ca_db(certificate_db) self.server.set_trusted_ca_db(certificate_db) class Container(Reactor): """A representation of the AMQP concept of a 'container', which loosely speaking is something that establishes links to or from another container, over which messages are transfered. This is an extension to the Reactor class that adds convenience methods for creating connections and sender- or receiver- links. """ def __init__(self, *handlers, **kwargs): super(Container, self).__init__(*handlers, **kwargs) if "impl" not in kwargs: try: self.ssl = SSLConfig() except SSLUnavailable: self.ssl = None self.global_handler = GlobalOverrides(kwargs.get('global_handler', self.global_handler)) self.trigger = None self.container_id = str(generate_uuid()) self.allow_insecure_mechs = True self.allowed_mechs = None self.sasl_enabled = True self.user = None self.password = None Wrapper.__setattr__(self, 'subclass', self.__class__) def connect(self, url=None, urls=None, address=None, handler=None, reconnect=None, heartbeat=None, ssl_domain=None, **kwargs): """ Initiates the establishment of an AMQP connection. Returns an instance of proton.Connection. @param url: URL string of process to connect to @param urls: list of URL strings of process to try to connect to Only one of url or urls should be specified. @param reconnect: Reconnect is enabled by default. You can pass in an instance of Backoff to control reconnect behavior. A value of False will prevent the library from automatically trying to reconnect if the underlying socket is disconnected before the connection has been closed. @param heartbeat: A value in milliseconds indicating the desired frequency of heartbeats used to test the underlying socket is alive. @param ssl_domain: SSL configuration in the form of an instance of proton.SSLDomain. @param handler: a connection scoped handler that will be called to process any events in the scope of this connection or its child links @param kwargs: 'sasl_enabled', which determines whether a sasl layer is used for the connection; 'allowed_mechs', an optional string containing a space-separated list of SASL mechanisms to allow if sasl is enabled; 'allow_insecure_mechs', a flag indicating whether insecure mechanisms, such as PLAIN over a non-encrypted socket, are allowed; 'virtual_host', the hostname to set in the Open performative used by peer to determine the correct back-end service for the client. If 'virtual_host' is not supplied the host field from the URL is used instead; 'user', the user to authenticate; 'password', the authentication secret. """ conn = self.connection(handler) conn.container = self.container_id or str(generate_uuid()) conn.offered_capabilities = kwargs.get('offered_capabilities') conn.desired_capabilities = kwargs.get('desired_capabilities') conn.properties = kwargs.get('properties') connector = Connector(conn) connector.allow_insecure_mechs = kwargs.get('allow_insecure_mechs', self.allow_insecure_mechs) connector.allowed_mechs = kwargs.get('allowed_mechs', self.allowed_mechs) connector.sasl_enabled = kwargs.get('sasl_enabled', self.sasl_enabled) connector.user = kwargs.get('user', self.user) connector.password = kwargs.get('password', self.password) connector.virtual_host = kwargs.get('virtual_host') if connector.virtual_host: # only set hostname if virtual-host is a non-empty string conn.hostname = connector.virtual_host connector.ssl_sni = kwargs.get('sni') connector.max_frame_size = kwargs.get('max_frame_size') conn._overrides = connector if url: connector.address = Urls([url]) elif urls: connector.address = Urls(urls) elif address: connector.address = address else: raise ValueError("One of url, urls or address required") if heartbeat: connector.heartbeat = heartbeat if reconnect: connector.reconnect = reconnect elif reconnect is None: connector.reconnect = Backoff() # use container's default client domain if none specified. This is # only necessary of the URL specifies the "amqps:" scheme connector.ssl_domain = ssl_domain or (self.ssl and self.ssl.client) conn._session_policy = SessionPerConnection() #todo: make configurable conn.open() return conn def _get_id(self, container, remote, local): if local and remote: "%s-%s-%s" % (container, remote, local) elif local: return "%s-%s" % (container, local) elif remote: return "%s-%s" % (container, remote) else: return "%s-%s" % (container, str(generate_uuid())) def _get_session(self, context): if isinstance(context, Url): return self._get_session(self.connect(url=context)) elif isinstance(context, Session): return context elif isinstance(context, Connection): if hasattr(context, '_session_policy'): return context._session_policy.session(context) else: return _create_session(context) else: return context.session() def create_sender(self, context, target=None, source=None, name=None, handler=None, tags=None, options=None): """ Initiates the establishment of a link over which messages can be sent. Returns an instance of proton.Sender. There are two patterns of use. (1) A connection can be passed as the first argument, in which case the link is established on that connection. In this case the target address can be specified as the second argument (or as a keyword argument). The source address can also be specified if desired. (2) Alternatively a URL can be passed as the first argument. In this case a new connection will be established on which the link will be attached. If a path is specified and the target is not, then the path of the URL is used as the target address. The name of the link may be specified if desired, otherwise a unique name will be generated. Various LinkOptions can be specified to further control the attachment. """ if isinstance(context, _compat.STRING_TYPES): context = Url(context) if isinstance(context, Url) and not target: target = context.path session = self._get_session(context) snd = session.sender(name or self._get_id(session.connection.container, target, source)) if source: snd.source.address = source if target: snd.target.address = target if handler != None: snd.handler = handler if tags: snd.tag_generator = tags _apply_link_options(options, snd) snd.open() return snd def create_receiver(self, context, source=None, target=None, name=None, dynamic=False, handler=None, options=None): """ Initiates the establishment of a link over which messages can be received (aka a subscription). Returns an instance of proton.Receiver. There are two patterns of use. (1) A connection can be passed as the first argument, in which case the link is established on that connection. In this case the source address can be specified as the second argument (or as a keyword argument). The target address can also be specified if desired. (2) Alternatively a URL can be passed as the first argument. In this case a new connection will be established on which the link will be attached. If a path is specified and the source is not, then the path of the URL is used as the target address. The name of the link may be specified if desired, otherwise a unique name will be generated. Various LinkOptions can be specified to further control the attachment. """ if isinstance(context, _compat.STRING_TYPES): context = Url(context) if isinstance(context, Url) and not source: source = context.path session = self._get_session(context) rcv = session.receiver(name or self._get_id(session.connection.container, source, target)) if source: rcv.source.address = source if dynamic: rcv.source.dynamic = True if target: rcv.target.address = target if handler != None: rcv.handler = handler _apply_link_options(options, rcv) rcv.open() return rcv def declare_transaction(self, context, handler=None, settle_before_discharge=False): if not _get_attr(context, '_txn_ctrl'): class InternalTransactionHandler(OutgoingMessageHandler): def __init__(self): super(InternalTransactionHandler, self).__init__(auto_settle=True) def on_settled(self, event): if hasattr(event.delivery, "transaction"): event.transaction = event.delivery.transaction event.delivery.transaction.handle_outcome(event) def on_unhandled(self, method, event): if handler: event.dispatch(handler) context._txn_ctrl = self.create_sender(context, None, name='txn-ctrl', handler=InternalTransactionHandler()) context._txn_ctrl.target.type = Terminus.COORDINATOR context._txn_ctrl.target.capabilities.put_object(symbol(u'amqp:local-transactions')) return Transaction(context._txn_ctrl, handler, settle_before_discharge) def listen(self, url, ssl_domain=None): """ Initiates a server socket, accepting incoming AMQP connections on the interface and port specified. """ url = Url(url) acceptor = self.acceptor(url.host, url.port) ssl_config = ssl_domain if not ssl_config and url.scheme == 'amqps': # use container's default server domain if self.ssl: ssl_config = self.ssl.server else: raise SSLUnavailable("amqps: SSL libraries not found") if ssl_config: acceptor.set_ssl_domain(ssl_config) return acceptor def do_work(self, timeout=None): if timeout: self.timeout = timeout return self.process() qpid-proton-0.22.0/proton-c/bindings/python/proton/handlers.py0000664000000000000000000005334113257152177021331 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import heapq, logging, os, re, socket, time, types, weakref from proton import dispatch, generate_uuid, PN_ACCEPTED, SASL, symbol, ulong, Url from proton import Collector, Connection, Delivery, Described, Endpoint, Event, Link, Terminus, Timeout from proton import Message, Handler, ProtonException, Transport, TransportException, ConnectionException from select import select log = logging.getLogger("proton") class OutgoingMessageHandler(Handler): """ A utility for simpler and more intuitive handling of delivery events related to outgoing i.e. sent messages. """ def __init__(self, auto_settle=True, delegate=None): self.auto_settle = auto_settle self.delegate = delegate def on_link_flow(self, event): if event.link.is_sender and event.link.credit \ and event.link.state & Endpoint.LOCAL_ACTIVE \ and event.link.state & Endpoint.REMOTE_ACTIVE : self.on_sendable(event) def on_delivery(self, event): dlv = event.delivery if dlv.link.is_sender and dlv.updated: if dlv.remote_state == Delivery.ACCEPTED: self.on_accepted(event) elif dlv.remote_state == Delivery.REJECTED: self.on_rejected(event) elif dlv.remote_state == Delivery.RELEASED or dlv.remote_state == Delivery.MODIFIED: self.on_released(event) if dlv.settled: self.on_settled(event) if self.auto_settle: dlv.settle() def on_sendable(self, event): """ Called when the sender link has credit and messages can therefore be transferred. """ if self.delegate != None: dispatch(self.delegate, 'on_sendable', event) def on_accepted(self, event): """ Called when the remote peer accepts an outgoing message. """ if self.delegate != None: dispatch(self.delegate, 'on_accepted', event) def on_rejected(self, event): """ Called when the remote peer rejects an outgoing message. """ if self.delegate != None: dispatch(self.delegate, 'on_rejected', event) def on_released(self, event): """ Called when the remote peer releases an outgoing message. Note that this may be in response to either the RELEASE or MODIFIED state as defined by the AMQP specification. """ if self.delegate != None: dispatch(self.delegate, 'on_released', event) def on_settled(self, event): """ Called when the remote peer has settled the outgoing message. This is the point at which it should never be retransmitted. """ if self.delegate != None: dispatch(self.delegate, 'on_settled', event) def recv_msg(delivery): msg = Message() msg.decode(delivery.link.recv(delivery.pending)) delivery.link.advance() return msg class Reject(ProtonException): """ An exception that indicate a message should be rejected """ pass class Release(ProtonException): """ An exception that indicate a message should be rejected """ pass class Acking(object): def accept(self, delivery): """ Accepts a received message. Note that this method cannot currently be used in combination with transactions. """ self.settle(delivery, Delivery.ACCEPTED) def reject(self, delivery): """ Rejects a received message that is considered invalid or unprocessable. """ self.settle(delivery, Delivery.REJECTED) def release(self, delivery, delivered=True): """ Releases a received message, making it available at the source for any (other) interested receiver. The ``delivered`` parameter indicates whether this should be considered a delivery attempt (and the delivery count updated) or not. """ if delivered: self.settle(delivery, Delivery.MODIFIED) else: self.settle(delivery, Delivery.RELEASED) def settle(self, delivery, state=None): if state: delivery.update(state) delivery.settle() class IncomingMessageHandler(Handler, Acking): """ A utility for simpler and more intuitive handling of delivery events related to incoming i.e. received messages. """ def __init__(self, auto_accept=True, delegate=None): self.delegate = delegate self.auto_accept = auto_accept def on_delivery(self, event): dlv = event.delivery if not dlv.link.is_receiver: return if dlv.aborted: self.on_aborted(event) dlv.settle() elif dlv.readable and not dlv.partial: event.message = recv_msg(dlv) if event.link.state & Endpoint.LOCAL_CLOSED: if self.auto_accept: dlv.update(Delivery.RELEASED) dlv.settle() else: try: self.on_message(event) if self.auto_accept: dlv.update(Delivery.ACCEPTED) dlv.settle() except Reject: dlv.update(Delivery.REJECTED) dlv.settle() except Release: dlv.update(Delivery.MODIFIED) dlv.settle() elif dlv.updated and dlv.settled: self.on_settled(event) def on_message(self, event): """ Called when a message is received. The message itself can be obtained as a property on the event. For the purpose of referring to this message in further actions (e.g. if explicitly accepting it, the ``delivery`` should be used, also obtainable via a property on the event. """ if self.delegate != None: dispatch(self.delegate, 'on_message', event) def on_settled(self, event): if self.delegate != None: dispatch(self.delegate, 'on_settled', event) def on_aborted(self, event): if self.delegate != None: dispatch(self.delegate, 'on_aborted', event) class EndpointStateHandler(Handler): """ A utility that exposes 'endpoint' events i.e. the open/close for links, sessions and connections in a more intuitive manner. A XXX_opened method will be called when both local and remote peers have opened the link, session or connection. This can be used to confirm a locally initiated action for example. A XXX_opening method will be called when the remote peer has requested an open that was not initiated locally. By default this will simply open locally, which then triggers the XXX_opened call. The same applies to close. """ def __init__(self, peer_close_is_error=False, delegate=None): self.delegate = delegate self.peer_close_is_error = peer_close_is_error @classmethod def is_local_open(cls, endpoint): return endpoint.state & Endpoint.LOCAL_ACTIVE @classmethod def is_local_uninitialised(cls, endpoint): return endpoint.state & Endpoint.LOCAL_UNINIT @classmethod def is_local_closed(cls, endpoint): return endpoint.state & Endpoint.LOCAL_CLOSED @classmethod def is_remote_open(cls, endpoint): return endpoint.state & Endpoint.REMOTE_ACTIVE @classmethod def is_remote_closed(cls, endpoint): return endpoint.state & Endpoint.REMOTE_CLOSED @classmethod def print_error(cls, endpoint, endpoint_type): if endpoint.remote_condition: log.error(endpoint.remote_condition.description or endpoint.remote_condition.name) elif cls.is_local_open(endpoint) and cls.is_remote_closed(endpoint): log.error("%s closed by peer" % endpoint_type) def on_link_remote_close(self, event): if event.link.remote_condition: self.on_link_error(event) elif self.is_local_closed(event.link): self.on_link_closed(event) else: self.on_link_closing(event) event.link.close() def on_session_remote_close(self, event): if event.session.remote_condition: self.on_session_error(event) elif self.is_local_closed(event.session): self.on_session_closed(event) else: self.on_session_closing(event) event.session.close() def on_connection_remote_close(self, event): if event.connection.remote_condition: if event.connection.remote_condition.name == "amqp:connection:forced": # Treat this the same as just having the transport closed by the peer without # sending any events. Allow reconnection to happen transparently. return self.on_connection_error(event) elif self.is_local_closed(event.connection): self.on_connection_closed(event) else: self.on_connection_closing(event) event.connection.close() def on_connection_local_open(self, event): if self.is_remote_open(event.connection): self.on_connection_opened(event) def on_connection_remote_open(self, event): if self.is_local_open(event.connection): self.on_connection_opened(event) elif self.is_local_uninitialised(event.connection): self.on_connection_opening(event) event.connection.open() def on_session_local_open(self, event): if self.is_remote_open(event.session): self.on_session_opened(event) def on_session_remote_open(self, event): if self.is_local_open(event.session): self.on_session_opened(event) elif self.is_local_uninitialised(event.session): self.on_session_opening(event) event.session.open() def on_link_local_open(self, event): if self.is_remote_open(event.link): self.on_link_opened(event) def on_link_remote_open(self, event): if self.is_local_open(event.link): self.on_link_opened(event) elif self.is_local_uninitialised(event.link): self.on_link_opening(event) event.link.open() def on_connection_opened(self, event): if self.delegate != None: dispatch(self.delegate, 'on_connection_opened', event) def on_session_opened(self, event): if self.delegate != None: dispatch(self.delegate, 'on_session_opened', event) def on_link_opened(self, event): if self.delegate != None: dispatch(self.delegate, 'on_link_opened', event) def on_connection_opening(self, event): if self.delegate != None: dispatch(self.delegate, 'on_connection_opening', event) def on_session_opening(self, event): if self.delegate != None: dispatch(self.delegate, 'on_session_opening', event) def on_link_opening(self, event): if self.delegate != None: dispatch(self.delegate, 'on_link_opening', event) def on_connection_error(self, event): if self.delegate != None: dispatch(self.delegate, 'on_connection_error', event) else: self.log_error(event.connection, "connection") def on_session_error(self, event): if self.delegate != None: dispatch(self.delegate, 'on_session_error', event) else: self.log_error(event.session, "session") event.connection.close() def on_link_error(self, event): if self.delegate != None: dispatch(self.delegate, 'on_link_error', event) else: self.log_error(event.link, "link") event.connection.close() def on_connection_closed(self, event): if self.delegate != None: dispatch(self.delegate, 'on_connection_closed', event) def on_session_closed(self, event): if self.delegate != None: dispatch(self.delegate, 'on_session_closed', event) def on_link_closed(self, event): if self.delegate != None: dispatch(self.delegate, 'on_link_closed', event) def on_connection_closing(self, event): if self.delegate != None: dispatch(self.delegate, 'on_connection_closing', event) elif self.peer_close_is_error: self.on_connection_error(event) def on_session_closing(self, event): if self.delegate != None: dispatch(self.delegate, 'on_session_closing', event) elif self.peer_close_is_error: self.on_session_error(event) def on_link_closing(self, event): if self.delegate != None: dispatch(self.delegate, 'on_link_closing', event) elif self.peer_close_is_error: self.on_link_error(event) def on_transport_tail_closed(self, event): self.on_transport_closed(event) def on_transport_closed(self, event): if self.delegate != None and event.connection and self.is_local_open(event.connection): dispatch(self.delegate, 'on_disconnected', event) class MessagingHandler(Handler, Acking): """ A general purpose handler that makes the proton-c events somewhat simpler to deal with and/or avoids repetitive tasks for common use cases. """ def __init__(self, prefetch=10, auto_accept=True, auto_settle=True, peer_close_is_error=False): self.handlers = [] if prefetch: self.handlers.append(CFlowController(prefetch)) self.handlers.append(EndpointStateHandler(peer_close_is_error, weakref.proxy(self))) self.handlers.append(IncomingMessageHandler(auto_accept, weakref.proxy(self))) self.handlers.append(OutgoingMessageHandler(auto_settle, weakref.proxy(self))) self.fatal_conditions = ["amqp:unauthorized-access"] def on_transport_error(self, event): """ Called when some error is encountered with the transport over which the AMQP connection is to be established. This includes authentication errors as well as socket errors. """ if event.transport.condition: if event.transport.condition.info: log.error("%s: %s: %s" % (event.transport.condition.name, event.transport.condition.description, event.transport.condition.info)) else: log.error("%s: %s" % (event.transport.condition.name, event.transport.condition.description)) if event.transport.condition.name in self.fatal_conditions: event.connection.close() else: logging.error("Unspecified transport error") def on_connection_error(self, event): """ Called when the peer closes the connection with an error condition. """ EndpointStateHandler.print_error(event.connection, "connection") def on_session_error(self, event): """ Called when the peer closes the session with an error condition. """ EndpointStateHandler.print_error(event.session, "session") event.connection.close() def on_link_error(self, event): """ Called when the peer closes the link with an error condition. """ EndpointStateHandler.print_error(event.link, "link") event.connection.close() def on_reactor_init(self, event): """ Called when the event loop - the reactor - starts. """ if hasattr(event.reactor, 'subclass'): setattr(event, event.reactor.subclass.__name__.lower(), event.reactor) self.on_start(event) def on_start(self, event): """ Called when the event loop starts. (Just an alias for on_reactor_init) """ pass def on_connection_closed(self, event): """ Called when the connection is closed. """ pass def on_session_closed(self, event): """ Called when the session is closed. """ pass def on_link_closed(self, event): """ Called when the link is closed. """ pass def on_connection_closing(self, event): """ Called when the peer initiates the closing of the connection. """ pass def on_session_closing(self, event): """ Called when the peer initiates the closing of the session. """ pass def on_link_closing(self, event): """ Called when the peer initiates the closing of the link. """ pass def on_disconnected(self, event): """ Called when the socket is disconnected. """ pass def on_sendable(self, event): """ Called when the sender link has credit and messages can therefore be transferred. """ pass def on_accepted(self, event): """ Called when the remote peer accepts an outgoing message. """ pass def on_rejected(self, event): """ Called when the remote peer rejects an outgoing message. """ pass def on_released(self, event): """ Called when the remote peer releases an outgoing message. Note that this may be in response to either the RELEASE or MODIFIED state as defined by the AMQP specification. """ pass def on_settled(self, event): """ Called when the remote peer has settled the outgoing message. This is the point at which it should never be retransmitted. """ pass def on_message(self, event): """ Called when a message is received. The message itself can be obtained as a property on the event. For the purpose of referring to this message in further actions (e.g. if explicitly accepting it, the ``delivery`` should be used, also obtainable via a property on the event. """ pass class TransactionHandler(object): """ The interface for transaction handlers, i.e. objects that want to be notified of state changes related to a transaction. """ def on_transaction_declared(self, event): pass def on_transaction_committed(self, event): pass def on_transaction_aborted(self, event): pass def on_transaction_declare_failed(self, event): pass def on_transaction_commit_failed(self, event): pass class TransactionalClientHandler(MessagingHandler, TransactionHandler): """ An extension to the MessagingHandler for applications using transactions. """ def __init__(self, prefetch=10, auto_accept=False, auto_settle=True, peer_close_is_error=False): super(TransactionalClientHandler, self).__init__(prefetch, auto_accept, auto_settle, peer_close_is_error) def accept(self, delivery, transaction=None): if transaction: transaction.accept(delivery) else: super(TransactionalClientHandler, self).accept(delivery) from proton import WrappedHandler from cproton import pn_flowcontroller, pn_handshaker, pn_iohandler class CFlowController(WrappedHandler): def __init__(self, window=1024): WrappedHandler.__init__(self, lambda: pn_flowcontroller(window)) class CHandshaker(WrappedHandler): def __init__(self): WrappedHandler.__init__(self, pn_handshaker) class IOHandler(WrappedHandler): def __init__(self): WrappedHandler.__init__(self, pn_iohandler) class PythonIO: def __init__(self): self.selectables = [] self.delegate = IOHandler() def on_unhandled(self, method, event): event.dispatch(self.delegate) def on_selectable_init(self, event): self.selectables.append(event.context) def on_selectable_updated(self, event): pass def on_selectable_final(self, event): sel = event.context if sel.is_terminal: self.selectables.remove(sel) sel.release() def on_reactor_quiesced(self, event): reactor = event.reactor # check if we are still quiesced, other handlers of # on_reactor_quiesced could have produced events to process if not reactor.quiesced: return reading = [] writing = [] deadline = None for sel in self.selectables: if sel.reading: reading.append(sel) if sel.writing: writing.append(sel) if sel.deadline: if deadline is None: deadline = sel.deadline else: deadline = min(sel.deadline, deadline) if deadline is not None: timeout = deadline - time.time() else: timeout = reactor.timeout if (timeout < 0): timeout = 0 timeout = min(timeout, reactor.timeout) readable, writable, _ = select(reading, writing, [], timeout) reactor.mark() now = time.time() for s in readable: s.readable() for s in writable: s.writable() for s in self.selectables: if s.deadline and now > s.deadline: s.expired() reactor.yield_() qpid-proton-0.22.0/proton-c/bindings/python/proton/_compat.py0000664000000000000000000000457113257152177021154 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ Utilities to help Proton support both python2 and python3. """ import sys import types IS_PY2 = sys.version_info[0] == 2 IS_PY3 = sys.version_info[0] == 3 if IS_PY3: INT_TYPES = (int,) TEXT_TYPES = (str,) STRING_TYPES = (str,) BINARY_TYPES = (bytes,) CLASS_TYPES = (type,) def raise_(t, v=None, tb=None): """Mimic the old 2.x raise behavior: Raise an exception of type t with value v using optional traceback tb """ if v is None: v = t() if tb is None: raise v else: raise v.with_traceback(tb) def bin2str(s, encoding='utf-8'): return s def iteritems(d): return iter(d.items()) def unichar(i): return chr(i) def str2bin(s, encoding='latin-1'): """Convert str to binary type""" return s.encode(encoding) def str2unicode(s): return s else: INT_TYPES = (int, long) TEXT_TYPES = (unicode,) # includes both unicode and non-unicode strings: STRING_TYPES = (basestring,) BINARY_TYPES = (str,) CLASS_TYPES = (type, types.ClassType) # the raise syntax will cause a parse error in Py3, so 'sneak' in a # definition that won't cause the parser to barf exec("""def raise_(t, v=None, tb=None): raise t, v, tb """) def bin2str(s, encoding='utf-8'): return s.decode(encoding) def iteritems(d, **kw): return d.iteritems() def unichar(i): return unichr(i) def str2bin(s, encoding='latin-1'): return s def str2unicode(s): return unicode(s, "unicode_escape") qpid-proton-0.22.0/proton-c/bindings/python/proton/__init__.py0000664000000000000000000031200213257152177021260 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ The proton module defines a suite of APIs that implement the AMQP 1.0 protocol. The proton APIs consist of the following classes: - L{Message} -- A class for creating and/or accessing AMQP message content. - L{Data} -- A class for creating and/or accessing arbitrary AMQP encoded data. """ from __future__ import absolute_import from cproton import * from .wrapper import Wrapper from proton import _compat import logging, weakref, socket, sys, threading try: handler = logging.NullHandler() except AttributeError: class NullHandler(logging.Handler): def handle(self, record): pass def emit(self, record): pass def createLock(self): self.lock = None handler = NullHandler() log = logging.getLogger("proton") log.addHandler(handler) try: import uuid def generate_uuid(): return uuid.uuid4() except ImportError: """ No 'native' UUID support. Provide a very basic UUID type that is a compatible subset of the uuid type provided by more modern python releases. """ import struct class uuid: class UUID: def __init__(self, hex=None, bytes=None): if [hex, bytes].count(None) != 1: raise TypeError("need one of hex or bytes") if bytes is not None: self.bytes = bytes elif hex is not None: fields=hex.split("-") fields[4:5] = [fields[4][:4], fields[4][4:]] self.bytes = struct.pack("!LHHHHL", *[int(x,16) for x in fields]) def __cmp__(self, other): if isinstance(other, uuid.UUID): return cmp(self.bytes, other.bytes) else: return -1 def __str__(self): return "%08x-%04x-%04x-%04x-%04x%08x" % struct.unpack("!LHHHHL", self.bytes) def __repr__(self): return "UUID(%r)" % str(self) def __hash__(self): return self.bytes.__hash__() import os, random, time rand = random.Random() rand.seed((os.getpid(), time.time(), socket.gethostname())) def random_uuid(): data = [rand.randint(0, 255) for i in xrange(16)] # From RFC4122, the version bits are set to 0100 data[6] &= 0x0F data[6] |= 0x40 # From RFC4122, the top two bits of byte 8 get set to 01 data[8] &= 0x3F data[8] |= 0x80 return "".join(map(chr, data)) def uuid4(): return uuid.UUID(bytes=random_uuid()) def generate_uuid(): return uuid4() # # Hacks to provide Python2 <---> Python3 compatibility # try: bytes() except NameError: bytes = str try: long() except NameError: long = int try: unicode() except NameError: unicode = str VERSION_MAJOR = PN_VERSION_MAJOR VERSION_MINOR = PN_VERSION_MINOR VERSION_POINT = PN_VERSION_POINT VERSION = (VERSION_MAJOR, VERSION_MINOR, VERSION_POINT) API_LANGUAGE = "C" IMPLEMENTATION_LANGUAGE = "C" class Constant(object): def __init__(self, name): self.name = name def __repr__(self): return self.name class ProtonException(Exception): """ The root of the proton exception hierarchy. All proton exception classes derive from this exception. """ pass class Timeout(ProtonException): """ A timeout exception indicates that a blocking operation has timed out. """ pass class Interrupt(ProtonException): """ An interrupt exception indicates that a blocking operation was interrupted. """ pass class MessageException(ProtonException): """ The MessageException class is the root of the message exception hierarchy. All exceptions generated by the Message class derive from this exception. """ pass EXCEPTIONS = { PN_TIMEOUT: Timeout, PN_INTR: Interrupt } PENDING = Constant("PENDING") ACCEPTED = Constant("ACCEPTED") REJECTED = Constant("REJECTED") RELEASED = Constant("RELEASED") MODIFIED = Constant("MODIFIED") ABORTED = Constant("ABORTED") SETTLED = Constant("SETTLED") STATUSES = { PN_STATUS_ABORTED: ABORTED, PN_STATUS_ACCEPTED: ACCEPTED, PN_STATUS_REJECTED: REJECTED, PN_STATUS_RELEASED: RELEASED, PN_STATUS_MODIFIED: MODIFIED, PN_STATUS_PENDING: PENDING, PN_STATUS_SETTLED: SETTLED, PN_STATUS_UNKNOWN: None } class Message(object): """The L{Message} class is a mutable holder of message content. @ivar instructions: delivery instructions for the message @type instructions: dict @ivar annotations: infrastructure defined message annotations @type annotations: dict @ivar properties: application defined message properties @type properties: dict @ivar body: message body @type body: bytes | unicode | dict | list | int | long | float | UUID """ DEFAULT_PRIORITY = PN_DEFAULT_PRIORITY def __init__(self, body=None, **kwargs): """ @param kwargs: Message property name/value pairs to initialise the Message """ self._msg = pn_message() self._id = Data(pn_message_id(self._msg)) self._correlation_id = Data(pn_message_correlation_id(self._msg)) self.instructions = None self.annotations = None self.properties = None self.body = body for k,v in _compat.iteritems(kwargs): getattr(self, k) # Raise exception if it's not a valid attribute. setattr(self, k, v) def __del__(self): if hasattr(self, "_msg"): pn_message_free(self._msg) del self._msg def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, MessageException) raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg)))) else: return err def _check_property_keys(self): for k in self.properties.keys(): if not isinstance(k, (bytes, str, unicode)): raise MessageException('Application property key is not unicode string: key=%s %s' % (str(k), type(k))) if isinstance(k, bytes): self.properties[_compat.bin2str(k)] = self.properties.pop(k) def _pre_encode(self): inst = Data(pn_message_instructions(self._msg)) ann = Data(pn_message_annotations(self._msg)) props = Data(pn_message_properties(self._msg)) body = Data(pn_message_body(self._msg)) inst.clear() if self.instructions is not None: inst.put_object(self.instructions) ann.clear() if self.annotations is not None: ann.put_object(self.annotations) props.clear() if self.properties is not None: self._check_property_keys() props.put_object(self.properties) body.clear() if self.body is not None: body.put_object(self.body) def _post_decode(self): inst = Data(pn_message_instructions(self._msg)) ann = Data(pn_message_annotations(self._msg)) props = Data(pn_message_properties(self._msg)) body = Data(pn_message_body(self._msg)) if inst.next(): self.instructions = inst.get_object() else: self.instructions = None if ann.next(): self.annotations = ann.get_object() else: self.annotations = None if props.next(): self.properties = props.get_object() else: self.properties = None if body.next(): self.body = body.get_object() else: self.body = None def clear(self): """ Clears the contents of the L{Message}. All fields will be reset to their default values. """ pn_message_clear(self._msg) self.instructions = None self.annotations = None self.properties = None self.body = None def _is_inferred(self): return pn_message_is_inferred(self._msg) def _set_inferred(self, value): self._check(pn_message_set_inferred(self._msg, bool(value))) inferred = property(_is_inferred, _set_inferred, doc=""" The inferred flag for a message indicates how the message content is encoded into AMQP sections. If inferred is true then binary and list values in the body of the message will be encoded as AMQP DATA and AMQP SEQUENCE sections, respectively. If inferred is false, then all values in the body of the message will be encoded as AMQP VALUE sections regardless of their type. """) def _is_durable(self): return pn_message_is_durable(self._msg) def _set_durable(self, value): self._check(pn_message_set_durable(self._msg, bool(value))) durable = property(_is_durable, _set_durable, doc=""" The durable property indicates that the message should be held durably by any intermediaries taking responsibility for the message. """) def _get_priority(self): return pn_message_get_priority(self._msg) def _set_priority(self, value): self._check(pn_message_set_priority(self._msg, value)) priority = property(_get_priority, _set_priority, doc=""" The priority of the message. """) def _get_ttl(self): return millis2secs(pn_message_get_ttl(self._msg)) def _set_ttl(self, value): self._check(pn_message_set_ttl(self._msg, secs2millis(value))) ttl = property(_get_ttl, _set_ttl, doc=""" The time to live of the message measured in seconds. Expired messages may be dropped. """) def _is_first_acquirer(self): return pn_message_is_first_acquirer(self._msg) def _set_first_acquirer(self, value): self._check(pn_message_set_first_acquirer(self._msg, bool(value))) first_acquirer = property(_is_first_acquirer, _set_first_acquirer, doc=""" True iff the recipient is the first to acquire the message. """) def _get_delivery_count(self): return pn_message_get_delivery_count(self._msg) def _set_delivery_count(self, value): self._check(pn_message_set_delivery_count(self._msg, value)) delivery_count = property(_get_delivery_count, _set_delivery_count, doc=""" The number of delivery attempts made for this message. """) def _get_id(self): return self._id.get_object() def _set_id(self, value): if type(value) in _compat.INT_TYPES: value = ulong(value) self._id.rewind() self._id.put_object(value) id = property(_get_id, _set_id, doc=""" The id of the message. """) def _get_user_id(self): return pn_message_get_user_id(self._msg) def _set_user_id(self, value): self._check(pn_message_set_user_id(self._msg, value)) user_id = property(_get_user_id, _set_user_id, doc=""" The user id of the message creator. """) def _get_address(self): return utf82unicode(pn_message_get_address(self._msg)) def _set_address(self, value): self._check(pn_message_set_address(self._msg, unicode2utf8(value))) address = property(_get_address, _set_address, doc=""" The address of the message. """) def _get_subject(self): return utf82unicode(pn_message_get_subject(self._msg)) def _set_subject(self, value): self._check(pn_message_set_subject(self._msg, unicode2utf8(value))) subject = property(_get_subject, _set_subject, doc=""" The subject of the message. """) def _get_reply_to(self): return utf82unicode(pn_message_get_reply_to(self._msg)) def _set_reply_to(self, value): self._check(pn_message_set_reply_to(self._msg, unicode2utf8(value))) reply_to = property(_get_reply_to, _set_reply_to, doc=""" The reply-to address for the message. """) def _get_correlation_id(self): return self._correlation_id.get_object() def _set_correlation_id(self, value): if type(value) in _compat.INT_TYPES: value = ulong(value) self._correlation_id.rewind() self._correlation_id.put_object(value) correlation_id = property(_get_correlation_id, _set_correlation_id, doc=""" The correlation-id for the message. """) def _get_content_type(self): return symbol(utf82unicode(pn_message_get_content_type(self._msg))) def _set_content_type(self, value): self._check(pn_message_set_content_type(self._msg, unicode2utf8(value))) content_type = property(_get_content_type, _set_content_type, doc=""" The content-type of the message. """) def _get_content_encoding(self): return symbol(utf82unicode(pn_message_get_content_encoding(self._msg))) def _set_content_encoding(self, value): self._check(pn_message_set_content_encoding(self._msg, unicode2utf8(value))) content_encoding = property(_get_content_encoding, _set_content_encoding, doc=""" The content-encoding of the message. """) def _get_expiry_time(self): return millis2secs(pn_message_get_expiry_time(self._msg)) def _set_expiry_time(self, value): self._check(pn_message_set_expiry_time(self._msg, secs2millis(value))) expiry_time = property(_get_expiry_time, _set_expiry_time, doc=""" The expiry time of the message. """) def _get_creation_time(self): return millis2secs(pn_message_get_creation_time(self._msg)) def _set_creation_time(self, value): self._check(pn_message_set_creation_time(self._msg, secs2millis(value))) creation_time = property(_get_creation_time, _set_creation_time, doc=""" The creation time of the message. """) def _get_group_id(self): return utf82unicode(pn_message_get_group_id(self._msg)) def _set_group_id(self, value): self._check(pn_message_set_group_id(self._msg, unicode2utf8(value))) group_id = property(_get_group_id, _set_group_id, doc=""" The group id of the message. """) def _get_group_sequence(self): return pn_message_get_group_sequence(self._msg) def _set_group_sequence(self, value): self._check(pn_message_set_group_sequence(self._msg, value)) group_sequence = property(_get_group_sequence, _set_group_sequence, doc=""" The sequence of the message within its group. """) def _get_reply_to_group_id(self): return utf82unicode(pn_message_get_reply_to_group_id(self._msg)) def _set_reply_to_group_id(self, value): self._check(pn_message_set_reply_to_group_id(self._msg, unicode2utf8(value))) reply_to_group_id = property(_get_reply_to_group_id, _set_reply_to_group_id, doc=""" The group-id for any replies. """) def encode(self): self._pre_encode() sz = 16 while True: err, data = pn_message_encode(self._msg, sz) if err == PN_OVERFLOW: sz *= 2 continue else: self._check(err) return data def decode(self, data): self._check(pn_message_decode(self._msg, data)) self._post_decode() def send(self, sender, tag=None): dlv = sender.delivery(tag or sender.delivery_tag()) encoded = self.encode() sender.stream(encoded) sender.advance() if sender.snd_settle_mode == Link.SND_SETTLED: dlv.settle() return dlv def recv(self, link): """ Receives and decodes the message content for the current delivery from the link. Upon success it will return the current delivery for the link. If there is no current delivery, or if the current delivery is incomplete, or if the link is not a receiver, it will return None. @type link: Link @param link: the link to receive a message from @return the delivery associated with the decoded message (or None) """ if link.is_sender: return None dlv = link.current if not dlv or dlv.partial: return None dlv.encoded = link.recv(dlv.pending) link.advance() # the sender has already forgotten about the delivery, so we might # as well too if link.remote_snd_settle_mode == Link.SND_SETTLED: dlv.settle() self.decode(dlv.encoded) return dlv def __repr2__(self): props = [] for attr in ("inferred", "address", "reply_to", "durable", "ttl", "priority", "first_acquirer", "delivery_count", "id", "correlation_id", "user_id", "group_id", "group_sequence", "reply_to_group_id", "instructions", "annotations", "properties", "body"): value = getattr(self, attr) if value: props.append("%s=%r" % (attr, value)) return "Message(%s)" % ", ".join(props) def __repr__(self): tmp = pn_string(None) err = pn_inspect(self._msg, tmp) result = pn_string_get(tmp) pn_free(tmp) self._check(err) return result _DEFAULT = object() class Selectable(Wrapper): @staticmethod def wrap(impl): if impl is None: return None else: return Selectable(impl) def __init__(self, impl): Wrapper.__init__(self, impl, pn_selectable_attachments) def _init(self): pass def fileno(self, fd = _DEFAULT): if fd is _DEFAULT: return pn_selectable_get_fd(self._impl) elif fd is None: pn_selectable_set_fd(self._impl, PN_INVALID_SOCKET) else: pn_selectable_set_fd(self._impl, fd) def _is_reading(self): return pn_selectable_is_reading(self._impl) def _set_reading(self, val): pn_selectable_set_reading(self._impl, bool(val)) reading = property(_is_reading, _set_reading) def _is_writing(self): return pn_selectable_is_writing(self._impl) def _set_writing(self, val): pn_selectable_set_writing(self._impl, bool(val)) writing = property(_is_writing, _set_writing) def _get_deadline(self): tstamp = pn_selectable_get_deadline(self._impl) if tstamp: return millis2secs(tstamp) else: return None def _set_deadline(self, deadline): pn_selectable_set_deadline(self._impl, secs2millis(deadline)) deadline = property(_get_deadline, _set_deadline) def readable(self): pn_selectable_readable(self._impl) def writable(self): pn_selectable_writable(self._impl) def expired(self): pn_selectable_expired(self._impl) def _is_registered(self): return pn_selectable_is_registered(self._impl) def _set_registered(self, registered): pn_selectable_set_registered(self._impl, registered) registered = property(_is_registered, _set_registered, doc=""" The registered property may be get/set by an I/O polling system to indicate whether the fd has been registered or not. """) @property def is_terminal(self): return pn_selectable_is_terminal(self._impl) def terminate(self): pn_selectable_terminate(self._impl) def release(self): pn_selectable_release(self._impl) class DataException(ProtonException): """ The DataException class is the root of the Data exception hierarchy. All exceptions raised by the Data class extend this exception. """ pass class UnmappedType: def __init__(self, msg): self.msg = msg def __repr__(self): return "UnmappedType(%s)" % self.msg class ulong(long): def __repr__(self): return "ulong(%s)" % long.__repr__(self) class timestamp(long): def __repr__(self): return "timestamp(%s)" % long.__repr__(self) class symbol(unicode): def __repr__(self): return "symbol(%s)" % unicode.__repr__(self) class char(unicode): def __repr__(self): return "char(%s)" % unicode.__repr__(self) class byte(int): def __repr__(self): return "byte(%s)" % int.__repr__(self) class short(int): def __repr__(self): return "short(%s)" % int.__repr__(self) class int32(int): def __repr__(self): return "int32(%s)" % int.__repr__(self) class ubyte(int): def __repr__(self): return "ubyte(%s)" % int.__repr__(self) class ushort(int): def __repr__(self): return "ushort(%s)" % int.__repr__(self) class uint(long): def __repr__(self): return "uint(%s)" % long.__repr__(self) class float32(float): def __repr__(self): return "float32(%s)" % float.__repr__(self) class decimal32(int): def __repr__(self): return "decimal32(%s)" % int.__repr__(self) class decimal64(long): def __repr__(self): return "decimal64(%s)" % long.__repr__(self) class decimal128(bytes): def __repr__(self): return "decimal128(%s)" % bytes.__repr__(self) class Described(object): def __init__(self, descriptor, value): self.descriptor = descriptor self.value = value def __repr__(self): return "Described(%r, %r)" % (self.descriptor, self.value) def __eq__(self, o): if isinstance(o, Described): return self.descriptor == o.descriptor and self.value == o.value else: return False UNDESCRIBED = Constant("UNDESCRIBED") class Array(object): def __init__(self, descriptor, type, *elements): self.descriptor = descriptor self.type = type self.elements = elements def __iter__(self): return iter(self.elements) def __repr__(self): if self.elements: els = ", %s" % (", ".join(map(repr, self.elements))) else: els = "" return "Array(%r, %r%s)" % (self.descriptor, self.type, els) def __eq__(self, o): if isinstance(o, Array): return self.descriptor == o.descriptor and \ self.type == o.type and self.elements == o.elements else: return False class Data: """ The L{Data} class provides an interface for decoding, extracting, creating, and encoding arbitrary AMQP data. A L{Data} object contains a tree of AMQP values. Leaf nodes in this tree correspond to scalars in the AMQP type system such as L{ints} or L{strings}. Non-leaf nodes in this tree correspond to compound values in the AMQP type system such as L{lists}, L{maps}, L{arrays}, or L{described values}. The root node of the tree is the L{Data} object itself and can have an arbitrary number of children. A L{Data} object maintains the notion of the current sibling node and a current parent node. Siblings are ordered within their parent. Values are accessed and/or added by using the L{next}, L{prev}, L{enter}, and L{exit} methods to navigate to the desired location in the tree and using the supplied variety of put_*/get_* methods to access or add a value of the desired type. The put_* methods will always add a value I{after} the current node in the tree. If the current node has a next sibling the put_* method will overwrite the value on this node. If there is no current node or the current node has no next sibling then one will be added. The put_* methods always set the added/modified node to the current node. The get_* methods read the value of the current node and do not change which node is current. The following types of scalar values are supported: - L{NULL} - L{BOOL} - L{UBYTE} - L{USHORT} - L{SHORT} - L{UINT} - L{INT} - L{ULONG} - L{LONG} - L{FLOAT} - L{DOUBLE} - L{BINARY} - L{STRING} - L{SYMBOL} The following types of compound values are supported: - L{DESCRIBED} - L{ARRAY} - L{LIST} - L{MAP} """ NULL = PN_NULL; "A null value." BOOL = PN_BOOL; "A boolean value." UBYTE = PN_UBYTE; "An unsigned byte value." BYTE = PN_BYTE; "A signed byte value." USHORT = PN_USHORT; "An unsigned short value." SHORT = PN_SHORT; "A short value." UINT = PN_UINT; "An unsigned int value." INT = PN_INT; "A signed int value." CHAR = PN_CHAR; "A character value." ULONG = PN_ULONG; "An unsigned long value." LONG = PN_LONG; "A signed long value." TIMESTAMP = PN_TIMESTAMP; "A timestamp value." FLOAT = PN_FLOAT; "A float value." DOUBLE = PN_DOUBLE; "A double value." DECIMAL32 = PN_DECIMAL32; "A DECIMAL32 value." DECIMAL64 = PN_DECIMAL64; "A DECIMAL64 value." DECIMAL128 = PN_DECIMAL128; "A DECIMAL128 value." UUID = PN_UUID; "A UUID value." BINARY = PN_BINARY; "A binary string." STRING = PN_STRING; "A unicode string." SYMBOL = PN_SYMBOL; "A symbolic string." DESCRIBED = PN_DESCRIBED; "A described value." ARRAY = PN_ARRAY; "An array value." LIST = PN_LIST; "A list value." MAP = PN_MAP; "A map value." type_names = { NULL: "null", BOOL: "bool", BYTE: "byte", UBYTE: "ubyte", SHORT: "short", USHORT: "ushort", INT: "int", UINT: "uint", CHAR: "char", LONG: "long", ULONG: "ulong", TIMESTAMP: "timestamp", FLOAT: "float", DOUBLE: "double", DECIMAL32: "decimal32", DECIMAL64: "decimal64", DECIMAL128: "decimal128", UUID: "uuid", BINARY: "binary", STRING: "string", SYMBOL: "symbol", DESCRIBED: "described", ARRAY: "array", LIST: "list", MAP: "map" } @classmethod def type_name(type): return Data.type_names[type] def __init__(self, capacity=16): if type(capacity) in _compat.INT_TYPES: self._data = pn_data(capacity) self._free = True else: self._data = capacity self._free = False def __del__(self): if self._free and hasattr(self, "_data"): pn_data_free(self._data) del self._data def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, DataException) raise exc("[%s]: %s" % (err, pn_error_text(pn_data_error(self._data)))) else: return err def clear(self): """ Clears the data object. """ pn_data_clear(self._data) def rewind(self): """ Clears current node and sets the parent to the root node. Clearing the current node sets it _before_ the first node, calling next() will advance to the first node. """ assert self._data is not None pn_data_rewind(self._data) def next(self): """ Advances the current node to its next sibling and returns its type. If there is no next sibling the current node remains unchanged and None is returned. """ found = pn_data_next(self._data) if found: return self.type() else: return None def prev(self): """ Advances the current node to its previous sibling and returns its type. If there is no previous sibling the current node remains unchanged and None is returned. """ found = pn_data_prev(self._data) if found: return self.type() else: return None def enter(self): """ Sets the parent node to the current node and clears the current node. Clearing the current node sets it _before_ the first child, call next() advances to the first child. """ return pn_data_enter(self._data) def exit(self): """ Sets the current node to the parent node and the parent node to its own parent. """ return pn_data_exit(self._data) def lookup(self, name): return pn_data_lookup(self._data, name) def narrow(self): pn_data_narrow(self._data) def widen(self): pn_data_widen(self._data) def type(self): """ Returns the type of the current node. """ dtype = pn_data_type(self._data) if dtype == -1: return None else: return dtype def encoded_size(self): """ Returns the size in bytes needed to encode the data in AMQP format. """ return pn_data_encoded_size(self._data) def encode(self): """ Returns a representation of the data encoded in AMQP format. """ size = 1024 while True: cd, enc = pn_data_encode(self._data, size) if cd == PN_OVERFLOW: size *= 2 elif cd >= 0: return enc else: self._check(cd) def decode(self, encoded): """ Decodes the first value from supplied AMQP data and returns the number of bytes consumed. @type encoded: binary @param encoded: AMQP encoded binary data """ return self._check(pn_data_decode(self._data, encoded)) def put_list(self): """ Puts a list value. Elements may be filled by entering the list node and putting element values. >>> data = Data() >>> data.put_list() >>> data.enter() >>> data.put_int(1) >>> data.put_int(2) >>> data.put_int(3) >>> data.exit() """ self._check(pn_data_put_list(self._data)) def put_map(self): """ Puts a map value. Elements may be filled by entering the map node and putting alternating key value pairs. >>> data = Data() >>> data.put_map() >>> data.enter() >>> data.put_string("key") >>> data.put_string("value") >>> data.exit() """ self._check(pn_data_put_map(self._data)) def put_array(self, described, element_type): """ Puts an array value. Elements may be filled by entering the array node and putting the element values. The values must all be of the specified array element type. If an array is described then the first child value of the array is the descriptor and may be of any type. >>> data = Data() >>> >>> data.put_array(False, Data.INT) >>> data.enter() >>> data.put_int(1) >>> data.put_int(2) >>> data.put_int(3) >>> data.exit() >>> >>> data.put_array(True, Data.DOUBLE) >>> data.enter() >>> data.put_symbol("array-descriptor") >>> data.put_double(1.1) >>> data.put_double(1.2) >>> data.put_double(1.3) >>> data.exit() @type described: bool @param described: specifies whether the array is described @type element_type: int @param element_type: the type of the array elements """ self._check(pn_data_put_array(self._data, described, element_type)) def put_described(self): """ Puts a described value. A described node has two children, the descriptor and the value. These are specified by entering the node and putting the desired values. >>> data = Data() >>> data.put_described() >>> data.enter() >>> data.put_symbol("value-descriptor") >>> data.put_string("the value") >>> data.exit() """ self._check(pn_data_put_described(self._data)) def put_null(self): """ Puts a null value. """ self._check(pn_data_put_null(self._data)) def put_bool(self, b): """ Puts a boolean value. @param b: a boolean value """ self._check(pn_data_put_bool(self._data, b)) def put_ubyte(self, ub): """ Puts an unsigned byte value. @param ub: an integral value """ self._check(pn_data_put_ubyte(self._data, ub)) def put_byte(self, b): """ Puts a signed byte value. @param b: an integral value """ self._check(pn_data_put_byte(self._data, b)) def put_ushort(self, us): """ Puts an unsigned short value. @param us: an integral value. """ self._check(pn_data_put_ushort(self._data, us)) def put_short(self, s): """ Puts a signed short value. @param s: an integral value """ self._check(pn_data_put_short(self._data, s)) def put_uint(self, ui): """ Puts an unsigned int value. @param ui: an integral value """ self._check(pn_data_put_uint(self._data, ui)) def put_int(self, i): """ Puts a signed int value. @param i: an integral value """ self._check(pn_data_put_int(self._data, i)) def put_char(self, c): """ Puts a char value. @param c: a single character """ self._check(pn_data_put_char(self._data, ord(c))) def put_ulong(self, ul): """ Puts an unsigned long value. @param ul: an integral value """ self._check(pn_data_put_ulong(self._data, ul)) def put_long(self, l): """ Puts a signed long value. @param l: an integral value """ self._check(pn_data_put_long(self._data, l)) def put_timestamp(self, t): """ Puts a timestamp value. @param t: an integral value """ self._check(pn_data_put_timestamp(self._data, t)) def put_float(self, f): """ Puts a float value. @param f: a floating point value """ self._check(pn_data_put_float(self._data, f)) def put_double(self, d): """ Puts a double value. @param d: a floating point value. """ self._check(pn_data_put_double(self._data, d)) def put_decimal32(self, d): """ Puts a decimal32 value. @param d: a decimal32 value """ self._check(pn_data_put_decimal32(self._data, d)) def put_decimal64(self, d): """ Puts a decimal64 value. @param d: a decimal64 value """ self._check(pn_data_put_decimal64(self._data, d)) def put_decimal128(self, d): """ Puts a decimal128 value. @param d: a decimal128 value """ self._check(pn_data_put_decimal128(self._data, d)) def put_uuid(self, u): """ Puts a UUID value. @param u: a uuid value """ self._check(pn_data_put_uuid(self._data, u.bytes)) def put_binary(self, b): """ Puts a binary value. @type b: binary @param b: a binary value """ self._check(pn_data_put_binary(self._data, b)) def put_memoryview(self, mv): """Put a python memoryview object as an AMQP binary value""" self.put_binary(mv.tobytes()) def put_buffer(self, buff): """Put a python buffer object as an AMQP binary value""" self.put_binary(bytes(buff)) def put_string(self, s): """ Puts a unicode value. @type s: unicode @param s: a unicode value """ self._check(pn_data_put_string(self._data, s.encode("utf8"))) def put_symbol(self, s): """ Puts a symbolic value. @type s: string @param s: the symbol name """ self._check(pn_data_put_symbol(self._data, s.encode('ascii'))) def get_list(self): """ If the current node is a list, return the number of elements, otherwise return zero. List elements can be accessed by entering the list. >>> count = data.get_list() >>> data.enter() >>> for i in range(count): ... type = data.next() ... if type == Data.STRING: ... print data.get_string() ... elif type == ...: ... ... >>> data.exit() """ return pn_data_get_list(self._data) def get_map(self): """ If the current node is a map, return the number of child elements, otherwise return zero. Key value pairs can be accessed by entering the map. >>> count = data.get_map() >>> data.enter() >>> for i in range(count/2): ... type = data.next() ... if type == Data.STRING: ... print data.get_string() ... elif type == ...: ... ... >>> data.exit() """ return pn_data_get_map(self._data) def get_array(self): """ If the current node is an array, return a tuple of the element count, a boolean indicating whether the array is described, and the type of each element, otherwise return (0, False, None). Array data can be accessed by entering the array. >>> # read an array of strings with a symbolic descriptor >>> count, described, type = data.get_array() >>> data.enter() >>> data.next() >>> print "Descriptor:", data.get_symbol() >>> for i in range(count): ... data.next() ... print "Element:", data.get_string() >>> data.exit() """ count = pn_data_get_array(self._data) described = pn_data_is_array_described(self._data) type = pn_data_get_array_type(self._data) if type == -1: type = None return count, described, type def is_described(self): """ Checks if the current node is a described value. The descriptor and value may be accessed by entering the described value. >>> # read a symbolically described string >>> assert data.is_described() # will error if the current node is not described >>> data.enter() >>> data.next() >>> print data.get_symbol() >>> data.next() >>> print data.get_string() >>> data.exit() """ return pn_data_is_described(self._data) def is_null(self): """ Checks if the current node is a null. """ return pn_data_is_null(self._data) def get_bool(self): """ If the current node is a boolean, returns its value, returns False otherwise. """ return pn_data_get_bool(self._data) def get_ubyte(self): """ If the current node is an unsigned byte, returns its value, returns 0 otherwise. """ return ubyte(pn_data_get_ubyte(self._data)) def get_byte(self): """ If the current node is a signed byte, returns its value, returns 0 otherwise. """ return byte(pn_data_get_byte(self._data)) def get_ushort(self): """ If the current node is an unsigned short, returns its value, returns 0 otherwise. """ return ushort(pn_data_get_ushort(self._data)) def get_short(self): """ If the current node is a signed short, returns its value, returns 0 otherwise. """ return short(pn_data_get_short(self._data)) def get_uint(self): """ If the current node is an unsigned int, returns its value, returns 0 otherwise. """ return uint(pn_data_get_uint(self._data)) def get_int(self): """ If the current node is a signed int, returns its value, returns 0 otherwise. """ return int32(pn_data_get_int(self._data)) def get_char(self): """ If the current node is a char, returns its value, returns 0 otherwise. """ return char(_compat.unichar(pn_data_get_char(self._data))) def get_ulong(self): """ If the current node is an unsigned long, returns its value, returns 0 otherwise. """ return ulong(pn_data_get_ulong(self._data)) def get_long(self): """ If the current node is an signed long, returns its value, returns 0 otherwise. """ return long(pn_data_get_long(self._data)) def get_timestamp(self): """ If the current node is a timestamp, returns its value, returns 0 otherwise. """ return timestamp(pn_data_get_timestamp(self._data)) def get_float(self): """ If the current node is a float, returns its value, raises 0 otherwise. """ return float32(pn_data_get_float(self._data)) def get_double(self): """ If the current node is a double, returns its value, returns 0 otherwise. """ return pn_data_get_double(self._data) # XXX: need to convert def get_decimal32(self): """ If the current node is a decimal32, returns its value, returns 0 otherwise. """ return decimal32(pn_data_get_decimal32(self._data)) # XXX: need to convert def get_decimal64(self): """ If the current node is a decimal64, returns its value, returns 0 otherwise. """ return decimal64(pn_data_get_decimal64(self._data)) # XXX: need to convert def get_decimal128(self): """ If the current node is a decimal128, returns its value, returns 0 otherwise. """ return decimal128(pn_data_get_decimal128(self._data)) def get_uuid(self): """ If the current node is a UUID, returns its value, returns None otherwise. """ if pn_data_type(self._data) == Data.UUID: return uuid.UUID(bytes=pn_data_get_uuid(self._data)) else: return None def get_binary(self): """ If the current node is binary, returns its value, returns "" otherwise. """ return pn_data_get_binary(self._data) def get_string(self): """ If the current node is a string, returns its value, returns "" otherwise. """ return pn_data_get_string(self._data).decode("utf8") def get_symbol(self): """ If the current node is a symbol, returns its value, returns "" otherwise. """ return symbol(pn_data_get_symbol(self._data).decode('ascii')) def copy(self, src): self._check(pn_data_copy(self._data, src._data)) def format(self): sz = 16 while True: err, result = pn_data_format(self._data, sz) if err == PN_OVERFLOW: sz *= 2 continue else: self._check(err) return result def dump(self): pn_data_dump(self._data) def put_dict(self, d): self.put_map() self.enter() try: for k, v in d.items(): self.put_object(k) self.put_object(v) finally: self.exit() def get_dict(self): if self.enter(): try: result = {} while self.next(): k = self.get_object() if self.next(): v = self.get_object() else: v = None result[k] = v finally: self.exit() return result def put_sequence(self, s): self.put_list() self.enter() try: for o in s: self.put_object(o) finally: self.exit() def get_sequence(self): if self.enter(): try: result = [] while self.next(): result.append(self.get_object()) finally: self.exit() return result def get_py_described(self): if self.enter(): try: self.next() descriptor = self.get_object() self.next() value = self.get_object() finally: self.exit() return Described(descriptor, value) def put_py_described(self, d): self.put_described() self.enter() try: self.put_object(d.descriptor) self.put_object(d.value) finally: self.exit() def get_py_array(self): """ If the current node is an array, return an Array object representing the array and its contents. Otherwise return None. This is a convenience wrapper around get_array, enter, etc. """ count, described, type = self.get_array() if type is None: return None if self.enter(): try: if described: self.next() descriptor = self.get_object() else: descriptor = UNDESCRIBED elements = [] while self.next(): elements.append(self.get_object()) finally: self.exit() return Array(descriptor, type, *elements) def put_py_array(self, a): described = a.descriptor != UNDESCRIBED self.put_array(described, a.type) self.enter() try: if described: self.put_object(a.descriptor) for e in a.elements: self.put_object(e) finally: self.exit() put_mappings = { None.__class__: lambda s, _: s.put_null(), bool: put_bool, ubyte: put_ubyte, ushort: put_ushort, uint: put_uint, ulong: put_ulong, byte: put_byte, short: put_short, int32: put_int, long: put_long, float32: put_float, float: put_double, decimal32: put_decimal32, decimal64: put_decimal64, decimal128: put_decimal128, char: put_char, timestamp: put_timestamp, uuid.UUID: put_uuid, bytes: put_binary, unicode: put_string, symbol: put_symbol, list: put_sequence, tuple: put_sequence, dict: put_dict, Described: put_py_described, Array: put_py_array } # for python 3.x, long is merely an alias for int, but for python 2.x # we need to add an explicit int since it is a different type if int not in put_mappings: put_mappings[int] = put_int # Python >=3.0 has 'memoryview', <=2.5 has 'buffer', >=2.6 has both. try: put_mappings[memoryview] = put_memoryview except NameError: pass try: put_mappings[buffer] = put_buffer except NameError: pass get_mappings = { NULL: lambda s: None, BOOL: get_bool, BYTE: get_byte, UBYTE: get_ubyte, SHORT: get_short, USHORT: get_ushort, INT: get_int, UINT: get_uint, CHAR: get_char, LONG: get_long, ULONG: get_ulong, TIMESTAMP: get_timestamp, FLOAT: get_float, DOUBLE: get_double, DECIMAL32: get_decimal32, DECIMAL64: get_decimal64, DECIMAL128: get_decimal128, UUID: get_uuid, BINARY: get_binary, STRING: get_string, SYMBOL: get_symbol, DESCRIBED: get_py_described, ARRAY: get_py_array, LIST: get_sequence, MAP: get_dict } def put_object(self, obj): putter = self.put_mappings[obj.__class__] putter(self, obj) def get_object(self): type = self.type() if type is None: return None getter = self.get_mappings.get(type) if getter: return getter(self) else: return UnmappedType(str(type)) class ConnectionException(ProtonException): pass class Endpoint(object): LOCAL_UNINIT = PN_LOCAL_UNINIT REMOTE_UNINIT = PN_REMOTE_UNINIT LOCAL_ACTIVE = PN_LOCAL_ACTIVE REMOTE_ACTIVE = PN_REMOTE_ACTIVE LOCAL_CLOSED = PN_LOCAL_CLOSED REMOTE_CLOSED = PN_REMOTE_CLOSED def _init(self): self.condition = None def _update_cond(self): obj2cond(self.condition, self._get_cond_impl()) @property def remote_condition(self): return cond2obj(self._get_remote_cond_impl()) # the following must be provided by subclasses def _get_cond_impl(self): assert False, "Subclass must override this!" def _get_remote_cond_impl(self): assert False, "Subclass must override this!" def _get_handler(self): from . import reactor ractor = reactor.Reactor.wrap(pn_object_reactor(self._impl)) if ractor: on_error = ractor.on_error_delegate() else: on_error = None record = self._get_attachments() return WrappedHandler.wrap(pn_record_get_handler(record), on_error) def _set_handler(self, handler): from . import reactor ractor = reactor.Reactor.wrap(pn_object_reactor(self._impl)) if ractor: on_error = ractor.on_error_delegate() else: on_error = None impl = _chandler(handler, on_error) record = self._get_attachments() pn_record_set_handler(record, impl) pn_decref(impl) handler = property(_get_handler, _set_handler) @property def transport(self): return self.connection.transport class Condition: def __init__(self, name, description=None, info=None): self.name = name self.description = description self.info = info def __repr__(self): return "Condition(%s)" % ", ".join([repr(x) for x in (self.name, self.description, self.info) if x]) def __eq__(self, o): if not isinstance(o, Condition): return False return self.name == o.name and \ self.description == o.description and \ self.info == o.info def obj2cond(obj, cond): pn_condition_clear(cond) if obj: pn_condition_set_name(cond, str(obj.name)) pn_condition_set_description(cond, obj.description) info = Data(pn_condition_info(cond)) if obj.info: info.put_object(obj.info) def cond2obj(cond): if pn_condition_is_set(cond): return Condition(pn_condition_get_name(cond), pn_condition_get_description(cond), dat2obj(pn_condition_info(cond))) else: return None def dat2obj(dimpl): if dimpl: d = Data(dimpl) d.rewind() d.next() obj = d.get_object() d.rewind() return obj def obj2dat(obj, dimpl): if obj is not None: d = Data(dimpl) d.put_object(obj) def secs2millis(secs): return long(secs*1000) def millis2secs(millis): return float(millis)/1000.0 def timeout2millis(secs): if secs is None: return PN_MILLIS_MAX return secs2millis(secs) def millis2timeout(millis): if millis == PN_MILLIS_MAX: return None return millis2secs(millis) def unicode2utf8(string): """Some Proton APIs expect a null terminated string. Convert python text types to UTF8 to avoid zero bytes introduced by other multi-byte encodings. This method will throw if the string cannot be converted. """ if string is None: return None if _compat.IS_PY2: if isinstance(string, unicode): return string.encode('utf-8') elif isinstance(string, str): return string else: # decoding a string results in bytes if isinstance(string, str): string = string.encode('utf-8') # fall through if isinstance(string, bytes): return string.decode('utf-8') raise TypeError("Unrecognized string type: %r (%s)" % (string, type(string))) def utf82unicode(string): """Covert C strings returned from proton-c into python unicode""" if string is None: return None if isinstance(string, _compat.TEXT_TYPES): # already unicode return string elif isinstance(string, _compat.BINARY_TYPES): return string.decode('utf8') else: raise TypeError("Unrecognized string type") class Connection(Wrapper, Endpoint): """ A representation of an AMQP connection """ @staticmethod def wrap(impl): if impl is None: return None else: return Connection(impl) def __init__(self, impl = pn_connection): Wrapper.__init__(self, impl, pn_connection_attachments) def _init(self): Endpoint._init(self) self.offered_capabilities = None self.desired_capabilities = None self.properties = None def _get_attachments(self): return pn_connection_attachments(self._impl) @property def connection(self): return self @property def transport(self): return Transport.wrap(pn_connection_transport(self._impl)) def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, ConnectionException) raise exc("[%s]: %s" % (err, pn_connection_error(self._impl))) else: return err def _get_cond_impl(self): return pn_connection_condition(self._impl) def _get_remote_cond_impl(self): return pn_connection_remote_condition(self._impl) def collect(self, collector): if collector is None: pn_connection_collect(self._impl, None) else: pn_connection_collect(self._impl, collector._impl) self._collector = weakref.ref(collector) def _get_container(self): return utf82unicode(pn_connection_get_container(self._impl)) def _set_container(self, name): return pn_connection_set_container(self._impl, unicode2utf8(name)) container = property(_get_container, _set_container) def _get_hostname(self): return utf82unicode(pn_connection_get_hostname(self._impl)) def _set_hostname(self, name): return pn_connection_set_hostname(self._impl, unicode2utf8(name)) hostname = property(_get_hostname, _set_hostname, doc=""" Set the name of the host (either fully qualified or relative) to which this connection is connecting to. This information may be used by the remote peer to determine the correct back-end service to connect the client to. This value will be sent in the Open performative, and will be used by SSL and SASL layers to identify the peer. """) def _get_user(self): return utf82unicode(pn_connection_get_user(self._impl)) def _set_user(self, name): return pn_connection_set_user(self._impl, unicode2utf8(name)) user = property(_get_user, _set_user) def _get_password(self): return None def _set_password(self, name): return pn_connection_set_password(self._impl, unicode2utf8(name)) password = property(_get_password, _set_password) @property def remote_container(self): """The container identifier specified by the remote peer for this connection.""" return pn_connection_remote_container(self._impl) @property def remote_hostname(self): """The hostname specified by the remote peer for this connection.""" return pn_connection_remote_hostname(self._impl) @property def remote_offered_capabilities(self): """The capabilities offered by the remote peer for this connection.""" return dat2obj(pn_connection_remote_offered_capabilities(self._impl)) @property def remote_desired_capabilities(self): """The capabilities desired by the remote peer for this connection.""" return dat2obj(pn_connection_remote_desired_capabilities(self._impl)) @property def remote_properties(self): """The properties specified by the remote peer for this connection.""" return dat2obj(pn_connection_remote_properties(self._impl)) def open(self): """ Opens the connection. In more detail, this moves the local state of the connection to the ACTIVE state and triggers an open frame to be sent to the peer. A connection is fully active once both peers have opened it. """ obj2dat(self.offered_capabilities, pn_connection_offered_capabilities(self._impl)) obj2dat(self.desired_capabilities, pn_connection_desired_capabilities(self._impl)) obj2dat(self.properties, pn_connection_properties(self._impl)) pn_connection_open(self._impl) def close(self): """ Closes the connection. In more detail, this moves the local state of the connection to the CLOSED state and triggers a close frame to be sent to the peer. A connection is fully closed once both peers have closed it. """ self._update_cond() pn_connection_close(self._impl) if hasattr(self, '_session_policy'): # break circular ref del self._session_policy @property def state(self): """ The state of the connection as a bit field. The state has a local and a remote component. Each of these can be in one of three states: UNINIT, ACTIVE or CLOSED. These can be tested by masking against LOCAL_UNINIT, LOCAL_ACTIVE, LOCAL_CLOSED, REMOTE_UNINIT, REMOTE_ACTIVE and REMOTE_CLOSED. """ return pn_connection_state(self._impl) def session(self): """ Returns a new session on this connection. """ ssn = pn_session(self._impl) if ssn is None: raise(SessionException("Session allocation failed.")) else: return Session(ssn) def session_head(self, mask): return Session.wrap(pn_session_head(self._impl, mask)) def link_head(self, mask): return Link.wrap(pn_link_head(self._impl, mask)) @property def work_head(self): return Delivery.wrap(pn_work_head(self._impl)) @property def error(self): return pn_error_code(pn_connection_error(self._impl)) def free(self): pn_connection_release(self._impl) class SessionException(ProtonException): pass class Session(Wrapper, Endpoint): @staticmethod def wrap(impl): if impl is None: return None else: return Session(impl) def __init__(self, impl): Wrapper.__init__(self, impl, pn_session_attachments) def _get_attachments(self): return pn_session_attachments(self._impl) def _get_cond_impl(self): return pn_session_condition(self._impl) def _get_remote_cond_impl(self): return pn_session_remote_condition(self._impl) def _get_incoming_capacity(self): return pn_session_get_incoming_capacity(self._impl) def _set_incoming_capacity(self, capacity): pn_session_set_incoming_capacity(self._impl, capacity) incoming_capacity = property(_get_incoming_capacity, _set_incoming_capacity) def _get_outgoing_window(self): return pn_session_get_outgoing_window(self._impl) def _set_outgoing_window(self, window): pn_session_set_outgoing_window(self._impl, window) outgoing_window = property(_get_outgoing_window, _set_outgoing_window) @property def outgoing_bytes(self): return pn_session_outgoing_bytes(self._impl) @property def incoming_bytes(self): return pn_session_incoming_bytes(self._impl) def open(self): pn_session_open(self._impl) def close(self): self._update_cond() pn_session_close(self._impl) def next(self, mask): return Session.wrap(pn_session_next(self._impl, mask)) @property def state(self): return pn_session_state(self._impl) @property def connection(self): return Connection.wrap(pn_session_connection(self._impl)) def sender(self, name): return Sender(pn_sender(self._impl, unicode2utf8(name))) def receiver(self, name): return Receiver(pn_receiver(self._impl, unicode2utf8(name))) def free(self): pn_session_free(self._impl) class LinkException(ProtonException): pass class Link(Wrapper, Endpoint): """ A representation of an AMQP link, of which there are two concrete implementations, Sender and Receiver. """ SND_UNSETTLED = PN_SND_UNSETTLED SND_SETTLED = PN_SND_SETTLED SND_MIXED = PN_SND_MIXED RCV_FIRST = PN_RCV_FIRST RCV_SECOND = PN_RCV_SECOND @staticmethod def wrap(impl): if impl is None: return None if pn_link_is_sender(impl): return Sender(impl) else: return Receiver(impl) def __init__(self, impl): Wrapper.__init__(self, impl, pn_link_attachments) def _get_attachments(self): return pn_link_attachments(self._impl) def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, LinkException) raise exc("[%s]: %s" % (err, pn_error_text(pn_link_error(self._impl)))) else: return err def _get_cond_impl(self): return pn_link_condition(self._impl) def _get_remote_cond_impl(self): return pn_link_remote_condition(self._impl) def open(self): """ Opens the link. In more detail, this moves the local state of the link to the ACTIVE state and triggers an attach frame to be sent to the peer. A link is fully active once both peers have attached it. """ pn_link_open(self._impl) def close(self): """ Closes the link. In more detail, this moves the local state of the link to the CLOSED state and triggers an detach frame (with the closed flag set) to be sent to the peer. A link is fully closed once both peers have detached it. """ self._update_cond() pn_link_close(self._impl) @property def state(self): """ The state of the link as a bit field. The state has a local and a remote component. Each of these can be in one of three states: UNINIT, ACTIVE or CLOSED. These can be tested by masking against LOCAL_UNINIT, LOCAL_ACTIVE, LOCAL_CLOSED, REMOTE_UNINIT, REMOTE_ACTIVE and REMOTE_CLOSED. """ return pn_link_state(self._impl) @property def source(self): """The source of the link as described by the local peer.""" return Terminus(pn_link_source(self._impl)) @property def target(self): """The target of the link as described by the local peer.""" return Terminus(pn_link_target(self._impl)) @property def remote_source(self): """The source of the link as described by the remote peer.""" return Terminus(pn_link_remote_source(self._impl)) @property def remote_target(self): """The target of the link as described by the remote peer.""" return Terminus(pn_link_remote_target(self._impl)) @property def session(self): return Session.wrap(pn_link_session(self._impl)) @property def connection(self): """The connection on which this link was attached.""" return self.session.connection def delivery(self, tag): return Delivery(pn_delivery(self._impl, tag)) @property def current(self): return Delivery.wrap(pn_link_current(self._impl)) def advance(self): return pn_link_advance(self._impl) @property def unsettled(self): return pn_link_unsettled(self._impl) @property def credit(self): """The amount of outstanding credit on this link.""" return pn_link_credit(self._impl) @property def available(self): return pn_link_available(self._impl) @property def queued(self): return pn_link_queued(self._impl) def next(self, mask): return Link.wrap(pn_link_next(self._impl, mask)) @property def name(self): """Returns the name of the link""" return utf82unicode(pn_link_name(self._impl)) @property def is_sender(self): """Returns true if this link is a sender.""" return pn_link_is_sender(self._impl) @property def is_receiver(self): """Returns true if this link is a receiver.""" return pn_link_is_receiver(self._impl) @property def remote_snd_settle_mode(self): return pn_link_remote_snd_settle_mode(self._impl) @property def remote_rcv_settle_mode(self): return pn_link_remote_rcv_settle_mode(self._impl) def _get_snd_settle_mode(self): return pn_link_snd_settle_mode(self._impl) def _set_snd_settle_mode(self, mode): pn_link_set_snd_settle_mode(self._impl, mode) snd_settle_mode = property(_get_snd_settle_mode, _set_snd_settle_mode) def _get_rcv_settle_mode(self): return pn_link_rcv_settle_mode(self._impl) def _set_rcv_settle_mode(self, mode): pn_link_set_rcv_settle_mode(self._impl, mode) rcv_settle_mode = property(_get_rcv_settle_mode, _set_rcv_settle_mode) def _get_drain(self): return pn_link_get_drain(self._impl) def _set_drain(self, b): pn_link_set_drain(self._impl, bool(b)) drain_mode = property(_get_drain, _set_drain) def drained(self): return pn_link_drained(self._impl) @property def remote_max_message_size(self): return pn_link_remote_max_message_size(self._impl) def _get_max_message_size(self): return pn_link_max_message_size(self._impl) def _set_max_message_size(self, mode): pn_link_set_max_message_size(self._impl, mode) max_message_size = property(_get_max_message_size, _set_max_message_size) def detach(self): return pn_link_detach(self._impl) def free(self): pn_link_free(self._impl) class Terminus(object): UNSPECIFIED = PN_UNSPECIFIED SOURCE = PN_SOURCE TARGET = PN_TARGET COORDINATOR = PN_COORDINATOR NONDURABLE = PN_NONDURABLE CONFIGURATION = PN_CONFIGURATION DELIVERIES = PN_DELIVERIES DIST_MODE_UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED DIST_MODE_COPY = PN_DIST_MODE_COPY DIST_MODE_MOVE = PN_DIST_MODE_MOVE EXPIRE_WITH_LINK = PN_EXPIRE_WITH_LINK EXPIRE_WITH_SESSION = PN_EXPIRE_WITH_SESSION EXPIRE_WITH_CONNECTION = PN_EXPIRE_WITH_CONNECTION EXPIRE_NEVER = PN_EXPIRE_NEVER def __init__(self, impl): self._impl = impl def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, LinkException) raise exc("[%s]" % err) else: return err def _get_type(self): return pn_terminus_get_type(self._impl) def _set_type(self, type): self._check(pn_terminus_set_type(self._impl, type)) type = property(_get_type, _set_type) def _get_address(self): """The address that identifies the source or target node""" return utf82unicode(pn_terminus_get_address(self._impl)) def _set_address(self, address): self._check(pn_terminus_set_address(self._impl, unicode2utf8(address))) address = property(_get_address, _set_address) def _get_durability(self): return pn_terminus_get_durability(self._impl) def _set_durability(self, seconds): self._check(pn_terminus_set_durability(self._impl, seconds)) durability = property(_get_durability, _set_durability) def _get_expiry_policy(self): return pn_terminus_get_expiry_policy(self._impl) def _set_expiry_policy(self, seconds): self._check(pn_terminus_set_expiry_policy(self._impl, seconds)) expiry_policy = property(_get_expiry_policy, _set_expiry_policy) def _get_timeout(self): return pn_terminus_get_timeout(self._impl) def _set_timeout(self, seconds): self._check(pn_terminus_set_timeout(self._impl, seconds)) timeout = property(_get_timeout, _set_timeout) def _is_dynamic(self): """Indicates whether the source or target node was dynamically created""" return pn_terminus_is_dynamic(self._impl) def _set_dynamic(self, dynamic): self._check(pn_terminus_set_dynamic(self._impl, dynamic)) dynamic = property(_is_dynamic, _set_dynamic) def _get_distribution_mode(self): return pn_terminus_get_distribution_mode(self._impl) def _set_distribution_mode(self, mode): self._check(pn_terminus_set_distribution_mode(self._impl, mode)) distribution_mode = property(_get_distribution_mode, _set_distribution_mode) @property def properties(self): """Properties of a dynamic source or target.""" return Data(pn_terminus_properties(self._impl)) @property def capabilities(self): """Capabilities of the source or target.""" return Data(pn_terminus_capabilities(self._impl)) @property def outcomes(self): return Data(pn_terminus_outcomes(self._impl)) @property def filter(self): """A filter on a source allows the set of messages transfered over the link to be restricted""" return Data(pn_terminus_filter(self._impl)) def copy(self, src): self._check(pn_terminus_copy(self._impl, src._impl)) class Sender(Link): """ A link over which messages are sent. """ def offered(self, n): pn_link_offered(self._impl, n) def stream(self, data): """ Send specified data as part of the current delivery @type data: binary @param data: data to send """ return self._check(pn_link_send(self._impl, data)) def send(self, obj, tag=None): """ Send specified object over this sender; the object is expected to have a send() method on it that takes the sender and an optional tag as arguments. Where the object is a Message, this will send the message over this link, creating a new delivery for the purpose. """ if hasattr(obj, 'send'): return obj.send(self, tag=tag) else: # treat object as bytes return self.stream(obj) def delivery_tag(self): if not hasattr(self, 'tag_generator'): def simple_tags(): count = 1 while True: yield str(count) count += 1 self.tag_generator = simple_tags() return next(self.tag_generator) class Receiver(Link): """ A link over which messages are received. """ def flow(self, n): """Increases the credit issued to the remote sender by the specified number of messages.""" pn_link_flow(self._impl, n) def recv(self, limit): n, binary = pn_link_recv(self._impl, limit) if n == PN_EOS: return None else: self._check(n) return binary def drain(self, n): pn_link_drain(self._impl, n) def draining(self): return pn_link_draining(self._impl) class NamedInt(int): values = {} def __new__(cls, i, name): ni = super(NamedInt, cls).__new__(cls, i) cls.values[i] = ni return ni def __init__(self, i, name): self.name = name def __repr__(self): return self.name def __str__(self): return self.name @classmethod def get(cls, i): return cls.values.get(i, i) class DispositionType(NamedInt): values = {} class Disposition(object): RECEIVED = DispositionType(PN_RECEIVED, "RECEIVED") ACCEPTED = DispositionType(PN_ACCEPTED, "ACCEPTED") REJECTED = DispositionType(PN_REJECTED, "REJECTED") RELEASED = DispositionType(PN_RELEASED, "RELEASED") MODIFIED = DispositionType(PN_MODIFIED, "MODIFIED") def __init__(self, impl, local): self._impl = impl self.local = local self._data = None self._condition = None self._annotations = None @property def type(self): return DispositionType.get(pn_disposition_type(self._impl)) def _get_section_number(self): return pn_disposition_get_section_number(self._impl) def _set_section_number(self, n): pn_disposition_set_section_number(self._impl, n) section_number = property(_get_section_number, _set_section_number) def _get_section_offset(self): return pn_disposition_get_section_offset(self._impl) def _set_section_offset(self, n): pn_disposition_set_section_offset(self._impl, n) section_offset = property(_get_section_offset, _set_section_offset) def _get_failed(self): return pn_disposition_is_failed(self._impl) def _set_failed(self, b): pn_disposition_set_failed(self._impl, b) failed = property(_get_failed, _set_failed) def _get_undeliverable(self): return pn_disposition_is_undeliverable(self._impl) def _set_undeliverable(self, b): pn_disposition_set_undeliverable(self._impl, b) undeliverable = property(_get_undeliverable, _set_undeliverable) def _get_data(self): if self.local: return self._data else: return dat2obj(pn_disposition_data(self._impl)) def _set_data(self, obj): if self.local: self._data = obj else: raise AttributeError("data attribute is read-only") data = property(_get_data, _set_data) def _get_annotations(self): if self.local: return self._annotations else: return dat2obj(pn_disposition_annotations(self._impl)) def _set_annotations(self, obj): if self.local: self._annotations = obj else: raise AttributeError("annotations attribute is read-only") annotations = property(_get_annotations, _set_annotations) def _get_condition(self): if self.local: return self._condition else: return cond2obj(pn_disposition_condition(self._impl)) def _set_condition(self, obj): if self.local: self._condition = obj else: raise AttributeError("condition attribute is read-only") condition = property(_get_condition, _set_condition) class Delivery(Wrapper): """ Tracks and/or records the delivery of a message over a link. """ RECEIVED = Disposition.RECEIVED ACCEPTED = Disposition.ACCEPTED REJECTED = Disposition.REJECTED RELEASED = Disposition.RELEASED MODIFIED = Disposition.MODIFIED @staticmethod def wrap(impl): if impl is None: return None else: return Delivery(impl) def __init__(self, impl): Wrapper.__init__(self, impl, pn_delivery_attachments) def _init(self): self.local = Disposition(pn_delivery_local(self._impl), True) self.remote = Disposition(pn_delivery_remote(self._impl), False) @property def tag(self): """The identifier for the delivery.""" return pn_delivery_tag(self._impl) @property def writable(self): """Returns true for an outgoing delivery to which data can now be written.""" return pn_delivery_writable(self._impl) @property def readable(self): """Returns true for an incoming delivery that has data to read.""" return pn_delivery_readable(self._impl) @property def updated(self): """Returns true if the state of the delivery has been updated (e.g. it has been settled and/or accepted, rejected etc).""" return pn_delivery_updated(self._impl) def update(self, state): """ Set the local state of the delivery e.g. ACCEPTED, REJECTED, RELEASED. """ obj2dat(self.local._data, pn_disposition_data(self.local._impl)) obj2dat(self.local._annotations, pn_disposition_annotations(self.local._impl)) obj2cond(self.local._condition, pn_disposition_condition(self.local._impl)) pn_delivery_update(self._impl, state) @property def pending(self): return pn_delivery_pending(self._impl) @property def partial(self): """ Returns true for an incoming delivery if not all the data is yet available. """ return pn_delivery_partial(self._impl) @property def local_state(self): """Returns the local state of the delivery.""" return DispositionType.get(pn_delivery_local_state(self._impl)) @property def remote_state(self): """ Returns the state of the delivery as indicated by the remote peer. """ return DispositionType.get(pn_delivery_remote_state(self._impl)) @property def settled(self): """ Returns true if the delivery has been settled by the remote peer. """ return pn_delivery_settled(self._impl) def settle(self): """ Settles the delivery locally. This indicates the application considers the delivery complete and does not wish to receive any further events about it. Every delivery should be settled locally. """ pn_delivery_settle(self._impl) @property def aborted(self): """Returns true if the delivery has been aborted.""" return pn_delivery_aborted(self._impl) def abort(self): """ Aborts the delivery. This indicates the application wishes to invalidate any data that may have already been sent on this delivery. The delivery cannot be aborted after it has been completely delivered. """ pn_delivery_abort(self._impl) @property def work_next(self): return Delivery.wrap(pn_work_next(self._impl)) @property def link(self): """ Returns the link on which the delivery was sent or received. """ return Link.wrap(pn_delivery_link(self._impl)) @property def session(self): """ Returns the session over which the delivery was sent or received. """ return self.link.session @property def connection(self): """ Returns the connection over which the delivery was sent or received. """ return self.session.connection @property def transport(self): return self.connection.transport class TransportException(ProtonException): pass class TraceAdapter: def __init__(self, tracer): self.tracer = tracer def __call__(self, trans_impl, message): self.tracer(Transport.wrap(trans_impl), message) class Transport(Wrapper): TRACE_OFF = PN_TRACE_OFF TRACE_DRV = PN_TRACE_DRV TRACE_FRM = PN_TRACE_FRM TRACE_RAW = PN_TRACE_RAW CLIENT = 1 SERVER = 2 @staticmethod def wrap(impl): if impl is None: return None else: return Transport(_impl=impl) def __init__(self, mode=None, _impl = pn_transport): Wrapper.__init__(self, _impl, pn_transport_attachments) if mode == Transport.SERVER: pn_transport_set_server(self._impl) elif mode is None or mode==Transport.CLIENT: pass else: raise TransportException("Cannot initialise Transport from mode: %s" % str(mode)) def _init(self): self._sasl = None self._ssl = None def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, TransportException) raise exc("[%s]: %s" % (err, pn_error_text(pn_transport_error(self._impl)))) else: return err def _set_tracer(self, tracer): pn_transport_set_pytracer(self._impl, TraceAdapter(tracer)); def _get_tracer(self): adapter = pn_transport_get_pytracer(self._impl) if adapter: return adapter.tracer else: return None tracer = property(_get_tracer, _set_tracer, doc=""" A callback for trace logging. The callback is passed the transport and log message. """) def log(self, message): pn_transport_log(self._impl, message) def require_auth(self, bool): pn_transport_require_auth(self._impl, bool) @property def authenticated(self): return pn_transport_is_authenticated(self._impl) def require_encryption(self, bool): pn_transport_require_encryption(self._impl, bool) @property def encrypted(self): return pn_transport_is_encrypted(self._impl) @property def user(self): return pn_transport_get_user(self._impl) def bind(self, connection): """Assign a connection to the transport""" self._check(pn_transport_bind(self._impl, connection._impl)) def unbind(self): """Release the connection""" self._check(pn_transport_unbind(self._impl)) def trace(self, n): pn_transport_trace(self._impl, n) def tick(self, now): """Process any timed events (like heartbeat generation). now = seconds since epoch (float). """ return millis2secs(pn_transport_tick(self._impl, secs2millis(now))) def capacity(self): c = pn_transport_capacity(self._impl) if c >= PN_EOS: return c else: return self._check(c) def push(self, binary): n = self._check(pn_transport_push(self._impl, binary)) if n != len(binary): raise OverflowError("unable to process all bytes: %s, %s" % (n, len(binary))) def close_tail(self): self._check(pn_transport_close_tail(self._impl)) def pending(self): p = pn_transport_pending(self._impl) if p >= PN_EOS: return p else: return self._check(p) def peek(self, size): cd, out = pn_transport_peek(self._impl, size) if cd == PN_EOS: return None else: self._check(cd) return out def pop(self, size): pn_transport_pop(self._impl, size) def close_head(self): self._check(pn_transport_close_head(self._impl)) @property def closed(self): return pn_transport_closed(self._impl) # AMQP 1.0 max-frame-size def _get_max_frame_size(self): return pn_transport_get_max_frame(self._impl) def _set_max_frame_size(self, value): pn_transport_set_max_frame(self._impl, value) max_frame_size = property(_get_max_frame_size, _set_max_frame_size, doc=""" Sets the maximum size for received frames (in bytes). """) @property def remote_max_frame_size(self): return pn_transport_get_remote_max_frame(self._impl) def _get_channel_max(self): return pn_transport_get_channel_max(self._impl) def _set_channel_max(self, value): if pn_transport_set_channel_max(self._impl, value): raise SessionException("Too late to change channel max.") channel_max = property(_get_channel_max, _set_channel_max, doc=""" Sets the maximum channel that may be used on the transport. """) @property def remote_channel_max(self): return pn_transport_remote_channel_max(self._impl) # AMQP 1.0 idle-time-out def _get_idle_timeout(self): return millis2secs(pn_transport_get_idle_timeout(self._impl)) def _set_idle_timeout(self, sec): pn_transport_set_idle_timeout(self._impl, secs2millis(sec)) idle_timeout = property(_get_idle_timeout, _set_idle_timeout, doc=""" The idle timeout of the connection (float, in seconds). """) @property def remote_idle_timeout(self): return millis2secs(pn_transport_get_remote_idle_timeout(self._impl)) @property def frames_output(self): return pn_transport_get_frames_output(self._impl) @property def frames_input(self): return pn_transport_get_frames_input(self._impl) def sasl(self): return SASL(self) def ssl(self, domain=None, session_details=None): # SSL factory (singleton for this transport) if not self._ssl: self._ssl = SSL(self, domain, session_details) return self._ssl @property def condition(self): return cond2obj(pn_transport_condition(self._impl)) @property def connection(self): return Connection.wrap(pn_transport_connection(self._impl)) class SASLException(TransportException): pass class SASL(Wrapper): OK = PN_SASL_OK AUTH = PN_SASL_AUTH SYS = PN_SASL_SYS PERM = PN_SASL_PERM TEMP = PN_SASL_TEMP @staticmethod def extended(): return pn_sasl_extended() def __init__(self, transport): Wrapper.__init__(self, transport._impl, pn_transport_attachments) self._sasl = pn_sasl(transport._impl) def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, SASLException) raise exc("[%s]" % (err)) else: return err @property def user(self): return pn_sasl_get_user(self._sasl) @property def mech(self): return pn_sasl_get_mech(self._sasl) @property def outcome(self): outcome = pn_sasl_outcome(self._sasl) if outcome == PN_SASL_NONE: return None else: return outcome def allowed_mechs(self, mechs): pn_sasl_allowed_mechs(self._sasl, unicode2utf8(mechs)) def _get_allow_insecure_mechs(self): return pn_sasl_get_allow_insecure_mechs(self._sasl) def _set_allow_insecure_mechs(self, insecure): pn_sasl_set_allow_insecure_mechs(self._sasl, insecure) allow_insecure_mechs = property(_get_allow_insecure_mechs, _set_allow_insecure_mechs, doc=""" Allow unencrypted cleartext passwords (PLAIN mech) """) def done(self, outcome): pn_sasl_done(self._sasl, outcome) def config_name(self, name): pn_sasl_config_name(self._sasl, name) def config_path(self, path): pn_sasl_config_path(self._sasl, path) class SSLException(TransportException): pass class SSLUnavailable(SSLException): pass class SSLDomain(object): MODE_CLIENT = PN_SSL_MODE_CLIENT MODE_SERVER = PN_SSL_MODE_SERVER VERIFY_PEER = PN_SSL_VERIFY_PEER VERIFY_PEER_NAME = PN_SSL_VERIFY_PEER_NAME ANONYMOUS_PEER = PN_SSL_ANONYMOUS_PEER def __init__(self, mode): self._domain = pn_ssl_domain(mode) if self._domain is None: raise SSLUnavailable() def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, SSLException) raise exc("SSL failure.") else: return err def set_credentials(self, cert_file, key_file, password): return self._check( pn_ssl_domain_set_credentials(self._domain, cert_file, key_file, password) ) def set_trusted_ca_db(self, certificate_db): return self._check( pn_ssl_domain_set_trusted_ca_db(self._domain, certificate_db) ) def set_peer_authentication(self, verify_mode, trusted_CAs=None): return self._check( pn_ssl_domain_set_peer_authentication(self._domain, verify_mode, trusted_CAs) ) def allow_unsecured_client(self): return self._check( pn_ssl_domain_allow_unsecured_client(self._domain) ) def __del__(self): pn_ssl_domain_free(self._domain) class SSL(object): @staticmethod def present(): return pn_ssl_present() def _check(self, err): if err < 0: exc = EXCEPTIONS.get(err, SSLException) raise exc("SSL failure.") else: return err def __new__(cls, transport, domain, session_details=None): """Enforce a singleton SSL object per Transport""" if transport._ssl: # unfortunately, we've combined the allocation and the configuration in a # single step. So catch any attempt by the application to provide what # may be a different configuration than the original (hack) ssl = transport._ssl if (domain and (ssl._domain is not domain) or session_details and (ssl._session_details is not session_details)): raise SSLException("Cannot re-configure existing SSL object!") else: obj = super(SSL, cls).__new__(cls) obj._domain = domain obj._session_details = session_details session_id = None if session_details: session_id = session_details.get_session_id() obj._ssl = pn_ssl( transport._impl ) if obj._ssl is None: raise SSLUnavailable() if domain: pn_ssl_init( obj._ssl, domain._domain, session_id ) transport._ssl = obj return transport._ssl def cipher_name(self): rc, name = pn_ssl_get_cipher_name( self._ssl, 128 ) if rc: return name return None def protocol_name(self): rc, name = pn_ssl_get_protocol_name( self._ssl, 128 ) if rc: return name return None SHA1 = PN_SSL_SHA1 SHA256 = PN_SSL_SHA256 SHA512 = PN_SSL_SHA512 MD5 = PN_SSL_MD5 CERT_COUNTRY_NAME = PN_SSL_CERT_SUBJECT_COUNTRY_NAME CERT_STATE_OR_PROVINCE = PN_SSL_CERT_SUBJECT_STATE_OR_PROVINCE CERT_CITY_OR_LOCALITY = PN_SSL_CERT_SUBJECT_CITY_OR_LOCALITY CERT_ORGANIZATION_NAME = PN_SSL_CERT_SUBJECT_ORGANIZATION_NAME CERT_ORGANIZATION_UNIT = PN_SSL_CERT_SUBJECT_ORGANIZATION_UNIT CERT_COMMON_NAME = PN_SSL_CERT_SUBJECT_COMMON_NAME def get_cert_subject_subfield(self, subfield_name): subfield_value = pn_ssl_get_remote_subject_subfield(self._ssl, subfield_name) return subfield_value def get_cert_subject(self): subject = pn_ssl_get_remote_subject(self._ssl) return subject def _get_cert_subject_unknown_subfield(self): # Pass in an unhandled enum return self.get_cert_subject_subfield(10) # Convenience functions for obtaining the subfields of the subject field. def get_cert_common_name(self): return self.get_cert_subject_subfield(SSL.CERT_COMMON_NAME) def get_cert_organization(self): return self.get_cert_subject_subfield(SSL.CERT_ORGANIZATION_NAME) def get_cert_organization_unit(self): return self.get_cert_subject_subfield(SSL.CERT_ORGANIZATION_UNIT) def get_cert_locality_or_city(self): return self.get_cert_subject_subfield(SSL.CERT_CITY_OR_LOCALITY) def get_cert_country(self): return self.get_cert_subject_subfield(SSL.CERT_COUNTRY_NAME) def get_cert_state_or_province(self): return self.get_cert_subject_subfield(SSL.CERT_STATE_OR_PROVINCE) def get_cert_fingerprint(self, fingerprint_length, digest_name): rc, fingerprint_str = pn_ssl_get_cert_fingerprint(self._ssl, fingerprint_length, digest_name) if rc == PN_OK: return fingerprint_str return None # Convenience functions for obtaining fingerprint for specific hashing algorithms def _get_cert_fingerprint_unknown_hash_alg(self): return self.get_cert_fingerprint(41, 10) def get_cert_fingerprint_sha1(self): return self.get_cert_fingerprint(41, SSL.SHA1) def get_cert_fingerprint_sha256(self): # sha256 produces a fingerprint that is 64 characters long return self.get_cert_fingerprint(65, SSL.SHA256) def get_cert_fingerprint_sha512(self): # sha512 produces a fingerprint that is 128 characters long return self.get_cert_fingerprint(129, SSL.SHA512) def get_cert_fingerprint_md5(self): return self.get_cert_fingerprint(33, SSL.MD5) @property def remote_subject(self): return pn_ssl_get_remote_subject( self._ssl ) RESUME_UNKNOWN = PN_SSL_RESUME_UNKNOWN RESUME_NEW = PN_SSL_RESUME_NEW RESUME_REUSED = PN_SSL_RESUME_REUSED def resume_status(self): return pn_ssl_resume_status( self._ssl ) def _set_peer_hostname(self, hostname): self._check(pn_ssl_set_peer_hostname( self._ssl, unicode2utf8(hostname) )) def _get_peer_hostname(self): err, name = pn_ssl_get_peer_hostname( self._ssl, 1024 ) self._check(err) return utf82unicode(name) peer_hostname = property(_get_peer_hostname, _set_peer_hostname, doc=""" Manage the expected name of the remote peer. Used to authenticate the remote. """) class SSLSessionDetails(object): """ Unique identifier for the SSL session. Used to resume previous session on a new SSL connection. """ def __init__(self, session_id): self._session_id = session_id def get_session_id(self): return self._session_id wrappers = { "pn_void": lambda x: pn_void2py(x), "pn_pyref": lambda x: pn_void2py(x), "pn_connection": lambda x: Connection.wrap(pn_cast_pn_connection(x)), "pn_session": lambda x: Session.wrap(pn_cast_pn_session(x)), "pn_link": lambda x: Link.wrap(pn_cast_pn_link(x)), "pn_delivery": lambda x: Delivery.wrap(pn_cast_pn_delivery(x)), "pn_transport": lambda x: Transport.wrap(pn_cast_pn_transport(x)), "pn_selectable": lambda x: Selectable.wrap(pn_cast_pn_selectable(x)) } class Collector: def __init__(self): self._impl = pn_collector() def put(self, obj, etype): pn_collector_put(self._impl, PN_PYREF, pn_py2void(obj), etype.number) def peek(self): return Event.wrap(pn_collector_peek(self._impl)) def pop(self): ev = self.peek() pn_collector_pop(self._impl) def __del__(self): pn_collector_free(self._impl) del self._impl if "TypeExtender" not in globals(): class TypeExtender: def __init__(self, number): self.number = number def next(self): try: return self.number finally: self.number += 1 class EventType(object): _lock = threading.Lock() _extended = TypeExtender(10000) TYPES = {} def __init__(self, name=None, number=None, method=None): if name is None and number is None: raise TypeError("extended events require a name") try: self._lock.acquire() if name is None: name = pn_event_type_name(number) if number is None: number = self._extended.next() if method is None: method = "on_%s" % name self.name = name self.number = number self.method = method self.TYPES[number] = self finally: self._lock.release() def __repr__(self): return self.name def dispatch(handler, method, *args): m = getattr(handler, method, None) if m: return m(*args) elif hasattr(handler, "on_unhandled"): return handler.on_unhandled(method, *args) class EventBase(object): def __init__(self, clazz, context, type): self.clazz = clazz self.context = context self.type = type def dispatch(self, handler): return dispatch(handler, self.type.method, self) def _none(x): return None DELEGATED = Constant("DELEGATED") def _core(number, method): return EventType(number=number, method=method) class Event(Wrapper, EventBase): REACTOR_INIT = _core(PN_REACTOR_INIT, "on_reactor_init") REACTOR_QUIESCED = _core(PN_REACTOR_QUIESCED, "on_reactor_quiesced") REACTOR_FINAL = _core(PN_REACTOR_FINAL, "on_reactor_final") TIMER_TASK = _core(PN_TIMER_TASK, "on_timer_task") CONNECTION_INIT = _core(PN_CONNECTION_INIT, "on_connection_init") CONNECTION_BOUND = _core(PN_CONNECTION_BOUND, "on_connection_bound") CONNECTION_UNBOUND = _core(PN_CONNECTION_UNBOUND, "on_connection_unbound") CONNECTION_LOCAL_OPEN = _core(PN_CONNECTION_LOCAL_OPEN, "on_connection_local_open") CONNECTION_LOCAL_CLOSE = _core(PN_CONNECTION_LOCAL_CLOSE, "on_connection_local_close") CONNECTION_REMOTE_OPEN = _core(PN_CONNECTION_REMOTE_OPEN, "on_connection_remote_open") CONNECTION_REMOTE_CLOSE = _core(PN_CONNECTION_REMOTE_CLOSE, "on_connection_remote_close") CONNECTION_FINAL = _core(PN_CONNECTION_FINAL, "on_connection_final") SESSION_INIT = _core(PN_SESSION_INIT, "on_session_init") SESSION_LOCAL_OPEN = _core(PN_SESSION_LOCAL_OPEN, "on_session_local_open") SESSION_LOCAL_CLOSE = _core(PN_SESSION_LOCAL_CLOSE, "on_session_local_close") SESSION_REMOTE_OPEN = _core(PN_SESSION_REMOTE_OPEN, "on_session_remote_open") SESSION_REMOTE_CLOSE = _core(PN_SESSION_REMOTE_CLOSE, "on_session_remote_close") SESSION_FINAL = _core(PN_SESSION_FINAL, "on_session_final") LINK_INIT = _core(PN_LINK_INIT, "on_link_init") LINK_LOCAL_OPEN = _core(PN_LINK_LOCAL_OPEN, "on_link_local_open") LINK_LOCAL_CLOSE = _core(PN_LINK_LOCAL_CLOSE, "on_link_local_close") LINK_LOCAL_DETACH = _core(PN_LINK_LOCAL_DETACH, "on_link_local_detach") LINK_REMOTE_OPEN = _core(PN_LINK_REMOTE_OPEN, "on_link_remote_open") LINK_REMOTE_CLOSE = _core(PN_LINK_REMOTE_CLOSE, "on_link_remote_close") LINK_REMOTE_DETACH = _core(PN_LINK_REMOTE_DETACH, "on_link_remote_detach") LINK_FLOW = _core(PN_LINK_FLOW, "on_link_flow") LINK_FINAL = _core(PN_LINK_FINAL, "on_link_final") DELIVERY = _core(PN_DELIVERY, "on_delivery") TRANSPORT = _core(PN_TRANSPORT, "on_transport") TRANSPORT_ERROR = _core(PN_TRANSPORT_ERROR, "on_transport_error") TRANSPORT_HEAD_CLOSED = _core(PN_TRANSPORT_HEAD_CLOSED, "on_transport_head_closed") TRANSPORT_TAIL_CLOSED = _core(PN_TRANSPORT_TAIL_CLOSED, "on_transport_tail_closed") TRANSPORT_CLOSED = _core(PN_TRANSPORT_CLOSED, "on_transport_closed") SELECTABLE_INIT = _core(PN_SELECTABLE_INIT, "on_selectable_init") SELECTABLE_UPDATED = _core(PN_SELECTABLE_UPDATED, "on_selectable_updated") SELECTABLE_READABLE = _core(PN_SELECTABLE_READABLE, "on_selectable_readable") SELECTABLE_WRITABLE = _core(PN_SELECTABLE_WRITABLE, "on_selectable_writable") SELECTABLE_EXPIRED = _core(PN_SELECTABLE_EXPIRED, "on_selectable_expired") SELECTABLE_ERROR = _core(PN_SELECTABLE_ERROR, "on_selectable_error") SELECTABLE_FINAL = _core(PN_SELECTABLE_FINAL, "on_selectable_final") @staticmethod def wrap(impl, number=None): if impl is None: return None if number is None: number = pn_event_type(impl) event = Event(impl, number) # check for an application defined ApplicationEvent and return that. This # avoids an expensive wrap operation invoked by event.context if pn_event_class(impl) == PN_PYREF and \ isinstance(event.context, EventBase): return event.context else: return event def __init__(self, impl, number): Wrapper.__init__(self, impl, pn_event_attachments) self.__dict__["type"] = EventType.TYPES[number] def _init(self): pass def copy(self): copy = pn_event_copy(self._impl) return Event.wrap(copy) @property def clazz(self): cls = pn_event_class(self._impl) if cls: return pn_class_name(cls) else: return None @property def root(self): return WrappedHandler.wrap(pn_event_root(self._impl)) @property def context(self): """Returns the context object associated with the event. The type of this depend on the type of event.""" return wrappers[self.clazz](pn_event_context(self._impl)) def dispatch(self, handler, type=None): type = type or self.type if isinstance(handler, WrappedHandler): pn_handler_dispatch(handler._impl, self._impl, type.number) else: result = dispatch(handler, type.method, self) if result != DELEGATED and hasattr(handler, "handlers"): for h in handler.handlers: self.dispatch(h, type) @property def reactor(self): """Returns the reactor associated with the event.""" return wrappers.get("pn_reactor", _none)(pn_event_reactor(self._impl)) def __getattr__(self, name): r = self.reactor if r and hasattr(r, 'subclass') and r.subclass.__name__.lower() == name: return r else: return super(Event, self).__getattr__(name) @property def transport(self): """Returns the transport associated with the event, or null if none is associated with it.""" return Transport.wrap(pn_event_transport(self._impl)) @property def connection(self): """Returns the connection associated with the event, or null if none is associated with it.""" return Connection.wrap(pn_event_connection(self._impl)) @property def session(self): """Returns the session associated with the event, or null if none is associated with it.""" return Session.wrap(pn_event_session(self._impl)) @property def link(self): """Returns the link associated with the event, or null if none is associated with it.""" return Link.wrap(pn_event_link(self._impl)) @property def sender(self): """Returns the sender link associated with the event, or null if none is associated with it. This is essentially an alias for link(), that does an additional checkon the type of the link.""" l = self.link if l and l.is_sender: return l else: return None @property def receiver(self): """Returns the receiver link associated with the event, or null if none is associated with it. This is essentially an alias for link(), that does an additional checkon the type of the link.""" l = self.link if l and l.is_receiver: return l else: return None @property def delivery(self): """Returns the delivery associated with the event, or null if none is associated with it.""" return Delivery.wrap(pn_event_delivery(self._impl)) def __repr__(self): return "%s(%s)" % (self.type, self.context) class LazyHandlers(object): def __get__(self, obj, clazz): if obj is None: return self ret = [] obj.__dict__['handlers'] = ret return ret class Handler(object): handlers = LazyHandlers() def on_unhandled(self, method, *args): pass class _cadapter: def __init__(self, handler, on_error=None): self.handler = handler self.on_error = on_error def dispatch(self, cevent, ctype): ev = Event.wrap(cevent, ctype) ev.dispatch(self.handler) def exception(self, exc, val, tb): if self.on_error is None: _compat.raise_(exc, val, tb) else: self.on_error((exc, val, tb)) class WrappedHandlersChildSurrogate: def __init__(self, delegate): self.handlers = [] self.delegate = weakref.ref(delegate) def on_unhandled(self, method, event): delegate = self.delegate() if delegate: dispatch(delegate, method, event) class WrappedHandlersProperty(object): def __get__(self, obj, clazz): if obj is None: return None return self.surrogate(obj).handlers def __set__(self, obj, value): self.surrogate(obj).handlers = value def surrogate(self, obj): key = "_surrogate" objdict = obj.__dict__ surrogate = objdict.get(key, None) if surrogate is None: objdict[key] = surrogate = WrappedHandlersChildSurrogate(obj) obj.add(surrogate) return surrogate class WrappedHandler(Wrapper): handlers = WrappedHandlersProperty() @classmethod def wrap(cls, impl, on_error=None): if impl is None: return None else: handler = cls(impl) handler.__dict__["on_error"] = on_error return handler def __init__(self, impl_or_constructor): Wrapper.__init__(self, impl_or_constructor) if list(self.__class__.__mro__).index(WrappedHandler) > 1: # instantiate the surrogate self.handlers.extend([]) def _on_error(self, info): on_error = getattr(self, "on_error", None) if on_error is None: _compat.raise_(info[0], info[1], info[2]) else: on_error(info) def add(self, handler, on_error=None): if handler is None: return if on_error is None: on_error = self._on_error impl = _chandler(handler, on_error) pn_handler_add(self._impl, impl) pn_decref(impl) def clear(self): pn_handler_clear(self._impl) def _chandler(obj, on_error=None): if obj is None: return None elif isinstance(obj, WrappedHandler): impl = obj._impl pn_incref(impl) return impl else: return pn_pyhandler(_cadapter(obj, on_error)) class Url(object): """ Simple URL parser/constructor, handles URLs of the form: ://:@:/ All components can be None if not specified in the URL string. The port can be specified as a service name, e.g. 'amqp' in the URL string but Url.port always gives the integer value. Warning: The placement of user and password in URLs is not recommended. It can result in credentials leaking out in program logs. Use connection configuration attributes instead. @ivar scheme: Url scheme e.g. 'amqp' or 'amqps' @ivar user: Username @ivar password: Password @ivar host: Host name, ipv6 literal or ipv4 dotted quad. @ivar port: Integer port. @ivar host_port: Returns host:port """ AMQPS = "amqps" AMQP = "amqp" class Port(int): """An integer port number that can be constructed from a service name string""" def __new__(cls, value): """@param value: integer port number or string service name.""" port = super(Url.Port, cls).__new__(cls, cls._port_int(value)) setattr(port, 'name', str(value)) return port def __eq__(self, x): return str(self) == x or int(self) == x def __ne__(self, x): return not self == x def __str__(self): return str(self.name) @staticmethod def _port_int(value): """Convert service, an integer or a service name, into an integer port number.""" try: return int(value) except ValueError: try: return socket.getservbyname(value) except socket.error: # Not every system has amqp/amqps defined as a service if value == Url.AMQPS: return 5671 elif value == Url.AMQP: return 5672 else: raise ValueError("Not a valid port number or service name: '%s'" % value) def __init__(self, url=None, defaults=True, **kwargs): """ @param url: URL string to parse. @param defaults: If true, fill in missing default values in the URL. If false, you can fill them in later by calling self.defaults() @param kwargs: scheme, user, password, host, port, path. If specified, replaces corresponding part in url string. """ if url: self._url = pn_url_parse(unicode2utf8(str(url))) if not self._url: raise ValueError("Invalid URL '%s'" % url) else: self._url = pn_url() for k in kwargs: # Let kwargs override values parsed from url getattr(self, k) # Check for invalid kwargs setattr(self, k, kwargs[k]) if defaults: self.defaults() class PartDescriptor(object): def __init__(self, part): self.getter = globals()["pn_url_get_%s" % part] self.setter = globals()["pn_url_set_%s" % part] def __get__(self, obj, type=None): return self.getter(obj._url) def __set__(self, obj, value): return self.setter(obj._url, str(value)) scheme = PartDescriptor('scheme') username = PartDescriptor('username') password = PartDescriptor('password') host = PartDescriptor('host') path = PartDescriptor('path') def _get_port(self): portstr = pn_url_get_port(self._url) return portstr and Url.Port(portstr) def _set_port(self, value): if value is None: pn_url_set_port(self._url, None) else: pn_url_set_port(self._url, str(Url.Port(value))) port = property(_get_port, _set_port) def __str__(self): return pn_url_str(self._url) def __repr__(self): return "Url(%s://%s/%s)" % (self.scheme, self.host, self.path) def __eq__(self, x): return str(self) == str(x) def __ne__(self, x): return not self == x def __del__(self): pn_url_free(self._url); del self._url def defaults(self): """ Fill in missing values (scheme, host or port) with defaults @return: self """ self.scheme = self.scheme or self.AMQP self.host = self.host or '0.0.0.0' self.port = self.port or self.Port(self.scheme) return self __all__ = [ "API_LANGUAGE", "IMPLEMENTATION_LANGUAGE", "ABORTED", "ACCEPTED", "PENDING", "REJECTED", "RELEASED", "MODIFIED", "SETTLED", "UNDESCRIBED", "Array", "Collector", "Condition", "Connection", "Data", "Delivery", "Disposition", "Described", "Endpoint", "Event", "EventType", "Handler", "Link", "Message", "MessageException", "ProtonException", "VERSION_MAJOR", "VERSION_MINOR", "Receiver", "SASL", "Sender", "Session", "SessionException", "SSL", "SSLDomain", "SSLSessionDetails", "SSLUnavailable", "SSLException", "Terminus", "Timeout", "Interrupt", "Transport", "TransportException", "Url", "char", "dispatch", "symbol", "timestamp", "ulong", "byte", "short", "int32", "ubyte", "ushort", "uint", "float32", "decimal32", "decimal64", "decimal128" ] qpid-proton-0.22.0/proton-c/bindings/python/docs/0000775000000000000000000000000013257152177016560 5ustar qpid-proton-0.22.0/proton-c/bindings/python/docs/tutorial.rst0000664000000000000000000003074713257152177021170 0ustar ######## Tutorial ######## ============ Hello World! ============ Tradition dictates that we start with hello world! However rather than simply striving for the shortest program possible, we'll aim for a more illustrative example while still restricting the functionality to sending and receiving a single message. .. literalinclude:: ../../../../examples/python/helloworld.py :lines: 21- :linenos: You can see the import of :py:class:`~proton.reactor.Container` from ``proton.reactor`` on the second line. This is a class that makes programming with proton a little easier for the common cases. It includes within it an event loop, and programs written using this utility are generally structured to react to various events. This reactive style is particularly suited to messaging applications. To be notified of a particular event, you define a class with the appropriately name method on it. That method is then called by the event loop when the event occurs. We define a class here, ``HelloWorld``, which handles the key events of interest in sending and receiving a message. The ``on_start()`` method is called when the event loop first starts. We handle that by establishing our connection (line 12), a sender over which to send the message (line 13) and a receiver over which to receive it back again (line 14). The ``on_sendable()`` method is called when message can be transferred over the associated sender link to the remote peer. We send out our ``Hello World!`` message (line 17), then close the sender (line 18) as we only want to send one message. The closing of the sender will prevent further calls to ``on_sendable()``. The ``on_message()`` method is called when a message is received. Within that we simply print the body of the message (line 21) and then close the connection (line 22). Now that we have defined the logic for handling these events, we create an instance of a :py:class:`~proton.reactor.Container`, pass it our handler and then enter the event loop by calling :py:meth:`~proton.reactor.Container.run()`. At this point control passes to the container instance, which will make the appropriate callbacks to any defined handlers. To run the example you will need to have a broker (or similar) accepting connections on that url either with a queue (or topic) matching the given address or else configured to create such a queue (or topic) dynamically. There is a simple broker.py script included alongside the examples that can be used for this purpose if desired. (It is also written using the API described here, and as such gives an example of a slightly more involved application). ==================== Hello World, Direct! ==================== Though often used in conjunction with a broker, AMQP does not *require* this. It also allows senders and receivers can communicate directly if desired. Let's modify our example to demonstrate this. .. literalinclude:: ../../../../examples/python/helloworld_direct.py :lines: 21- :emphasize-lines: 11,21-22,24-25 :linenos: The first difference, on line 11, is that rather than creating a receiver on the same connection as our sender, we listen for incoming connections by invoking the :py:meth:`~proton.reactor.Container.listen()` method on the container. As we only need then to initiate one link, the sender, we can do that by passing in a url rather than an existing connection, and the connection will also be automatically established for us. We send the message in response to the ``on_sendable()`` callback and print the message out in response to the ``on_message()`` callback exactly as before. However we also handle two new events. We now close the connection from the senders side once the message has been accepted (line 22). The acceptance of the message is an indication of successful transfer to the peer. We are notified of that event through the ``on_accepted()`` callback. Then, once the connection has been closed, of which we are notified through the ``on_closed()`` callback, we stop accepting incoming connections (line 25) at which point there is no work to be done and the event loop exits, and the run() method will return. So now we have our example working without a broker involved! ============================= Asynchronous Send and Receive ============================= Of course, these ``HelloWorld!`` examples are very artificial, communicating as they do over a network connection but with the same process. A more realistic example involves communication between separate processes (which could indeed be running on completely separate machines). Let's separate the sender from the receiver, and let's transfer more than a single message between them. We'll start with a simple sender. .. literalinclude:: ../../../../examples/python/simple_send.py :lines: 21- :linenos: As with the previous example, we define the application logic in a class that handles various events. As before, we use the ``on_start()`` event to establish our sender link over which we will transfer messages and the ``on_sendable()`` event to know when we can transfer our messages. Because we are transferring more than one message, we need to keep track of how many we have sent. We'll use a ``sent`` member variable for that. The ``total`` member variable will hold the number of messages we want to send. AMQP defines a credit-based flow control mechanism. Flow control allows the receiver to control how many messages it is prepared to receive at a given time and thus prevents any component being overwhelmed by the number of messages it is sent. In the ``on_sendable()`` callback, we check that our sender has credit before sending messages. We also check that we haven't already sent the required number of messages. The ``send()`` call on line 20 is of course asynchronous. When it returns the message has not yet actually been transferred across the network to the receiver. By handling the ``on_accepted()`` event, we can get notified when the receiver has received and accepted the message. In our example we use this event to track the confirmation of the messages we have sent. We only close the connection and exit when the receiver has received all the messages we wanted to send. If we are disconnected after a message is sent and before it has been confirmed by the receiver, it is said to be ``in doubt``. We don't know whether or not it was received. In this example, we will handle that by resending any in-doubt messages. This is known as an 'at-least-once' guarantee, since each message should eventually be received at least once, though a given message may be received more than once (i.e. duplicates are possible). In the ``on_disconnected()`` callback, we reset the sent count to reflect only those that have been confirmed. The library will automatically try to reconnect for us, and when our sender is sendable again, we can restart from the point we know the receiver got to. Now let's look at the corresponding receiver: .. literalinclude:: ../../../../examples/python/simple_recv.py :lines: 21- :linenos: Here we handle the ``on_start()`` by creating our receiver, much like we did for the sender. We also handle the ``on_message()`` event for received messages and print the message out as in the ``Hello World!`` examples. However we add some logic to allow the receiver to wait for a given number of messages, then to close the connection and exit. We also add some logic to check for and ignore duplicates, using a simple sequential id scheme. Again, though sending between these two examples requires some sort of intermediary process (e.g. a broker), AMQP allows us to send messages directly between two processes without this if we so wish. In that case one or other of the processes needs to accept incoming socket connections. Let's create a modified version of the receiving example that does this: .. literalinclude:: ../../../../examples/python/direct_recv.py :lines: 21- :emphasize-lines: 13,25 :linenos: There are only two differences here. On line 13, instead of initiating a link (and implicitly a connection), we listen for incoming connections. On line 25, when we have received all the expected messages, we then stop listening for incoming connections by closing the listener object. You can use the original send example now to send to this receiver directly. (Note: you will need to stop any broker that is listening on the 5672 port, or else change the port used by specifying a different address to each example via the -a command line switch). We could equally well modify the original sender to allow the original receiver to connect to it. Again that just requires two modifications: .. literalinclude:: ../../../../examples/python/direct_send.py :lines: 21- :emphasize-lines: 15,28 :linenos: As with the modified receiver, instead of initiating establishment of a link, we listen for incoming connections on line 15 and then on line 28, when we have received confirmation of all the messages we sent, we can close the listener in order to exit. The symmetry in the underlying AMQP that enables this is quite unique and elegant, and in reflecting this the proton API provides a flexible toolkit for implementing all sorts of interesting intermediaries (the broker.py script provided as a simple broker for testing purposes provides an example of this). To try this modified sender, run the original receiver against it. ================ Request/Response ================ A common pattern is to send a request message and expect a response message in return. AMQP has special support for this pattern. Let's have a look at a simple example. We'll start with the 'server', i.e. the program that will process the request and send the response. Note that we are still using a broker in this example. Our server will provide a very simple service: it will respond with the body of the request converted to uppercase. .. literalinclude:: ../../../../examples/python/server.py :lines: 21- :linenos: The code here is not too different from the simple receiver example. When we receive a request however, we look at the :py:attr:`~proton.Message.reply_to` address on the :py:class:`~proton.Message` and create a sender for that over which to send the response. We'll cache the senders in case we get further requests with the same reply_to. Now let's create a simple client to test this service out. .. literalinclude:: ../../../../examples/python/client.py :lines: 21- :linenos: As well as sending requests, we need to be able to get back the responses. We create a receiver for that (see line 14), but we don't specify an address, we set the dynamic option which tells the broker we are connected to to create a temporary address over which we can receive our responses. We need to use the address allocated by the broker as the reply_to address of our requests, so we can't send them until the broker has confirmed our receiving link has been set up (at which point we will have our allocated address). To do that, we add an ``on_link_opened()`` method to our handler class, and if the link associated with event is the receiver, we use that as the trigger to send our first request. Again, we could avoid having any intermediary process here if we wished. The following code implementas a server to which the client above could connect directly without any need for a broker or similar. .. literalinclude:: ../../../../examples/python/server_direct.py :lines: 21- :linenos: Though this requires some more extensive changes than the simple sending and receiving examples, the essence of the program is still the same. Here though, rather than the server establishing a link for the response, it relies on the link that the client established, since that now comes in directly to the server process. Miscellaneous ============= Many brokers offer the ability to consume messages based on a 'selector' that defines which messages are of interest based on particular values of the headers. The following example shows how that can be achieved: .. literalinclude:: ../../../../examples/python/selected_recv.py :lines: 21- :emphasize-lines: 10 :linenos: When creating the receiver, we specify a Selector object as an option. The options argument can take a single object or a list. Another option that is sometimes of interest when using a broker is the ability to 'browse' the messages on a queue, rather than consuming them. This is done in AMQP by specifying a distribution mode of 'copy' (instead of 'move' which is the expected default for queues). An example of that is shown next: .. literalinclude:: ../../../../examples/python/queue_browser.py :lines: 21- :emphasize-lines: 10 :linenos: qpid-proton-0.22.0/proton-c/bindings/python/docs/overview.rst0000664000000000000000000001465513257152177021173 0ustar ############ API Overview ############ ========================= An overview of the model ========================= Messages are transferred between connected peers over 'links'. At the sending peer the link is called a sender. At the receiving peer it is called a receiver. Messages are sent by senders and received by receivers. Links may have named 'source' and 'target' addresses (for example to identify the queue from which message were to be received or to which they were to be sent). Links are established over sessions. Sessions are established over connections. Connections are (generally) established between two uniquely identified containers. Though a connection can have multiple sessions, often this is not needed. The container API allows you to ignore sessions unless you actually require them. The sending of a message over a link is called a delivery. The message is the content sent, including all meta-data such as headers and annotations. The delivery is the protocol exchange associated with the transfer of that content. To indicate that a delivery is complete, either the sender or the receiver 'settles' it. When the other side learns that it has been settled, they will no longer communicate about that delivery. The receiver can also indicate whether they accept or reject the message. Three different delivery levels or 'guarantees' can be achieved: at-most-once, at-least-once or exactly-once. See :ref:`delivery-guarantees` for more detail. ======================================================= A summary of the most commonly used classes and members ======================================================= A brief summary of some of the key classes follows. The :py:class:`~proton.reactor.Container` class is a convenient entry point into the API, allowing connections and links to be established. Applications are structured as one or more event handlers. Handlers can be set at Container, Connection, or Link scope. Messages are sent by establishing an appropriate sender and invoking its :py:meth:`~proton.Sender.send()` method. This is typically done when the sender is sendable, a condition indicated by the :py:meth:`~proton.handlers.MessagingHandler.on_sendable()` event, to avoid excessive build up of messages. Messages can be received by establishing an appropriate receiver and handling the :py:meth:`~proton.handlers.MessagingHandler.on_message()` event. .. autoclass:: proton.reactor.Container :show-inheritance: proton.reactor.Reactor :members: connect, create_receiver, create_sender, run, schedule :undoc-members: .. py:attribute:: container_id The identifier used to identify this container in any connections it establishes. Container names should be unique. By default a UUID will be used. The :py:meth:`~proton.reactor.Container.connect()` method returns an instance of :py:class:`~proton.Connection`, the :py:meth:`~proton.reactor.Container.create_receiver()` method returns an instance of :py:class:`~proton.Receiver` and the :py:meth:`~proton.reactor.Container.create_sender()` method returns an instance of :py:class:`~proton.Sender`. .. autoclass:: proton.Connection :members: open, close, state, session, hostname, container, remote_container, remote_desired_capabilities, remote_hostname, remote_offered_capabilities , remote_properties :undoc-members: .. autoclass:: proton.Receiver :show-inheritance: proton.Link :members: flow, recv, drain, draining :undoc-members: .. autoclass:: proton.Sender :show-inheritance: proton.Link :members: offered, send :undoc-members: .. autoclass:: proton.Link :members: name, state, is_sender, is_receiver, credit, queued, session, connection, source, target, remote_source, remote_target :undoc-members: The :py:meth:`~proton.Link.source()`, :py:meth:`~proton.Link.target()`, :py:meth:`~proton.Link.remote_source()` and :py:meth:`~proton.Link.remote_target()` methods all return an instance of :py:class:`~proton.Terminus`. .. autoclass:: proton.Delivery :members: update, settle, settled, remote_state, local_state, partial, readable, writable, link, session, connection :undoc-members: .. autoclass:: proton.handlers.MessagingHandler :members: on_start, on_reactor_init, on_message, on_accepted, on_rejected, on_settled, on_sendable, on_connection_error, on_link_error, on_session_error, on_disconnected, accept, reject, release, settle :undoc-members: .. autoclass:: proton.Event :members: delivery, link, receiver, sender, session, connection, reactor, context :undoc-members: .. autoclass:: proton.Message :members: address, id, priority, subject, ttl, reply_to, correlation_id, durable, user_id, content_type, content_encoding, creation_time, expiry_time, delivery_count, first_acquirer, group_id, group_sequence, reply_to_group_id, send, recv, encode, decode :undoc-members: .. autoclass:: proton.Terminus :members: address, dynamic, properties, capabilities, filter :undoc-members: .. _delivery-guarantees: =================== Delivery guarantees =================== For at-most-once, the sender settles the message as soon as it sends it. If the connection is lost before the message is received by the receiver, the message will not be delivered. For at-least-once, the receiver accepts and settles the message on receipt. If the connection is lost before the sender is informed of the settlement, then the delivery is considered in-doubt and should be retried. This will ensure it eventually gets delivered (provided of course the connection and link can be reestablished). It may mean that it is delivered multiple times though. Finally, for exactly-once, the receiver accepts the message but doesn't settle it. The sender settles once it is aware that the receiver accepted it. In this way the receiver retains knowledge of an accepted message until it is sure the sender knows it has been accepted. If the connection is lost before settlement, the receiver informs the sender of all the unsettled deliveries it knows about, and from this the sender can deduce which need to be redelivered. The sender likewise informs the receiver which deliveries it knows about, from which the receiver can deduce which have already been settled. qpid-proton-0.22.0/proton-c/bindings/python/docs/index.rst0000664000000000000000000000022513257152177020420 0ustar Apache Qpid Proton: python documentation ======================================== Contents: .. toctree:: :maxdepth: 2 tutorial overview qpid-proton-0.22.0/proton-c/bindings/python/docs/conf.py0000664000000000000000000001733513257152177020070 0ustar # -*- coding: utf-8 -*- # # Apache Qpid Proton documentation build configuration file, created by # sphinx-quickstart on Mon Feb 16 14:13:09 2015. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. #templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Apache Qpid Proton' copyright = u'2015, Apache Qpid' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.22.0' # The full version, including alpha/beta/rc tags. release = '0.22.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinxdoc' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'ApacheQpidProtondoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'ApacheQpidProton.tex', u'Apache Qpid Proton Documentation', u'The Apache Qpid Community', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'apacheqpidproton', u'Apache Qpid Proton Documentation', [u'The Apache Qpid Community'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'ApacheQpidProton', u'Apache Qpid Proton Documentation', u'The Apache Qpid Community', 'ApacheQpidProton', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' qpid-proton-0.22.0/proton-c/bindings/python/cproton.i0000664000000000000000000003004113257152177017464 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ %module cproton %{ /* Includes the header in the wrapper code */ #if defined(_WIN32) && ! defined(__CYGWIN__) #include #endif #include #include #include #include #include #include #include #include #include /* NOTE: According to ccache-swig man page: "Known problems are using preprocessor directives within %inline blocks and the use of ’#pragma SWIG’." This includes using macros in an %inline section. Keep preprocessor directives and macro expansions in the normal header section. */ PN_HANDLE(PNI_PYTRACER); %} %include %cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1)); %cstring_output_maxsize(char *OUTPUT, size_t MAX_OUTPUT_SIZE) %include %pybuffer_binary(const char *BIN_IN, size_t BIN_LEN) // Typemap for methods that return binary data: // force the return type as binary - this is necessary for Python3 %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (char *BIN_OUT, size_t *BIN_SIZE) (int res, size_t n, char *buff = 0, $*2_ltype size) { res = SWIG_AsVal(size_t)($input, &n); if (!SWIG_IsOK(res)) { %argument_fail(res, "(char *BIN_OUT, size_t *BIN_SIZE)", $symname, $argnum); } buff= %new_array(n+1, char); $1 = %static_cast(buff, $1_ltype); size = %numeric_cast(n,$*2_ltype); $2 = &size; } %typemap(freearg,noblock=1,match="in")(char *BIN_OUT, size_t *BIN_SIZE) { if (buff$argnum) %delete_array(buff$argnum); } %typemap(argout,noblock=1) (char *BIN_OUT, size_t *BIN_SIZE) { %append_output(PyBytes_FromStringAndSize($1,*$2)); } // Typemap for those methods that return variable length text data in a buffer // provided as a parameter. If the method fails we must avoid attempting to // decode the contents of the buffer as it does not carry valid text data. %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (char *VTEXT_OUT, size_t *VTEXT_SIZE) (int res, size_t n, char *buff = 0, $*2_ltype size) { res = SWIG_AsVal(size_t)($input, &n); if (!SWIG_IsOK(res)) { %argument_fail(res, "(char *VTEXT_OUT, size_t *VTEXT_SIZE)", $symname, $argnum); } buff = %new_array(n+1, char); $1 = %static_cast(buff, $1_ltype); size = %numeric_cast(n,$*2_ltype); $2 = &size; } %typemap(freearg,noblock=1,match="in")(char *VTEXT_OUT, size_t *VTEXT_SIZE) { if (buff$argnum) %delete_array(buff$argnum); } %typemap(argout,noblock=1,fragment="SWIG_FromCharPtrAndSize") (char *VTEXT_OUT, size_t *VTEXT_SIZE) { %append_output(SWIG_FromCharPtrAndSize($1,*$2)); } // These are not used/needed in the python binding %ignore pn_dtag; %ignore pn_message_get_id; %ignore pn_message_set_id; %ignore pn_message_get_correlation_id; %ignore pn_message_set_correlation_id; %typemap(in) pn_bytes_t { if ($input == Py_None) { $1.start = NULL; $1.size = 0; } else { $1.start = PyBytes_AsString($input); if (!$1.start) { return NULL; } $1.size = PyBytes_Size($input); } } %typemap(out) pn_bytes_t { $result = PyBytes_FromStringAndSize($1.start, $1.size); } %typemap(out) pn_delivery_tag_t { $result = PyBytes_FromStringAndSize($1.bytes, $1.size); } %typemap(in) pn_uuid_t { memset($1.bytes, 0, 16); if ($input == Py_None) { ; // Already zeroed out } else { const char* b = PyBytes_AsString($input); if (b) { memmove($1.bytes, b, (PyBytes_Size($input) < 16 ? PyBytes_Size($input) : 16)); } else { return NULL; } } } %typemap(out) pn_uuid_t { $result = PyBytes_FromStringAndSize($1.bytes, 16); } %apply pn_uuid_t { pn_decimal128_t }; int pn_message_encode(pn_message_t *msg, char *BIN_OUT, size_t *BIN_SIZE); %ignore pn_message_encode; int pn_message_decode(pn_message_t *msg, const char *BIN_IN, size_t BIN_LEN); %ignore pn_message_decode; ssize_t pn_link_send(pn_link_t *transport, const char *BIN_IN, size_t BIN_LEN); %ignore pn_link_send; %rename(pn_link_recv) wrap_pn_link_recv; %inline %{ int wrap_pn_link_recv(pn_link_t *link, char *BIN_OUT, size_t *BIN_SIZE) { ssize_t sz = pn_link_recv(link, BIN_OUT, *BIN_SIZE); if (sz >= 0) { *BIN_SIZE = sz; } else { *BIN_SIZE = 0; } return sz; } %} %ignore pn_link_recv; ssize_t pn_transport_push(pn_transport_t *transport, const char *BIN_IN, size_t BIN_LEN); %ignore pn_transport_push; %rename(pn_transport_peek) wrap_pn_transport_peek; %inline %{ int wrap_pn_transport_peek(pn_transport_t *transport, char *BIN_OUT, size_t *BIN_SIZE) { ssize_t sz = pn_transport_peek(transport, BIN_OUT, *BIN_SIZE); if (sz >= 0) { *BIN_SIZE = sz; } else { *BIN_SIZE = 0; } return sz; } %} %ignore pn_transport_peek; %rename(pn_delivery) wrap_pn_delivery; %inline %{ pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) { return pn_delivery(link, pn_dtag(STRING, LENGTH)); } %} %ignore pn_delivery; %rename(pn_delivery_tag) wrap_pn_delivery_tag; %inline %{ void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) { pn_delivery_tag_t tag = pn_delivery_tag(delivery); *ALLOC_OUTPUT = (char *) malloc(tag.size); *ALLOC_SIZE = tag.size; memcpy(*ALLOC_OUTPUT, tag.start, tag.size); } %} %ignore pn_delivery_tag; ssize_t pn_data_decode(pn_data_t *data, const char *BIN_IN, size_t BIN_LEN); %ignore pn_data_decode; %rename(pn_data_encode) wrap_pn_data_encode; %inline %{ int wrap_pn_data_encode(pn_data_t *data, char *BIN_OUT, size_t *BIN_SIZE) { ssize_t sz = pn_data_encode(data, BIN_OUT, *BIN_SIZE); if (sz >= 0) { *BIN_SIZE = sz; } else { *BIN_SIZE = 0; } return sz; } %} %ignore pn_data_encode; %rename(pn_data_format) wrap_pn_data_format; %inline %{ int wrap_pn_data_format(pn_data_t *data, char *VTEXT_OUT, size_t *VTEXT_SIZE) { int err = pn_data_format(data, VTEXT_OUT, VTEXT_SIZE); if (err) *VTEXT_SIZE = 0; return err; } %} %ignore pn_data_format; bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE); %ignore pn_ssl_get_cipher_name; bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE); %ignore pn_ssl_get_protocol_name; char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl, pn_ssl_cert_subject_subfield field); %ignore pn_ssl_get_remote_subject_subfield; int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE, pn_ssl_hash_alg hash_alg); %ignore pn_ssl_get_cert_fingerprint; %rename(pn_ssl_get_peer_hostname) wrap_pn_ssl_get_peer_hostname; %inline %{ int wrap_pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *VTEXT_OUT, size_t *VTEXT_SIZE) { int err = pn_ssl_get_peer_hostname(ssl, VTEXT_OUT, VTEXT_SIZE); if (err) *VTEXT_SIZE = 0; return err; } %} %ignore pn_ssl_get_peer_hostname; %immutable PN_PYREF; %inline %{ extern const pn_class_t *PN_PYREF; #define CID_pn_pyref CID_pn_void #define pn_pyref_new NULL #define pn_pyref_initialize NULL #define pn_pyref_finalize NULL #define pn_pyref_free NULL #define pn_pyref_hashcode pn_void_hashcode #define pn_pyref_compare pn_void_compare #define pn_pyref_inspect pn_void_inspect static void pn_pyref_incref(void *object) { PyObject* p = (PyObject*) object; SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XINCREF(p); SWIG_PYTHON_THREAD_END_BLOCK; } static void pn_pyref_decref(void *object) { PyObject* p = (PyObject*) object; SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XDECREF(p); SWIG_PYTHON_THREAD_END_BLOCK; } static int pn_pyref_refcount(void *object) { return 1; } static const pn_class_t *pn_pyref_reify(void *object) { return PN_PYREF; } const pn_class_t PNI_PYREF = PN_METACLASS(pn_pyref); const pn_class_t *PN_PYREF = &PNI_PYREF; void *pn_py2void(PyObject *object) { return object; } PyObject *pn_void2py(void *object) { if (object) { PyObject* p = (PyObject*) object; SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_INCREF(p); SWIG_PYTHON_THREAD_END_BLOCK; return p; } else { Py_RETURN_NONE; } } PyObject *pn_cast_pn_void(void *object) { return pn_void2py(object); } typedef struct { PyObject *handler; PyObject *dispatch; PyObject *exception; } pni_pyh_t; static pni_pyh_t *pni_pyh(pn_handler_t *handler) { return (pni_pyh_t *) pn_handler_mem(handler); } static void pni_pyh_finalize(pn_handler_t *handler) { pni_pyh_t *pyh = pni_pyh(handler); SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_DECREF(pyh->handler); Py_DECREF(pyh->dispatch); Py_DECREF(pyh->exception); SWIG_PYTHON_THREAD_END_BLOCK; } static void pni_pydispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) { pni_pyh_t *pyh = pni_pyh(handler); SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyObject *arg = SWIG_NewPointerObj(event, SWIGTYPE_p_pn_event_t, 0); PyObject *pytype = PyInt_FromLong(type); PyObject *result = PyObject_CallMethodObjArgs(pyh->handler, pyh->dispatch, arg, pytype, NULL); if (!result) { PyObject *exc, *val, *tb; PyErr_Fetch(&exc, &val, &tb); PyErr_NormalizeException(&exc, &val, &tb); if (!val) { val = Py_None; Py_INCREF(val); } if (!tb) { tb = Py_None; Py_INCREF(tb); } { PyObject *result2 = PyObject_CallMethodObjArgs(pyh->handler, pyh->exception, exc, val, tb, NULL); if (!result2) { PyErr_PrintEx(true); } Py_XDECREF(result2); } Py_XDECREF(exc); Py_XDECREF(val); Py_XDECREF(tb); } Py_XDECREF(arg); Py_XDECREF(pytype); Py_XDECREF(result); SWIG_PYTHON_THREAD_END_BLOCK; } pn_handler_t *pn_pyhandler(PyObject *handler) { pn_handler_t *chandler = pn_handler_new(pni_pydispatch, sizeof(pni_pyh_t), pni_pyh_finalize); pni_pyh_t *phy = pni_pyh(chandler); phy->handler = handler; { SWIG_PYTHON_THREAD_BEGIN_BLOCK; phy->dispatch = PyString_FromString("dispatch"); phy->exception = PyString_FromString("exception"); Py_INCREF(phy->handler); SWIG_PYTHON_THREAD_END_BLOCK; } return chandler; } void pn_pytracer(pn_transport_t *transport, const char *message) { PyObject *pytracer = (PyObject *) pn_record_get(pn_transport_attachments(transport), PNI_PYTRACER); SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyObject *pytrans = SWIG_NewPointerObj(transport, SWIGTYPE_p_pn_transport_t, 0); PyObject *pymsg = PyString_FromString(message); PyObject *result = PyObject_CallFunctionObjArgs(pytracer, pytrans, pymsg, NULL); if (!result) { PyErr_PrintEx(true); } Py_XDECREF(pytrans); Py_XDECREF(pymsg); Py_XDECREF(result); SWIG_PYTHON_THREAD_END_BLOCK; } void pn_transport_set_pytracer(pn_transport_t *transport, PyObject *obj) { pn_record_t *record = pn_transport_attachments(transport); pn_record_def(record, PNI_PYTRACER, PN_PYREF); pn_record_set(record, PNI_PYTRACER, obj); pn_transport_set_tracer(transport, pn_pytracer); } PyObject *pn_transport_get_pytracer(pn_transport_t *transport) { pn_record_t *record = pn_transport_attachments(transport); PyObject *obj = (PyObject *)pn_record_get(record, PNI_PYTRACER); if (obj) { Py_XINCREF(obj); return obj; } else { Py_RETURN_NONE; } } %} %include "proton/cproton.i" qpid-proton-0.22.0/proton-c/bindings/python/README.rst.in0000664000000000000000000000107113257152177017723 0ustar Python bindings for Qpid Proton =============================== This module provides version @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@ of the Proton AMQP messaging toolkit. Qpid Proton is a high-performance, lightweight messaging library. It can be used in the widest range of messaging applications, including brokers, client libraries, routers, bridges, proxies, and more. Proton makes it trivial to integrate with the AMQP 1.0 ecosystem from any platform, environment, or language. More about `Proton `_. qpid-proton-0.22.0/proton-c/bindings/python/PACKAGING.txt0000664000000000000000000000140313257152177017653 0ustar This document describes how to build a native Python source package. This can be used to install the Python bindings via pip. First configure the project using 'cmake' then build it. You do not need to install the project. See the INSTALL.md file at the project's top directory for details on building. Once you have built the project, there should be a 'dist' directory in the Python bindings directory in the build directory. For example, assuming the build directory is named 'build': $ cd build/proton-c/bindings/python/dist You can now run the setup.py script from within the dist directory to build your source distribution package. To build a Python source distribution: $ python ./setup.py sdist To build and install: $ python ./setup.py build install qpid-proton-0.22.0/proton-c/bindings/python/MANIFEST.in0000664000000000000000000000012013257152177017357 0ustar graft docs graft setuputils graft proton-c global-exclude proton-c *.pyc *.pyo qpid-proton-0.22.0/proton-c/bindings/python/CMakeLists.txt0000664000000000000000000001464513257152177020402 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # NB For python the SWIG module name must have the same name as the input .i file for CMake to generate the # correct dependencies set(CMAKE_SWIG_FLAGS "-threads") include_directories (${PYTHON_INCLUDE_PATH}) set_source_files_properties(cproton.i PROPERTIES CPLUSPLUS NO) # Suppress warnings in swig generated code. set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # Set Compiler extra flags for Solaris when using SunStudio if (CMAKE_C_COMPILER_ID STREQUAL "SunPro") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSWIGEXPORT=__global") endif () list(APPEND SWIG_MODULE_cproton_EXTRA_DEPS ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i ${PROTON_HEADERS} ) swig_add_library(cproton LANGUAGE python SOURCES cproton.i) swig_link_libraries(cproton ${BINDING_DEPS} ${PYTHON_LIBRARIES}) set_target_properties(${SWIG_MODULE_cproton_REAL_NAME} PROPERTIES LINK_FLAGS "${CATCH_UNDEFINED}") find_package(PythonInterp REQUIRED) if (CHECK_SYSINSTALL_PYTHON) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES_DEFAULT OUTPUT_STRIP_TRAILING_WHITESPACE) else () set (PYTHON_SITEARCH_PACKAGES_DEFAULT ${BINDINGS_DIR}/python) endif () if (NOT PYTHON_SITEARCH_PACKAGES) set (PYTHON_SITEARCH_PACKAGES ${PYTHON_SITEARCH_PACKAGES_DEFAULT}) endif() set (pysrc-generated cproton.py) set (pysrc proton/__init__.py proton/handlers.py proton/reactor.py proton/utils.py proton/wrapper.py proton/_compat.py ) # extra files included in the source distribution set(py_dist_files cproton.i MANIFEST.in setuputils docs ) macro (py_compile directory files artifacts) foreach (src_file ${files}) install(CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" -c \"import py_compile; py_compile.compile('${src_file}', cfile='${src_file}c')\" WORKING_DIRECTORY ${directory})") install(CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" -O -c \"import py_compile; py_compile.compile('${src_file}', cfile='${src_file}o')\" WORKING_DIRECTORY ${directory})") list(APPEND ${artifacts} ${directory}/${src_file} ${directory}/${src_file}c ${directory}/${src_file}o) endforeach (src_file) endmacro(py_compile) py_compile(${CMAKE_CURRENT_BINARY_DIR} ${pysrc-generated} CPROTON_ARTIFACTS) py_compile(${CMAKE_CURRENT_SOURCE_DIR} "${pysrc}" PROTON_ARTIFACTS) find_program(EPYDOC_EXE epydoc) mark_as_advanced (EPYDOC_EXE) if (EPYDOC_EXE) foreach (py_src_doc ${pysrc}) list(APPEND PY_DOC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${py_src_doc}") endforeach(py_src_doc) add_custom_target(docs-py COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/../../env.py -- PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR} ${EPYDOC_EXE} -v --no-private --html -o ${CMAKE_CURRENT_BINARY_DIR}/html ${PY_DOC_FILES} DEPENDS ${SWIG_MODULE_${cproton}_REAL_NAME}) add_dependencies(docs docs-py) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "${PROTON_SHARE}/docs/api-py" COMPONENT documentation OPTIONAL) endif (EPYDOC_EXE) find_program(SPHINX_EXE sphinx-build) mark_as_advanced (SPHINX_EXE) if (SPHINX_EXE) add_custom_target(tutorial-py COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/../../env.py -- PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_EXE} -b html ${CMAKE_CURRENT_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR}/tutorial) add_dependencies(docs tutorial-py) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tutorial/" DESTINATION "${PROTON_SHARE}/docs/tutorial-py" COMPONENT documentation OPTIONAL) endif (SPHINX_EXE) install(FILES ${CPROTON_ARTIFACTS} DESTINATION ${PYTHON_SITEARCH_PACKAGES} COMPONENT Python) install(FILES ${PROTON_ARTIFACTS} DESTINATION "${PYTHON_SITEARCH_PACKAGES}/proton/" COMPONENT Python) install(TARGETS ${SWIG_MODULE_cproton_REAL_NAME} DESTINATION ${PYTHON_SITEARCH_PACKAGES} COMPONENT Python) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "html;tutorial") # # Set up the directory 'dist' for building the python native package # source distribution for Pypi/pip # set(py_dist_dir ${CMAKE_CURRENT_BINARY_DIR}/dist) file(COPY ${py_dist_files} DESTINATION ${py_dist_dir}) file(MAKE_DIRECTORY ${py_dist_dir}/proton) file(COPY ${pysrc} DESTINATION ${py_dist_dir}/proton) add_custom_target(py_src_dist ALL) add_dependencies(py_src_dist generated_c_files) file(MAKE_DIRECTORY ${py_dist_dir}/proton-c) # copy generated source files from the binary dir to the dist foreach(sfile ${qpid-proton-include-generated}) string(REPLACE ${CMAKE_BINARY_DIR} ${py_dist_dir} dfile ${sfile}) add_custom_command(TARGET py_src_dist COMMAND ${CMAKE_COMMAND} -E copy ${sfile} ${dfile}) endforeach() # copy the proton C sources to the dist set (all_src ${qpid-proton-core} ${qpid-proton-extra} ${qpid-proton-include} ${qpid-proton-include-extra} ${qpid-proton-layers-all} ${qpid-proton-platform-all} ${qpid-proton-private-includes} include/proton/cproton.i ) foreach(sfile ${all_src}) add_custom_command(TARGET py_src_dist COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/proton-c/${sfile} ${py_dist_dir}/proton-c/${sfile}) endforeach() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in ${py_dist_dir}/setup.py ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.rst.in ${py_dist_dir}/README.rst ) qpid-proton-0.22.0/proton-c/bindings/go/0000775000000000000000000000000013257152177014714 5ustar qpid-proton-0.22.0/proton-c/bindings/go/test-versions.sh0000775000000000000000000000260713257152177020105 0ustar #!/bin/bash # # Takes a list of install prefixes and tests the go source under the current directory # against the proton install in each prefix. # # NOTE: This script will fail if it finds proton headers or libraries installed in standard # places or on the existing paths, to avoid possible confusion. # for VAR in LD_LIBRARY_PATH LIBRARY_PATH C_INCLUDE_PATH; do declare OLD_${VAR}=${!VAR}; done prefix() { prefix=$1 export LD_LIBRARY_PATH="$prefix/lib64:$prefix/lib:$OLD_LD_LIBRARY_PATH" export LIBRARY_PATH="$prefix/lib64:$prefix/lib:$OLD_LIBRARY_PATH" export C_INCLUDE_PATH="$prefix/include:$OLD_C_INCLUDE_PATH" } TEMP=$(mktemp -d) trap "rm -rf $TEMP" EXIT set -o pipefail cat > $TEMP/test.c < int main(int c, char **a) { return 0; } EOF cc $TEMP/test.c 2> /dev/null && { echo "cc found proton in include path"; cc -E | grep proton/connection.h | head -n1; exit 1; } 1>&2 cat > $TEMP/test.c </dev/null && { echo "cc found proton in library path" 1>&2 ; exit 1; } for P in "$@"; do ( case $P in /*) ;; *) P=$PWD/$P;; esac test -d $P || { echo "no such directory: $P"; continue; } echo ==== $P prefix $P export GOPATH=$PWD git clean -dfx go test qpid.apache.org/... ) done qpid-proton-0.22.0/proton-c/bindings/go/src/0000775000000000000000000000000013257152177015503 5ustar qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/0000775000000000000000000000000013257152177020446 5ustar qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/readme-go-get.md0000664000000000000000000000121613257152177023405 0ustar The go-only subtree of proton is maintained on the branch `go1` for the `go get` command. `go1` is special to the `go get` command, it will use that branch rather than `master` when it is present. Created with: git subtree split --prefix=proton-c/bindings/go/src/qpid.apache.org -b go1 Update with: git checkout go1 git pull git merge -s recursive -Xsubtree=proton-c/bindings/go/src/qpid.apache.org master To see the branch description: `git config branch.go1.description` NOTE: when updating the branch, you should also visit the doc pages at https://godoc.org/?q=qpid.apache.org and click "Refresh now" at the bottom of the page qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/0000775000000000000000000000000013257152177021767 5ustar qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers_gen.go0000664000000000000000000006523713257152177025027 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // NOTE: DO NOT EDIT. This file was generated by genwrap.go from the proton header files. // Update the generator and re-run if you need to modify this code. // package proton import ( "time" "unsafe" ) // #include // #include // #include // #include // #include import "C" // #include // #include // #include // #include // #include // #include // #include // #include // #include import "C" type EventType int const ( EConnectionInit EventType = C.PN_CONNECTION_INIT EConnectionBound EventType = C.PN_CONNECTION_BOUND EConnectionUnbound EventType = C.PN_CONNECTION_UNBOUND EConnectionLocalOpen EventType = C.PN_CONNECTION_LOCAL_OPEN EConnectionRemoteOpen EventType = C.PN_CONNECTION_REMOTE_OPEN EConnectionLocalClose EventType = C.PN_CONNECTION_LOCAL_CLOSE EConnectionRemoteClose EventType = C.PN_CONNECTION_REMOTE_CLOSE EConnectionFinal EventType = C.PN_CONNECTION_FINAL ESessionInit EventType = C.PN_SESSION_INIT ESessionLocalOpen EventType = C.PN_SESSION_LOCAL_OPEN ESessionRemoteOpen EventType = C.PN_SESSION_REMOTE_OPEN ESessionLocalClose EventType = C.PN_SESSION_LOCAL_CLOSE ESessionRemoteClose EventType = C.PN_SESSION_REMOTE_CLOSE ESessionFinal EventType = C.PN_SESSION_FINAL ELinkInit EventType = C.PN_LINK_INIT ELinkLocalOpen EventType = C.PN_LINK_LOCAL_OPEN ELinkRemoteOpen EventType = C.PN_LINK_REMOTE_OPEN ELinkLocalClose EventType = C.PN_LINK_LOCAL_CLOSE ELinkRemoteClose EventType = C.PN_LINK_REMOTE_CLOSE ELinkLocalDetach EventType = C.PN_LINK_LOCAL_DETACH ELinkRemoteDetach EventType = C.PN_LINK_REMOTE_DETACH ELinkFlow EventType = C.PN_LINK_FLOW ELinkFinal EventType = C.PN_LINK_FINAL EDelivery EventType = C.PN_DELIVERY ETransport EventType = C.PN_TRANSPORT ETransportAuthenticated EventType = C.PN_TRANSPORT_AUTHENTICATED ETransportError EventType = C.PN_TRANSPORT_ERROR ETransportHeadClosed EventType = C.PN_TRANSPORT_HEAD_CLOSED ETransportTailClosed EventType = C.PN_TRANSPORT_TAIL_CLOSED ETransportClosed EventType = C.PN_TRANSPORT_CLOSED ) func (e EventType) String() string { switch e { case C.PN_CONNECTION_INIT: return "ConnectionInit" case C.PN_CONNECTION_BOUND: return "ConnectionBound" case C.PN_CONNECTION_UNBOUND: return "ConnectionUnbound" case C.PN_CONNECTION_LOCAL_OPEN: return "ConnectionLocalOpen" case C.PN_CONNECTION_REMOTE_OPEN: return "ConnectionRemoteOpen" case C.PN_CONNECTION_LOCAL_CLOSE: return "ConnectionLocalClose" case C.PN_CONNECTION_REMOTE_CLOSE: return "ConnectionRemoteClose" case C.PN_CONNECTION_FINAL: return "ConnectionFinal" case C.PN_SESSION_INIT: return "SessionInit" case C.PN_SESSION_LOCAL_OPEN: return "SessionLocalOpen" case C.PN_SESSION_REMOTE_OPEN: return "SessionRemoteOpen" case C.PN_SESSION_LOCAL_CLOSE: return "SessionLocalClose" case C.PN_SESSION_REMOTE_CLOSE: return "SessionRemoteClose" case C.PN_SESSION_FINAL: return "SessionFinal" case C.PN_LINK_INIT: return "LinkInit" case C.PN_LINK_LOCAL_OPEN: return "LinkLocalOpen" case C.PN_LINK_REMOTE_OPEN: return "LinkRemoteOpen" case C.PN_LINK_LOCAL_CLOSE: return "LinkLocalClose" case C.PN_LINK_REMOTE_CLOSE: return "LinkRemoteClose" case C.PN_LINK_LOCAL_DETACH: return "LinkLocalDetach" case C.PN_LINK_REMOTE_DETACH: return "LinkRemoteDetach" case C.PN_LINK_FLOW: return "LinkFlow" case C.PN_LINK_FINAL: return "LinkFinal" case C.PN_DELIVERY: return "Delivery" case C.PN_TRANSPORT: return "Transport" case C.PN_TRANSPORT_AUTHENTICATED: return "TransportAuthenticated" case C.PN_TRANSPORT_ERROR: return "TransportError" case C.PN_TRANSPORT_HEAD_CLOSED: return "TransportHeadClosed" case C.PN_TRANSPORT_TAIL_CLOSED: return "TransportTailClosed" case C.PN_TRANSPORT_CLOSED: return "TransportClosed" } return "Unknown" } // Wrappers for declarations in session.h type Session struct{ pn *C.pn_session_t } func (s Session) IsNil() bool { return s.pn == nil } func (s Session) CPtr() unsafe.Pointer { return unsafe.Pointer(s.pn) } func (s Session) Free() { C.pn_session_free(s.pn) } func (s Session) State() State { return State(C.pn_session_state(s.pn)) } func (s Session) Error() error { return PnError(C.pn_session_error(s.pn)) } func (s Session) Condition() Condition { return Condition{C.pn_session_condition(s.pn)} } func (s Session) RemoteCondition() Condition { return Condition{C.pn_session_remote_condition(s.pn)} } func (s Session) Connection() Connection { return Connection{C.pn_session_connection(s.pn)} } func (s Session) Open() { C.pn_session_open(s.pn) } func (s Session) Close() { C.pn_session_close(s.pn) } func (s Session) IncomingCapacity() uint { return uint(C.pn_session_get_incoming_capacity(s.pn)) } func (s Session) SetIncomingCapacity(capacity uint) { C.pn_session_set_incoming_capacity(s.pn, C.size_t(capacity)) } func (s Session) OutgoingWindow() uint { return uint(C.pn_session_get_outgoing_window(s.pn)) } func (s Session) SetOutgoingWindow(window uint) { C.pn_session_set_outgoing_window(s.pn, C.size_t(window)) } func (s Session) OutgoingBytes() uint { return uint(C.pn_session_outgoing_bytes(s.pn)) } func (s Session) IncomingBytes() uint { return uint(C.pn_session_incoming_bytes(s.pn)) } func (s Session) Next(state State) Session { return Session{C.pn_session_next(s.pn, C.pn_state_t(state))} } // Wrappers for declarations in link.h type SndSettleMode C.pn_snd_settle_mode_t const ( SndUnsettled SndSettleMode = C.PN_SND_UNSETTLED SndSettled SndSettleMode = C.PN_SND_SETTLED SndMixed SndSettleMode = C.PN_SND_MIXED ) func (e SndSettleMode) String() string { switch e { case C.PN_SND_UNSETTLED: return "SndUnsettled" case C.PN_SND_SETTLED: return "SndSettled" case C.PN_SND_MIXED: return "SndMixed" } return "unknown" } type RcvSettleMode C.pn_rcv_settle_mode_t const ( RcvFirst RcvSettleMode = C.PN_RCV_FIRST RcvSecond RcvSettleMode = C.PN_RCV_SECOND ) func (e RcvSettleMode) String() string { switch e { case C.PN_RCV_FIRST: return "RcvFirst" case C.PN_RCV_SECOND: return "RcvSecond" } return "unknown" } type Link struct{ pn *C.pn_link_t } func (l Link) IsNil() bool { return l.pn == nil } func (l Link) CPtr() unsafe.Pointer { return unsafe.Pointer(l.pn) } func (l Link) Free() { C.pn_link_free(l.pn) } func (l Link) Name() string { return C.GoString(C.pn_link_name(l.pn)) } func (l Link) IsSender() bool { return bool(C.pn_link_is_sender(l.pn)) } func (l Link) IsReceiver() bool { return bool(C.pn_link_is_receiver(l.pn)) } func (l Link) State() State { return State(C.pn_link_state(l.pn)) } func (l Link) Error() error { return PnError(C.pn_link_error(l.pn)) } func (l Link) Condition() Condition { return Condition{C.pn_link_condition(l.pn)} } func (l Link) RemoteCondition() Condition { return Condition{C.pn_link_remote_condition(l.pn)} } func (l Link) Session() Session { return Session{C.pn_link_session(l.pn)} } func (l Link) Next(state State) Link { return Link{C.pn_link_next(l.pn, C.pn_state_t(state))} } func (l Link) Open() { C.pn_link_open(l.pn) } func (l Link) Close() { C.pn_link_close(l.pn) } func (l Link) Detach() { C.pn_link_detach(l.pn) } func (l Link) Source() Terminus { return Terminus{C.pn_link_source(l.pn)} } func (l Link) Target() Terminus { return Terminus{C.pn_link_target(l.pn)} } func (l Link) RemoteSource() Terminus { return Terminus{C.pn_link_remote_source(l.pn)} } func (l Link) RemoteTarget() Terminus { return Terminus{C.pn_link_remote_target(l.pn)} } func (l Link) Current() Delivery { return Delivery{C.pn_link_current(l.pn)} } func (l Link) Advance() bool { return bool(C.pn_link_advance(l.pn)) } func (l Link) Credit() int { return int(C.pn_link_credit(l.pn)) } func (l Link) Queued() int { return int(C.pn_link_queued(l.pn)) } func (l Link) RemoteCredit() int { return int(C.pn_link_remote_credit(l.pn)) } func (l Link) Drained() int { return int(C.pn_link_drained(l.pn)) } func (l Link) Available() int { return int(C.pn_link_available(l.pn)) } func (l Link) SndSettleMode() SndSettleMode { return SndSettleMode(C.pn_link_snd_settle_mode(l.pn)) } func (l Link) RcvSettleMode() RcvSettleMode { return RcvSettleMode(C.pn_link_rcv_settle_mode(l.pn)) } func (l Link) SetSndSettleMode(mode SndSettleMode) { C.pn_link_set_snd_settle_mode(l.pn, C.pn_snd_settle_mode_t(mode)) } func (l Link) SetRcvSettleMode(mode RcvSettleMode) { C.pn_link_set_rcv_settle_mode(l.pn, C.pn_rcv_settle_mode_t(mode)) } func (l Link) RemoteSndSettleMode() SndSettleMode { return SndSettleMode(C.pn_link_remote_snd_settle_mode(l.pn)) } func (l Link) RemoteRcvSettleMode() RcvSettleMode { return RcvSettleMode(C.pn_link_remote_rcv_settle_mode(l.pn)) } func (l Link) Unsettled() int { return int(C.pn_link_unsettled(l.pn)) } func (l Link) Offered(credit int) { C.pn_link_offered(l.pn, C.int(credit)) } func (l Link) Flow(credit int) { C.pn_link_flow(l.pn, C.int(credit)) } func (l Link) Drain(credit int) { C.pn_link_drain(l.pn, C.int(credit)) } func (l Link) SetDrain(drain bool) { C.pn_link_set_drain(l.pn, C.bool(drain)) } func (l Link) Draining() bool { return bool(C.pn_link_draining(l.pn)) } // Wrappers for declarations in delivery.h type Delivery struct{ pn *C.pn_delivery_t } func (d Delivery) IsNil() bool { return d.pn == nil } func (d Delivery) CPtr() unsafe.Pointer { return unsafe.Pointer(d.pn) } func (d Delivery) Tag() DeliveryTag { return DeliveryTag{C.pn_delivery_tag(d.pn)} } func (d Delivery) Link() Link { return Link{C.pn_delivery_link(d.pn)} } func (d Delivery) Local() Disposition { return Disposition{C.pn_delivery_local(d.pn)} } func (d Delivery) LocalState() uint64 { return uint64(C.pn_delivery_local_state(d.pn)) } func (d Delivery) Remote() Disposition { return Disposition{C.pn_delivery_remote(d.pn)} } func (d Delivery) RemoteState() uint64 { return uint64(C.pn_delivery_remote_state(d.pn)) } func (d Delivery) Settled() bool { return bool(C.pn_delivery_settled(d.pn)) } func (d Delivery) Pending() uint { return uint(C.pn_delivery_pending(d.pn)) } func (d Delivery) Partial() bool { return bool(C.pn_delivery_partial(d.pn)) } func (d Delivery) Writable() bool { return bool(C.pn_delivery_writable(d.pn)) } func (d Delivery) Readable() bool { return bool(C.pn_delivery_readable(d.pn)) } func (d Delivery) Updated() bool { return bool(C.pn_delivery_updated(d.pn)) } func (d Delivery) Update(state uint64) { C.pn_delivery_update(d.pn, C.uint64_t(state)) } func (d Delivery) Clear() { C.pn_delivery_clear(d.pn) } func (d Delivery) Current() bool { return bool(C.pn_delivery_current(d.pn)) } func (d Delivery) Settle() { C.pn_delivery_settle(d.pn) } func (d Delivery) Dump() { C.pn_delivery_dump(d.pn) } func (d Delivery) Buffered() bool { return bool(C.pn_delivery_buffered(d.pn)) } // Wrappers for declarations in disposition.h type Disposition struct{ pn *C.pn_disposition_t } func (d Disposition) IsNil() bool { return d.pn == nil } func (d Disposition) CPtr() unsafe.Pointer { return unsafe.Pointer(d.pn) } func (d Disposition) Type() uint64 { return uint64(C.pn_disposition_type(d.pn)) } func (d Disposition) Condition() Condition { return Condition{C.pn_disposition_condition(d.pn)} } func (d Disposition) Data() Data { return Data{C.pn_disposition_data(d.pn)} } func (d Disposition) SectionNumber() uint16 { return uint16(C.pn_disposition_get_section_number(d.pn)) } func (d Disposition) SetSectionNumber(section_number uint16) { C.pn_disposition_set_section_number(d.pn, C.uint32_t(section_number)) } func (d Disposition) SectionOffset() uint64 { return uint64(C.pn_disposition_get_section_offset(d.pn)) } func (d Disposition) SetSectionOffset(section_offset uint64) { C.pn_disposition_set_section_offset(d.pn, C.uint64_t(section_offset)) } func (d Disposition) IsFailed() bool { return bool(C.pn_disposition_is_failed(d.pn)) } func (d Disposition) SetFailed(failed bool) { C.pn_disposition_set_failed(d.pn, C.bool(failed)) } func (d Disposition) IsUndeliverable() bool { return bool(C.pn_disposition_is_undeliverable(d.pn)) } func (d Disposition) SetUndeliverable(undeliverable bool) { C.pn_disposition_set_undeliverable(d.pn, C.bool(undeliverable)) } func (d Disposition) Annotations() Data { return Data{C.pn_disposition_annotations(d.pn)} } // Wrappers for declarations in condition.h type Condition struct{ pn *C.pn_condition_t } func (c Condition) IsNil() bool { return c.pn == nil } func (c Condition) CPtr() unsafe.Pointer { return unsafe.Pointer(c.pn) } func (c Condition) IsSet() bool { return bool(C.pn_condition_is_set(c.pn)) } func (c Condition) Clear() { C.pn_condition_clear(c.pn) } func (c Condition) Name() string { return C.GoString(C.pn_condition_get_name(c.pn)) } func (c Condition) SetName(name string) int { nameC := C.CString(name) defer C.free(unsafe.Pointer(nameC)) return int(C.pn_condition_set_name(c.pn, nameC)) } func (c Condition) Description() string { return C.GoString(C.pn_condition_get_description(c.pn)) } func (c Condition) SetDescription(description string) int { descriptionC := C.CString(description) defer C.free(unsafe.Pointer(descriptionC)) return int(C.pn_condition_set_description(c.pn, descriptionC)) } func (c Condition) Info() Data { return Data{C.pn_condition_info(c.pn)} } func (c Condition) IsRedirect() bool { return bool(C.pn_condition_is_redirect(c.pn)) } func (c Condition) RedirectHost() string { return C.GoString(C.pn_condition_redirect_host(c.pn)) } func (c Condition) RedirectPort() int { return int(C.pn_condition_redirect_port(c.pn)) } // Wrappers for declarations in terminus.h type TerminusType C.pn_terminus_type_t const ( Unspecified TerminusType = C.PN_UNSPECIFIED Source TerminusType = C.PN_SOURCE Target TerminusType = C.PN_TARGET Coordinator TerminusType = C.PN_COORDINATOR ) func (e TerminusType) String() string { switch e { case C.PN_UNSPECIFIED: return "Unspecified" case C.PN_SOURCE: return "Source" case C.PN_TARGET: return "Target" case C.PN_COORDINATOR: return "Coordinator" } return "unknown" } type Durability C.pn_durability_t const ( Nondurable Durability = C.PN_NONDURABLE Configuration Durability = C.PN_CONFIGURATION Deliveries Durability = C.PN_DELIVERIES ) func (e Durability) String() string { switch e { case C.PN_NONDURABLE: return "Nondurable" case C.PN_CONFIGURATION: return "Configuration" case C.PN_DELIVERIES: return "Deliveries" } return "unknown" } type ExpiryPolicy C.pn_expiry_policy_t const ( ExpireWithLink ExpiryPolicy = C.PN_EXPIRE_WITH_LINK ExpireWithSession ExpiryPolicy = C.PN_EXPIRE_WITH_SESSION ExpireWithConnection ExpiryPolicy = C.PN_EXPIRE_WITH_CONNECTION ExpireNever ExpiryPolicy = C.PN_EXPIRE_NEVER ) func (e ExpiryPolicy) String() string { switch e { case C.PN_EXPIRE_WITH_LINK: return "ExpireWithLink" case C.PN_EXPIRE_WITH_SESSION: return "ExpireWithSession" case C.PN_EXPIRE_WITH_CONNECTION: return "ExpireWithConnection" case C.PN_EXPIRE_NEVER: return "ExpireNever" } return "unknown" } type DistributionMode C.pn_distribution_mode_t const ( DistModeUnspecified DistributionMode = C.PN_DIST_MODE_UNSPECIFIED DistModeCopy DistributionMode = C.PN_DIST_MODE_COPY DistModeMove DistributionMode = C.PN_DIST_MODE_MOVE ) func (e DistributionMode) String() string { switch e { case C.PN_DIST_MODE_UNSPECIFIED: return "DistModeUnspecified" case C.PN_DIST_MODE_COPY: return "DistModeCopy" case C.PN_DIST_MODE_MOVE: return "DistModeMove" } return "unknown" } type Terminus struct{ pn *C.pn_terminus_t } func (t Terminus) IsNil() bool { return t.pn == nil } func (t Terminus) CPtr() unsafe.Pointer { return unsafe.Pointer(t.pn) } func (t Terminus) Type() TerminusType { return TerminusType(C.pn_terminus_get_type(t.pn)) } func (t Terminus) SetType(type_ TerminusType) int { return int(C.pn_terminus_set_type(t.pn, C.pn_terminus_type_t(type_))) } func (t Terminus) Address() string { return C.GoString(C.pn_terminus_get_address(t.pn)) } func (t Terminus) SetAddress(address string) int { addressC := C.CString(address) defer C.free(unsafe.Pointer(addressC)) return int(C.pn_terminus_set_address(t.pn, addressC)) } func (t Terminus) SetDistributionMode(mode DistributionMode) int { return int(C.pn_terminus_set_distribution_mode(t.pn, C.pn_distribution_mode_t(mode))) } func (t Terminus) Durability() Durability { return Durability(C.pn_terminus_get_durability(t.pn)) } func (t Terminus) SetDurability(durability Durability) int { return int(C.pn_terminus_set_durability(t.pn, C.pn_durability_t(durability))) } func (t Terminus) ExpiryPolicy() ExpiryPolicy { return ExpiryPolicy(C.pn_terminus_get_expiry_policy(t.pn)) } func (t Terminus) SetExpiryPolicy(policy ExpiryPolicy) int { return int(C.pn_terminus_set_expiry_policy(t.pn, C.pn_expiry_policy_t(policy))) } func (t Terminus) Timeout() time.Duration { return (time.Duration(C.pn_terminus_get_timeout(t.pn)) * time.Second) } func (t Terminus) SetTimeout(timeout time.Duration) int { return int(C.pn_terminus_set_timeout(t.pn, C.pn_seconds_t(timeout/time.Second))) } func (t Terminus) IsDynamic() bool { return bool(C.pn_terminus_is_dynamic(t.pn)) } func (t Terminus) SetDynamic(dynamic bool) int { return int(C.pn_terminus_set_dynamic(t.pn, C.bool(dynamic))) } func (t Terminus) Properties() Data { return Data{C.pn_terminus_properties(t.pn)} } func (t Terminus) Capabilities() Data { return Data{C.pn_terminus_capabilities(t.pn)} } func (t Terminus) Outcomes() Data { return Data{C.pn_terminus_outcomes(t.pn)} } func (t Terminus) Filter() Data { return Data{C.pn_terminus_filter(t.pn)} } func (t Terminus) Copy(src Terminus) int { return int(C.pn_terminus_copy(t.pn, src.pn)) } // Wrappers for declarations in connection.h type Connection struct{ pn *C.pn_connection_t } func (c Connection) IsNil() bool { return c.pn == nil } func (c Connection) CPtr() unsafe.Pointer { return unsafe.Pointer(c.pn) } func (c Connection) Free() { C.pn_connection_free(c.pn) } func (c Connection) Release() { C.pn_connection_release(c.pn) } func (c Connection) Error() error { return PnError(C.pn_connection_error(c.pn)) } func (c Connection) State() State { return State(C.pn_connection_state(c.pn)) } func (c Connection) Open() { C.pn_connection_open(c.pn) } func (c Connection) Close() { C.pn_connection_close(c.pn) } func (c Connection) Reset() { C.pn_connection_reset(c.pn) } func (c Connection) Condition() Condition { return Condition{C.pn_connection_condition(c.pn)} } func (c Connection) RemoteCondition() Condition { return Condition{C.pn_connection_remote_condition(c.pn)} } func (c Connection) Container() string { return C.GoString(C.pn_connection_get_container(c.pn)) } func (c Connection) SetContainer(container string) { containerC := C.CString(container) defer C.free(unsafe.Pointer(containerC)) C.pn_connection_set_container(c.pn, containerC) } func (c Connection) SetUser(user string) { userC := C.CString(user) defer C.free(unsafe.Pointer(userC)) C.pn_connection_set_user(c.pn, userC) } func (c Connection) User() string { return C.GoString(C.pn_connection_get_user(c.pn)) } func (c Connection) Hostname() string { return C.GoString(C.pn_connection_get_hostname(c.pn)) } func (c Connection) SetHostname(hostname string) { hostnameC := C.CString(hostname) defer C.free(unsafe.Pointer(hostnameC)) C.pn_connection_set_hostname(c.pn, hostnameC) } func (c Connection) RemoteContainer() string { return C.GoString(C.pn_connection_remote_container(c.pn)) } func (c Connection) RemoteHostname() string { return C.GoString(C.pn_connection_remote_hostname(c.pn)) } func (c Connection) OfferedCapabilities() Data { return Data{C.pn_connection_offered_capabilities(c.pn)} } func (c Connection) DesiredCapabilities() Data { return Data{C.pn_connection_desired_capabilities(c.pn)} } func (c Connection) Properties() Data { return Data{C.pn_connection_properties(c.pn)} } func (c Connection) RemoteOfferedCapabilities() Data { return Data{C.pn_connection_remote_offered_capabilities(c.pn)} } func (c Connection) RemoteDesiredCapabilities() Data { return Data{C.pn_connection_remote_desired_capabilities(c.pn)} } func (c Connection) RemoteProperties() Data { return Data{C.pn_connection_remote_properties(c.pn)} } func (c Connection) Transport() Transport { return Transport{C.pn_connection_transport(c.pn)} } // Wrappers for declarations in transport.h type Transport struct{ pn *C.pn_transport_t } func (t Transport) IsNil() bool { return t.pn == nil } func (t Transport) CPtr() unsafe.Pointer { return unsafe.Pointer(t.pn) } func (t Transport) SetServer() { C.pn_transport_set_server(t.pn) } func (t Transport) Free() { C.pn_transport_free(t.pn) } func (t Transport) User() string { return C.GoString(C.pn_transport_get_user(t.pn)) } func (t Transport) RequireAuth(required bool) { C.pn_transport_require_auth(t.pn, C.bool(required)) } func (t Transport) IsAuthenticated() bool { return bool(C.pn_transport_is_authenticated(t.pn)) } func (t Transport) RequireEncryption(required bool) { C.pn_transport_require_encryption(t.pn, C.bool(required)) } func (t Transport) IsEncrypted() bool { return bool(C.pn_transport_is_encrypted(t.pn)) } func (t Transport) Condition() Condition { return Condition{C.pn_transport_condition(t.pn)} } func (t Transport) Error() error { return PnError(C.pn_transport_error(t.pn)) } func (t Transport) Bind(connection Connection) int { return int(C.pn_transport_bind(t.pn, connection.pn)) } func (t Transport) Unbind() int { return int(C.pn_transport_unbind(t.pn)) } func (t Transport) Log(message string) { messageC := C.CString(message) defer C.free(unsafe.Pointer(messageC)) C.pn_transport_log(t.pn, messageC) } func (t Transport) ChannelMax() uint32 { return uint32(C.pn_transport_get_channel_max(t.pn)) } func (t Transport) SetChannelMax(channel_max uint32) int { return int(C.pn_transport_set_channel_max(t.pn, C.uint16_t(channel_max))) } func (t Transport) RemoteChannelMax() uint32 { return uint32(C.pn_transport_remote_channel_max(t.pn)) } func (t Transport) MaxFrame() uint16 { return uint16(C.pn_transport_get_max_frame(t.pn)) } func (t Transport) SetMaxFrame(size uint16) { C.pn_transport_set_max_frame(t.pn, C.uint32_t(size)) } func (t Transport) RemoteMaxFrame() uint16 { return uint16(C.pn_transport_get_remote_max_frame(t.pn)) } func (t Transport) IdleTimeout() time.Duration { return (time.Duration(C.pn_transport_get_idle_timeout(t.pn)) * time.Millisecond) } func (t Transport) SetIdleTimeout(timeout time.Duration) { C.pn_transport_set_idle_timeout(t.pn, C.pn_millis_t(timeout/time.Millisecond)) } func (t Transport) RemoteIdleTimeout() time.Duration { return (time.Duration(C.pn_transport_get_remote_idle_timeout(t.pn)) * time.Millisecond) } func (t Transport) Input(bytes string, available uint) int { bytesC := C.CString(bytes) defer C.free(unsafe.Pointer(bytesC)) return int(C.pn_transport_input(t.pn, bytesC, C.size_t(available))) } func (t Transport) Output(bytes string, size uint) int { bytesC := C.CString(bytes) defer C.free(unsafe.Pointer(bytesC)) return int(C.pn_transport_output(t.pn, bytesC, C.size_t(size))) } func (t Transport) Capacity() int { return int(C.pn_transport_capacity(t.pn)) } func (t Transport) Process(size uint) int { return int(C.pn_transport_process(t.pn, C.size_t(size))) } func (t Transport) CloseTail() int { return int(C.pn_transport_close_tail(t.pn)) } func (t Transport) Pending() int { return int(C.pn_transport_pending(t.pn)) } func (t Transport) Peek(dst string, size uint) int { dstC := C.CString(dst) defer C.free(unsafe.Pointer(dstC)) return int(C.pn_transport_peek(t.pn, dstC, C.size_t(size))) } func (t Transport) Pop(size uint) { C.pn_transport_pop(t.pn, C.size_t(size)) } func (t Transport) CloseHead() int { return int(C.pn_transport_close_head(t.pn)) } func (t Transport) Quiesced() bool { return bool(C.pn_transport_quiesced(t.pn)) } func (t Transport) Closed() bool { return bool(C.pn_transport_closed(t.pn)) } func (t Transport) Tick(now time.Time) time.Time { return goTime(C.pn_transport_tick(t.pn, pnTime(now))) } func (t Transport) Connection() Connection { return Connection{C.pn_transport_connection(t.pn)} } // Wrappers for declarations in sasl.h type SASLOutcome C.pn_sasl_outcome_t const ( SASLNone SASLOutcome = C.PN_SASL_NONE SASLOk SASLOutcome = C.PN_SASL_OK SASLAuth SASLOutcome = C.PN_SASL_AUTH SASLSys SASLOutcome = C.PN_SASL_SYS SASLPerm SASLOutcome = C.PN_SASL_PERM SASLTemp SASLOutcome = C.PN_SASL_TEMP ) func (e SASLOutcome) String() string { switch e { case C.PN_SASL_NONE: return "SASLNone" case C.PN_SASL_OK: return "SASLOk" case C.PN_SASL_AUTH: return "SASLAuth" case C.PN_SASL_SYS: return "SASLSys" case C.PN_SASL_PERM: return "SASLPerm" case C.PN_SASL_TEMP: return "SASLTemp" } return "unknown" } type SASL struct{ pn *C.pn_sasl_t } func (s SASL) IsNil() bool { return s.pn == nil } func (s SASL) CPtr() unsafe.Pointer { return unsafe.Pointer(s.pn) } func (s SASL) Done(outcome SASLOutcome) { C.pn_sasl_done(s.pn, C.pn_sasl_outcome_t(outcome)) } func (s SASL) Outcome() SASLOutcome { return SASLOutcome(C.pn_sasl_outcome(s.pn)) } func (s SASL) User() string { return C.GoString(C.pn_sasl_get_user(s.pn)) } func (s SASL) Mech() string { return C.GoString(C.pn_sasl_get_mech(s.pn)) } func (s SASL) AllowedMechs(mechs string) { mechsC := C.CString(mechs) defer C.free(unsafe.Pointer(mechsC)) C.pn_sasl_allowed_mechs(s.pn, mechsC) } func (s SASL) SetAllowInsecureMechs(insecure bool) { C.pn_sasl_set_allow_insecure_mechs(s.pn, C.bool(insecure)) } func (s SASL) AllowInsecureMechs() bool { return bool(C.pn_sasl_get_allow_insecure_mechs(s.pn)) } func (s SASL) ConfigName(name string) { nameC := C.CString(name) defer C.free(unsafe.Pointer(nameC)) C.pn_sasl_config_name(s.pn, nameC) } func (s SASL) ConfigPath(path string) { pathC := C.CString(path) defer C.free(unsafe.Pointer(pathC)) C.pn_sasl_config_path(s.pn, pathC) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers.go0000664000000000000000000003403713257152177024170 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file contains special-case wrapper functions or wrappers that don't follow // the pattern of genwrap.go. package proton //#include //#include //#include //#include //#include //#include //#include //#include //#include //#include //#include import "C" import ( "fmt" "qpid.apache.org/amqp" "reflect" "time" "unsafe" ) // TODO aconway 2015-05-05: Documentation for generated types. // CHandle holds an unsafe.Pointer to a proton C struct, the C type depends on the // Go type implementing this interface. For low level, at-your-own-risk use only. type CHandle interface { // CPtr returns the unsafe C pointer, equivalent to a C void*. CPtr() unsafe.Pointer } // Incref increases the refcount of a proton value, which prevents the // underlying C struct being freed until you call Decref(). // // It can be useful to "pin" a proton value in memory while it is in use by // goroutines other than the event loop goroutine. For example if you Incref() a // Link, the underlying object is not freed when the link is closed, so means // other goroutines can continue to safely use it as an index in a map or inject // it into the event loop goroutine. There will of course be an error if you try // to use a link after it is closed, but not a segmentation fault. func Incref(c CHandle) { if p := c.CPtr(); p != nil { C.pn_incref(p) } } // Decref decreases the refcount of a proton value, freeing the underlying C // struct if this is the last reference. Only call this if you previously // called Incref() for this value. func Decref(c CHandle) { if p := c.CPtr(); p != nil { C.pn_decref(p) } } // Event is an AMQP protocol event. type Event struct { pn *C.pn_event_t eventType EventType connection Connection transport Transport session Session link Link delivery Delivery injecter Injecter } func makeEvent(pn *C.pn_event_t, injecter Injecter) Event { return Event{ pn: pn, eventType: EventType(C.pn_event_type(pn)), connection: Connection{C.pn_event_connection(pn)}, transport: Transport{C.pn_event_transport(pn)}, session: Session{C.pn_event_session(pn)}, link: Link{C.pn_event_link(pn)}, delivery: Delivery{C.pn_event_delivery(pn)}, injecter: injecter, } } func (e Event) IsNil() bool { return e.eventType == EventType(0) } func (e Event) Type() EventType { return e.eventType } func (e Event) Connection() Connection { return e.connection } func (e Event) Transport() Transport { return e.transport } func (e Event) Session() Session { return e.session } func (e Event) Link() Link { return e.link } func (e Event) Delivery() Delivery { return e.delivery } func (e Event) String() string { return e.Type().String() } // Injecter should not be used in a handler function, but it can be passed to // other goroutines (via a channel or to a goroutine started by handler // functions) to let them inject functions back into the handlers goroutine. func (e Event) Injecter() Injecter { return e.injecter } // Data is an intermediate form of decoded AMQP data. type Data struct{ pn *C.pn_data_t } func (d Data) Free() { C.pn_data_free(d.pn) } func (d Data) CPtr() unsafe.Pointer { return unsafe.Pointer(d.pn) } func (d Data) Clear() { C.pn_data_clear(d.pn) } func (d Data) Rewind() { C.pn_data_rewind(d.pn) } func (d Data) Next() { C.pn_data_next(d.pn) } func (d Data) Error() error { return PnError(C.pn_data_error(d.pn)) } func (d Data) Empty() bool { return C.pn_data_size(d.pn) == 0 } func (d Data) String() string { str := C.pn_string(C.CString("")) defer C.pn_free(unsafe.Pointer(str)) C.pn_inspect(unsafe.Pointer(d.pn), str) return C.GoString(C.pn_string_get(str)) } // Unmarshal the value of d into value pointed at by ptr, see amqp.Unmarshal() for details func (d Data) Unmarshal(ptr interface{}) error { d.Rewind() d.Next() err := amqp.UnmarshalUnsafe(d.CPtr(), ptr) return err } // Marshal the value v into d, see amqp.Marshal() for details func (d Data) Marshal(v interface{}) error { d.Clear() return amqp.MarshalUnsafe(v, d.CPtr()) } // State holds the state flags for an AMQP endpoint. type State byte const ( SLocalUninit State = C.PN_LOCAL_UNINIT SLocalActive = C.PN_LOCAL_ACTIVE SLocalClosed = C.PN_LOCAL_CLOSED SRemoteUninit = C.PN_REMOTE_UNINIT SRemoteActive = C.PN_REMOTE_ACTIVE SRemoteClosed = C.PN_REMOTE_CLOSED ) // Has is True if bits & state is non 0. func (s State) Has(bits State) bool { return s&bits != 0 } func (s State) LocalUninit() bool { return s.Has(SLocalUninit) } func (s State) LocalActive() bool { return s.Has(SLocalActive) } func (s State) LocalClosed() bool { return s.Has(SLocalClosed) } func (s State) RemoteUninit() bool { return s.Has(SRemoteUninit) } func (s State) RemoteActive() bool { return s.Has(SRemoteActive) } func (s State) RemoteClosed() bool { return s.Has(SRemoteClosed) } // Return a State containing just the local flags func (s State) Local() State { return State(s & C.PN_LOCAL_MASK) } // Return a State containing just the remote flags func (s State) Remote() State { return State(s & C.PN_REMOTE_MASK) } // Endpoint is the common interface for Connection, Link and Session. type Endpoint interface { // State is the open/closed state. State() State // Open an endpoint. Open() // Close an endpoint. Close() // Condition holds a local error condition. Condition() Condition // RemoteCondition holds a remote error condition. RemoteCondition() Condition // Human readable name String() string // Human readable endpoint type "sender-link", "session" etc. Type() string } // CloseError sets an error condition (if err != nil) on an endpoint and closes // the endpoint if not already closed func CloseError(e Endpoint, err error) { if err != nil && !e.Condition().IsSet() { e.Condition().SetError(err) } e.Close() } // EndpointError returns the remote error if there is one, the local error if not // nil if there is no error. func EndpointError(e Endpoint) error { err := e.RemoteCondition().Error() if err == nil { err = e.Condition().Error() } return err } const ( Received uint64 = C.PN_RECEIVED Accepted = C.PN_ACCEPTED Rejected = C.PN_REJECTED Released = C.PN_RELEASED Modified = C.PN_MODIFIED ) // SettleAs is equivalent to d.Update(disposition); d.Settle() func (d Delivery) SettleAs(disposition uint64) { d.Update(disposition) d.Settle() } // Accept accepts and settles a delivery. func (d Delivery) Accept() { d.SettleAs(Accepted) } // Reject rejects and settles a delivery func (d Delivery) Reject() { d.SettleAs(Rejected) } // Release releases and settles a delivery // If delivered is true the delivery count for the message will be increased. func (d Delivery) Release(delivered bool) { if delivered { d.SettleAs(Modified) } else { d.SettleAs(Released) } } type DeliveryTag struct{ pn C.pn_delivery_tag_t } func (t DeliveryTag) String() string { return C.GoStringN(t.pn.start, C.int(t.pn.size)) } func (l Link) Recv(buf []byte) int { if len(buf) == 0 { return 0 } return int(C.pn_link_recv(l.pn, (*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf)))) } func (l Link) SendBytes(bytes []byte) int { return int(C.pn_link_send(l.pn, cPtr(bytes), cLen(bytes))) } func pnTag(tag string) C.pn_delivery_tag_t { bytes := []byte(tag) return C.pn_dtag(cPtr(bytes), cLen(bytes)) } func (l Link) Delivery(tag string) Delivery { return Delivery{C.pn_delivery(l.pn, pnTag(tag))} } func (l Link) Connection() Connection { return l.Session().Connection() } // Human-readable link description including name, source, target and direction. func (l Link) String() string { switch { case l.IsNil(): return fmt.Sprintf("") case l.IsSender(): return fmt.Sprintf("%s(%s->%s)", l.Name(), l.Source().Address(), l.Target().Address()) default: return fmt.Sprintf("%s(%s<-%s)", l.Name(), l.Target().Address(), l.Source().Address()) } } func (l Link) Type() string { if l.IsSender() { return "sender-link" } else { return "receiver-link" } } // IsDrain calls pn_link_get_drain(), it conflicts with pn_link_drain() under the normal mapping. func (l Link) IsDrain() bool { return bool(C.pn_link_get_drain(l.pn)) } func cPtr(b []byte) *C.char { if len(b) == 0 { return nil } return (*C.char)(unsafe.Pointer(&b[0])) } func cLen(b []byte) C.size_t { return C.size_t(len(b)) } func (s Session) Sender(name string) Link { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) return Link{C.pn_sender(s.pn, cname)} } func (s Session) Receiver(name string) Link { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) return Link{C.pn_receiver(s.pn, cname)} } func (t Transport) String() string { return fmt.Sprintf("(Transport)(%p)", t.CPtr()) } // Unique (per process) string identifier for a connection, useful for debugging. func (c Connection) String() string { // Use the transport address to match the default transport logs from PN_TRACE. return fmt.Sprintf("(Connection)(%p)", c.Transport().CPtr()) } func (c Connection) Type() string { return "connection" } // Head functions don't follow the normal naming conventions so missed by the generator. func (c Connection) LinkHead(s State) Link { return Link{C.pn_link_head(c.pn, C.pn_state_t(s))} } func (c Connection) SessionHead(s State) Session { return Session{C.pn_session_head(c.pn, C.pn_state_t(s))} } func (c Connection) Links(state State) (links []Link) { for l := c.LinkHead(state); !l.IsNil(); l = l.Next(state) { links = append(links, l) } return } func (c Connection) Sessions(state State) (sessions []Session) { for s := c.SessionHead(state); !s.IsNil(); s = s.Next(state) { sessions = append(sessions, s) } return } // SetPassword takes []byte not string because it is impossible to erase a string // from memory reliably. Proton will not keep the password in memory longer than // needed, the caller should overwrite their copy on return. // // The password must not contain embedded nul characters, a trailing nul is ignored. func (c Connection) SetPassword(password []byte) { if len(password) == 0 || password[len(password)-1] != 0 { password = append(password, 0) // Proton requires a terminating null. } C.pn_connection_set_password(c.pn, (*C.char)(unsafe.Pointer(&password[0]))) } func (s Session) String() string { return fmt.Sprintf("(Session)(%p)", s.pn) // TODO aconway 2016-09-12: should print channel number. } func (s Session) Type() string { return "session" } // Error returns an instance of amqp.Error or nil. func (c Condition) Error() error { if c.IsNil() || !c.IsSet() { return nil } return amqp.Error{Name: c.Name(), Description: c.Description()} } // Set a Go error into a condition. // If it is not an amqp.Condition use the error type as name, error string as description. func (c Condition) SetError(err error) { if err != nil { if cond, ok := err.(amqp.Error); ok { c.SetName(cond.Name) c.SetDescription(cond.Description) } else { c.SetName(reflect.TypeOf(err).Name()) c.SetDescription(err.Error()) } } } func (c Connection) Session() (Session, error) { s := Session{C.pn_session(c.pn)} if s.IsNil() { return s, Connection(c).Error() } return s, nil } // pnTime converts Go time.Time to Proton millisecond Unix time. // // Note: t.isZero() is converted to C.pn_timestamp_t(0) and vice-versa. These // are used as "not set" sentinel values by the Go and Proton APIs, so it is // better to conserve the "zeroness" even though they don't represent the same // time instant. // func pnTime(t time.Time) (pnt C.pn_timestamp_t) { if !t.IsZero() { pnt = C.pn_timestamp_t(t.Unix()*1000 + int64(t.Nanosecond())/int64(time.Millisecond)) } return } // goTime converts a pn_timestamp_t to a Go time.Time. // // Note: C.pn_timestamp_t(0) is converted to a zero time.Time and // vice-versa. These are used as "not set" sentinel values by the Go and Proton // APIs, so it is better to conserve the "zeroness" even though they don't // represent the same time instant. // func goTime(pnt C.pn_timestamp_t) (t time.Time) { if pnt != 0 { t = time.Unix(int64(pnt/1000), int64(pnt%1000)*int64(time.Millisecond)) } return } // Special treatment for Transport.Head, return value is unsafe.Pointer not string func (t Transport) Head() unsafe.Pointer { return unsafe.Pointer(C.pn_transport_head(t.pn)) } // Special treatment for Transport.Tail, return value is unsafe.Pointer not string func (t Transport) Tail() unsafe.Pointer { return unsafe.Pointer(C.pn_transport_tail(t.pn)) } // Special treatment for Transport.Push, takes []byte instead of char*, size func (t Transport) Push(bytes []byte) int { return int(C.pn_transport_push(t.pn, (*C.char)(unsafe.Pointer(&bytes[0])), C.size_t(len(bytes)))) } // Get the SASL object for the transport. func (t Transport) SASL() SASL { return SASL{C.pn_sasl(t.pn)} } // Do we support extended SASL negotiation? // All implementations of Proton support ANONYMOUS and EXTERNAL on both // client and server sides and PLAIN on the client side. // // Extended SASL implememtations use an external library (Cyrus SASL) // to support other mechanisms beyond these basic ones. func SASLExtended() bool { return bool(C.pn_sasl_extended()) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/uuid.go0000664000000000000000000000314413257152177023266 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package proton import ( "fmt" "math/rand" "sync" "time" ) // UUID is a 16-byte Universally Unique Identifier type UUID [16]byte // String gives a UUID in standard string format. func (u UUID) String() string { return fmt.Sprintf("%X-%X-%X-%X-%X", u[0:4], u[4:6], u[6:8], u[8:10], u[10:]) } // Don't mess with the default random source. var randomSource = rand.NewSource(time.Now().UnixNano()) var randomLock sync.Mutex func random() byte { randomLock.Lock() defer randomLock.Unlock() return byte(randomSource.Int63()) } // UUID4 returns a randomly-generated (version 4) UUID, as per RFC4122 func UUID4() UUID { var u UUID for i := 0; i < len(u); i++ { u[i] = random() } // See /https://tools.ietf.org/html/rfc4122#section-4.4 u[6] = (u[6] & 0x0F) | 0x40 // Version bits to 4 u[8] = (u[8] & 0x3F) | 0x80 // Reserved bits (top two) set to 01 return u } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/proton_test.go0000664000000000000000000000472013257152177024701 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package proton import ( "fmt" "net" "path" "runtime" "testing" "time" ) func errorIf(t *testing.T, err error) { if err != nil { _, file, line, ok := runtime.Caller(1) // annotate with location of caller. if ok { _, file = path.Split(file) } t.Errorf("(from %s:%d) %v", file, line, err) } } func fatalIf(t *testing.T, err error) { if err != nil { _, file, line, ok := runtime.Caller(1) // annotate with location of caller. if ok { _, file = path.Split(file) } t.Fatalf("(from %s:%d) %v", file, line, err) } } type events []EventType type testEngine struct { Engine events chan EventType } func newTestEngine(conn net.Conn) (*testEngine, error) { testEng := &testEngine{events: make(chan EventType, 1000)} return testEng, testEng.Initialize(conn, testEng) } func (eng *testEngine) HandleEvent(e Event) { eng.events <- e.Type() } func (eng *testEngine) expect(events []EventType) error { timer := time.After(5 * time.Second) for _, want := range events { select { case got := <-eng.events: if want != got { return fmt.Errorf("want %s, got %s", want, got) } case <-timer: return fmt.Errorf("expect timeout") } } return nil } func Test(t *testing.T) { cConn, sConn := net.Pipe() client, err := newTestEngine(cConn) fatalIf(t, err) server, err := newTestEngine(sConn) fatalIf(t, err) server.Server() go client.Run() go server.Run() fatalIf(t, server.expect(events{EConnectionInit, EConnectionBound})) fatalIf(t, client.expect(events{EConnectionInit, EConnectionBound})) fatalIf(t, client.InjectWait(func() error { client.Connection().Open(); return nil })) fatalIf(t, client.expect(events{EConnectionLocalOpen})) fatalIf(t, server.expect(events{EConnectionRemoteOpen})) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/message.go0000664000000000000000000000550013257152177023742 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package proton // #include // #include // #include import "C" import ( "fmt" "qpid.apache.org/amqp" "strconv" "sync/atomic" ) // HasMessage is true if all message data is available. // Equivalent to !d.isNil && d.Readable() && !d.Partial() func (d Delivery) HasMessage() bool { return !d.IsNil() && d.Readable() && !d.Partial() } // Message decodes the message contained in a delivery. // // Must be called in the correct link context with this delivery as the current message, // handling an MMessage event is always a safe context to call this function. // // Will return an error if message is incomplete or not current. func (delivery Delivery) Message() (m amqp.Message, err error) { if !delivery.Readable() { return nil, fmt.Errorf("delivery is not readable") } if delivery.Partial() { return nil, fmt.Errorf("delivery has partial message") } data := make([]byte, delivery.Pending()) result := delivery.Link().Recv(data) if result != len(data) { return nil, fmt.Errorf("cannot receive message: %s", PnErrorCode(result)) } m = amqp.NewMessage() err = m.Decode(data) return } // Process-wide atomic counter for generating tag names var tagCounter uint64 func nextTag() string { return strconv.FormatUint(atomic.AddUint64(&tagCounter, 1), 32) } // Send sends a amqp.Message over a Link. // Returns a Delivery that can be use to determine the outcome of the message. func (link Link) Send(m amqp.Message) (Delivery, error) { if !link.IsSender() { return Delivery{}, fmt.Errorf("attempt to send message on receiving link") } delivery := link.Delivery(nextTag()) bytes, err := m.Encode(nil) if err != nil { return Delivery{}, fmt.Errorf("cannot send message %s", err) } result := link.SendBytes(bytes) link.Advance() if result != len(bytes) { if result < 0 { return delivery, fmt.Errorf("send failed %v", PnErrorCode(result)) } else { return delivery, fmt.Errorf("send incomplete %v of %v", result, len(bytes)) } } if link.RemoteSndSettleMode() == SndSettled { delivery.Settle() } return delivery, nil } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go0000664000000000000000000002645013257152177024125 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package proton import "fmt" // EventHandler handles core proton events. type EventHandler interface { // HandleEvent is called with an event. // Typically HandleEvent() is implemented as a switch on e.Type() // Returning an error will stop the Engine. HandleEvent(e Event) } // MessagingHandler provides an alternative interface to EventHandler. // it is easier to use for most applications that send and receive messages. // // Implement this interface and then wrap your value with a MessagingHandlerDelegator. // MessagingHandlerDelegator implements EventHandler and can be registered with a Engine. // type MessagingHandler interface { // HandleMessagingEvent is called with MessagingEvent. // Typically HandleEvent() is implemented as a switch on e.Type() // Returning an error will stop the Engine. HandleMessagingEvent(MessagingEvent, Event) } // MessagingEvent provides a set of events that are easier to work with than the // core events defined by EventType // // There are 3 types of "endpoint": Connection, Session and Link. For each // endpoint there are 5 events: Opening, Opened, Closing, Closed and Error. // // The meaning of these events is as follows: // // Opening: The remote end opened, the local end will open automatically. // // Opened: Both ends are open, regardless of which end opened first. // // Closing: The remote end closed without error, the local end will close automatically. // // Error: The remote end closed with an error, the local end will close automatically. // // Closed: Both ends are closed, regardless of which end closed first or if there was an error. // No further events will be received for the endpoint. // type MessagingEvent int const ( // The event loop starts. MStart MessagingEvent = iota // The peer closes the connection with an error condition. MConnectionError // The peer closes the session with an error condition. MSessionError // The peer closes the link with an error condition. MLinkError // The peer Initiates the opening of the connection. MConnectionOpening // The peer initiates the opening of the session. MSessionOpening // The peer initiates the opening of the link. MLinkOpening // The connection is opened. MConnectionOpened // The session is opened. MSessionOpened // The link is opened. MLinkOpened // The peer initiates the closing of the connection. MConnectionClosing // The peer initiates the closing of the session. MSessionClosing // The peer initiates the closing of the link. MLinkClosing // Both ends of the connection are closed. MConnectionClosed // Both ends of the session are closed. MSessionClosed // Both ends of the link are closed. MLinkClosed // The sender link has credit and messages can // therefore be transferred. MSendable // The remote peer accepts an outgoing message. MAccepted // The remote peer rejects an outgoing message. MRejected // The peer releases an outgoing message. Note that this may be in response to // either the RELEASE or MODIFIED state as defined by the AMQP specification. MReleased // The peer has settled the outgoing message. This is the point at which it // should never be re-transmitted. MSettled // A message is received. Call Event.Delivery().Message() to decode as an amqp.Message. // To manage the outcome of this messages (e.g. to accept or reject the message) // use Event.Delivery(). MMessage // A network connection was disconnected. MDisconnected ) func (t MessagingEvent) String() string { switch t { case MStart: return "Start" case MConnectionError: return "ConnectionError" case MSessionError: return "SessionError" case MLinkError: return "LinkError" case MConnectionOpening: return "ConnectionOpening" case MSessionOpening: return "SessionOpening" case MLinkOpening: return "LinkOpening" case MConnectionOpened: return "ConnectionOpened" case MSessionOpened: return "SessionOpened" case MLinkOpened: return "LinkOpened" case MConnectionClosing: return "ConnectionClosing" case MSessionClosing: return "SessionClosing" case MLinkClosing: return "LinkClosing" case MConnectionClosed: return "ConnectionClosed" case MSessionClosed: return "SessionClosed" case MLinkClosed: return "LinkClosed" case MDisconnected: return "Disconnected" case MSendable: return "Sendable" case MAccepted: return "Accepted" case MRejected: return "Rejected" case MReleased: return "Released" case MSettled: return "Settled" case MMessage: return "Message" default: return "Unknown" } } // ResourceHandler provides a simple way to track the creation and deletion of // various proton objects. // endpointDelegator captures common patterns for endpoints opening/closing type endpointDelegator struct { remoteOpen, remoteClose, localOpen, localClose EventType opening, opened, closing, closed, error MessagingEvent endpoint func(Event) Endpoint delegator *MessagingAdapter } // HandleEvent handles an open/close event for an endpoint in a generic way. func (d endpointDelegator) HandleEvent(e Event) { endpoint := d.endpoint(e) state := endpoint.State() switch e.Type() { case d.localOpen: if state.RemoteActive() { d.delegator.mhandler.HandleMessagingEvent(d.opened, e) } case d.remoteOpen: d.delegator.mhandler.HandleMessagingEvent(d.opening, e) switch { case state.LocalActive(): d.delegator.mhandler.HandleMessagingEvent(d.opened, e) case state.LocalUninit(): if d.delegator.AutoOpen { endpoint.Open() } } case d.remoteClose: if endpoint.RemoteCondition().IsSet() { // Closed with error d.delegator.mhandler.HandleMessagingEvent(d.error, e) } else { d.delegator.mhandler.HandleMessagingEvent(d.closing, e) } if state.LocalClosed() { d.delegator.mhandler.HandleMessagingEvent(d.closed, e) } else if state.LocalActive() { endpoint.Close() } case d.localClose: if state.RemoteClosed() { d.delegator.mhandler.HandleMessagingEvent(d.closed, e) } default: // We shouldn't be called with any other event type. panic(fmt.Errorf("internal error, not an open/close event: %s", e)) } } type flowcontroller struct { window, drained int } func (d flowcontroller) HandleEvent(e Event) { link := e.Link() switch e.Type() { case ELinkLocalOpen, ELinkRemoteOpen, ELinkFlow, EDelivery: if link.IsReceiver() { d.drained += link.Drained() if d.drained != 0 { link.Flow(d.window - link.Credit()) } } } } // MessagingAdapter implements a EventHandler and delegates to a MessagingHandler. // You can modify the exported fields before you pass the MessagingAdapter to // a Engine. type MessagingAdapter struct { mhandler MessagingHandler connection, session, link endpointDelegator flowcontroller EventHandler // AutoSettle (default true) automatically pre-settle outgoing messages. AutoSettle bool // AutoAccept (default true) automatically accept and settle incoming messages // if they are not settled by the delegate. AutoAccept bool // AutoOpen (default true) automatically open remotely opened endpoints. AutoOpen bool // Prefetch (default 10) initial credit to issue for incoming links. Prefetch int // PeerCloseIsError (default false) if true a close by the peer will be treated as an error. PeerCloseError bool } func NewMessagingAdapter(h MessagingHandler) *MessagingAdapter { return &MessagingAdapter{ mhandler: h, flowcontroller: nil, AutoSettle: true, AutoAccept: true, AutoOpen: true, Prefetch: 10, PeerCloseError: false, } } func handleIf(h EventHandler, e Event) { if h != nil { h.HandleEvent(e) } } // Handle a proton event by passing the corresponding MessagingEvent(s) to // the MessagingHandler. func (d *MessagingAdapter) HandleEvent(e Event) { handleIf(d.flowcontroller, e) switch e.Type() { case EConnectionInit: d.connection = endpointDelegator{ EConnectionRemoteOpen, EConnectionRemoteClose, EConnectionLocalOpen, EConnectionLocalClose, MConnectionOpening, MConnectionOpened, MConnectionClosing, MConnectionClosed, MConnectionError, func(e Event) Endpoint { return e.Connection() }, d, } d.session = endpointDelegator{ ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose, MSessionOpening, MSessionOpened, MSessionClosing, MSessionClosed, MSessionError, func(e Event) Endpoint { return e.Session() }, d, } d.link = endpointDelegator{ ELinkRemoteOpen, ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose, MLinkOpening, MLinkOpened, MLinkClosing, MLinkClosed, MLinkError, func(e Event) Endpoint { return e.Link() }, d, } if d.Prefetch > 0 { d.flowcontroller = flowcontroller{window: d.Prefetch, drained: 0} } d.mhandler.HandleMessagingEvent(MStart, e) case EConnectionRemoteOpen: d.connection.HandleEvent(e) case EConnectionRemoteClose: d.connection.HandleEvent(e) e.Connection().Transport().CloseTail() case EConnectionLocalOpen, EConnectionLocalClose: d.connection.HandleEvent(e) case ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose: d.session.HandleEvent(e) case ELinkRemoteOpen: e.Link().Source().Copy(e.Link().RemoteSource()) e.Link().Target().Copy(e.Link().RemoteTarget()) d.link.HandleEvent(e) case ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose: d.link.HandleEvent(e) case ELinkFlow: if e.Link().IsSender() && e.Link().Credit() > 0 { d.mhandler.HandleMessagingEvent(MSendable, e) } case EDelivery: if e.Delivery().Link().IsReceiver() { d.incoming(e) } else { d.outgoing(e) } case ETransportClosed: d.mhandler.HandleMessagingEvent(MDisconnected, e) } } func (d *MessagingAdapter) incoming(e Event) { delivery := e.Delivery() if delivery.HasMessage() { d.mhandler.HandleMessagingEvent(MMessage, e) if d.AutoAccept && !delivery.Settled() { delivery.Accept() } if delivery.Current() { e.Link().Advance() } } else if delivery.Updated() && delivery.Settled() { d.mhandler.HandleMessagingEvent(MSettled, e) } return } func (d *MessagingAdapter) outgoing(e Event) { delivery := e.Delivery() if delivery.Updated() { switch delivery.Remote().Type() { case Accepted: d.mhandler.HandleMessagingEvent(MAccepted, e) case Rejected: d.mhandler.HandleMessagingEvent(MRejected, e) case Released, Modified: d.mhandler.HandleMessagingEvent(MReleased, e) } if delivery.Settled() { // The delivery was settled remotely, inform the local end. d.mhandler.HandleMessagingEvent(MSettled, e) } if d.AutoSettle { delivery.Settle() // Local settle, don't mhandler MSettled till the remote end settles. } } return } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/error.go0000664000000000000000000000451713257152177023456 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Internal implementation details - ignore. package proton // #cgo LDFLAGS: -lqpid-proton-core // #include // #include import "C" import ( "fmt" "sync" "sync/atomic" ) type PnErrorCode int func (e PnErrorCode) String() string { switch e { case C.PN_EOS: return "end-of-data" case C.PN_ERR: return "error" case C.PN_OVERFLOW: return "overflow" case C.PN_UNDERFLOW: return "underflow" case C.PN_STATE_ERR: return "bad-state" case C.PN_ARG_ERR: return "invalid-argument" case C.PN_TIMEOUT: return "timeout" case C.PN_INTR: return "interrupted" case C.PN_INPROGRESS: return "in-progress" default: return fmt.Sprintf("unknown-error(%d)", e) } } func PnError(e *C.pn_error_t) error { if e == nil || C.pn_error_code(e) == 0 { return nil } return fmt.Errorf("%s: %s", PnErrorCode(C.pn_error_code(e)), C.GoString(C.pn_error_text(e))) } // ErrorHolder is a goroutine-safe error holder that keeps the first error that is set. type ErrorHolder struct { once sync.Once value atomic.Value } // Set the error if not already set, return the error in the Holder. func (e *ErrorHolder) Set(err error) { if err != nil { e.once.Do(func() { e.value.Store(err) }) } } // Get the error. func (e *ErrorHolder) Get() (err error) { err, _ = e.value.Load().(error) return } // assert panics if condition is false with optional formatted message func assert(condition bool, format ...interface{}) { if !condition { if len(format) > 0 { panic(fmt.Errorf(format[0].(string), format[1:]...)) } else { panic(fmt.Errorf("assertion failed")) } } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go0000664000000000000000000003120013257152177023557 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package proton import ( "fmt" "net" "os" "strings" "sync" "time" "unsafe" ) /* #include #include #include #include #include #include #include #include */ import "C" // Injecter allows functions to be "injected" into the event-processing loop, to // be called in the same goroutine as event handlers. type Injecter interface { // Inject a function into the engine goroutine. // // f() will be called in the same goroutine as event handlers, so it can safely // use values belonging to event handlers without synchronization. f() should // not block, no further events or injected functions can be processed until // f() returns. // // Returns a non-nil error if the function could not be injected and will // never be called. Otherwise the function will eventually be called. // // Note that proton values (Link, Session, Connection etc.) that existed when // Inject(f) was called may have become invalid by the time f() is executed. // Handlers should handle keep track of Closed events to ensure proton values // are not used after they become invalid. One technique is to have map from // proton values to application values. Check that the map has the correct // proton/application value pair at the start of the injected function and // delete the value from the map when handling a Closed event. Inject(f func()) error // InjectWait is like Inject but does not return till f() has completed. // If f() cannot be injected it returns the error from Inject(), otherwise // it returns the error from f() InjectWait(f func() error) error } // Engine reads from a net.Conn, decodes AMQP events and calls the appropriate // Handler functions sequentially in a single goroutine. Actions taken by // Handler functions (such as sending messages) are encoded and written to the // net.Conn. You can create multiple Engines to handle multiple connections // concurrently. // // You implement the EventHandler and/or MessagingHandler interfaces and provide // those values to NewEngine(). Their HandleEvent method will be called in the // event-handling goroutine. // // Handlers can pass values from an event (Connections, Links, Deliveries etc.) to // other goroutines, store them, or use them as map indexes. Effectively they are // just pointers. Other goroutines cannot call their methods directly but they can // can create a function closure to call such methods and pass it to Engine.Inject() // to have it evaluated in the engine goroutine. // // You are responsible for ensuring you don't use an event value after it is // invalid. The handler methods will tell you when a value is no longer valid. For // example after a LinkClosed event, that link is no longer valid. If you do // Link.Close() yourself (in a handler or injected function) the link remains valid // until the corresponding LinkClosed event is received by the handler. // // Engine.Close() will take care of cleaning up any remaining values when you are // done with the Engine. All values associated with a engine become invalid when you // call Engine.Close() // // The qpid.apache.org/proton/concurrent package will do all this for you, so it // may be a better choice for some applications. // type Engine struct { // Error is set on exit from Run() if there was an error. err ErrorHolder inject chan func() conn net.Conn connection Connection transport Transport collector *C.pn_collector_t handlers []EventHandler // Handlers for proton events. running chan struct{} // This channel will be closed when the goroutines are done. closeOnce sync.Once timer *time.Timer traceEvent bool } const bufferSize = 4096 func envBool(name string) bool { v := strings.ToLower(os.Getenv(name)) return v == "true" || v == "1" || v == "yes" || v == "on" } // Create a new Engine and call Initialize() with conn and handlers func NewEngine(conn net.Conn, handlers ...EventHandler) (*Engine, error) { eng := &Engine{} return eng, eng.Initialize(conn, handlers...) } // Initialize an Engine with a connection and handlers. Start it with Run() func (eng *Engine) Initialize(conn net.Conn, handlers ...EventHandler) error { eng.inject = make(chan func()) eng.conn = conn eng.connection = Connection{C.pn_connection()} eng.transport = Transport{C.pn_transport()} eng.collector = C.pn_collector() eng.handlers = handlers eng.running = make(chan struct{}) eng.timer = time.NewTimer(0) eng.traceEvent = envBool("PN_TRACE_EVT") if eng.transport.IsNil() || eng.connection.IsNil() || eng.collector == nil { eng.free() return fmt.Errorf("proton.NewEngine cannot allocate") } C.pn_connection_collect(eng.connection.pn, eng.collector) return nil } // Create a byte slice backed by C memory. // Empty or error (size <= 0) returns a nil byte slice. func cByteSlice(start unsafe.Pointer, size int) []byte { if start == nil || size <= 0 { return nil } else { // Slice from very large imaginary array in C memory return (*[1 << 30]byte)(start)[:size:size] } } func (eng *Engine) Connection() Connection { return eng.connection } func (eng *Engine) Transport() Transport { return eng.transport } func (eng *Engine) String() string { return fmt.Sprintf("[%s]%s-%s", eng.Id(), eng.conn.LocalAddr(), eng.conn.RemoteAddr()) } func (eng *Engine) Id() string { // Use transport address to match default PN_TRACE_FRM=1 output. return fmt.Sprintf("%p", eng.Transport().CPtr()) } func (eng *Engine) Error() error { return eng.err.Get() } // Inject a function into the Engine's event loop. // // f() will be called in the same event-processing goroutine that calls Handler // methods. f() can safely call methods on values that belong to this engine // (Sessions, Links etc) // // The injected function has no parameters or return values. It is normally a // closure and can use channels to communicate with the injecting goroutine if // necessary. // // Returns a non-nil error if the engine is closed before the function could be // injected. func (eng *Engine) Inject(f func()) error { select { case eng.inject <- f: return nil case <-eng.running: return eng.Error() } } // InjectWait is like Inject but does not return till f() has completed or the // engine is closed, and returns an error value from f() func (eng *Engine) InjectWait(f func() error) error { done := make(chan error) defer close(done) err := eng.Inject(func() { done <- f() }) if err != nil { return err } select { case <-eng.running: return eng.Error() case err := <-done: return err } } // Server puts the Engine in server mode, meaning it will auto-detect security settings on // the incoming connection such as use of SASL and SSL. // Must be called before Run() // func (eng *Engine) Server() { eng.Transport().SetServer() } func (eng *Engine) disconnect(err error) { cond := eng.Transport().Condition() cond.SetError(err) // Set the provided error. cond.SetError(eng.conn.Close()) // Use connection error if cond is not already set. eng.transport.CloseTail() eng.transport.CloseHead() } // Close the engine's connection. // If err != nil pass it to the remote end as the close condition. // Returns when the remote end closes or disconnects. func (eng *Engine) Close(err error) { _ = eng.Inject(func() { CloseError(eng.Connection(), err) }) <-eng.running } // CloseTimeout like Close but disconnect if the remote end doesn't close within timeout. func (eng *Engine) CloseTimeout(err error, timeout time.Duration) { _ = eng.Inject(func() { CloseError(eng.Connection(), err) }) select { case <-eng.running: case <-time.After(timeout): eng.Disconnect(err) } } // Disconnect the engine's connection immediately without an AMQP close. // Process any termination events before returning. func (eng *Engine) Disconnect(err error) { _ = eng.Inject(func() { eng.disconnect(err) }) <-eng.running } // Let proton run timed activity and set up the next tick func (eng *Engine) tick() { now := time.Now() next := eng.Transport().Tick(now) if !next.IsZero() { eng.timer.Reset(next.Sub(now)) } } func (eng *Engine) dispatch() bool { for ce := C.pn_collector_peek(eng.collector); ce != nil; ce = C.pn_collector_peek(eng.collector) { e := makeEvent(ce, eng) if eng.traceEvent { eng.transport.Log(e.String()) } for _, h := range eng.handlers { h.HandleEvent(e) } if e.Type() == EConnectionRemoteOpen { eng.tick() // Update the tick if changed by remote. } C.pn_collector_pop(eng.collector) } return !eng.transport.Closed() || C.pn_collector_peek(eng.collector) != nil } func (eng *Engine) writeBuffer() []byte { size := eng.Transport().Pending() // Evaluate before Head(), may change buffer. start := eng.Transport().Head() return cByteSlice(start, size) } func (eng *Engine) readBuffer() []byte { size := eng.Transport().Capacity() start := eng.Transport().Tail() return cByteSlice(start, size) } func (eng *Engine) free() { if !eng.transport.IsNil() { eng.transport.Unbind() eng.transport.Free() eng.transport = Transport{} } if !eng.connection.IsNil() { eng.connection.Free() eng.connection = Connection{} } if eng.collector != nil { C.pn_collector_release(eng.collector) C.pn_collector_free(eng.collector) eng.collector = nil } } // Run the engine. Engine.Run() will exit when the engine is closed or // disconnected. You can check for errors after exit with Engine.Error(). // func (eng *Engine) Run() error { defer eng.free() eng.transport.Bind(eng.connection) eng.tick() // Start ticking if needed // Channels for read and write buffers going in and out of the read/write goroutines. // The channels are unbuffered: we want to exchange buffers in sequence. readsIn, writesIn := make(chan []byte), make(chan []byte) readsOut, writesOut := make(chan []byte), make(chan []byte) wait := sync.WaitGroup{} wait.Add(2) // Read and write goroutines go func() { // Read goroutine defer wait.Done() for { rbuf, ok := <-readsIn if !ok { return } n, err := eng.conn.Read(rbuf) if n > 0 { readsOut <- rbuf[:n] } else if err != nil { _ = eng.Inject(func() { eng.Transport().Condition().SetError(err) eng.Transport().CloseTail() }) return } } }() go func() { // Write goroutine defer wait.Done() for { wbuf, ok := <-writesIn if !ok { return } n, err := eng.conn.Write(wbuf) if n > 0 { writesOut <- wbuf[:n] } else if err != nil { _ = eng.Inject(func() { eng.Transport().Condition().SetError(err) eng.Transport().CloseHead() }) return } } }() for eng.dispatch() { readBuf := eng.readBuffer() writeBuf := eng.writeBuffer() // Note that getting the buffers can generate events (eg. SASL events) that // might close the transport. Check if we are already finished before // blocking for IO. if !eng.dispatch() { break } // sendReads/sendWrites are nil (not sendable in select) unless we have a // buffer to read/write var sendReads, sendWrites chan []byte if readBuf != nil { sendReads = readsIn } if writeBuf != nil { sendWrites = writesIn } // Send buffers to the read/write goroutines if we have them. // Get buffers from the read/write goroutines and process them // Check for injected functions select { case sendReads <- readBuf: case sendWrites <- writeBuf: case buf := <-readsOut: eng.transport.Process(uint(len(buf))) case buf := <-writesOut: eng.transport.Pop(uint(len(buf))) case f, ok := <-eng.inject: // Function injected from another goroutine if ok { f() } case <-eng.timer.C: eng.tick() } } eng.err.Set(EndpointError(eng.Connection())) eng.err.Set(eng.Transport().Condition().Error()) close(readsIn) close(writesIn) close(eng.running) // Signal goroutines have exited and Error is set, disable Inject() _ = eng.conn.Close() // Close conn, force read/write goroutines to exit (they will Inject) wait.Wait() // Wait for goroutines return eng.err.Get() } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go0000664000000000000000000000522213257152177023064 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package proton wraps Proton-C, an event-driven, concurrent-unsafe AMQP 1.0 C library (package 'electron' is more "Go-like" and concurrent-safe) This package requires the [proton-C library](http://qpid.apache.org/proton) to be installed. Consult the C API documentation at http://qpid.apache.org/proton for more information about the types here. There is a 1-1 correspondence between C type pn_foo_t and Go type proton.Foo, and between C function pn_foo_do_something(pn_foo_t*, ...) and Go method func (proton.Foo) DoSomething(...) The proton.Engine type pumps data between a Go net.Conn and a proton event loop goroutine that feeds events to a proton.MessagingHandler, which you must implement. See the Engine documentation for more. MessagingHandler defines an event handling interface that you can implement to react to AMQP protocol events. There is also a lower-level EventHandler, but MessagingHandler provides a simpler set of events and automates common tasks for you, for most applications it will be more convenient. NOTE: Methods on most types defined in this package (Sessions, Links etc.) can *only* be called in the event handler goroutine of the relevant Connection/Engine, either by the HandleEvent method of a handler type or in a function injected into the goroutine via Inject() or InjectWait() Handlers and injected functions can set up channels to communicate with other goroutines. Note the Injecter associated with a handler available as part of the Event value passed to HandleEvent. Separate Engine instances are independent, and can run concurrently. The 'electron' package is built on the proton package but instead offers a concurrent-safe API that can use simple procedural loops rather than event handlers to express application logic. It is easier to use for most applications. */ package proton // #cgo LDFLAGS: -lqpid-proton-core import "C" // This file is just for the package comment. qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/0000775000000000000000000000000013257152177022261 5ustar qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/time.go0000664000000000000000000000525713257152177023557 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "math" "reflect" "time" ) // Timeout is the error returned if an operation does not complete on time. // // Methods named *Timeout in this package take time.Duration timeout parameter. // // If timeout > 0 and there is no result available before the timeout, they // return a zero or nil value and Timeout as an error. // // If timeout == 0 they will return a result if one is immediately available or // nil/zero and Timeout as an error if not. // // If timeout == Forever the function will return only when there is a result or // some non-timeout error occurs. // var Timeout = fmt.Errorf("timeout") // Forever can be used as a timeout parameter to indicate wait forever. const Forever time.Duration = math.MaxInt64 // timedReceive receives on channel (which can be a chan of any type), waiting // up to timeout. // // timeout==0 means do a non-blocking receive attempt. timeout < 0 means block // forever. Other values mean block up to the timeout. // // Returns error Timeout on timeout, Closed on channel close. func timedReceive(channel interface{}, timeout time.Duration) (interface{}, error) { cases := []reflect.SelectCase{ reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(channel)}, } if timeout == 0 { // Non-blocking cases = append(cases, reflect.SelectCase{Dir: reflect.SelectDefault}) } else { // Block up to timeout cases = append(cases, reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(After(timeout))}) } chosen, value, ok := reflect.Select(cases) switch { case chosen == 0 && ok: return value.Interface(), nil case chosen == 0 && !ok: return nil, Closed default: return nil, Timeout } } // After is like time.After but returns a nil channel if timeout == Forever // since selecting on a nil channel will never return. func After(timeout time.Duration) <-chan time.Time { if timeout == Forever { return nil } else { return time.After(timeout) } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/session.go0000664000000000000000000001005713257152177024276 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "qpid.apache.org/proton" ) // Session is an AMQP session, it contains Senders and Receivers. type Session interface { Endpoint // Sender opens a new sender. Sender(...LinkOption) (Sender, error) // Receiver opens a new Receiver. Receiver(...LinkOption) (Receiver, error) } type session struct { endpoint pSession proton.Session connection *connection incomingCapacity, outgoingWindow uint } // SessionOption can be passed when creating a Session type SessionOption func(*session) // IncomingCapacity returns a Session Option that sets the size (in bytes) of // the session's incoming data buffer. func IncomingCapacity(bytes uint) SessionOption { return func(s *session) { s.incomingCapacity = bytes } } // OutgoingWindow returns a Session Option that sets the outgoing window size (in frames). func OutgoingWindow(frames uint) SessionOption { return func(s *session) { s.outgoingWindow = frames } } // in proton goroutine func newSession(c *connection, es proton.Session, setting ...SessionOption) *session { s := &session{ connection: c, pSession: es, } s.endpoint.init(es.String()) for _, set := range setting { set(s) } c.handler.sessions[s.pSession] = s s.pSession.SetIncomingCapacity(s.incomingCapacity) s.pSession.SetOutgoingWindow(s.outgoingWindow) s.pSession.Open() return s } func (s *session) Connection() Connection { return s.connection } func (s *session) pEndpoint() proton.Endpoint { return s.pSession } func (s *session) engine() *proton.Engine { return s.connection.engine } func (s *session) Close(err error) { _ = s.engine().Inject(func() { if s.Error() == nil { localClose(s.pSession, err) } }) } func (s *session) Sender(setting ...LinkOption) (snd Sender, err error) { err = s.engine().InjectWait(func() error { if s.Error() != nil { return s.Error() } l, err := makeLocalLink(s, true, setting...) if err == nil { snd = newSender(l) } return err }) return } func (s *session) Receiver(setting ...LinkOption) (rcv Receiver, err error) { err = s.engine().InjectWait(func() error { if s.Error() != nil { return s.Error() } l, err := makeLocalLink(s, false, setting...) if err == nil { rcv = newReceiver(l) } return err }) return } // IncomingSender is sent on the Connection.Incoming() channel when there is an // incoming request to open a session. type IncomingSession struct { incoming h *handler pSession proton.Session incomingCapacity, outgoingWindow uint } func newIncomingSession(h *handler, ps proton.Session) *IncomingSession { return &IncomingSession{incoming: makeIncoming(ps), h: h, pSession: ps} } // SetIncomingCapacity sets the session buffer capacity of an incoming session in bytes. func (in *IncomingSession) SetIncomingCapacity(bytes uint) { in.incomingCapacity = bytes } // SetOutgoingWindow sets the session outgoing window of an incoming session in frames. func (in *IncomingSession) SetOutgoingWindow(frames uint) { in.outgoingWindow = frames } // Accept an incoming session endpoint. func (in *IncomingSession) Accept() Endpoint { return in.accept(func() Endpoint { return newSession(in.h.connection, in.pSession, IncomingCapacity(in.incomingCapacity), OutgoingWindow(in.outgoingWindow)) }) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go0000664000000000000000000002016113257152177024070 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron // #include import "C" import ( "fmt" "qpid.apache.org/amqp" "qpid.apache.org/proton" "time" ) // Sender is a Link that sends messages. // // The result of sending a message is provided by an Outcome value. // // A sender can buffer messages up to the credit limit provided by the remote receiver. // All the Send* methods will block if the buffer is full until there is space. // Send*Timeout methods will give up after the timeout and set Timeout as Outcome.Error. // type Sender interface { Endpoint LinkSettings // SendSync sends a message and blocks until the message is acknowledged by the remote receiver. // Returns an Outcome, which may contain an error if the message could not be sent. SendSync(m amqp.Message) Outcome // SendWaitable puts a message in the send buffer and returns a channel that // you can use to wait for the Outcome of just that message. The channel is // buffered so you can receive from it whenever you want without blocking. // // Note: can block if there is no space to buffer the message. SendWaitable(m amqp.Message) <-chan Outcome // SendForget buffers a message for sending and returns, with no notification of the outcome. // // Note: can block if there is no space to buffer the message. SendForget(m amqp.Message) // SendAsync puts a message in the send buffer and returns immediately. An // Outcome with Value = value will be sent to the ack channel when the remote // receiver has acknowledged the message or if there is an error. // // You can use the same ack channel for many calls to SendAsync(), possibly on // many Senders. The channel will receive the outcomes in the order they // become available. The channel should be buffered and/or served by dedicated // goroutines to avoid blocking the connection. // // If ack == nil no Outcome is sent. // // Note: can block if there is no space to buffer the message. SendAsync(m amqp.Message, ack chan<- Outcome, value interface{}) SendAsyncTimeout(m amqp.Message, ack chan<- Outcome, value interface{}, timeout time.Duration) SendWaitableTimeout(m amqp.Message, timeout time.Duration) <-chan Outcome SendForgetTimeout(m amqp.Message, timeout time.Duration) SendSyncTimeout(m amqp.Message, timeout time.Duration) Outcome } // Outcome provides information about the outcome of sending a message. type Outcome struct { // Status of the message: was it sent, how was it acknowledged. Status SentStatus // Error is a local error if Status is Unsent or Unacknowledged, a remote error otherwise. Error error // Value provided by the application in SendAsync() Value interface{} } func (o Outcome) send(ack chan<- Outcome) { if ack != nil { ack <- o } } // SentStatus indicates the status of a sent message. type SentStatus int const ( // Message was never sent Unsent SentStatus = iota // Message was sent but never acknowledged. It may or may not have been received. Unacknowledged // Message was accepted by the receiver (or was sent pre-settled, accept is assumed) Accepted // Message was rejected as invalid by the receiver Rejected // Message was not processed by the receiver but may be valid for a different receiver Released // Receiver responded with an unrecognized status. Unknown ) // String human readable name for SentStatus. func (s SentStatus) String() string { switch s { case Unsent: return "unsent" case Unacknowledged: return "unacknowledged" case Accepted: return "accepted" case Rejected: return "rejected" case Released: return "released" case Unknown: return "unknown" default: return fmt.Sprintf("invalid(%d)", s) } } // Convert proton delivery state code to SentStatus value func sentStatus(d uint64) SentStatus { switch d { case proton.Accepted: return Accepted case proton.Rejected: return Rejected case proton.Released, proton.Modified: return Released default: return Unknown } } // Sender implementation, held by handler. type sender struct { link credit chan struct{} // Signal available credit. } func (s *sender) SendAsyncTimeout(m amqp.Message, ack chan<- Outcome, v interface{}, t time.Duration) { // wait for credit if _, err := timedReceive(s.credit, t); err != nil { if err == Closed && s.Error() != nil { err = s.Error() } Outcome{Unsent, err, v}.send(ack) return } // Send a message in handler goroutine err := s.engine().Inject(func() { if s.Error() != nil { Outcome{Unsent, s.Error(), v}.send(ack) return } delivery, err2 := s.pLink.Send(m) switch { case err2 != nil: Outcome{Unsent, err2, v}.send(ack) case ack == nil || s.SndSettle() == SndSettled: // Pre-settled if s.SndSettle() != SndUnsettled { // Not forced to send unsettled by link policy delivery.Settle() } Outcome{Accepted, nil, v}.send(ack) // Assume accepted default: s.handler().sentMessages[delivery] = sentMessage{ack, v} // Register with handler } if s.pLink.Credit() > 0 { // Signal there is still credit s.sendable() } }) if err != nil { Outcome{Unsent, err, v}.send(ack) } } // Set credit flag if not already set. Non-blocking, any goroutine func (s *sender) sendable() { select { // Non-blocking case s.credit <- struct{}{}: default: } } func (s *sender) SendWaitableTimeout(m amqp.Message, t time.Duration) <-chan Outcome { out := make(chan Outcome, 1) s.SendAsyncTimeout(m, out, nil, t) return out } func (s *sender) SendForgetTimeout(m amqp.Message, t time.Duration) { s.SendAsyncTimeout(m, nil, nil, t) } func (s *sender) SendSyncTimeout(m amqp.Message, t time.Duration) Outcome { deadline := time.Now().Add(t) ack := s.SendWaitableTimeout(m, t) t = deadline.Sub(time.Now()) // Adjust for time already spent. if t < 0 { t = 0 } if out, err := timedReceive(ack, t); err == nil { return out.(Outcome) } else { if err == Closed && s.Error() != nil { err = s.Error() } return Outcome{Unacknowledged, err, nil} } } func (s *sender) SendAsync(m amqp.Message, ack chan<- Outcome, v interface{}) { s.SendAsyncTimeout(m, ack, v, Forever) } func (s *sender) SendWaitable(m amqp.Message) <-chan Outcome { return s.SendWaitableTimeout(m, Forever) } func (s *sender) SendForget(m amqp.Message) { s.SendForgetTimeout(m, Forever) } func (s *sender) SendSync(m amqp.Message) Outcome { return <-s.SendWaitable(m) } // handler goroutine func (s *sender) closed(err error) error { close(s.credit) return s.link.closed(err) } func newSender(ls linkSettings) *sender { s := &sender{link: link{linkSettings: ls}, credit: make(chan struct{}, 1)} s.endpoint.init(s.link.pLink.String()) s.handler().addLink(s.pLink, s) s.link.pLink.Open() return s } // sentMessage records a sent message on the handler. type sentMessage struct { ack chan<- Outcome value interface{} } // IncomingSender is sent on the Connection.Incoming() channel when there is // an incoming request to open a sender link. type IncomingSender struct { incoming linkSettings } func newIncomingSender(sn *session, pLink proton.Link) *IncomingSender { return &IncomingSender{ incoming: makeIncoming(pLink), linkSettings: makeIncomingLinkSettings(pLink, sn), } } // Accept accepts an incoming sender endpoint func (in *IncomingSender) Accept() Endpoint { return in.accept(func() Endpoint { return newSender(in.linkSettings) }) } // Call in injected functions to check if the sender is valid. func (s *sender) valid() bool { s2, ok := s.handler().links[s.pLink].(*sender) return ok && s2 == s } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go0000664000000000000000000001634013257152177024420 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "qpid.apache.org/amqp" "qpid.apache.org/proton" "time" ) // Receiver is a Link that receives messages. // type Receiver interface { Endpoint LinkSettings // Receive blocks until a message is available or until the Receiver is closed // and has no more buffered messages. Receive() (ReceivedMessage, error) // ReceiveTimeout is like Receive but gives up after timeout, see Timeout. // // Note that that if Prefetch is false, after a Timeout the credit issued by // Receive remains on the link. It will be used by the next call to Receive. ReceiveTimeout(timeout time.Duration) (ReceivedMessage, error) // Prefetch==true means the Receiver will automatically issue credit to the // remote sender to keep its buffer as full as possible, i.e. it will // "pre-fetch" messages independently of the application calling // Receive(). This gives good throughput for applications that handle a // continuous stream of messages. Larger capacity may improve throughput, the // optimal value depends on the characteristics of your application. // // Prefetch==false means the Receiver will issue only issue credit when you // call Receive(), and will only issue enough credit to satisfy the calls // actually made. This gives lower throughput but will not fetch any messages // in advance. It is good for synchronous applications that need to evaluate // each message before deciding whether to receive another. The // request-response pattern is a typical example. If you make concurrent // calls to Receive with pre-fetch disabled, you can improve performance by // setting the capacity close to the expected number of concurrent calls. // Prefetch() bool // Capacity is the size (number of messages) of the local message buffer // These are messages received but not yet returned to the application by a call to Receive() Capacity() int } // Receiver implementation type receiver struct { link buffer chan ReceivedMessage callers int } func (r *receiver) Capacity() int { return cap(r.buffer) } func (r *receiver) Prefetch() bool { return r.prefetch } // Call in proton goroutine func newReceiver(ls linkSettings) *receiver { r := &receiver{link: link{linkSettings: ls}} r.endpoint.init(r.link.pLink.String()) if r.capacity < 1 { r.capacity = 1 } r.buffer = make(chan ReceivedMessage, r.capacity) r.handler().addLink(r.pLink, r) r.link.pLink.Open() if r.prefetch { r.flow(r.maxFlow()) } return r } // Call in proton goroutine. Max additional credit we can request. func (r *receiver) maxFlow() int { return cap(r.buffer) - len(r.buffer) - r.pLink.Credit() } func (r *receiver) flow(credit int) { if credit > 0 { r.pLink.Flow(credit) } } // Inject flow check per-caller call when prefetch is off. // Called with inc=1 at start of call, inc = -1 at end func (r *receiver) caller(inc int) { _ = r.engine().Inject(func() { r.callers += inc need := r.callers - (len(r.buffer) + r.pLink.Credit()) max := r.maxFlow() if need > max { need = max } r.flow(need) }) } // Inject flow top-up if prefetch is enabled func (r *receiver) flowTopUp() { if r.prefetch { _ = r.engine().Inject(func() { r.flow(r.maxFlow()) }) } } func (r *receiver) Receive() (rm ReceivedMessage, err error) { return r.ReceiveTimeout(Forever) } func (r *receiver) ReceiveTimeout(timeout time.Duration) (rm ReceivedMessage, err error) { assert(r.buffer != nil, "Receiver is not open: %s", r) if !r.prefetch { // Per-caller flow control select { // Check for immediate availability, avoid caller() inject case rm2, ok := <-r.buffer: if ok { rm = rm2 } else { err = r.Error() } return default: // Not immediately available, inject caller() counts r.caller(+1) defer r.caller(-1) } } rmi, err := timedReceive(r.buffer, timeout) switch err { case nil: r.flowTopUp() rm = rmi.(ReceivedMessage) case Closed: err = r.Error() } return } // Called in proton goroutine on MMessage event. func (r *receiver) message(delivery proton.Delivery) { if r.pLink.State().RemoteClosed() { localClose(r.pLink, r.pLink.RemoteCondition().Error()) return } if delivery.HasMessage() { m, err := delivery.Message() if err != nil { localClose(r.pLink, err) return } assert(m != nil) r.pLink.Advance() if r.pLink.Credit() < 0 { localClose(r.pLink, fmt.Errorf("received message in excess of credit limit")) } else { // We never issue more credit than cap(buffer) so this will not block. r.buffer <- ReceivedMessage{m, delivery, r} } } } func (r *receiver) closed(err error) error { e := r.link.closed(err) if r.buffer != nil { close(r.buffer) } return e } // ReceivedMessage contains an amqp.Message and allows the message to be acknowledged. type ReceivedMessage struct { // Message is the received message. Message amqp.Message pDelivery proton.Delivery receiver Receiver } // Acknowledge a ReceivedMessage with the given delivery status. func (rm *ReceivedMessage) acknowledge(status uint64) error { return rm.receiver.(*receiver).engine().Inject(func() { // Deliveries are valid as long as the connection is, unless settled. rm.pDelivery.SettleAs(uint64(status)) }) } // Accept tells the sender that we take responsibility for processing the message. func (rm *ReceivedMessage) Accept() error { return rm.acknowledge(proton.Accepted) } // Reject tells the sender we consider the message invalid and unusable. func (rm *ReceivedMessage) Reject() error { return rm.acknowledge(proton.Rejected) } // Release tells the sender we will not process the message but some other // receiver might. func (rm *ReceivedMessage) Release() error { return rm.acknowledge(proton.Released) } // IncomingReceiver is sent on the Connection.Incoming() channel when there is // an incoming request to open a receiver link. type IncomingReceiver struct { incoming linkSettings } func newIncomingReceiver(sn *session, pLink proton.Link) *IncomingReceiver { return &IncomingReceiver{ incoming: makeIncoming(pLink), linkSettings: makeIncomingLinkSettings(pLink, sn), } } // SetCapacity sets the capacity of the incoming receiver, call before Accept() func (in *IncomingReceiver) SetCapacity(capacity int) { in.capacity = capacity } // SetPrefetch sets the pre-fetch mode of the incoming receiver, call before Accept() func (in *IncomingReceiver) SetPrefetch(prefetch bool) { in.prefetch = prefetch } // Accept accepts an incoming receiver endpoint func (in *IncomingReceiver) Accept() Endpoint { return in.accept(func() Endpoint { return newReceiver(in.linkSettings) }) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/link_test.go0000664000000000000000000000422413257152177024606 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Test that link settings are propagated correctly package electron import ( "net" "qpid.apache.org/amqp" "qpid.apache.org/proton" "testing" "time" ) func TestLinkSettings(t *testing.T) { cConn, sConn := net.Pipe() done := make(chan error) settings := TerminusSettings{Durability: 1, Expiry: 2, Timeout: 42 * time.Second, Dynamic: true} filterMap := map[amqp.Symbol]interface{}{"int": int32(33), "str": "hello"} go func() { // Server close(done) defer sConn.Close() c, err := NewConnection(sConn, Server()) fatalIf(t, err) for in := range c.Incoming() { ep := in.Accept() switch ep := ep.(type) { case Receiver: errorIf(t, checkEqual("one.source", ep.Source())) errorIf(t, checkEqual(TerminusSettings{}, ep.SourceSettings())) errorIf(t, checkEqual("one.target", ep.Target())) errorIf(t, checkEqual(settings, ep.TargetSettings())) case Sender: errorIf(t, checkEqual("two", ep.LinkName())) errorIf(t, checkEqual("two.source", ep.Source())) errorIf(t, checkEqual(TerminusSettings{Durability: proton.Deliveries, Expiry: proton.ExpireNever}, ep.SourceSettings())) errorIf(t, checkEqual(filterMap, ep.Filter())) } } }() // Client c, err := NewConnection(cConn) fatalIf(t, err) c.Sender(Source("one.source"), Target("one.target"), TargetSettings(settings)) c.Receiver(Source("two.source"), DurableSubscription("two"), Filter(filterMap)) c.Close(nil) <-done } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/link.go0000664000000000000000000002447713257152177023563 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "qpid.apache.org/amqp" "qpid.apache.org/proton" "time" ) // Settings associated with a link type LinkSettings interface { // Source address that messages are coming from. Source() string // Target address that messages are going to. Target() string // Name is a unique name for the link among links between the same // containers in the same direction. By default generated automatically. LinkName() string // IsSender is true if this is the sending end of the link. IsSender() bool // IsReceiver is true if this is the receiving end of the link. IsReceiver() bool // SndSettle defines when the sending end of the link settles message delivery. SndSettle() SndSettleMode // RcvSettle defines when the sending end of the link settles message delivery. RcvSettle() RcvSettleMode // Session containing the Link Session() Session // Filter for the link Filter() map[amqp.Symbol]interface{} // Advanced settings for the source SourceSettings() TerminusSettings // Advanced settings for the target TargetSettings() TerminusSettings } // LinkOption can be passed when creating a sender or receiver link to set optional configuration. type LinkOption func(*linkSettings) // Source returns a LinkOption that sets address that messages are coming from. func Source(s string) LinkOption { return func(l *linkSettings) { l.source = s } } // Target returns a LinkOption that sets address that messages are going to. func Target(s string) LinkOption { return func(l *linkSettings) { l.target = s } } // LinkName returns a LinkOption that sets the link name. func LinkName(s string) LinkOption { return func(l *linkSettings) { l.linkName = s } } // SndSettle returns a LinkOption that sets the send settle mode func SndSettle(m SndSettleMode) LinkOption { return func(l *linkSettings) { l.sndSettle = m } } // RcvSettle returns a LinkOption that sets the send settle mode func RcvSettle(m RcvSettleMode) LinkOption { return func(l *linkSettings) { l.rcvSettle = m } } // Capacity returns a LinkOption that sets the link capacity func Capacity(n int) LinkOption { return func(l *linkSettings) { l.capacity = n } } // Prefetch returns a LinkOption that sets a receivers pre-fetch flag. Not relevant for a sender. func Prefetch(p bool) LinkOption { return func(l *linkSettings) { l.prefetch = p } } // DurableSubscription returns a LinkOption that configures a Receiver as a named durable // subscription. The name overrides (and is overridden by) LinkName() so you should normally // only use one of these options. func DurableSubscription(name string) LinkOption { return func(l *linkSettings) { l.linkName = name l.sourceSettings.Durability = proton.Deliveries l.sourceSettings.Expiry = proton.ExpireNever } } // AtMostOnce returns a LinkOption that sets "fire and forget" mode, messages // are sent but no acknowledgment is received, messages can be lost if there is // a network failure. Sets SndSettleMode=SendSettled and RcvSettleMode=RcvFirst func AtMostOnce() LinkOption { return func(l *linkSettings) { SndSettle(SndSettled)(l) RcvSettle(RcvFirst)(l) } } // AtLeastOnce returns a LinkOption that requests acknowledgment for every // message, acknowledgment indicates the message was definitely received. In the // event of a failure, unacknowledged messages can be re-sent but there is a // chance that the message will be received twice in this case. Sets // SndSettleMode=SndUnsettled and RcvSettleMode=RcvFirst func AtLeastOnce() LinkOption { return func(l *linkSettings) { SndSettle(SndUnsettled)(l) RcvSettle(RcvFirst)(l) } } // Filter returns a LinkOption that sets a filter. func Filter(m map[amqp.Symbol]interface{}) LinkOption { return func(l *linkSettings) { l.filter = m } } // SourceSettings returns a LinkOption that sets all the SourceSettings. // Note: it will override the source address set by a Source() option func SourceSettings(ts TerminusSettings) LinkOption { return func(l *linkSettings) { l.sourceSettings = ts } } // TargetSettings returns a LinkOption that sets all the TargetSettings. // Note: it will override the target address set by a Target() option func TargetSettings(ts TerminusSettings) LinkOption { return func(l *linkSettings) { l.targetSettings = ts } } // SndSettleMode defines when the sending end of the link settles message delivery. type SndSettleMode proton.SndSettleMode const ( // Messages are sent unsettled SndUnsettled = SndSettleMode(proton.SndUnsettled) // Messages are sent already settled SndSettled = SndSettleMode(proton.SndSettled) // Sender can send either unsettled or settled messages. SendMixed = SndSettleMode(proton.SndMixed) ) // RcvSettleMode defines when the receiving end of the link settles message delivery. type RcvSettleMode proton.RcvSettleMode const ( // Receiver settles first. RcvFirst = RcvSettleMode(proton.RcvFirst) // Receiver waits for sender to settle before settling. RcvSecond = RcvSettleMode(proton.RcvSecond) ) type linkSettings struct { source string sourceSettings TerminusSettings target string targetSettings TerminusSettings linkName string isSender bool sndSettle SndSettleMode rcvSettle RcvSettleMode capacity int prefetch bool filter map[amqp.Symbol]interface{} session *session pLink proton.Link } // Advanced AMQP settings for the source or target of a link. // Usually these can be set via a more descriptive LinkOption, e.g. DurableSubscription() // and do not need to be set/examined directly. type TerminusSettings struct { Durability proton.Durability Expiry proton.ExpiryPolicy Timeout time.Duration Dynamic bool } func makeTerminusSettings(t proton.Terminus) TerminusSettings { return TerminusSettings{ Durability: t.Durability(), Expiry: t.ExpiryPolicy(), Timeout: t.Timeout(), Dynamic: t.IsDynamic(), } } type link struct { endpoint linkSettings } func (l *linkSettings) Source() string { return l.source } func (l *linkSettings) Target() string { return l.target } func (l *linkSettings) LinkName() string { return l.linkName } func (l *linkSettings) IsSender() bool { return l.isSender } func (l *linkSettings) IsReceiver() bool { return !l.isSender } func (l *linkSettings) SndSettle() SndSettleMode { return l.sndSettle } func (l *linkSettings) RcvSettle() RcvSettleMode { return l.rcvSettle } func (l *linkSettings) Filter() map[amqp.Symbol]interface{} { return l.filter } func (l *linkSettings) SourceSettings() TerminusSettings { return l.sourceSettings } func (l *linkSettings) TargetSettings() TerminusSettings { return l.targetSettings } func (l *link) Session() Session { return l.session } func (l *link) Connection() Connection { return l.session.Connection() } func (l *link) engine() *proton.Engine { return l.session.connection.engine } func (l *link) handler() *handler { return l.session.connection.handler } // Open a link and return the linkSettings. func makeLocalLink(sn *session, isSender bool, setting ...LinkOption) (linkSettings, error) { l := linkSettings{ isSender: isSender, capacity: 1, prefetch: false, session: sn, } for _, set := range setting { set(&l) } if l.linkName == "" { l.linkName = l.session.connection.container.nextLinkName() } if l.IsSender() { l.pLink = l.session.pSession.Sender(l.linkName) } else { l.pLink = l.session.pSession.Receiver(l.linkName) } if l.pLink.IsNil() { return l, fmt.Errorf("cannot create link %s", l.pLink) } l.pLink.Source().SetAddress(l.source) if len(l.filter) > 0 { if err := l.pLink.Source().Filter().Marshal(l.filter); err != nil { panic(err) // Shouldn't happen } } l.pLink.Source().SetDurability(l.sourceSettings.Durability) l.pLink.Source().SetExpiryPolicy(l.sourceSettings.Expiry) l.pLink.Source().SetTimeout(l.sourceSettings.Timeout) l.pLink.Source().SetDynamic(l.sourceSettings.Dynamic) l.pLink.Target().SetAddress(l.target) l.pLink.Target().SetDurability(l.targetSettings.Durability) l.pLink.Target().SetExpiryPolicy(l.targetSettings.Expiry) l.pLink.Target().SetTimeout(l.targetSettings.Timeout) l.pLink.Target().SetDynamic(l.targetSettings.Dynamic) l.pLink.SetSndSettleMode(proton.SndSettleMode(l.sndSettle)) l.pLink.SetRcvSettleMode(proton.RcvSettleMode(l.rcvSettle)) l.pLink.Open() return l, nil } func makeIncomingLinkSettings(pLink proton.Link, sn *session) linkSettings { l := linkSettings{ isSender: pLink.IsSender(), source: pLink.RemoteSource().Address(), sourceSettings: makeTerminusSettings(pLink.RemoteSource()), target: pLink.RemoteTarget().Address(), targetSettings: makeTerminusSettings(pLink.RemoteTarget()), linkName: pLink.Name(), sndSettle: SndSettleMode(pLink.RemoteSndSettleMode()), rcvSettle: RcvSettleMode(pLink.RemoteRcvSettleMode()), capacity: 1, prefetch: false, pLink: pLink, session: sn, } filter := l.pLink.RemoteSource().Filter() if !filter.Empty() { filter.Unmarshal(&l.filter) // TODO aconway 2017-06-08: ignoring errors } return l } // Not part of Link interface but use by Sender and Receiver. func (l *link) Credit() (credit int, err error) { err = l.engine().InjectWait(func() error { if l.Error() != nil { return l.Error() } credit = l.pLink.Credit() return nil }) return } // Not part of Link interface but use by Sender and Receiver. func (l *link) Capacity() int { return l.capacity } func (l *link) Close(err error) { _ = l.engine().Inject(func() { if l.Error() == nil { localClose(l.pLink, err) } }) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/handler.go0000664000000000000000000001232013257152177024223 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "qpid.apache.org/amqp" "qpid.apache.org/proton" ) // NOTE: methods in this file are called only in the proton goroutine unless otherwise indicated. type handler struct { delegator *proton.MessagingAdapter connection *connection links map[proton.Link]Endpoint sentMessages map[proton.Delivery]sentMessage sessions map[proton.Session]*session } func newHandler(c *connection) *handler { h := &handler{ connection: c, links: make(map[proton.Link]Endpoint), sentMessages: make(map[proton.Delivery]sentMessage), sessions: make(map[proton.Session]*session), } h.delegator = proton.NewMessagingAdapter(h) // Disable auto features of MessagingAdapter, we do these ourselves. h.delegator.Prefetch = 0 h.delegator.AutoAccept = false h.delegator.AutoSettle = false h.delegator.AutoOpen = false return h } func (h *handler) linkError(l proton.Link, msg string) { proton.CloseError(l, amqp.Errorf(amqp.InternalError, "%s for %s %s", msg, l.Type(), l)) } func (h *handler) HandleMessagingEvent(t proton.MessagingEvent, e proton.Event) { switch t { case proton.MMessage: if r, ok := h.links[e.Link()].(*receiver); ok { r.message(e.Delivery()) } else { h.linkError(e.Link(), "no receiver") } case proton.MSettled: if sm, ok := h.sentMessages[e.Delivery()]; ok { d := e.Delivery().Remote() sm.ack <- Outcome{sentStatus(d.Type()), d.Condition().Error(), sm.value} delete(h.sentMessages, e.Delivery()) } case proton.MSendable: if s, ok := h.links[e.Link()].(*sender); ok { s.sendable() } else { h.linkError(e.Link(), "no sender") } case proton.MConnectionOpening: h.connection.heartbeat = e.Transport().RemoteIdleTimeout() if e.Connection().State().LocalUninit() { // Remotely opened h.incoming(newIncomingConnection(h.connection)) } h.connection.wakeSync() case proton.MSessionOpening: if e.Session().State().LocalUninit() { // Remotely opened h.incoming(newIncomingSession(h, e.Session())) } h.sessions[e.Session()].wakeSync() case proton.MSessionClosed: h.sessionClosed(e.Session(), proton.EndpointError(e.Session())) case proton.MLinkOpening: l := e.Link() if ss := h.sessions[l.Session()]; ss != nil { if l.State().LocalUninit() { // Remotely opened. if l.IsReceiver() { h.incoming(newIncomingReceiver(ss, l)) } else { h.incoming(newIncomingSender(ss, l)) } } if ep, ok := h.links[l]; ok { ep.wakeSync() } else { h.linkError(l, "no link") } } else { h.linkError(l, "no session") } case proton.MLinkClosing: e.Link().Close() case proton.MLinkClosed: h.linkClosed(e.Link(), proton.EndpointError(e.Link())) case proton.MConnectionClosing: h.connection.err.Set(e.Connection().RemoteCondition().Error()) case proton.MConnectionClosed: h.shutdown(proton.EndpointError(e.Connection())) case proton.MDisconnected: err := e.Transport().Condition().Error() if err == nil { err = amqp.Errorf(amqp.IllegalState, "unexpected disconnect on %s", h.connection) } h.shutdown(err) } } func (h *handler) incoming(in Incoming) { var err error if h.connection.incoming != nil { h.connection.incoming <- in // Must block until accept/reject, subsequent events may use the incoming endpoint. err = in.wait() } else { err = amqp.Errorf(amqp.NotAllowed, "rejected incoming %s %s", in.pEndpoint().Type(), in.pEndpoint().String()) } if err == nil { in.pEndpoint().Open() } else { proton.CloseError(in.pEndpoint(), err) } } func (h *handler) addLink(pl proton.Link, el Endpoint) { h.links[pl] = el } func (h *handler) linkClosed(l proton.Link, err error) { if link, ok := h.links[l]; ok { _ = link.closed(err) delete(h.links, l) l.Free() } } func (h *handler) sessionClosed(ps proton.Session, err error) { if s, ok := h.sessions[ps]; ok { delete(h.sessions, ps) err = s.closed(err) for l, _ := range h.links { if l.Session() == ps { h.linkClosed(l, err) } } ps.Free() } } func (h *handler) shutdown(err error) { err = h.connection.closed(err) for _, sm := range h.sentMessages { // Don't block but ensure outcome is sent eventually. if sm.ack != nil { o := Outcome{Unacknowledged, err, sm.value} select { case sm.ack <- o: default: go func(ack chan<- Outcome) { ack <- o }(sm.ack) // Deliver it eventually } } } h.sentMessages = nil for _, l := range h.links { _ = l.closed(err) } h.links = nil for _, s := range h.sessions { _ = s.closed(err) } h.sessions = nil } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/example_client_server_test.go0000664000000000000000000000561313257152177030233 0ustar package electron_test import ( "fmt" "log" "net" "qpid.apache.org/amqp" "qpid.apache.org/electron" "sync" ) // Example Server that accepts a single Connection, Session and Receiver link // and prints messages received until the link closes. func Server(l net.Listener) { cont := electron.NewContainer("server") c, err := cont.Accept(l) if err != nil { log.Fatal(err) } l.Close() // This server only accepts one connection // Process incoming endpoints till we get a Receiver link var r electron.Receiver for r == nil { in := <-c.Incoming() switch in := in.(type) { case *electron.IncomingSession, *electron.IncomingConnection: in.Accept() // Accept the incoming connection and session for the receiver case *electron.IncomingReceiver: in.SetCapacity(10) in.SetPrefetch(true) // Automatic flow control for a buffer of 10 messages. r = in.Accept().(electron.Receiver) case nil: return // Connection is closed default: in.Reject(amqp.Errorf("example-server", "unexpected endpoint %v", in)) } } go func() { // Reject any further incoming endpoints for in := range c.Incoming() { in.Reject(amqp.Errorf("example-server", "unexpected endpoint %v", in)) } }() // Receive messages till the Receiver closes rm, err := r.Receive() for ; err == nil; rm, err = r.Receive() { fmt.Printf("server received: %q\n", rm.Message.Body()) rm.Accept() // Signal to the client that the message was accepted } fmt.Printf("server receiver closed: %v\n", err) } // Example client sending messages to a server running in a goroutine. // // Normally client and server would be separate processes. For more realistic and detailed examples: // https://github.com/apache/qpid-proton/blob/master/examples/go/README.md // func Example_clientServer() { l, err := net.Listen("tcp", "127.0.0.1:0") // tcp4 so example will work on ipv6-disabled platforms if err != nil { log.Fatal(err) } // SERVER: start the server running in a separate goroutine var waitServer sync.WaitGroup // We will wait for the server goroutine to finish before exiting waitServer.Add(1) go func() { // Run the server in the background defer waitServer.Done() Server(l) }() // CLIENT: Send messages to the server addr := l.Addr() c, err := electron.Dial(addr.Network(), addr.String()) if err != nil { log.Fatal(err) } s, err := c.Sender() if err != nil { log.Fatal(err) } for i := 0; i < 3; i++ { msg := fmt.Sprintf("hello %v", i) // Send and wait for the Outcome from the server. // Note: For higher throughput, use SendAsync() to send a stream of messages // and process the returning stream of Outcomes concurrently. s.SendSync(amqp.NewMessageWith(msg)) } c.Close(nil) // Closing the connection will stop the server waitServer.Wait() // Let the server finish // Output: // server received: "hello 0" // server received: "hello 1" // server received: "hello 2" // server receiver closed: EOF } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/error.go0000664000000000000000000000207013257152177023740 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" ) // assert panics if condition is false with optional formatted message func assert(condition bool, format ...interface{}) { if !condition { if len(format) > 0 { panic(fmt.Errorf(format[0].(string), format[1:]...)) } else { panic(fmt.Errorf("assertion failed")) } } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/endpoint.go0000664000000000000000000001312313257152177024430 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "io" "qpid.apache.org/proton" ) // Closed is an alias for io.EOF. It is returned as an error when an endpoint // was closed cleanly. var Closed = io.EOF // EOF is an alias for io.EOF. It is returned as an error when an endpoint // was closed cleanly. var EOF = io.EOF // Endpoint is the local end of a communications channel to the remote peer // process. The following interface implement Endpoint: Connection, Session, // Sender and Receiver. // // You can create an endpoint with functions on Container, Connection and // Session. You can accept incoming endpoints from the remote peer using // Connection.Incoming() // type Endpoint interface { // Close an endpoint and signal an error to the remote end if error != nil. Close(error) // String is a human readable identifier, useful for debugging and logging. String() string // Error returns nil if the endpoint is open, otherwise returns an error. // Error() == Closed means the endpoint was closed without error. Error() error // Connection is the connection associated with this endpoint. Connection() Connection // Done returns a channel that will close when the endpoint closes. // After Done() has closed, Error() will return the reason for closing. Done() <-chan struct{} // Sync() waits for the remote peer to confirm the endpoint is active or // reject it with an error. You can call it immediately on new endpoints // for more predictable error handling. // // AMQP is an asynchronous protocol. It is legal to create an endpoint and // start using it without waiting for confirmation. This avoids a needless // delay in the non-error case and throughput by "assuming the best". // // However if there *is* an error, these "optimistic" actions will fail. The // endpoint and its children will be closed with an error. The error will only // be detected when you try to use one of these endpoints or call Sync() Sync() error // Called in handler goroutine when endpoint is remotely closed. closed(err error) error wakeSync() } // Base implementation for Endpoint type endpoint struct { err proton.ErrorHolder str string // String() return value. done chan struct{} active chan struct{} } func (e *endpoint) init(s string) { e.str = s e.done = make(chan struct{}) e.active = make(chan struct{}) } // Called in proton goroutine on remote open. func (e *endpoint) wakeSync() { select { // Close active channel if not already closed. case <-e.active: default: close(e.active) } } // Called in proton goroutine (from handler) on a Closed or Disconnected event. // // Set err if there is not already an error on the endpoint. // Return Error() func (e *endpoint) closed(err error) error { select { case <-e.done: // Already closed default: e.err.Set(err) e.err.Set(Closed) e.wakeSync() // Make sure we wake up Sync() close(e.done) } return e.Error() } func (e *endpoint) String() string { return e.str } func (e *endpoint) Error() error { return e.err.Get() } func (e *endpoint) Done() <-chan struct{} { return e.done } func (e *endpoint) Sync() error { <-e.active return e.Error() } // Call in proton goroutine to initiate closing an endpoint locally // handler will complete the close when remote end closes. func localClose(ep proton.Endpoint, err error) { if ep.State().LocalActive() { proton.CloseError(ep, err) } } // Incoming is the interface for incoming endpoints, see Connection.Incoming() // // Call Incoming.Accept() to open the endpoint or Incoming.Reject() to close it // with optional error // // Implementing types are *IncomingConnection, *IncomingSession, *IncomingSender // and *IncomingReceiver. Each type provides methods to examine the incoming // endpoint request and set configuration options for the local endpoint // before calling Accept() or Reject() type Incoming interface { // Accept and open the endpoint. Accept() Endpoint // Reject the endpoint with an error Reject(error) // wait for and call the accept function, call in proton goroutine. wait() error pEndpoint() proton.Endpoint } type incoming struct { pep proton.Endpoint acceptCh chan func() error } func makeIncoming(e proton.Endpoint) incoming { return incoming{pep: e, acceptCh: make(chan func() error)} } func (in *incoming) String() string { return fmt.Sprintf("%s: %s", in.pep.Type(), in.pep) } func (in *incoming) Reject(err error) { in.acceptCh <- func() error { return err } } // Call in proton goroutine, wait for and call the accept function. func (in *incoming) wait() error { return (<-in.acceptCh)() } func (in *incoming) pEndpoint() proton.Endpoint { return in.pep } // Called in app goroutine to send an accept function to proton and return the resulting endpoint. func (in *incoming) accept(f func() Endpoint) Endpoint { done := make(chan Endpoint) in.acceptCh <- func() error { ep := f() done <- ep return nil } return <-done } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/electron_test.go0000664000000000000000000003376213257152177025475 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "net" "path" "qpid.apache.org/amqp" "reflect" "runtime" "testing" "time" ) func fatalIf(t *testing.T, err error) { if err != nil { _, file, line, ok := runtime.Caller(1) // annotate with location of caller. if ok { _, file = path.Split(file) } t.Fatalf("(from %s:%d) %v", file, line, err) } } func errorIf(t *testing.T, err error) { if err != nil { _, file, line, ok := runtime.Caller(1) // annotate with location of caller. if ok { _, file = path.Split(file) } t.Errorf("(from %s:%d) %v", file, line, err) } } func checkEqual(want interface{}, got interface{}) error { if !reflect.DeepEqual(want, got) { return fmt.Errorf("%#v != %#v", want, got) } return nil } // Start a server, return listening addr and channel for incoming Connections. func newServer(t *testing.T, cont Container, opts ...ConnectionOption) (net.Addr, <-chan Connection) { listener, err := net.Listen("tcp4", "") // For systems with ipv6 disabled fatalIf(t, err) addr := listener.Addr() ch := make(chan Connection) go func() { conn, err := listener.Accept() c, err := cont.Connection(conn, append([]ConnectionOption{Server()}, opts...)...) fatalIf(t, err) ch <- c }() return addr, ch } // Open a client connection and session, return the session. func newClient(t *testing.T, cont Container, addr net.Addr, opts ...ConnectionOption) Session { conn, err := net.Dial(addr.Network(), addr.String()) fatalIf(t, err) // Don't bother checking error here, it's an async error so it's racy to do so anyway. // Let caller use Sync() or catch it on first use. c, _ := cont.Connection(conn, opts...) sn, _ := c.Session() return sn } // Return client and server ends of the same connection. func newClientServerOpts(t *testing.T, copts []ConnectionOption, sopts []ConnectionOption) (client Session, server Connection) { addr, ch := newServer(t, NewContainer("test-server"), sopts...) client = newClient(t, NewContainer("test-client"), addr, copts...) return client, <-ch } // Return client and server ends of the same connection. func newClientServer(t *testing.T) (client Session, server Connection) { return newClientServerOpts(t, nil, nil) } // Close client and server func closeClientServer(client Session, server Connection) { client.Connection().Close(nil) server.Close(nil) } // Send a message one way with a client sender and server receiver, verify ack. func TestClientSendServerReceive(t *testing.T) { nLinks := 3 nMessages := 3 rchan := make(chan Receiver, nLinks) client, server := newClientServer(t) go func() { for in := range server.Incoming() { switch in := in.(type) { case *IncomingReceiver: in.SetCapacity(1) in.SetPrefetch(false) rchan <- in.Accept().(Receiver) default: in.Accept() } } }() defer func() { closeClientServer(client, server) }() s := make([]Sender, nLinks) for i := 0; i < nLinks; i++ { var err error s[i], err = client.Sender(Target(fmt.Sprintf("foo%d", i))) if err != nil { t.Fatal(err) } } r := make([]Receiver, nLinks) for i := 0; i < nLinks; i++ { r[i] = <-rchan } for i := 0; i < nLinks; i++ { for j := 0; j < nMessages; j++ { // Client send ack := make(chan Outcome, 1) sendDone := make(chan struct{}) go func() { defer close(sendDone) m := amqp.NewMessageWith(fmt.Sprintf("foobar%v-%v", i, j)) var err error s[i].SendAsync(m, ack, "testing") if err != nil { t.Fatal(err) } }() // Server receive rm, err := r[i].Receive() if err != nil { t.Fatal(err) } if want, got := interface{}(fmt.Sprintf("foobar%v-%v", i, j)), rm.Message.Body(); want != got { t.Errorf("%#v != %#v", want, got) } // Should not be acknowledged on client yet <-sendDone select { case <-ack: t.Errorf("unexpected ack") default: } // Server send ack if err := rm.Reject(); err != nil { t.Error(err) } // Client get ack. if a := <-ack; a.Value != "testing" || a.Error != nil || a.Status != Rejected { t.Error("unexpected ack: ", a.Status, a.Error, a.Value) } } } } func TestClientReceiver(t *testing.T) { nMessages := 3 client, server := newClientServer(t) go func() { for in := range server.Incoming() { switch in := in.(type) { case *IncomingSender: s := in.Accept().(Sender) go func() { for i := int32(0); i < int32(nMessages); i++ { out := s.SendSync(amqp.NewMessageWith(i)) if out.Error != nil { t.Error(out.Error) return } } s.Close(nil) }() default: in.Accept() } } }() r, err := client.Receiver(Source("foo")) if err != nil { t.Fatal(err) } for i := int32(0); i < int32(nMessages); i++ { rm, err := r.Receive() if err != nil { if err != Closed { t.Error(err) } break } if err := rm.Accept(); err != nil { t.Error(err) } if b, ok := rm.Message.Body().(int32); !ok || b != i { t.Errorf("want %v, true got %v, %v", i, b, ok) } } server.Close(nil) client.Connection().Close(nil) } // Test timeout versions of waiting functions. func TestTimeouts(t *testing.T) { var err error rchan := make(chan Receiver, 1) client, server := newClientServer(t) go func() { for i := range server.Incoming() { switch i := i.(type) { case *IncomingReceiver: i.SetCapacity(1) i.SetPrefetch(false) rchan <- i.Accept().(Receiver) // Issue credit only on receive default: i.Accept() } } }() defer func() { closeClientServer(client, server) }() // Open client sender snd, err := client.Sender(Target("test")) if err != nil { t.Fatal(err) } rcv := <-rchan // Test send with timeout short := time.Millisecond long := time.Second m := amqp.NewMessage() if err := snd.SendSyncTimeout(m, 0).Error; err != Timeout { // No credit, expect timeout. t.Error("want Timeout got", err) } if err := snd.SendSyncTimeout(m, short).Error; err != Timeout { // No credit, expect timeout. t.Error("want Timeout got", err) } // Test receive with timeout if _, err = rcv.ReceiveTimeout(0); err != Timeout { // No credit, expect timeout. t.Error("want Timeout got", err) } // Test receive with timeout if _, err = rcv.ReceiveTimeout(short); err != Timeout { // No credit, expect timeout. t.Error("want Timeout got", err) } // There is now a credit on the link due to receive ack := make(chan Outcome) snd.SendAsyncTimeout(m, ack, nil, short) // Disposition should timeout select { case <-ack: t.Errorf("want Timeout got %#v", ack) case <-time.After(short): } // Receive and accept rm, err := rcv.ReceiveTimeout(long) if err != nil { t.Fatal(err) } if err := rm.Accept(); err != nil { t.Fatal(err) } // Sender get ack if a := <-ack; a.Status != Accepted || a.Error != nil { t.Errorf("want (accepted, nil) got %#v", a) } } // A server that returns the opposite end of each client link via channels. type pairs struct { t *testing.T client Session server Connection rchan chan Receiver schan chan Sender capacity int prefetch bool } func newPairs(t *testing.T, capacity int, prefetch bool) *pairs { p := &pairs{t: t, rchan: make(chan Receiver, 1), schan: make(chan Sender, 1)} p.client, p.server = newClientServer(t) go func() { for i := range p.server.Incoming() { switch i := i.(type) { case *IncomingReceiver: i.SetCapacity(capacity) i.SetPrefetch(prefetch) p.rchan <- i.Accept().(Receiver) case *IncomingSender: p.schan <- i.Accept().(Sender) default: i.Accept() } } }() return p } func (p *pairs) close() { closeClientServer(p.client, p.server) } // Return a client sender and server receiver func (p *pairs) senderReceiver() (Sender, Receiver) { snd, err := p.client.Sender() fatalIf(p.t, err) rcv := <-p.rchan return snd, rcv } // Return a client receiver and server sender func (p *pairs) receiverSender() (Receiver, Sender) { rcv, err := p.client.Receiver() fatalIf(p.t, err) snd := <-p.schan return rcv, snd } type result struct { label string err error value interface{} } func (r result) String() string { return fmt.Sprintf("%v(%v)", r.err, r.label) } func doSend(snd Sender, results chan result) { err := snd.SendSync(amqp.NewMessage()).Error results <- result{"send", err, nil} } func doReceive(rcv Receiver, results chan result) { msg, err := rcv.Receive() results <- result{"receive", err, msg} } func doDisposition(ack <-chan Outcome, results chan result) { results <- result{"disposition", (<-ack).Error, nil} } // Senders get credit immediately if receivers have prefetch set func TestSendReceivePrefetch(t *testing.T) { pairs := newPairs(t, 1, true) s, r := pairs.senderReceiver() s.SendAsyncTimeout(amqp.NewMessage(), nil, nil, time.Second) // Should not block for credit. if _, err := r.Receive(); err != nil { t.Error(err) } } // Senders do not get credit till Receive() if receivers don't have prefetch func TestSendReceiveNoPrefetch(t *testing.T) { pairs := newPairs(t, 1, false) s, r := pairs.senderReceiver() done := make(chan struct{}, 1) go func() { s.SendAsyncTimeout(amqp.NewMessage(), nil, nil, time.Second) // Should block for credit. close(done) }() select { case <-done: t.Errorf("send should be blocked on credit") default: if _, err := r.Receive(); err != nil { t.Error(err) } else { <-done } // Should be unblocked now } } // Test that closing Links interrupts blocked link functions. func TestLinkCloseInterrupt(t *testing.T) { want := amqp.Error{Name: "x", Description: "all bad"} pairs := newPairs(t, 1, false) results := make(chan result) // Collect expected errors // Note closing the link does not interrupt Send() calls, the AMQP spec says // that deliveries can be settled after the link is closed. // Receiver.Close() interrupts Receive() snd, rcv := pairs.senderReceiver() go doReceive(rcv, results) rcv.Close(want) if r := <-results; want != r.err { t.Errorf("want %#v got %#v", want, r) } // Remote Sender.Close() interrupts Receive() snd, rcv = pairs.senderReceiver() go doReceive(rcv, results) snd.Close(want) if r := <-results; want != r.err { t.Errorf("want %#v got %#v", want, r) } } // Test closing the server end of a connection. func TestConnectionCloseInterrupt1(t *testing.T) { want := amqp.Error{Name: "x", Description: "bad"} pairs := newPairs(t, 1, true) results := make(chan result) // Collect expected errors // Connection.Close() interrupts Send, Receive, Disposition. snd, rcv := pairs.senderReceiver() go doSend(snd, results) if _, err := rcv.Receive(); err != nil { t.Error("receive", err) } rcv, snd = pairs.receiverSender() go doReceive(rcv, results) snd, rcv = pairs.senderReceiver() ack := snd.SendWaitable(amqp.NewMessage()) if _, err := rcv.Receive(); err != nil { t.Error("receive", err) } go doDisposition(ack, results) pairs.server.Close(want) for i := 0; i < 3; i++ { if r := <-results; want != r.err { t.Errorf("want %v got %v", want, r) } } } // Test closing the client end of the connection. func TestConnectionCloseInterrupt2(t *testing.T) { want := amqp.Error{Name: "x", Description: "bad"} pairs := newPairs(t, 1, true) results := make(chan result) // Collect expected errors // Connection.Close() interrupts Send, Receive, Disposition. snd, rcv := pairs.senderReceiver() go doSend(snd, results) if _, err := rcv.Receive(); err != nil { t.Error("receive", err) } rcv, snd = pairs.receiverSender() go doReceive(rcv, results) snd, rcv = pairs.senderReceiver() ack := snd.SendWaitable(amqp.NewMessage()) go doDisposition(ack, results) pairs.client.Connection().Close(want) for i := 0; i < 3; i++ { if r := <-results; want != r.err { t.Errorf("want %v got %v", want, r.err) } } } func heartbeat(c Connection) time.Duration { return c.(*connection).engine.Transport().RemoteIdleTimeout() } func TestHeartbeat(t *testing.T) { client, server := newClientServerOpts(t, []ConnectionOption{Heartbeat(102 * time.Millisecond)}, nil) defer closeClientServer(client, server) var serverHeartbeat time.Duration go func() { for in := range server.Incoming() { switch in := in.(type) { case *IncomingConnection: serverHeartbeat = in.Heartbeat() in.AcceptConnection(Heartbeat(101 * time.Millisecond)) default: in.Accept() } } }() // Freeze the server to stop it sending heartbeats. unfreeze := make(chan bool) defer close(unfreeze) freeze := func() error { return server.(*connection).engine.Inject(func() { <-unfreeze }) } fatalIf(t, client.Sync()) errorIf(t, checkEqual(101*time.Millisecond, heartbeat(client.Connection()))) errorIf(t, checkEqual(102*time.Millisecond, serverHeartbeat)) errorIf(t, client.Connection().Error()) // Freeze the server for less than a heartbeat fatalIf(t, freeze()) time.Sleep(50 * time.Millisecond) unfreeze <- true // Make sure server is still responding. s, err := client.Sender() errorIf(t, err) errorIf(t, s.Sync()) // Freeze the server till the client times out the connection fatalIf(t, freeze()) select { case <-client.Done(): if amqp.ResourceLimitExceeded != client.Error().(amqp.Error).Name { t.Error("bad timeout error:", client.Error()) } case <-time.After(400 * time.Millisecond): t.Error("connection failed to time out") } unfreeze <- true // Unfreeze the server <-server.Done() if amqp.ResourceLimitExceeded != server.Error().(amqp.Error).Name { t.Error("bad timeout error:", server.Error()) } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/doc.go0000664000000000000000000000626113257152177023362 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package electron lets you write concurrent AMQP 1.0 messaging clients and servers. This package requires the [proton-C library](http://qpid.apache.org/proton) to be installed. Start by creating a Container with NewContainer. An AMQP Container represents a single AMQP "application" and can contain client and server connections. You can enable AMQP over any connection that implements the standard net.Conn interface. Typically you can connect with net.Dial() or listen for server connections with net.Listen. Enable AMQP by passing the net.Conn to Container.Connection(). AMQP allows bi-direction peer-to-peer message exchange as well as client-to-broker. Messages are sent over "links". Each link is one-way and has a Sender and Receiver end. Connection.Sender() and Connection.Receiver() open links to Send() and Receive() messages. Connection.Incoming() lets you accept incoming links opened by the remote peer. You can open and accept multiple links in both directions on a single Connection. Some of the documentation examples show client and server side by side in a single program, in separate goroutines. This is only for example purposes, real AMQP applications would run in separate processes on the network. More realistic examples: https://github.com/apache/qpid-proton/blob/master/examples/go/README.md Some of the documentation examples show client and server side by side in a single program, in separate goroutines. This is only for example purposes, real AMQP applications would run in separate processes on the network. More realistic examples: https://github.com/apache/qpid-proton/blob/master/examples/go/README.md */ package electron //#cgo LDFLAGS: -lqpid-proton-core import "C" // Just for package comment /* DEVELOPER NOTES There is a single proton.Engine per connection, each driving it's own event-loop goroutine, and each with a 'handler'. Most state for a connection is maintained on the handler, and only accessed in the event-loop goroutine, so no locks are required there. The handler sets up channels as needed to get or send data from user goroutines using electron types like Sender or Receiver. Engine.Inject injects actions into the event loop from user goroutines. It is important to check at the start of an injected function that required objects are still valid, for example a link may be remotely closed between the time a Sender function calls Inject and the time the injected function is execute by the handler goroutine. */ qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/container.go0000664000000000000000000000625013257152177024575 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "net" "qpid.apache.org/proton" "strconv" "sync/atomic" ) // Container is an AMQP container, it represents a single AMQP "application" // which can have multiple client or server connections. // // Each Container in a distributed AMQP application must have a unique // container-id which is applied to its connections. // // Create with NewContainer() // type Container interface { // Id is a unique identifier for the container in your distributed application. Id() string // Connection creates a connection associated with this container. Connection(conn net.Conn, opts ...ConnectionOption) (Connection, error) // Dial is shorthand for // conn, err := net.Dial(); c, err := Connection(conn, opts...) // See net.Dial() for the meaning of the network, address arguments. Dial(network string, address string, opts ...ConnectionOption) (Connection, error) // Accept is shorthand for: // conn, err := l.Accept(); c, err := Connection(conn, append(opts, Server()...) Accept(l net.Listener, opts ...ConnectionOption) (Connection, error) // String returns Id() String() string } type container struct { id string tagCounter uint64 } func (cont *container) nextTag() string { return strconv.FormatUint(atomic.AddUint64(&cont.tagCounter, 1), 32) } // NewContainer creates a new container. The id must be unique in your // distributed application, all connections created by the container // will have this container-id. // // If id == "" a random UUID will be generated for the id. func NewContainer(id string) Container { if id == "" { id = proton.UUID4().String() } cont := &container{id: id} return cont } func (cont *container) Id() string { return cont.id } func (cont *container) String() string { return cont.Id() } func (cont *container) nextLinkName() string { return cont.id + "@" + cont.nextTag() } func (cont *container) Connection(conn net.Conn, opts ...ConnectionOption) (Connection, error) { return NewConnection(conn, append(opts, Parent(cont))...) } func (cont *container) Dial(network, address string, opts ...ConnectionOption) (c Connection, err error) { conn, err := net.Dial(network, address) if err == nil { c, err = cont.Connection(conn, opts...) } return } func (cont *container) Accept(l net.Listener, opts ...ConnectionOption) (c Connection, err error) { conn, err := l.Accept() if err == nil { c, err = cont.Connection(conn, append(opts, Server())...) } return } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go0000664000000000000000000003320013257152177024745 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron // #include import "C" import ( "net" "qpid.apache.org/proton" "sync" "time" ) // Settings associated with a Connection. type ConnectionSettings interface { // Authenticated user name associated with the connection. User() string // The AMQP virtual host name for the connection. // // Optional, useful when the server has multiple names and provides different // service based on the name the client uses to connect. // // By default it is set to the DNS host name that the client uses to connect, // but it can be set to something different at the client side with the // VirtualHost() option. // // Returns error if the connection fails to authenticate. VirtualHost() string // Heartbeat is the maximum delay between sending frames that the remote peer // has requested of us. If the interval expires an empty "heartbeat" frame // will be sent automatically to keep the connection open. Heartbeat() time.Duration } // Connection is an AMQP connection, created by a Container. type Connection interface { Endpoint ConnectionSettings // Sender opens a new sender on the DefaultSession. Sender(...LinkOption) (Sender, error) // Receiver opens a new Receiver on the DefaultSession(). Receiver(...LinkOption) (Receiver, error) // DefaultSession() returns a default session for the connection. It is opened // on the first call to DefaultSession and returned on subsequent calls. DefaultSession() (Session, error) // Session opens a new session. Session(...SessionOption) (Session, error) // Container for the connection. Container() Container // Disconnect the connection abruptly with an error. Disconnect(error) // Wait waits for the connection to be disconnected. Wait() error // WaitTimeout is like Wait but returns Timeout if the timeout expires. WaitTimeout(time.Duration) error // Incoming returns a channel for incoming endpoints opened by the remote peer. // See the Incoming interface for more detail. // // Note: this channel will first return an *IncomingConnection for the // connection itself which allows you to look at security information and // decide whether to Accept() or Reject() the connection. Then it will return // *IncomingSession, *IncomingSender and *IncomingReceiver as they are opened // by the remote end. // // Note 2: you must receiving from Incoming() and call Accept/Reject to avoid // blocking electron event loop. Normally you would run a loop in a goroutine // to handle incoming types that interest and Accept() those that don't. Incoming() <-chan Incoming } type connectionSettings struct { user, virtualHost string heartbeat time.Duration } func (c connectionSettings) User() string { return c.user } func (c connectionSettings) VirtualHost() string { return c.virtualHost } func (c connectionSettings) Heartbeat() time.Duration { return c.heartbeat } // ConnectionOption can be passed when creating a connection to configure various options type ConnectionOption func(*connection) // User returns a ConnectionOption sets the user name for a connection func User(user string) ConnectionOption { return func(c *connection) { c.user = user c.pConnection.SetUser(user) } } // VirtualHost returns a ConnectionOption to set the AMQP virtual host for the connection. // Only applies to outbound client connection. func VirtualHost(virtualHost string) ConnectionOption { return func(c *connection) { c.virtualHost = virtualHost c.pConnection.SetHostname(virtualHost) } } // Password returns a ConnectionOption to set the password used to establish a // connection. Only applies to outbound client connection. // // The connection will erase its copy of the password from memory as soon as it // has been used to authenticate. If you are concerned about passwords staying in // memory you should never store them as strings, and should overwrite your // copy as soon as you are done with it. // func Password(password []byte) ConnectionOption { return func(c *connection) { c.pConnection.SetPassword(password) } } // Server returns a ConnectionOption to put the connection in server mode for incoming connections. // // A server connection will do protocol negotiation to accept a incoming AMQP // connection. Normally you would call this for a connection created by // net.Listener.Accept() // func Server() ConnectionOption { return func(c *connection) { c.engine.Server(); c.server = true; AllowIncoming()(c) } } // AllowIncoming returns a ConnectionOption to enable incoming endpoints, see // Connection.Incoming() This is automatically set for Server() connections. func AllowIncoming() ConnectionOption { return func(c *connection) { c.incoming = make(chan Incoming) } } // Parent returns a ConnectionOption that associates the Connection with it's Container // If not set a connection will create its own default container. func Parent(cont Container) ConnectionOption { return func(c *connection) { c.container = cont.(*container) } } type connection struct { endpoint connectionSettings defaultSessionOnce, closeOnce sync.Once container *container conn net.Conn server bool incoming chan Incoming handler *handler engine *proton.Engine pConnection proton.Connection defaultSession Session } // NewConnection creates a connection with the given options. func NewConnection(conn net.Conn, opts ...ConnectionOption) (*connection, error) { c := &connection{ conn: conn, } c.handler = newHandler(c) var err error c.engine, err = proton.NewEngine(c.conn, c.handler.delegator) if err != nil { return nil, err } c.pConnection = c.engine.Connection() for _, set := range opts { set(c) } if c.container == nil { c.container = NewContainer("").(*container) } c.pConnection.SetContainer(c.container.Id()) saslConfig.setup(c.engine) c.endpoint.init(c.engine.String()) go c.run() return c, nil } func (c *connection) run() { if !c.server { c.pConnection.Open() } _ = c.engine.Run() if c.incoming != nil { close(c.incoming) } _ = c.closed(Closed) } func (c *connection) Close(err error) { c.err.Set(err) c.engine.Close(err) } func (c *connection) Disconnect(err error) { c.err.Set(err) c.engine.Disconnect(err) } func (c *connection) Session(opts ...SessionOption) (Session, error) { var s Session err := c.engine.InjectWait(func() error { if c.Error() != nil { return c.Error() } pSession, err := c.engine.Connection().Session() if err == nil { pSession.Open() if err == nil { s = newSession(c, pSession, opts...) } } return err }) return s, err } func (c *connection) Container() Container { return c.container } func (c *connection) DefaultSession() (s Session, err error) { c.defaultSessionOnce.Do(func() { c.defaultSession, err = c.Session() }) if err == nil { err = c.Error() } return c.defaultSession, err } func (c *connection) Sender(opts ...LinkOption) (Sender, error) { if s, err := c.DefaultSession(); err == nil { return s.Sender(opts...) } else { return nil, err } } func (c *connection) Receiver(opts ...LinkOption) (Receiver, error) { if s, err := c.DefaultSession(); err == nil { return s.Receiver(opts...) } else { return nil, err } } func (c *connection) Connection() Connection { return c } func (c *connection) Wait() error { return c.WaitTimeout(Forever) } func (c *connection) WaitTimeout(timeout time.Duration) error { _, err := timedReceive(c.done, timeout) if err == Timeout { return Timeout } return c.Error() } func (c *connection) Incoming() <-chan Incoming { assert(c.incoming != nil, "Incoming() is only allowed for a Connection created with the Server() option: %s", c) return c.incoming } type IncomingConnection struct { incoming connectionSettings c *connection } func newIncomingConnection(c *connection) *IncomingConnection { c.user = c.pConnection.Transport().User() c.virtualHost = c.pConnection.RemoteHostname() return &IncomingConnection{ incoming: makeIncoming(c.pConnection), connectionSettings: c.connectionSettings, c: c} } // AcceptConnection is like Accept() but takes ConnectionOption s // For example you can set the Heartbeat() for the accepted connection. func (in *IncomingConnection) AcceptConnection(opts ...ConnectionOption) Connection { return in.accept(func() Endpoint { for _, opt := range opts { opt(in.c) } in.c.pConnection.Open() return in.c }).(Connection) } func (in *IncomingConnection) Accept() Endpoint { return in.AcceptConnection() } func sasl(c *connection) proton.SASL { return c.engine.Transport().SASL() } // SASLEnable returns a ConnectionOption that enables SASL authentication. // Only required if you don't set any other SASL options. func SASLEnable() ConnectionOption { return func(c *connection) { sasl(c) } } // SASLAllowedMechs returns a ConnectionOption to set the list of allowed SASL // mechanisms. // // Can be used on the client or the server to restrict the SASL for a connection. // mechs is a space-separated list of mechanism names. // func SASLAllowedMechs(mechs string) ConnectionOption { return func(c *connection) { sasl(c).AllowedMechs(mechs) } } // SASLAllowInsecure returns a ConnectionOption that allows or disallows clear // text SASL authentication mechanisms // // By default the SASL layer is configured not to allow mechanisms that disclose // the clear text of the password over an unencrypted AMQP connection. This specifically // will disallow the use of the PLAIN mechanism without using SSL encryption. // // This default is to avoid disclosing password information accidentally over an // insecure network. // func SASLAllowInsecure(b bool) ConnectionOption { return func(c *connection) { sasl(c).SetAllowInsecureMechs(b) } } // Heartbeat returns a ConnectionOption that requests the maximum delay // between sending frames for the remote peer. If we don't receive any frames // within 2*delay we will close the connection. // func Heartbeat(delay time.Duration) ConnectionOption { // Proton-C divides the idle-timeout by 2 before sending, so compensate. return func(c *connection) { c.engine.Transport().SetIdleTimeout(2 * delay) } } type saslConfigState struct { lock sync.Mutex name string dir string initialized bool } func (s *saslConfigState) set(target *string, value string) { s.lock.Lock() defer s.lock.Unlock() if s.initialized { panic("SASL configuration cannot be changed after a Connection has been created") } *target = value } // Apply the global SASL configuration the first time a proton.Engine needs it // // TODO aconway 2016-09-15: Current pn_sasl C impl config is broken, so all we // can realistically offer is global configuration. Later if/when the pn_sasl C // impl is fixed we can offer per connection over-rides. func (s *saslConfigState) setup(eng *proton.Engine) { s.lock.Lock() defer s.lock.Unlock() if !s.initialized { s.initialized = true sasl := eng.Transport().SASL() if s.name != "" { sasl.ConfigName(saslConfig.name) } if s.dir != "" { sasl.ConfigPath(saslConfig.dir) } } } var saslConfig saslConfigState // GlobalSASLConfigDir sets the SASL configuration directory for every // Connection created in this process. If not called, the default is determined // by your SASL installation. // // You can set SASLAllowInsecure and SASLAllowedMechs on individual connections. // // Must be called at most once, before any connections are created. func GlobalSASLConfigDir(dir string) { saslConfig.set(&saslConfig.dir, dir) } // GlobalSASLConfigName sets the SASL configuration name for every Connection // created in this process. If not called the default is "proton-server". // // The complete configuration file name is // /.conf // // You can set SASLAllowInsecure and SASLAllowedMechs on individual connections. // // Must be called at most once, before any connections are created. func GlobalSASLConfigName(name string) { saslConfig.set(&saslConfig.name, name) } // Do we support extended SASL negotiation? // All implementations of Proton support ANONYMOUS and EXTERNAL on both // client and server sides and PLAIN on the client side. // // Extended SASL implememtations use an external library (Cyrus SASL) // to support other mechanisms beyond these basic ones. func SASLExtended() bool { return proton.SASLExtended() } // Dial is shorthand for using net.Dial() then NewConnection() // See net.Dial() for the meaning of the network, address arguments. func Dial(network, address string, opts ...ConnectionOption) (c Connection, err error) { conn, err := net.Dial(network, address) if err == nil { c, err = NewConnection(conn, opts...) } return } // DialWithDialer is shorthand for using dialer.Dial() then NewConnection() // See net.Dial() for the meaning of the network, address arguments. func DialWithDialer(dialer *net.Dialer, network, address string, opts ...ConnectionOption) (c Connection, err error) { conn, err := dialer.Dial(network, address) if err == nil { c, err = NewConnection(conn, opts...) } return } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/electron/auth_test.go0000664000000000000000000001050413257152177024610 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package electron import ( "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "testing" ) func testAuthClientServer(t *testing.T, copts []ConnectionOption, sopts []ConnectionOption) (got connectionSettings, err error) { client, server := newClientServerOpts(t, copts, sopts) defer closeClientServer(client, server) go func() { for in := range server.Incoming() { switch in := in.(type) { case *IncomingConnection: got = connectionSettings{user: in.User(), virtualHost: in.VirtualHost()} } in.Accept() } }() err = client.Sync() return } func TestAuthAnonymous(t *testing.T) { got, err := testAuthClientServer(t, []ConnectionOption{User("fred"), VirtualHost("vhost"), SASLAllowInsecure(true)}, []ConnectionOption{SASLAllowedMechs("ANONYMOUS"), SASLAllowInsecure(true)}) fatalIf(t, err) errorIf(t, checkEqual(connectionSettings{user: "anonymous", virtualHost: "vhost"}, got)) } func TestAuthPlain(t *testing.T) { extendedSASL.startTest(t) got, err := testAuthClientServer(t, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("fred@proton"), Password([]byte("xxx"))}, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")}) fatalIf(t, err) errorIf(t, checkEqual(connectionSettings{user: "fred@proton"}, got)) } func TestAuthBadPass(t *testing.T) { extendedSASL.startTest(t) _, err := testAuthClientServer(t, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("fred@proton"), Password([]byte("yyy"))}, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")}) if err == nil { t.Error("Expected auth failure for bad pass") } } func TestAuthBadUser(t *testing.T) { extendedSASL.startTest(t) _, err := testAuthClientServer(t, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("foo@bar"), Password([]byte("yyy"))}, []ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")}) if err == nil { t.Error("Expected auth failure for bad user") } } type extendedSASLState struct { err error dir string } func (s *extendedSASLState) setup() { if SASLExtended() { if s.dir, s.err = ioutil.TempDir("", ""); s.err == nil { GlobalSASLConfigDir(s.dir) GlobalSASLConfigName("test") conf := filepath.Join(s.dir, "test.conf") db := filepath.Join(s.dir, "proton.sasldb") saslpasswd := os.Getenv("SASLPASSWD") if saslpasswd == "" { saslpasswd = "saslpasswd2" } cmd := exec.Command(saslpasswd, "-c", "-p", "-f", db, "-u", "proton", "fred") cmd.Stdin = strings.NewReader("xxx") // Password if _, s.err = cmd.CombinedOutput(); s.err == nil { confStr := fmt.Sprintf(` sasldb_path: %s mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS `, db) s.err = ioutil.WriteFile(conf, []byte(confStr), os.ModePerm) } } } // Note we don't do anything with s.err now, tests that need the // extended SASL config will fail if s.err != nil. If no such tests // are run then it is not an error that we couldn't set it up. } func (s extendedSASLState) teardown() { if s.dir != "" { _ = os.RemoveAll(s.dir) } } func (s extendedSASLState) startTest(t *testing.T) { if !SASLExtended() { t.Skipf("Extended SASL not enabled") } else if extendedSASL.err != nil { t.Skipf("Extended SASL setup error: %v", extendedSASL.err) } } var extendedSASL extendedSASLState func TestMain(m *testing.M) { // Do global SASL setup/teardown in main. // Doing it on-demand makes the tests fragile to parallel test runs and // changes in test ordering. extendedSASL.setup() status := m.Run() extendedSASL.teardown() os.Exit(status) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/0000775000000000000000000000000013257152177021404 5ustar qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/version.go0000664000000000000000000000235713257152177023427 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // NOTE: DO NOT EDIT. This file was generated by genwrap.go from the proton header files. // Update the generator and re-run if you need to modify this code. // package amqp // Version check for proton library. // Done here because this is the lowest-level dependency for all the proton Go packages. // #include // #if PN_VERSION_MAJOR == 0 && PN_VERSION_MINOR < 10 // #error packages qpid.apache.org/... require Proton-C library version 0.10 or greater // #endif import "C" qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/url_test.go0000664000000000000000000000276713257152177023610 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp import ( "fmt" ) func ExampleParseURL() { for _, s := range []string{ "amqp://username:password@host:1234/path", "host:1234", "host", "host/path", "amqps://host", "/path", "", ":1234", // Taken out because the go 1.4 URL parser isn't the same as later //"[::1]", //"[::1", // Output would be: // amqp://[::1]:amqp // parse amqp://[::1: missing ']' in host } { u, err := ParseURL(s) if err != nil { fmt.Println(err) } else { fmt.Println(u) } } // Output: // amqp://username:password@host:1234/path // amqp://host:1234 // amqp://host:amqp // amqp://host:amqp/path // amqps://host:amqps // amqp://localhost:amqp/path // amqp://localhost:amqp // parse :1234: missing protocol scheme } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/url.go0000664000000000000000000000521013257152177022533 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp import ( "errors" "net" "net/url" "strings" ) const ( amqp string = "amqp" amqps = "amqps" defaulthost = "localhost" ) // The way this is used it can only get a hostport already validated by // the URL parser, so this means we can skip some error checks func splitHostPort(hostport string) (string, string, error) { if hostport == "" { return "", "", nil } if hostport[0] == '[' { // There must be a matching ']' as already validated if l := strings.LastIndex(hostport, "]"); len(hostport) == l+1 { // trim off '[' and ']' return hostport[1:l], "", nil } } else if strings.IndexByte(hostport, ':') < 0 { return hostport, "", nil } return net.SplitHostPort(hostport) } func UpdateURL(in *url.URL) (err error) { // Detect form without "amqp://" and stick it on front // to make it match the usual proton defaults u := new (url.URL) *u = *in if (u.Scheme != "" && u.Opaque != "") || (u.Scheme == "" && u.Host == "") { input := u.String() input = "amqp://" + input u, err = url.Parse(input) if err != nil { return } } // If Scheme is still "" then default to amqp if u.Scheme == "" { u.Scheme = amqp } // Error if the scheme is not an amqp scheme if u.Scheme != amqp && u.Scheme != amqps { return errors.New("invalid amqp scheme") } // Decompose Host into host and port host, port, err := splitHostPort(u.Host) if err != nil { return } if host == "" { host = defaulthost } if port == "" { port = u.Scheme } u.Host = net.JoinHostPort(host, port) *in = *u return nil } // ParseUrl parses an AMQP URL string and returns a net/url.Url. // // It is more forgiving than net/url.Parse and allows most of the parts of the // URL to be missing, assuming AMQP defaults. // func ParseURL(s string) (u *url.URL, err error) { if u, err = url.Parse(s); err != nil { return } if err = UpdateURL(u); err != nil { u = nil } return u, err } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go0000664000000000000000000005501413257152177023732 0ustar /* Licensed to the Apache Software Foundation (ASF) under one oor more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp // #include import "C" import ( "bytes" "fmt" "io" "reflect" "time" "unsafe" ) const minDecode = 1024 // Error returned if AMQP data cannot be unmarshaled as the desired Go type. type UnmarshalError struct { // The name of the AMQP type. AMQPType string // The Go type. GoType reflect.Type s string } func (e UnmarshalError) Error() string { return e.s } // Error returned if there are not enough bytes to decode a complete AMQP value. var EndOfData = &UnmarshalError{s: "Not enough data for AMQP value"} var badData = &UnmarshalError{s: "Unexpected error in data"} func newUnmarshalError(pnType C.pn_type_t, v interface{}) *UnmarshalError { e := &UnmarshalError{ AMQPType: C.pn_type_t(pnType).String(), GoType: reflect.TypeOf(v), } if e.GoType == nil || e.GoType.Kind() != reflect.Ptr { e.s = fmt.Sprintf("cannot unmarshal to Go type %v, not a pointer", e.GoType) } else { e.s = fmt.Sprintf("cannot unmarshal AMQP %v to Go %v", e.AMQPType, e.GoType.Elem()) } return e } func doPanic(data *C.pn_data_t, v interface{}) { e := newUnmarshalError(C.pn_data_type(data), v) panic(e) } func doPanicMsg(data *C.pn_data_t, v interface{}, msg string) { e := newUnmarshalError(C.pn_data_type(data), v) e.s = e.s + ": " + msg panic(e) } func panicIfBadData(data *C.pn_data_t, v interface{}) { if C.pn_data_errno(data) != 0 { doPanicMsg(data, v, PnError(C.pn_data_error(data)).Error()) } } func panicUnless(ok bool, data *C.pn_data_t, v interface{}) { if !ok { doPanic(data, v) } } func checkOp(ok bool, v interface{}) { if !ok { panic(&badData) } } // // Decoding from a pn_data_t // // NOTE: we use panic() to signal a decoding error, simplifies decoding logic. // We recover() at the highest possible level - i.e. in the exported Unmarshal or Decode. // // Decoder decodes AMQP values from an io.Reader. // type Decoder struct { reader io.Reader buffer bytes.Buffer } // NewDecoder returns a new decoder that reads from r. // // The decoder has it's own buffer and may read more data than required for the // AMQP values requested. Use Buffered to see if there is data left in the // buffer. // func NewDecoder(r io.Reader) *Decoder { return &Decoder{r, bytes.Buffer{}} } // Buffered returns a reader of the data remaining in the Decoder's buffer. The // reader is valid until the next call to Decode. // func (d *Decoder) Buffered() io.Reader { return bytes.NewReader(d.buffer.Bytes()) } // Decode reads the next AMQP value from the Reader and stores it in the value pointed to by v. // // See the documentation for Unmarshal for details about the conversion of AMQP into a Go value. // func (d *Decoder) Decode(v interface{}) (err error) { data := C.pn_data(0) defer C.pn_data_free(data) var n int for n, err = decode(data, d.buffer.Bytes()); err == EndOfData; { err = d.more() if err == nil { n, err = decode(data, d.buffer.Bytes()) } } if err == nil { if err = recoverUnmarshal(v, data); err == nil { d.buffer.Next(n) } } return } /* Unmarshal decodes AMQP-encoded bytes and stores the result in the Go value pointed to by v. Legal conversions from the source AMQP type to the target Go type as follows: +----------------------------+-------------------------------------------------+ |Target Go type | Allowed AMQP types +============================+==================================================+ |bool |bool | +----------------------------+--------------------------------------------------+ |int, int8, int16, int32, |Equivalent or smaller signed integer type: | |int64 |byte, short, int, long or char | +----------------------------+--------------------------------------------------+ |uint, uint8, uint16, uint32,|Equivalent or smaller unsigned integer type: | |uint64 |ubyte, ushort, uint, ulong | +----------------------------+--------------------------------------------------+ |float32, float64 |Equivalent or smaller float or double | +----------------------------+--------------------------------------------------+ |string, []byte |string, symbol or binary | +----------------------------+--------------------------------------------------+ |Symbol |symbol | +----------------------------+--------------------------------------------------+ |Char |char | +----------------------------+--------------------------------------------------+ |Described |AMQP described type [1] | +----------------------------+--------------------------------------------------+ |Time |timestamp | +----------------------------+--------------------------------------------------+ |UUID |uuid | +----------------------------+--------------------------------------------------+ |map[interface{}]interface{} |Any AMQP map | +----------------------------+--------------------------------------------------+ |map[K]T |map, provided all keys and values can unmarshal | | |to types K,T | +----------------------------+--------------------------------------------------+ |[]interface{} |AMQP list or array | +----------------------------+--------------------------------------------------+ |[]T |list or array if elements can unmarshal as T | +----------------------------+------------------n-------------------------------+ |interface{} |any AMQP type[2] | +----------------------------+--------------------------------------------------+ [1] An AMQP described value can also unmarshal to a plain value, discarding the descriptor. Unmarshalling into the special amqp.Described type preserves the descriptor. [2] Any AMQP value can be unmarshalled to an interface{}. The Go type is determined by the AMQP type as follows: +----------------------------+--------------------------------------------------+ |Source AMQP Type |Go Type in target interface{} | +============================+==================================================+ |bool |bool | +----------------------------+--------------------------------------------------+ |byte,short,int,long |int8,int16,int32,int64 | +----------------------------+--------------------------------------------------+ |ubyte,ushort,uint,ulong |uint8,uint16,uint32,uint64 | +----------------------------+--------------------------------------------------+ |float, double |float32, float64 | +----------------------------+--------------------------------------------------+ |string |string | +----------------------------+--------------------------------------------------+ |symbol |Symbol | +----------------------------+--------------------------------------------------+ |char |Char | +----------------------------+--------------------------------------------------+ |binary |Binary | +----------------------------+--------------------------------------------------+ |null |nil | +----------------------------+--------------------------------------------------+ |described type |Described | +----------------------------+--------------------------------------------------+ |timestamp |time.Time | +----------------------------+--------------------------------------------------+ |uuid |UUID | +----------------------------+--------------------------------------------------+ |map |Map or AnyMap[4] | +----------------------------+--------------------------------------------------+ |list |List | +----------------------------+--------------------------------------------------+ |array |[]T for simple types, T is chosen as above [3] | +----------------------------+--------------------------------------------------+ [3] An AMQP array of simple types unmarshalls as a slice of the corresponding Go type. An AMQP array containing complex types (lists, maps or nested arrays) unmarshals to the generic array type amqp.Array [4] An AMQP map unmarshals as the generic `type Map map[interface{}]interface{}` unless it contains key values that are illegal as Go map types, in which case it unmarshals as type AnyMap. The following Go types cannot be unmarshaled: uintptr, function, interface, channel, array (use slice), struct AMQP types not yet supported: decimal32/64/128 */ func Unmarshal(bytes []byte, v interface{}) (n int, err error) { data := C.pn_data(0) defer C.pn_data_free(data) n, err = decode(data, bytes) if err == nil { err = recoverUnmarshal(v, data) } return } // Internal func UnmarshalUnsafe(pnData unsafe.Pointer, v interface{}) (err error) { return recoverUnmarshal(v, (*C.pn_data_t)(pnData)) } // more reads more data when we can't parse a complete AMQP type func (d *Decoder) more() error { var readSize int64 = minDecode if int64(d.buffer.Len()) > readSize { // Grow by doubling readSize = int64(d.buffer.Len()) } var n int64 n, err := d.buffer.ReadFrom(io.LimitReader(d.reader, readSize)) if n == 0 && err == nil { // ReadFrom won't report io.EOF, just returns 0 err = io.EOF } return err } // Call unmarshal(), convert panic to error value func recoverUnmarshal(v interface{}, data *C.pn_data_t) (err error) { defer func() { if r := recover(); r != nil { if uerr, ok := r.(*UnmarshalError); ok { err = uerr } else { panic(r) } } }() unmarshal(v, data) return nil } // Unmarshal from data into value pointed at by v. Returns v. // NOTE: If you update this you also need to update getInterface() func unmarshal(v interface{}, data *C.pn_data_t) { rt := reflect.TypeOf(v) rv := reflect.ValueOf(v) panicUnless(v != nil && rt.Kind() == reflect.Ptr && !rv.IsNil(), data, v) // Check for PN_DESCRIBED first, as described types can unmarshal into any of the Go types. // An interface{} target is handled in the switch below, even for described types. if _, isInterface := v.(*interface{}); !isInterface && bool(C.pn_data_is_described(data)) { getDescribed(data, v) return } // Unmarshal based on the target type pnType := C.pn_data_type(data) switch v := v.(type) { case *bool: panicUnless(pnType == C.PN_BOOL, data, v) *v = bool(C.pn_data_get_bool(data)) case *int8: panicUnless(pnType == C.PN_BYTE, data, v) *v = int8(C.pn_data_get_byte(data)) case *uint8: panicUnless(pnType == C.PN_UBYTE, data, v) *v = uint8(C.pn_data_get_ubyte(data)) case *int16: switch C.pn_data_type(data) { case C.PN_BYTE: *v = int16(C.pn_data_get_byte(data)) case C.PN_SHORT: *v = int16(C.pn_data_get_short(data)) default: doPanic(data, v) } case *uint16: switch pnType { case C.PN_UBYTE: *v = uint16(C.pn_data_get_ubyte(data)) case C.PN_USHORT: *v = uint16(C.pn_data_get_ushort(data)) default: doPanic(data, v) } case *int32: switch pnType { case C.PN_CHAR: *v = int32(C.pn_data_get_char(data)) case C.PN_BYTE: *v = int32(C.pn_data_get_byte(data)) case C.PN_SHORT: *v = int32(C.pn_data_get_short(data)) case C.PN_INT: *v = int32(C.pn_data_get_int(data)) default: doPanic(data, v) } case *uint32: switch pnType { case C.PN_CHAR: *v = uint32(C.pn_data_get_char(data)) case C.PN_UBYTE: *v = uint32(C.pn_data_get_ubyte(data)) case C.PN_USHORT: *v = uint32(C.pn_data_get_ushort(data)) case C.PN_UINT: *v = uint32(C.pn_data_get_uint(data)) default: doPanic(data, v) } case *int64: switch pnType { case C.PN_CHAR: *v = int64(C.pn_data_get_char(data)) case C.PN_BYTE: *v = int64(C.pn_data_get_byte(data)) case C.PN_SHORT: *v = int64(C.pn_data_get_short(data)) case C.PN_INT: *v = int64(C.pn_data_get_int(data)) case C.PN_LONG: *v = int64(C.pn_data_get_long(data)) default: doPanic(data, v) } case *uint64: switch pnType { case C.PN_CHAR: *v = uint64(C.pn_data_get_char(data)) case C.PN_UBYTE: *v = uint64(C.pn_data_get_ubyte(data)) case C.PN_USHORT: *v = uint64(C.pn_data_get_ushort(data)) case C.PN_ULONG: *v = uint64(C.pn_data_get_ulong(data)) default: doPanic(data, v) } case *int: switch pnType { case C.PN_CHAR: *v = int(C.pn_data_get_char(data)) case C.PN_BYTE: *v = int(C.pn_data_get_byte(data)) case C.PN_SHORT: *v = int(C.pn_data_get_short(data)) case C.PN_INT: *v = int(C.pn_data_get_int(data)) case C.PN_LONG: if intIs64 { *v = int(C.pn_data_get_long(data)) } else { doPanic(data, v) } default: doPanic(data, v) } case *uint: switch pnType { case C.PN_CHAR: *v = uint(C.pn_data_get_char(data)) case C.PN_UBYTE: *v = uint(C.pn_data_get_ubyte(data)) case C.PN_USHORT: *v = uint(C.pn_data_get_ushort(data)) case C.PN_UINT: *v = uint(C.pn_data_get_uint(data)) case C.PN_ULONG: if intIs64 { *v = uint(C.pn_data_get_ulong(data)) } else { doPanic(data, v) } default: doPanic(data, v) } case *float32: panicUnless(pnType == C.PN_FLOAT, data, v) *v = float32(C.pn_data_get_float(data)) case *float64: switch pnType { case C.PN_FLOAT: *v = float64(C.pn_data_get_float(data)) case C.PN_DOUBLE: *v = float64(C.pn_data_get_double(data)) default: doPanic(data, v) } case *string: switch pnType { case C.PN_STRING: *v = goString(C.pn_data_get_string(data)) case C.PN_SYMBOL: *v = goString(C.pn_data_get_symbol(data)) case C.PN_BINARY: *v = goString(C.pn_data_get_binary(data)) default: doPanic(data, v) } case *[]byte: switch pnType { case C.PN_STRING: *v = goBytes(C.pn_data_get_string(data)) case C.PN_SYMBOL: *v = goBytes(C.pn_data_get_symbol(data)) case C.PN_BINARY: *v = goBytes(C.pn_data_get_binary(data)) default: doPanic(data, v) } return case *Char: panicUnless(pnType == C.PN_CHAR, data, v) *v = Char(C.pn_data_get_char(data)) case *Binary: panicUnless(pnType == C.PN_BINARY, data, v) *v = Binary(goBytes(C.pn_data_get_binary(data))) case *Symbol: panicUnless(pnType == C.PN_SYMBOL, data, v) *v = Symbol(goBytes(C.pn_data_get_symbol(data))) case *time.Time: panicUnless(pnType == C.PN_TIMESTAMP, data, v) *v = time.Unix(0, int64(C.pn_data_get_timestamp(data))*1000) case *UUID: panicUnless(pnType == C.PN_UUID, data, v) pn := C.pn_data_get_uuid(data) copy((*v)[:], C.GoBytes(unsafe.Pointer(&pn.bytes), 16)) case *AnnotationKey: panicUnless(pnType == C.PN_ULONG || pnType == C.PN_SYMBOL || pnType == C.PN_STRING, data, v) unmarshal(&v.value, data) case *AnyMap: panicUnless(C.pn_data_type(data) == C.PN_MAP, data, v) n := int(C.pn_data_get_map(data)) / 2 if cap(*v) < n { *v = make(AnyMap, n) } *v = (*v)[:n] data.enter(*v) defer data.exit(*v) for i := 0; i < n; i++ { data.next(*v) unmarshal(&(*v)[i].Key, data) data.next(*v) unmarshal(&(*v)[i].Value, data) } case *interface{}: getInterface(data, v) default: // This is not one of the fixed well-known types, reflect for map and slice types switch rt.Elem().Kind() { case reflect.Map: getMap(data, v) case reflect.Slice: getSequence(data, v) default: doPanic(data, v) } } } // Unmarshalling into an interface{} the type is determined by the AMQP source type, // since the interface{} target can hold any Go type. func getInterface(data *C.pn_data_t, vp *interface{}) { pnType := C.pn_data_type(data) switch pnType { case C.PN_BOOL: *vp = bool(C.pn_data_get_bool(data)) case C.PN_UBYTE: *vp = uint8(C.pn_data_get_ubyte(data)) case C.PN_BYTE: *vp = int8(C.pn_data_get_byte(data)) case C.PN_USHORT: *vp = uint16(C.pn_data_get_ushort(data)) case C.PN_SHORT: *vp = int16(C.pn_data_get_short(data)) case C.PN_UINT: *vp = uint32(C.pn_data_get_uint(data)) case C.PN_INT: *vp = int32(C.pn_data_get_int(data)) case C.PN_CHAR: *vp = Char(C.pn_data_get_char(data)) case C.PN_ULONG: *vp = uint64(C.pn_data_get_ulong(data)) case C.PN_LONG: *vp = int64(C.pn_data_get_long(data)) case C.PN_FLOAT: *vp = float32(C.pn_data_get_float(data)) case C.PN_DOUBLE: *vp = float64(C.pn_data_get_double(data)) case C.PN_BINARY: *vp = Binary(goBytes(C.pn_data_get_binary(data))) case C.PN_STRING: *vp = goString(C.pn_data_get_string(data)) case C.PN_SYMBOL: *vp = Symbol(goString(C.pn_data_get_symbol(data))) case C.PN_TIMESTAMP: *vp = time.Unix(0, int64(C.pn_data_get_timestamp(data))*1000) case C.PN_UUID: var u UUID unmarshal(&u, data) *vp = u case C.PN_MAP: // We will try to unmarshal as a Map first, if that fails try AnyMap m := make(Map, int(C.pn_data_get_map(data))/2) if err := recoverUnmarshal(&m, data); err == nil { *vp = m } else { am := make(AnyMap, int(C.pn_data_get_map(data))/2) unmarshal(&am, data) *vp = am } case C.PN_LIST: l := List{} unmarshal(&l, data) *vp = l case C.PN_ARRAY: sp := getArrayStore(data) // interface{} containing T* for suitable T unmarshal(sp, data) *vp = reflect.ValueOf(sp).Elem().Interface() case C.PN_DESCRIBED: d := Described{} unmarshal(&d, data) *vp = d case C.PN_NULL: *vp = nil case C.PN_INVALID: // Allow decoding from an empty data object to an interface, treat it like NULL. // This happens when optional values or properties are omitted from a message. *vp = nil default: // Don't know how to handle this panic(newUnmarshalError(pnType, vp)) } } // Return an interface{} containing a pointer to an appropriate slice or Array func getArrayStore(data *C.pn_data_t) interface{} { // TODO aconway 2017-11-10: described arrays. switch C.pn_data_get_array_type(data) { case C.PN_BOOL: return new([]bool) case C.PN_UBYTE: return new([]uint8) case C.PN_BYTE: return new([]int8) case C.PN_USHORT: return new([]uint16) case C.PN_SHORT: return new([]int16) case C.PN_UINT: return new([]uint32) case C.PN_INT: return new([]int32) case C.PN_CHAR: return new([]Char) case C.PN_ULONG: return new([]uint64) case C.PN_LONG: return new([]int64) case C.PN_FLOAT: return new([]float32) case C.PN_DOUBLE: return new([]float64) case C.PN_BINARY: return new([]Binary) case C.PN_STRING: return new([]string) case C.PN_SYMBOL: return new([]Symbol) case C.PN_TIMESTAMP: return new([]time.Time) case C.PN_UUID: return new([]UUID) } return new(Array) // Not a simple type, use generic Array } var typeOfInterface = reflect.TypeOf(interface{}(nil)) // get into map pointed at by v func getMap(data *C.pn_data_t, v interface{}) { panicUnless(C.pn_data_type(data) == C.PN_MAP, data, v) n := int(C.pn_data_get_map(data)) / 2 mapValue := reflect.ValueOf(v).Elem() mapValue.Set(reflect.MakeMap(mapValue.Type())) // Clear the map data.enter(v) defer data.exit(v) // Allocate re-usable key/val values keyType := mapValue.Type().Key() keyPtr := reflect.New(keyType) valPtr := reflect.New(mapValue.Type().Elem()) for i := 0; i < n; i++ { data.next(v) unmarshal(keyPtr.Interface(), data) if keyType.Kind() == reflect.Interface && !keyPtr.Elem().Elem().Type().Comparable() { doPanicMsg(data, v, fmt.Sprintf("key %#v is not comparable", keyPtr.Elem().Interface())) } data.next(v) unmarshal(valPtr.Interface(), data) mapValue.SetMapIndex(keyPtr.Elem(), valPtr.Elem()) } } func getSequence(data *C.pn_data_t, vp interface{}) { var count int pnType := C.pn_data_type(data) switch pnType { case C.PN_LIST: count = int(C.pn_data_get_list(data)) case C.PN_ARRAY: count = int(C.pn_data_get_array(data)) default: doPanic(data, vp) } listValue := reflect.MakeSlice(reflect.TypeOf(vp).Elem(), count, count) data.enter(vp) defer data.exit(vp) for i := 0; i < count; i++ { data.next(vp) val := reflect.New(listValue.Type().Elem()) unmarshal(val.Interface(), data) listValue.Index(i).Set(val.Elem()) } reflect.ValueOf(vp).Elem().Set(listValue) } func getDescribed(data *C.pn_data_t, vp interface{}) { d, isDescribed := vp.(*Described) data.enter(vp) defer data.exit(vp) data.next(vp) if isDescribed { unmarshal(&d.Descriptor, data) data.next(vp) unmarshal(&d.Value, data) } else { data.next(vp) // Skip descriptor unmarshal(vp, data) // Unmarshal plain value } } // decode from bytes. // Return bytes decoded or 0 if we could not decode a complete object. // func decode(data *C.pn_data_t, bytes []byte) (int, error) { n := C.pn_data_decode(data, cPtr(bytes), cLen(bytes)) if n == C.PN_UNDERFLOW { C.pn_error_clear(C.pn_data_error(data)) return 0, EndOfData } else if n <= 0 { return 0, &UnmarshalError{s: fmt.Sprintf("unmarshal %v", PnErrorCode(n))} } return int(n), nil } // Checked versions of pn_data functions func (data *C.pn_data_t) enter(v interface{}) { checkOp(bool(C.pn_data_enter(data)), v) } func (data *C.pn_data_t) exit(v interface{}) { checkOp(bool(C.pn_data_exit(data)), v) } func (data *C.pn_data_t) next(v interface{}) { checkOp(bool(C.pn_data_next(data)), v) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/types_test.go0000664000000000000000000001262013257152177024137 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp import ( "fmt" "reflect" "testing" "time" ) func checkEqual(want interface{}, got interface{}) error { if !reflect.DeepEqual(want, got) { return fmt.Errorf("%#v != %#v", want, got) } return nil } func checkUnmarshal(marshaled []byte, v interface{}) error { got, err := Unmarshal(marshaled, v) if err != nil { return err } if got != len(marshaled) { return fmt.Errorf("Wanted to Unmarshal %v bytes, got %v", len(marshaled), got) } return nil } func ExampleKey() { var k AnnotationKey = AnnotationKeySymbol(Symbol("foo")) fmt.Println(k.Get().(Symbol)) k = AnnotationKeyUint64(42) fmt.Println(k.Get().(uint64)) // Output: // foo // 42 } var timeValue = time.Now().Round(time.Millisecond) // Values that are unchanged by a marshal/unmarshal round-trip from interface{} // to interface{} var rtValues = []interface{}{ true, int8(-8), int16(-16), int32(-32), int64(-64), uint8(8), uint16(16), uint32(32), uint64(64), float32(0.32), float64(0.64), "string", Binary("Binary"), Symbol("symbol"), nil, Described{"D", "V"}, timeValue, UUID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, Char('a'), Map{"V": "X"}, Map{}, List{"V", int32(1)}, List{}, []string{"a", "b", "c"}, []int8{}, AnyMap{{[]int8{1, 2, 3}, "bad-key"}, {int16(1), "duplicate-1"}, {int16(1), "duplicate-2"}}, } // Go values that round-trip if unmarshalled back to the same type they were // marshalled from, but unmarshal to interface{} as a different default type. var oddValues = []interface{}{ int(-99), // int32|64 depending on platform uint(99), // int32|64 depending on platform []byte("byte"), // amqp.Binary map[string]int{"str": 99}, // amqp.Map []Map{Map{}}, // amqp.Array - the generic array AnyMap(nil), // Map } var allValues = append(rtValues, oddValues...) // %v formatted representation of allValues var vstrings = []string{ // for rtValues "true", "-8", "-16", "-32", "-64", "8", "16", "32", "64", "0.32", "0.64", "string", "Binary", "symbol", "", "{D V}", fmt.Sprintf("%v", timeValue), "UUID(01020304-0506-0708-090a-0b0c0d0e0f10)", fmt.Sprintf("%v", 'a'), "map[V:X]", "map[]", "[V 1]", "[]", "[a b c]", "[]", "[{[1 2 3] bad-key} {1 duplicate-1} {1 duplicate-2}]", // for oddValues "-99", "99", "[98 121 116 101]", /*"byte"*/ "map[str:99]", "[map[]]", "[]", } // Round-trip encoding test func TestTypesRoundTrip(t *testing.T) { for _, x := range rtValues { marshalled, err := Marshal(x, nil) if err != nil { t.Error(err) } var v interface{} if err := checkUnmarshal(marshalled, &v); err != nil { t.Error(err) } if err := checkEqual(x, v); err != nil { t.Error(err) } } } // Round trip from T to T where T is the type of the value. func TestTypesRoundTripAll(t *testing.T) { for _, x := range allValues { marshaled, err := Marshal(x, nil) if err != nil { t.Error(err) } if x == nil { // We can't create an instance of nil to unmarshal to. continue } vp := reflect.New(reflect.TypeOf(x)) // v points to a Zero of the same type as x if err := checkUnmarshal(marshaled, vp.Interface()); err != nil { t.Error(err) } v := vp.Elem().Interface() if err := checkEqual(x, v); err != nil { t.Error(err) } } } func TestTypesPrint(t *testing.T) { // Default %v representations of rtValues and oddValues for i, x := range allValues { if s := fmt.Sprintf("%v", x); vstrings[i] != s { t.Errorf("printing %T: want %v, got %v", x, vstrings[i], s) } } } func TestDescribed(t *testing.T) { want := Described{"D", "V"} marshaled, _ := Marshal(want, nil) // Unmarshal to Described type var d Described if err := checkUnmarshal(marshaled, &d); err != nil { t.Error(err) } if err := checkEqual(want, d); err != nil { t.Error(err) } // Unmarshal to interface{} var i interface{} if err := checkUnmarshal(marshaled, &i); err != nil { t.Error(err) } if _, ok := i.(Described); !ok { t.Errorf("Expected Described, got %T(%v)", i, i) } if err := checkEqual(want, i); err != nil { t.Error(err) } // Unmarshal value only (drop descriptor) to the value type var s string if err := checkUnmarshal(marshaled, &s); err != nil { t.Error(err) } if err := checkEqual(want.Value, s); err != nil { t.Error(err) } // Nested described types want = Described{Described{int64(123), true}, "foo"} marshaled, _ = Marshal(want, nil) if err := checkUnmarshal(marshaled, &d); err != nil { t.Error(err) } if err := checkEqual(want, d); err != nil { t.Error(err) } // Nested to interface if err := checkUnmarshal(marshaled, &i); err != nil { t.Error(err) } if err := checkEqual(want, i); err != nil { t.Error(err) } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/types.go0000664000000000000000000001535713257152177023112 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp // #include import "C" import ( "bytes" "fmt" "time" "unsafe" ) func (t C.pn_type_t) String() string { switch C.pn_type_t(t) { case C.PN_NULL: return "null" case C.PN_BOOL: return "bool" case C.PN_UBYTE: return "ubyte" case C.PN_BYTE: return "byte" case C.PN_USHORT: return "ushort" case C.PN_SHORT: return "short" case C.PN_CHAR: return "char" case C.PN_UINT: return "uint" case C.PN_INT: return "int" case C.PN_ULONG: return "ulong" case C.PN_LONG: return "long" case C.PN_TIMESTAMP: return "timestamp" case C.PN_FLOAT: return "float" case C.PN_DOUBLE: return "double" case C.PN_DECIMAL32: return "decimal32" case C.PN_DECIMAL64: return "decimal64" case C.PN_DECIMAL128: return "decimal128" case C.PN_UUID: return "uuid" case C.PN_BINARY: return "binary" case C.PN_STRING: return "string" case C.PN_SYMBOL: return "symbol" case C.PN_DESCRIBED: return "described" case C.PN_ARRAY: return "array" case C.PN_LIST: return "list" case C.PN_MAP: return "map" default: return fmt.Sprintf("", int(t)) } } // The AMQP map type. A generic map that can have mixed-type keys and values. type Map map[interface{}]interface{} // The most general AMQP map type, for unusual interoperability cases. // // This is not a Go Map but a sequence of {key, value} pairs. // // An AnyMap lets you control or examine the encoded ordering of key,value pairs // and use key values that are not legal as Go map keys. // // The amqp.Map, or plain Go map types are easier to use for most cases. type AnyMap []KeyValue // Return a Map constructed from an AnyMap. // Panic if the AnyMap has key values that are not valid Go map keys (e.g. maps, slices) func (a AnyMap) Map() (m Map) { for _, kv := range a { m[kv.Key] = kv.Value } return } // KeyValue pair, used by AnyMap type KeyValue struct{ Key, Value interface{} } // The AMQP list type. A generic list that can hold mixed-type values. type List []interface{} // The generic AMQP array type, used to unmarshal an array with nested array, // map or list elements. Arrays of simple type T unmarshal to []T type Array []interface{} // Symbol is a string that is encoded as an AMQP symbol type Symbol string func (s Symbol) String() string { return string(s) } func (s Symbol) GoString() string { return fmt.Sprintf("s\"%s\"", s) } // Binary is a string that is encoded as an AMQP binary. // It is a string rather than a byte[] because byte[] is not hashable and can't be used as // a map key, AMQP frequently uses binary types as map keys. It can convert to and from []byte type Binary string func (b Binary) String() string { return string(b) } func (b Binary) GoString() string { return fmt.Sprintf("b\"%s\"", b) } // GoString for Map prints values with their types, useful for debugging. func (m Map) GoString() string { out := &bytes.Buffer{} fmt.Fprintf(out, "%T{", m) i := len(m) for k, v := range m { fmt.Fprintf(out, "%T(%#v): %T(%#v)", k, k, v, v) i-- if i > 0 { fmt.Fprint(out, ", ") } } fmt.Fprint(out, "}") return out.String() } // GoString for List prints values with their types, useful for debugging. func (l List) GoString() string { out := &bytes.Buffer{} fmt.Fprintf(out, "%T{", l) for i := 0; i < len(l); i++ { fmt.Fprintf(out, "%T(%#v)", l[i], l[i]) if i == len(l)-1 { fmt.Fprint(out, ", ") } } fmt.Fprint(out, "}") return out.String() } // pnTime converts Go time.Time to Proton millisecond Unix time. func pnTime(t time.Time) C.pn_timestamp_t { secs := t.Unix() // Note: sub-second accuracy is not guaranteed if the Unix time in // nanoseconds cannot be represented by an int64 (sometime around year 2260) msecs := (t.UnixNano() % int64(time.Second)) / int64(time.Millisecond) return C.pn_timestamp_t(secs*1000 + msecs) } // goTime converts a pn_timestamp_t to a Go time.Time. func goTime(t C.pn_timestamp_t) time.Time { secs := int64(t) / 1000 nsecs := (int64(t) % 1000) * int64(time.Millisecond) return time.Unix(secs, nsecs) } func goBytes(cBytes C.pn_bytes_t) (bytes []byte) { if cBytes.start != nil { bytes = C.GoBytes(unsafe.Pointer(cBytes.start), C.int(cBytes.size)) } return } func goString(cBytes C.pn_bytes_t) (str string) { if cBytes.start != nil { str = C.GoStringN(cBytes.start, C.int(cBytes.size)) } return } func pnBytes(b []byte) C.pn_bytes_t { if len(b) == 0 { return C.pn_bytes_t{0, nil} } else { return C.pn_bytes_t{C.size_t(len(b)), (*C.char)(unsafe.Pointer(&b[0]))} } } func cPtr(b []byte) *C.char { if len(b) == 0 { return nil } return (*C.char)(unsafe.Pointer(&b[0])) } func cLen(b []byte) C.size_t { return C.size_t(len(b)) } // AnnotationKey is used as a map key for AMQP annotation maps which are // allowed to have keys that are either symbol or ulong but no other type. // type AnnotationKey struct { value interface{} } func AnnotationKeySymbol(v Symbol) AnnotationKey { return AnnotationKey{v} } func AnnotationKeyUint64(v uint64) AnnotationKey { return AnnotationKey{v} } func AnnotationKeyString(v string) AnnotationKey { return AnnotationKey{Symbol(v)} } // Returns the value which must be Symbol, uint64 or nil func (k AnnotationKey) Get() interface{} { return k.value } func (k AnnotationKey) String() string { return fmt.Sprintf("%v", k.Get()) } // Described represents an AMQP described type, which is really // just a pair of AMQP values - the first is treated as a "descriptor", // and is normally a string or ulong providing information about the type. // The second is the "value" and can be any AMQP value. type Described struct { Descriptor interface{} Value interface{} } // UUID is an AMQP 128-bit Universally Unique Identifier, as defined by RFC-4122 section 4.1.2 type UUID [16]byte func (u UUID) String() string { return fmt.Sprintf("UUID(%x-%x-%x-%x-%x)", u[0:4], u[4:6], u[6:8], u[8:10], u[10:]) } // Char is an AMQP unicode character, equivalent to a Go rune. // It is defined as a distinct type so it can be distinguished from an AMQP int type Char rune const intIs64 = unsafe.Sizeof(int(0)) == 8 qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/message_test.go0000664000000000000000000001307613257152177024425 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp import ( "testing" "time" ) func roundTrip(m Message) error { buffer, err := m.Encode(nil) if err != nil { return err } m2, err := DecodeMessage(buffer) if err != nil { return err } return checkEqual(m, m2) } func TestDefaultMessage(t *testing.T) { m := NewMessage() // Check defaults for _, data := range [][]interface{}{ {m.Inferred(), false}, {m.Durable(), false}, {m.Priority(), uint8(4)}, {m.TTL(), time.Duration(0)}, {m.UserId(), ""}, {m.Address(), ""}, {m.Subject(), ""}, {m.ReplyTo(), ""}, {m.ContentType(), ""}, {m.ContentEncoding(), ""}, {m.GroupId(), ""}, {m.GroupSequence(), int32(0)}, {m.ReplyToGroupId(), ""}, {m.MessageId(), nil}, {m.CorrelationId(), nil}, {m.DeliveryAnnotations(), map[AnnotationKey]interface{}(nil)}, {m.MessageAnnotations(), map[AnnotationKey]interface{}(nil)}, {m.ApplicationProperties(), map[string]interface{}(nil)}, // Deprecated {m.Instructions(), map[string]interface{}(nil)}, {m.Annotations(), map[string]interface{}(nil)}, {m.Properties(), map[string]interface{}(nil)}, {m.Body(), nil}, } { if err := checkEqual(data[0], data[1]); err != nil { t.Error(err) } } if err := roundTrip(m); err != nil { t.Error(err) } } func TestMessageRoundTrip(t *testing.T) { m := NewMessage() m.SetInferred(false) m.SetDurable(true) m.SetPriority(42) m.SetTTL(0) m.SetUserId("user") m.SetAddress("address") m.SetSubject("subject") m.SetReplyTo("replyto") m.SetContentType("content") m.SetContentEncoding("encoding") m.SetGroupId("group") m.SetGroupSequence(42) m.SetReplyToGroupId("replytogroup") m.SetMessageId("id") m.SetCorrelationId("correlation") m.SetDeliveryAnnotations(map[AnnotationKey]interface{}{AnnotationKeySymbol("instructions"): "foo"}) m.SetMessageAnnotations(map[AnnotationKey]interface{}{AnnotationKeySymbol("annotations"): "bar"}) m.SetApplicationProperties(map[string]interface{}{"int": int32(32), "bool": true}) m.Marshal("hello") for _, data := range [][]interface{}{ {m.Inferred(), false}, {m.Durable(), true}, {m.Priority(), uint8(42)}, {m.TTL(), time.Duration(0)}, {m.UserId(), "user"}, {m.Address(), "address"}, {m.Subject(), "subject"}, {m.ReplyTo(), "replyto"}, {m.ContentType(), "content"}, {m.ContentEncoding(), "encoding"}, {m.GroupId(), "group"}, {m.GroupSequence(), int32(42)}, {m.ReplyToGroupId(), "replytogroup"}, {m.MessageId(), "id"}, {m.CorrelationId(), "correlation"}, {m.DeliveryAnnotations(), map[AnnotationKey]interface{}{AnnotationKeySymbol("instructions"): "foo"}}, {m.MessageAnnotations(), map[AnnotationKey]interface{}{AnnotationKeySymbol("annotations"): "bar"}}, {m.ApplicationProperties(), map[string]interface{}{"int": int32(32), "bool": true}}, {m.Body(), "hello"}, // Deprecated {m.Instructions(), map[string]interface{}{"instructions": "foo"}}, {m.Annotations(), map[string]interface{}{"annotations": "bar"}}, } { if err := checkEqual(data[0], data[1]); err != nil { t.Error(err) } } if err := roundTrip(m); err != nil { t.Error(err) } } func TestDeprecated(t *testing.T) { m := NewMessage() m.SetInstructions(map[string]interface{}{"instructions": "foo"}) m.SetAnnotations(map[string]interface{}{"annotations": "bar"}) m.SetProperties(map[string]interface{}{"int": int32(32), "bool": true}) for _, data := range [][]interface{}{ {m.DeliveryAnnotations(), map[AnnotationKey]interface{}{AnnotationKeySymbol("instructions"): "foo"}}, {m.MessageAnnotations(), map[AnnotationKey]interface{}{AnnotationKeySymbol("annotations"): "bar"}}, {m.ApplicationProperties(), map[string]interface{}{"int": int32(32), "bool": true}}, {m.Instructions(), map[string]interface{}{"instructions": "foo"}}, {m.Annotations(), map[string]interface{}{"annotations": "bar"}}, {m.Properties(), map[string]interface{}{"int": int32(32), "bool": true}}, } { if err := checkEqual(data[0], data[1]); err != nil { t.Error(err) } } if err := roundTrip(m); err != nil { t.Error(err) } } func TestMessageBodyTypes(t *testing.T) { var s string var body interface{} var i int64 m := NewMessageWith(int64(42)) m.Unmarshal(&body) m.Unmarshal(&i) if err := checkEqual(body.(int64), int64(42)); err != nil { t.Error(err) } if err := checkEqual(i, int64(42)); err != nil { t.Error(err) } m = NewMessageWith("hello") m.Unmarshal(&s) m.Unmarshal(&body) if err := checkEqual(s, "hello"); err != nil { t.Error(err) } if err := checkEqual(body.(string), "hello"); err != nil { t.Error(err) } if err := roundTrip(m); err != nil { t.Error(err) } m = NewMessageWith(Binary("bin")) m.Unmarshal(&s) m.Unmarshal(&body) if err := checkEqual(body.(Binary), Binary("bin")); err != nil { t.Error(err) } if err := checkEqual(s, "bin"); err != nil { t.Error(err) } if err := roundTrip(m); err != nil { t.Error(err) } // TODO aconway 2015-09-08: array etc. } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/message.go0000664000000000000000000003371413257152177023367 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp // #include // #include // #include // #include // // /* Helper for setting message string fields */ // typedef int (*set_fn)(pn_message_t*, const char*); // int msg_set_str(pn_message_t* m, char* s, set_fn set) { // int result = set(m, s); // free(s); // return result; // } // import "C" import ( "fmt" "runtime" "time" ) // Message is the interface to an AMQP message. type Message interface { // Durable indicates that any parties taking responsibility // for the message must durably store the content. Durable() bool SetDurable(bool) // Priority impacts ordering guarantees. Within a // given ordered context, higher priority messages may jump ahead of // lower priority messages. Priority() uint8 SetPriority(uint8) // TTL or Time To Live, a message it may be dropped after this duration TTL() time.Duration SetTTL(time.Duration) // FirstAcquirer indicates // that the recipient of the message is the first recipient to acquire // the message, i.e. there have been no failed delivery attempts to // other acquirers. Note that this does not mean the message has not // been delivered to, but not acquired, by other recipients. FirstAcquirer() bool SetFirstAcquirer(bool) // DeliveryCount tracks how many attempts have been made to // delivery a message. DeliveryCount() uint32 SetDeliveryCount(uint32) // MessageId provides a unique identifier for a message. // it can be an a string, an unsigned long, a uuid or a // binary value. MessageId() interface{} SetMessageId(interface{}) UserId() string SetUserId(string) Address() string SetAddress(string) Subject() string SetSubject(string) ReplyTo() string SetReplyTo(string) // CorrelationId is set on correlated request and response messages. It can be // an a string, an unsigned long, a uuid or a binary value. CorrelationId() interface{} SetCorrelationId(interface{}) ContentType() string SetContentType(string) ContentEncoding() string SetContentEncoding(string) // ExpiryTime indicates an absolute time when the message may be dropped. // A Zero time (i.e. t.isZero() == true) indicates a message never expires. ExpiryTime() time.Time SetExpiryTime(time.Time) CreationTime() time.Time SetCreationTime(time.Time) GroupId() string SetGroupId(string) GroupSequence() int32 SetGroupSequence(int32) ReplyToGroupId() string SetReplyToGroupId(string) // Property map set by the application to be carried with the message. // Values must be simple types (not maps, lists or sequences) ApplicationProperties() map[string]interface{} SetApplicationProperties(map[string]interface{}) // Per-delivery annotations to provide delivery instructions. // May be added or removed by intermediaries during delivery. DeliveryAnnotations() map[AnnotationKey]interface{} SetDeliveryAnnotations(map[AnnotationKey]interface{}) // Message annotations added as part of the bare message at creation, usually // by an AMQP library. See ApplicationProperties() for adding application data. MessageAnnotations() map[AnnotationKey]interface{} SetMessageAnnotations(map[AnnotationKey]interface{}) // Inferred indicates how the message content // is encoded into AMQP sections. If inferred is true then binary and // list values in the body of the message will be encoded as AMQP DATA // and AMQP SEQUENCE sections, respectively. If inferred is false, // then all values in the body of the message will be encoded as AMQP // VALUE sections regardless of their type. Inferred() bool SetInferred(bool) // Marshal a Go value into the message body. See amqp.Marshal() for details. Marshal(interface{}) // Unmarshal the message body into the value pointed to by v. See amqp.Unmarshal() for details. Unmarshal(interface{}) // Body value resulting from the default unmarshaling of message body as interface{} Body() interface{} // Encode encodes the message as AMQP data. If buffer is non-nil and is large enough // the message is encoded into it, otherwise a new buffer is created. // Returns the buffer containing the message. Encode(buffer []byte) ([]byte, error) // Decode data into this message. Overwrites an existing message content. Decode(buffer []byte) error // Clear the message contents. Clear() // Copy the contents of another message to this one. Copy(m Message) error // Deprecated: use DeliveryAnnotations() for a more type-safe interface Instructions() map[string]interface{} SetInstructions(v map[string]interface{}) // Deprecated: use MessageAnnotations() for a more type-safe interface Annotations() map[string]interface{} SetAnnotations(v map[string]interface{}) // Deprecated: use ApplicationProperties() for a more type-safe interface Properties() map[string]interface{} SetProperties(v map[string]interface{}) } type message struct{ pn *C.pn_message_t } func freeMessage(m *message) { C.pn_message_free(m.pn) m.pn = nil } // NewMessage creates a new message instance. func NewMessage() Message { m := &message{C.pn_message()} runtime.SetFinalizer(m, freeMessage) return m } // NewMessageWith creates a message with value as the body. Equivalent to // m := NewMessage(); m.Marshal(body) func NewMessageWith(value interface{}) Message { m := NewMessage() m.Marshal(value) return m } func (m *message) Clear() { C.pn_message_clear(m.pn) } func (m *message) Copy(x Message) error { if data, err := x.Encode(nil); err == nil { return m.Decode(data) } else { return err } } // ==== message get functions func rewindGet(data *C.pn_data_t) (v interface{}) { C.pn_data_rewind(data) C.pn_data_next(data) unmarshal(&v, data) return v } func (m *message) Inferred() bool { return bool(C.pn_message_is_inferred(m.pn)) } func (m *message) Durable() bool { return bool(C.pn_message_is_durable(m.pn)) } func (m *message) Priority() uint8 { return uint8(C.pn_message_get_priority(m.pn)) } func (m *message) TTL() time.Duration { return time.Duration(C.pn_message_get_ttl(m.pn)) * time.Millisecond } func (m *message) FirstAcquirer() bool { return bool(C.pn_message_is_first_acquirer(m.pn)) } func (m *message) DeliveryCount() uint32 { return uint32(C.pn_message_get_delivery_count(m.pn)) } func (m *message) MessageId() interface{} { return rewindGet(C.pn_message_id(m.pn)) } func (m *message) UserId() string { return goString(C.pn_message_get_user_id(m.pn)) } func (m *message) Address() string { return C.GoString(C.pn_message_get_address(m.pn)) } func (m *message) Subject() string { return C.GoString(C.pn_message_get_subject(m.pn)) } func (m *message) ReplyTo() string { return C.GoString(C.pn_message_get_reply_to(m.pn)) } func (m *message) CorrelationId() interface{} { return rewindGet(C.pn_message_correlation_id(m.pn)) } func (m *message) ContentType() string { return C.GoString(C.pn_message_get_content_type(m.pn)) } func (m *message) ContentEncoding() string { return C.GoString(C.pn_message_get_content_encoding(m.pn)) } func (m *message) ExpiryTime() time.Time { return time.Unix(0, int64(time.Millisecond*time.Duration(C.pn_message_get_expiry_time(m.pn)))) } func (m *message) CreationTime() time.Time { return time.Unix(0, int64(time.Millisecond)*int64(C.pn_message_get_creation_time(m.pn))) } func (m *message) GroupId() string { return C.GoString(C.pn_message_get_group_id(m.pn)) } func (m *message) GroupSequence() int32 { return int32(C.pn_message_get_group_sequence(m.pn)) } func (m *message) ReplyToGroupId() string { return C.GoString(C.pn_message_get_reply_to_group_id(m.pn)) } func getAnnotations(data *C.pn_data_t) (v map[AnnotationKey]interface{}) { if C.pn_data_size(data) > 0 { C.pn_data_rewind(data) C.pn_data_next(data) unmarshal(&v, data) } return v } func (m *message) DeliveryAnnotations() map[AnnotationKey]interface{} { return getAnnotations(C.pn_message_instructions(m.pn)) } func (m *message) MessageAnnotations() map[AnnotationKey]interface{} { return getAnnotations(C.pn_message_annotations(m.pn)) } func (m *message) ApplicationProperties() map[string]interface{} { var v map[string]interface{} data := C.pn_message_properties(m.pn) if C.pn_data_size(data) > 0 { C.pn_data_rewind(data) C.pn_data_next(data) unmarshal(&v, data) } return v } // ==== message set methods func setData(v interface{}, data *C.pn_data_t) { C.pn_data_clear(data) marshal(v, data) } func (m *message) SetInferred(b bool) { C.pn_message_set_inferred(m.pn, C.bool(b)) } func (m *message) SetDurable(b bool) { C.pn_message_set_durable(m.pn, C.bool(b)) } func (m *message) SetPriority(b uint8) { C.pn_message_set_priority(m.pn, C.uint8_t(b)) } func (m *message) SetTTL(d time.Duration) { C.pn_message_set_ttl(m.pn, C.pn_millis_t(d/time.Millisecond)) } func (m *message) SetFirstAcquirer(b bool) { C.pn_message_set_first_acquirer(m.pn, C.bool(b)) } func (m *message) SetDeliveryCount(c uint32) { C.pn_message_set_delivery_count(m.pn, C.uint32_t(c)) } func (m *message) SetMessageId(id interface{}) { setData(id, C.pn_message_id(m.pn)) } func (m *message) SetUserId(s string) { C.pn_message_set_user_id(m.pn, pnBytes(([]byte)(s))) } func (m *message) SetAddress(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_address)) } func (m *message) SetSubject(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_subject)) } func (m *message) SetReplyTo(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_reply_to)) } func (m *message) SetCorrelationId(c interface{}) { setData(c, C.pn_message_correlation_id(m.pn)) } func (m *message) SetContentType(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_content_type)) } func (m *message) SetContentEncoding(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_content_encoding)) } func (m *message) SetExpiryTime(t time.Time) { C.pn_message_set_expiry_time(m.pn, pnTime(t)) } func (m *message) SetCreationTime(t time.Time) { C.pn_message_set_creation_time(m.pn, pnTime(t)) } func (m *message) SetGroupId(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_group_id)) } func (m *message) SetGroupSequence(s int32) { C.pn_message_set_group_sequence(m.pn, C.pn_sequence_t(s)) } func (m *message) SetReplyToGroupId(s string) { C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_reply_to_group_id)) } func (m *message) SetDeliveryAnnotations(v map[AnnotationKey]interface{}) { setData(v, C.pn_message_instructions(m.pn)) } func (m *message) SetMessageAnnotations(v map[AnnotationKey]interface{}) { setData(v, C.pn_message_annotations(m.pn)) } func (m *message) SetApplicationProperties(v map[string]interface{}) { setData(v, C.pn_message_properties(m.pn)) } // Marshal body from v func (m *message) Marshal(v interface{}) { clearMarshal(v, C.pn_message_body(m.pn)) } // Unmarshal body to v, which must be a pointer to a value. See amqp.Unmarshal func (m *message) Unmarshal(v interface{}) { data := C.pn_message_body(m.pn) if C.pn_data_size(data) > 0 { C.pn_data_rewind(data) C.pn_data_next(data) unmarshal(v, data) } return } // Return the body value as an interface func (m *message) Body() (v interface{}) { m.Unmarshal(&v); return } func (m *message) Decode(data []byte) error { m.Clear() if len(data) == 0 { return fmt.Errorf("empty buffer for decode") } if C.pn_message_decode(m.pn, cPtr(data), cLen(data)) < 0 { return fmt.Errorf("decoding message: %s", PnError(C.pn_message_error(m.pn))) } return nil } func DecodeMessage(data []byte) (m Message, err error) { m = NewMessage() err = m.Decode(data) return } func (m *message) Encode(buffer []byte) ([]byte, error) { encode := func(buf []byte) ([]byte, error) { len := cLen(buf) result := C.pn_message_encode(m.pn, cPtr(buf), &len) switch { case result == C.PN_OVERFLOW: return buf, overflow case result < 0: return buf, fmt.Errorf("cannot encode message: %s", PnErrorCode(result)) default: return buf[:len], nil } } return encodeGrow(buffer, encode) } // TODO aconway 2015-09-14: Multi-section messages. // TODO aconway 2016-09-09: Message.String() use inspect. // ==== Deprecated functions func oldGetAnnotations(data *C.pn_data_t) (v map[string]interface{}) { if C.pn_data_size(data) > 0 { C.pn_data_rewind(data) C.pn_data_next(data) unmarshal(&v, data) } return v } func (m *message) Instructions() map[string]interface{} { return oldGetAnnotations(C.pn_message_instructions(m.pn)) } func (m *message) Annotations() map[string]interface{} { return oldGetAnnotations(C.pn_message_annotations(m.pn)) } func (m *message) Properties() map[string]interface{} { return oldGetAnnotations(C.pn_message_properties(m.pn)) } // Convert old string-keyed annotations to an AnnotationKey map func fixAnnotations(old map[string]interface{}) (annotations map[AnnotationKey]interface{}) { annotations = make(map[AnnotationKey]interface{}) for k, v := range old { annotations[AnnotationKeyString(k)] = v } return } func (m *message) SetInstructions(v map[string]interface{}) { setData(fixAnnotations(v), C.pn_message_instructions(m.pn)) } func (m *message) SetAnnotations(v map[string]interface{}) { setData(fixAnnotations(v), C.pn_message_annotations(m.pn)) } func (m *message) SetProperties(v map[string]interface{}) { setData(fixAnnotations(v), C.pn_message_properties(m.pn)) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal_test.go0000664000000000000000000001124213257152177024421 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp import ( "strings" "testing" ) func TestSymbolKey(t *testing.T) { bytes, err := Marshal(AnnotationKeySymbol("foo"), nil) if err != nil { t.Fatal(err) } var k AnnotationKey if _, err := Unmarshal(bytes, &k); err != nil { t.Error(err) } if err := checkEqual("foo", string(k.Get().(Symbol))); err != nil { t.Error(err) } var sym Symbol if _, err := Unmarshal(bytes, &sym); err != nil { t.Error(err) } if err := checkEqual("foo", sym.String()); err != nil { t.Error(err) } } func TestStringKey(t *testing.T) { bytes, err := Marshal(AnnotationKeyString("foo"), nil) if err != nil { t.Fatal(err) } var k AnnotationKey if _, err := Unmarshal(bytes, &k); err != nil { t.Error(err) } if err := checkEqual("foo", string(k.Get().(Symbol))); err != nil { t.Error(err) } var s string if _, err := Unmarshal(bytes, &s); err != nil { t.Error(err) } if err := checkEqual("foo", s); err != nil { t.Error(err) } } func TestIntKey(t *testing.T) { bytes, err := Marshal(AnnotationKeyUint64(12345), nil) if err != nil { t.Fatal(err) } var k AnnotationKey if _, err := Unmarshal(bytes, &k); err != nil { t.Error(err) } if 12345 != k.Get().(uint64) { t.Errorf("(%T)%v != (%T)%v", 12345, k.Get().(uint64)) } var n uint64 if _, err := Unmarshal(bytes, &n); err != nil { t.Error(err) } if 12345 != n { t.Errorf("%v != %v", 12345, k.Get().(uint64)) } } func TestMapToMap(t *testing.T) { in := Map{"k": "v", "x": "y", true: false, int8(3): uint64(24)} if bytes, err := Marshal(in, nil); err == nil { var out Map if _, err := Unmarshal(bytes, &out); err == nil { if err = checkEqual(in, out); err != nil { t.Error(err) } } else { t.Error(err) } } } func TestMapToInterface(t *testing.T) { in := Map{"k": "v", "x": "y", true: false, int8(3): uint64(24)} if bytes, err := Marshal(in, nil); err == nil { var out interface{} if _, err := Unmarshal(bytes, &out); err == nil { if err = checkEqual(in, out); err != nil { t.Error(err) } } else { t.Error(err) } } } func TestAnyMap(t *testing.T) { // nil bytes, err := Marshal(AnyMap(nil), nil) if err != nil { t.Error(err) } var out AnyMap if _, err := Unmarshal(bytes, &out); err != nil { t.Error(err) } if err = checkEqual(AnyMap(nil), out); err != nil { t.Error(err) } // empty bytes, err = Marshal(AnyMap{}, nil) if err != nil { t.Error(err) } if _, err := Unmarshal(bytes, &out); err != nil { t.Error(err) } if err = checkEqual(AnyMap(nil), out); err != nil { t.Error(err) } // with data in := AnyMap{{"k", "v"}, {true, false}} bytes, err = Marshal(in, nil) if err != nil { t.Error(err) } if _, err := Unmarshal(bytes, &out); err != nil { t.Error(err) } if err = checkEqual(in, out); err != nil { t.Error(err) } } func TestBadMap(t *testing.T) { // unmarshal map with invalid keys in := AnyMap{{"k", "v"}, {[]string{"x", "y"}, "invalid-key"}} bytes, err := Marshal(in, nil) if err != nil { t.Error(err) } m := Map{} // Should fail to unmarshal to a map if _, err := Unmarshal(bytes, &m); err != nil { if !strings.Contains(err.Error(), "key []string{\"x\", \"y\"} is not comparable") { t.Error(err) } } else { t.Error("expected error") } // Should unmarshal to an AnyMap var out AnyMap if _, err := Unmarshal(bytes, &out); err != nil { t.Error(err) } else if err = checkEqual(in, out); err != nil { t.Error(err) } // Should unmarshal to interface{} as AnyMap var v interface{} if _, err := Unmarshal(bytes, &v); err != nil { t.Error(err) } else if err = checkEqual(in, v); err != nil { t.Error(err) } // Round trip from interface to interface in = AnyMap{{[]int8{1, 2, 3}, "bad-key"}, {int16(1), "duplicate-1"}, {int16(1), "duplicate-2"}} bytes, err = Marshal(interface{}(in), nil) if err != nil { t.Error(err) } v = nil if _, err := Unmarshal(bytes, &v); err != nil { t.Error(err) } else if err = checkEqual(in, v); err != nil { t.Error(err) } } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go0000664000000000000000000002751413257152177023373 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp // #include import "C" import ( "fmt" "io" "reflect" "time" "unsafe" ) // Error returned if Go data cannot be marshaled as an AMQP type. type MarshalError struct { // The Go type. GoType reflect.Type s string } func (e MarshalError) Error() string { return e.s } func newMarshalError(v interface{}, s string) *MarshalError { t := reflect.TypeOf(v) return &MarshalError{GoType: t, s: fmt.Sprintf("cannot marshal %s: %s", t, s)} } func dataMarshalError(v interface{}, data *C.pn_data_t) error { if pe := PnError(C.pn_data_error(data)); pe != nil { return newMarshalError(v, pe.Error()) } return nil } /* Marshal encodes a Go value as AMQP data in buffer. If buffer is nil, or is not large enough, a new buffer is created. Returns the buffer used for encoding with len() adjusted to the actual size of data. Go types are encoded as follows +-------------------------------------+--------------------------------------------+ |Go type |AMQP type | +-------------------------------------+--------------------------------------------+ |bool |bool | +-------------------------------------+--------------------------------------------+ |int8, int16, int32, int64 (int) |byte, short, int, long (int or long) | +-------------------------------------+--------------------------------------------+ |uint8, uint16, uint32, uint64 (uint) |ubyte, ushort, uint, ulong (uint or ulong) | +-------------------------------------+--------------------------------------------+ |float32, float64 |float, double. | +-------------------------------------+--------------------------------------------+ |string |string | +-------------------------------------+--------------------------------------------+ |[]byte, Binary |binary | +-------------------------------------+--------------------------------------------+ |Symbol |symbol | +-------------------------------------+--------------------------------------------+ |Char |char | +-------------------------------------+--------------------------------------------+ |interface{} |the contained type | +-------------------------------------+--------------------------------------------+ |nil |null | +-------------------------------------+--------------------------------------------+ |map[K]T |map with K and T converted as above | +-------------------------------------+--------------------------------------------+ |Map |map, may have mixed types for keys, values | +-------------------------------------+--------------------------------------------+ |AnyMap |map (See AnyMap) | +-------------------------------------+--------------------------------------------+ |List, []interface{} |list, may have mixed-type values | +-------------------------------------+--------------------------------------------+ |[]T, [N]T |array, T is mapped as per this table | +-------------------------------------+--------------------------------------------+ |Described |described type | +-------------------------------------+--------------------------------------------+ |time.Time |timestamp | +-------------------------------------+--------------------------------------------+ |UUID |uuid | +-------------------------------------+--------------------------------------------+ The following Go types cannot be marshaled: uintptr, function, channel, struct, complex64/128 AMQP types not yet supported: decimal32/64/128 */ func Marshal(v interface{}, buffer []byte) (outbuf []byte, err error) { data := C.pn_data(0) defer C.pn_data_free(data) if err = recoverMarshal(v, data); err != nil { return buffer, err } encode := func(buf []byte) ([]byte, error) { n := int(C.pn_data_encode(data, cPtr(buf), cLen(buf))) switch { case n == int(C.PN_OVERFLOW): return buf, overflow case n < 0: return buf, dataMarshalError(v, data) default: return buf[:n], nil } } return encodeGrow(buffer, encode) } // Internal use only func MarshalUnsafe(v interface{}, pnData unsafe.Pointer) (err error) { return recoverMarshal(v, (*C.pn_data_t)(pnData)) } func recoverMarshal(v interface{}, data *C.pn_data_t) (err error) { defer func() { // Convert panic to error return if r := recover(); r != nil { if err2, ok := r.(*MarshalError); ok { err = err2 // Convert internal panic to error } else { panic(r) // Unrecognized error, continue to panic } } }() marshal(v, data) // Panics on error return } const minEncode = 256 // overflow is returned when an encoding function can't fit data in the buffer. var overflow = fmt.Errorf("buffer too small") // encodeFn encodes into buffer[0:len(buffer)]. // Returns buffer with length adjusted for data encoded. // If buffer too small, returns overflow as error. type encodeFn func(buffer []byte) ([]byte, error) // encodeGrow calls encode() into buffer, if it returns overflow grows the buffer. // Returns the final buffer. func encodeGrow(buffer []byte, encode encodeFn) ([]byte, error) { if buffer == nil || len(buffer) == 0 { buffer = make([]byte, minEncode) } var err error for buffer, err = encode(buffer); err == overflow; buffer, err = encode(buffer) { buffer = make([]byte, 2*len(buffer)) } return buffer, err } // Marshal v to data func marshal(i interface{}, data *C.pn_data_t) { switch v := i.(type) { case nil: C.pn_data_put_null(data) case bool: C.pn_data_put_bool(data, C.bool(v)) // Signed integers case int8: C.pn_data_put_byte(data, C.int8_t(v)) case int16: C.pn_data_put_short(data, C.int16_t(v)) case int32: C.pn_data_put_int(data, C.int32_t(v)) case int64: C.pn_data_put_long(data, C.int64_t(v)) case int: if intIs64 { C.pn_data_put_long(data, C.int64_t(v)) } else { C.pn_data_put_int(data, C.int32_t(v)) } // Unsigned integers case uint8: C.pn_data_put_ubyte(data, C.uint8_t(v)) case uint16: C.pn_data_put_ushort(data, C.uint16_t(v)) case uint32: C.pn_data_put_uint(data, C.uint32_t(v)) case uint64: C.pn_data_put_ulong(data, C.uint64_t(v)) case uint: if intIs64 { C.pn_data_put_ulong(data, C.uint64_t(v)) } else { C.pn_data_put_uint(data, C.uint32_t(v)) } // Floating point case float32: C.pn_data_put_float(data, C.float(v)) case float64: C.pn_data_put_double(data, C.double(v)) // String-like (string, binary, symbol) case string: C.pn_data_put_string(data, pnBytes([]byte(v))) case []byte: C.pn_data_put_binary(data, pnBytes(v)) case Binary: C.pn_data_put_binary(data, pnBytes([]byte(v))) case Symbol: C.pn_data_put_symbol(data, pnBytes([]byte(v))) // Other simple types case time.Time: C.pn_data_put_timestamp(data, C.pn_timestamp_t(v.UnixNano()/1000)) case UUID: C.pn_data_put_uuid(data, *(*C.pn_uuid_t)(unsafe.Pointer(&v[0]))) case Char: C.pn_data_put_char(data, (C.pn_char_t)(v)) // Described types case Described: C.pn_data_put_described(data) C.pn_data_enter(data) marshal(v.Descriptor, data) marshal(v.Value, data) C.pn_data_exit(data) // Restricted type annotation-key, marshals as contained value case AnnotationKey: marshal(v.Get(), data) // Special type to represent AMQP maps with keys that are illegal in Go case AnyMap: C.pn_data_put_map(data) C.pn_data_enter(data) defer C.pn_data_exit(data) for _, kv := range v { marshal(kv.Key, data) marshal(kv.Value, data) } default: // Examine complex types (Go map, slice, array) by reflected structure switch reflect.TypeOf(i).Kind() { case reflect.Map: m := reflect.ValueOf(v) C.pn_data_put_map(data) if C.pn_data_enter(data) { defer C.pn_data_exit(data) } else { panic(dataMarshalError(i, data)) } for _, key := range m.MapKeys() { marshal(key.Interface(), data) marshal(m.MapIndex(key).Interface(), data) } case reflect.Slice, reflect.Array: // Note: Go array and slice are mapped the same way: // if element type is an interface, map to AMQP list (mixed type) // if element type is a non-interface type map to AMQP array (single type) s := reflect.ValueOf(v) if pnType, ok := arrayTypeMap[s.Type().Elem()]; ok { C.pn_data_put_array(data, false, pnType) } else { C.pn_data_put_list(data) } C.pn_data_enter(data) defer C.pn_data_exit(data) for j := 0; j < s.Len(); j++ { marshal(s.Index(j).Interface(), data) } default: panic(newMarshalError(v, "no conversion")) } } if err := dataMarshalError(i, data); err != nil { panic(err) } } // Mapping froo Go element type to AMQP array type for types that can go in an AMQP array // NOTE: this must be kept consistent with marshal() which does the actual marshalling. var arrayTypeMap = map[reflect.Type]C.pn_type_t{ nil: C.PN_NULL, reflect.TypeOf(true): C.PN_BOOL, reflect.TypeOf(int8(0)): C.PN_BYTE, reflect.TypeOf(int16(0)): C.PN_INT, reflect.TypeOf(int32(0)): C.PN_SHORT, reflect.TypeOf(int64(0)): C.PN_LONG, reflect.TypeOf(uint8(0)): C.PN_UBYTE, reflect.TypeOf(uint16(0)): C.PN_UINT, reflect.TypeOf(uint32(0)): C.PN_USHORT, reflect.TypeOf(uint64(0)): C.PN_ULONG, reflect.TypeOf(float32(0)): C.PN_FLOAT, reflect.TypeOf(float64(0)): C.PN_DOUBLE, reflect.TypeOf(""): C.PN_STRING, reflect.TypeOf((*Symbol)(nil)).Elem(): C.PN_SYMBOL, reflect.TypeOf((*Binary)(nil)).Elem(): C.PN_BINARY, reflect.TypeOf([]byte{}): C.PN_BINARY, reflect.TypeOf((*time.Time)(nil)).Elem(): C.PN_TIMESTAMP, reflect.TypeOf((*UUID)(nil)).Elem(): C.PN_UUID, reflect.TypeOf((*Char)(nil)).Elem(): C.PN_CHAR, } // Compute mapping of int/uint at runtime as they depend on execution environment. func init() { if intIs64 { arrayTypeMap[reflect.TypeOf(int(0))] = C.PN_LONG arrayTypeMap[reflect.TypeOf(uint(0))] = C.PN_ULONG } else { arrayTypeMap[reflect.TypeOf(int(0))] = C.PN_INT arrayTypeMap[reflect.TypeOf(uint(0))] = C.PN_UINT } } func clearMarshal(v interface{}, data *C.pn_data_t) { C.pn_data_clear(data) marshal(v, data) } // Encoder encodes AMQP values to an io.Writer type Encoder struct { writer io.Writer buffer []byte } // New encoder returns a new encoder that writes to w. func NewEncoder(w io.Writer) *Encoder { return &Encoder{w, make([]byte, minEncode)} } func (e *Encoder) Encode(v interface{}) (err error) { e.buffer, err = Marshal(v, e.buffer) if err == nil { _, err = e.writer.Write(e.buffer) } return err } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go0000664000000000000000000002166313257152177024462 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Test that conversion of Go type to/from AMQP is compatible with other // bindings. // package amqp import ( "bytes" "io" "io/ioutil" "os" "reflect" "strings" "testing" ) var skipped = false func getReader(t *testing.T, name string) (r io.Reader) { dir := os.Getenv("PN_INTEROP_DIR") if dir == "" { if !skipped { skipped = true // Don't keep repeating t.Skip("no PN_INTEROP_DIR in environment") } else { t.SkipNow() } } r, err := os.Open(dir + "/" + name + ".amqp") if err != nil { t.Fatalf("can't open %#v: %v", name, err) } return } func remaining(d *Decoder) string { remainder, _ := ioutil.ReadAll(io.MultiReader(d.Buffered(), d.reader)) return string(remainder) } // checkDecode: want is the expected value, gotPtr is a pointer to a // instance of the same type for Decode. func checkDecode(d *Decoder, want interface{}, gotPtr interface{}, t *testing.T) { if err := d.Decode(gotPtr); err != nil { t.Error("Decode failed", err) return } got := reflect.ValueOf(gotPtr).Elem().Interface() if err := checkEqual(want, got); err != nil { t.Error("Decode bad value:", err) return } // Try round trip encoding bytes, err := Marshal(want, nil) if err != nil { t.Error("Marshal failed", err) return } n, err := Unmarshal(bytes, gotPtr) if err != nil { t.Error("Unmarshal failed", err) return } if err := checkEqual(n, len(bytes)); err != nil { t.Error("Bad unmarshal length", err) return } got = reflect.ValueOf(gotPtr).Elem().Interface() if err = checkEqual(want, got); err != nil { t.Error("Bad unmarshal value", err) return } } func TestUnmarshal(t *testing.T) { bytes, err := ioutil.ReadAll(getReader(t, "strings")) if err != nil { t.Error(err) } for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} { var got string n, err := Unmarshal(bytes, &got) if err != nil { t.Error(err) } if want != got { t.Errorf("%#v != %#v", want, got) } bytes = bytes[n:] } } func TestPrimitivesExact(t *testing.T) { d := NewDecoder(getReader(t, "primitives")) // Decoding into exact types var b bool checkDecode(d, true, &b, t) checkDecode(d, false, &b, t) var u8 uint8 checkDecode(d, uint8(42), &u8, t) var u16 uint16 checkDecode(d, uint16(42), &u16, t) var i16 int16 checkDecode(d, int16(-42), &i16, t) var u32 uint32 checkDecode(d, uint32(12345), &u32, t) var i32 int32 checkDecode(d, int32(-12345), &i32, t) var u64 uint64 checkDecode(d, uint64(12345), &u64, t) var i64 int64 checkDecode(d, int64(-12345), &i64, t) var f32 float32 checkDecode(d, float32(0.125), &f32, t) var f64 float64 checkDecode(d, float64(0.125), &f64, t) } func TestPrimitivesCompatible(t *testing.T) { d := NewDecoder(getReader(t, "primitives")) // Decoding into compatible types var b bool var i int var u uint var f float64 checkDecode(d, true, &b, t) checkDecode(d, false, &b, t) checkDecode(d, uint(42), &u, t) checkDecode(d, uint(42), &u, t) checkDecode(d, -42, &i, t) checkDecode(d, uint(12345), &u, t) checkDecode(d, -12345, &i, t) checkDecode(d, uint(12345), &u, t) checkDecode(d, -12345, &i, t) checkDecode(d, 0.125, &f, t) checkDecode(d, 0.125, &f, t) } // checkDecodeValue: want is the expected value, decode into a reflect.Value func checkDecodeInterface(d *Decoder, want interface{}, t *testing.T) { var got, got2 interface{} if err := d.Decode(&got); err != nil { t.Error("Decode failed", err) return } if err := checkEqual(want, got); err != nil { t.Error(err) return } // Try round trip encoding bytes, err := Marshal(got, nil) if err != nil { t.Error(err) return } n, err := Unmarshal(bytes, &got2) if err != nil { t.Error(err) return } if err := checkEqual(n, len(bytes)); err != nil { t.Error(err) return } if err := checkEqual(want, got2); err != nil { t.Error(err) return } } func TestPrimitivesInterface(t *testing.T) { d := NewDecoder(getReader(t, "primitives")) checkDecodeInterface(d, true, t) checkDecodeInterface(d, false, t) checkDecodeInterface(d, uint8(42), t) checkDecodeInterface(d, uint16(42), t) checkDecodeInterface(d, int16(-42), t) checkDecodeInterface(d, uint32(12345), t) checkDecodeInterface(d, int32(-12345), t) checkDecodeInterface(d, uint64(12345), t) checkDecodeInterface(d, int64(-12345), t) checkDecodeInterface(d, float32(0.125), t) checkDecodeInterface(d, float64(0.125), t) } func TestStrings(t *testing.T) { d := NewDecoder(getReader(t, "strings")) // Test decoding as plain Go strings for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} { var got string checkDecode(d, want, &got, t) } remains := remaining(d) if remains != "" { t.Errorf("leftover: %s", remains) } // Test decoding as specific string types d = NewDecoder(getReader(t, "strings")) var bytes []byte var str, sym string checkDecode(d, []byte("abc\000defg"), &bytes, t) checkDecode(d, "abcdefg", &str, t) checkDecode(d, "abcdefg", &sym, t) checkDecode(d, make([]byte, 0), &bytes, t) checkDecode(d, "", &str, t) checkDecode(d, "", &sym, t) remains = remaining(d) if remains != "" { t.Fatalf("leftover: %s", remains) } // Test some error handling d = NewDecoder(getReader(t, "strings")) var s string err := d.Decode(s) if err == nil { t.Fatal("Expected error") } if !strings.Contains(err.Error(), "not a pointer") { t.Error(err) } var i int err = d.Decode(&i) if !strings.Contains(err.Error(), "cannot unmarshal") { t.Error(err) } _, err = Unmarshal([]byte{}, nil) if err := checkEqual(err, EndOfData); err != nil { t.Error(err) } _, err = Unmarshal([]byte("foobar"), nil) if !strings.Contains(err.Error(), "invalid-argument") { t.Error(err) } } func TestEncodeDecode(t *testing.T) { type data struct { s string i int u8 uint8 b bool f float32 v interface{} } in := data{"foo", 42, 9, true, 1.234, "thing"} buf := bytes.Buffer{} e := NewEncoder(&buf) if err := e.Encode(in.s); err != nil { t.Error(err) } if err := e.Encode(in.i); err != nil { t.Error(err) } if err := e.Encode(in.u8); err != nil { t.Error(err) } if err := e.Encode(in.b); err != nil { t.Error(err) } if err := e.Encode(in.f); err != nil { t.Error(err) } if err := e.Encode(in.v); err != nil { t.Error(err) } var out data d := NewDecoder(&buf) if err := d.Decode(&out.s); err != nil { t.Error(err) } if err := d.Decode(&out.i); err != nil { t.Error(err) } if err := d.Decode(&out.u8); err != nil { t.Error(err) } if err := d.Decode(&out.b); err != nil { t.Error(err) } if err := d.Decode(&out.f); err != nil { t.Error(err) } if err := d.Decode(&out.v); err != nil { t.Error(err) } if err := checkEqual(in, out); err != nil { t.Error(err) } } func TestMap(t *testing.T) { d := NewDecoder(getReader(t, "maps")) // Generic map var m Map checkDecode(d, Map{"one": int32(1), "two": int32(2), "three": int32(3)}, &m, t) // Interface as map var i interface{} checkDecode(d, Map{int32(1): "one", int32(2): "two", int32(3): "three"}, &i, t) d = NewDecoder(getReader(t, "maps")) // Specific typed map var m2 map[string]int checkDecode(d, map[string]int{"one": 1, "two": 2, "three": 3}, &m2, t) // Nested map m = Map{int64(1): "one", "two": int32(2), true: Map{uint8(1): true, uint8(2): false}} bytes, err := Marshal(m, nil) if err != nil { t.Fatal(err) } _, err = Unmarshal(bytes, &i) if err != nil { t.Fatal(err) } if err = checkEqual(m, i); err != nil { t.Fatal(err) } } func TestList(t *testing.T) { d := NewDecoder(getReader(t, "lists")) var l List checkDecode(d, List{int32(32), "foo", true}, &l, t) checkDecode(d, List{}, &l, t) } // TODO aconway 2015-09-08: the message.amqp file seems to be incorrectly coded as // as an AMQP string *inside* an AMQP binary?? Skip the test for now. func TODO_TestMessage(t *testing.T) { bytes, err := ioutil.ReadAll(getReader(t, "message")) if err != nil { t.Fatal(err) } m, err := DecodeMessage(bytes) if err != nil { t.Fatal(err) } else { if err := checkEqual(m.Body(), "hello"); err != nil { t.Error(err) } } m2 := NewMessageWith("hello") bytes2, err := m2.Encode(nil) if err != nil { t.Error(err) } else { if err = checkEqual(bytes, bytes2); err != nil { t.Error(err) } } } // TODO aconway 2015-03-13: finish the full interop test qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/error.go0000664000000000000000000000623013257152177023065 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package amqp // #include import "C" import ( "fmt" "reflect" ) // Error is an AMQP error condition. It has a name and a description. // It implements the Go error interface so can be returned as an error value. // // You can pass amqp.Error to methods that send an error to a remote endpoint, // this gives you full control over what the remote endpoint will see. // // You can also pass any Go error to such functions, the remote peer // will see the equivalent of MakeError(error) // type Error struct{ Name, Description string } // Error implements the Go error interface for AMQP error errors. func (c Error) Error() string { return fmt.Sprintf("%s: %s", c.Name, c.Description) } // Errorf makes a Error with name and formatted description as per fmt.Sprintf func Errorf(name, format string, arg ...interface{}) Error { return Error{name, fmt.Sprintf(format, arg...)} } // MakeError makes an AMQP error from a go error using the Go error type as the name // and the err.Error() string as the description. func MakeError(err error) Error { return Error{reflect.TypeOf(err).Name(), err.Error()} } var ( InternalError = "amqp:internal-error" NotFound = "amqp:not-found" UnauthorizedAccess = "amqp:unauthorized-access" DecodeError = "amqp:decode-error" ResourceLimitExceeded = "amqp:resource-limit-exceeded" NotAllowed = "amqp:not-allowed" InvalidField = "amqp:invalid-field" NotImplemented = "amqp:not-implemented" ResourceLocked = "amqp:resource-locked" PreconditionFailed = "amqp:precondition-failed" ResourceDeleted = "amqp:resource-deleted" IllegalState = "amqp:illegal-state" FrameSizeTooSmall = "amqp:frame-size-too-small" ) type PnErrorCode int func (e PnErrorCode) String() string { switch e { case C.PN_EOS: return "end-of-data" case C.PN_ERR: return "error" case C.PN_OVERFLOW: return "overflow" case C.PN_UNDERFLOW: return "underflow" case C.PN_STATE_ERR: return "bad-state" case C.PN_ARG_ERR: return "invalid-argument" case C.PN_TIMEOUT: return "timeout" case C.PN_INTR: return "interrupted" case C.PN_INPROGRESS: return "in-progress" default: return fmt.Sprintf("unknown-error(%d)", e) } } func PnError(e *C.pn_error_t) error { if e == nil || C.pn_error_code(e) == 0 { return nil } return fmt.Errorf("%s: %s", PnErrorCode(C.pn_error_code(e)), C.GoString(C.pn_error_text(e))) } qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/amqp/doc.go0000664000000000000000000000255713257152177022511 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package amqp encodes and decodes AMQP 1.0 messages and data types as Go types. It follows the standard 'encoding' libraries pattern. The mapping between AMQP and Go types is described in the documentation of the Marshal and Unmarshal functions. This package requires the [proton-C library](http://qpid.apache.org/proton) to be installed. Package 'electron' is a full AMQP 1.0 client/server toolkit using this package. AMQP 1.0 is an open standard for inter-operable message exchange, see */ package amqp // #cgo LDFLAGS: -lqpid-proton-core import "C" // This file is just for the package comment. qpid-proton-0.22.0/proton-c/bindings/go/src/qpid.apache.org/README.md0000664000000000000000000001271013257152177021726 0ustar # Qpid Go packages for AMQP These packages provide [Go](http://golang.org) support for sending and receiving AMQP messages in client or server applications. Reference documentation is available at: They require the [proton-C library and header files](http://qpid.apache.org/proton) to be installed. On many platforms it is available pre-packaged, for example on Fedora dnf install qpid-proton-c-devel If you built proton from source, you can set environment variables to find the built libraries and headers as follows: source /config.sh If you have installed the library and headers in non-standard directories, then add them to the following environment variables: LD_LIBRARY_PATH # directory containing the library LIBRARY_PATH # directory containing the library C_INCLUDE_PATH # directory containing the proton/ subdirectory with header files There are 3 packages: [qpid.apache.org/amqp](http://godoc.org/qpid.apache.org/amqp) provides functions to convert AMQP messages and data types to and from Go data types. Used by both the proton and electron packages to manage AMQP data. [qpid.apache.org/electron](http://godoc.org/qpid.apache.org/electron) is a simple, concurrent-safe API for sending and receiving messages. It can be used with goroutines and channels to build concurrent AMQP clients and servers. [qpid.apache.org/proton](http://godoc.org/qpid.apache.org/proton) is an event-driven, concurrent-unsafe package that closely follows the proton C API. Most Go programmers will find the [electron](http://godoc.org/qpid.apache.org/electron) package easier to use. See the [examples](https://github.com/apache/qpid-proton/blob/master/examples/go/README.md) to help you get started. Feedback is encouraged at: - Email - Create issues , attach patches to an issue. ### Why two APIs? The `proton` API is a direct mapping of the proton C library into Go. It is usable but not very natural for a Go programmer because it takes an *event-driven* approach and has no built-in support for concurrent use. `electron` uses `proton` internally but provides a more Go-like API that is safe to use from multiple concurrent goroutines. Go encourages programs to be structured as concurrent *goroutines* that communicate via *channels*. Go literature distinguishes between: - *concurrency*: "keeping track of things that could be done in parallel" - *parallelism*: "actually doing things in parallel on multiple CPUs or cores" A Go program expresses concurrency by starting goroutines for potentially concurrent tasks. The Go runtime schedules the activity of goroutines onto a small number (possibly one) of actual parallel executions. Even with no hardware parallelism, goroutine concurrency lets the Go runtime order unpredictable events like file descriptors being readable/writable, channels having data, timers firing etc. Go automatically takes care of switching out goroutines that block or sleep so it is normal to write code in terms of blocking calls. By contrast, event-driven programming is based on polling mechanisms like `select`, `poll` or `epoll`. These also dispatch unpredictably ordered events to a single thread or a small thread pool. However this requires a different style of programming: "event-driven" or "reactive" programming. Go developers call it "inside-out" programming. In an event-driven program blocking is a big problem as it consumes a scarce thread of execution, so actions that take time to complete have to be re-structured in terms of multiple events. The promise of Go is that you can express your program in concurrent, sequential terms and the Go runtime will turn it inside-out for you. You can start goroutines for all concurrent activities. They can loop forever or block for as long as they need waiting for timers, IO or any unpredictable event. Go will interleave and schedule them efficiently onto the available parallel hardware. For example: in the `electron` API, you can send a message and wait for it to be acknowledged in a single function. All the information about the message, why you sent it, and what to do when it is acknowledged can be held in local variables, all the code is in a simple sequence. Other goroutines in your program can be sending and receiving messages concurrently, they are not blocked. In the `proton` API, an event handler that sends a message must return *immediately*, it cannot block the event loop to wait for acknowledgement. Acknowledgement is a separate event, so the code for handling it is in a different event handler. Context information about the message has to be stored in some non-local variable that both functions can find. This makes the code harder to follow. The `proton` API is important because it is the foundation for the `electron` API, and may be useful for programs that need to be close to the original C library for some reason. However the `electron` API hides the event-driven details behind simple, sequential, concurrent-safe methods that can be called from arbitrary goroutines. Under the covers, data is passed through channels to dedicated `proton` goroutines so user goroutines can work concurrently with the proton event-loop. ## New to Go? If you are new to Go then these are a good place to start: - [A Tour of Go](http://tour.golang.org) - [Effective Go](http://golang.org/doc/effective_go.html) Then look at the tools and docs at as you need them. qpid-proton-0.22.0/proton-c/bindings/go/genwrap.go0000664000000000000000000003251513257152177016714 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generator to generate a thin Go wrapper API around the C proton API. // // Not run automatically, generated sources are checked in. To update the // generated sources run `go run genwrap.go` in this directory. // // WARNING: generating code from the wrong proton header file versions // will break compatibility guarantees. This program will attempt to detect // such errors. If you are deliberately changing the compatibility requirements // update the variable minVersion below. // package main import ( "flag" "fmt" "io" "io/ioutil" "os" "os/exec" "path" "regexp" "strings" "text/template" ) var minVersion = "0.10" // The minimum version of proton-c that the Go binding can use var include = flag.String("include", "../../include", "Directory containing proton/*.h include files") var versionH = regexp.MustCompile("(?s:PN_VERSION_MAJOR ([0-9]+).*PN_VERSION_MINOR ([0-9]+))") var versionTxt = regexp.MustCompile("^[0-9]+\\.[0-9]+") func main() { flag.Parse() genVersion() genWrappers() } func getVersion() string { _, err := ioutil.ReadFile(path.Join(*include, "proton/version.h.in")) if err == nil { // We are using the headers in git sources, get the version.txt vt, err := ioutil.ReadFile(path.Join(*include, "../../version.txt")) panicIf(err) return versionTxt.FindString(string(vt)) } vh, err := ioutil.ReadFile(path.Join(*include, "proton/version.h")) if err == nil { // We are using installed headers return strings.Join(versionH.FindStringSubmatch(string(vh))[1:], ".") } panic(err) } func genVersion() { version := getVersion() if minVersion != version { panic(fmt.Errorf("Generating from wrong version %v, expected %v", version, minVersion)) } out, err := os.Create("src/qpid.apache.org/amqp/version.go") panicIf(err) defer out.Close() splitVersion := strings.Split(minVersion, ".") fmt.Fprintf(out, copyright+` package amqp // Version check for proton library. // Done here because this is the lowest-level dependency for all the proton Go packages. // #include // #if PN_VERSION_MAJOR == %s && PN_VERSION_MINOR < %s // #error packages qpid.apache.org/... require Proton-C library version 0.10 or greater // #endif import "C" `, splitVersion[0], splitVersion[1]) } func genWrappers() { outPath := "src/qpid.apache.org/proton/wrappers_gen.go" out, err := os.Create(outPath) panicIf(err) defer out.Close() apis := []string{"session", "link", "delivery", "disposition", "condition", "terminus", "connection", "transport", "sasl"} fmt.Fprintln(out, copyright) fmt.Fprint(out, ` package proton import ( "time" "unsafe" ) // #include // #include // #include // #include // #include import "C" `) for _, api := range apis { fmt.Fprintf(out, "// #include \n", api) } fmt.Fprintln(out, `import "C"`) event(out) for _, api := range apis { fmt.Fprintf(out, "// Wrappers for declarations in %s.h\n\n", api) header := readHeader(api) enums := findEnums(header) for _, e := range enums { genEnum(out, e.Name, e.Values) } apiWrapFns(api, header, out) } out.Close() if err := exec.Command("gofmt", "-w", outPath).Run(); err != nil { fmt.Fprintf(os.Stderr, "gofmt: %s", err) os.Exit(1) } } // Identify acronyms that should be uppercase not Mixedcase var acronym = regexp.MustCompile("(?i)SASL|AMQP") func mixedCase(s string) string { result := "" for _, w := range strings.Split(s, "_") { if acronym.MatchString(w) { w = strings.ToUpper(w) } else { w = strings.ToUpper(w[0:1]) + strings.ToLower(w[1:]) } result = result + w } return result } func mixedCaseTrim(s, prefix string) string { return mixedCase(strings.TrimPrefix(s, prefix)) } var templateFuncs = template.FuncMap{"mixedCase": mixedCase, "mixedCaseTrim": mixedCaseTrim} func doTemplate(out io.Writer, data interface{}, tmpl string) { panicIf(template.Must(template.New("").Funcs(templateFuncs).Parse(tmpl)).Execute(out, data)) } type enumType struct { Name string Values []string } // Find enums in a header file return map of enum name to values. func findEnums(header string) (enums []enumType) { for _, enum := range enumDefRe.FindAllStringSubmatch(header, -1) { enums = append(enums, enumType{enum[2], enumValRe.FindAllString(enum[1], -1)}) } return enums } // Types that are integral, not wrappers. Enums are added automatically. var simpleType = map[string]bool{ "State": true, // integral typedef } func genEnum(out io.Writer, name string, values []string) { simpleType[mixedCase(name)] = true doTemplate(out, []interface{}{name, values}, ` {{$enumName := index . 0}}{{$values := index . 1}} type {{mixedCase $enumName}} C.pn_{{$enumName}}_t const ({{range $values}} {{mixedCaseTrim . "PN_"}} {{mixedCase $enumName}} = C.{{.}} {{end}} ) func (e {{mixedCase $enumName}}) String() string { switch e { {{range $values}} case C.{{.}}: return "{{mixedCaseTrim . "PN_"}}" {{end}} } return "unknown" } `) } func panicIf(err error) { if err != nil { panic(err) } } func readHeader(name string) string { s, err := ioutil.ReadFile(path.Join(*include, "proton", name+".h")) panicIf(err) return string(s) } var copyright string = `/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // NOTE: DO NOT EDIT. This file was generated by genwrap.go from the proton header files. // Update the generator and re-run if you need to modify this code. // ` type eventType struct { // C, function and interface names for the event Name, Cname, Fname, Iname string } func newEventType(cName string) eventType { var etype eventType etype.Cname = cName etype.Name = mixedCaseTrim(cName, "PN_") etype.Fname = "On" + etype.Name etype.Iname = etype.Fname + "Interface" return etype } var ( enumDefRe = regexp.MustCompile("typedef enum {([^}]*)} pn_([a-z_]+)_t;") enumValRe = regexp.MustCompile("PN_[A-Z_]+") skipEventRe = regexp.MustCompile("EVENT_NONE|REACTOR|SELECTABLE|TIMER") skipFnRe = regexp.MustCompile("attach|context|class|collect|link_recv|link_send|transport_.*logf$|transport_.*trace|transport_head|transport_tail|transport_push|connection_set_password|link_get_drain") ) // Generate event wrappers. func event(out io.Writer) { event_h := readHeader("event") // Event is implemented by hand in wrappers.go // Get all the pn_event_type_t enum values var etypes []eventType enums := findEnums(event_h) for _, e := range enums[0].Values { if skipEventRe.FindStringSubmatch(e) == nil { etypes = append(etypes, newEventType(e)) } } doTemplate(out, etypes, ` type EventType int const ({{range .}} E{{.Name}} EventType = C.{{.Cname}}{{end}} ) `) doTemplate(out, etypes, ` func (e EventType) String() string { switch e { {{range .}} case C.{{.Cname}}: return "{{.Name}}"{{end}} } return "Unknown" } `) } type genType struct { Ctype, Gotype string ToGo func(value string) string ToC func(value string) string Assign func(value string) string } func (g genType) printBody(out io.Writer, value string) { if g.Gotype != "" { fmt.Fprintf(out, "return %s", g.ToGo(value)) } else { fmt.Fprintf(out, "%s", value) } } func (g genType) goLiteral(value string) string { return fmt.Sprintf("%s{%s}", g.Gotype, value) } func (g genType) goConvert(value string) string { switch g.Gotype { case "string": return fmt.Sprintf("C.GoString(%s)", value) case "Event": return fmt.Sprintf("makeEvent(%s)", value) default: return fmt.Sprintf("%s(%s)", g.Gotype, value) } } func mapType(ctype string) (g genType) { g.Ctype = "C." + strings.Trim(ctype, " \n") // Special-case mappings for C types, default: is the general wrapper type case. switch g.Ctype { case "C.void": g.Gotype = "" case "C.size_t": g.Gotype = "uint" case "C.int": g.Gotype = "int" case "C.void *": g.Gotype = "unsafe.Pointer" g.Ctype = "unsafe.Pointer" case "C.bool": g.Gotype = "bool" case "C.ssize_t": g.Gotype = "int" case "C.uint64_t": g.Gotype = "uint64" case "C.uint32_t": g.Gotype = "uint16" case "C.uint16_t": g.Gotype = "uint32" case "C.const char *": fallthrough case "C.char *": g.Gotype = "string" g.Ctype = "C.CString" g.ToC = func(v string) string { return fmt.Sprintf("%sC", v) } g.Assign = func(v string) string { return fmt.Sprintf("%sC := C.CString(%s)\n defer C.free(unsafe.Pointer(%sC))\n", v, v, v) } case "C.pn_seconds_t": g.Gotype = "time.Duration" g.ToGo = func(v string) string { return fmt.Sprintf("(time.Duration(%s) * time.Second)", v) } g.ToC = func(v string) string { return fmt.Sprintf("C.pn_seconds_t(%s/time.Second)", v) } case "C.pn_millis_t": g.Gotype = "time.Duration" g.ToGo = func(v string) string { return fmt.Sprintf("(time.Duration(%s) * time.Millisecond)", v) } g.ToC = func(v string) string { return fmt.Sprintf("C.pn_millis_t(%s/time.Millisecond)", v) } case "C.pn_timestamp_t": g.Gotype = "time.Time" g.ToC = func(v string) string { return fmt.Sprintf("pnTime(%s)", v) } g.ToGo = func(v string) string { return fmt.Sprintf("goTime(%s)", v) } case "C.pn_error_t *": g.Gotype = "error" g.ToGo = func(v string) string { return fmt.Sprintf("PnError(%s)", v) } default: pnId := regexp.MustCompile(" *pn_([a-z_]+)_t *\\*? *") match := pnId.FindStringSubmatch(g.Ctype) if match == nil { panic(fmt.Errorf("unknown C type %#v", g.Ctype)) } g.Gotype = mixedCase(match[1]) if !simpleType[g.Gotype] { g.ToGo = g.goLiteral g.ToC = func(v string) string { return v + ".pn" } } } if g.ToGo == nil { g.ToGo = g.goConvert // Use conversion by default. } if g.ToC == nil { g.ToC = func(v string) string { return fmt.Sprintf("%s(%s)", g.Ctype, v) } } return } type genArg struct { Name string genType } var typeNameRe = regexp.MustCompile("^(.*( |\\*))([^ *]+)$") func splitArgs(argstr string) []genArg { argstr = strings.Trim(argstr, " \n") if argstr == "" { return []genArg{} } args := make([]genArg, 0) for _, item := range strings.Split(argstr, ",") { item = strings.Trim(item, " \n") typeName := typeNameRe.FindStringSubmatch(item) if typeName == nil { panic(fmt.Errorf("Can't split argument type/name %#v", item)) } cType := strings.Trim(typeName[1], " \n") name := strings.Trim(typeName[3], " \n") if name == "type" { name = "type_" } args = append(args, genArg{name, mapType(cType)}) } return args } func goArgs(args []genArg) string { l := "" for i, arg := range args { if i != 0 { l += ", " } l += arg.Name + " " + arg.Gotype } return l } func cArgs(args []genArg) string { l := "" for _, arg := range args { l += fmt.Sprintf(", %s", arg.ToC(arg.Name)) } return l } func cAssigns(args []genArg) string { l := "\n" for _, arg := range args { if arg.Assign != nil { l += fmt.Sprintf("%s\n", arg.Assign(arg.Name)) } } return l } // Return the go name of the function or "" to skip the function. func goFnName(api, fname string) string { // Skip class, context and attachment functions. if skipFnRe.FindStringSubmatch(api+"_"+fname) != nil { return "" } return mixedCaseTrim(fname, "get_") } func apiWrapFns(api, header string, out io.Writer) { fmt.Fprintf(out, "type %s struct{pn *C.pn_%s_t}\n", mixedCase(api), api) fmt.Fprintf(out, "func (%c %s) IsNil() bool { return %c.pn == nil }\n", api[0], mixedCase(api), api[0]) fmt.Fprintf(out, "func (%c %s) CPtr() unsafe.Pointer { return unsafe.Pointer(%c.pn) }\n", api[0], mixedCase(api), api[0]) fn := regexp.MustCompile(fmt.Sprintf(`PN_EXTERN ([a-z0-9_ ]+ *\*?) *pn_%s_([a-z_]+)\(pn_%s_t *\*[a-z_]+ *,? *([^)]*)\)`, api, api)) for _, m := range fn.FindAllStringSubmatch(header, -1) { rtype, fname, argstr := mapType(m[1]), m[2], m[3] gname := goFnName(api, fname) if gname == "" { // Skip continue } args := splitArgs(argstr) fmt.Fprintf(out, "func (%c %s) %s", api[0], mixedCase(api), gname) fmt.Fprintf(out, "(%s) %s { ", goArgs(args), rtype.Gotype) fmt.Fprint(out, cAssigns(args)) rtype.printBody(out, fmt.Sprintf("C.pn_%s_%s(%c.pn%s)", api, fname, api[0], cArgs(args))) fmt.Fprintf(out, "}\n") } } qpid-proton-0.22.0/proton-c/bindings/go/CMakeLists.txt0000664000000000000000000000671313257152177017463 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Go version execute_process(COMMAND ${GO_EXE} version OUTPUT_VARIABLE go_ver OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Found Go: ${GO_EXE} (${go_ver})") # NOTE: go test -race flag is not included by default, it causes problems on several platforms: # - ubuntu up to trust: link errors # - ubuntu from xenial: requires extra package golang-race-detector-runtime # - fedora with gccgo: complains about "import cycles" # (Works well on fedora with original go) # Enable manually with -DGO_TEST_FLAGS="-v -race" set(GO_BUILD_FLAGS "" CACHE STRING "Flags for 'go build'") set(GO_VET_FLAGS "-v" CACHE STRING "Flags for 'go test'") set(GO_TEST_FLAGS "-v" CACHE STRING "Flags for 'go test'") # Flags that differ for golang go and gcc go. if (go_ver MATCHES "gccgo") set(GO_RPATH_FLAGS -gccgoflags "-Wl,-rpath=${CMAKE_BINARY_DIR}/proton-c") else() set(GO_RPATH_FLAGS -ldflags "-r ${CMAKE_BINARY_DIR}/proton-c") endif() separate_arguments(GO_BUILD_FLAGS) separate_arguments(GO_TEST_FLAGS) # Create a Go tree in the binary directory, link src to the source directory set(GOPATH ${CMAKE_CURRENT_BINARY_DIR}) add_custom_target(go-src-link ALL COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/src ${GOPATH}/src) # Following are CACHE INTERNAL so examples/CMakeLists.txt can see them. set(GO_ENV ${env_py} -- "GOPATH=${GOPATH}" "CGO_CFLAGS=-I${CMAKE_SOURCE_DIR}/proton-c/include -I${CMAKE_BINARY_DIR}/proton-c/include" "CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/proton-c" "PN_INTEROP_DIR=${CMAKE_SOURCE_DIR}/tests/interop" "SASLPASSWD=${SASLPASSWD_EXE}" CACHE INTERNAL "Run a command with Go environment variables") set(GO ${GO_ENV} ${GO_EXE} CACHE INTERNAL "Run go with environment set") set(GO_BUILD ${GO} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go build") set(GO_INSTALL ${GO} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install" ) set(GO_TEST ${GO} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL "Run go test") # The go build tools handle dependency checks and incremental builds better than # CMake so just run them every time, they do nothing if nothing needs to be # done. add_custom_target(go-build ALL COMMAND ${GO_INSTALL} qpid.apache.org/... DEPENDS qpid-proton-core WORKING_DIRECTORY $ENV{PWD}) add_test( NAME go-test COMMAND ${GO_TEST} qpid.apache.org/... WORKING_DIRECTORY $ENV{PWD}) # Clean up go output directories. list(APPEND ADDITIONAL_MAKE_CLEAN_FILES ${GOPATH}/pkg ${GOPATH}/bin) # Install go sources. set (GO_INSTALL_DIR ${SHARE_INSTALL_DIR}/gocode/src CACHE PATH "Installation directory for Go code") mark_as_advanced (GO_INSTALL_DIR) install(DIRECTORY src/qpid.apache.org DESTINATION ${GO_INSTALL_DIR} COMPONENT Go) qpid-proton-0.22.0/proton-c/bindings/cpp/0000775000000000000000000000000013257152177015071 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/src/0000775000000000000000000000000013257152177015660 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/src/work_queue.cpp0000664000000000000000000000504513257152177020556 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/work_queue.hpp" #include "proton/duration.hpp" #include "contexts.hpp" #include "proactor_container_impl.hpp" #include "proactor_work_queue_impl.hpp" #include #include namespace proton { work_queue::work_queue() {} work_queue::work_queue(container& c) { *this = container::impl::make_work_queue(c); } work_queue::~work_queue() {} work_queue& work_queue::operator=(impl* i) { impl_.reset(i); return *this; } bool work_queue::add(internal::v03::work f) { // If we have no actual work queue, then can't defer if (!impl_) return false; return impl_->add(f); } #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES bool work_queue::add(internal::v11::work f) { // If we have no actual work queue, then can't defer if (!impl_) return false; return impl_->add(f); } #endif bool work_queue::add(void_function0& f) { return add(make_work(&void_function0::operator(), &f)); } void work_queue::schedule(duration d, internal::v03::work f) { // If we have no actual work queue, then can't defer if (!impl_) return; return impl_->schedule(d, f); } #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES void work_queue::schedule(duration d, internal::v11::work f) { // If we have no actual work queue, then can't defer if (!impl_) return; return impl_->schedule(d, f); } #endif void work_queue::schedule(duration d, void_function0& f) { schedule(d, make_work(&void_function0::operator(), &f)); } work_queue& work_queue::get(pn_connection_t* c) { return connection_context::get(c).work_queue_; } work_queue& work_queue::get(pn_session_t* s) { return get(pn_session_connection(s)); } work_queue& work_queue::get(pn_link_t* l) { return get(pn_link_session(l)); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/value_test.cpp0000664000000000000000000001133313257152177020540 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "scalar_test.hpp" namespace { using namespace std; using namespace proton; using test::many; using test::scalar_test_group; // Inserting and extracting arrays from a container T of type U template void sequence_test( type_id tid, const many& values, const string& s) { T x(values.begin(), values.end()); value vx(x); // construct ASSERT_EQUAL(tid, vx.type()); ASSERT_EQUAL(x, get(vx)); ASSERT_EQUAL(x, coerce(vx)); { T y; get(vx, y); // Two argument get. ASSERT_EQUAL(x, y); } { T y; coerce(vx, y); // Two argument coerce. ASSERT_EQUAL(x, y); } value v2; // assign v2 = x; ASSERT_EQUAL(tid, v2.type()); ASSERT_EQUAL(x, get(v2)); ASSERT_EQUAL(x, coerce(v2)); ASSERT_EQUAL(vx, v2); T y(x); typename T::iterator it = y.begin(); *y.begin() = *(++it); // Second element is bigger so y is lexicographically bigger than x value vy(y); ASSERT(vx != vy); ASSERT(vx < vy); ASSERT(vy > vx); ASSERT_EQUAL(s, to_string(vx)); } template void map_test(const U& values, const string& s) { T m(values.begin(), values.end()); value v(m); ASSERT_EQUAL(MAP, v.type()); T m2(get(v)); ASSERT_EQUAL(m.size(), m2.size()); ASSERT_EQUAL(m, m2); if (!s.empty()) ASSERT_EQUAL(s, to_string(v)); } } int main(int, char**) { try { int failed = 0; scalar_test_group(failed); // Sequence tests RUN_TEST(failed, sequence_test >( ARRAY, many() + false + true, "@PN_BOOL[false, true]")); RUN_TEST(failed, sequence_test >( ARRAY, many() + -1 + 2, "@PN_INT[-1, 2]")); RUN_TEST(failed, sequence_test >( ARRAY, many() + "a" + "b", "@PN_STRING[\"a\", \"b\"]")); RUN_TEST(failed, sequence_test >( ARRAY, many() + "a" + "b", "@PN_SYMBOL[:a, :b]")); RUN_TEST(failed, sequence_test >( LIST, many() + value(0) + value("a"), "[0, \"a\"]")); RUN_TEST(failed, sequence_test >( LIST, many() + scalar(0) + scalar("a"), "[0, \"a\"]")); // // Map tests typedef pair si_pair; many si_pairs; si_pairs << si_pair("a", 0) << si_pair("b", 1) << si_pair("c", 2); RUN_TEST(failed, (map_test >( si_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}"))); RUN_TEST(failed, (map_test >( si_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}"))); many > value_pairs(si_pairs); RUN_TEST(failed, (map_test >( value_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}"))); many > scalar_pairs(si_pairs); RUN_TEST(failed, (map_test >( scalar_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}"))); annotation_key ak(si_pairs[0].first); pair p(si_pairs[0]); many > restricted_pairs(si_pairs); RUN_TEST(failed, (map_test >( restricted_pairs, "{:a=0, :b=1, :c=2}"))); #if PN_CPP_HAS_CPP11 RUN_TEST(failed, sequence_test >( ARRAY, many() + binary("xx") + binary("yy"), "@PN_BINARY[b\"xx\", b\"yy\"]")); RUN_TEST(failed, (map_test >(si_pairs, ""))); #endif return failed; } catch (const std::exception& e) { std::cout << "ERROR in main(): " << e.what() << std::endl; } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/value.cpp0000664000000000000000000001353513257152177017507 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton_bits.hpp" #include "proton/internal/data.hpp" #include "proton/value.hpp" #include "proton/types.hpp" #include "proton/scalar.hpp" #include "proton/error.hpp" #include #include namespace proton { using codec::decoder; using codec::encoder; using codec::start; value::value() {} value::value(pn_data_t *d) { data_ = make_wrapper(d); } value::value(const value& x) { *this = x; } #if PN_CPP_HAS_RVALUE_REFERENCES value::value(value&& x) { swap(*this, x); } value& value::operator=(value&& x) { swap(*this, x); return *this; } #endif value& value::operator=(const value& x) { if (this != &x) { if (x.empty()) clear(); else data().copy(x.data_); } return *this; } void swap(value& x, value& y) { std::swap(x.data_, y.data_); } void value::clear() { if (!!data_) data_.clear(); } namespace internal { // On demand internal::data& value_base::data() { if (!data_) data_ = internal::data::create(); return data_; } } type_id value::type() const { return (!data_ || data_.empty()) ? NULL_TYPE : codec::decoder(*this).next_type(); } bool value::empty() const { return type() == NULL_TYPE; } namespace { // Compare nodes, return -1 if ab // Forward-declare so we can use it recursively. int compare_next(decoder& a, decoder& b); template int compare(const T& a, const T& b) { if (a < b) return -1; else if (a > b) return +1; else return 0; } int compare_container(decoder& a, decoder& b) { start sa, sb; a >> sa; b >> sb; // Compare described vs. not-described. int cmp = compare(sa.is_described, sb.is_described); if (cmp) return cmp; // Lexical sort (including descriptor if there is one) size_t min_size = std::min(sa.size, sb.size) + size_t(sa.is_described); for (size_t i = 0; i < min_size; ++i) { cmp = compare_next(a, b); if (cmp) return cmp; } return compare(sa.size, sb.size); } template int compare_simple(decoder& a, decoder& b) { T va = T(); T vb = T(); a >> va; b >> vb; return compare(va, vb); } int compare_next(decoder& a, decoder& b) { // Sort by type_id first. type_id ta = a.next_type(), tb = b.next_type(); int cmp = compare(ta, tb); if (cmp) return cmp; switch (ta) { case NULL_TYPE: return 0; case ARRAY: case LIST: case MAP: case DESCRIBED: return compare_container(a, b); case BOOLEAN: return compare_simple(a, b); case UBYTE: return compare_simple(a, b); case BYTE: return compare_simple(a, b); case USHORT: return compare_simple(a, b); case SHORT: return compare_simple(a, b); case UINT: return compare_simple(a, b); case INT: return compare_simple(a, b); case ULONG: return compare_simple(a, b); case LONG: return compare_simple(a, b); case CHAR: return compare_simple(a, b); case TIMESTAMP: return compare_simple(a, b); case FLOAT: return compare_simple(a, b); case DOUBLE: return compare_simple(a, b); case DECIMAL32: return compare_simple(a, b); case DECIMAL64: return compare_simple(a, b); case DECIMAL128: return compare_simple(a, b); case UUID: return compare_simple(a, b); case BINARY: return compare_simple(a, b); case STRING: return compare_simple(a, b); case SYMBOL: return compare_simple(a, b); } // Avoid unreached diagnostic from clang #if defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunreachable-code" #endif // Invalid but equal type_id, treat as equal. return 0; #if defined(__clang__) #pragma GCC diagnostic pop #endif } int compare(const value& x, const value& y) { decoder a(x), b(y); internal::state_guard s1(a), s2(b); a.rewind(); b.rewind(); while (a.more() && b.more()) { int cmp = compare_next(a, b); if (cmp != 0) return cmp; } if (b.more()) return -1; if (a.more()) return 1; return 0; } } // namespace bool operator==(const value& x, const value& y) { if (x.empty() && y.empty()) return true; if (x.empty() || y.empty()) return false; return compare(x, y) == 0; } bool operator<(const value& x, const value& y) { if (x.empty() && y.empty()) return false; if (x.empty()) return true; // empty is < !empty return compare(x, y) < 0; } std::ostream& operator<<(std::ostream& o, const value& x) { if (x.empty()) { return o << ""; } if (type_id_is_scalar(x.type()) || x.empty()) return o << proton::get(x); // Print as a scalar // Use pn_inspect for complex types. proton::decoder d(x); return o << d; } std::string to_string(const value& x) { std::ostringstream os; os << std::boolalpha << x; return os.str(); } void value::reset(pn_data_t *d) { data_ = make_wrapper(d); } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/uuid.cpp0000664000000000000000000000546213257152177017341 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "types_internal.hpp" #include "proton/uuid.hpp" #include "proton/types_fwd.hpp" #include #include #include #include #ifdef WIN32 #include #define GETPID _getpid #else #include #define GETPID getpid #endif namespace proton { namespace { // Seed the random number generated once at startup. struct seed { seed() { // A hash of time and PID, time alone is a bad seed as programs started // within the same second will get the same seed. long secs = time(0); long pid = GETPID(); std::srand(((secs*181)*((pid-83)*359))%104729); } } seed_; } uuid uuid::copy() { uuid u; std::fill(u.begin(), u.end(), 0); return u; } uuid uuid::copy(const char* bytes) { uuid u; if (bytes) std::copy(bytes, bytes + u.size(), u.begin()); else std::fill(u.begin(), u.end(), 0); return u; } uuid uuid::random() { uuid bytes; int r = std::rand(); for (size_t i = 0; i < bytes.size(); ++i ) { bytes[i] = r & 0xFF; r >>= 8; if (!r) r = std::rand(); } // From RFC4122, the version bits are set to 0100 bytes[6] = (bytes[6] & 0x0F) | 0x40; // From RFC4122, the top two bits of byte 8 get set to 01 bytes[8] = (bytes[8] & 0x3F) | 0x80; return bytes; } /// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hyphens) std::ostream& operator<<(std::ostream& o, const uuid& u) { ios_guard restore_flags(o); o << std::hex << std::setfill('0'); static const int segments[] = {4,2,2,2,6}; // 1 byte is 2 hex chars. const uint8_t *p = reinterpret_cast(u.begin()); for (size_t i = 0; i < sizeof(segments)/sizeof(segments[0]); ++i) { if (i > 0) o << '-'; for (int j = 0; j < segments[i]; ++j) { o << std::setw(2) << printable_byte(*(p++)); } } return o; } std::string uuid::str() const { std::ostringstream s; s << *this; return s.str(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/url_test.cpp0000664000000000000000000000742413257152177020234 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_bits.hpp" #include namespace { #define CHECK_URL(S, SCHEME, USER, PWD, HOST, PORT, PATH) do { \ proton::url u(S); \ ASSERT_EQUAL(SCHEME, u.scheme()); \ ASSERT_EQUAL(USER, u.user()); \ ASSERT_EQUAL(PWD, u.password()); \ ASSERT_EQUAL(HOST, u.host()); \ ASSERT_EQUAL(PORT, u.port()); \ ASSERT_EQUAL(PATH, u.path()); \ } while(0) void parse_to_string_test() { CHECK_URL("amqp://foo:xyz/path", "amqp", "", "", "foo", "xyz", "path"); CHECK_URL("amqp://username:password@host:1234/path", "amqp", "username", "password", "host", "1234", "path"); CHECK_URL("host:1234", "amqp", "", "", "host", "1234", ""); CHECK_URL("host", "amqp", "", "", "host", "amqp", ""); CHECK_URL("host/path", "amqp", "", "", "host", "amqp", "path"); CHECK_URL("amqps://host", "amqps", "", "", "host", "amqps", ""); CHECK_URL("/path", "amqp", "", "", "localhost", "amqp", "path"); CHECK_URL("", "amqp", "", "", "localhost", "amqp", ""); CHECK_URL(":1234", "amqp", "", "", "localhost", "1234", ""); } void parse_slash_slash() { CHECK_URL("//username:password@host:1234/path", "amqp", "username", "password", "host", "1234", "path"); CHECK_URL("//host:port/path", "amqp", "", "", "host", "port", "path"); CHECK_URL("//host", "amqp", "", "", "host", "amqp", ""); CHECK_URL("//:port", "amqp", "", "", "localhost", "port", ""); CHECK_URL("//:0", "amqp", "", "", "localhost", "0", ""); } #define CHECK_URL_NODEFAULT(S, SCHEME, USER, PWD, HOST, PORT, PATH) do { \ proton::url u(S, false); \ ASSERT_EQUAL(SCHEME, u.scheme()); \ ASSERT_EQUAL(USER, u.user()); \ ASSERT_EQUAL(PWD, u.password()); \ ASSERT_EQUAL(HOST, u.host()); \ ASSERT_EQUAL(PORT, u.port()); \ ASSERT_EQUAL(PATH, u.path()); \ } while(0) } void parse_nodefault() { CHECK_URL_NODEFAULT("", "", "", "", "", "", ""); CHECK_URL_NODEFAULT("//:", "", "", "", "", "", ""); CHECK_URL_NODEFAULT("//:0", "", "", "", "", "0", ""); CHECK_URL_NODEFAULT("//h:", "", "", "", "h", "", ""); } int main(int, char**) { int failed = 0; RUN_TEST(failed, parse_to_string_test()); RUN_TEST(failed, parse_slash_slash()); RUN_TEST(failed, parse_nodefault()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/url.cpp0000664000000000000000000001551313257152177017173 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/url.hpp" #include "proton/error.hpp" #include "proton_bits.hpp" #include #include #include #include #include namespace { /** URL-encode src and append to dst. */ static std::string pni_urlencode(const std::string &src) { static const char *bad = "@:/"; std::ostringstream dst; dst << std::hex << std::uppercase << std::setfill('0'); std::size_t i = 0; std::size_t j = src.find_first_of(bad); while (j!=std::string::npos) { dst << src.substr(i, j-i); dst << "%" << std::setw(2) << src[j]; i = j + 1; j = src.find_first_of(bad); } dst << src.substr(i); return dst.str(); } // Low level url parser static void pni_urldecode(const char *src, char *dst) { const char *in = src; char *out = dst; while (*in != '\0') { if ('%' == *in) { if ((in[1] != '\0') && (in[2] != '\0')) { char esc[3]; esc[0] = in[1]; esc[1] = in[2]; esc[2] = '\0'; unsigned long d = std::strtoul(esc, NULL, 16); *out = (char)d; in += 3; out++; } else { *out = *in; in++; out++; } } else { *out = *in; in++; out++; } } *out = '\0'; } void parse_url(char *url, const char **scheme, const char **user, const char **pass, const char **host, const char **port, const char **path) { if (!url) return; char *slash = std::strchr(url, '/'); if (slash && slash>url) { char *scheme_end = std::strstr(slash-1, "://"); if (scheme_end && scheme_end cstr; mutable std::string str; impl(const std::string& s) : scheme(0), username(0), password(0), host(0), port(0), path(0), cstr(s.size()+1, '\0') { std::copy(s.begin(), s.end(), cstr.begin()); parse_url(&cstr[0], &scheme, &username, &password, &host, &port, &path); } void defaults() { if (!scheme || *scheme=='\0' ) scheme = proton::url::AMQP.c_str(); if (!host || *host=='\0' ) host = default_host; if (!port || *port=='\0' ) port = scheme; } operator std::string() const { if ( str.empty() ) { if (scheme) { str += scheme; str += "://"; } if (username) { str += pni_urlencode(username); } if (password) { str += ":"; str += pni_urlencode(password); } if (username || password) { str += "@"; } if (host) { if (std::strchr(host, ':')) { str += '['; str += host; str += ']'; } else { str += host; } } if (port) { str += ':'; str += port; } if (path) { str += '/'; str += path; } } return str; } }; const char* const url::impl::default_host = "localhost"; url_error::url_error(const std::string& s) : error(s) {} url::url(const std::string &s) : impl_(new impl(s)) { impl_->defaults(); } url::url(const std::string &s, bool d) : impl_(new impl(s)) { if (d) impl_->defaults(); } url::url(const url& u) : impl_(new impl(u)) {} url::~url() {} url& url::operator=(const url& u) { if (this != &u) { impl_.reset(new impl(*u.impl_)); } return *this; } url::operator std::string() const { return *impl_; } std::string url::scheme() const { return str(impl_->scheme); } std::string url::user() const { return str(impl_->username); } std::string url::password() const { return str(impl_->password); } std::string url::host() const { return str(impl_->host); } std::string url::port() const { return str(impl_->port); } std::string url::path() const { return str(impl_->path); } std::string url::host_port() const { return host() + ":" + port(); } bool url::empty() const { return impl_->str.empty(); } const std::string url::AMQP("amqp"); const std::string url::AMQPS("amqps"); uint16_t url::port_int() const { if (port() == AMQP) return 5672; if (port() == AMQPS) return 5671; std::istringstream is(port()); uint16_t result; is >> result; if (is.fail()) throw url_error("invalid port '" + port() + "'"); return result; } std::ostream& operator<<(std::ostream& o, const url& u) { return o << std::string(u); } std::string to_string(const url& u) { return u; } std::istream& operator>>(std::istream& i, url& u) { std::string s; i >> s; if (!i.fail() && !i.bad()) { if (!s.empty()) { url::impl* p = new url::impl(s); p->defaults(); u.impl_.reset(p); } else { i.clear(std::ios::failbit); } } return i; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/types_internal.hpp0000664000000000000000000000517713257152177021443 0ustar #ifndef TYPES_INTERNAL_HPP #define TYPES_INTERNAL_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/internal/type_traits.hpp" #include "proton/error.hpp" #include "proton/binary.hpp" #include ///@file /// Inline helpers for encode/decode/type conversion/ostream operators. namespace proton { /// Byte copy between two objects, only enabled if their sizes are equal. template typename internal::enable_if::type byte_copy(T &to, const U &from) { const char *p = reinterpret_cast(&from); std::copy(p, p + sizeof(T), reinterpret_cast(&to)); } inline conversion_error make_conversion_error(type_id want, type_id got, const std::string& msg=std::string()) { std::ostringstream s; s << "unexpected type, want: " << want << " got: " << got; if (!msg.empty()) s << ": " << msg; return conversion_error(s.str()); } /// Convert std::string to pn_bytes_t inline pn_bytes_t pn_bytes(const std::string& s) { pn_bytes_t b = { s.size(), s.empty() ? 0 : const_cast(&s[0]) }; return b; } inline pn_bytes_t pn_bytes(const binary& s) { pn_bytes_t b = { s.size(), s.empty() ? 0 : reinterpret_cast(&s[0]) }; return b; } inline std::string str(const pn_bytes_t& b) { return std::string(b.start, b.size); } inline binary bin(const pn_bytes_t& b) { return binary(b.start, b.start+b.size); } // Save all stream format state, restore in destructor. struct ios_guard { std::ios &guarded; std::ios old; ios_guard(std::ios& x) : guarded(x), old(0) { old.copyfmt(guarded); } ~ios_guard() { guarded.copyfmt(old); } }; // Convert a char (signed or unsigned) into an unsigned 1 byte integer that will ostream // as a numeric byte value, not a character and will not get sign-extended. inline unsigned int printable_byte(uint8_t byte) { return byte; } } #endif // TYPES_INTERNAL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/type_id.cpp0000664000000000000000000000440113257152177020020 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "types_internal.hpp" #include "proton/type_id.hpp" #include namespace proton { std::string type_name(type_id t) { switch (t) { case NULL_TYPE: return "null"; case BOOLEAN: return "boolean"; case UBYTE: return "ubyte"; case BYTE: return "byte"; case USHORT: return "ushort"; case SHORT: return "short"; case UINT: return "uint"; case INT: return "int"; case CHAR: return "char"; case ULONG: return "ulong"; case LONG: return "long"; case TIMESTAMP: return "timestamp"; case FLOAT: return "float"; case DOUBLE: return "double"; case DECIMAL32: return "decimal32"; case DECIMAL64: return "decimal64"; case DECIMAL128: return "decimal128"; case UUID: return "uuid"; case BINARY: return "binary"; case STRING: return "string"; case SYMBOL: return "symbol"; case DESCRIBED: return "described"; case ARRAY: return "array"; case LIST: return "list"; case MAP: return "map"; } // Avoid unreached diagnostic from clang #if defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunreachable-code" #endif return "unknown"; #if defined(__clang__) #pragma GCC diagnostic pop #endif } std::ostream& operator<<(std::ostream& o, type_id t) { return o << type_name(t); } void assert_type_equal(type_id want, type_id got) { if (want != got) throw make_conversion_error(want, got); } } // proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/transport.cpp0000664000000000000000000000271613257152177020426 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/error.hpp" #include "proton/transport.hpp" #include "proton/error_condition.hpp" #include "proton/connection.hpp" #include "proton/ssl.hpp" #include "proton/sasl.hpp" #include #include #include "msg.hpp" #include "proton_bits.hpp" namespace proton { connection transport::connection() const { return make_wrapper(pn_transport_connection(pn_object())); } class ssl transport::ssl() const { return pn_ssl(pn_object()); } class sasl transport::sasl() const { return pn_sasl(pn_object()); } error_condition transport::error() const { return make_wrapper(pn_transport_condition(pn_object())); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/transfer.cpp0000664000000000000000000000330213257152177020206 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/delivery.hpp" #include "proton/connection.hpp" #include "proton/link.hpp" #include "proton/session.hpp" #include #include #include #include "proton_bits.hpp" namespace proton { session transfer::session() const { return make_wrapper(pn_link_session(pn_delivery_link(pn_object()))); } connection transfer::connection() const { return make_wrapper(pn_session_connection(pn_link_session(pn_delivery_link(pn_object())))); } container& transfer::container() const { return connection().container(); } work_queue& transfer::work_queue() const { return connection().work_queue(); } bool transfer::settled() const { return pn_delivery_settled(pn_object()); } void transfer::settle() { pn_delivery_settle(pn_object()); } enum transfer::state transfer::state() const { return static_cast(pn_delivery_remote_state(pn_object())); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/tracker.cpp0000664000000000000000000000214213257152177020016 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/tracker.hpp" #include "proton/sender.hpp" #include "proton_bits.hpp" #include namespace proton { tracker::tracker(pn_delivery_t *d): transfer(make_wrapper(d)) {} sender tracker::sender() const { return make_wrapper(pn_delivery_link(pn_object())); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/timestamp.cpp0000664000000000000000000000217213257152177020371 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/timestamp.hpp" #include "proton/internal/config.hpp" #include #include #include namespace proton { timestamp timestamp::now() { return timestamp( pn_proactor_now() ); } std::ostream& operator<<(std::ostream& o, timestamp ts) { return o << ts.milliseconds(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/test_bits.hpp0000664000000000000000000001371213257152177020375 0ustar #ifndef TEST_BITS_HPP #define TEST_BITS_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "msg.hpp" #include "proton/types.hpp" #include #include #include #include #include #include namespace test { struct fail : public std::logic_error { explicit fail(const std::string& what) : logic_error(what) {} }; struct error : public std::logic_error { explicit error(const std::string& what) : logic_error(what) {} }; template void assert_equal(const T& want, const U& got, const std::string& what) { if (!(want == got)) throw fail(MSG(what << " " << want << " != " << got)); } template inline void assert_equalish(T want, T got, T delta, const std::string& what) { if (!(fabs(want-got) <= delta)) throw fail(MSG(what << " " << want << " !=~ " << got)); } #define FAIL_MSG(WHAT) (MSG(__FILE__ << ":" << __LINE__ << ": " << WHAT).str()) #define FAIL(WHAT) throw test::fail(FAIL_MSG(WHAT)) #define ASSERT(TEST) do { if (!(TEST)) FAIL("failed ASSERT(" #TEST ")"); } while(false) #define ASSERT_EQUAL(WANT, GOT) \ test::assert_equal((WANT), (GOT), FAIL_MSG("failed ASSERT_EQUAL(" #WANT ", " #GOT ")")) #define ASSERT_EQUALISH(WANT, GOT, DELTA) \ test::assert_equalish((WANT), (GOT), (DELTA), FAIL_MSG("failed ASSERT_EQUALISH(" #WANT ", " #GOT ")")) #define ASSERT_THROWS(WANT, EXPR) do { try { EXPR; FAIL("Expected " #WANT); } catch(const WANT&) {} } while(0) #define RUN_TEST(BAD_COUNT, TEST) \ do { \ try { \ std::cout << "TEST: " << #TEST << std::endl; \ TEST; \ break; \ } catch(const test::fail& e) { \ std::cout << "FAIL " << #TEST << std::endl << e.what() << std::endl; \ } catch(const std::exception& e) { \ std::cout << "ERROR " << #TEST << std::endl << __FILE__ << ":" << __LINE__ << ": " << e.what() << std::endl; \ } \ ++BAD_COUNT; \ } while(0) /* Like RUN_TEST but only if one of the argv strings is found in the test EXPR */ #define RUN_ARGV_TEST(BAD_COUNT, EXPR) do { \ if (argc == 1) { \ RUN_TEST(BAD_COUNT, EXPR); \ } else { \ for (int i = 1; i < argc; ++i) { \ if (strstr(#EXPR, argv[i])) { \ RUN_TEST(BAD_COUNT, EXPR); \ break; \ } \ } \ } \ } while(0) template std::string str(const T& x) { std::ostringstream s; s << std::boolalpha << x; return s.str(); } // A way to easily create literal collections that can be compared to std:: collections // and to print std collections // e.g. // std::vector v = ...; // ASSERT_EQUAL(many() + "a" + "b" + "c", v); template struct many : public std::vector { many() {} template explicit many(const S& s) : std::vector(s.begin(), s.end()) {} many& operator+=(const T& t) { this->push_back(t); return *this; } many& operator<<(const T& t) { return *this += t; } many operator+(const T& t) { many l(*this); return l += t; } }; template bool operator==(const many& m, const S& s) { return m.size() == s.size() && S(m.begin(), m.end()) == s; } template bool operator==(const S& s, const many& m) { return m.size() == s.size() && S(m.begin(), m.end()) == s; } template std::ostream& operator<<(std::ostream& o, const many& m) { std::ostream_iterator oi(o, " "); std::copy(m.begin(), m.end(), oi); return o; } } namespace std { template std::ostream& operator<<(std::ostream& o, const std::vector& s) { return o << test::many(s); } template std::ostream& operator<<(std::ostream& o, const std::deque& s) { return o << test::many(s); } template std::ostream& operator<<(std::ostream& o, const std::list& s) { return o << test::many(s); } template std::ostream& operator<<(std::ostream& o, const std::map& x) { return o << test::many >(x); } template std::ostream& operator<<(std::ostream& o, const std::pair& p) { return o << "( " << p.first << " , " << p.second << " )"; } #if PN_CPP_HAS_CPP11 template std::ostream& operator<<(std::ostream& o, const std::unordered_map& x) { return o << test::many >(x); } template std::ostream& operator<<(std::ostream& o, const std::forward_list& s) { return o << test::many(s); } #endif } #endif // TEST_BITS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/terminus.cpp0000664000000000000000000000341413257152177020234 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/duration.hpp" #include "proton/terminus.hpp" #include "proton/value.hpp" #include "proton/codec/vector.hpp" #include "proton_bits.hpp" namespace proton { terminus::terminus(pn_terminus_t* t) : object_(t), parent_(0) {} enum terminus::expiry_policy terminus::expiry_policy() const { return (enum expiry_policy)pn_terminus_get_expiry_policy(object_); } duration terminus::timeout() const { return duration::SECOND * pn_terminus_get_timeout(object_); } enum terminus::durability_mode terminus::durability_mode() { return (enum durability_mode) pn_terminus_get_durability(object_); } bool terminus::dynamic() const { return pn_terminus_is_dynamic(object_); } value terminus::node_properties() const { return value(pn_terminus_properties(object_)); } std::vector terminus::capabilities() const { value caps(pn_terminus_capabilities(object_)); return caps.empty() ? std::vector() : caps.get >(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/target.cpp0000664000000000000000000000310713257152177017653 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton_bits.hpp" #include "proton/target.hpp" #include "proton/sender.hpp" #include "proton/receiver.hpp" #include "proton_bits.hpp" namespace proton { // Set parent_ non-null when the local terminus is authoritative and may need to be looked up. target::target(pn_terminus_t *t) : terminus(make_wrapper(t)) {} target::target(const sender& snd) : terminus(make_wrapper(pn_link_remote_target(unwrap(snd)))) {} target::target(const receiver& rcv) : terminus(make_wrapper(pn_link_remote_target(unwrap(rcv)))) { parent_ = unwrap(rcv); } std::string target::address() const { pn_terminus_t *authoritative = object_; if (parent_ && pn_terminus_is_dynamic(object_)) authoritative = pn_link_target(parent_); return str(pn_terminus_get_address(authoritative)); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/ssl_domain.cpp0000664000000000000000000001273113257152177020520 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/ssl.hpp" #include "proton/error.hpp" #include "msg.hpp" #include namespace proton { /// TODO: This whole class isn't really needed as pn_ssl_domain_t is already refcounted, with shared ownership for all pn_ssl_t objects /// that hold one /// cjansen: but note it is not a PN_CLASS object and two pn_ssl_domain_free() from the app will cause a free while still in use. class ssl_domain_impl { public: ssl_domain_impl(bool is_server) : refcount_(1), pn_domain_(pn_ssl_domain(is_server ? PN_SSL_MODE_SERVER : PN_SSL_MODE_CLIENT)) { if (!pn_domain_) throw error(MSG("SSL/TLS unavailable")); } ~ssl_domain_impl() { pn_ssl_domain_free(pn_domain_); } void incref() { refcount_++; } void decref() { if (--refcount_ == 0) { delete this; } } pn_ssl_domain_t *pn_domain() { return pn_domain_; } private: int refcount_; pn_ssl_domain_t *pn_domain_; ssl_domain_impl(const ssl_domain_impl&); ssl_domain_impl& operator=(const ssl_domain_impl&); }; namespace internal { ssl_domain::ssl_domain(bool is_server) : impl_(0), server_type_(is_server) {} ssl_domain::ssl_domain(const ssl_domain &x) : impl_(x.impl_), server_type_(x.server_type_) { if (impl_) impl_->incref(); } ssl_domain& internal::ssl_domain::operator=(const ssl_domain&x) { if (&x == this) return *this; if (impl_) impl_->decref(); impl_ = x.impl_; server_type_ = x.server_type_; if (impl_) impl_->incref(); return *this; } ssl_domain::~ssl_domain() { if (impl_) impl_->decref(); } pn_ssl_domain_t *ssl_domain::pn_domain() { if (!impl_) // Lazily create in case never actually used or configured. // The pn_ssl_domain_t is a heavy object. impl_ = new ssl_domain_impl(server_type_); return impl_->pn_domain(); } } // namespace internal namespace { void set_cred(pn_ssl_domain_t *dom, const std::string &main, const std::string &extra, const std::string &pass, bool pwset) { const char *cred2 = extra.empty() ? NULL : extra.c_str(); const char *pw = pwset ? pass.c_str() : NULL; if (pn_ssl_domain_set_credentials(dom, main.c_str(), cred2, pw)) throw error(MSG("SSL certificate initialization failure for " << main << ":" << (cred2 ? cred2 : "NULL") << ":" << (pw ? pw : "NULL"))); } } ssl_server_options::ssl_server_options(ssl_certificate &cert) : internal::ssl_domain(true) { set_cred(pn_domain(), cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_); } ssl_server_options::ssl_server_options( ssl_certificate &cert, const std::string &trust_db, const std::string &advertise_db, enum ssl::verify_mode mode) : internal::ssl_domain(true) { pn_ssl_domain_t* dom = pn_domain(); set_cred(dom, cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_); if (pn_ssl_domain_set_trusted_ca_db(dom, trust_db.c_str())) throw error(MSG("SSL trust store initialization failure for " << trust_db)); const std::string &db = advertise_db.empty() ? trust_db : advertise_db; if (pn_ssl_domain_set_peer_authentication(dom, pn_ssl_verify_mode_t(mode), db.c_str())) throw error(MSG("SSL server configuration failure requiring client certificates using " << db)); } ssl_server_options::ssl_server_options() : ssl_domain(true) {} namespace { void client_setup(pn_ssl_domain_t *dom, const std::string &trust_db, enum ssl::verify_mode mode) { if (pn_ssl_domain_set_trusted_ca_db(dom, trust_db.c_str())) throw error(MSG("SSL trust store initialization failure for " << trust_db)); if (pn_ssl_domain_set_peer_authentication(dom, pn_ssl_verify_mode_t(mode), NULL)) throw error(MSG("SSL client verify mode failure")); } } ssl_client_options::ssl_client_options(const std::string &trust_db, enum ssl::verify_mode mode) : ssl_domain(false) { client_setup(pn_domain(), trust_db, mode); } ssl_client_options::ssl_client_options(ssl_certificate &cert, const std::string &trust_db, enum ssl::verify_mode mode) : ssl_domain(false) { pn_ssl_domain_t *dom = pn_domain(); set_cred(dom, cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_); client_setup(dom, trust_db, mode); } ssl_client_options::ssl_client_options() : ssl_domain(false) {} ssl_certificate::ssl_certificate(const std::string &main) : certdb_main_(main), pw_set_(false) {} ssl_certificate::ssl_certificate(const std::string &main, const std::string &extra) : certdb_main_(main), certdb_extra_(extra), pw_set_(false) {} ssl_certificate::ssl_certificate(const std::string &main, const std::string &extra, const std::string &pw) : certdb_main_(main), certdb_extra_(extra), passwd_(pw), pw_set_(true) {} } // namespace qpid-proton-0.22.0/proton-c/bindings/cpp/src/ssl.cpp0000664000000000000000000000314213257152177017165 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/ssl.hpp" #include "proton/error.hpp" #include "msg.hpp" #include namespace proton { std::string ssl::cipher() const { char buf[128]; if (pn_ssl_get_cipher_name(object_, buf, sizeof(buf))) return std::string(buf); return std::string(); } int ssl::ssf() const { return pn_ssl_get_ssf(object_); } std::string ssl::protocol() const { char buf[128]; if (pn_ssl_get_protocol_name(object_, buf, sizeof(buf))) return std::string(buf); return std::string(); } enum ssl::resume_status ssl::resume_status() const { return (enum ssl::resume_status)pn_ssl_resume_status(object_); } std::string ssl::remote_subject() const { const char *s = pn_ssl_get_remote_subject(object_); return s ? std::string(s) : std::string(); } } // namespace qpid-proton-0.22.0/proton-c/bindings/cpp/src/source.cpp0000664000000000000000000000372413257152177017672 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton_bits.hpp" #include "proton/source.hpp" #include "proton/sender.hpp" #include "proton/receiver.hpp" #include "proton_bits.hpp" namespace proton { // Set parent_ non-null when the local terminus is authoritative and may need to be looked up. source::source(pn_terminus_t *t) : terminus(make_wrapper(t)), filters_(pn_terminus_filter(object_)) {} source::source(const sender& snd) : terminus(make_wrapper(pn_link_remote_source(unwrap(snd)))), filters_(pn_terminus_filter(object_)) { parent_ = unwrap(snd); } source::source(const receiver& rcv) : terminus(make_wrapper(pn_link_remote_source(unwrap(rcv)))), filters_(pn_terminus_filter(object_)) {} std::string source::address() const { pn_terminus_t *authoritative = object_; if (parent_ && pn_terminus_is_dynamic(object_)) authoritative = pn_link_source(parent_); return str(pn_terminus_get_address(authoritative)); } enum source::distribution_mode source::distribution_mode() const { return (enum distribution_mode)pn_terminus_get_distribution_mode(object_); } const source::filter_map& source::filters() const { return filters_; } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/session_options.cpp0000664000000000000000000000411113257152177021617 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/session_options.hpp" #include "proton/session.hpp" #include "proton/connection.hpp" #include "proton/container.hpp" #include #include "messaging_adapter.hpp" #include "proactor_container_impl.hpp" #include "proton_bits.hpp" namespace proton { template struct option { T value; bool set; option() : value(), set(false) {} option& operator=(const T& x) { value = x; set = true; return *this; } void update(const option& x) { if (x.set) *this = x.value; } }; class session_options::impl { public: option handler; void apply(session& s) { if (s.uninitialized()) { if (handler.set && handler.value) container::impl::set_handler(s, handler.value); } } }; session_options::session_options() : impl_(new impl()) {} session_options::session_options(const session_options& x) : impl_(new impl()) { *this = x; } session_options::~session_options() {} session_options& session_options::operator=(const session_options& x) { *impl_ = *x.impl_; return *this; } session_options& session_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; } void session_options::apply(session& s) const { impl_->apply(s); } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/session.cpp0000664000000000000000000000763113257152177020056 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/session.hpp" #include "proton/connection.hpp" #include "proton/receiver_options.hpp" #include "proton/sender_options.hpp" #include "proton/session_options.hpp" #include "contexts.hpp" #include "link_namer.hpp" #include "proton_bits.hpp" #include #include #include namespace proton { void session::open() { pn_session_open(pn_object()); } void session::open(const session_options &opts) { opts.apply(*this); pn_session_open(pn_object()); } void session::close() { pn_session_close(pn_object()); } container& session::container() const { return connection().container(); } work_queue& session::work_queue() const { return connection().work_queue(); } connection session::connection() const { return make_wrapper(pn_session_connection(pn_object())); } namespace { std::string next_link_name(const connection& c) { io::link_namer* ln = connection_context::get(unwrap(c)).link_gen; return ln ? ln->link_name() : uuid::random().str(); } } sender session::open_sender(const std::string &addr) { return open_sender(addr, sender_options()); } sender session::open_sender(const std::string &addr, const sender_options &so) { std::string name = so.get_name() ? *so.get_name() : next_link_name(connection()); pn_link_t *lnk = pn_sender(pn_object(), name.c_str()); pn_terminus_set_address(pn_link_target(lnk), addr.c_str()); sender snd(make_wrapper(lnk)); snd.open(so); return snd; } receiver session::open_receiver(const std::string &addr) { return open_receiver(addr, receiver_options()); } receiver session::open_receiver(const std::string &addr, const receiver_options &ro) { std::string name = ro.get_name() ? *ro.get_name() : next_link_name(connection()); pn_link_t *lnk = pn_receiver(pn_object(), name.c_str()); pn_terminus_set_address(pn_link_source(lnk), addr.c_str()); receiver rcv(make_wrapper(lnk)); rcv.open(ro); return rcv; } error_condition session::error() const { return make_wrapper(pn_session_remote_condition(pn_object())); } size_t session::incoming_bytes() const { return pn_session_incoming_bytes(pn_object()); } size_t session::outgoing_bytes() const { return pn_session_outgoing_bytes(pn_object()); } sender_range session::senders() const { pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0); while (lnk) { if (pn_link_is_sender(lnk) && pn_link_session(lnk) == pn_object()) break; lnk = pn_link_next(lnk, 0); } return sender_range(sender_iterator(make_wrapper(lnk), pn_object())); } receiver_range session::receivers() const { pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0); while (lnk) { if (pn_link_is_receiver(lnk) && pn_link_session(lnk) == pn_object()) break; lnk = pn_link_next(lnk, 0); } return receiver_range(receiver_iterator(make_wrapper(lnk), pn_object())); } session_iterator session_iterator::operator++() { obj_ = pn_session_next(unwrap(obj_), 0); return *this; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/sender_options.cpp0000664000000000000000000001034613257152177021423 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/sender_options.hpp" #include "proton/messaging_handler.hpp" #include "proton/source_options.hpp" #include "proton/target_options.hpp" #include "proactor_container_impl.hpp" #include "contexts.hpp" #include "messaging_adapter.hpp" #include "proton_bits.hpp" namespace proton { template struct option { T value; bool set; option() : value(), set(false) {} option& operator=(const T& x) { value = x; set = true; return *this; } void update(const option& x) { if (x.set) *this = x.value; } }; class sender_options::impl { static link_context& get_context(sender l) { return link_context::get(unwrap(l)); } static void set_delivery_mode(sender l, proton::delivery_mode mode) { switch (mode) { case delivery_mode::AT_MOST_ONCE: pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED); break; case delivery_mode::AT_LEAST_ONCE: pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED); pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST); break; default: break; } } public: option handler; option delivery_mode; option auto_settle; option source; option target; option name; void apply(sender& s) { if (s.uninitialized()) { if (delivery_mode.set) set_delivery_mode(s, delivery_mode.value); if (handler.set && handler.value) container::impl::set_handler(s, handler.value); if (auto_settle.set) get_context(s).auto_settle = auto_settle.value; if (source.set) { proton::source local_s(make_wrapper(pn_link_source(unwrap(s)))); source.value.apply(local_s); } if (target.set) { proton::target local_t(make_wrapper(pn_link_target(unwrap(s)))); target.value.apply(local_t); } } } void update(const impl& x) { handler.update(x.handler); delivery_mode.update(x.delivery_mode); auto_settle.update(x.auto_settle); source.update(x.source); target.update(x.target); } }; sender_options::sender_options() : impl_(new impl()) {} sender_options::sender_options(const sender_options& x) : impl_(new impl()) { *this = x; } sender_options::~sender_options() {} sender_options& sender_options::operator=(const sender_options& x) { *impl_ = *x.impl_; return *this; } void sender_options::update(const sender_options& x) { impl_->update(*x.impl_); } sender_options& sender_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; } sender_options& sender_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; } sender_options& sender_options::auto_settle(bool b) {impl_->auto_settle = b; return *this; } sender_options& sender_options::source(const source_options &s) {impl_->source = s; return *this; } sender_options& sender_options::target(const target_options &s) {impl_->target = s; return *this; } sender_options& sender_options::name(const std::string &s) {impl_->name = s; return *this; } void sender_options::apply(sender& s) const { impl_->apply(s); } const std::string* sender_options::get_name() const { return impl_->name.set ? &impl_->name.value : 0; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/sender.cpp0000664000000000000000000000517113257152177017650 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/sender.hpp" #include "proton/link.hpp" #include "proton/sender_options.hpp" #include "proton/source.hpp" #include "proton/target.hpp" #include "proton/tracker.hpp" #include #include #include #include "proton_bits.hpp" #include "contexts.hpp" #include namespace proton { sender::sender(pn_link_t *l): link(make_wrapper(l)) {} void sender::open() { attach(); } void sender::open(const sender_options &opts) { opts.apply(*this); attach(); } class source sender::source() const { return proton::source(*this); } class target sender::target() const { return proton::target(*this); } namespace { // TODO: revisit if thread safety required uint64_t tag_counter = 0; } tracker sender::send(const message &message) { uint64_t id = ++tag_counter; pn_delivery_t *dlv = pn_delivery(pn_object(), pn_dtag(reinterpret_cast(&id), sizeof(id))); std::vector buf; message.encode(buf); assert(!buf.empty()); pn_link_send(pn_object(), &buf[0], buf.size()); pn_link_advance(pn_object()); if (pn_link_snd_settle_mode(pn_object()) == PN_SND_SETTLED) pn_delivery_settle(dlv); if (!pn_link_credit(pn_object())) link_context::get(pn_object()).draining = false; return make_wrapper(dlv); } void sender::return_credit() { link_context &lctx = link_context::get(pn_object()); lctx.draining = false; pn_link_drained(pn_object()); } sender_iterator sender_iterator::operator++() { if (!!obj_) { pn_link_t *lnk = pn_link_next(obj_.pn_object(), 0); while (lnk) { if (pn_link_is_sender(lnk) && pn_link_session(lnk) == session_) break; lnk = pn_link_next(lnk, 0); } obj_ = lnk; } return *this; } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/scalar_test.hpp0000664000000000000000000002315013257152177020676 0ustar #ifndef SCALAR_TEST_HPP #define SCALAR_TEST_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Template tests used by both scalar_test.cpp and value_test.hpp to test conversion // of scalar values via a proton::scalar or a proton::value. #include "test_bits.hpp" #include "proton/types.hpp" #include "proton/error.hpp" #include namespace test { using namespace proton; // Inserting and extracting simple C++ values using same-type get and coerce template void simple_type_test(T x, type_id tid, const std::string& s, T y) { V vx(x); // Construct from C++ value ASSERT_EQUAL(tid, vx.type()); ASSERT(!vx.empty()); ASSERT_EQUAL(x, get(vx)); ASSERT_EQUAL(x, coerce(vx)); V vxa = x; // Assign from C++ value ASSERT_EQUAL(tid, vxa.type()); ASSERT(!vx.empty()); ASSERT_EQUAL(vx, vxa); ASSERT_EQUAL(x, get(vxa)); ASSERT_EQUAL(x, coerce(vxa)); V v2; // Default construct ASSERT(v2.type() == NULL_TYPE); ASSERT(v2.empty()); v2 = x; // Assign from C++ value ASSERT_EQUAL(tid, v2.type()); ASSERT_EQUAL(vx, v2); ASSERT_EQUAL(x, get(v2)); ASSERT_EQUAL(x, coerce(v2)); V v3(vx); // Copy construct ASSERT_EQUAL(tid, v3.type()); ASSERT_EQUAL(vx, v3); ASSERT_EQUAL(x, get(v3)); ASSERT_EQUAL(x, coerce(v3)); V v4 = vx; // Copy assign ASSERT_EQUAL(tid, v4.type()); ASSERT_EQUAL(x, get(v4)); ASSERT_EQUAL(x, coerce(v4)); ASSERT_EQUAL(s, to_string(vx)); // Stringify V vy(y); ASSERT(vx != vy); // Compare ASSERT(vx < vy); ASSERT(vy > vx); } // Test native C/C++ integer types via their mapped integer type ([u]int_x_t) template void simple_integral_test() { typedef typename internal::integer_type::value>::type int_type; simple_type_test(T(3), internal::type_id_of::value, "3", T(4)); } // Test invalid gets, valid same-type get is tested by simple_type_test // Templated to test both scalar and value. template void bad_get_test() { try { get(V(int8_t(1))); FAIL("byte as bool"); } catch (conversion_error) {} try { get(V(true)); FAIL("bool as uint8_t"); } catch (conversion_error) {} try { get(V(int8_t(1))); FAIL("int8 as uint8"); } catch (conversion_error) {} try { get(V(uint16_t(1))); FAIL("uint16 as int16"); } catch (conversion_error) {} try { get(V(int32_t(1))); FAIL("int32 as int16"); } catch (conversion_error) {} try { get(V(std::string())); FAIL("string as symbol"); } catch (conversion_error) {} try { get(V(binary())); FAIL("binary as string"); } catch (conversion_error) {} try { get(V(symbol())); FAIL("symbol as binary"); } catch (conversion_error) {} try { get(V(timestamp())); FAIL("timestamp as binary"); } catch (conversion_error) {} try { get(V(timestamp())); FAIL("timestamp as int"); } catch (conversion_error) {} try { get(V(0)); FAIL("int as timestamp"); } catch (conversion_error) {} try { get(V(std::string())); FAIL("string as timestamp"); } catch (conversion_error) {} } // Test some valid coercions and some bad ones with mixed types. // Templated to test both scalar and value. template void coerce_test() { // Valid C++ conversions should work with coerce. ASSERT_EQUAL(false, coerce(V(0))); ASSERT_EQUAL(true, coerce(V(-1))); ASSERT_EQUAL(true, coerce(V(int64_t(0xFFFF0000)))); ASSERT_EQUAL(1, coerce(V(uint64_t(1)))); // In range. ASSERT_EQUAL(1, coerce(V(uint32_t(0xFF01)))); // int truncate. ASSERT_EQUAL(0xFFFF, coerce(V(int8_t(-1)))); // Sign extend. ASSERT_EQUAL(-1, coerce(V(uint64_t(0xFFFFFFFFul)))); // 2s complement ASSERT_EQUALISH(1.2f, coerce(V(double(1.2))), 0.001f); ASSERT_EQUALISH(3.4, coerce(V(float(3.4))), 0.001); ASSERT_EQUALISH(23.0, coerce(V(uint64_t(23))), 0.001); // int to double. ASSERT_EQUAL(-1945, coerce(V(float(-1945.123)))); // round to int. // String-like conversions. ASSERT_EQUAL(std::string("foo"), coerce(V(symbol("foo")))); ASSERT_EQUAL(std::string("foo"), coerce(V(binary("foo")))); // Bad coercions, types are not `is_convertible` V s("foo"); try { coerce(s); FAIL("string as bool"); } catch (conversion_error) {} try { coerce(s); FAIL("string as int"); } catch (conversion_error) {} try { coerce(s); FAIL("string as double"); } catch (conversion_error) {} try { coerce(V(0)); FAIL("int as string"); } catch (conversion_error) {} try { coerce(V(true)); FAIL("bool as symbol"); } catch (conversion_error) {} try { coerce(V(0.0)); FAIL("double as binary"); } catch (conversion_error) {} try { coerce(V(binary())); FAIL("binary as symbol"); } catch (conversion_error) {} try { coerce(V(symbol())); FAIL("symbol as binary"); } catch (conversion_error) {} try { coerce(s); } catch (conversion_error) {} try { coerce(s); } catch (conversion_error) {} } template void null_test() { V v; ASSERT(v.empty()); ASSERT_EQUAL(NULL_TYPE, v.type()); get(v); null n; get(v, n); V v2(n); ASSERT(v.empty()); ASSERT_EQUAL(NULL_TYPE, v.type()); v = "foo"; ASSERT_EQUAL(STRING, v.type()); try { get(v); FAIL("Expected conversion_error"); } catch (conversion_error) {} v = null(); get(v); } // Nasty hack for uninterpreted decimal<> types. template T make(const char c) { T x; std::fill(x.begin(), x.end(), c); return x; } template void scalar_test_group(int& failed) { // Direct AMQP-mapped types. RUN_TEST(failed, simple_type_test(false, BOOLEAN, "false", true)); RUN_TEST(failed, simple_type_test(uint8_t(42), UBYTE, "42", uint8_t(50))); RUN_TEST(failed, simple_type_test(int8_t(-42), BYTE, "-42", int8_t(-40))); RUN_TEST(failed, simple_type_test(uint16_t(4242), USHORT, "4242", uint16_t(5252))); RUN_TEST(failed, simple_type_test(int16_t(-4242), SHORT, "-4242", int16_t(3))); RUN_TEST(failed, simple_type_test(uint32_t(4242), UINT, "4242", uint32_t(5252))); RUN_TEST(failed, simple_type_test(int32_t(-4242), INT, "-4242", int32_t(3))); RUN_TEST(failed, simple_type_test(uint64_t(4242), ULONG, "4242", uint64_t(5252))); RUN_TEST(failed, simple_type_test(int64_t(-4242), LONG, "-4242", int64_t(3))); RUN_TEST(failed, simple_type_test(wchar_t('X'), CHAR, "88", wchar_t('Y'))); RUN_TEST(failed, simple_type_test(float(1.234), FLOAT, "1.234", float(2.345))); RUN_TEST(failed, simple_type_test(double(11.2233), DOUBLE, "11.2233", double(12))); RUN_TEST(failed, simple_type_test(timestamp(1234), TIMESTAMP, "1234", timestamp(12345))); RUN_TEST(failed, simple_type_test(make(1), DECIMAL32, "decimal32(0x01010101)", make(2))); RUN_TEST(failed, simple_type_test(make(3), DECIMAL64, "decimal64(0x0303030303030303)", make(4))); RUN_TEST(failed, simple_type_test(make(5), DECIMAL128, "decimal128(0x05050505050505050505050505050505)", make(6))); RUN_TEST(failed, simple_type_test( uuid::copy("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), UUID, "00112233-4455-6677-8899-aabbccddeeff", uuid::copy("\xff\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"))); RUN_TEST(failed, simple_type_test(std::string("xxx"), STRING, "xxx", std::string("yyy"))); RUN_TEST(failed, simple_type_test(symbol("aaa"), SYMBOL, "aaa", symbol("aaaa"))); RUN_TEST(failed, simple_type_test(binary("\010aaa"), BINARY, "b\"\\x08aaa\"", binary("aaaa"))); // Test native C++ integral types. RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); #if PN_CPP_HAS_LONG_LONG_TYPE RUN_TEST(failed, (simple_integral_test())); RUN_TEST(failed, (simple_integral_test())); #endif RUN_TEST(failed, (coerce_test())); RUN_TEST(failed, (null_test())); RUN_TEST(failed, (bad_get_test())); } } #endif // SCALAR_TEST_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/scalar_test.cpp0000664000000000000000000000455213257152177020676 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "scalar_test.hpp" namespace { using namespace std; using namespace proton; using test::scalar_test_group; // NOTE: proton::coerce<> and bad proton::get() are tested in value_test to avoid redundant test code. void encode_decode_test() { value v; scalar a("foo"); v = a; // Assignment to value does encode, get<> does decode. ASSERT_EQUAL(v, a); ASSERT_EQUAL(std::string("foo"), get(v)); scalar a2 = get(v); ASSERT_EQUAL(std::string("foo"), get(a2)); } void message_id_test() { ASSERT_EQUAL(23, coerce(message_id(23))); ASSERT_EQUAL(23u, get(message_id(23))); ASSERT(message_id("foo") != message_id(binary("foo"))); ASSERT_EQUAL(scalar("foo"), message_id("foo")); ASSERT_EQUAL("foo", coerce(message_id("foo"))); ASSERT(message_id("a") < message_id("z")); uuid r = uuid::random(); ASSERT_EQUAL(r, get(message_id(r))); } void annotation_key_test() { ASSERT_EQUAL(23, coerce(annotation_key(23))); ASSERT_EQUAL(23u, get(annotation_key(23))); ASSERT_EQUAL("foo", coerce(annotation_key("foo"))); ASSERT_EQUAL(scalar(symbol("foo")), annotation_key("foo")); } template T make(const char c) { T x; std::fill(x.begin(), x.end(), c); return x; } } int main(int, char**) { int failed = 0; scalar_test_group(failed); RUN_TEST(failed, encode_decode_test()); RUN_TEST(failed, message_id_test()); RUN_TEST(failed, annotation_key_test()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/scalar_base.cpp0000664000000000000000000001645313257152177020634 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "msg.hpp" #include "types_internal.hpp" #include "proton/binary.hpp" #include "proton/decimal.hpp" #include "proton/internal/type_traits.hpp" #include "proton/scalar_base.hpp" #include "proton/symbol.hpp" #include "proton/timestamp.hpp" #include "proton/uuid.hpp" #include #include namespace proton { scalar_base::scalar_base() { atom_.type = PN_NULL; } scalar_base::scalar_base(const pn_atom_t& a) { set(a); } scalar_base::scalar_base(const scalar_base& x) { set(x.atom_); } scalar_base& scalar_base::operator=(const scalar_base& x) { if (this != &x) set(x.atom_); return *this; } type_id scalar_base::type() const { return type_id(atom_.type); } bool scalar_base::empty() const { return type() == NULL_TYPE; } void scalar_base::set(const binary& x, pn_type_t t) { atom_.type = t; bytes_ = x; atom_.u.as_bytes = pn_bytes(bytes_); } void scalar_base::set(const pn_atom_t& atom) { if (type_id_is_string_like(type_id(atom.type))) { set(bin(atom.u.as_bytes), atom.type); } else { atom_ = atom; bytes_.clear(); } } void scalar_base::put_(bool x) { atom_.u.as_bool = x; atom_.type = PN_BOOL; } void scalar_base::put_(uint8_t x) { atom_.u.as_ubyte = x; atom_.type = PN_UBYTE; } void scalar_base::put_(int8_t x) { atom_.u.as_byte = x; atom_.type = PN_BYTE; } void scalar_base::put_(uint16_t x) { atom_.u.as_ushort = x; atom_.type = PN_USHORT; } void scalar_base::put_(int16_t x) { atom_.u.as_short = x; atom_.type = PN_SHORT; } void scalar_base::put_(uint32_t x) { atom_.u.as_uint = x; atom_.type = PN_UINT; } void scalar_base::put_(int32_t x) { atom_.u.as_int = x; atom_.type = PN_INT; } void scalar_base::put_(uint64_t x) { atom_.u.as_ulong = x; atom_.type = PN_ULONG; } void scalar_base::put_(int64_t x) { atom_.u.as_long = x; atom_.type = PN_LONG; } void scalar_base::put_(wchar_t x) { atom_.u.as_char = x; atom_.type = PN_CHAR; } void scalar_base::put_(float x) { atom_.u.as_float = x; atom_.type = PN_FLOAT; } void scalar_base::put_(double x) { atom_.u.as_double = x; atom_.type = PN_DOUBLE; } void scalar_base::put_(timestamp x) { atom_.u.as_timestamp = x.milliseconds(); atom_.type = PN_TIMESTAMP; } void scalar_base::put_(const decimal32& x) { byte_copy(atom_.u.as_decimal32, x); atom_.type = PN_DECIMAL32;; } void scalar_base::put_(const decimal64& x) { byte_copy(atom_.u.as_decimal64, x); atom_.type = PN_DECIMAL64; } void scalar_base::put_(const decimal128& x) { byte_copy(atom_.u.as_decimal128, x); atom_.type = PN_DECIMAL128; } void scalar_base::put_(const uuid& x) { byte_copy(atom_.u.as_uuid, x); atom_.type = PN_UUID; } void scalar_base::put_(const std::string& x) { set(binary(x), PN_STRING); } void scalar_base::put_(const symbol& x) { set(binary(x), PN_SYMBOL); } void scalar_base::put_(const binary& x) { set(x, PN_BINARY); } void scalar_base::put_(const char* x) { set(binary(std::string(x)), PN_STRING); } void scalar_base::put_(const null&) { atom_.type = PN_NULL; } void scalar_base::ok(pn_type_t t) const { if (atom_.type != t) throw make_conversion_error(type_id(t), type()); } void scalar_base::get_(bool& x) const { ok(PN_BOOL); x = atom_.u.as_bool; } void scalar_base::get_(uint8_t& x) const { ok(PN_UBYTE); x = atom_.u.as_ubyte; } void scalar_base::get_(int8_t& x) const { ok(PN_BYTE); x = atom_.u.as_byte; } void scalar_base::get_(uint16_t& x) const { ok(PN_USHORT); x = atom_.u.as_ushort; } void scalar_base::get_(int16_t& x) const { ok(PN_SHORT); x = atom_.u.as_short; } void scalar_base::get_(uint32_t& x) const { ok(PN_UINT); x = atom_.u.as_uint; } void scalar_base::get_(int32_t& x) const { ok(PN_INT); x = atom_.u.as_int; } void scalar_base::get_(wchar_t& x) const { ok(PN_CHAR); x = wchar_t(atom_.u.as_char); } void scalar_base::get_(uint64_t& x) const { ok(PN_ULONG); x = atom_.u.as_ulong; } void scalar_base::get_(int64_t& x) const { ok(PN_LONG); x = atom_.u.as_long; } void scalar_base::get_(timestamp& x) const { ok(PN_TIMESTAMP); x = atom_.u.as_timestamp; } void scalar_base::get_(float& x) const { ok(PN_FLOAT); x = atom_.u.as_float; } void scalar_base::get_(double& x) const { ok(PN_DOUBLE); x = atom_.u.as_double; } void scalar_base::get_(decimal32& x) const { ok(PN_DECIMAL32); byte_copy(x, atom_.u.as_decimal32); } void scalar_base::get_(decimal64& x) const { ok(PN_DECIMAL64); byte_copy(x, atom_.u.as_decimal64); } void scalar_base::get_(decimal128& x) const { ok(PN_DECIMAL128); byte_copy(x, atom_.u.as_decimal128); } void scalar_base::get_(uuid& x) const { ok(PN_UUID); byte_copy(x, atom_.u.as_uuid); } void scalar_base::get_(std::string& x) const { ok(PN_STRING); x = std::string(bytes_.begin(), bytes_.end()); } void scalar_base::get_(symbol& x) const { ok(PN_SYMBOL); x = symbol(bytes_.begin(), bytes_.end()); } void scalar_base::get_(binary& x) const { ok(PN_BINARY); x = bytes_; } void scalar_base::get_(null&) const { ok(PN_NULL); } namespace { struct equal_op { const scalar_base& x; equal_op(const scalar_base& s) : x(s) {} template bool operator()(const T& y) { return (internal::get(x) == y); } }; struct less_op { const scalar_base& x; less_op(const scalar_base& s) : x(s) {} template bool operator()(const T& y) { return (y < internal::get(x)); } }; struct ostream_op { std::ostream& o; ostream_op(std::ostream& o_) : o(o_) {} template std::ostream& operator()(const T& x) { return o << x; } }; } // namespace bool operator==(const scalar_base& x, const scalar_base& y) { if (x.type() != y.type()) return false; if (x.type() == NULL_TYPE) return true; return internal::visit(x, equal_op(y)); } bool operator<(const scalar_base& x, const scalar_base& y) { if (x.type() != y.type()) return x.type() < y.type(); if (x.type() == NULL_TYPE) return false; return internal::visit(x, less_op(y)); } std::ostream& operator<<(std::ostream& o, const scalar_base& s) { switch (s.type()) { case NULL_TYPE: return o << ""; case BYTE: return o << static_cast(internal::get(s)); case UBYTE: return o << static_cast(internal::get(s)); // Other types printed using normal C++ operator << default: return internal::visit(s, ostream_op(o)); } } namespace internal { conversion_error make_coercion_error(const char* cpp, type_id amqp) { return conversion_error(std::string("invalid proton::coerce<") + cpp + ">(" + type_name(amqp) + ")"); } } // internal std::string to_string(const scalar_base& x) { std::ostringstream os; os << std::boolalpha << x; return os.str(); } } // proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/sasl.cpp0000664000000000000000000000234513257152177017332 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/sasl.hpp" namespace proton { enum sasl::outcome sasl::outcome() const { return static_cast(pn_sasl_outcome(object_)); } std::string sasl::user() const { const char *name = pn_sasl_get_user(object_); return name ? std::string(name) : std::string(); } std::string sasl::mech() const { const char *m = pn_sasl_get_mech(object_); return m ? std::string(m) : std::string(); } } // namespace qpid-proton-0.22.0/proton-c/bindings/cpp/src/returned.cpp0000664000000000000000000000276513257152177020226 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton_bits.hpp" #include #include #include #include #include namespace proton { template PN_CPP_EXTERN returned::returned(const returned& x) : ptr_(x.ptr_) {} template PN_CPP_EXTERN returned::operator T() const { return internal::factory::wrap(ptr_); } template returned::returned(typename T::pn_type* p) : ptr_(p) {} // Explicit instantiations for allowed types template class PN_CPP_CLASS_EXTERN returned; template class PN_CPP_CLASS_EXTERN returned; template class PN_CPP_CLASS_EXTERN returned; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/reconnect_test.cpp0000664000000000000000000001706413257152177021413 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_bits.hpp" #include "proton/error_condition.hpp" #include "proton/connection.hpp" #include "proton/connection_options.hpp" #include "proton/container.hpp" #include "proton/delivery.hpp" #include "proton/message.hpp" #include "proton/messaging_handler.hpp" #include "proton/listener.hpp" #include "proton/listen_handler.hpp" #include "proton/reconnect_options.hpp" #include "proton/work_queue.hpp" #include "proton/internal/pn_unique_ptr.hpp" #include #include #include #include #include namespace { // Wait for N things to be done. class waiter { size_t count; public: waiter(size_t n) : count(n) {} void done() { if (--count == 0) ready(); } virtual void ready() = 0; }; class server_connection_handler : public proton::messaging_handler { struct listen_handler : public proton::listen_handler { proton::connection_options opts; std::string url; waiter& listen_waiter; listen_handler(proton::messaging_handler& h, waiter& w) : listen_waiter(w) { opts.handler(h); } void on_open(proton::listener& l) PN_CPP_OVERRIDE { std::ostringstream o; o << "//:" << l.port(); // Connect to the actual listening port url = o.str(); // Schedule rather than call done() direct to ensure serialization l.container().schedule(proton::duration::IMMEDIATE, proton::make_work(&waiter::done, &listen_waiter)); } proton::connection_options on_accept(proton::listener&) PN_CPP_OVERRIDE { return opts; } }; proton::listener listener_; int messages_; int expect_; bool closing_; bool done_; listen_handler listen_handler_; void close (proton::connection &c) { if (closing_) return; c.close(proton::error_condition("amqp:connection:forced", "Failover testing")); closing_ = true; } public: server_connection_handler(proton::container& c, int e, waiter& w) : messages_(0), expect_(e), closing_(false), done_(false), listen_handler_(*this, w) { listener_ = c.listen("//:0", listen_handler_); } std::string url() const { if (listen_handler_.url.empty()) throw std::runtime_error("no url"); return listen_handler_.url; } void on_connection_open(proton::connection &c) PN_CPP_OVERRIDE { // Only listen for a single connection listener_.stop(); if (messages_==expect_) close(c); else c.open(); } void on_message(proton::delivery & d, proton::message & m) PN_CPP_OVERRIDE { ++messages_; proton::connection c = d.connection(); if (messages_==expect_) close(c); } void on_connection_close(proton::connection & c) PN_CPP_OVERRIDE { done_ = true; } void on_transport_error(proton::transport & ) PN_CPP_OVERRIDE { // If we get an error then (try to) stop the listener // - this will stop the listener if we didn't already accept a connection listener_.stop(); } }; class tester : public proton::messaging_handler, public waiter { public: tester() : waiter(3), container_(*this, "reconnect_server") {} void on_container_start(proton::container &c) PN_CPP_OVERRIDE { // Server that fails upon connection s1.reset(new server_connection_handler(c, 0, *this)); // Server that fails on first message s2.reset(new server_connection_handler(c, 1, *this)); // server that doesn't fail in this test s3.reset(new server_connection_handler(c, 100, *this)); } // waiter::ready is called when all 3 listeners are ready. void ready() PN_CPP_OVERRIDE { std::vector urls; urls.push_back(s2->url()); urls.push_back(s3->url()); container_.connect(s1->url(), proton::connection_options().reconnect(proton::reconnect_options().failover_urls(urls))); } void on_connection_open(proton::connection& c) PN_CPP_OVERRIDE { c.open_sender("messages"); } void on_sendable(proton::sender& s) PN_CPP_OVERRIDE { proton::message m; m.body("hello"); s.send(m); } void on_tracker_accept(proton::tracker& d) PN_CPP_OVERRIDE { d.connection().close(); } void run() { container_.run(); } private: proton::internal::pn_unique_ptr s1; proton::internal::pn_unique_ptr s2; proton::internal::pn_unique_ptr s3; proton::container container_; }; int test_failover_simple() { tester().run(); return 0; } } class stop_reconnect_tester : public proton::messaging_handler { public: stop_reconnect_tester() : container_(*this, "reconnect_tester") { } void deferred_stop() { container_.stop(); } void on_container_start(proton::container &c) PN_CPP_OVERRIDE { proton::reconnect_options reconnect_options; c.connect("this-is-not-going-to work.com", proton::connection_options().reconnect(reconnect_options)); c.schedule(proton::duration::SECOND, proton::make_work(&stop_reconnect_tester::deferred_stop, this)); } void run() { container_.run(); } private: proton::container container_; }; int test_stop_reconnect() { stop_reconnect_tester().run(); return 0; } class authfail_reconnect_tester : public proton::messaging_handler, public waiter { public: authfail_reconnect_tester() : waiter(1), container_(*this, "authfail_reconnect_tester"), errored_(false) {} void deferred_stop() { container_.stop(); } void on_container_start(proton::container& c) PN_CPP_OVERRIDE { // This server won't fail in this test s1.reset(new server_connection_handler(c, 100, *this)); c.schedule(proton::duration::SECOND, proton::make_work(&authfail_reconnect_tester::deferred_stop, this)); } void on_transport_error(proton::transport& t) PN_CPP_OVERRIDE { errored_ = true; } void ready() PN_CPP_OVERRIDE { proton::connection_options co; co.sasl_allowed_mechs("PLAIN"); co.reconnect(proton::reconnect_options()); container_.connect(s1->url(), co); } void run() { container_.run(); ASSERT(errored_); } private: proton::container container_; proton::internal::pn_unique_ptr s1; bool errored_; }; int test_auth_fail_reconnect() { authfail_reconnect_tester().run(); return 0; } int main(int argc, char** argv) { int failed = 0; RUN_ARGV_TEST(failed, test_failover_simple()); RUN_ARGV_TEST(failed, test_stop_reconnect()); RUN_ARGV_TEST(failed, test_auth_fail_reconnect()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/reconnect_options_impl.hpp0000664000000000000000000000246313257152177023152 0ustar #ifndef PROTON_CPP_RECONNECT_OPTIONSIMPL_H #define PROTON_CPP_RECONNECT_OPTIONSIMPL_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/duration.hpp" #include #include namespace proton { class reconnect_options::impl { public: impl() : delay(10), delay_multiplier(2.0), max_delay(duration::FOREVER), max_attempts(0) {} duration delay; float delay_multiplier; duration max_delay; int max_attempts; std::vector failover_urls; }; } #endif /*!PROTON_CPP_RECONNECT_OPTIONSIMPL_H*/ qpid-proton-0.22.0/proton-c/bindings/cpp/src/reconnect_options.cpp0000664000000000000000000000342213257152177022120 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/reconnect_options.hpp" #include "reconnect_options_impl.hpp" namespace proton { reconnect_options::reconnect_options() : impl_(new impl()) {} reconnect_options::reconnect_options(const reconnect_options& x) : impl_(new impl()) { *this = x; } reconnect_options::~reconnect_options() {} reconnect_options& reconnect_options::operator=(const reconnect_options& x) { *impl_ = *x.impl_; return *this; } reconnect_options& reconnect_options::delay(duration d) { impl_->delay = d; return *this; } reconnect_options& reconnect_options::delay_multiplier(float f) { impl_->delay_multiplier = f; return *this; } reconnect_options& reconnect_options::max_delay(duration d) { impl_->max_delay = d; return *this; } reconnect_options& reconnect_options::max_attempts(int i) { impl_->max_attempts = i; return *this; } reconnect_options& reconnect_options::failover_urls(const std::vector& urls) { impl_->failover_urls = urls; return *this; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/receiver_options.cpp0000664000000000000000000001172413257152177021750 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/receiver_options.hpp" #include "proton/messaging_handler.hpp" #include "proton/source_options.hpp" #include "proton/target_options.hpp" #include #include "contexts.hpp" #include "proactor_container_impl.hpp" #include "messaging_adapter.hpp" #include "proton_bits.hpp" namespace proton { template struct option { T value; bool set; option() : value(), set(false) {} option& operator=(const T& x) { value = x; set = true; return *this; } void update(const option& x) { if (x.set) *this = x.value; } }; class receiver_options::impl { static link_context& get_context(receiver l) { return link_context::get(unwrap(l)); } static void set_delivery_mode(receiver l, proton::delivery_mode mode) { switch (mode) { case delivery_mode::AT_MOST_ONCE: pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED); break; case delivery_mode::AT_LEAST_ONCE: pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED); pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST); break; default: break; } } public: option handler; option delivery_mode; option auto_accept; option auto_settle; option credit_window; option dynamic_address; option source; option target; option name; void apply(receiver& r) { if (r.uninitialized()) { if (delivery_mode.set) set_delivery_mode(r, delivery_mode.value); if (handler.set && handler.value) container::impl::set_handler(r, handler.value); if (auto_settle.set) get_context(r).auto_settle = auto_settle.value; if (auto_accept.set) get_context(r).auto_accept = auto_accept.value; if (credit_window.set) get_context(r).credit_window = credit_window.value; if (source.set) { proton::source local_s(make_wrapper(pn_link_source(unwrap(r)))); source.value.apply(local_s); } if (target.set) { proton::target local_t(make_wrapper(pn_link_target(unwrap(r)))); target.value.apply(local_t); } } } void update(const impl& x) { handler.update(x.handler); delivery_mode.update(x.delivery_mode); auto_accept.update(x.auto_accept); auto_settle.update(x.auto_settle); credit_window.update(x.credit_window); dynamic_address.update(x.dynamic_address); source.update(x.source); target.update(x.target); } }; receiver_options::receiver_options() : impl_(new impl()) {} receiver_options::receiver_options(const receiver_options& x) : impl_(new impl()) { *this = x; } receiver_options::~receiver_options() {} receiver_options& receiver_options::operator=(const receiver_options& x) { *impl_ = *x.impl_; return *this; } void receiver_options::update(const receiver_options& x) { impl_->update(*x.impl_); } receiver_options& receiver_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; } receiver_options& receiver_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; } receiver_options& receiver_options::auto_accept(bool b) {impl_->auto_accept = b; return *this; } receiver_options& receiver_options::credit_window(int w) {impl_->credit_window = w; return *this; } receiver_options& receiver_options::source(source_options &s) {impl_->source = s; return *this; } receiver_options& receiver_options::target(target_options &s) {impl_->target = s; return *this; } receiver_options& receiver_options::name(const std::string &s) {impl_->name = s; return *this; } void receiver_options::apply(receiver& r) const { impl_->apply(r); } const std::string* receiver_options::get_name() const { return impl_->name.set ? &impl_->name.value : 0; } // No-op, kept for binary compat but auto_settle is not relevant to receiver only sender. receiver_options& receiver_options::auto_settle(bool b) { return *this; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/receiver.cpp0000664000000000000000000000532413257152177020174 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/receiver.hpp" #include "proton/error.hpp" #include "proton/link.hpp" #include "proton/receiver_options.hpp" #include "proton/source.hpp" #include "proton/target.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include "contexts.hpp" #include #include #include #include namespace proton { receiver::receiver(pn_link_t* r): link(make_wrapper(r)) {} void receiver::open() { attach(); } void receiver::open(const receiver_options &opts) { opts.apply(*this); attach(); } class source receiver::source() const { return proton::source(*this); } class target receiver::target() const { return proton::target(*this); } void receiver::add_credit(uint32_t credit) { link_context &ctx = link_context::get(pn_object()); if (ctx.draining) ctx.pending_credit += credit; else pn_link_flow(pn_object(), credit); } void receiver::drain() { link_context &ctx = link_context::get(pn_object()); if (ctx.draining) throw proton::error("drain already in progress"); else { ctx.draining = true; if (credit() > 0) pn_link_set_drain(pn_object(), true); else { // Drain is already complete. No state to communicate over the wire. // Create dummy flow event where "drain finish" can be detected. pn_connection_t *pnc = pn_session_connection(pn_link_session(pn_object())); pn_collector_put(pn_connection_collector(pnc), PN_OBJECT, pn_object(), PN_LINK_FLOW); } } } receiver_iterator receiver_iterator::operator++() { if (!!obj_) { pn_link_t *lnk = pn_link_next(obj_.pn_object(), 0); while (lnk) { if (pn_link_is_receiver(lnk) && pn_link_session(lnk) == session_) break; lnk = pn_link_next(lnk, 0); } obj_ = lnk; } return *this; } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/proton_bits.hpp0000664000000000000000000001304413257152177020735 0ustar #ifndef PROTON_BITS_HPP #define PROTON_BITS_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include #include "contexts.hpp" /**@file * * Assorted internal proton utilities. */ struct pn_error_t; struct pn_data_t; struct pn_transport_t; struct pn_sasl_t; struct pn_ssl_t; struct pn_connection_t; struct pn_session_t; struct pn_link_t; struct pn_delivery_t; struct pn_condition_t; struct pn_acceptor_t; struct pn_terminus_t; struct pn_reactor_t; struct pn_record_t; namespace proton { namespace internal { class data; } class transport; class sasl; class ssl; class connection; class session; class link; class sender; class receiver; class transfer; class tracker; class delivery; class error_condition; class acceptor; class terminus; class source; class target; class reactor; class messaging_handler; std::string error_str(long code); /** Print the error string from pn_error_t, or from code if pn_error_t has no error. */ std::string error_str(pn_error_t*, long code=0); /** Make a void* inspectable via operator <<. */ struct inspectable { void* value; inspectable(void* o) : value(o) {} }; /** Stream a proton object via pn_inspect. */ std::ostream& operator<<(std::ostream& o, const inspectable& object); void set_error_condition(const error_condition&, pn_condition_t*); /// Convert a const char* to std::string, convert NULL to the empty string. inline std::string str(const char* s) { return s ? s : std::string(); } namespace internal { // These traits relate the wrapped and wrapper classes for the templated factories below template struct wrapped {}; template <> struct wrapped { typedef pn_data_t type; }; template <> struct wrapped { typedef pn_transport_t type; }; template <> struct wrapped { typedef pn_connection_t type; }; template <> struct wrapped { typedef pn_session_t type; }; template <> struct wrapped { typedef pn_link_t type; }; template <> struct wrapped { typedef pn_link_t type; }; template <> struct wrapped { typedef pn_link_t type; }; template <> struct wrapped { typedef pn_delivery_t type; }; template <> struct wrapped { typedef pn_delivery_t type; }; template <> struct wrapped { typedef pn_delivery_t type; }; template <> struct wrapped { typedef pn_condition_t type; }; template <> struct wrapped { typedef pn_terminus_t type; }; template <> struct wrapped { typedef pn_terminus_t type; }; template <> struct wrapped { typedef pn_terminus_t type; }; template struct wrapper {}; template <> struct wrapper { typedef internal::data type; }; template <> struct wrapper { typedef transport type; }; template <> struct wrapper { typedef connection type; }; template <> struct wrapper { typedef session type; }; template <> struct wrapper { typedef link type; }; template <> struct wrapper { typedef transfer type; }; template <> struct wrapper { typedef error_condition type; }; template <> struct wrapper { typedef terminus type; }; // Factory for wrapper types template class factory { public: static T wrap(typename wrapped::type* t) { return t; } static typename wrapped::type* unwrap(const T& t) { return t.pn_object(); } }; template struct context {}; template <> struct context {typedef link_context type; }; template <> struct context {typedef link_context type; }; template <> struct context {typedef link_context type; }; template <> struct context {typedef session_context type; }; template <> struct context {typedef connection_context type; }; template inline void set_messaging_handler(T t, messaging_handler* mh) { context::type::get(factory::unwrap(t)).handler = mh; } template inline messaging_handler* get_messaging_handler(T* t) { return context::type>::type::get(t).handler; } class returned_factory { public: template static returned make(typename internal::wrapped::type* pn) { return returned(pn); } }; } // namespace internal template typename internal::wrapper::type make_wrapper(T* t) { return internal::factory::type>::wrap(t); } template U make_wrapper(typename internal::wrapped::type* t) { return internal::factory::wrap(t); } template typename internal::wrapped::type* unwrap(const T& t) { return internal::factory::unwrap(t); } template returned make_returned(typename internal::wrapped::type* pn) { return internal::returned_factory::make(pn); } } #endif // PROTON_BITS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/proton_bits.cpp0000664000000000000000000000433113257152177020727 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton_bits.hpp" #include "proton/error_condition.hpp" #include #include #include #include #include namespace proton { std::string error_str(long code) { switch (code) { case 0: return "ok"; case PN_EOS: return "end of data stream"; case PN_ERR: return "error"; case PN_OVERFLOW: return "overflow"; case PN_UNDERFLOW: return "underflow"; case PN_STATE_ERR: return "invalid state"; case PN_ARG_ERR: return "invalid argument"; case PN_TIMEOUT: return "timeout"; case PN_INTR: return "interrupt"; default: return "unknown error code"; } } std::string error_str(pn_error_t* err, long code) { if (err && pn_error_code(err)) { const char* text = pn_error_text(err); return text ? std::string(text) : error_str(pn_error_code(err)); } return error_str(code); } std::ostream& operator<<(std::ostream& o, const inspectable& object) { pn_string_t* str = pn_string(""); pn_inspect(object.value, str); o << pn_string_get(str); pn_free(str); return o; } void set_error_condition(const error_condition& e, pn_condition_t *c) { pn_condition_clear(c); if (!e.name().empty()) { pn_condition_set_name(c, e.name().c_str()); } if (!e.description().empty()) { pn_condition_set_description(c, e.description().c_str()); } value(pn_condition_info(c)) = e.properties(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/proactor_work_queue_impl.hpp0000664000000000000000000000232513257152177023513 0ustar #ifndef PROTON_CPP_EVENT_LOOP_IMPL_HPP #define PROTON_CPP_EVENT_LOOP_IMPL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/fwd.hpp" namespace proton { class work_queue::impl { public: virtual ~impl() {}; virtual bool add(work f) = 0; void add_void(work f) { add(f); } virtual void schedule(duration, work) = 0; virtual void run_all_jobs() = 0; virtual void finished() = 0; }; } #endif // PROTON_CPP_EVENT_LOOP_IMPL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/proactor_container_impl.hpp0000664000000000000000000001300713257152177023306 0ustar #ifndef PROTON_CPP_PROACTOR_CONTAINERIMPL_H #define PROTON_CPP_PROACTOR_CONTAINERIMPL_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/fwd.hpp" #include "proton/container.hpp" #include "proton/connection.hpp" #include "proton/connection_options.hpp" #include "proton/duration.hpp" #include "proton/error_condition.hpp" #include "proton/messaging_handler.hpp" #include "proton/receiver.hpp" #include "proton/receiver_options.hpp" #include "proton/sender.hpp" #include "proton/sender_options.hpp" #include "proton/work_queue.hpp" #include "proton_bits.hpp" #include #include #include #include #include #if PN_CPP_SUPPORTS_THREADS #include # define MUTEX(x) std::mutex x; # define GUARD(x) std::lock_guard g(x) # define ONCE_FLAG(x) std::once_flag x; # define CALL_ONCE(x, ...) std::call_once(x, __VA_ARGS__) #else # define MUTEX(x) # define GUARD(x) # define ONCE_FLAG(x) # define CALL_ONCE(x, f, o) ((o)->*(f))() #endif struct pn_proactor_t; struct pn_listener_t; struct pn_event_t; namespace proton { namespace internal { class connector; } class container::impl { public: impl(container& c, const std::string& id, messaging_handler* = 0); ~impl(); std::string id() const { return id_; } returned connect(const std::string&, const connection_options&); returned open_sender( const std::string&, const proton::sender_options &, const connection_options &); returned open_receiver( const std::string&, const proton::receiver_options &, const connection_options &); listener listen(const std::string&); listener listen(const std::string&, const connection_options& lh); listener listen(const std::string&, listen_handler& lh); void client_connection_options(const connection_options &); connection_options client_connection_options() const { return client_connection_options_; } void server_connection_options(const connection_options &); connection_options server_connection_options() const { return server_connection_options_; } void sender_options(const proton::sender_options&); class sender_options sender_options() const { return sender_options_; } void receiver_options(const proton::receiver_options&); class receiver_options receiver_options() const { return receiver_options_; } void run(int threads); void stop(const error_condition& err); void auto_stop(bool set); void schedule(duration, work); template static void set_handler(T s, messaging_handler* h); template static messaging_handler* get_handler(T s); static work_queue::impl* make_work_queue(container&); private: class common_work_queue; class connection_work_queue; class container_work_queue; pn_listener_t* listen_common_lh(const std::string&); pn_connection_t* make_connection_lh(const url& url, const connection_options&); void setup_connection_lh(const url& url, pn_connection_t *pnc); void start_connection(const url& url, pn_connection_t* c); void reconnect(pn_connection_t* pnc); duration next_delay(reconnect_context& rc); bool setup_reconnect(pn_connection_t* pnc); void reset_reconnect(pn_connection_t* pnc); // Event loop to run in each container thread void thread(); bool handle(pn_event_t*); void run_timer_jobs(); int threads_; container& container_; MUTEX(lock_) ONCE_FLAG(start_once_) ONCE_FLAG(stop_once_) void start_event(); void stop_event(); typedef std::set work_queues; work_queues work_queues_; MUTEX(work_queues_lock_) container_work_queue* add_work_queue(); void remove_work_queue(container_work_queue*); struct scheduled { timestamp time; // duration from epoch for task work task; // We want to get to get the *earliest* first so test is "reversed" bool operator < (const scheduled& r) const { return r.time < time; } }; std::vector deferred_; // This vector is kept as a heap MUTEX(deferred_lock_) pn_proactor_t* proactor_; messaging_handler* handler_; std::string id_; connection_options client_connection_options_; connection_options server_connection_options_; proton::sender_options sender_options_; proton::receiver_options receiver_options_; error_condition disconnect_error_; unsigned reconnecting_; bool auto_stop_; bool stopping_; friend class connector; }; template void container::impl::set_handler(T s, messaging_handler* mh) { internal::set_messaging_handler(s, mh); } template messaging_handler* container::impl::get_handler(T s) { return internal::get_messaging_handler(s); } } #endif /*!PROTON_CPP_PROACTOR_CONTAINERIMPL_H*/ qpid-proton-0.22.0/proton-c/bindings/cpp/src/proactor_container_impl.cpp0000664000000000000000000006154113257152177023307 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proactor_container_impl.hpp" #include "proactor_work_queue_impl.hpp" #include "proton/error_condition.hpp" #include "proton/listener.hpp" #include "proton/listen_handler.hpp" #include "proton/reconnect_options.hpp" #include "proton/url.hpp" #include "proton/connection.h" #include "proton/listener.h" #include "proton/proactor.h" #include "proton/transport.h" #include "contexts.hpp" #include "messaging_adapter.hpp" #include "reconnect_options_impl.hpp" #include "proton_bits.hpp" #include #include #include #include #if PN_CPP_SUPPORTS_THREADS # include #endif #if PN_CPP_HAS_HEADER_RANDOM # include #endif // XXXX: Debug //#include namespace proton { class container::impl::common_work_queue : public work_queue::impl { public: common_work_queue(container::impl& c): container_(c), finished_(false), running_(false) {} typedef std::vector jobs; void run_all_jobs(); void finished() { GUARD(lock_); finished_ = true; } void schedule(duration, work); MUTEX(lock_) container::impl& container_; jobs jobs_; bool finished_; bool running_; }; void container::impl::common_work_queue::schedule(duration d, work f) { // Note this is an unbounded work queue. // A resource-safe implementation should be bounded. if (finished_) return; container_.schedule(d, make_work(&work_queue::impl::add_void, (work_queue::impl*)this, f)); } void container::impl::common_work_queue::run_all_jobs() { jobs j; // Lock this operation for mt { GUARD(lock_); // Ensure that we never run work from this queue concurrently if (running_) return; running_ = true; // But allow adding to the queue concurrently to running std::swap(j, jobs_); } // Run queued work, but ignore any exceptions for (jobs::iterator f = j.begin(); f != j.end(); ++f) try { (*f)(); } catch (...) {}; { GUARD(lock_); running_ = false; } return; } class container::impl::connection_work_queue : public common_work_queue { public: connection_work_queue(container::impl& ct, pn_connection_t* c): common_work_queue(ct), connection_(c) {} bool add(work f); pn_connection_t* connection_; }; bool container::impl::connection_work_queue::add(work f) { // Note this is an unbounded work queue. // A resource-safe implementation should be bounded. GUARD(lock_); if (finished_) return false; jobs_.push_back(f); pn_connection_wake(connection_); return true; } class container::impl::container_work_queue : public common_work_queue { public: container_work_queue(container::impl& c): common_work_queue(c) {} ~container_work_queue() { container_.remove_work_queue(this); } bool add(work f); }; bool container::impl::container_work_queue::add(work f) { // Note this is an unbounded work queue. // A resource-safe implementation should be bounded. GUARD(lock_); if (finished_) return false; jobs_.push_back(f); pn_proactor_set_timeout(container_.proactor_, 0); return true; } class work_queue::impl* container::impl::make_work_queue(container& c) { return c.impl_->add_work_queue(); } container::impl::impl(container& c, const std::string& id, messaging_handler* mh) : threads_(0), container_(c), proactor_(pn_proactor()), handler_(mh), id_(id), reconnecting_(0), auto_stop_(true), stopping_(false) {} container::impl::~impl() { pn_proactor_free(proactor_); } container::impl::container_work_queue* container::impl::add_work_queue() { container_work_queue* c = new container_work_queue(*this); GUARD(work_queues_lock_); work_queues_.insert(c); return c; } void container::impl::remove_work_queue(container::impl::container_work_queue* l) { GUARD(work_queues_lock_); work_queues_.erase(l); } void container::impl::setup_connection_lh(const url& url, pn_connection_t *pnc) { pn_connection_set_container(pnc, id_.c_str()); pn_connection_set_hostname(pnc, url.host().c_str()); if (!url.user().empty()) pn_connection_set_user(pnc, url.user().c_str()); if (!url.password().empty()) pn_connection_set_password(pnc, url.password().c_str()); } pn_connection_t* container::impl::make_connection_lh( const url& url, const connection_options& user_opts) { if (stopping_) throw proton::error("container is stopping"); connection_options opts = client_connection_options_; // Defaults opts.update(user_opts); messaging_handler* mh = opts.handler(); pn_connection_t *pnc = pn_connection(); connection_context& cc(connection_context::get(pnc)); cc.container = &container_; cc.handler = mh; cc.work_queue_ = new container::impl::connection_work_queue(*container_.impl_, pnc); cc.connected_address_ = url; cc.connection_options_.reset(new connection_options(opts)); setup_connection_lh(url, pnc); make_wrapper(pnc).open(opts); return pnc; // 1 refcount from pn_connection() } // Takes ownership of pnc // // NOTE: After the call to start_connection() pnc is active in a proactor thread, // and may even have been freed already. It is undefined to use pnc (or any // object belonging to it) except in appropriate handlers. // // SUBTLE NOTE: There must not be any proton::object wrappers in scope when // start_connection() is called. The wrapper destructor will call pn_decref() // after start_connection() which is undefined! // void container::impl::start_connection(const url& url, pn_connection_t *pnc) { char caddr[PN_MAX_ADDR]; pn_proactor_addr(caddr, sizeof(caddr), url.host().c_str(), url.port().c_str()); pn_transport_t* pnt = pn_transport(); connection_context& cc = connection_context::get(pnc); connection_options& co = *cc.connection_options_; co.apply_unbound_client(pnt); pn_proactor_connect2(proactor_, pnc, pnt, caddr); // Takes ownership of pnc, pnt } void container::impl::reconnect(pn_connection_t* pnc) { --reconnecting_; if (stopping_ && reconnecting_==0) { pn_connection_free(pnc); //TODO: We've lost the error - we should really propagate it here pn_proactor_disconnect(proactor_, NULL); return; } connection_context& cc = connection_context::get(pnc); reconnect_context& rc = *cc.reconnect_context_.get(); const reconnect_options::impl& roi = *rc.reconnect_options_->impl_; // Figure out next connection url to try // rc.current_url_ == -1 means try the url specified in connect, not a failover url const proton::url url(rc.current_url_==-1 ? cc.connected_address_ : roi.failover_urls[rc.current_url_]); // XXXX Debug: //std::cout << "Retries: " << rc.retries_ << " Delay: " << rc.delay_ << " Trying: " << url << std::endl; setup_connection_lh(url, pnc); make_wrapper(pnc).open(*cc.connection_options_); start_connection(url, pnc); // Did we go through all the urls? if (rc.current_url_==int(roi.failover_urls.size())-1) { rc.current_url_ = -1; ++rc.retries_; } else { ++rc.current_url_; } } namespace { #if PN_CPP_HAS_HEADER_RANDOM && PN_CPP_HAS_THREAD_LOCAL duration random_between(duration min, duration max) { static thread_local std::default_random_engine gen; std::uniform_int_distribution dist{min.milliseconds(), max.milliseconds()}; return duration(dist(gen)); } #else duration random_between(duration, duration max) { return max; } #endif } duration container::impl::next_delay(reconnect_context& rc) { // If we've not retried before do it immediately if (rc.retries_==0) return duration(0); // If we haven't tried all failover urls yet this round do it immediately if (rc.current_url_!=-1) return duration(0); const reconnect_options::impl& roi = *rc.reconnect_options_->impl_; if (rc.retries_==1) { rc.delay_ = roi.delay; } else { rc.delay_ = std::min(roi.max_delay, rc.delay_ * roi.delay_multiplier); } return random_between(roi.delay, rc.delay_); } void container::impl::reset_reconnect(pn_connection_t* pnc) { connection_context& cc = connection_context::get(pnc); reconnect_context* rc = cc.reconnect_context_.get(); if (!rc) return; rc->delay_ = 0; rc->retries_ = 0; rc->current_url_ = -1; } bool container::impl::setup_reconnect(pn_connection_t* pnc) { // If container stopping don't try to reconnect // - we pretend to have set up a reconnect attempt so // that the proactor disconnect will finish and we will exit // the run loop without error. { GUARD(lock_); if (stopping_) return true; } connection_context& cc = connection_context::get(pnc); reconnect_context* rc = cc.reconnect_context_.get(); // If reconnect not enabled just fail if (!rc) return false; const reconnect_options::impl& roi = *rc->reconnect_options_->impl_; pn_transport_t* t = pn_connection_transport(pnc); pn_condition_t* condition = pn_transport_condition(t); // If we failed to authenticate then don't reconnect any more and just fail if ( !strcmp(pn_condition_get_name(condition), "amqp:unauthorized-access") ) return false; // If too many reconnect attempts just fail if ( roi.max_attempts != 0 && rc->retries_ >= roi.max_attempts) { pn_condition_format(condition, "proton:io", "Too many reconnect attempts (%d)", rc->retries_); return false; } // Recover connection from proactor pn_proactor_release_connection(pnc); // Figure out delay till next reconnect duration delay = next_delay(*rc); // Schedule reconnect - can do this on container work queue as no one can have the connection // now anyway schedule(delay, make_work(&container::impl::reconnect, this, pnc)); ++reconnecting_; return true; } returned container::impl::connect( const std::string& addr, const proton::connection_options& user_opts) { proton::url url(addr); pn_connection_t* pnc = 0; { GUARD(lock_); pnc = make_connection_lh(url, user_opts); } start_connection(url, pnc); // See comment on start_connection return make_returned(pnc); } returned container::impl::open_sender(const std::string &urlstr, const proton::sender_options &o1, const connection_options &o2) { proton::url url(urlstr); pn_link_t* pnl = 0; pn_connection_t* pnc = 0; { GUARD(lock_); proton::sender_options lopts(sender_options_); lopts.update(o1); pnc = make_connection_lh(url, o2); connection conn(make_wrapper(pnc)); pnl = unwrap(conn.default_session().open_sender(url.path(), lopts)); } start_connection(url, pnc); // See comment on start_connection return make_returned(pnl); // Unsafe returned pointer } returned container::impl::open_receiver(const std::string &urlstr, const proton::receiver_options &o1, const connection_options &o2) { proton::url url(urlstr); pn_link_t* pnl = 0; pn_connection_t* pnc = 0; { GUARD(lock_); proton::receiver_options lopts(receiver_options_); lopts.update(o1); pnc = make_connection_lh(url, o2); connection conn(make_wrapper(pnc)); pnl = unwrap(conn.default_session().open_receiver(url.path(), lopts)); } start_connection(url, pnc); // See comment on start_connection return make_returned(pnl); } pn_listener_t* container::impl::listen_common_lh(const std::string& addr) { if (stopping_) throw proton::error("container is stopping"); proton::url url(addr, false); // Don't want un-helpful defaults like "localhost" // Figure out correct string len then create connection address int len = pn_proactor_addr(0, 0, url.host().c_str(), url.port().c_str()); std::vector caddr(len+1); pn_proactor_addr(&caddr[0], len+1, url.host().c_str(), url.port().c_str()); pn_listener_t* listener = pn_listener(); pn_listener_set_context(listener, &container_); pn_proactor_listen(proactor_, listener, &caddr[0], 16); return listener; } proton::listener container::impl::listen(const std::string& addr) { GUARD(lock_); pn_listener_t* listener = listen_common_lh(addr); return proton::listener(listener); } proton::listener container::impl::listen(const std::string& addr, const proton::connection_options& opts) { GUARD(lock_); pn_listener_t* listener = listen_common_lh(addr); listener_context& lc=listener_context::get(listener); lc.connection_options_.reset(new connection_options(opts)); return proton::listener(listener); } proton::listener container::impl::listen(const std::string& addr, proton::listen_handler& lh) { GUARD(lock_); pn_listener_t* listener = listen_common_lh(addr); listener_context& lc=listener_context::get(listener); lc.listen_handler_ = &lh; return proton::listener(listener); } void container::impl::schedule(duration delay, work f) { GUARD(deferred_lock_); timestamp now = timestamp::now(); // Record timeout; Add callback to timeout sorted list scheduled s = {now+delay, f}; deferred_.push_back(s); std::push_heap(deferred_.begin(), deferred_.end()); // Set timeout for current head of timeout queue scheduled* next = &deferred_.front(); pn_millis_t timeout_ms = (now < next->time) ? (next->time-now).milliseconds() : 0; pn_proactor_set_timeout(proactor_, timeout_ms); } void container::impl::client_connection_options(const connection_options &opts) { GUARD(lock_); client_connection_options_ = opts; } void container::impl::server_connection_options(const connection_options &opts) { GUARD(lock_); server_connection_options_ = opts; } void container::impl::sender_options(const proton::sender_options &opts) { GUARD(lock_); sender_options_ = opts; } void container::impl::receiver_options(const proton::receiver_options &opts) { GUARD(lock_); receiver_options_ = opts; } void container::impl::run_timer_jobs() { timestamp now = timestamp::now(); // Check head of timer queue for (;;) { work task; { GUARD(deferred_lock_); if ( deferred_.size()==0 ) return; timestamp next_time = deferred_.front().time; if (next_time>now) { pn_proactor_set_timeout(proactor_, (next_time-now).milliseconds()); return; } task = deferred_.front().task; std::pop_heap(deferred_.begin(), deferred_.end()); deferred_.pop_back(); } task(); } } // Return true if this thread is finished bool container::impl::handle(pn_event_t* event) { // If we have any pending connection work, do it now pn_connection_t* c = pn_event_connection(event); if (c) { work_queue::impl* queue = connection_context::get(c).work_queue_.impl_.get(); queue->run_all_jobs(); } // Process events that shouldn't be sent to messaging_handler switch (pn_event_type(event)) { case PN_PROACTOR_INACTIVE: /* listener and all connections closed */ // If we're stopping interrupt all other threads still running if (auto_stop_) pn_proactor_interrupt(proactor_); return false; // We only interrupt to stop threads case PN_PROACTOR_INTERRUPT: { // Interrupt any other threads still running GUARD(lock_); if (threads_>1) pn_proactor_interrupt(proactor_); return true; } case PN_PROACTOR_TIMEOUT: { // Can get an immediate timeout, if we have a container event loop inject run_timer_jobs(); // Run every container event loop job // This is not at all efficient and single threads all these jobs, but it does correctly // serialise them work_queues queues; { GUARD(work_queues_lock_); queues = work_queues_; } for (work_queues::iterator queue = queues.begin(); queue!=queues.end(); ++queue) { (*queue)->run_all_jobs(); } return false; } case PN_LISTENER_OPEN: { pn_listener_t* l = pn_event_listener(event); proton::listen_handler* handler; { GUARD(lock_); listener_context &lc(listener_context::get(l)); handler = lc.listen_handler_; } if (handler) { listener lstnr(l); handler->on_open(lstnr); } return false; } case PN_LISTENER_ACCEPT: { pn_listener_t* l = pn_event_listener(event); pn_connection_t* c = pn_connection(); pn_connection_set_container(c, id_.c_str()); connection_options opts = server_connection_options_; listen_handler* handler; listener_context* lc; const connection_options* options; { GUARD(lock_); lc = &listener_context::get(l); handler = lc->listen_handler_; options = lc->connection_options_.get(); } if (handler) { listener lstr(l); opts.update(handler->on_accept(lstr)); } else if (options) opts.update(*options); // Handler applied separately connection_context& cc = connection_context::get(c); cc.container = &container_; cc.listener_context_ = lc; cc.handler = opts.handler(); cc.work_queue_ = new container::impl::connection_work_queue(*container_.impl_, c); pn_transport_t* pnt = pn_transport(); pn_transport_set_server(pnt); opts.apply_unbound_server(pnt); pn_listener_accept2(l, c, pnt); return false; } case PN_LISTENER_CLOSE: { pn_listener_t* l = pn_event_listener(event); proton::listen_handler* handler; { GUARD(lock_); listener_context &lc(listener_context::get(l)); handler = lc.listen_handler_; } listener lstnr(l); if (handler) { pn_condition_t* c = pn_listener_condition(l); if (pn_condition_is_set(c)) { handler->on_error(lstnr, make_wrapper(c).what()); } handler->on_close(lstnr); } return false; } // Connection driver will bind a new transport to the connection at this point case PN_CONNECTION_INIT: return false; // We've already applied options, so don't need to do it here case PN_CONNECTION_BOUND: return false; case PN_CONNECTION_REMOTE_OPEN: { // This is the only event that we get indicating that the connection succeeded so // it's the only place to reset the reconnection logic. // // Just note we have a connection then process normally pn_connection_t* c = pn_event_connection(event); reset_reconnect(c); break; } case PN_CONNECTION_REMOTE_CLOSE: { pn_connection_t *c = pn_event_connection(event); pn_condition_t *cc = pn_connection_remote_condition(c); // If we got a close with a condition of amqp:connection:forced then don't send // any close/error events now. Just set the error condition on the transport and // close the connection - This should act as though a transport error occurred if (pn_condition_is_set(cc) && !strcmp(pn_condition_get_name(cc), "amqp:connection:forced")) { pn_transport_t* t = pn_event_transport(event); pn_condition_t* tc = pn_transport_condition(t); pn_condition_copy(tc, cc); pn_connection_close(c); return false; } break; } case PN_TRANSPORT_CLOSED: { // If reconnect is turned on then handle closed on error here with reconnect attempt pn_connection_t* c = pn_event_connection(event); pn_transport_t* t = pn_event_transport(event); // If we successfully schedule a re-connect then hide the event from // user handlers by returning here. if (pn_condition_is_set(pn_transport_condition(t)) && setup_reconnect(c)) return false; // Otherwise, this connection will be freed by the proactor. // Mark its work_queue finished so it won't try to use the freed connection. connection_context::get(c).work_queue_.impl_.get()->finished(); } default: break; } // Figure out the handler for the primary object for event messaging_handler* mh = 0; // First try for a link (send/receiver) handler pn_link_t *link = pn_event_link(event); if (link) mh = get_handler(link); // Try for session handler if no link handler pn_session_t *session = pn_event_session(event); if (session && !mh) mh = get_handler(session); // Try for connection handler if none of the above pn_connection_t *connection = pn_event_connection(event); if (connection && !mh) mh = get_handler(connection); // Use container handler if nothing more specific (must be a container handler) if (!mh) mh = handler_; // If we still have no handler don't do anything! // This is pretty unusual, but possible if we use the default constructor for container if (!mh) return false; messaging_adapter::dispatch(*mh, event); return false; } void container::impl::thread() { bool finished; { GUARD(lock_); ++threads_; finished = stopping_; } while (!finished) { pn_event_batch_t *events = pn_proactor_wait(proactor_); pn_event_t *e; error_condition error; try { while ((e = pn_event_batch_next(events))) { finished = handle(e); if (finished) break; } } catch (const std::exception& e) { // If we caught an exception then shutdown the (other threads of the) container error = error_condition("exception", e.what()); } catch (...) { error = error_condition("exception", "container shut-down by unknown exception"); } pn_proactor_done(proactor_, events); if (!error.empty()) { finished = true; { GUARD(lock_); disconnect_error_ = error; } stop(error); } } { GUARD(lock_); --threads_; } } void container::impl::start_event() { if (handler_) handler_->on_container_start(container_); } void container::impl::stop_event() { if (handler_) handler_->on_container_stop(container_); } void container::impl::run(int threads) { // Have to "manually" generate container events CALL_ONCE(start_once_, &impl::start_event, this); #if PN_CPP_SUPPORTS_THREADS // Run handler threads threads = std::max(threads, 1); // Ensure at least 1 thread typedef std::vector vt; // pointer vector to work around failures in older compilers vt ts(threads-1); for (vt::iterator i = ts.begin(); i != ts.end(); ++i) { *i = new std::thread(&impl::thread, this); } thread(); // Use this thread too. // Wait for the other threads to stop for (vt::iterator i = ts.begin(); i != ts.end(); ++i) { (*i)->join(); delete *i; } #else // Run a single handler thread (As we have no threading API) thread(); #endif bool last = false; { GUARD(lock_); last = threads_==0; } if (last) CALL_ONCE(stop_once_, &impl::stop_event, this); // Throw an exception if we disconnected the proactor because of an exception { GUARD(lock_); if (!disconnect_error_.empty()) throw proton::error(disconnect_error_.description()); }; } void container::impl::auto_stop(bool set) { GUARD(lock_); auto_stop_ = set; } void container::impl::stop(const proton::error_condition& err) { { GUARD(lock_); if (stopping_) return; // Already stopping auto_stop_ = true; stopping_ = true; // Have to wait until actual reconnect to stop or we leak the connection if (reconnecting_>0) return; } pn_condition_t* error_condition = pn_condition(); set_error_condition(err, error_condition); pn_proactor_disconnect(proactor_, error_condition); pn_condition_free(error_condition); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/object.cpp0000664000000000000000000000240413257152177017632 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/internal/object.hpp" #include namespace proton { namespace internal { void pn_ptr_base::incref(void *p) { if (p) ::pn_incref(const_cast(p)); } void pn_ptr_base::decref(void *p) { if (p) ::pn_decref(const_cast(p)); } std::string pn_ptr_base::inspect(void* p) { if (!p) return std::string(); ::pn_string_t* s = ::pn_string(NULL); (void) ::pn_inspect(p, s); return std::string(pn_string_get(s)); } }} qpid-proton-0.22.0/proton-c/bindings/cpp/src/node_options.cpp0000664000000000000000000001473413257152177021075 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/codec/vector.hpp" #include "proton/source.hpp" #include "proton/source_options.hpp" #include "proton/target.hpp" #include "proton/target_options.hpp" #include "proton_bits.hpp" #include namespace proton { template struct option { T value; bool set; option() : value(), set(false) {} option& operator=(const T& x) { value = x; set = true; return *this; } void update(const option& x) { if (x.set) *this = x.value; } }; namespace { void timeout(terminus &t, duration d) { uint32_t seconds = 0; if (d == duration::FOREVER) seconds = std::numeric_limits::max(); else if (d != duration::IMMEDIATE) { uint64_t x = d.milliseconds(); if ((std::numeric_limits::max() - x) <= 500) seconds = std::numeric_limits::max(); else { x = (x + 500) / 1000; seconds = x < std::numeric_limits::max() ? x : std::numeric_limits::max(); } } pn_terminus_set_timeout(unwrap(t), seconds); } } namespace { // Options common to sources and targets void node_address(terminus &t, option &addr, option &dynamic) { if (dynamic.set && dynamic.value) { pn_terminus_set_dynamic(unwrap(t), true); // Ignore any addr value for dynamic. return; } if (addr.set) { pn_terminus_set_address(unwrap(t), addr.value.c_str()); } } void node_durability(terminus &t, option &mode) { if (mode.set) pn_terminus_set_durability(unwrap(t), pn_durability_t(mode.value)); } void node_expiry(terminus &t, option &policy, option &d) { if (policy.set) pn_terminus_set_expiry_policy(unwrap(t), pn_expiry_policy_t(policy.value)); if (d.set) timeout(t, d.value); } } class source_options::impl { public: option address; option dynamic; option durability_mode; option timeout; option expiry_policy; option distribution_mode; option filters; option > capabilities; void apply(source& s) { node_address(s, address, dynamic); node_durability(s, durability_mode); node_expiry(s, expiry_policy, timeout); if (distribution_mode.set) pn_terminus_set_distribution_mode(unwrap(s), pn_distribution_mode_t(distribution_mode.value)); if (filters.set && !filters.value.empty()) { // Applied at most once via source_option. No need to clear. value(pn_terminus_filter(unwrap(s))) = filters.value; } if (capabilities.set) { value(pn_terminus_capabilities(unwrap(s))) = capabilities.value; } } }; source_options::source_options() : impl_(new impl()) {} source_options::source_options(const source_options& x) : impl_(new impl()) { *this = x; } source_options::~source_options() {} source_options& source_options::operator=(const source_options& x) { *impl_ = *x.impl_; return *this; } source_options& source_options::address(const std::string &addr) { impl_->address = addr; return *this; } source_options& source_options::dynamic(bool b) { impl_->dynamic = b; return *this; } source_options& source_options::durability_mode(enum source::durability_mode m) { impl_->durability_mode = m; return *this; } source_options& source_options::timeout(duration d) { impl_->timeout = d; return *this; } source_options& source_options::expiry_policy(enum source::expiry_policy m) { impl_->expiry_policy = m; return *this; } source_options& source_options::distribution_mode(enum source::distribution_mode m) { impl_->distribution_mode = m; return *this; } source_options& source_options::filters(const source::filter_map &map) { impl_->filters = map; return *this; } source_options& source_options::capabilities(const std::vector& c) { impl_->capabilities = c; return *this; } void source_options::apply(source& s) const { impl_->apply(s); } // TARGET class target_options::impl { public: option address; option dynamic; option durability_mode; option timeout; option expiry_policy; option > capabilities; void apply(target& t) { node_address(t, address, dynamic); node_durability(t, durability_mode); node_expiry(t, expiry_policy, timeout); if (capabilities.set) { value(pn_terminus_capabilities(unwrap(t))) = capabilities.value; } } }; target_options::target_options() : impl_(new impl()) {} target_options::target_options(const target_options& x) : impl_(new impl()) { *this = x; } target_options::~target_options() {} target_options& target_options::operator=(const target_options& x) { *impl_ = *x.impl_; return *this; } target_options& target_options::address(const std::string &addr) { impl_->address = addr; return *this; } target_options& target_options::dynamic(bool b) { impl_->dynamic = b; return *this; } target_options& target_options::durability_mode(enum target::durability_mode m) { impl_->durability_mode = m; return *this; } target_options& target_options::timeout(duration d) { impl_->timeout = d; return *this; } target_options& target_options::expiry_policy(enum target::expiry_policy m) { impl_->expiry_policy = m; return *this; } target_options& target_options::capabilities(const std::vector& c) { impl_->capabilities = c; return *this; } void target_options::apply(target& s) const { impl_->apply(s); } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/msg.hpp0000664000000000000000000000334713257152177017166 0ustar #ifndef PROTON_MSG_H #define PROTON_MSG_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include namespace proton { /** A simple facade for std::ostringstream that allows * in place construction of a message and automatic conversion * to string. * E.g. *@code * void foo(const std::string&); * foo(msg() << "hello " << 32); *@endcode * Will construct the string "hello 32" and pass it to foo() */ struct msg { std::ostringstream os; msg() {} msg(const msg& m) : os(m.str()) {} std::string str() const { return os.str(); } operator std::string() const { return str(); } template msg& operator<<(const T& t) { os << t; return *this; } }; inline std::ostream& operator<<(std::ostream& o, const msg& m) { return o << m.str(); } /** Construct a message using operator << and append (file:line) */ #define QUOTe_(x) #x #define QUOTE(x) QUOTe_(x) #define MSG(message) (::proton::msg() << message) } #endif /*!PROTON_MSG_H*/ qpid-proton-0.22.0/proton-c/bindings/cpp/src/messaging_adapter.hpp0000664000000000000000000000234213257152177022047 0ustar #ifndef PROTON_CPP_MESSAGING_ADAPTER_H #define PROTON_CPP_MESSAGING_ADAPTER_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ ///@cond INTERNAL struct pn_event_t; namespace proton { class messaging_handler; /// Convert the low level proton-c events to the higher level proton::messaging_handler calls class messaging_adapter { public: static void dispatch(messaging_handler& delegate, pn_event_t* e); }; } ///@endcond INTERNAL #endif /*!PROTON_CPP_MESSAGING_ADAPTER_H*/ qpid-proton-0.22.0/proton-c/bindings/cpp/src/messaging_adapter.cpp0000664000000000000000000002577313257152177022057 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "messaging_adapter.hpp" #include "proton/connection.hpp" #include "proton/container.hpp" #include "proton/delivery.hpp" #include "proton/error.hpp" #include "proton/messaging_handler.hpp" #include "proton/receiver.hpp" #include "proton/receiver_options.hpp" #include "proton/sender.hpp" #include "proton/sender_options.hpp" #include "proton/session.hpp" #include "proton/tracker.hpp" #include "proton/transport.hpp" #include "contexts.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include #include #include #include #include #include #include #include namespace proton { namespace { // This must only be called for receiver links void credit_topup(pn_link_t *link) { assert(pn_link_is_receiver(link)); int window = link_context::get(link).credit_window; if (window) { int delta = window - pn_link_credit(link); pn_link_flow(link, delta); } } void on_link_flow(messaging_handler& handler, pn_event_t* event) { pn_link_t *lnk = pn_event_link(event); // TODO: process session flow data, if no link-specific data, just return. if (!lnk) return; int state = pn_link_state(lnk); if ((state&PN_LOCAL_ACTIVE) && (state&PN_REMOTE_ACTIVE)) { link_context& lctx = link_context::get(lnk); if (pn_link_is_sender(lnk)) { if (pn_link_credit(lnk) > 0) { sender s(make_wrapper(lnk)); bool draining = pn_link_get_drain(lnk); if ( draining && !lctx.draining) { handler.on_sender_drain_start(s); } lctx.draining = draining; // create on_message extended event handler.on_sendable(s); } } else { // receiver if (!pn_link_credit(lnk) && lctx.draining) { lctx.draining = false; receiver r(make_wrapper(lnk)); handler.on_receiver_drain_finish(r); } credit_topup(lnk); } } } // Decode the message corresponding to a delivery from a link. void message_decode(message& msg, proton::delivery delivery) { std::vector buf; buf.resize(pn_delivery_pending(unwrap(delivery))); if (buf.empty()) throw error("message decode: no delivery pending on link"); proton::receiver link = delivery.receiver(); assert(!buf.empty()); ssize_t n = pn_link_recv(unwrap(link), const_cast(&buf[0]), buf.size()); if (n != ssize_t(buf.size())) throw error(MSG("receiver read failure")); msg.clear(); msg.decode(buf); pn_link_advance(unwrap(link)); } void on_delivery(messaging_handler& handler, pn_event_t* event) { pn_link_t *lnk = pn_event_link(event); pn_delivery_t *dlv = pn_event_delivery(event); link_context& lctx = link_context::get(lnk); if (pn_link_is_receiver(lnk)) { delivery d(make_wrapper(dlv)); if (!pn_delivery_partial(dlv) && pn_delivery_readable(dlv)) { // generate on_message pn_connection_t *pnc = pn_session_connection(pn_link_session(lnk)); connection_context& ctx = connection_context::get(pnc); // Reusable per-connection message. // Avoid expensive heap malloc/free overhead. // See PROTON-998 class message &msg(ctx.event_message); message_decode(msg, d); if (pn_link_state(lnk) & PN_LOCAL_CLOSED) { if (lctx.auto_accept) d.release(); } else { handler.on_message(d, msg); if (lctx.auto_accept && !d.settled()) d.accept(); if (lctx.draining && !pn_link_credit(lnk)) { lctx.draining = false; receiver r(make_wrapper(lnk)); handler.on_receiver_drain_finish(r); } } } else if (pn_delivery_updated(dlv) && d.settled()) { handler.on_delivery_settle(d); } if (lctx.draining && pn_link_credit(lnk) == 0) { lctx.draining = false; pn_link_set_drain(lnk, false); receiver r(make_wrapper(lnk)); handler.on_receiver_drain_finish(r); if (lctx.pending_credit) { pn_link_flow(lnk, lctx.pending_credit); lctx.pending_credit = 0; } } credit_topup(lnk); } else { tracker t(make_wrapper(dlv)); // sender if (pn_delivery_updated(dlv)) { uint64_t rstate = pn_delivery_remote_state(dlv); if (rstate == PN_ACCEPTED) { handler.on_tracker_accept(t); } else if (rstate == PN_REJECTED) { handler.on_tracker_reject(t); } else if (rstate == PN_RELEASED || rstate == PN_MODIFIED) { handler.on_tracker_release(t); } if (t.settled()) { handler.on_tracker_settle(t); } if (lctx.auto_settle) t.settle(); } } } bool is_remote_uninitialized(pn_state_t state) { return state & PN_REMOTE_UNINIT; } void on_link_remote_detach(messaging_handler& handler, pn_event_t* event) { pn_link_t *lnk = pn_event_link(event); if (pn_link_is_receiver(lnk)) { receiver r(make_wrapper(lnk)); handler.on_receiver_detach(r); } else { sender s(make_wrapper(lnk)); handler.on_sender_detach(s); } pn_link_detach(lnk); } void on_link_remote_close(messaging_handler& handler, pn_event_t* event) { pn_link_t *lnk = pn_event_link(event); if (pn_link_is_receiver(lnk)) { receiver r(make_wrapper(lnk)); if (pn_condition_is_set(pn_link_remote_condition(lnk))) { handler.on_receiver_error(r); } handler.on_receiver_close(r); } else { sender s(make_wrapper(lnk)); if (pn_condition_is_set(pn_link_remote_condition(lnk))) { handler.on_sender_error(s); } handler.on_sender_close(s); } pn_link_close(lnk); } void on_session_remote_close(messaging_handler& handler, pn_event_t* event) { pn_session_t *session = pn_event_session(event); class session s(make_wrapper(session)); if (pn_condition_is_set(pn_session_remote_condition(session))) { handler.on_session_error(s); } handler.on_session_close(s); pn_session_close(session); } void on_connection_remote_close(messaging_handler& handler, pn_event_t* event) { pn_connection_t *conn = pn_event_connection(event); connection c(make_wrapper(conn)); if (pn_condition_is_set(pn_connection_remote_condition(conn))) { handler.on_connection_error(c); } handler.on_connection_close(c); pn_connection_close(conn); } void on_connection_remote_open(messaging_handler& handler, pn_event_t* event) { // Generate on_transport_open event here until we find a better place transport t(make_wrapper(pn_event_transport(event))); handler.on_transport_open(t); pn_connection_t *conn = pn_event_connection(event); connection c(make_wrapper(conn)); handler.on_connection_open(c); } void on_session_remote_open(messaging_handler& handler, pn_event_t* event) { pn_session_t *session = pn_event_session(event); class session s(make_wrapper(session)); handler.on_session_open(s); } void on_link_local_open(messaging_handler& handler, pn_event_t* event) { pn_link_t* lnk = pn_event_link(event); if ( pn_link_is_receiver(lnk) ) { credit_topup(lnk); // We know local is active so don't check for it } else if ( pn_link_state(lnk)&PN_REMOTE_ACTIVE && pn_link_credit(lnk) > 0) { sender s(make_wrapper(lnk)); handler.on_sendable(s); } } void on_link_remote_open(messaging_handler& handler, pn_event_t* event) { pn_link_t *lnk = pn_event_link(event); if (pn_link_is_receiver(lnk)) { receiver r(make_wrapper(lnk)); handler.on_receiver_open(r); credit_topup(lnk); } else { sender s(make_wrapper(lnk)); handler.on_sender_open(s); } } void on_transport_closed(messaging_handler& handler, pn_event_t* event) { pn_transport_t *tspt = pn_event_transport(event); transport t(make_wrapper(tspt)); // If the connection isn't open generate on_transport_open event // because we didn't generate it yet and the events won't match. pn_connection_t *conn = pn_event_connection(event); if (!conn || is_remote_uninitialized(pn_connection_state(conn))) { handler.on_transport_open(t); } if (pn_condition_is_set(pn_transport_condition(tspt))) { handler.on_transport_error(t); } handler.on_transport_close(t); } void on_connection_wake(messaging_handler& handler, pn_event_t* event) { connection c(make_wrapper(pn_event_connection(event))); handler.on_connection_wake(c); } } void messaging_adapter::dispatch(messaging_handler& handler, pn_event_t* event) { pn_event_type_t type = pn_event_type(event); // Only handle events we are interested in switch(type) { case PN_CONNECTION_REMOTE_OPEN: on_connection_remote_open(handler, event); break; case PN_CONNECTION_REMOTE_CLOSE: on_connection_remote_close(handler, event); break; case PN_SESSION_REMOTE_OPEN: on_session_remote_open(handler, event); break; case PN_SESSION_REMOTE_CLOSE: on_session_remote_close(handler, event); break; case PN_LINK_LOCAL_OPEN: on_link_local_open(handler, event); break; case PN_LINK_REMOTE_OPEN: on_link_remote_open(handler, event); break; case PN_LINK_REMOTE_CLOSE: on_link_remote_close(handler, event); break; case PN_LINK_REMOTE_DETACH: on_link_remote_detach(handler, event); break; case PN_LINK_FLOW: on_link_flow(handler, event); break; case PN_DELIVERY: on_delivery(handler, event); break; case PN_TRANSPORT_CLOSED: on_transport_closed(handler, event); break; case PN_CONNECTION_WAKE: on_connection_wake(handler, event); break; // Ignore everything else default: break; } } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/message_test.cpp0000664000000000000000000001562713257152177021062 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/message.hpp" #include "proton/scalar.hpp" #include "test_bits.hpp" #include #include #include #include namespace { using namespace std; using namespace proton; #define CHECK_STR(ATTR) \ m.ATTR(#ATTR); \ ASSERT_EQUAL(std::string(#ATTR), m.ATTR()) #define CHECK_MESSAGE_ID(ATTR) \ m.ATTR(#ATTR); \ ASSERT_EQUAL(scalar(#ATTR), m.ATTR()) void test_message_defaults() { message m; ASSERT(m.body().empty()); ASSERT(m.id().empty()); ASSERT(m.user().empty()); ASSERT(m.to().empty()); ASSERT(m.subject().empty()); ASSERT(m.reply_to().empty()); ASSERT(m.correlation_id().empty()); ASSERT(m.content_type().empty()); ASSERT(m.content_encoding().empty()); ASSERT(m.group_id().empty()); ASSERT(m.reply_to_group_id().empty()); ASSERT_EQUAL(0, m.expiry_time().milliseconds()); ASSERT_EQUAL(0, m.creation_time().milliseconds()); ASSERT_EQUAL(false, m.inferred()); ASSERT_EQUAL(false, m.durable()); ASSERT_EQUAL(0, m.ttl().milliseconds()); ASSERT_EQUAL(message::default_priority, m.priority()); ASSERT_EQUAL(false, m.first_acquirer()); ASSERT_EQUAL(0u, m.delivery_count()); } void test_message_properties() { message m("hello"); std::string s = get(m.body()); ASSERT_EQUAL("hello", s); CHECK_MESSAGE_ID(id); CHECK_STR(user); CHECK_STR(to); CHECK_STR(subject); CHECK_STR(reply_to); CHECK_MESSAGE_ID(correlation_id); CHECK_STR(content_type); CHECK_STR(content_encoding); CHECK_STR(group_id); CHECK_STR(reply_to_group_id); m.expiry_time(timestamp(42)); ASSERT_EQUAL(m.expiry_time().milliseconds(), 42); m.creation_time(timestamp(4242)); ASSERT_EQUAL(m.creation_time().milliseconds(), 4242); m.ttl(duration(30)); ASSERT_EQUAL(m.ttl().milliseconds(), 30); m.priority(3); ASSERT_EQUAL(m.priority(), 3); message m2(m); ASSERT_EQUAL("hello", get(m2.body())); ASSERT_EQUAL(message_id("id"), m2.id()); ASSERT_EQUAL("user", m2.user()); ASSERT_EQUAL("to", m2.to()); ASSERT_EQUAL("subject", m2.subject()); ASSERT_EQUAL("reply_to", m2.reply_to()); ASSERT_EQUAL(message_id("correlation_id"), m2.correlation_id()); ASSERT_EQUAL("content_type", m2.content_type()); ASSERT_EQUAL("content_encoding", m2.content_encoding()); ASSERT_EQUAL("group_id", m2.group_id()); ASSERT_EQUAL("reply_to_group_id", m2.reply_to_group_id()); ASSERT_EQUAL(42, m2.expiry_time().milliseconds()); ASSERT_EQUAL(4242, m.creation_time().milliseconds()); m2 = m; ASSERT_EQUAL("hello", get(m2.body())); ASSERT_EQUAL(message_id("id"), m2.id()); ASSERT_EQUAL("user", m2.user()); ASSERT_EQUAL("to", m2.to()); ASSERT_EQUAL("subject", m2.subject()); ASSERT_EQUAL("reply_to", m2.reply_to()); ASSERT_EQUAL(message_id("correlation_id"), m2.correlation_id()); ASSERT_EQUAL("content_type", m2.content_type()); ASSERT_EQUAL("content_encoding", m2.content_encoding()); ASSERT_EQUAL("group_id", m2.group_id()); ASSERT_EQUAL("reply_to_group_id", m2.reply_to_group_id()); ASSERT_EQUAL(42, m2.expiry_time().milliseconds()); ASSERT_EQUAL(4242, m.creation_time().milliseconds()); } void test_message_body() { std::string s("hello"); message m1(s.c_str()); ASSERT_EQUAL(s, get(m1.body())); message m2(s); ASSERT_EQUAL(s, coerce(m2.body())); message m3; m3.body(s); ASSERT_EQUAL(s, coerce(m3.body())); ASSERT_EQUAL(5, coerce(message(5).body())); ASSERT_EQUAL(3.1, coerce(message(3.1).body())); } void test_message_maps() { message m; ASSERT(m.properties().empty()); ASSERT(m.message_annotations().empty()); ASSERT(m.delivery_annotations().empty()); m.properties().put("foo", 12); m.delivery_annotations().put("bar", "xyz"); m.message_annotations().put(23, int8_t(42)); ASSERT_EQUAL(m.properties().get("foo"), scalar(12)); ASSERT_EQUAL(m.delivery_annotations().get("bar"), scalar("xyz")); ASSERT_EQUAL(m.message_annotations().get(23), scalar(int8_t(42))); ASSERT_EQUAL(proton::get(m.message_annotations().get(23)), 42); ASSERT_EQUAL(m.message_annotations().get(23).get(), 42); message m2(m); ASSERT_EQUAL(m.properties().get("foo"), scalar(12)); // Decoding shouldn't change it ASSERT_EQUAL(m2.properties().get("foo"), scalar(12)); ASSERT_EQUAL(m2.delivery_annotations().get("bar"), scalar("xyz")); ASSERT_EQUAL(m2.message_annotations().get(23), scalar(int8_t(42))); m.properties().put("foo","newfoo"); m.delivery_annotations().put(24, 1000); m.message_annotations().erase(23); message m3 = m; size_t size = m3.properties().size(); ASSERT_EQUAL(1u, size); ASSERT_EQUAL(m3.properties().get("foo"), scalar("newfoo")); ASSERT_EQUAL(2u, m3.delivery_annotations().size()); ASSERT_EQUAL(m3.delivery_annotations().get("bar"), scalar("xyz")); ASSERT_EQUAL(m3.delivery_annotations().get(24), scalar(1000)); ASSERT(m3.message_annotations().empty()); // PROTON-1498 message msg; msg.message_annotations().put("x-opt-jms-msg-type", int8_t(1)); proton::message::annotation_map& am_ref = msg.message_annotations(); uint8_t t = am_ref.get(proton::symbol("x-opt-jms-msg-type")).get(); ASSERT_EQUAL(1, t); proton::message::annotation_map am_val = msg.message_annotations(); t = am_val.get(proton::symbol("x-opt-jms-msg-type")).get(); ASSERT_EQUAL(1, t); } void test_message_reuse() { message m1("one"); m1.properties().put("x", "y"); message m2("two"); m2.properties().put("a", "b"); m1.decode(m2.encode()); // Use m1 for a newly decoded message ASSERT_EQUAL(value("two"), m1.body()); ASSERT_EQUAL(value("b"), m1.properties().get("a")); } } int main(int, char**) { int failed = 0; RUN_TEST(failed, test_message_properties()); RUN_TEST(failed, test_message_defaults()); RUN_TEST(failed, test_message_body()); RUN_TEST(failed, test_message_maps()); RUN_TEST(failed, test_message_reuse()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/message.cpp0000664000000000000000000002211513257152177020011 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/delivery.hpp" #include "proton/error.hpp" #include "proton/link.hpp" #include "proton/message.hpp" #include "proton/message_id.hpp" #include "proton/receiver.hpp" #include "proton/sender.hpp" #include "proton/timestamp.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include "types_internal.hpp" #include "core/message-internal.h" #include "proton/delivery.h" #include #include #include namespace proton { struct message::impl { value body; property_map properties; annotation_map annotations; annotation_map instructions; impl(pn_message_t *msg) { body.reset(pn_message_body(msg)); properties.reset(pn_message_properties(msg)); annotations.reset(pn_message_annotations(msg)); instructions.reset(pn_message_instructions(msg)); } void clear() { properties.clear(); annotations.clear(); instructions.clear(); } // Encode cached maps to the pn_data_t, always used an empty() value for an empty map void flush() { if (!properties.empty()) properties.value(); if (!annotations.empty()) annotations.value(); if (!instructions.empty()) instructions.value(); } }; message::message() : pn_msg_(0) {} message::message(const message &m) : pn_msg_(0) { *this = m; } #if PN_CPP_HAS_RVALUE_REFERENCES message::message(message &&m) : pn_msg_(0) { swap(*this, m); } message& message::operator=(message&& m) { swap(*this, m); return *this; } #endif message::message(const value& x) : pn_msg_(0) { body() = x; } message::~message() { if (pn_msg_) { impl().~impl(); // destroy in-place pn_message_free(pn_msg_); } } void swap(message& x, message& y) { std::swap(x.pn_msg_, y.pn_msg_); } pn_message_t *message::pn_msg() const { if (!pn_msg_) { pn_msg_ = pni_message_with_extra(sizeof(struct message::impl)); // Construct impl in extra storage allocated with pn_msg_ new (pni_message_get_extra(pn_msg_)) struct message::impl(pn_msg_); } return pn_msg_; } struct message::impl& message::impl() const { return *(struct message::impl*)pni_message_get_extra(pn_msg()); } message& message::operator=(const message& m) { if (&m != this) { // TODO aconway 2015-08-10: more efficient pn_message_copy function std::vector data; m.encode(data); decode(data); } return *this; } void message::clear() { if (pn_msg_) { impl().clear(); pn_message_clear(pn_msg_); } } namespace { void check(int err) { if (err) throw error(error_str(err)); } } // namespace void message::id(const message_id& id) { pn_message_set_id(pn_msg(), id.atom_); } message_id message::id() const { return pn_message_get_id(pn_msg()); } void message::user(const std::string &id) { check(pn_message_set_user_id(pn_msg(), pn_bytes(id))); } std::string message::user() const { return str(pn_message_get_user_id(pn_msg())); } void message::to(const std::string &addr) { check(pn_message_set_address(pn_msg(), addr.c_str())); } std::string message::to() const { const char* addr = pn_message_get_address(pn_msg()); return addr ? std::string(addr) : std::string(); } void message::address(const std::string &addr) { check(pn_message_set_address(pn_msg(), addr.c_str())); } std::string message::address() const { const char* addr = pn_message_get_address(pn_msg()); return addr ? std::string(addr) : std::string(); } void message::subject(const std::string &s) { check(pn_message_set_subject(pn_msg(), s.c_str())); } std::string message::subject() const { const char* s = pn_message_get_subject(pn_msg()); return s ? std::string(s) : std::string(); } void message::reply_to(const std::string &s) { check(pn_message_set_reply_to(pn_msg(), s.c_str())); } std::string message::reply_to() const { const char* s = pn_message_get_reply_to(pn_msg()); return s ? std::string(s) : std::string(); } void message::correlation_id(const message_id& id) { value(pn_message_correlation_id(pn_msg())) = id; } message_id message::correlation_id() const { return pn_message_get_correlation_id(pn_msg()); } void message::content_type(const std::string &s) { check(pn_message_set_content_type(pn_msg(), s.c_str())); } std::string message::content_type() const { const char* s = pn_message_get_content_type(pn_msg()); return s ? std::string(s) : std::string(); } void message::content_encoding(const std::string &s) { check(pn_message_set_content_encoding(pn_msg(), s.c_str())); } std::string message::content_encoding() const { const char* s = pn_message_get_content_encoding(pn_msg()); return s ? std::string(s) : std::string(); } void message::expiry_time(timestamp t) { pn_message_set_expiry_time(pn_msg(), t.milliseconds()); } timestamp message::expiry_time() const { return timestamp(pn_message_get_expiry_time(pn_msg())); } void message::creation_time(timestamp t) { pn_message_set_creation_time(pn_msg(), t.milliseconds()); } timestamp message::creation_time() const { return timestamp(pn_message_get_creation_time(pn_msg())); } void message::group_id(const std::string &s) { check(pn_message_set_group_id(pn_msg(), s.c_str())); } std::string message::group_id() const { const char* s = pn_message_get_group_id(pn_msg()); return s ? std::string(s) : std::string(); } void message::reply_to_group_id(const std::string &s) { check(pn_message_set_reply_to_group_id(pn_msg(), s.c_str())); } std::string message::reply_to_group_id() const { const char* s = pn_message_get_reply_to_group_id(pn_msg()); return s ? std::string(s) : std::string(); } bool message::inferred() const { return pn_message_is_inferred(pn_msg()); } void message::inferred(bool b) { pn_message_set_inferred(pn_msg(), b); } void message::body(const value& x) { body() = x; } const value& message::body() const { return impl().body; } value& message::body() { return impl().body; } message::property_map& message::properties() { return impl().properties; } const message::property_map& message::properties() const { return impl().properties; } message::annotation_map& message::message_annotations() { return impl().annotations; } const message::annotation_map& message::message_annotations() const { return impl().annotations; } message::annotation_map& message::delivery_annotations() { return impl().instructions; } const message::annotation_map& message::delivery_annotations() const { return impl().instructions; } void message::encode(std::vector &s) const { impl().flush(); size_t sz = std::max(s.capacity(), size_t(512)); while (true) { s.resize(sz); assert(!s.empty()); int err = pn_message_encode(pn_msg(), const_cast(&s[0]), &sz); if (err) { if (err != PN_OVERFLOW) check(err); } else { s.resize(sz); return; } sz *= 2; } } std::vector message::encode() const { std::vector data; encode(data); return data; } void message::decode(const std::vector &s) { if (s.empty()) throw error("message decode: no data"); impl().clear(); check(pn_message_decode(pn_msg(), &s[0], s.size())); } bool message::durable() const { return pn_message_is_durable(pn_msg()); } void message::durable(bool b) { pn_message_set_durable(pn_msg(), b); } duration message::ttl() const { return duration(pn_message_get_ttl(pn_msg())); } void message::ttl(duration d) { pn_message_set_ttl(pn_msg(), d.milliseconds()); } uint8_t message::priority() const { return pn_message_get_priority(pn_msg()); } void message::priority(uint8_t d) { pn_message_set_priority(pn_msg(), d); } bool message::first_acquirer() const { return pn_message_is_first_acquirer(pn_msg()); } void message::first_acquirer(bool b) { pn_message_set_first_acquirer(pn_msg(), b); } uint32_t message::delivery_count() const { return pn_message_get_delivery_count(pn_msg()); } void message::delivery_count(uint32_t d) { pn_message_set_delivery_count(pn_msg(), d); } int32_t message::group_sequence() const { return pn_message_get_group_sequence(pn_msg()); } void message::group_sequence(int32_t d) { pn_message_set_group_sequence(pn_msg(), d); } const uint8_t message::default_priority = PN_DEFAULT_PRIORITY; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/map_test.cpp0000664000000000000000000000641713257152177020210 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/map.hpp" #include "test_bits.hpp" #include #include namespace { using namespace std; using namespace proton; void test_empty() { proton::map m; ASSERT_EQUAL(0U, m.size()); ASSERT(m.empty()); ASSERT_EQUAL(0U, m.erase("x")); ASSERT(!m.exists("x")); std::map sm; proton::get(m, sm); ASSERT(sm.empty()); } void test_use() { proton::map m; m.put("x", "y"); ASSERT_EQUAL(scalar("y"), m.get("x")); ASSERT(!m.empty()); ASSERT(m.exists("x")); ASSERT_EQUAL(1U, m.size()); m.put("a", "b"); ASSERT_EQUAL(scalar("b"), m.get("a")); ASSERT_EQUAL(2U, m.size()); ASSERT_EQUAL(1U, m.erase("x")); ASSERT_EQUAL(1U, m.size()); ASSERT(!m.exists("x")); ASSERT_EQUAL(scalar("b"), m.get("a")); m.clear(); ASSERT(m.empty()); } void test_cppmap() { std::map sm; sm["a"] = 2; sm["b"] = 3; proton::map m; m = sm; ASSERT_EQUAL(scalar(2), m.get("a")); ASSERT_EQUAL(scalar(3), m.get("b")); ASSERT_EQUAL(2U, m.size()); std::map sm2; proton::get(m, sm2); ASSERT_EQUAL(2U, sm2.size()); ASSERT_EQUAL(scalar(2), sm2["a"]); ASSERT_EQUAL(scalar(3), sm2["b"]); // Round trip: value v = m.value(); proton::map m2; m2.value(v); // Use a vector as map storage vector > vm; vm.push_back(std::make_pair(string("x"), 8)); vm.push_back(std::make_pair(string("y"), 9)); m.value(vm); // Can't use type-safe op=, not enabled ASSERT_EQUAL(scalar(8), m.get("x")); ASSERT_EQUAL(scalar(9), m.get("y")); ASSERT_EQUAL(2U, m.size()); vm.clear(); proton::get(m, vm); ASSERT_EQUAL(2U, vm.size()); ASSERT_EQUAL(string("x"), vm[0].first); ASSERT_EQUAL(scalar(8), vm[0].second); } void test_value() { proton::map m; value v; v = "foo"; ASSERT_THROWS(conversion_error, m.value(v)); std::map bad; // Wrong type of map. // Note we can't detect an empty map of bad type because AMQP maps allow // mixed types, so there must be data to object to. bad[1]=1.0; ASSERT_THROWS(conversion_error, m.value(bad)); } } int main(int, char**) { int failed = 0; RUN_TEST(failed, test_empty()); RUN_TEST(failed, test_use()); RUN_TEST(failed, test_cppmap()); RUN_TEST(failed, test_value()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/map.cpp0000664000000000000000000001522613257152177017147 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/map.hpp" #include "proton/annotation_key.hpp" #include "proton/scalar.hpp" #include "proton/value.hpp" #include "proton/codec/decoder.hpp" #include "proton/codec/encoder.hpp" #include "proton/codec/map.hpp" #include #include // IMPLEMENTATION NOTES: // - if (map_.get()) then *map_ is the authority and value_ is empty() // - cache() ensures that *map_ is up to date and value_ is cleared. // - flush() ensures value_ is up to date and map_ is cleared. namespace proton { // use std::map as the actual map implementation type template class map_type_impl : public std::map {}; template map::map() {} template map::map(const map& x) { *this = x; } template map::map(pn_data_t *d) : value_(d) { // NOTE: for internal use. Don't verify that the data is valid here as that // would forcibly decode message maps immediately, we want to decode on-demand. } template PN_CPP_EXTERN void swap(map& x, map& y) { using namespace std; swap(x.map_, y.map_); swap(x.value_, y.value_); } template map& map::operator=(const map& x) { if (&x != this) { map_.reset(x.map_.get() ? new map_type(*x.map_) : 0); value_ = x.value_; } return *this; } #if PN_CPP_HAS_RVALUE_REFERENCES template map::map(map&& x) : map_(std::move(x.map_)), value_(std::move(x.value_)) {} template map& map::operator=(map&& x) { if (&x != this) { map_.reset(x.map_.release()); value_ = std::move(x.value_); } return *this; } #endif template map::~map() {} // Make sure map_ is valid template typename map::map_type& map::cache() const { if (!map_) { map_.reset(new map_type); if (!value_.empty()) { proton::get(value_, *map_); value_.clear(); } } return *map_; } // Make sure value_ is valid template value& map::flush() const { if (map_.get()) { value_ = *map_; map_.reset(); } else if (value_.empty()) { // Must contain an empty map, not be an empty value. codec::encoder(value_) << codec::start::map() << codec::finish(); } return value_; } template void map::value(const proton::value& x) { if (x.empty()) { clear(); } else { internal::pn_unique_ptr tmp(new map_type); proton::get(x, *tmp); // Validate by decoding, may throw map_.reset(tmp.release()); value_.clear(); } } template proton::value& map::value() { return flush(); } template const proton::value& map::value() const { return flush(); } template T map::get(const K& k) const { if (this->empty()) return T(); typename map_type::const_iterator i = cache().find(k); if (i == map_->end()) return T(); return i->second; } template void map::put(const K& k, const T& v) { cache()[k] = v; } template size_t map::erase(const K& k) { if (this->empty()) { return 0; } else { return cache().erase(k); } } template bool map::exists(const K& k) const { return this->empty() ? 0 : cache().find(k) != cache().end(); } template size_t map::size() const { return this->empty() ? 0 : cache().size(); } template void map::clear() { map_.reset(); // Must invalidate the cache on clear() value_.clear(); } template bool map::empty() const { if (map_.get()) { return map_->empty(); } if (value_.empty()) { return true; } // We must decode the non-empty value to see if it is an empty map. return cache().empty(); } // Point to a different underlying pn_data_t, no copy template void map::reset(pn_data_t *d) { value_.reset(d); // Points to d, not copy of d. map_.reset(); // NOTE: for internal use. Don't verify that the data is valid here as that // would forcibly decode message maps immediately, we want to decode on-demand. } template PN_CPP_EXTERN proton::codec::decoder& operator>>(proton::codec::decoder& d, map& m) { m.map_.reset(); d >> m.value_; m.cache(); // Validate the value return d; } template PN_CPP_EXTERN proton::codec::encoder& operator<<(proton::codec::encoder& e, const map& m) { return e << m.value(); // Copy the value } // Force the necessary template instantiations so that the library exports the correct symbols template class PN_CPP_CLASS_EXTERN map; typedef map cm1; template PN_CPP_EXTERN void swap<>(cm1&, cm1&); template PN_CPP_EXTERN proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cm1& m); template PN_CPP_EXTERN proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cm1& m); template class PN_CPP_CLASS_EXTERN map; typedef map cm2; template PN_CPP_EXTERN void swap<>(cm2&, cm2&); template PN_CPP_EXTERN proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cm2& m); template PN_CPP_EXTERN proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cm2& m); template class PN_CPP_CLASS_EXTERN map; typedef map cm3; template PN_CPP_EXTERN void swap<>(cm3&, cm3&); template PN_CPP_EXTERN proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cm3& m); template PN_CPP_EXTERN proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cm3& m); } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/listener.cpp0000664000000000000000000000422113257152177020210 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/connection_options.hpp" #include "proton/listener.hpp" #include "proton/listen_handler.hpp" #include #include #include "contexts.hpp" #include namespace proton { listener::listener(): listener_(0) {} listener::listener(pn_listener_t* l): listener_(l) {} // Out-of-line big-3 with trivial implementations, in case we need them in future. listener::listener(const listener& l) : listener_(l.listener_) {} listener::~listener() {} listener& listener::operator=(const listener& l) { listener_ = l.listener_; return *this; } void listener::stop() { if (listener_) pn_listener_close(listener_); } int listener::port() { char port[16] = ""; pn_netaddr_host_port(pn_listener_addr(listener_), NULL, 0, port, sizeof(port)); int i = atoi(port); if (!i) throw error("listener has no port"); return i; } class container& listener::container() const { void *c = pn_listener_get_context(listener_); if (!c) throw proton::error("No container"); return *reinterpret_cast(c); } // Listen handler listen_handler::~listen_handler() {} void listen_handler::on_open(listener&) {} connection_options listen_handler::on_accept(listener&) { return connection_options(); } void listen_handler::on_error(listener&, const std::string&) {} void listen_handler::on_close(listener&) {} } qpid-proton-0.22.0/proton-c/bindings/cpp/src/link_namer.hpp0000664000000000000000000000267313257152177020520 0ustar #ifndef PROTON_IO_LINK_NAMER_HPP #define PROTON_IO_LINK_NAMER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/internal/export.hpp" #include namespace proton { class connection; namespace io { /// **Unsettled API** - Generate default link names that are unique /// within a container. base_container provides a default /// implementation. class link_namer { public: virtual ~link_namer() {} /// Generate a unique link name. virtual std::string link_name() = 0; }; /// **Unsettled API** - Set the link_namer to use on a connection. PN_CPP_EXTERN void set_link_namer(connection&, link_namer&); } // io } // proton #endif // PROTON_IO_LINK_NAMER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/src/link_namer.cpp0000664000000000000000000000205513257152177020505 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "link_namer.hpp" #include "proton/connection.hpp" #include "contexts.hpp" #include "proton_bits.hpp" namespace proton { namespace io { void set_link_namer(connection& c, link_namer& l) { connection_context::get(unwrap(c)).link_gen = &l; } }} qpid-proton-0.22.0/proton-c/bindings/cpp/src/link.cpp0000664000000000000000000000440513257152177017324 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton_bits.hpp" #include "proton/link.hpp" #include "proton/error.hpp" #include "proton/connection.hpp" #include #include #include #include "contexts.hpp" #include "msg.hpp" #include "proton_bits.hpp" namespace proton { void link::attach() { pn_link_open(pn_object()); } void link::close() { pn_link_close(pn_object()); } void link::detach() { pn_link_detach(pn_object()); } int link::credit() const { pn_link_t *lnk = pn_object(); if (pn_link_is_sender(lnk)) return pn_link_credit(lnk); link_context& lctx = link_context::get(lnk); return pn_link_credit(lnk) + lctx.pending_credit; } bool link::draining() { pn_link_t *lnk = pn_object(); link_context& lctx = link_context::get(lnk); if (pn_link_is_sender(lnk)) return pn_link_credit(lnk) > 0 && lctx.draining; else return lctx.draining; } std::string link::name() const { return str(pn_link_name(pn_object()));} container& link::container() const { return connection().container(); } work_queue& link::work_queue() const { return connection().work_queue(); } class connection link::connection() const { return make_wrapper(pn_session_connection(pn_link_session(pn_object()))); } class session link::session() const { return make_wrapper(pn_link_session(pn_object())); } error_condition link::error() const { return make_wrapper(pn_link_remote_condition(pn_object())); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/interop_test.cpp0000664000000000000000000000744313257152177021113 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/codec/decoder.hpp" #include "proton/codec/encoder.hpp" #include "proton/error.hpp" #include "proton/value.hpp" #include "test_bits.hpp" #include #include #include #include #include namespace { using namespace std; using namespace proton; using proton::codec::encoder; using proton::codec::decoder; using proton::internal::data; using test::str; std::string tests_dir; string read(string filename) { filename = tests_dir+string("/interop/")+filename+string(".amqp"); ifstream ifs(filename.c_str()); if (!ifs.good()) FAIL("Can't open " << filename); return string(istreambuf_iterator(ifs), istreambuf_iterator()); } // Test data ostream operator void test_data_ostream() { data dt(data::create()); decoder d(dt); d.decode(read("primitives")); ASSERT_EQUAL("true, false, 42, 42, -42, 12345, -12345, 12345, -12345, 0.125, 0.125", str(dt)); } // Test extracting to exact AMQP types works correctly, extracting to invalid types fails. void test_decoder_primitives_exact() { value dv; decoder d(dv); d.decode(read("primitives")); ASSERT(d.more()); try { get< ::int8_t>(d); FAIL("got bool as byte"); } catch(conversion_error){} ASSERT_EQUAL(true, get(d)); ASSERT_EQUAL(false, get(d)); try { get< ::int8_t>(d); FAIL("got ubyte as byte"); } catch(conversion_error){} ASSERT_EQUAL(42, get< ::uint8_t>(d)); try { get< ::int32_t>(d); FAIL("got uint as ushort"); } catch(conversion_error){} ASSERT_EQUAL(42, get< ::uint16_t>(d)); try { get< ::uint16_t>(d); FAIL("got short as ushort"); } catch(conversion_error){} ASSERT_EQUAL(-42, get< ::int16_t>(d)); ASSERT_EQUAL(12345u, get< ::uint32_t>(d)); ASSERT_EQUAL(-12345, get< ::int32_t>(d)); ASSERT_EQUAL(12345u, get< ::uint64_t>(d)); ASSERT_EQUAL(-12345, get< ::int64_t>(d)); try { get(d); FAIL("got float as double"); } catch(conversion_error){} ASSERT_EQUAL(0.125f, get(d)); try { get(d); FAIL("got double as float"); } catch(conversion_error){} ASSERT_EQUAL(0.125, get(d)); ASSERT(!d.more()); } // Test inserting primitive sand encoding as AMQP. void test_encoder_primitives() { value dv; encoder e(dv); e << true << false; e << ::uint8_t(42); e << ::uint16_t(42) << ::int16_t(-42); e << ::uint32_t(12345) << ::int32_t(-12345); e << ::uint64_t(12345) << ::int64_t(-12345); e << float(0.125) << double(0.125); ASSERT_EQUAL("true, false, 42, 42, -42, 12345, -12345, 12345, -12345, 0.125, 0.125", str(e)); std::string data = e.encode(); ASSERT_EQUAL(read("primitives"), data); } } int main(int argc, char** argv) { int failed = 0; if (argc != 2) { cerr << "Usage: " << argv[0] << " tests-dir" << endl; return 1; } tests_dir = argv[1]; RUN_TEST(failed, test_data_ostream()); RUN_TEST(failed, test_decoder_primitives_exact()); RUN_TEST(failed, test_encoder_primitives()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/handler.cpp0000664000000000000000000000672413257152177020012 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/messaging_handler.hpp" #include "proton/connection.hpp" #include "proton/container.hpp" #include "proton/error_condition.hpp" #include "proton/receiver.hpp" #include "proton/receiver_options.hpp" #include "proton/sender.hpp" #include "proton/sender_options.hpp" #include "proton/session.hpp" #include "proton/transport.hpp" #include "proton_bits.hpp" #include "proton/connection.h" #include "proton/session.h" namespace proton { messaging_handler::messaging_handler(){} messaging_handler::~messaging_handler(){} void messaging_handler::on_container_start(container &) {} void messaging_handler::on_container_stop(container &) {} void messaging_handler::on_message(delivery &, message &) {} void messaging_handler::on_sendable(sender &) {} void messaging_handler::on_transport_close(transport &) {} void messaging_handler::on_transport_error(transport &t) { on_error(t.error()); } void messaging_handler::on_transport_open(transport &) {} void messaging_handler::on_connection_close(connection &) {} void messaging_handler::on_connection_error(connection &c) { on_error(c.error()); } void messaging_handler::on_connection_open(connection &c) { if (c.uninitialized()) { pn_connection_open(unwrap(c)); } } void messaging_handler::on_session_close(session &) {} void messaging_handler::on_session_error(session &s) { on_error(s.error()); } void messaging_handler::on_session_open(session &s) { if (s.uninitialized()) { pn_session_open(unwrap(s)); } } void messaging_handler::on_receiver_close(receiver &) {} void messaging_handler::on_receiver_error(receiver &l) { on_error(l.error()); } void messaging_handler::on_receiver_open(receiver &l) { if (l.uninitialized()) { l.open(l.connection().receiver_options()); } } void messaging_handler::on_receiver_detach(receiver &) {} void messaging_handler::on_sender_close(sender &) {} void messaging_handler::on_sender_error(sender &l) { on_error(l.error()); } void messaging_handler::on_sender_open(sender &l) { if (l.uninitialized()) { l.open(l.connection().sender_options()); } } void messaging_handler::on_sender_detach(sender &) {} void messaging_handler::on_tracker_accept(tracker &) {} void messaging_handler::on_tracker_reject(tracker &) {} void messaging_handler::on_tracker_release(tracker &) {} void messaging_handler::on_tracker_settle(tracker &) {} void messaging_handler::on_delivery_settle(delivery &) {} void messaging_handler::on_sender_drain_start(sender &) {} void messaging_handler::on_receiver_drain_finish(receiver &) {} void messaging_handler::on_connection_wake(connection&) {} void messaging_handler::on_error(const error_condition& c) { throw proton::error(c.what()); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/error_condition.cpp0000664000000000000000000000504713257152177021571 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/error_condition.hpp" #include #include "proton_bits.hpp" #include namespace proton { error_condition::error_condition(pn_condition_t* c) : name_(str(pn_condition_get_name(c))), description_(str(pn_condition_get_description(c))), properties_(value(pn_condition_info(c))) {} error_condition::error_condition(std::string description) : name_("proton:io:error"), description_(description) {} error_condition::error_condition(std::string name, std::string description) : name_(name), description_(description) {} error_condition::error_condition(std::string name, std::string description, value properties) : name_(name), description_(description), properties_(properties) {} #if PN_CPP_HAS_EXPLICIT_CONVERSIONS error_condition::operator bool() const { return !name_.empty(); } #endif bool error_condition::operator!() const { return name_.empty(); } bool error_condition::empty() const { return name_.empty(); } std::string error_condition::name() const { return name_; } std::string error_condition::description() const { return description_; } value error_condition::properties() const { return properties_; } std::string error_condition::what() const { if (!*this) { return "No error condition"; } else { std::string s(name_); if (!description_.empty()) { s += ": "; s += description_; } return s; } } bool operator==(const error_condition& x, const error_condition& y) { return x.name() == y.name() && x.description() == y.description() && x.properties() == y.properties(); } std::ostream& operator<<(std::ostream& o, const error_condition& err) { return o << err.what(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/error.cpp0000664000000000000000000000206113257152177017514 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/error.hpp" namespace proton { error::error(const std::string& msg) : std::runtime_error(msg) {} timeout_error::timeout_error(const std::string& msg) : error(msg) {} conversion_error::conversion_error(const std::string& msg) : error(msg) {} } qpid-proton-0.22.0/proton-c/bindings/cpp/src/endpoint.cpp0000664000000000000000000000503713257152177020211 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton_bits.hpp" #include "proton/connection.hpp" #include "proton/endpoint.hpp" #include "proton/error_condition.hpp" #include "proton/link.hpp" #include "proton/session.hpp" #include #include #include namespace { inline bool uninitialized(int state) { return state & PN_LOCAL_UNINIT; } inline bool active(int state) { return state & PN_LOCAL_ACTIVE; } inline bool closed(int state) { return (state & PN_LOCAL_CLOSED) && (state & PN_REMOTE_CLOSED); } } namespace proton { bool connection::uninitialized() const { return ::uninitialized(pn_connection_state(pn_object())); } bool connection::active() const { return ::active(pn_connection_state(pn_object())); } bool connection::closed() const { return ::closed(pn_connection_state(pn_object())); } void connection::close(const error_condition& condition) { set_error_condition(condition, pn_connection_condition(pn_object())); close(); } bool session::uninitialized() const { return ::uninitialized(pn_session_state(pn_object())); } bool session::active() const { return ::active(pn_session_state(pn_object())); } bool session::closed() const { return ::closed(pn_session_state(pn_object())); } void session::close(const error_condition& condition) { set_error_condition(condition, pn_session_condition(pn_object())); close(); } bool link::uninitialized() const { return ::uninitialized(pn_link_state(pn_object())); } bool link::active() const { return ::active(pn_link_state(pn_object())); } bool link::closed() const { return ::closed(pn_link_state(pn_object())); } void link::close(const error_condition& condition) { set_error_condition(condition, pn_link_condition(pn_object())); close(); } endpoint::~endpoint() {} } qpid-proton-0.22.0/proton-c/bindings/cpp/src/encoder.cpp0000664000000000000000000001425013257152177020005 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/codec/encoder.hpp" #include "proton_bits.hpp" #include "types_internal.hpp" #include "msg.hpp" #include "proton/annotation_key.hpp" #include "proton/binary.hpp" #include "proton/decimal.hpp" #include "proton/message_id.hpp" #include "proton/scalar_base.hpp" #include "proton/symbol.hpp" #include "proton/timestamp.hpp" #include "proton/value.hpp" #include #include #include namespace proton { namespace codec { void encoder::check(long result) { if (result < 0) throw conversion_error(error_str(pn_data_error(pn_object()), result)); } encoder::encoder(internal::value_base& v) : data(v.data()) { clear(); } bool encoder::encode(char* buffer, size_t& size) { internal::state_guard sg(*this); // In case of error ssize_t result = pn_data_encode(pn_object(), buffer, size); if (result == PN_OVERFLOW) { result = pn_data_encoded_size(pn_object()); if (result >= 0) { size = size_t(result); return false; } } check(result); size = size_t(result); sg.cancel(); // Don't restore state, all is well. pn_data_clear(pn_object()); return true; } void encoder::encode(std::string& s) { s.resize(std::max(s.capacity(), size_t(1))); // Use full capacity, ensure not empty size_t size = s.size(); assert(!s.empty()); if (!encode(&s[0], size)) { s.resize(size); assert(!s.empty()); encode(&s[0], size); } } std::string encoder::encode() { std::string s; encode(s); return s; } encoder& encoder::operator<<(const start& s) { switch (s.type) { case ARRAY: pn_data_put_array(pn_object(), s.is_described, pn_type_t(s.element)); break; case MAP: pn_data_put_map(pn_object()); break; case LIST: pn_data_put_list(pn_object()); break; case DESCRIBED: pn_data_put_described(pn_object()); break; default: throw conversion_error(MSG("" << s.type << " is not a container type")); } pn_data_enter(pn_object()); return *this; } encoder& encoder::operator<<(const finish&) { pn_data_exit(pn_object()); return *this; } namespace { template T coerce(const U &x) { return x; } template <> pn_uuid_t coerce(const uuid& x) { pn_uuid_t y; byte_copy(y, x); return y; } template <> pn_decimal32_t coerce(const decimal32 &x) { pn_decimal32_t y; byte_copy(y, x); return y; } template <> pn_decimal64_t coerce(const decimal64 &x) { pn_decimal64_t y; byte_copy(y, x); return y; } template <> pn_decimal128_t coerce(const decimal128 &x) { pn_decimal128_t y; byte_copy(y, x); return y; } int pn_data_put_amqp_string(pn_data_t *d, const std::string& x) { return pn_data_put_string(d, pn_bytes(x)); } int pn_data_put_amqp_binary(pn_data_t *d, const binary& x) { return pn_data_put_binary(d, pn_bytes(x)); } int pn_data_put_amqp_symbol(pn_data_t *d, const symbol& x) { return pn_data_put_symbol(d, pn_bytes(x)); } } // namespace template encoder& encoder::insert(const T& x, int (*put)(pn_data_t*, U)) { internal::state_guard sg(*this); // Save state in case of error. check(put(pn_object(), coerce(x))); sg.cancel(); // Don't restore state, all is good. return *this; } encoder& encoder::operator<<(bool x) { return insert(x, pn_data_put_bool); } encoder& encoder::operator<<(uint8_t x) { return insert(x, pn_data_put_ubyte); } encoder& encoder::operator<<(int8_t x) { return insert(x, pn_data_put_byte); } encoder& encoder::operator<<(uint16_t x) { return insert(x, pn_data_put_ushort); } encoder& encoder::operator<<(int16_t x) { return insert(x, pn_data_put_short); } encoder& encoder::operator<<(uint32_t x) { return insert(x, pn_data_put_uint); } encoder& encoder::operator<<(int32_t x) { return insert(x, pn_data_put_int); } encoder& encoder::operator<<(wchar_t x) { return insert(x, pn_data_put_char); } encoder& encoder::operator<<(uint64_t x) { return insert(x, pn_data_put_ulong); } encoder& encoder::operator<<(int64_t x) { return insert(x, pn_data_put_long); } encoder& encoder::operator<<(timestamp x) { return insert(x.milliseconds(), pn_data_put_timestamp); } encoder& encoder::operator<<(float x) { return insert(x, pn_data_put_float); } encoder& encoder::operator<<(double x) { return insert(x, pn_data_put_double); } encoder& encoder::operator<<(decimal32 x) { return insert(x, pn_data_put_decimal32); } encoder& encoder::operator<<(decimal64 x) { return insert(x, pn_data_put_decimal64); } encoder& encoder::operator<<(decimal128 x) { return insert(x, pn_data_put_decimal128); } encoder& encoder::operator<<(const uuid& x) { return insert(x, pn_data_put_uuid); } encoder& encoder::operator<<(const std::string& x) { return insert(x, pn_data_put_amqp_string); } encoder& encoder::operator<<(const symbol& x) { return insert(x, pn_data_put_amqp_symbol); } encoder& encoder::operator<<(const binary& x) { return insert(x, pn_data_put_amqp_binary); } encoder& encoder::operator<<(const null&) { pn_data_put_null(pn_object()); return *this; } encoder& encoder::operator<<(const scalar_base& x) { return insert(x.atom_, pn_data_put_atom); } encoder& encoder::operator<<(const internal::value_base& x) { data d = x.data_; if (*this == d) throw conversion_error("cannot insert into self"); if (!d || d.empty()) return *this << null(); d.rewind(); check(append(d)); return *this; } } // codec } // proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/duration.cpp0000664000000000000000000000240013257152177020205 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/duration.hpp" #include "proton/timestamp.hpp" #include #include namespace proton { const duration duration::FOREVER(std::numeric_limits::max()); const duration duration::IMMEDIATE(0); const duration duration::MILLISECOND(1); const duration duration::SECOND(1000); const duration duration::MINUTE(SECOND * 60); std::ostream& operator<<(std::ostream& o, duration d) { return o << d.milliseconds(); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/delivery.cpp0000664000000000000000000000301113257152177020202 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/delivery.hpp" #include "proton/receiver.hpp" #include "proton_bits.hpp" #include namespace { void settle_delivery(pn_delivery_t* o, uint64_t state) { pn_delivery_update(o, state); pn_delivery_settle(o); } } namespace proton { delivery::delivery(pn_delivery_t* d): transfer(make_wrapper(d)) {} receiver delivery::receiver() const { return make_wrapper(pn_delivery_link(pn_object())); } void delivery::accept() { settle_delivery(pn_object(), ACCEPTED); } void delivery::reject() { settle_delivery(pn_object(), REJECTED); } void delivery::release() { settle_delivery(pn_object(), RELEASED); } void delivery::modify() { settle_delivery(pn_object(), MODIFIED); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/decoder.cpp0000664000000000000000000002423513257152177017777 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/codec/decoder.hpp" #include "proton/annotation_key.hpp" #include "proton/binary.hpp" #include "proton/decimal.hpp" #include "proton/message_id.hpp" #include "proton/scalar.hpp" #include "proton/symbol.hpp" #include "proton/timestamp.hpp" #include "proton/value.hpp" #include "proton_bits.hpp" #include "types_internal.hpp" #include "msg.hpp" #include namespace proton { namespace codec { /**@file * * Note the pn_data_t "current" node is always pointing *before* the next value * to be returned by the decoder. */ decoder::decoder(const internal::value_base& v, bool exact) : data(const_cast(v).data()), exact_(exact) { rewind(); } namespace { template T check(T result) { if (result < 0) throw conversion_error(error_str(result)); return result; } } void decoder::decode(const char* i, size_t size) { internal::state_guard sg(*this); const char* end = i + size; while (i < end) i += check(pn_data_decode(pn_object(), i, size_t(end - i))); } void decoder::decode(const std::string& s) { decode(s.data(), s.size()); } bool decoder::more() { internal::state_guard sg(*this); return next(); } type_id decoder::pre_get() { if (!next()) throw conversion_error("no more data"); type_id t = type_id(pn_data_type(pn_object())); if (t < 0) throw conversion_error("invalid data"); return t; } namespace { template void assign(T& x, const U& y) { x = y; } void assign(uuid& x, const pn_uuid_t y) { byte_copy(x, y); } void assign(decimal32& x, const pn_decimal32_t y) { byte_copy(x, y); } void assign(decimal64& x, const pn_decimal64_t y) { byte_copy(x, y); } void assign(decimal128& x, const pn_decimal128_t y) { byte_copy(x, y); } void assign(symbol& x, const pn_bytes_t y) { x = str(y); } void assign(binary& x, const pn_bytes_t y) { x = bin(y); } } // namespace // Simple extract with no type conversion. template decoder& decoder::extract(T& x, U (*get)(pn_data_t*)) { internal::state_guard sg(*this); assert_type_equal(internal::type_id_of::value, pre_get()); assign(x, get(pn_object())); sg.cancel(); // No error, cancel the reset. return *this; } type_id decoder::next_type() { internal::state_guard sg(*this); return pre_get(); } decoder& decoder::operator>>(start& s) { internal::state_guard sg(*this); s.type = pre_get(); switch (s.type) { case ARRAY: s.size = pn_data_get_array(pn_object()); s.element = type_id(pn_data_get_array_type(pn_object())); s.is_described = pn_data_is_array_described(pn_object()); break; case LIST: s.size = pn_data_get_list(pn_object()); break; case MAP: s.size = pn_data_get_map(pn_object()); break; case DESCRIBED: s.is_described = true; s.size = 1; break; default: throw conversion_error(MSG("" << s.type << " is not a container type")); } pn_data_enter(pn_object()); sg.cancel(); return *this; } decoder& decoder::operator>>(const finish&) { pn_data_exit(pn_object()); return *this; } decoder& decoder::operator>>(null&) { internal::state_guard sg(*this); assert_type_equal(NULL_TYPE, pre_get()); return *this; } decoder& decoder::operator>>(internal::value_base& x) { if (*this == x.data_) throw conversion_error("extract into self"); data d = x.data(); d.clear(); narrow(); try { check(d.appendn(*this, 1)); widen(); } catch(...) { widen(); throw; } next(); return *this; } decoder& decoder::operator>>(message_id& x) { internal::state_guard sg(*this); type_id got = pre_get(); if (got != ULONG && got != UUID && got != BINARY && got != STRING) throw conversion_error( msg() << "expected one of ulong, uuid, binary or string but found " << got); x.set(pn_data_get_atom(pn_object())); sg.cancel(); return *this; } decoder& decoder::operator>>(annotation_key& x) { internal::state_guard sg(*this); type_id got = pre_get(); if (got != ULONG && got != SYMBOL) throw conversion_error(msg() << "expected one of ulong or symbol but found " << got); x.set(pn_data_get_atom(pn_object())); sg.cancel(); return *this; } decoder& decoder::operator>>(scalar& x) { internal::state_guard sg(*this); type_id got = pre_get(); if (!type_id_is_scalar(got)) throw conversion_error("expected scalar, found "+type_name(got)); x.set(pn_data_get_atom(pn_object())); sg.cancel(); // No error, no rewind return *this; } decoder& decoder::operator>>(bool &x) { return extract(x, pn_data_get_bool); } decoder& decoder::operator>>(uint8_t &x) { return extract(x, pn_data_get_ubyte); } decoder& decoder::operator>>(int8_t &x) { return extract(x, pn_data_get_byte); } decoder& decoder::operator>>(uint16_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(USHORT, tid); switch (tid) { case UBYTE: x = pn_data_get_ubyte(pn_object()); break; case USHORT: x = pn_data_get_ushort(pn_object()); break; default: assert_type_equal(USHORT, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(int16_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(SHORT, tid); switch (tid) { case BYTE: x = pn_data_get_byte(pn_object()); break; case SHORT: x = pn_data_get_short(pn_object()); break; default: assert_type_equal(SHORT, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(uint32_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(UINT, tid); switch (tid) { case UBYTE: x = pn_data_get_ubyte(pn_object()); break; case USHORT: x = pn_data_get_ushort(pn_object()); break; case UINT: x = pn_data_get_uint(pn_object()); break; default: assert_type_equal(UINT, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(int32_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(INT, tid); switch (tid) { case BYTE: x = pn_data_get_byte(pn_object()); break; case SHORT: x = pn_data_get_short(pn_object()); break; case INT: x = pn_data_get_int(pn_object()); break; default: assert_type_equal(INT, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(uint64_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(ULONG, tid); switch (tid) { case UBYTE: x = pn_data_get_ubyte(pn_object()); break; case USHORT: x = pn_data_get_ushort(pn_object()); break; case UINT: x = pn_data_get_uint(pn_object()); break; case ULONG: x = pn_data_get_ulong(pn_object()); break; default: assert_type_equal(ULONG, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(int64_t &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(LONG, tid); switch (tid) { case BYTE: x = pn_data_get_byte(pn_object()); break; case SHORT: x = pn_data_get_short(pn_object()); break; case INT: x = pn_data_get_int(pn_object()); break; case LONG: x = pn_data_get_long(pn_object()); break; default: assert_type_equal(LONG, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(wchar_t &x) { return extract(x, pn_data_get_char); } decoder& decoder::operator>>(timestamp &x) { return extract(x, pn_data_get_timestamp); } decoder& decoder::operator>>(float &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(FLOAT, tid); switch (tid) { case FLOAT: x = pn_data_get_float(pn_object()); break; case DOUBLE: x = float(pn_data_get_double(pn_object())); break; default: assert_type_equal(FLOAT, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(double &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(DOUBLE, tid); switch (tid) { case FLOAT: x = static_cast(pn_data_get_float(pn_object())); break; case DOUBLE: x = pn_data_get_double(pn_object()); break; default: assert_type_equal(DOUBLE, tid); } sg.cancel(); return *this; } decoder& decoder::operator>>(decimal32 &x) { return extract(x, pn_data_get_decimal32); } decoder& decoder::operator>>(decimal64 &x) { return extract(x, pn_data_get_decimal64); } decoder& decoder::operator>>(decimal128 &x) { return extract(x, pn_data_get_decimal128); } decoder& decoder::operator>>(uuid &x) { return extract(x, pn_data_get_uuid); } decoder& decoder::operator>>(binary &x) { return extract(x, pn_data_get_binary); } decoder& decoder::operator>>(symbol &x) { return extract(x, pn_data_get_symbol); } decoder& decoder::operator>>(std::string &x) { internal::state_guard sg(*this); type_id tid = pre_get(); if (exact_) assert_type_equal(STRING, tid); switch (tid) { case STRING: x = str(pn_data_get_string(pn_object())); break; case SYMBOL: x = str(pn_data_get_symbol(pn_object())); break; default: assert_type_equal(STRING, tid); } sg.cancel(); return *this; } } // codec } // proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/decimal.cpp0000664000000000000000000000244413257152177017766 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/decimal.hpp" #include namespace proton { std::ostream& operator<<(std::ostream& o, const decimal32& d) { return o << "decimal32(" < >(d)<< ")"; } std::ostream& operator<<(std::ostream& o, const decimal64& d) { return o << "decimal64(" < >(d)<< ")"; } std::ostream& operator<<(std::ostream& o, const decimal128& d) { return o << "decimal128(" < >(d)<< ")"; } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/data.cpp0000664000000000000000000000427213257152177017302 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/internal/data.hpp" #include "proton/binary.hpp" #include "proton/codec/encoder.hpp" #include "proton/decimal.hpp" #include "proton/message_id.hpp" #include "proton/symbol.hpp" #include "proton/timestamp.hpp" #include "proton/value.hpp" #include #include #include "proton_bits.hpp" namespace proton { namespace internal { data data::create() { return internal::take_ownership(pn_data(0)).get(); } void data::copy(const data& x) { ::pn_data_copy(pn_object(), x.pn_object()); } void data::clear() { ::pn_data_clear(pn_object()); } void data::rewind() { ::pn_data_rewind(pn_object()); } bool data::empty() const { return ::pn_data_size(pn_object()) == 0; } const void* data::point() const { return pn_data_point(pn_object()); } void data::restore(const void* h) { pn_data_restore(pn_object(), pn_handle_t(h)); } void data::narrow() { pn_data_narrow(pn_object()); } void data::widen() { pn_data_widen(pn_object()); } int data::append(data src) { return pn_data_append(pn_object(), src.pn_object());} int data::appendn(data src, int limit) { return pn_data_appendn(pn_object(), src.pn_object(), limit);} bool data::next() { return pn_data_next(pn_object()); } std::ostream& operator<<(std::ostream& o, const data& d) { state_guard sg(const_cast(d)); const_cast(d).rewind(); return o << inspectable(d.pn_object()); } } // internal } // proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/contexts.hpp0000664000000000000000000001031313257152177020236 0ustar #ifndef PROTON_CPP_CONTEXTS_H #define PROTON_CPP_CONTEXTS_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/work_queue.hpp" #include "proton/message.hpp" #include "proton/internal/pn_unique_ptr.hpp" struct pn_record_t; struct pn_link_t; struct pn_session_t; struct pn_connection_t; struct pn_listener_t; namespace proton { class proton_handler; class connector; namespace io {class link_namer;} // Base class for C++ classes that are used as proton contexts. // Contexts are pn_objects managed by pn reference counts, the C++ value is allocated in-place. class context { public: // identifies a context, contains a record pointer and a handle. typedef std::pair id; virtual ~context(); // Allocate a default-constructed T as a proton object. // T must be a subclass of context. template static T *create() { return new(alloc(sizeof(T))) T(); } // The pn_class for a context static pn_class_t* pn_class(); // Get the context identified by id as a C++ T*, return null pointer if not present. template static T* ptr(id id_) { return reinterpret_cast(pn_record_get(id_.first, id_.second)); } // If the context is not present, create it with value x. template static T& ref(id id_) { T* ctx = context::ptr(id_); if (!ctx) { ctx = create(); pn_record_def(id_.first, id_.second, pn_class()); pn_record_set(id_.first, id_.second, ctx); pn_decref(ctx); } return *ctx; } private: static void *alloc(size_t n); }; class listener_context; class reconnect_context; // Connection context used by all connections. class connection_context : public context { public: connection_context(); static connection_context& get(pn_connection_t *c); class container* container; pn_session_t *default_session; // Owned by connection. message event_message; // re-used by messaging_adapter for performance. io::link_namer* link_gen; // Link name generator. messaging_handler* handler; std::string connected_address_; internal::pn_unique_ptr connection_options_; internal::pn_unique_ptr reconnect_context_; listener_context* listener_context_; work_queue work_queue_; }; // This is not a context object on its own, but an optional part of connection class reconnect_context { public: reconnect_context(const reconnect_options& ro); internal::pn_unique_ptr reconnect_options_; duration delay_; int retries_; int current_url_; }; class listener_context : public context { public: listener_context(); static listener_context& get(pn_listener_t* c); listen_handler* listen_handler_; internal::pn_unique_ptr connection_options_; }; class link_context : public context { public: link_context() : handler(0), credit_window(10), pending_credit(0), auto_accept(true), auto_settle(true), draining(false) {} static link_context& get(pn_link_t* l); messaging_handler* handler; int credit_window; uint32_t pending_credit; bool auto_accept; bool auto_settle; bool draining; }; class session_context : public context { public: session_context() : handler(0) {} static session_context& get(pn_session_t* s); messaging_handler* handler; }; } #endif /*!PROTON_CPP_CONTEXTS_H*/ qpid-proton-0.22.0/proton-c/bindings/cpp/src/contexts.cpp0000664000000000000000000000550513257152177020240 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "contexts.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include "proton/connection_options.hpp" #include "proton/error.hpp" #include "proton/reconnect_options.hpp" #include #include #include #include #include #include #include namespace proton { namespace { void cpp_context_finalize(void* v) { reinterpret_cast(v)->~context(); } #define CID_cpp_context CID_pn_object #define cpp_context_initialize NULL #define cpp_context_hashcode NULL #define cpp_context_compare NULL #define cpp_context_inspect NULL pn_class_t cpp_context_class = PN_CLASS(cpp_context); // Handles PN_HANDLE(CONNECTION_CONTEXT) PN_HANDLE(LISTENER_CONTEXT) PN_HANDLE(SESSION_CONTEXT) PN_HANDLE(LINK_CONTEXT) template T* get_context(pn_record_t* record, pn_handle_t handle) { return reinterpret_cast(pn_record_get(record, handle)); } } context::~context() {} void *context::alloc(size_t n) { return pn_object_new(&cpp_context_class, n); } pn_class_t* context::pn_class() { return &cpp_context_class; } connection_context::connection_context() : container(0), default_session(0), link_gen(0), handler(0), listener_context_(0) {} reconnect_context::reconnect_context(const reconnect_options& ro) : reconnect_options_(new reconnect_options(ro)), retries_(0), current_url_(-1) {} listener_context::listener_context() : listen_handler_(0) {} connection_context& connection_context::get(pn_connection_t *c) { return ref(id(pn_connection_attachments(c), CONNECTION_CONTEXT)); } listener_context& listener_context::get(pn_listener_t* l) { return ref(id(pn_listener_attachments(l), LISTENER_CONTEXT)); } link_context& link_context::get(pn_link_t* l) { return ref(id(pn_link_attachments(l), LINK_CONTEXT)); } session_context& session_context::get(pn_session_t* s) { return ref(id(pn_session_attachments(s), SESSION_CONTEXT)); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/container_test.cpp0000664000000000000000000002564013257152177021414 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_bits.hpp" #include "proton/connection.hpp" #include "proton/connection_options.hpp" #include "proton/container.hpp" #include "proton/messaging_handler.hpp" #include "proton/listener.hpp" #include "proton/listen_handler.hpp" #include "proton/work_queue.hpp" #include #include #include #include #include #if PN_CPP_SUPPORTS_THREADS # include # include # include #endif namespace { std::string make_url(std::string host, int port) { std::ostringstream url; url << "//" << host << ":" << port; return url.str(); } struct test_listen_handler : public proton::listen_handler { bool on_open_, on_accept_, on_close_; std::string on_error_; std::string host_; proton::connection_options opts_; test_listen_handler(const std::string& host=std::string(), const proton::connection_options& opts=proton::connection_options() ) : on_open_(false), on_accept_(false), on_close_(false), host_(host), opts_(opts) {} proton::connection_options on_accept(proton::listener&) PN_CPP_OVERRIDE { on_accept_ = true; return proton::connection_options(); } void on_open(proton::listener& l) PN_CPP_OVERRIDE { on_open_ = true; ASSERT(!on_accept_); ASSERT(on_error_.empty()); ASSERT(!on_close_); l.container().connect(make_url(host_, l.port()), opts_); } void on_close(proton::listener&) PN_CPP_OVERRIDE { on_close_ = true; ASSERT(on_open_ || on_error_.size()); } void on_error(proton::listener&, const std::string& e) PN_CPP_OVERRIDE { on_error_ = e; ASSERT(!on_close_); } }; class test_handler : public proton::messaging_handler { public: bool closing; bool done; std::string peer_vhost; std::string peer_container_id; proton::listener listener; test_listen_handler listen_handler; test_handler(const std::string h, const proton::connection_options& c_opts) : closing(false), done(false), listen_handler(h, c_opts) {} void on_container_start(proton::container &c) PN_CPP_OVERRIDE { listener = c.listen("//:0", listen_handler); } void on_connection_open(proton::connection &c) PN_CPP_OVERRIDE { ASSERT(listen_handler.on_open_); ASSERT(!listen_handler.on_close_); ASSERT(listen_handler.on_error_.empty()); if (peer_vhost.empty() && !c.virtual_host().empty()) peer_vhost = c.virtual_host(); if (peer_container_id.empty() && !c.container_id().empty()) peer_container_id = c.container_id(); if (!closing) c.close(); closing = true; } void on_connection_close(proton::connection &) PN_CPP_OVERRIDE { if (!done) listener.stop(); done = true; } }; int test_container_default_container_id() { proton::connection_options opts; test_handler th("", opts); proton::container(th).run(); ASSERT(!th.peer_container_id.empty()); ASSERT(th.listen_handler.on_error_.empty()); ASSERT(th.listen_handler.on_close_); return 0; } int test_container_vhost() { proton::connection_options opts; opts.virtual_host("a.b.c"); test_handler th("", opts); proton::container(th).run(); ASSERT_EQUAL(th.peer_vhost, "a.b.c"); return 0; } int test_container_default_vhost() { proton::connection_options opts; test_handler th("127.0.0.1", opts); proton::container(th).run(); ASSERT_EQUAL(th.peer_vhost, "127.0.0.1"); return 0; } int test_container_no_vhost() { // explicitly setting an empty virtual-host will cause the Open // performative to be sent without a hostname field present. // Sadly whether or not a 'hostname' field was received cannot be // determined from here, so just exercise the code proton::connection_options opts; opts.virtual_host(""); test_handler th("127.0.0.1", opts); proton::container(th).run(); ASSERT_EQUAL(th.peer_vhost, ""); return 0; } int test_container_bad_address() { // Listen on a bad address, check for leaks // Regression test for https://issues.apache.org/jira/browse/PROTON-1217 proton::container c; // Default fixed-option listener. Valgrind for leaks. try { c.listen("999.666.999.666:0"); } catch (const proton::error&) {} c.run(); // Dummy listener. test_listen_handler l; test_handler h2("999.999.999.666", proton::connection_options()); try { c.listen("999.666.999.666:0", l); } catch (const proton::error&) {} c.run(); ASSERT(!l.on_open_); ASSERT(!l.on_accept_); ASSERT(l.on_close_); ASSERT(!l.on_error_.empty()); return 0; } class stop_tester : public proton::messaging_handler { proton::listener listener; test_listen_handler listen_handler; // Set up a listener which would block forever void on_container_start(proton::container& c) PN_CPP_OVERRIDE { ASSERT(state==0); listener = c.listen("//:0", listen_handler); c.auto_stop(false); state = 1; } // Get here twice - once for listener, once for connector void on_connection_open(proton::connection &c) PN_CPP_OVERRIDE { c.close(); state++; } void on_connection_close(proton::connection &c) PN_CPP_OVERRIDE { ASSERT(state==3); c.container().stop(); state = 4; } void on_container_stop(proton::container & ) PN_CPP_OVERRIDE { ASSERT(state==4); state = 5; } void on_transport_error(proton::transport & t) PN_CPP_OVERRIDE { // Do nothing - ignore transport errors - we're going to get one when // the container stops. } public: stop_tester(): state(0) {} int state; }; int test_container_stop() { stop_tester t; proton::container(t).run(); ASSERT(t.state==5); return 0; } struct hang_tester : public proton::messaging_handler { proton::listener listener; bool done; hang_tester() : done(false) {} void connect(proton::container* c) { c->connect(make_url("", listener.port())); } void on_container_start(proton::container& c) PN_CPP_OVERRIDE { listener = c.listen("//:0"); c.schedule(proton::duration(250), proton::make_work(&hang_tester::connect, this, &c)); } void on_connection_open(proton::connection& c) PN_CPP_OVERRIDE { c.close(); } void on_connection_close(proton::connection& c) PN_CPP_OVERRIDE { if (!done) { done = true; listener.stop(); } } }; int test_container_schedule_nohang() { hang_tester t; proton::container(t).run(); return 0; } class immediate_stop_tester : public proton::messaging_handler { public: void on_container_start(proton::container &c) PN_CPP_OVERRIDE { c.stop(); } }; int test_container_immediate_stop() { immediate_stop_tester t; proton::container(t).run(); // Should return after on_container_start return 0; } int test_container_pre_stop() { proton::container c; c.stop(); c.run(); // Should return immediately return 0; } struct schedule_tester : public proton::messaging_handler { void stop(proton::container* c) { c->stop(); } void on_container_start(proton::container& c) PN_CPP_OVERRIDE { c.schedule(proton::duration(250), proton::make_work(&schedule_tester::stop, this, &c)); } }; int test_container_schedule_stop() { schedule_tester tester; proton::container c(tester); c.auto_stop(false); c.run(); return 0; } #if PN_CPP_SUPPORTS_THREADS // Tests that require thread support class test_mt_handler : public proton::messaging_handler { public: std::mutex lock_; std::condition_variable cond_; std::string str_; proton::error_condition err_; void set(const std::string& s) { std::lock_guard l(lock_); str_ = s; cond_.notify_one(); } std::string wait() { std::unique_lock l(lock_); while (str_.empty()) cond_.wait(l); std::string s = str_; str_.clear(); return s; } proton::error_condition error() const { return err_; } void on_container_start(proton::container &) PN_CPP_OVERRIDE { set("start"); } void on_connection_open(proton::connection &) PN_CPP_OVERRIDE { set("open"); } // Catch errors and save. void on_error(const proton::error_condition& e) PN_CPP_OVERRIDE { err_ = e; } }; class container_runner { proton::container& c_; public: container_runner(proton::container& c) : c_(c) {} void operator()() {c_.run();} }; int test_container_mt_stop_empty() { test_mt_handler th; proton::container c(th); c.auto_stop( false ); container_runner runner(c); auto t = std::thread(runner); ASSERT_EQUAL("start", th.wait()); c.stop(); t.join(); ASSERT_EQUAL("", th.error().name()); return 0; } int test_container_mt_stop() { test_mt_handler th; proton::container c(th); c.auto_stop(false); container_runner runner(c); auto t = std::thread(runner); test_listen_handler lh; c.listen("//:0", lh); // Also opens a connection ASSERT_EQUAL("start", th.wait()); ASSERT_EQUAL("open", th.wait()); c.stop(); t.join(); // It is possible to get sporadic connection errors from this test depending on timing of stop() return 0; } #endif } // namespace int main(int argc, char** argv) { int failed = 0; RUN_ARGV_TEST(failed, test_container_default_container_id()); RUN_ARGV_TEST(failed, test_container_vhost()); RUN_ARGV_TEST(failed, test_container_default_vhost()); RUN_ARGV_TEST(failed, test_container_no_vhost()); RUN_ARGV_TEST(failed, test_container_bad_address()); RUN_ARGV_TEST(failed, test_container_stop()); RUN_ARGV_TEST(failed, test_container_schedule_nohang()); RUN_ARGV_TEST(failed, test_container_immediate_stop()); RUN_ARGV_TEST(failed, test_container_pre_stop()); RUN_ARGV_TEST(failed, test_container_schedule_stop()); #if PN_CPP_SUPPORTS_THREADS RUN_ARGV_TEST(failed, test_container_mt_stop_empty()); RUN_ARGV_TEST(failed, test_container_mt_stop()); #endif return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/container.cpp0000664000000000000000000001157213257152177020354 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/container.hpp" #include "proton/error_condition.hpp" #include "proton/error_condition.hpp" #include "proton/listen_handler.hpp" #include "proton/listener.hpp" #include "proton/uuid.hpp" #include "proactor_container_impl.hpp" namespace proton { container::container(messaging_handler& h, const std::string& id) : impl_(new impl(*this, id, &h)) {} container::container(messaging_handler& h) : impl_(new impl(*this, uuid::random().str(), &h)) {} container::container(const std::string& id) : impl_(new impl(*this, id)) {} container::container() : impl_(new impl(*this, uuid::random().str())) {} container::~container() {} returned container::connect(const std::string &url) { return connect(url, connection_options()); } returned container::open_sender(const std::string &url) { return open_sender(url, proton::sender_options(), connection_options()); } returned container::open_sender(const std::string &url, const proton::sender_options &lo) { return open_sender(url, lo, connection_options()); } returned container::open_sender(const std::string &url, const proton::connection_options &co) { return open_sender(url, sender_options(), co); } returned container::open_receiver(const std::string &url) { return open_receiver(url, proton::receiver_options(), connection_options()); } returned container::open_receiver(const std::string &url, const proton::receiver_options &lo) { return open_receiver(url, lo, connection_options()); } returned container::open_receiver(const std::string &url, const proton::connection_options &co) { return open_receiver(url, receiver_options(), co); } listener container::listen(const std::string& url, const connection_options& opts) { return impl_->listen(url, opts); } listener container::listen(const std::string &url) { return impl_->listen(url); } void container::stop() { stop(error_condition()); } returned container::connect(const std::string& url, const connection_options& opts) { return impl_->connect(url, opts); } listener container::listen(const std::string& url, listen_handler& l) { return impl_->listen(url, l); } void container::run() { impl_->run(1); } #if PN_CPP_SUPPORTS_THREADS void container::run(int threads) { impl_->run(threads); } #endif void container::auto_stop(bool set) { impl_->auto_stop(set); } void container::stop(const error_condition& err) { impl_->stop(err); } returned container::open_sender( const std::string &url, const class sender_options &o, const connection_options &c) { return impl_->open_sender(url, o, c); } returned container::open_receiver( const std::string&url, const class receiver_options &o, const connection_options &c) { return impl_->open_receiver(url, o, c); } std::string container::id() const { return impl_->id(); } void container::schedule(duration d, internal::v03::work f) { return impl_->schedule(d, f); } #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES void container::schedule(duration d, internal::v11::work f) { return impl_->schedule(d, f); } #endif void container::schedule(duration d, void_function0& f) { return impl_->schedule(d, make_work(&void_function0::operator(), &f)); } void container::client_connection_options(const connection_options& c) { impl_->client_connection_options(c); } connection_options container::client_connection_options() const { return impl_->client_connection_options(); } void container::server_connection_options(const connection_options &o) { impl_->server_connection_options(o); } connection_options container::server_connection_options() const { return impl_->server_connection_options(); } void container::sender_options(const class sender_options &o) { impl_->sender_options(o); } class sender_options container::sender_options() const { return impl_->sender_options(); } void container::receiver_options(const class receiver_options & o) { impl_->receiver_options(o); } class receiver_options container::receiver_options() const { return impl_->receiver_options(); } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/connection_options.cpp0000664000000000000000000002223113257152177022276 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton/connection_options.hpp" #include "proton/connection.hpp" #include "proton/fwd.hpp" #include "proton/messaging_handler.hpp" #include "proton/reconnect_options.hpp" #include "proton/transport.hpp" #include "proton/ssl.hpp" #include "proton/sasl.hpp" #include "contexts.hpp" #include "messaging_adapter.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include #include #include namespace proton { template struct option { T value; bool set; option() : value(), set(false) {} option& operator=(const T& x) { value = x; set = true; return *this; } void update(const option& x) { if (x.set) *this = x.value; } }; class connection_options::impl { public: option handler; option max_frame_size; option max_sessions; option idle_timeout; option container_id; option virtual_host; option user; option password; option reconnect; option ssl_client_options; option ssl_server_options; option sasl_enabled; option sasl_allowed_mechs; option sasl_allow_insecure_mechs; option sasl_config_name; option sasl_config_path; /* * There are three types of connection options: the handler * (required at creation, so too late to apply here), open frame * options (that never change after the original open), and * transport options (set once per transport over the life of the * connection). */ void apply_unbound(connection& c) { pn_connection_t *pnc = unwrap(c); // Only apply connection options if uninit. bool uninit = c.uninitialized(); if (!uninit) return; if (reconnect.set) connection_context::get(pnc).reconnect_context_.reset(new reconnect_context(reconnect.value)); if (container_id.set) pn_connection_set_container(pnc, container_id.value.c_str()); if (virtual_host.set) pn_connection_set_hostname(pnc, virtual_host.value.c_str()); if (user.set) pn_connection_set_user(pnc, user.value.c_str()); if (password.set) pn_connection_set_password(pnc, password.value.c_str()); } void apply_transport(pn_transport_t* pnt) { if (max_frame_size.set) pn_transport_set_max_frame(pnt, max_frame_size.value); if (max_sessions.set) pn_transport_set_channel_max(pnt, max_sessions.value); if (idle_timeout.set) pn_transport_set_idle_timeout(pnt, idle_timeout.value.milliseconds()); } void apply_sasl(pn_transport_t* pnt) { // Transport options. pnt is NULL between reconnect attempts // and if there is a pipelined open frame. if (!pnt) return; // Skip entirely if SASL explicitly disabled if (!sasl_enabled.set || sasl_enabled.value) { if (sasl_enabled.set) // Explicitly set, not just default behaviour. pn_sasl(pnt); // Force a sasl instance. Lazily create one otherwise. if (sasl_allow_insecure_mechs.set) pn_sasl_set_allow_insecure_mechs(pn_sasl(pnt), sasl_allow_insecure_mechs.value); if (sasl_allowed_mechs.set) pn_sasl_allowed_mechs(pn_sasl(pnt), sasl_allowed_mechs.value.c_str()); if (sasl_config_name.set) pn_sasl_config_name(pn_sasl(pnt), sasl_config_name.value.c_str()); if (sasl_config_path.set) pn_sasl_config_path(pn_sasl(pnt), sasl_config_path.value.c_str()); } } void apply_ssl(pn_transport_t* pnt, bool client) { // Transport options. pnt is NULL between reconnect attempts // and if there is a pipelined open frame. if (!pnt) return; if (client && ssl_client_options.set) { // A side effect of pn_ssl() is to set the ssl peer // hostname to the connection hostname, which has // already been adjusted for the virtual_host option. pn_ssl_t *ssl = pn_ssl(pnt); if (pn_ssl_init(ssl, ssl_client_options.value.pn_domain(), NULL)) throw error(MSG("client SSL/TLS initialization error")); } else if (!client && ssl_server_options.set) { pn_ssl_t *ssl = pn_ssl(pnt); if (pn_ssl_init(ssl, ssl_server_options.value.pn_domain(), NULL)) throw error(MSG("server SSL/TLS initialization error")); } } void update(const impl& x) { handler.update(x.handler); max_frame_size.update(x.max_frame_size); max_sessions.update(x.max_sessions); idle_timeout.update(x.idle_timeout); container_id.update(x.container_id); virtual_host.update(x.virtual_host); user.update(x.user); password.update(x.password); reconnect.update(x.reconnect); ssl_client_options.update(x.ssl_client_options); ssl_server_options.update(x.ssl_server_options); sasl_enabled.update(x.sasl_enabled); sasl_allow_insecure_mechs.update(x.sasl_allow_insecure_mechs); sasl_allowed_mechs.update(x.sasl_allowed_mechs); sasl_config_name.update(x.sasl_config_name); sasl_config_path.update(x.sasl_config_path); } }; connection_options::connection_options() : impl_(new impl()) {} connection_options::connection_options(class messaging_handler& h) : impl_(new impl()) { handler(h); } connection_options::connection_options(const connection_options& x) : impl_(new impl()) { *this = x; } connection_options::~connection_options() {} connection_options& connection_options::operator=(const connection_options& x) { *impl_ = *x.impl_; return *this; } connection_options& connection_options::update(const connection_options& x) { impl_->update(*x.impl_); return *this; } connection_options& connection_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; } connection_options& connection_options::max_frame_size(uint32_t n) { impl_->max_frame_size = n; return *this; } connection_options& connection_options::max_sessions(uint16_t n) { impl_->max_sessions = n; return *this; } connection_options& connection_options::idle_timeout(duration t) { impl_->idle_timeout = t; return *this; } connection_options& connection_options::container_id(const std::string &id) { impl_->container_id = id; return *this; } connection_options& connection_options::virtual_host(const std::string &id) { impl_->virtual_host = id; return *this; } connection_options& connection_options::user(const std::string &user) { impl_->user = user; return *this; } connection_options& connection_options::password(const std::string &password) { impl_->password = password; return *this; } connection_options& connection_options::reconnect(const reconnect_options &r) { impl_->reconnect = r; return *this; } connection_options& connection_options::ssl_client_options(const class ssl_client_options &c) { impl_->ssl_client_options = c; return *this; } connection_options& connection_options::ssl_server_options(const class ssl_server_options &c) { impl_->ssl_server_options = c; return *this; } connection_options& connection_options::sasl_enabled(bool b) { impl_->sasl_enabled = b; return *this; } connection_options& connection_options::sasl_allow_insecure_mechs(bool b) { impl_->sasl_allow_insecure_mechs = b; return *this; } connection_options& connection_options::sasl_allowed_mechs(const std::string &s) { impl_->sasl_allowed_mechs = s; return *this; } connection_options& connection_options::sasl_config_name(const std::string &n) { impl_->sasl_config_name = n; return *this; } connection_options& connection_options::sasl_config_path(const std::string &p) { impl_->sasl_config_path = p; return *this; } void connection_options::apply_unbound(connection& c) const { impl_->apply_unbound(c); } void connection_options::apply_unbound_client(pn_transport_t *t) const { impl_->apply_sasl(t); impl_->apply_ssl(t, true); impl_->apply_transport(t); } void connection_options::apply_unbound_server(pn_transport_t *t) const { impl_->apply_sasl(t); impl_->apply_ssl(t, false); impl_->apply_transport(t); } messaging_handler* connection_options::handler() const { return impl_->handler.value; } } // namespace proton qpid-proton-0.22.0/proton-c/bindings/cpp/src/connection_driver_test.cpp0000664000000000000000000003623113257152177023142 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_bits.hpp" #include "proton_bits.hpp" #include "link_namer.hpp" #include "proton/connection.hpp" #include "proton/container.hpp" #include "proton/io/connection_driver.hpp" #include "proton/link.hpp" #include "proton/message.hpp" #include "proton/messaging_handler.hpp" #include "proton/receiver_options.hpp" #include "proton/sender.hpp" #include "proton/sender_options.hpp" #include "proton/source.hpp" #include "proton/source_options.hpp" #include "proton/target.hpp" #include "proton/target_options.hpp" #include "proton/transport.hpp" #include "proton/types_fwd.hpp" #include "proton/uuid.hpp" #include #include namespace { using namespace std; using namespace proton; using namespace test; using proton::io::connection_driver; using proton::io::const_buffer; using proton::io::mutable_buffer; typedef std::deque byte_stream; static const int MAX_SPIN = 1000; // Give up after 1000 event-less dispatches /// In memory connection_driver that reads and writes from byte_streams struct in_memory_driver : public connection_driver { byte_stream& reads; byte_stream& writes; int spinning; in_memory_driver(byte_stream& rd, byte_stream& wr, const std::string& name) : connection_driver(name), reads(rd), writes(wr), spinning(0) {} void do_read() { mutable_buffer rbuf = read_buffer(); size_t size = std::min(reads.size(), rbuf.size); if (size) { copy(reads.begin(), reads.begin()+size, static_cast(rbuf.data)); read_done(size); reads.erase(reads.begin(), reads.begin()+size); } } void do_write() { const_buffer wbuf = write_buffer(); if (wbuf.size) { writes.insert(writes.begin(), static_cast(wbuf.data), static_cast(wbuf.data) + wbuf.size); write_done(wbuf.size); } } void check_idle() { spinning = has_events() ? 0 : spinning+1; if (spinning > MAX_SPIN) throw test::error("no activity, interrupting test"); } timestamp process(timestamp t = timestamp()) { check_idle(); if (!dispatch()) throw test::error("unexpected close: "+connection().error().what()); timestamp next_tick; if (t!=timestamp()) next_tick = tick(t); do_read(); do_write(); check_idle(); dispatch(); return next_tick; } }; /// A pair of drivers that talk to each other in-memory, simulating a connection. struct driver_pair { byte_stream ab, ba; in_memory_driver a, b; driver_pair(const connection_options& oa, const connection_options& ob, const std::string& name="" ) : a(ba, ab, name+"a"), b(ab, ba, name+"b") { a.connect(oa); b.accept(ob); } void process() { a.process(); b.process(); } }; /// A pair of drivers that talk to each other in-memory, simulating a connection. /// This version also simulates the passage of time struct timed_driver_pair { duration timeout; byte_stream ab, ba; in_memory_driver a, b; timestamp now; timed_driver_pair(duration t, const connection_options& oa0, const connection_options& ob0, const std::string& name="" ) : timeout(t), a(ba, ab, name+"a"), b(ab, ba, name+"b"), now(100100100) { connection_options oa(oa0); connection_options ob(ob0); a.connect(oa.idle_timeout(t)); b.accept(ob.idle_timeout(t)); } void process_untimed() { a.process(); b.process(); } void process_timed_succeed() { timestamp anow = now + timeout - duration(100); timestamp bnow = now + timeout - duration(100); a.process(anow); b.process(bnow); now = std::max(anow, bnow); } void process_timed_fail() { timestamp anow = now + timeout + timeout + duration(100); timestamp bnow = now + timeout + timeout + duration(100); a.process(anow); b.process(bnow); now = std::max(anow, bnow); } }; /// A handler that records incoming endpoints, errors etc. struct record_handler : public messaging_handler { std::deque receivers; std::deque senders; std::deque sessions; std::deque unhandled_errors, transport_errors, connection_errors; std::deque messages; void on_receiver_open(receiver &l) PN_CPP_OVERRIDE { messaging_handler::on_receiver_open(l); receivers.push_back(l); } void on_sender_open(sender &l) PN_CPP_OVERRIDE { messaging_handler::on_sender_open(l); senders.push_back(l); } void on_session_open(session &s) PN_CPP_OVERRIDE { messaging_handler::on_session_open(s); sessions.push_back(s); } void on_transport_error(transport& t) PN_CPP_OVERRIDE { transport_errors.push_back(t.error().what()); } void on_connection_error(connection& c) PN_CPP_OVERRIDE { connection_errors.push_back(c.error().what()); } void on_error(const proton::error_condition& c) PN_CPP_OVERRIDE { unhandled_errors.push_back(c.what()); } void on_message(proton::delivery&, proton::message& m) PN_CPP_OVERRIDE { messages.push_back(m); } }; template typename S::value_type quick_pop(S& s) { ASSERT(!s.empty()); typename S::value_type x = s.front(); s.pop_front(); return x; } struct namer : public io::link_namer { char name; namer(char c) : name(c) {} std::string link_name() { return std::string(1, name++); } }; void test_driver_link_id() { record_handler ha, hb; driver_pair d(ha, hb); d.a.connect(ha); d.b.accept(hb); namer na('x'); namer nb('b'); connection ca = d.a.connection(); connection cb = d.b.connection(); set_link_namer(ca, na); set_link_namer(cb, nb); d.b.connection().open(); d.a.connection().open_sender("foo"); while (ha.senders.empty() || hb.receivers.empty()) d.process(); sender s = quick_pop(ha.senders); ASSERT_EQUAL("x", s.name()); ASSERT_EQUAL("x", quick_pop(hb.receivers).name()); d.a.connection().open_receiver("bar"); while (ha.receivers.empty() || hb.senders.empty()) d.process(); ASSERT_EQUAL("y", quick_pop(ha.receivers).name()); ASSERT_EQUAL("y", quick_pop(hb.senders).name()); d.b.connection().open_receiver(""); while (ha.senders.empty() || hb.receivers.empty()) d.process(); ASSERT_EQUAL("b", quick_pop(ha.senders).name()); ASSERT_EQUAL("b", quick_pop(hb.receivers).name()); } void test_endpoint_close() { record_handler ha, hb; driver_pair d(ha, hb); d.a.connection().open_sender("x"); d.a.connection().open_receiver("y"); while (ha.senders.size()+ha.receivers.size() < 2 || hb.senders.size()+hb.receivers.size() < 2) d.process(); proton::link ax = quick_pop(ha.senders), ay = quick_pop(ha.receivers); proton::link bx = quick_pop(hb.receivers), by = quick_pop(hb.senders); // Close a link ax.close(proton::error_condition("err", "foo bar")); while (!bx.closed()) d.process(); proton::error_condition c = bx.error(); ASSERT_EQUAL("err", c.name()); ASSERT_EQUAL("foo bar", c.description()); ASSERT_EQUAL("err: foo bar", c.what()); // Close a link with an empty condition ay.close(proton::error_condition()); while (!by.closed()) d.process(); ASSERT(by.error().empty()); // Close a connection connection ca = d.a.connection(), cb = d.b.connection(); ca.close(proton::error_condition("conn", "bad connection")); while (!cb.closed()) d.process(); ASSERT_EQUAL("conn: bad connection", cb.error().what()); ASSERT_EQUAL(1u, hb.connection_errors.size()); ASSERT_EQUAL("conn: bad connection", hb.connection_errors.front()); } void test_driver_disconnected() { // driver.disconnected() aborts the connection and calls the local on_transport_error() record_handler ha, hb; driver_pair d(ha, hb); d.a.connect(ha); d.b.accept(hb); while (!d.a.connection().active() || !d.b.connection().active()) d.process(); // Close a with an error condition. The AMQP connection is still open. d.a.disconnected(proton::error_condition("oops", "driver failure")); ASSERT(!d.a.dispatch()); ASSERT(!d.a.connection().closed()); ASSERT(d.a.connection().error().empty()); ASSERT_EQUAL(0u, ha.connection_errors.size()); ASSERT_EQUAL("oops: driver failure", d.a.transport().error().what()); ASSERT_EQUAL(1u, ha.transport_errors.size()); ASSERT_EQUAL("oops: driver failure", ha.transport_errors.front()); // In a real app the IO code would detect the abort and do this: d.b.disconnected(proton::error_condition("broken", "it broke")); ASSERT(!d.b.dispatch()); ASSERT(!d.b.connection().closed()); ASSERT(d.b.connection().error().empty()); ASSERT_EQUAL(0u, hb.connection_errors.size()); // Proton-C adds (connection aborted) if transport closes too early, // and provides a default message if there is no user message. ASSERT_EQUAL("broken: it broke (connection aborted)", d.b.transport().error().what()); ASSERT_EQUAL(1u, hb.transport_errors.size()); ASSERT_EQUAL("broken: it broke (connection aborted)", hb.transport_errors.front()); } void test_no_container() { // An driver with no container should throw, not crash. connection_driver d; try { d.connection().container(); FAIL("expected error"); } catch (const proton::error&) {} } void test_spin_interrupt() { // Check the test framework interrupts a spinning driver pair with nothing to do. record_handler ha, hb; driver_pair d(ha, hb); try { while (true) d.process(); FAIL("expected exception"); } catch (const test::error&) {} } void test_link_options() { // Propagation of link and terminus properties record_handler ha, hb; driver_pair d(ha, hb); std::vector caps; caps.push_back("foo"); caps.push_back("bar"); source::filter_map f; f.put("xx", "xxx"); ASSERT_EQUAL(1U, f.size()); d.a.connection().open_sender( "x", sender_options().name("_x").target(target_options().capabilities(caps))); f.clear(); f.put("yy", "yyy"); ASSERT_EQUAL(1U, f.size()); d.a.connection().open_receiver( "y", receiver_options().name("_y").source(source_options().filters(f).capabilities(caps))); while (ha.senders.size()+ha.receivers.size() < 2 || hb.senders.size()+hb.receivers.size() < 2) d.process(); proton::sender ax = quick_pop(ha.senders); ASSERT_EQUAL("_x", ax.name()); // TODO PROTON-1679 - the following assertion should pass. // ASSERT_EQUAL("x", ax.target().address()); // ASSERT_EQUAL(many() + "foo" + "bar", ax.target().capabilities()); proton::receiver ay = quick_pop(ha.receivers); ASSERT_EQUAL("_y", ay.name()); // TODO PROTON-1679 - the following assertion should pass. // ASSERT_EQUAL("y", ay.source().address()); // ASSERT_EQUAL(many() + "foo" + "bar", ay.source().capabilities()); proton::receiver bx = quick_pop(hb.receivers); ASSERT_EQUAL("x", bx.target().address()); ASSERT_EQUAL(many() + "foo" + "bar", bx.target().capabilities()); ASSERT_EQUAL("_x", bx.name()); ASSERT_EQUAL("", bx.source().address()); ASSERT_EQUAL(many(), bx.source().capabilities()); proton::sender by = quick_pop(hb.senders); ASSERT_EQUAL("y", by.source().address()); ASSERT_EQUAL(many() + "foo" + "bar", by.source().capabilities()); ASSERT_EQUAL("_y", by.name()); f = by.source().filters(); ASSERT_EQUAL(1U, f.size()); ASSERT_EQUAL(value("yyy"), f.get("yy")); } void test_message() { // Verify a message arrives intact record_handler ha, hb; driver_pair d(ha, hb); proton::sender s = d.a.connection().open_sender("x"); proton::message m("barefoot"); m.properties().put("x", "y"); m.message_annotations().put("a", "b"); s.send(m); while (hb.messages.size() == 0) d.process(); proton::message m2 = quick_pop(hb.messages); ASSERT_EQUAL(value("barefoot"), m2.body()); ASSERT_EQUAL(value("y"), m2.properties().get("x")); ASSERT_EQUAL(value("b"), m2.message_annotations().get("a")); } void test_message_timeout_succeed() { // Verify a message arrives intact record_handler ha, hb; timed_driver_pair d(duration(2000), ha, hb); proton::sender s = d.a.connection().open_sender("x"); d.process_timed_succeed(); proton::message m("barefoot_timed_succeed"); m.properties().put("x", "y"); m.message_annotations().put("a", "b"); s.send(m); while (hb.messages.size() == 0) d.process_timed_succeed(); proton::message m2 = quick_pop(hb.messages); ASSERT_EQUAL(value("barefoot_timed_succeed"), m2.body()); ASSERT_EQUAL(value("y"), m2.properties().get("x")); ASSERT_EQUAL(value("b"), m2.message_annotations().get("a")); } void test_message_timeout_fail() { // Verify a message arrives intact record_handler ha, hb; timed_driver_pair d(duration(2000), ha, hb); proton::sender s = d.a.connection().open_sender("x"); d.process_timed_fail(); proton::message m("barefoot_timed_fail"); m.properties().put("x", "y"); m.message_annotations().put("a", "b"); s.send(m); d.process_timed_fail(); ASSERT_THROWS(test::error, while (hb.messages.size() == 0) { d.process_timed_fail(); } ); ASSERT_EQUAL(1u, hb.transport_errors.size()); ASSERT_EQUAL("amqp:resource-limit-exceeded: local-idle-timeout expired", d.b.transport().error().what()); ASSERT_EQUAL(1u, ha.connection_errors.size()); ASSERT_EQUAL("amqp:resource-limit-exceeded: local-idle-timeout expired", d.a.connection().error().what()); } } int main(int argc, char** argv) { int failed = 0; RUN_ARGV_TEST(failed, test_driver_link_id()); RUN_ARGV_TEST(failed, test_endpoint_close()); RUN_ARGV_TEST(failed, test_driver_disconnected()); RUN_ARGV_TEST(failed, test_no_container()); RUN_ARGV_TEST(failed, test_spin_interrupt()); RUN_ARGV_TEST(failed, test_link_options()); RUN_ARGV_TEST(failed, test_message()); RUN_ARGV_TEST(failed, test_message_timeout_succeed()); RUN_ARGV_TEST(failed, test_message_timeout_fail()); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/connection_driver.cpp0000664000000000000000000001125413257152177022101 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "proton/io/connection_driver.hpp" #include "proton/connection.hpp" #include "proton/container.hpp" #include "proton/error.hpp" #include "proton/messaging_handler.hpp" #include "proton/transport.hpp" #include "proton/uuid.hpp" #include "proton/work_queue.hpp" #include "contexts.hpp" #include "messaging_adapter.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include #include #include #include namespace proton { namespace io { void connection_driver::init() { if (pn_connection_driver_init(&driver_, pn_connection(), pn_transport()) != 0) { this->~connection_driver(); // Dtor won't be called on throw from ctor. throw proton::error(std::string("connection_driver allocation failed")); } } connection_driver::connection_driver() : handler_(0) { init(); } connection_driver::connection_driver(const std::string& id) : container_id_(id), handler_(0) { init(); } connection_driver::~connection_driver() { pn_connection_driver_destroy(&driver_); } void connection_driver::configure(const connection_options& opts, bool server) { proton::connection c(connection()); opts.apply_unbound(c); if (server) { pn_transport_set_server(driver_.transport); opts.apply_unbound_server(driver_.transport); } else { opts.apply_unbound_client(driver_.transport); } pn_connection_driver_bind(&driver_); handler_ = opts.handler(); } void connection_driver::connect(const connection_options& opts) { connection_options all; all.container_id(container_id_); all.update(opts); configure(all, false); connection().open(); } void connection_driver::accept(const connection_options& opts) { connection_options all; all.container_id(container_id_); all.update(opts); configure(all, true); } bool connection_driver::has_events() const { return driver_.collector && pn_collector_peek(driver_.collector); } bool connection_driver::dispatch() { pn_event_t* c_event; while ((c_event = pn_connection_driver_next_event(&driver_)) != NULL) { try { if (handler_ != 0) { messaging_adapter::dispatch(*handler_, c_event); } } catch (const std::exception& e) { pn_condition_t *cond = pn_transport_condition(driver_.transport); if (!pn_condition_is_set(cond)) { pn_condition_format(cond, "exception", "%s", e.what()); } } } return !pn_connection_driver_finished(&driver_); } mutable_buffer connection_driver::read_buffer() { pn_rwbytes_t buffer = pn_connection_driver_read_buffer(&driver_); return mutable_buffer(buffer.start, buffer.size); } void connection_driver::read_done(size_t n) { return pn_connection_driver_read_done(&driver_, n); } void connection_driver::read_close() { pn_connection_driver_read_close(&driver_); } const_buffer connection_driver::write_buffer() { pn_bytes_t buffer = pn_connection_driver_write_buffer(&driver_); return const_buffer(buffer.start, buffer.size); } void connection_driver::write_done(size_t n) { return pn_connection_driver_write_done(&driver_, n); } void connection_driver::write_close() { pn_connection_driver_write_close(&driver_); } timestamp connection_driver::tick(timestamp now) { return timestamp(pn_transport_tick(driver_.transport, now.milliseconds())); } void connection_driver::disconnected(const proton::error_condition& err) { pn_condition_t* condition = pn_transport_condition(driver_.transport); if (!pn_condition_is_set(condition)) { set_error_condition(err, condition); } pn_connection_driver_close(&driver_); } proton::connection connection_driver::connection() const { return make_wrapper(driver_.connection); } proton::transport connection_driver::transport() const { return make_wrapper(driver_.transport); } }} qpid-proton-0.22.0/proton-c/bindings/cpp/src/connection.cpp0000664000000000000000000001256613257152177020535 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "proton_bits.hpp" #include "proton/connection.hpp" #include "proton/connection_options.hpp" #include "proton/container.hpp" #include "proton/error.hpp" #include "proton/receiver_options.hpp" #include "proton/sender_options.hpp" #include "proton/session.hpp" #include "proton/session_options.hpp" #include "proton/transport.hpp" #include "proton/work_queue.hpp" #include "contexts.hpp" #include "msg.hpp" #include "proton_bits.hpp" #include #include #include #include #include namespace proton { transport connection::transport() const { return make_wrapper(pn_connection_transport(pn_object())); } void connection::open() { open(connection_options()); } void connection::open(const connection_options &opts) { opts.apply_unbound(*this); pn_connection_open(pn_object()); } void connection::close() { pn_connection_close(pn_object()); } std::string connection::virtual_host() const { return str(pn_connection_remote_hostname(pn_object())); } std::string connection::container_id() const { return str(pn_connection_get_container(pn_object())); } std::string connection::user() const { return str(pn_transport_get_user(pn_connection_transport(pn_object()))); } container& connection::container() const { class container* c = connection_context::get(pn_object()).container; if (!c) throw proton::error("No container"); return *c; } work_queue& connection::work_queue() const { return connection_context::get(pn_object()).work_queue_; } session_range connection::sessions() const { return session_range(session_iterator(make_wrapper(pn_session_head(pn_object(), 0)))); } receiver_range connection::receivers() const { pn_link_t *lnk = pn_link_head(pn_object(), 0); while (lnk) { if (pn_link_is_receiver(lnk)) break; lnk = pn_link_next(lnk, 0); } return receiver_range(receiver_iterator(make_wrapper(lnk))); } sender_range connection::senders() const { pn_link_t *lnk = pn_link_head(pn_object(), 0); while (lnk) { if (pn_link_is_sender(lnk)) break; lnk = pn_link_next(lnk, 0); } return sender_range(sender_iterator(make_wrapper(lnk))); } session connection::open_session() { return open_session(session_options()); } session connection::open_session(const session_options &opts) { session s(make_wrapper(pn_session(pn_object()))); // TODO: error check, too many sessions, no mem... if (!!s) s.open(opts); return s; } session connection::default_session() { connection_context& ctx = connection_context::get(pn_object()); if (!ctx.default_session) { // Note we can't use a proton::session here because we don't want to own // a session reference. The connection owns the session, owning it here as well // would create a circular ownership. ctx.default_session = pn_session(pn_object()); pn_session_open(ctx.default_session); } return make_wrapper(ctx.default_session); } sender connection::open_sender(const std::string &addr) { return open_sender(addr, sender_options()); } sender connection::open_sender(const std::string &addr, const class sender_options &opts) { return default_session().open_sender(addr, opts); } receiver connection::open_receiver(const std::string &addr) { return open_receiver(addr, receiver_options()); } receiver connection::open_receiver(const std::string &addr, const class receiver_options &opts) { return default_session().open_receiver(addr, opts); } class sender_options connection::sender_options() const { connection_context& ctx = connection_context::get(pn_object()); return ctx.container ? ctx.container->sender_options() : proton::sender_options(); } class receiver_options connection::receiver_options() const { connection_context& ctx = connection_context::get(pn_object()); return ctx.container ? ctx.container->receiver_options() : proton::receiver_options(); } error_condition connection::error() const { return make_wrapper(pn_connection_remote_condition(pn_object())); } uint32_t connection::max_frame_size() const { return pn_transport_get_remote_max_frame(pn_connection_transport(pn_object())); } uint16_t connection::max_sessions() const { return pn_transport_remote_channel_max(pn_connection_transport(pn_object())); } uint32_t connection::idle_timeout() const { return pn_transport_get_remote_idle_timeout(pn_connection_transport(pn_object())); } void connection::wake() const { pn_connection_wake(pn_object()); } } qpid-proton-0.22.0/proton-c/bindings/cpp/src/codec_test.cpp0000664000000000000000000001065213257152177020504 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "test_bits.hpp" #include "proton/internal/data.hpp" #include "proton/internal/config.hpp" #include "proton/types.hpp" namespace { using namespace proton; template void simple_type_test(const T& x) { ASSERT(codec::is_encodable::value); value v; codec::encoder e(v); e << x; T y; codec::decoder d(v); d >> y; ASSERT_EQUAL(x, y); } template T make_fill(const char c) { T x; std::fill(x.begin(), x.end(), c); return x; } template void uncodable_type_test() { ASSERT(!codec::is_encodable::value); } } int main(int, char**) { int failed = 0; // Basic AMQP types RUN_TEST(failed, simple_type_test(false)); RUN_TEST(failed, simple_type_test(uint8_t(42))); RUN_TEST(failed, simple_type_test(int8_t(-42))); RUN_TEST(failed, simple_type_test(uint16_t(4242))); RUN_TEST(failed, simple_type_test(int16_t(-4242))); RUN_TEST(failed, simple_type_test(uint32_t(4242))); RUN_TEST(failed, simple_type_test(int32_t(-4242))); RUN_TEST(failed, simple_type_test(uint64_t(4242))); RUN_TEST(failed, simple_type_test(int64_t(-4242))); RUN_TEST(failed, simple_type_test(wchar_t('X'))); RUN_TEST(failed, simple_type_test(float(1.234))); RUN_TEST(failed, simple_type_test(double(11.2233))); RUN_TEST(failed, simple_type_test(timestamp(1234))); RUN_TEST(failed, simple_type_test(make_fill(0))); RUN_TEST(failed, simple_type_test(make_fill(0))); RUN_TEST(failed, simple_type_test(make_fill(0))); RUN_TEST(failed, simple_type_test(uuid::copy("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"))); RUN_TEST(failed, simple_type_test(std::string("xxx"))); RUN_TEST(failed, simple_type_test(symbol("aaa"))); RUN_TEST(failed, simple_type_test(binary("aaa"))); // Native int type that may map differently per platform to uint types. RUN_TEST(failed, simple_type_test(char(42))); RUN_TEST(failed, simple_type_test(short(42))); RUN_TEST(failed, simple_type_test(int(42))); RUN_TEST(failed, simple_type_test(long(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); #if PN_CPP_HAS_LONG_LONG_TYPE RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); RUN_TEST(failed, simple_type_test(static_cast(42))); #endif // value and scalar types, more tests in value_test and scalar_test. RUN_TEST(failed, simple_type_test(value("foo"))); RUN_TEST(failed, value v(23); simple_type_test(v)); RUN_TEST(failed, simple_type_test(scalar(23))); RUN_TEST(failed, simple_type_test(annotation_key(42))); RUN_TEST(failed, simple_type_test(message_id(42))); // Make sure we reject uncodable types RUN_TEST(failed, (uncodable_type_test >())); RUN_TEST(failed, (uncodable_type_test >())); RUN_TEST(failed, (uncodable_type_test >())); RUN_TEST(failed, (uncodable_type_test())); RUN_TEST(failed, (uncodable_type_test())); return failed; } qpid-proton-0.22.0/proton-c/bindings/cpp/src/byte_array.cpp0000664000000000000000000000225513257152177020531 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "types_internal.hpp" #include "proton/byte_array.hpp" #include #include namespace proton { namespace internal { void print_hex(std::ostream& o, const uint8_t* p, size_t n) { ios_guard restore_flags(o); o << "0x" << std::hex << std::setfill('0'); for (size_t i = 0; i < n; ++i) { o << std::setw(2) << printable_byte(p[i]); } } }} qpid-proton-0.22.0/proton-c/bindings/cpp/src/binary.cpp0000664000000000000000000000254113257152177017652 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "types_internal.hpp" #include "proton/binary.hpp" #include #include #include namespace proton { std::ostream& operator<<(std::ostream& o, const binary& x) { ios_guard restore_flags(o); o << std::hex << std::setfill('0') << "b\""; for (binary::const_iterator i = x.begin(); i != x.end(); ++i) { if (!isprint(*i) && !isspace(*i)) { // Non-printables in hex. o << "\\x" << std::setw(2) << printable_byte(*i); } else { o << char(*i); } } return o << '"'; } } qpid-proton-0.22.0/proton-c/bindings/cpp/libqpid-proton-cpp.pc.in0000664000000000000000000000205013257152177021542 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ includedir=@INCLUDEDIR@ Name: Proton C++ Description: Qpid Proton C++ library Version: @PN_VERSION@ URL: http://qpid.apache.org/proton/ Libs: -L${libdir} -lqpid-proton-cpp Cflags: -I${includedir} qpid-proton-0.22.0/proton-c/bindings/cpp/include/0000775000000000000000000000000013257152177016514 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/0000775000000000000000000000000013257152177020035 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/work_queue.hpp0000664000000000000000000002513313257152177022740 0ustar #ifndef PROTON_WORK_QUEUE_HPP #define PROTON_WORK_QUEUE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./duration.hpp" #include "./fwd.hpp" #include "./function.hpp" #include "./internal/config.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include #include #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES #include #endif struct pn_connection_t; struct pn_session_t; struct pn_link_t; /// @file /// @copybrief proton::work_queue namespace proton { /// @cond INTERNAL namespace internal { namespace v03 { struct invocable { invocable() {} virtual ~invocable() {} virtual invocable& clone() const = 0; virtual void operator() () = 0; }; template struct invocable_cloner : invocable { virtual ~invocable_cloner() {} virtual invocable& clone() const { return *new T(static_cast(*this)); } }; struct invocable_wrapper { invocable_wrapper(): wrapped_(0) {} invocable_wrapper(const invocable_wrapper& w): wrapped_(&w.wrapped_->clone()) {} invocable_wrapper& operator=(const invocable_wrapper& that) { invocable_wrapper newthis(that); std::swap(wrapped_, newthis.wrapped_); return *this; } #if PN_CPP_HAS_RVALUE_REFERENCES invocable_wrapper(invocable_wrapper&& w): wrapped_(w.wrapped_) {} invocable_wrapper& operator=(invocable_wrapper&& that) {delete wrapped_; wrapped_ = that.wrapped_; return *this; } #endif ~invocable_wrapper() { delete wrapped_; } invocable_wrapper(const invocable& i): wrapped_(&i.clone()) {} void operator()() { (*wrapped_)(); } invocable* wrapped_; }; /// **Unsettled API** - A work item for a @ref work_queue "work queue". /// /// It can be created from a function that takes no parameters and /// returns no value. class work { public: /// Create a work item. work() {} work(const invocable& i): item_(i) {} /// Invoke the work item. void operator()() { item_(); } ~work() {} private: invocable_wrapper item_; }; // Utilities to make work from functions/member functions (C++03 version) // Lots of repetition to handle functions/member functions with up to 3 arguments template struct work0 : public invocable_cloner > { R (* fn_)(); work0(R (* f)()) : fn_(f) {} void operator()() { (*fn_)(); } }; template struct work1 : public invocable_cloner > { R (* fn_)(A); A a_; work1(R (* t)(A), A a) : fn_(t), a_(a) {} void operator()() { (*fn_)(a_); } }; template struct work2 : public invocable_cloner > { R (* fn_)(A, B); A a_; B b_; work2(R (* t)(A, B), A a, B b) : fn_(t), a_(a), b_(b) {} void operator()() { (*fn_)(a_, b_); } }; template struct work3 : public invocable_cloner > { R (* fn_)(A, B, C); A a_; B b_; C c_; work3(R (* t)(A, B, C), A a, B b, C c) : fn_(t), a_(a), b_(b), c_(c) {} void operator()() { (*fn_)(a_, b_, c_); } }; template struct work_pmf0 : public invocable_cloner > { T& holder_; R (T::* fn_)(); work_pmf0(R (T::* a)(), T& h) : holder_(h), fn_(a) {} void operator()() { (holder_.*fn_)(); } }; template struct work_pmf1 : public invocable_cloner > { T& holder_; R (T::* fn_)(A); A a_; work_pmf1(R (T::* t)(A), T& h, A a) : holder_(h), fn_(t), a_(a) {} void operator()() { (holder_.*fn_)(a_); } }; template struct work_pmf2 : public invocable_cloner > { T& holder_; R (T::* fn_)(A, B); A a_; B b_; work_pmf2(R (T::* t)(A, B), T& h, A a, B b) : holder_(h), fn_(t), a_(a), b_(b) {} void operator()() { (holder_.*fn_)(a_, b_); } }; template struct work_pmf3 : public invocable_cloner > { T& holder_; R (T::* fn_)(A, B, C); A a_; B b_; C c_; work_pmf3(R (T::* t)(A, B, C), T& h, A a, B b, C c) : holder_(h), fn_(t), a_(a), b_(b), c_(c) {} void operator()() { (holder_.*fn_)(a_, b_, c_); } }; /// `make_work` is the equivalent of C++11 `std::bind` for C++03. It /// will bind both free functions and pointers to member functions. template work make_work(R (T::*f)(), T* t) { return work_pmf0(f, *t); } template work make_work(R (T::*f)(A), T* t, A a) { return work_pmf1(f, *t, a); } template work make_work(R (T::*f)(A, B), T* t, A a, B b) { return work_pmf2(f, *t, a, b); } template work make_work(R (T::*f)(A, B, C), T* t, A a, B b, C c) { return work_pmf3(f, *t, a, b, c); } template work make_work(R (*f)()) { return work0(f); } template work make_work(R (*f)(A), A a) { return work1(f, a); } template work make_work(R (*f)(A, B), A a, B b) { return work2(f, a, b); } template work make_work(R (*f)(A, B, C), A a, B b, C c) { return work3(f, a, b, c); } } } // internal::v03 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES namespace internal { namespace v11 { class work { public: /// **Unsettled API** work() {} /// **Unsettled API** /// /// Construct a unit of work from anything /// function-like that takes no arguments and returns /// no result. template ::type,work>::value>::type > work(T&& f): item_(std::forward(f)) {} /// **Unsettled API** /// /// Execute the piece of work void operator()() { item_(); } ~work() {} private: std::function item_; }; /// **Unsettled API** - Make a unit of work. /// /// Make a unit of work from either a function or a member function /// and an object pointer. /// /// **C++ versions** - This C++11 version is just a wrapper for /// `std::bind`. template work make_work(Rest&&... r) { return std::bind(std::forward(r)...); } } } // internal::v11 using internal::v11::work; using internal::v11::make_work; #else using internal::v03::work; using internal::v03::make_work; #endif /// @endcond /// **Unsettled API** - A context for thread-safe execution of work. /// /// Event-handler functions associated with a single /// `proton::connection` are called in sequence. The connection's /// `proton::work_queue` allows you to "inject" extra work from /// any thread and have it executed in the same sequence. /// /// You may also create arbitrary `proton::work_queue` objects backed /// by a @ref container that allow other objects to have their own /// serialised work queues that can have work injected safely from /// other threads. The @ref container ensures that the work is /// correctly serialised. /// /// The `proton::work` class represents the work to be queued and can /// be created from a function that takes no parameters and returns no /// value. class PN_CPP_CLASS_EXTERN work_queue { /// @cond INTERNAL class impl; work_queue& operator=(impl* i); /// @endcond public: /// **Unsettled API** - Create a work queue. PN_CPP_EXTERN work_queue(); /// **Unsettled API** - Create a work queue backed by a container. PN_CPP_EXTERN work_queue(container&); PN_CPP_EXTERN ~work_queue(); /// **Unsettled API** - Add work `fn` to the work queue. /// /// Work `fn` will be called serially with other work in the queue. /// The work may be deferred and executed in another thread. /// /// @return true if `fn` has been or will be called; false if the /// event loops is ended or `fn` cannot be injected for any other /// reason. PN_CPP_EXTERN bool add(work fn); /// **Deprecated** - Use `add(work)`. PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'work_queue::add(work)'") bool add(void_function0& fn); /// @cond INTERNAL // This is a hack to ensure that the C++03 version is declared // only during the compilation of the library #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS) PN_CPP_EXTERN bool add(internal::v03::work fn); #endif /// @endcond /// **Unsettled API** - Add work `fn` to the work queue after a /// duration. /// /// Scheduled execution is "best effort". It may not be possible /// to inject the work after the elapsed duration. There will be /// no indication of this. /// /// @copydetails add() PN_CPP_EXTERN void schedule(duration, work fn); /// **Deprecated** - Use `schedule(duration, work)`. PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'work_queue::schedule(duration, work)'") void schedule(duration, void_function0& fn); /// @cond INTERNAL // This is a hack to ensure that the C++03 version is declared // only during the compilation of the library #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS) PN_CPP_EXTERN void schedule(duration, internal::v03::work fn); #endif /// @endcond private: PN_CPP_EXTERN static work_queue& get(pn_connection_t*); PN_CPP_EXTERN static work_queue& get(pn_session_t*); PN_CPP_EXTERN static work_queue& get(pn_link_t*); internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class container; friend class io::connection_driver; /// @endcond }; } // proton #endif // PROTON_WORK_QUEUE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/value.hpp0000664000000000000000000001234213257152177021664 0ustar #ifndef PROTON_VALUE_HPP #define PROTON_VALUE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./codec/encoder.hpp" #include "./codec/decoder.hpp" #include "./internal/type_traits.hpp" #include "./scalar.hpp" #include "./types_fwd.hpp" #include #include /// @file /// @copybrief proton::value namespace proton { namespace internal { // Separate value data from implicit conversion constructors to avoid template recursion. class value_base { protected: internal::data& data(); internal::data data_; friend class codec::encoder; friend class codec::decoder; }; } // internal /// A holder for any AMQP value, simple or complex. /// /// @see @ref types_page class value : public internal::value_base, private internal::comparable { private: // Enabler for encodable types excluding proton::value. template struct assignable : public internal::enable_if::value, U> {}; template struct assignable {}; public: /// Create a null value PN_CPP_EXTERN value(); /// @name Copy a value /// @{ PN_CPP_EXTERN value(const value&); PN_CPP_EXTERN value& operator=(const value&); #if PN_CPP_HAS_RVALUE_REFERENCES PN_CPP_EXTERN value(value&&); PN_CPP_EXTERN value& operator=(value&&); #endif /// @} /// Copy from any allowed type T. template value(const T& x, typename assignable::type* = 0) { *this = x; } /// Assign from any allowed type T. template typename assignable::type operator=(const T& x) { codec::encoder e(*this); e << x; return *this; } /// Get the type ID for the current value. PN_CPP_EXTERN type_id type() const; /// True if the value is null PN_CPP_EXTERN bool empty() const; /// Reset the value to null/empty PN_CPP_EXTERN void clear(); /// @cond INTERNAL template PN_CPP_DEPRECATED("Use 'proton::get'") void get(T &t) const; template PN_CPP_DEPRECATED("Use 'proton::get'") T get() const; /// @endcond /// swap values friend PN_CPP_EXTERN void swap(value&, value&); /// @name Comparison operators /// @{ friend PN_CPP_EXTERN bool operator==(const value& x, const value& y); friend PN_CPP_EXTERN bool operator<(const value& x, const value& y); ///@} /// If contained value is a scalar type T, print using operator<<(T) /// /// Complex types are printed in a non-standard human-readable format but /// that may change in future so should not be parsed. friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const value&); ///@cond INTERNAL /// Used to refer to existing pn_data_t* values as proton::value value(pn_data_t* d); // Refer to existing pn_data_t void reset(pn_data_t* d = 0); // Refer to a new pn_data_t ///@endcond }; /// @copydoc scalar::get /// @relatedalso proton::value template T get(const value& v) { T x; get(v, x); return x; } /// Like get(const value&) but assigns the value to a reference /// instead of returning it. May be more efficient for complex values /// (arrays, maps, etc.) /// /// @relatedalso proton::value template void get(const value& v, T& x) { codec::decoder d(v, true); d >> x; } /// @relatedalso proton::value template inline void get(const U& u, T& x) { const value v(u); get(v, x); } /// @copydoc scalar::coerce /// @relatedalso proton::value template T coerce(const value& v) { T x; coerce(v, x); return x; } /// Like coerce(const value&) but assigns the value to a reference /// instead of returning it. May be more efficient for complex values /// (arrays, maps, etc.) /// /// @relatedalso proton::value template void coerce(const value& v, T& x) { codec::decoder d(v, false); scalar s; if (type_id_is_scalar(v.type())) { d >> s; x = internal::coerce(s); } else { d >> x; } } /// Special case for get(), just checks that value contains NULL. template<> inline void get(const value& v, null&) { assert_type_equal(NULL_TYPE, v.type()); } /// Return a readable string representation of x for display purposes. PN_CPP_EXTERN std::string to_string(const value& x); /// @cond INTERNAL template void value::get(T &x) const { x = proton::get(*this); } template T value::get() const { return proton::get(*this); } /// @endcond } // proton #endif // PROTON_VALUE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/uuid.hpp0000664000000000000000000000401513257152177021514 0ustar #ifndef PROTON_UUID_HPP #define PROTON_UUID_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./byte_array.hpp" #include #include /// @file /// @copybrief proton::uuid namespace proton { /// A 16-byte universally unique identifier. class uuid : public byte_array<16> { public: /// Make a copy. PN_CPP_EXTERN static uuid copy(); /// Return a uuid copied from bytes. Bytes must point to at least /// 16 bytes. If `bytes == 0` the UUID is zero-initialized. PN_CPP_EXTERN static uuid copy(const char* bytes); /// Return a simple randomly-generated UUID. This is used by the /// Proton library to generate default UUIDs. /// /// For specific security, performance, or uniqueness /// requirements, you may want to use a better UUID generator or /// some other form of identifier entirely. PN_CPP_EXTERN static uuid random(); /// UUID standard string format: 8-4-4-4-12 (36 chars, 32 /// alphanumeric chars and 4 hyphens). PN_CPP_EXTERN std::string str() const; }; /// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric chars /// and 4 hyphens). PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const uuid&); } // proton #endif // PROTON_UUID_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/url.hpp0000664000000000000000000001121613257152177021351 0ustar #ifndef PROTON_URL_HPP #define PROTON_URL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/pn_unique_ptr.hpp" #include "./error.hpp" #include #include #include /// @file /// **Deprecated** - Use a third-party URL library. namespace proton { /// **Deprecated** - Use a third-party URL library. /// /// An error encountered during URL parsing. struct PN_CPP_DEPRECATED("Use a third-party URL library") PN_CPP_CLASS_EXTERN url_error : public error { /// @cond INTERNAL /// Construct a URL error with a message. PN_CPP_EXTERN explicit url_error(const std::string&); /// @endcond }; /// **Deprecated** - Use a third-party URL library. /// /// A URL parser. /// /// Proton URLs take the form /// `://:@:/`. /// /// - Scheme can be `amqp` or `amqps`. Host is a DNS name or IP /// address (v4 or v6). /// /// - Port can be a number or a symbolic service name such as `amqp`. /// /// - Path is normally used as a link source or target address. On a /// broker it typically corresponds to a queue or topic name. class PN_CPP_DEPRECATED("Use a third-party URL library") url { public: static const std::string AMQP; ///< "amqp" prefix static const std::string AMQPS; ///< "amqps" prefix // XXX No constructor for an empty URL? // XXX What is the default 'defaults' behavior? /// Parse `url_str` as an AMQP URL. /// /// @note Converts automatically from string. /// @throw url_error if URL is invalid. PN_CPP_EXTERN url(const std::string& url_str); /// @cond INTERNAL /// XXX I want to understand why this is important to keep. /// /// **Unsettled API** - Parse `url_str` as an AMQP URL. If /// `defaults` is true, fill in defaults for missing values. /// Otherwise, return an empty string for missing values. /// /// @note Converts automatically from string. /// @throw url_error if URL is invalid. PN_CPP_EXTERN url(const std::string& url_str, bool defaults); /// @endcond /// Copy a URL. PN_CPP_EXTERN url(const url&); PN_CPP_EXTERN ~url(); /// Copy a URL. PN_CPP_EXTERN url& operator=(const url&); /// True if the URL is empty. PN_CPP_EXTERN bool empty() const; /// Returns the URL as a string PN_CPP_EXTERN operator std::string() const; /// @name URL fields /// /// @{ /// `amqp` or `amqps`. PN_CPP_EXTERN std::string scheme() const; /// The user name for authentication. PN_CPP_EXTERN std::string user() const; // XXX Passwords in URLs are dumb. /// The password. PN_CPP_EXTERN std::string password() const; /// The host name or IP address. PN_CPP_EXTERN std::string host() const; /// `port` can be a number or a symbolic name such as "amqp". PN_CPP_EXTERN std::string port() const; /// `port_int` is the numeric value of the port. PN_CPP_EXTERN uint16_t port_int() const; /// host_port returns just the `host:port` part of the URL PN_CPP_EXTERN std::string host_port() const; // XXX is this not confusing (or incorrect)? The path starts with // the first / after //. /// `path` is everything after the final "/". PN_CPP_EXTERN std::string path() const; /// @} /// Return URL as a string. friend PN_CPP_EXTERN std::string to_string(const url&); private: struct impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&); // XXX Why is it important to have this? /// Parse `url` from istream. This automatically fills in /// defaults for missing values. /// /// @note An invalid url is indicated by setting /// std::stream::fail(), NOT by throwing url_error. friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&); /// @endcond }; } // proton #endif // PROTON_URL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/types_fwd.hpp0000664000000000000000000000250413257152177022553 0ustar #ifndef PROTON_TYPES_FWD_HPP #define PROTON_TYPES_FWD_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// Forward declarations for Proton types used to represent AMQP types. #include "./internal/config.hpp" #if PN_CPP_HAS_NULLPTR #include #endif namespace proton { class binary; class decimal128; class decimal32; class decimal64; class scalar; class symbol; class timestamp; class duration; class uuid; class value; struct null { null() {} #if PN_CPP_HAS_NULLPTR null(std::nullptr_t) {} #endif }; } // proton #endif // PROTON_TYPES_FWD_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/types.hpp0000664000000000000000000000301413257152177021710 0ustar #ifndef PROTON_TYPES_HPP #define PROTON_TYPES_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// Proton types used to represent AMQP types. // TODO aconway 2016-03-15: described types, described arrays. #include "./internal/config.hpp" #include "./annotation_key.hpp" #include "./binary.hpp" #include "./decimal.hpp" #include "./duration.hpp" #include "./message_id.hpp" #include "./scalar.hpp" #include "./symbol.hpp" #include "./timestamp.hpp" #include "./types_fwd.hpp" #include "./uuid.hpp" #include "./value.hpp" #include "./codec/deque.hpp" #include "./codec/list.hpp" #include "./codec/map.hpp" #include "./codec/vector.hpp" #if PN_CPP_HAS_CPP11 #include "./codec/forward_list.hpp" #include "./codec/unordered_map.hpp" #endif #endif // PROTON_TYPES_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/type_id.hpp0000664000000000000000000001043713257152177022210 0ustar #ifndef PROTON_TYPE_ID_HPP #define PROTON_TYPE_ID_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// Type IDs for AMQP data types. #include "./internal/export.hpp" #include #include namespace proton { /// An identifier for AMQP types. enum type_id { NULL_TYPE = PN_NULL, ///< The null type, contains no data. BOOLEAN = PN_BOOL, ///< Boolean true or false. UBYTE = PN_UBYTE, ///< Unsigned 8-bit integer. BYTE = PN_BYTE, ///< Signed 8-bit integer. USHORT = PN_USHORT, ///< Unsigned 16-bit integer. SHORT = PN_SHORT, ///< Signed 16-bit integer. UINT = PN_UINT, ///< Unsigned 32-bit integer. INT = PN_INT, ///< Signed 32-bit integer. CHAR = PN_CHAR, ///< 32-bit unicode character. ULONG = PN_ULONG, ///< Unsigned 64-bit integer. LONG = PN_LONG, ///< Signed 64-bit integer. TIMESTAMP = PN_TIMESTAMP, ///< Signed 64-bit milliseconds since the epoch. FLOAT = PN_FLOAT, ///< 32-bit binary floating point. DOUBLE = PN_DOUBLE, ///< 64-bit binary floating point. DECIMAL32 = PN_DECIMAL32, ///< 32-bit decimal floating point. DECIMAL64 = PN_DECIMAL64, ///< 64-bit decimal floating point. DECIMAL128 = PN_DECIMAL128, ///< 128-bit decimal floating point. UUID = PN_UUID, ///< 16-byte UUID. BINARY = PN_BINARY, ///< Variable-length sequence of bytes. STRING = PN_STRING, ///< Variable-length utf8-encoded string. SYMBOL = PN_SYMBOL, ///< Variable-length encoded string. DESCRIBED = PN_DESCRIBED, ///< A descriptor and a value. ARRAY = PN_ARRAY, ///< A sequence of values of the same type. LIST = PN_LIST, ///< A sequence of values of mixed types. MAP = PN_MAP ///< A sequence of key-value pairs. }; /// Get the name of the AMQP type. PN_CPP_EXTERN std::string type_name(type_id); /// Print the type name. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, type_id); /// Throw a conversion_error if want != got with a message including /// the names of the types. PN_CPP_EXTERN void assert_type_equal(type_id want, type_id got); /// @name Functions to test the properties of a type ID /// @{ inline bool type_id_is_signed_int(type_id t) { return t == BYTE || t == SHORT || t == INT || t == LONG; } inline bool type_id_is_unsigned_int(type_id t) { return t == UBYTE || t == USHORT || t == UINT || t == ULONG; } inline bool type_id_is_integral(type_id t) { return t == BOOLEAN || t == CHAR || t == TIMESTAMP || type_id_is_unsigned_int(t) || type_id_is_signed_int(t); } inline bool type_id_is_floating_point(type_id t) { return t == FLOAT || t == DOUBLE; } inline bool type_id_is_decimal(type_id t) { return t == DECIMAL32 || t == DECIMAL64 || t == DECIMAL128; } inline bool type_id_is_signed(type_id t) { return type_id_is_signed_int(t) || type_id_is_floating_point(t) || type_id_is_decimal(t); } inline bool type_id_is_string_like(type_id t) { return t == BINARY || t == STRING || t == SYMBOL; } inline bool type_id_is_container(type_id t) { return t == LIST || t == MAP || t == ARRAY || t == DESCRIBED; } inline bool type_id_is_scalar(type_id t) { return type_id_is_integral(t) || type_id_is_floating_point(t) || type_id_is_decimal(t) || type_id_is_string_like(t) || t == TIMESTAMP || t == UUID; } inline bool type_id_is_null(type_id t) { return t == NULL_TYPE; } /// } } // proton #endif // PROTON_TYPE_ID_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/transport.hpp0000664000000000000000000000351213257152177022603 0ustar #ifndef PROTON_TRANSPORT_HPP #define PROTON_TRANSPORT_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/object.hpp" /// @file /// @copybrief proton::transport struct pn_transport_t; namespace proton { /// A network channel supporting an AMQP connection. class transport : public internal::object { /// @cond INTERNAL transport(pn_transport_t* t) : internal::object(t) {} /// @endcond public: /// Create an empty transport. transport() : internal::object(0) {} /// Get the connection associated with this transport. PN_CPP_EXTERN class connection connection() const; /// Get SSL information. PN_CPP_EXTERN class ssl ssl() const; /// Get SASL information. PN_CPP_EXTERN class sasl sasl() const; /// Get the error condition. PN_CPP_EXTERN class error_condition error() const; /// @cond INTERNAL friend class internal::factory; /// @endcond }; } // proton #endif // PROTON_TRANSPORT_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/transfer.hpp0000664000000000000000000000511413257152177022373 0ustar #ifndef PROTON_TRANSFER_HPP #define PROTON_TRANSFER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/object.hpp" #include /// @file /// @copybrief proton::transfer struct pn_delivery_t; namespace proton { /// The base class for delivery and tracker. class transfer : public internal::object { /// @cond INTERNAL transfer(pn_delivery_t* d) : internal::object(d) {} /// @endcond public: /// Create an empty transfer. transfer() : internal::object(0) {} /// Delivery state values. enum state { NONE = 0, ///< Unknown state RECEIVED = PN_RECEIVED, ///< Received but not yet settled ACCEPTED = PN_ACCEPTED, ///< Settled as accepted REJECTED = PN_REJECTED, ///< Settled as rejected RELEASED = PN_RELEASED, ///< Settled as released MODIFIED = PN_MODIFIED ///< Settled as modified }; // AMQP spec 3.4 delivery State /// Get the remote state for a delivery. PN_CPP_EXTERN enum state state() const; /// Return the session for this transfer. PN_CPP_EXTERN class session session() const; /// Return the connection for this transfer. PN_CPP_EXTERN class connection connection() const; /// Get the work_queue for the transfer. PN_CPP_EXTERN class work_queue& work_queue() const; /// Return the container for this transfer. PN_CPP_EXTERN class container &container() const; /// Settle the delivery; informs the remote end. PN_CPP_EXTERN void settle(); /// Return true if the transfer has been settled. PN_CPP_EXTERN bool settled() const; /// @cond INTERNAL friend class internal::factory; /// @endcond }; } // proton #endif // PROTON_TRANSFER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/tracker.hpp0000664000000000000000000000310313257152177022176 0ustar #ifndef PROTON_TRACKER_HPP #define PROTON_TRACKER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./transfer.hpp" /// @file /// @copybrief proton::tracker struct pn_delivery_t; namespace proton { /// A tracker for a sent message. Every tracker exists within the /// context of a sender. /// /// A delivery attempt can fail. As a result, a particular message may /// correspond to multiple trackers. class tracker : public transfer { /// @cond INTERNAL tracker(pn_delivery_t* d); /// @endcond public: /// Create an empty tracker. tracker() {} /// Get the sender for this tracker. PN_CPP_EXTERN class sender sender() const; /// @cond INTERNAL friend class internal::factory; /// @endcond }; } // proton #endif // PROTON_TRACKER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/timestamp.hpp0000664000000000000000000000472713257152177022563 0ustar #ifndef PROTON_TIMESTAMP_HPP #define PROTON_TIMESTAMP_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "./duration.hpp" #include /// @file /// @copybrief proton::timestamp namespace proton { /// A 64-bit timestamp in milliseconds since the Unix epoch. /// /// The dawn of the Unix epoch was 00:00:00 (UTC), 1 January 1970. class timestamp : private internal::comparable { public: /// A numeric type holding a value in milliseconds. typedef int64_t numeric_type; /// The current wall-clock time. PN_CPP_EXTERN static timestamp now(); /// Construct from a value in milliseconds. explicit timestamp(numeric_type ms = 0) : ms_(ms) {} /// Assign a value in milliseconds. timestamp& operator=(numeric_type ms) { ms_ = ms; return *this; } /// Get the value in milliseconds. numeric_type milliseconds() const { return ms_; } private: numeric_type ms_; }; /// @name Comparison and arithmetic operators /// @{ inline bool operator==(timestamp x, timestamp y) { return x.milliseconds() == y.milliseconds(); } inline bool operator<(timestamp x, timestamp y) { return x.milliseconds() < y.milliseconds(); } inline timestamp operator+(timestamp ts, duration d) { return timestamp(ts.milliseconds() + d.milliseconds()); } inline timestamp operator-(timestamp ts, duration d) { return timestamp(ts.milliseconds() - d.milliseconds()); } inline duration operator-(timestamp t0, timestamp t1) { return duration(t0.milliseconds() - t1.milliseconds()); } inline timestamp operator+(duration d, timestamp ts) { return ts + d; } /// @} /// Print a timestamp. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, timestamp); } // proton #endif // PROTON_TIMESTAMP_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/thread_safe.hpp0000664000000000000000000000176313257152177023022 0ustar #ifndef PROTON_THREAD_SAFE_HPP #define PROTON_THREAD_SAFE_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// @file /// **Deprecated** - No longer used. // Removed. Place-holder for for #include compatibility. #endif // PROTON_THREAD_SAFE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/terminus.hpp0000664000000000000000000000645613257152177022427 0ustar #ifndef PROTON_TERMINUS_HPP #define PROTON_TERMINUS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./types_fwd.hpp" #include "./internal/export.hpp" #include #include #include /// @file /// @copybrief proton::terminus struct pn_link_t; struct pn_terminus_t; namespace proton { namespace internal { template class factory; } /// One end of a link, either a source or a target. /// /// The source terminus is where messages originate; the target /// terminus is where they go. /// /// @see proton::link class terminus { /// @cond INTERNAL terminus(pn_terminus_t* t); /// @endcond public: terminus() : object_(0), parent_(0) {} /// The persistence mode of the source or target. enum durability_mode { /// No persistence. NONDURABLE = PN_NONDURABLE, /// Only configuration is persisted. CONFIGURATION = PN_CONFIGURATION, /// Configuration and unsettled state are persisted. UNSETTLED_STATE = PN_DELIVERIES }; /// When expiration of the source or target begins. enum expiry_policy { /// When the link is closed. LINK_CLOSE = PN_EXPIRE_WITH_LINK, /// When the containing session is closed. SESSION_CLOSE = PN_EXPIRE_WITH_SESSION, /// When the containing connection is closed. CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION, /// The terminus never expires. NEVER = PN_EXPIRE_NEVER }; // XXX This should have address? /// Get the policy for when expiration begins. PN_CPP_EXTERN enum expiry_policy expiry_policy() const; /// The period after which the source is discarded on expiry. The /// duration is rounded to the nearest second. PN_CPP_EXTERN duration timeout() const; /// Get the durability flag. PN_CPP_EXTERN enum durability_mode durability_mode(); /// True if the remote node is created dynamically. PN_CPP_EXTERN bool dynamic() const; /// Obtain a reference to the AMQP dynamic node properties for the /// terminus. See also lifetime_policy. PN_CPP_EXTERN value node_properties() const; /// Extension capabilities that are supported/requested PN_CPP_EXTERN std::vector capabilities() const; protected: pn_terminus_t *pn_object() const { return object_; } private: pn_terminus_t* object_; pn_link_t* parent_; /// @cond INTERNAL friend class internal::factory; friend class source; friend class target; /// @endcond }; } // proton #endif // PROTON_TERMINUS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/target_options.hpp0000664000000000000000000000570013257152177023611 0ustar #ifndef PROTON_TARGET_OPTIONS_HPP #define PROTON_TARGET_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./duration.hpp" #include "./target.hpp" #include /// @file /// @copybrief proton::target_options namespace proton { /// Options for creating a target node for a sender or receiver. /// /// Options can be "chained". For more information see @ref /// proton::connection_options. /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class target_options { public: /// Create an empty set of options. PN_CPP_EXTERN target_options(); /// Copy options. PN_CPP_EXTERN target_options(const target_options&); PN_CPP_EXTERN ~target_options(); /// Copy options. PN_CPP_EXTERN target_options& operator=(const target_options&); /// Set the address for the target. It is unset by default. The /// address is ignored if dynamic() is true. PN_CPP_EXTERN target_options& address(const std::string& addr); /// Request that a node be dynamically created by the remote peer. /// The default is false. Any specified target address() is /// ignored. PN_CPP_EXTERN target_options& dynamic(bool); /// Control the persistence of the target node. The default is /// target::NONDURABLE, meaning non-persistent. PN_CPP_EXTERN target_options& durability_mode(enum target::durability_mode); /// The expiry period after which the target is discarded. The /// default is no timeout. PN_CPP_EXTERN target_options& timeout(duration); /// Control when the clock for expiration begins. The default is /// target::LINK_CLOSE. PN_CPP_EXTERN target_options& expiry_policy(enum target::expiry_policy); /// Extension capabilities that are supported/requested PN_CPP_EXTERN target_options& capabilities(const std::vector&); private: void apply(target&) const; class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class target; friend class sender_options; friend class receiver_options; /// @endcond }; } // proton #endif // PROTON_TARGET_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/target.hpp0000664000000000000000000000331213257152177022033 0ustar #ifndef PROTON_TARGET_HPP #define PROTON_TARGET_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./terminus.hpp" #include /// @file /// @copybrief proton::target struct pn_terminus_t; namespace proton { namespace internal { template class factory; } /// A destination for messages. /// /// @see proton::sender, proton::receiver, proton::target class target : public terminus { public: /// Create an empty target. target() : terminus() {} using terminus::durability_mode; using terminus::expiry_policy; /// The address of the target. PN_CPP_EXTERN std::string address() const; private: target(pn_terminus_t* t); target(const sender&); target(const receiver&); /// @cond INTERNAL friend class internal::factory; friend class sender; friend class receiver; /// @endcond }; } // proton #endif // PROTON_TARGET_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/symbol.hpp0000664000000000000000000000270213257152177022054 0ustar #ifndef PROTON_SYMBOL_HPP #define PROTON_SYMBOL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include /// @file /// @copybrief proton::symbol namespace proton { /// A string that represents the AMQP symbol type. /// /// A symbol can contain only 7-bit ASCII characters. class symbol : public std::string { public: /// Construct from a `std::string`. symbol(const std::string& s=std::string()) : std::string(s) {} /// Construct from a C string. symbol(const char* s) : std::string(s) {} /// Construct from any sequence of `char`. template symbol(Iter start, Iter finish) : std::string(start, finish) {} }; } // proton #endif // PROTON_SYMBOL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/ssl.hpp0000664000000000000000000001337313257152177021356 0ustar #ifndef PROTON_SSL_HPP #define PROTON_SSL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/config.hpp" #include #include /// @file /// @copybrief proton::ssl namespace proton { /// SSL information. class ssl { /// @cond INTERNAL ssl(pn_ssl_t* s) : object_(s) {} /// @endcond #if PN_CPP_HAS_DELETED_FUNCTIONS ssl() = delete; #else ssl(); #endif public: /// Determines the level of peer validation. enum verify_mode { /// Require peer to provide a valid identifying certificate VERIFY_PEER = PN_SSL_VERIFY_PEER, /// Do not require a certificate or cipher authorization ANONYMOUS_PEER = PN_SSL_ANONYMOUS_PEER, /// Require valid certificate and matching name VERIFY_PEER_NAME = PN_SSL_VERIFY_PEER_NAME }; /// Outcome specifier for an attempted session resume. enum resume_status { UNKNOWN = PN_SSL_RESUME_UNKNOWN, ///< Session resume state unknown or not supported NEW = PN_SSL_RESUME_NEW, ///< Session renegotiated, not resumed REUSED = PN_SSL_RESUME_REUSED ///< Session resumed from previous session }; /// @cond INTERNAL /// XXX C API uses cipher_name /// Get the cipher name. PN_CPP_EXTERN std::string cipher() const; /// XXX C API uses protocol_name /// Get the protocol name. PN_CPP_EXTERN std::string protocol() const; /// Get the security strength factor. PN_CPP_EXTERN int ssf() const; /// XXX discuss, what's the meaning of "remote" here? PN_CPP_EXTERN std::string remote_subject() const; /// XXX setters? versus connection options PN_CPP_EXTERN void resume_session_id(const std::string& session_id); PN_CPP_EXTERN enum resume_status resume_status() const; /// @endcond private: pn_ssl_t* const object_; /// @cond INTERNAL friend class transport; /// @endcond }; /// **Unsettled API** - An SSL certificate. class ssl_certificate { public: /// Create an SSL certificate. PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main); // XXX Document the following constructors /// @copydoc ssl_certificate PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra); /// @copydoc ssl_certificate PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra, const std::string &passwd); /// @endcond private: std::string certdb_main_; std::string certdb_extra_; std::string passwd_; bool pw_set_; /// @cond INTERNAL friend class ssl_client_options; friend class ssl_server_options; /// @endcond }; class ssl_domain_impl; namespace internal { // Base class for SSL configuration class ssl_domain { public: PN_CPP_EXTERN ssl_domain(const ssl_domain&); PN_CPP_EXTERN ssl_domain& operator=(const ssl_domain&); PN_CPP_EXTERN ~ssl_domain(); protected: ssl_domain(bool is_server); pn_ssl_domain_t *pn_domain(); private: ssl_domain_impl *impl_; bool server_type_; }; } /// **Unsettled API** - SSL configuration for inbound connections. class ssl_server_options : private internal::ssl_domain { public: /// Server SSL options based on the supplied X.509 certificate /// specifier. PN_CPP_EXTERN ssl_server_options(ssl_certificate &cert); /// Server SSL options requiring connecting clients to provide a /// client certificate. PN_CPP_EXTERN ssl_server_options(ssl_certificate &cert, const std::string &trust_db, const std::string &advertise_db = std::string(), enum ssl::verify_mode mode = ssl::VERIFY_PEER); /// Server SSL options restricted to available anonymous cipher /// suites on the platform. PN_CPP_EXTERN ssl_server_options(); private: // Bring pn_domain into scope and allow connection_options to use // it. using internal::ssl_domain::pn_domain; /// @cond INTERNAL friend class connection_options; /// @endcond }; /// **Unsettled API** - SSL configuration for outbound connections. class ssl_client_options : private internal::ssl_domain { public: /// Create SSL client options (no client certificate). PN_CPP_EXTERN ssl_client_options(const std::string &trust_db, enum ssl::verify_mode = ssl::VERIFY_PEER_NAME); /// Create SSL client options with a client certificate. PN_CPP_EXTERN ssl_client_options(ssl_certificate&, const std::string &trust_db, enum ssl::verify_mode = ssl::VERIFY_PEER_NAME); /// SSL connections restricted to available anonymous cipher /// suites on the platform. PN_CPP_EXTERN ssl_client_options(); private: // Bring pn_domain into scope and allow connection_options to use // it. using internal::ssl_domain::pn_domain; /// @cond INTERNAL friend class connection_options; /// @endcond }; } // proton #endif // PROTON_SSL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/source_options.hpp0000664000000000000000000000654213257152177023630 0ustar #ifndef PROTON_SOURCE_OPTIONS_HPP #define PROTON_SOURCE_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./duration.hpp" #include "./source.hpp" #include /// @file /// @copybrief proton::source_options namespace proton { /// Options for creating a source node for a sender or receiver. /// /// Options can be "chained". For more information see @ref /// proton::connection_options. /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class source_options { public: /// Create an empty set of options. PN_CPP_EXTERN source_options(); /// Copy options. PN_CPP_EXTERN source_options(const source_options&); PN_CPP_EXTERN ~source_options(); /// Copy options. PN_CPP_EXTERN source_options& operator=(const source_options&); /// Set the address for the source. It is unset by default. The /// address is ignored if dynamic() is true. PN_CPP_EXTERN source_options& address(const std::string&); /// Request that a node be dynamically created by the remote peer. /// The default is false. Any specified source address() is /// ignored. PN_CPP_EXTERN source_options& dynamic(bool); /// Control whether messages are browsed or consumed. The /// default is source::MOVE, meaning consumed. PN_CPP_EXTERN source_options& distribution_mode(enum source::distribution_mode); /// Control the persistence of the source node. The default is /// source::NONDURABLE, meaning non-persistent. PN_CPP_EXTERN source_options& durability_mode(enum source::durability_mode); /// The expiry period after which the source is discarded. The /// default is no timeout. PN_CPP_EXTERN source_options& timeout(duration); /// Control when the clock for expiration begins. The default is /// source::LINK_CLOSE. PN_CPP_EXTERN source_options& expiry_policy(enum source::expiry_policy); /// **Unsettled API** - Specify a filter mechanism on the source /// that restricts message flow to a subset of the available /// messages. PN_CPP_EXTERN source_options& filters(const source::filter_map&); /// Extension capabilities that are supported/requested PN_CPP_EXTERN source_options& capabilities(const std::vector&); private: void apply(source&) const; class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class source; friend class sender_options; friend class receiver_options; /// @endcond }; } // proton #endif // PROTON_SOURCE_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/source.hpp0000664000000000000000000000503513257152177022051 0ustar #ifndef PROTON_SOURCE_HPP #define PROTON_SOURCE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./map.hpp" #include "./symbol.hpp" #include "./terminus.hpp" #include "./value.hpp" #include /// @file /// @copybrief proton::source struct pn_terminus_t; namespace proton { /// A point of origin for messages. /// /// @see proton::sender, proton::receiver, proton::target class source : public terminus { public: /// **Unsettled API** - A map of AMQP symbol keys and filter /// specifiers. typedef map filter_map; /// Create an empty source. source() : terminus() {} /// The policy for distributing messages. enum distribution_mode { // XXX Why is unspecified needed? The protocol doesn't have // it. /// Unspecified UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED, /// Once transferred, the message remains available to other links COPY = PN_DIST_MODE_COPY, /// Once transferred, the message is unavailable to other links MOVE = PN_DIST_MODE_MOVE }; using terminus::durability_mode; using terminus::expiry_policy; /// The address of the source. PN_CPP_EXTERN std::string address() const; /// Get the distribution mode. PN_CPP_EXTERN enum distribution_mode distribution_mode() const; /// **Unsettled API** - Obtain the set of message filters. PN_CPP_EXTERN const filter_map& filters() const; private: source(pn_terminus_t* t); source(const sender&); source(const receiver&); filter_map filters_; /// @cond INTERNAL friend class proton::internal::factory; friend class sender; friend class receiver; /// @endcond }; } // proton #endif // PROTON_SOURCE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/session_options.hpp0000664000000000000000000000365213257152177024012 0ustar #ifndef PROTON_SESSION_OPTIONS_HPP #define PROTON_SESSION_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" /// @file /// @copybrief proton::session_options namespace proton { /// Options for creating a session. /// /// Options can be "chained" (see proton::connection_options). /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class session_options { public: /// Create an empty set of options. PN_CPP_EXTERN session_options(); /// Copy options. PN_CPP_EXTERN session_options(const session_options&); PN_CPP_EXTERN ~session_options(); /// Copy options. PN_CPP_EXTERN session_options& operator=(const session_options&); /// Set a messaging_handler for the session. PN_CPP_EXTERN session_options& handler(class messaging_handler &); // Other useful session configuration TBD. /// @cond INTERNAL private: void apply(session&) const; class impl; internal::pn_unique_ptr impl_; friend class session; /// @endcond }; } // proton #endif // PROTON_SESSION_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/session.hpp0000664000000000000000000000714413257152177022237 0ustar #ifndef PROTON_SESSION_HPP #define PROTON_SESSION_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./endpoint.hpp" #include "./receiver.hpp" #include "./sender.hpp" #include /// @file /// @copybrief proton::session struct pn_session_t; namespace proton { /// A container of senders and receivers. class PN_CPP_CLASS_EXTERN session : public internal::object, public endpoint { public: /// @cond INTERNAL PN_CPP_EXTERN session(pn_session_t* s) : internal::object(s) {} /// @endcond public: /// Create an empty session. session() : internal::object(0) {} PN_CPP_EXTERN bool uninitialized() const; PN_CPP_EXTERN bool active() const; PN_CPP_EXTERN bool closed() const; PN_CPP_EXTERN class error_condition error() const; /// Open the session. /// /// @see endpoint_lifecycle PN_CPP_EXTERN void open(); /// @copydoc open PN_CPP_EXTERN void open(const session_options &opts); PN_CPP_EXTERN void close(); PN_CPP_EXTERN void close(const error_condition&); /// Get the container for this session. PN_CPP_EXTERN class container &container() const; /// Get the work_queue for the session. PN_CPP_EXTERN class work_queue& work_queue() const; /// Get the connection this session belongs to. PN_CPP_EXTERN class connection connection() const; /// Open a sender for `addr`. PN_CPP_EXTERN sender open_sender(const std::string &addr); /// @copydoc open_sender PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &opts); /// Open a receiver for `addr`. PN_CPP_EXTERN receiver open_receiver(const std::string &addr); /// @copydoc open_receiver PN_CPP_EXTERN receiver open_receiver(const std::string &addr, const receiver_options &opts); /// The number of incoming bytes currently buffered. PN_CPP_EXTERN size_t incoming_bytes() const; /// The number of outgoing bytes currently buffered. PN_CPP_EXTERN size_t outgoing_bytes() const; /// Return the senders on this session. PN_CPP_EXTERN sender_range senders() const; /// Return the receivers on this session. PN_CPP_EXTERN receiver_range receivers() const; /// @cond INTERNAL friend class internal::factory; friend class session_iterator; /// @endcond }; /// @cond INTERNAL /// An iterator of sessions. class session_iterator : public internal::iter_base { public: explicit session_iterator(session s = 0) : internal::iter_base(s) {} /// Advance to the next session. PN_CPP_EXTERN session_iterator operator++(); }; /// A range of sessions. typedef internal::iter_range session_range; /// @endcond } // proton #endif // PROTON_SESSION_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/sender_options.hpp0000664000000000000000000000665113257152177023611 0ustar #ifndef PROTON_SENDER_OPTIONS_HPP #define PROTON_SENDER_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./delivery_mode.hpp" #include /// @file /// @copybrief proton::sender_options namespace proton { /// Options for creating a sender. /// /// Options can be "chained" like this: /// /// @code /// l = container.create_sender(url, sender_options().handler(h).auto_settle(false)); /// @endcode /// /// You can also create an options object with common settings and use /// it as a base for different connections that have mostly the same /// settings: /// /// @code /// sender_options opts; /// opts.delivery_mode(delivery_mode::AT_MOST_ONCE); /// l1 = container.open_sender(url1, opts.handler(h1)); /// c2 = container.open_receiver(url2, opts.handler(h2)); /// @endcode /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class sender_options { public: /// Create an empty set of options. PN_CPP_EXTERN sender_options(); /// Copy options. PN_CPP_EXTERN sender_options(const sender_options&); PN_CPP_EXTERN ~sender_options(); /// Copy options. PN_CPP_EXTERN sender_options& operator=(const sender_options&); /// Merge with another option set PN_CPP_EXTERN void update(const sender_options& other); /// Set a messaging_handler for sender events only. /// The handler is no longer in use when messaging_handler::on_sender_close() is called. /// messaging_handler::on_sender_close() may not be called if a connection is aborted, /// in that case it should be cleaned up in its connection's messaging_handler::on_transport_close() PN_CPP_EXTERN sender_options& handler(class messaging_handler&); /// Set the delivery mode on the sender. PN_CPP_EXTERN sender_options& delivery_mode(delivery_mode); /// Automatically settle messages (default is true). PN_CPP_EXTERN sender_options& auto_settle(bool); /// Options for the source node of the sender. PN_CPP_EXTERN sender_options& source(const source_options&); /// Options for the receiver node of the receiver. PN_CPP_EXTERN sender_options& target(const target_options&); /// Set the link name. If not set a unique name is generated. PN_CPP_EXTERN sender_options& name(const std::string& name); private: void apply(sender&) const; const std::string* get_name() const; // Pointer to name if set, else 0 class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class sender; friend class session; /// @endcond }; } // proton #endif // PROTON_SENDER_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/sender.hpp0000664000000000000000000000544113257152177022032 0ustar #ifndef PROTON_SENDER_HPP #define PROTON_SENDER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./link.hpp" #include "./tracker.hpp" /// @file /// @copybrief proton::sender struct pn_link_t; struct pn_session_t; namespace proton { /// A channel for sending messages. class PN_CPP_CLASS_EXTERN sender : public link { /// @cond INTERNAL PN_CPP_EXTERN sender(pn_link_t* s); /// @endcond public: /// Create an empty sender. sender() {} /// Open the sender. /// /// @see endpoint_lifecycle PN_CPP_EXTERN void open(); /// @copydoc open PN_CPP_EXTERN void open(const sender_options &opts); /// Send a message on the sender. PN_CPP_EXTERN tracker send(const message &m); /// Get the source node. PN_CPP_EXTERN class source source() const; /// Get the target node. PN_CPP_EXTERN class target target() const; /// **Unsettled API** - Return all unused credit to the receiver in /// response to a drain request. Has no effect unless there has /// been a drain request and there is remaining credit to use or /// return. /// /// @see receiver::drain PN_CPP_EXTERN void return_credit(); /// @cond INTERNAL friend class internal::factory; friend class sender_iterator; /// @endcond }; /// @cond INTERNAL /// An iterator of senders. class sender_iterator : public internal::iter_base { sender_iterator(sender snd, pn_session_t* s = 0) : internal::iter_base(snd), session_(s) {} public: /// Create an iterator of senders. sender_iterator() : internal::iter_base(0), session_(0) {} /// Advance to the next sender. PN_CPP_EXTERN sender_iterator operator++(); private: pn_session_t* session_; friend class connection; friend class session; }; /// A range of senders. typedef internal::iter_range sender_range; /// @endcond } #endif // PROTON_SENDER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/scalar_base.hpp0000664000000000000000000001703413257152177023012 0ustar #ifndef PROTON_SCALAR_BASE_HPP #define PROTON_SCALAR_BASE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./binary.hpp" #include "./decimal.hpp" #include "./error.hpp" #include "./internal/comparable.hpp" #include "./internal/export.hpp" #include "./internal/type_traits.hpp" #include "./symbol.hpp" #include "./timestamp.hpp" #include "./type_id.hpp" #include "./types_fwd.hpp" #include "./uuid.hpp" #include #include #include #include /// @file /// @copybrief proton::scalar_base namespace proton { class scalar_base; namespace codec { class decoder; class encoder; } namespace internal { template T get(const scalar_base& s); } /// The base class for scalar types. class scalar_base : private internal::comparable { public: /// AMQP type of data stored in the scalar PN_CPP_EXTERN type_id type() const; /// True if there is no value, i.e. type() == NULL_TYPE. PN_CPP_EXTERN bool empty() const; /// Compare friend PN_CPP_EXTERN bool operator<(const scalar_base& x, const scalar_base& y); /// Compare friend PN_CPP_EXTERN bool operator==(const scalar_base& x, const scalar_base& y); /// Print the contained value friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const scalar_base& x); protected: PN_CPP_EXTERN scalar_base(const pn_atom_t& a); PN_CPP_EXTERN scalar_base(); PN_CPP_EXTERN scalar_base(const scalar_base&); PN_CPP_EXTERN scalar_base& operator=(const scalar_base&); PN_CPP_EXTERN void put_(bool); PN_CPP_EXTERN void put_(uint8_t); PN_CPP_EXTERN void put_(int8_t); PN_CPP_EXTERN void put_(uint16_t); PN_CPP_EXTERN void put_(int16_t); PN_CPP_EXTERN void put_(uint32_t); PN_CPP_EXTERN void put_(int32_t); PN_CPP_EXTERN void put_(uint64_t); PN_CPP_EXTERN void put_(int64_t); PN_CPP_EXTERN void put_(wchar_t); PN_CPP_EXTERN void put_(float); PN_CPP_EXTERN void put_(double); PN_CPP_EXTERN void put_(timestamp); PN_CPP_EXTERN void put_(const decimal32&); PN_CPP_EXTERN void put_(const decimal64&); PN_CPP_EXTERN void put_(const decimal128&); PN_CPP_EXTERN void put_(const uuid&); PN_CPP_EXTERN void put_(const std::string&); PN_CPP_EXTERN void put_(const symbol&); PN_CPP_EXTERN void put_(const binary&); PN_CPP_EXTERN void put_(const char* s); ///< Treated as an AMQP string PN_CPP_EXTERN void put_(const null&); template void put(const T& x) { putter::put(*this, x); } private: PN_CPP_EXTERN void get_(bool&) const; PN_CPP_EXTERN void get_(uint8_t&) const; PN_CPP_EXTERN void get_(int8_t&) const; PN_CPP_EXTERN void get_(uint16_t&) const; PN_CPP_EXTERN void get_(int16_t&) const; PN_CPP_EXTERN void get_(uint32_t&) const; PN_CPP_EXTERN void get_(int32_t&) const; PN_CPP_EXTERN void get_(uint64_t&) const; PN_CPP_EXTERN void get_(int64_t&) const; PN_CPP_EXTERN void get_(wchar_t&) const; PN_CPP_EXTERN void get_(float&) const; PN_CPP_EXTERN void get_(double&) const; PN_CPP_EXTERN void get_(timestamp&) const; PN_CPP_EXTERN void get_(decimal32&) const; PN_CPP_EXTERN void get_(decimal64&) const; PN_CPP_EXTERN void get_(decimal128&) const; PN_CPP_EXTERN void get_(uuid&) const; PN_CPP_EXTERN void get_(std::string&) const; PN_CPP_EXTERN void get_(symbol&) const; PN_CPP_EXTERN void get_(binary&) const; PN_CPP_EXTERN void get_(null&) const; // use template structs, functions cannot be partially specialized. template struct putter { static void put(scalar_base& s, const T& x) { s.put_(x); } }; template struct putter::value>::type> { static void put(scalar_base& s, const T& x) { s.put_(static_cast::type>(x)); } }; template struct getter { static T get(const scalar_base& s) { T x; s.get_(x); return x; } }; template struct getter::value>::type> { static T get(const scalar_base& s) { typename internal::known_integer::type x; s.get_(x); return x; } }; void ok(pn_type_t) const; void set(const pn_atom_t&); void set(const binary& x, pn_type_t t); pn_atom_t atom_; binary bytes_; // Hold binary data. /// @cond INTERNAL friend class message; friend class codec::encoder; friend class codec::decoder; template friend T internal::get(const scalar_base& s); /// @endcond }; namespace internal { template T get(const scalar_base& s) { return scalar_base::getter::get(s); } template R visit(const scalar_base& s, F f) { switch(s.type()) { case BOOLEAN: return f(internal::get(s)); case UBYTE: return f(internal::get(s)); case BYTE: return f(internal::get(s)); case USHORT: return f(internal::get(s)); case SHORT: return f(internal::get(s)); case UINT: return f(internal::get(s)); case INT: return f(internal::get(s)); case CHAR: return f(internal::get(s)); case ULONG: return f(internal::get(s)); case LONG: return f(internal::get(s)); case TIMESTAMP: return f(internal::get(s)); case FLOAT: return f(internal::get(s)); case DOUBLE: return f(internal::get(s)); case DECIMAL32: return f(internal::get(s)); case DECIMAL64: return f(internal::get(s)); case DECIMAL128: return f(internal::get(s)); case UUID: return f(internal::get(s)); case BINARY: return f(internal::get(s)); case STRING: return f(internal::get(s)); case SYMBOL: return f(internal::get(s)); default: throw conversion_error("invalid scalar type "+type_name(s.type())); } } PN_CPP_EXTERN conversion_error make_coercion_error(const char* cpp_type, type_id amqp_type); template struct coerce_op { template typename enable_if::value, T>::type operator()(const U& x) { return static_cast(x); } template typename enable_if::value, T>::type operator()(const U&) { throw make_coercion_error(typeid(T).name(), type_id_of::value); } }; template T coerce(const scalar_base& s) { return visit(s, coerce_op()); } } // namespace internal /// Return a readable string representation of x for display purposes. PN_CPP_EXTERN std::string to_string(const scalar_base& x); } // proton #endif // PROTON_SCALAR_BASE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/scalar.hpp0000664000000000000000000000524513257152177022021 0ustar #ifndef PROTON_SCALAR_HPP #define PROTON_SCALAR_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "./scalar_base.hpp" #include /// @file /// @copybrief proton::scalar namespace proton { /// A holder for an instance of any scalar AMQP type. /// /// @see @ref types_page class scalar : public scalar_base { public: /// Create an empty scalar. PN_CPP_EXTERN scalar() {} /// Construct from any scalar type. template scalar(const T& x) { *this = x; } /// Assign from any scalar type. template scalar& operator=(const T& x) { put(x); return *this; } /// Clear the scalar, making it empty(). void clear() { *this = null(); } }; /// Get a contained value of type T. For example: /// /// uint64_t i = get(x) /// /// This will succeed if and only if x contains a uint64_t value. /// /// @throw conversion_error if contained value is not of type T. /// @relatedalso scalar template T get(const scalar& s) { return internal::get(s); } /// Coerce the contained value to type T. For example: /// /// uint64_t i = coerce(x) /// /// This will succeed if x contains any numeric value, but may lose /// precision if it contains a float or double value. /// /// @throw conversion_error if the value cannot be converted to T /// according to `std::is_convertible` /// @relatedalso scalar template T coerce(const scalar& x) { return internal::coerce(x); } /// Coerce the contained value to type T. For example: /// /// uint64_t i = coerce(x) /// /// This will succeed if x contains any numeric value, but may lose /// precision if it contains a float or double value. /// /// @throw conversion_error if the value cannot be converted to T /// according to `std::is_convertible` /// @relatedalso scalar template T coerce(scalar& x) { return internal::coerce(x); } } // proton #endif // PROTON_SCALAR_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/sasl.hpp0000664000000000000000000000407113257152177021512 0ustar #ifndef PROTON_SASL_HPP #define PROTON_SASL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/config.hpp" #include "./internal/object.hpp" #include #include /// @file /// @copybrief proton::sasl namespace proton { /// SASL information. class sasl { /// @cond INTERNAL sasl(pn_sasl_t* s) : object_(s) {} /// @endcond #if PN_CPP_HAS_DELETED_FUNCTIONS sasl() = delete; #else sasl(); #endif public: /// The result of the SASL negotiation. enum outcome { NONE = PN_SASL_NONE, ///< Negotiation not completed OK = PN_SASL_OK, ///< Authentication succeeded AUTH = PN_SASL_AUTH, ///< Failed due to bad credentials SYS = PN_SASL_SYS, ///< Failed due to a system error PERM = PN_SASL_PERM, ///< Failed due to unrecoverable error TEMP = PN_SASL_TEMP ///< Failed due to transient error }; /// Get the outcome. PN_CPP_EXTERN enum outcome outcome() const; /// Get the user name. PN_CPP_EXTERN std::string user() const; /// Get the mechanism. PN_CPP_EXTERN std::string mech() const; /// @cond INTERNAL private: pn_sasl_t* const object_; friend class transport; /// @endcond }; } // proton #endif // PROTON_SASL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/returned.hpp0000664000000000000000000000413713257152177022403 0ustar #ifndef PROTON_RETURNED_HPP #define PROTON_RETURNED_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/object.hpp" #include "./connection.hpp" #include "./receiver.hpp" #include "./sender.hpp" /// @file /// @copybrief proton::returned namespace proton { namespace internal { class returned_factory; } /// A return type for container methods. /// /// **Thread safety** - Container method return values are /// *thread-unsafe*. A single-threaded application can safely assign /// the `returned` value to a plain `T`. A multithreaded /// application *must* ignore the returned value because it may /// already be invalid by the time the function returns. /// Multithreaded applications can safely access the value inside @ref /// messaging_handler functions. template class PN_CPP_CLASS_EXTERN returned { public: /// Copy operator required to return a value PN_CPP_EXTERN returned(const returned&); /// Convert to the proton::object /// /// @note **Thread-unsafe** - Do not use in a multithreaded application. PN_CPP_EXTERN operator T() const; private: typename T::pn_type* ptr_; returned(typename T::pn_type*); returned& operator=(const returned&); // Not defined friend class internal::returned_factory; }; } // proton #endif /*!PROTON_RETURNED_HPP*/ qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/reconnect_options.hpp0000664000000000000000000000555213257152177024310 0ustar #ifndef PROTON_RECONNECT_OPTIONS_HPP #define PROTON_RECONNECT_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./duration.hpp" #include "./source.hpp" #include #include /// @file /// @copybrief proton::reconnect_options namespace proton { /// **Unsettled API** - Options for reconnect and failover after /// connection loss. /// /// These options determine a series of delays to coordinate /// reconnection attempts. They may be open-ended or limited in time. /// They may be evenly spaced or increasing at an exponential rate. /// /// Options can be "chained". See @ref proton::connection_options. /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class reconnect_options { public: /// Create an empty set of options. PN_CPP_EXTERN reconnect_options(); /// Copy options. PN_CPP_EXTERN reconnect_options(const reconnect_options&); PN_CPP_EXTERN ~reconnect_options(); /// Copy options. PN_CPP_EXTERN reconnect_options& operator=(const reconnect_options&); /// The base value for recurring delays. The default is 10 /// milliseconds. PN_CPP_EXTERN reconnect_options& delay(duration); /// The scaling multiplier for successive reconnect delays. The /// default is 2.0. PN_CPP_EXTERN reconnect_options& delay_multiplier(float); /// The maximum delay between successive connect attempts. The /// default duration::FOREVER, meaning no limit. PN_CPP_EXTERN reconnect_options& max_delay(duration); /// The maximum number of reconnect attempts. The default is 0, /// meaning no limit. PN_CPP_EXTERN reconnect_options& max_attempts(int); /// Alternative connection URLs used for failover. There are none /// by default. PN_CPP_EXTERN reconnect_options& failover_urls(const std::vector& conn_urls); private: class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class container; /// @endcond }; } // proton #endif // PROTON_RECONNECT_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/receiver_options.hpp0000664000000000000000000000727613257152177024141 0ustar #ifndef PROTON_RECEIVER_OPTIONS_HPP #define PROTON_RECEIVER_OPTIONS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./delivery_mode.hpp" #include /// @file /// @copybrief proton::receiver_options namespace proton { /// Options for creating a receiver. /// /// Options can be "chained" like this: /// /// @code /// l = container.create_receiver(url, receiver_options().handler(h).auto_accept(true)); /// @endcode /// /// You can also create an options object with common settings and use /// it as a base for different connections that have mostly the same /// settings: /// /// @code /// receiver_options opts; /// opts.auto_accept(true); /// c2 = container.open_receiver(url2, opts.handler(h2)); /// @endcode /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class receiver_options { public: /// Create an empty set of options. PN_CPP_EXTERN receiver_options(); /// Copy options. PN_CPP_EXTERN receiver_options(const receiver_options&); PN_CPP_EXTERN ~receiver_options(); /// Copy options. PN_CPP_EXTERN receiver_options& operator=(const receiver_options&); /// Merge with another option set. PN_CPP_EXTERN void update(const receiver_options& other); /// Set a messaging_handler for receiver events only. The handler /// is no longer in use when /// messaging_handler::on_receiver_close() is called. PN_CPP_EXTERN receiver_options& handler(class messaging_handler&); /// Set the delivery mode on the receiver. The default is /// delivery_mode::AT_LEAST_ONCE. PN_CPP_EXTERN receiver_options& delivery_mode(delivery_mode); /// Enable or disable automatic acceptance of messages that aren't /// otherwise released, rejected, or modified. It is enabled by /// default. PN_CPP_EXTERN receiver_options& auto_accept(bool); /// @deprecated not applicable to receiver, only to sender PN_CPP_EXTERN receiver_options& auto_settle(bool); /// Options for the source node of the receiver. PN_CPP_EXTERN receiver_options& source(source_options&); /// Options for the target node of the receiver. PN_CPP_EXTERN receiver_options& target(target_options&); /// Automatically replenish credit for flow control up to `count` /// messages. The default is 10. Set to zero to disable /// automatic replenishment. PN_CPP_EXTERN receiver_options& credit_window(int count); /// Set the link name. If not set a unique name is generated. PN_CPP_EXTERN receiver_options& name(const std::string& name); private: void apply(receiver &) const; const std::string* get_name() const; // Pointer to name if set, else 0 class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class receiver; friend class session; /// @endcond }; } // proton #endif // PROTON_RECEIVER_OPTIONS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/receiver.hpp0000664000000000000000000000634713257152177022364 0ustar #ifndef PROTON_RECEIVER_HPP #define PROTON_RECEIVER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./link.hpp" #include struct pn_link_t; struct pn_session_t; /// @file /// @copybrief proton::receiver namespace proton { /// A channel for receiving messages. class PN_CPP_CLASS_EXTERN receiver : public link { /// @cond INTERNAL PN_CPP_EXTERN receiver(pn_link_t* r); /// @endcond public: /// Create an empty receiver. receiver() {} /// Open the receiver. /// /// @see endpoint_lifecycle PN_CPP_EXTERN void open(); /// @copydoc open PN_CPP_EXTERN void open(const receiver_options &opts); /// Get the source node. PN_CPP_EXTERN class source source() const; /// Get the target node. PN_CPP_EXTERN class target target() const; /// Increment the credit available to the sender. Credit granted /// during a drain cycle is not communicated to the receiver until /// the drain completes. PN_CPP_EXTERN void add_credit(uint32_t); /// **Unsettled API** - Commence a drain cycle. If there is /// positive credit, a request is sent to the sender to /// immediately use up all of the existing credit balance by /// sending messages that are immediately available and releasing /// any unused credit (see sender::return_credit). Throws /// proton::error if a drain cycle is already in progress. An /// on_receiver_drain_finish event will be generated when the /// outstanding drained credit reaches zero. PN_CPP_EXTERN void drain(); /// @cond INTERNAL friend class internal::factory; friend class receiver_iterator; /// @endcond }; /// @cond INTERNAL /// An iterator of receivers. class receiver_iterator : public internal::iter_base { explicit receiver_iterator(receiver r, pn_session_t* s = 0) : internal::iter_base(r), session_(s) {} public: /// Create an iterator of receivers. explicit receiver_iterator() : internal::iter_base(0), session_(0) {} /// Advance to the next receiver. PN_CPP_EXTERN receiver_iterator operator++(); private: pn_session_t* session_; friend class connection; friend class session; }; /// A range of receivers. typedef internal::iter_range receiver_range; /// @endcond } // proton #endif // PROTON_RECEIVER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/namespaces.hpp0000664000000000000000000000223413257152177022666 0ustar #ifndef PROTON_NAMESPACES_HPP #define PROTON_NAMESPACES_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// @file /// Namespace declarations. /// The main Proton namespace. namespace proton { /// **Unsettled API** - AMQP data encoding and decoding. namespace codec { } /// **Unsettled API** - Interfaces for IO integration. namespace io { } namespace internal { } } // proton #endif // PROTON_NAMESPACES_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/messaging_handler.hpp0000664000000000000000000001504613257152177024226 0ustar #ifndef PROTON_MESSAGING_HANDLER_HPP #define PROTON_MESSAGING_HANDLER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" /// @file /// @copybrief proton::messaging_handler namespace proton { /// A handler for Proton messaging events. /// /// Subclass and override the event-handling member functions. /// /// #### Close and error handling /// /// There are several objects that have `on_X_close` and `on_X_error` /// functions. They are called as follows: /// /// - If `X` is closed cleanly, with no error status, then `on_X_close` /// is called. /// /// - If `X` is closed with an error, then `on_X_error` is called, /// followed by `on_X_close`. The error condition is also available /// in `on_X_close` from `X::error()`. /// /// By default, if you do not implement `on_X_error`, it will call /// `on_error`. If you do not implement `on_error` it will throw a /// `proton::error` exception, which may not be what you want but /// does help to identify forgotten error handling quickly. /// /// #### Resource cleanup /// /// Every `on_X_open` event is paired with an `on_X_close` event which /// can clean up any resources created by the open handler. In /// particular this is still true if an error is reported with an /// `on_X_error` event. The error-handling logic doesn't have to /// manage resource clean up. It can assume that the close event will /// be along to handle it. class PN_CPP_CLASS_EXTERN messaging_handler { public: PN_CPP_EXTERN messaging_handler(); PN_CPP_EXTERN virtual ~messaging_handler(); /// The container event loop is starting. /// /// This is the first event received after calling /// `container::run()`. PN_CPP_EXTERN virtual void on_container_start(container&); /// The container event loop is stopping. /// /// This is the last event received before the container event /// loop stops. PN_CPP_EXTERN virtual void on_container_stop(container&); /// A message is received. PN_CPP_EXTERN virtual void on_message(delivery&, message&); /// A message can be sent. PN_CPP_EXTERN virtual void on_sendable(sender&); /// The underlying network transport is open PN_CPP_EXTERN virtual void on_transport_open(transport&); /// The underlying network transport has closed. PN_CPP_EXTERN virtual void on_transport_close(transport&); /// The underlying network transport has closed with an error /// condition. PN_CPP_EXTERN virtual void on_transport_error(transport&); /// The remote peer opened the connection. PN_CPP_EXTERN virtual void on_connection_open(connection&); /// The remote peer closed the connection. PN_CPP_EXTERN virtual void on_connection_close(connection&); /// The remote peer closed the connection with an error condition. PN_CPP_EXTERN virtual void on_connection_error(connection&); /// The remote peer opened the session. PN_CPP_EXTERN virtual void on_session_open(session&); /// The remote peer closed the session. PN_CPP_EXTERN virtual void on_session_close(session&); /// The remote peer closed the session with an error condition. PN_CPP_EXTERN virtual void on_session_error(session&); /// The remote peer opened the link. PN_CPP_EXTERN virtual void on_receiver_open(receiver&); /// The remote peer detached the link. PN_CPP_EXTERN virtual void on_receiver_detach(receiver&); /// The remote peer closed the link. PN_CPP_EXTERN virtual void on_receiver_close(receiver&); /// The remote peer closed the link with an error condition. PN_CPP_EXTERN virtual void on_receiver_error(receiver&); /// The remote peer opened the link. PN_CPP_EXTERN virtual void on_sender_open(sender&); /// The remote peer detached the link. PN_CPP_EXTERN virtual void on_sender_detach(sender&); /// The remote peer closed the link. PN_CPP_EXTERN virtual void on_sender_close(sender&); /// The remote peer closed the link with an error condition. PN_CPP_EXTERN virtual void on_sender_error(sender&); /// The receiving peer accepted a transfer. PN_CPP_EXTERN virtual void on_tracker_accept(tracker&); /// The receiving peer rejected a transfer. PN_CPP_EXTERN virtual void on_tracker_reject(tracker&); /// The receiving peer released a transfer. PN_CPP_EXTERN virtual void on_tracker_release(tracker&); /// The receiving peer settled a transfer. PN_CPP_EXTERN virtual void on_tracker_settle(tracker&); /// The sending peer settled a transfer. PN_CPP_EXTERN virtual void on_delivery_settle(delivery&); /// **Unsettled API** - The receiving peer has requested a drain of /// remaining credit. PN_CPP_EXTERN virtual void on_sender_drain_start(sender&); /// **Unsettled API** - The credit outstanding at the time of the /// drain request has been consumed or returned. PN_CPP_EXTERN virtual void on_receiver_drain_finish(receiver&); /// **Unsettled API** - An event that can be triggered from /// another thread. /// /// This event is triggered by a call to `connection::wake()`. It /// is used to notify the application that something needs /// attention. /// /// **Thread-safety** - The application handler and the triggering /// thread must use some form of thread-safe state or /// communication to tell the handler what it needs to do. See /// `proton::work_queue` for an easier way to execute code safely /// in the handler thread. /// /// @note Spurious calls to `on_connection_wake()` can occur /// without any application call to `connection::wake()`. PN_CPP_EXTERN virtual void on_connection_wake(connection&); /// Fallback error handling. PN_CPP_EXTERN virtual void on_error(const error_condition&); }; } // proton #endif // PROTON_MESSAGING_HANDLER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/message_id.hpp0000664000000000000000000000612713257152177022654 0ustar #ifndef PROTON_MESSAGE_ID_HPP #define PROTON_MESSAGE_ID_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./binary.hpp" #include "./scalar_base.hpp" #include "./uuid.hpp" #include #include /// @file /// @copybrief proton::message_id namespace proton { /// An AMQP message ID. /// /// It can contain one of the following types: /// /// - uint64_t /// - std::string /// - proton::uuid /// - proton::binary /// class message_id : public scalar_base { public: /// An empty message_id. message_id() {} /// Construct from any type that can be assigned. template message_id(const T& x) { *this = x; } /// @name Assignment operators /// Assign a C++ value, deduce the AMQP type() /// /// @{ message_id& operator=(uint64_t x) { put_(x); return *this; } message_id& operator=(const uuid& x) { put_(x); return *this; } message_id& operator=(const binary& x) { put_(x); return *this; } message_id& operator=(const std::string& x) { put_(x); return *this; } message_id& operator=(const char* x) { put_(x); return *this; } ///< Treated as amqp::STRING /// @} private: message_id(const pn_atom_t& a): scalar_base(a) {} ///@cond INTERNAL friend class message; friend class codec::decoder; ///@endcond }; /// @cond INTERNAL /// Base template for get(message_id), specialized for legal message_id types. template T get(const message_id& x); /// @endcond /// Get the uint64_t value or throw conversion_error. @relatedalso message_id template<> inline uint64_t get(const message_id& x) { return internal::get(x); } /// Get the @ref uuid value or throw conversion_error. @relatedalso message_id template<> inline uuid get(const message_id& x) { return internal::get(x); } /// Get the @ref binary value or throw conversion_error. @relatedalso message_id template<> inline binary get(const message_id& x) { return internal::get(x); } /// Get the std::string value or throw conversion_error. @relatedalso message_id template<> inline std::string get(const message_id& x) { return internal::get(x); } /// @copydoc scalar::coerce /// @relatedalso message_id template T coerce(const message_id& x) { return internal::coerce(x); } } // proton #endif // PROTON_MESSAGE_ID_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/message.hpp0000664000000000000000000002265613257152177022205 0ustar #ifndef PROTON_MESSAGE_HPP #define PROTON_MESSAGE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./duration.hpp" #include "./timestamp.hpp" #include "./value.hpp" #include "./map.hpp" #include "./internal/pn_unique_ptr.hpp" #include #include #include /// @file /// @copybrief proton::message struct pn_message_t; namespace proton { /// An AMQP message. /// /// Value semantics: A message can be copied or assigned to make a new /// message. class message { public: /// A map of string keys and AMQP scalar values. typedef map property_map; /// A map of AMQP annotation keys and AMQP values. typedef map annotation_map; /// Create an empty message. PN_CPP_EXTERN message(); /// Copy a message. PN_CPP_EXTERN message(const message&); /// Copy a message. PN_CPP_EXTERN message& operator=(const message&); #if PN_CPP_HAS_RVALUE_REFERENCES /// Move a message. PN_CPP_EXTERN message(message&&); /// Move a message. PN_CPP_EXTERN message& operator=(message&&); #endif /// Create a message with its body set from any value that can be /// converted to a proton::value. PN_CPP_EXTERN message(const value& x); PN_CPP_EXTERN ~message(); /// @name Basic properties and methods /// @{ /// Clear the message content and properties. PN_CPP_EXTERN void clear(); /// Set the message ID. /// /// The message ID uniquely identifies a message within a /// messaging system. PN_CPP_EXTERN void id(const message_id&); /// Get the message ID. PN_CPP_EXTERN message_id id() const; /// Set the user name or ID. PN_CPP_EXTERN void user(const std::string&); /// Get the user name or ID. PN_CPP_EXTERN std::string user() const; /// Encode entire message into a byte vector, growing it if /// necessary. PN_CPP_EXTERN void encode(std::vector&) const; /// Return encoded message as a byte vector. PN_CPP_EXTERN std::vector encode() const; /// Decode from string data into the message. PN_CPP_EXTERN void decode(const std::vector&); /// @} /// @name Routing /// @{ /// Set the destination address. PN_CPP_EXTERN void to(const std::string&); /// Get the destination address. PN_CPP_EXTERN std::string to() const; /// @cond INTERNAL /// These are aliases for to() PN_CPP_EXTERN void address(const std::string&); PN_CPP_EXTERN std::string address() const; /// @endcond /// Set the address for replies. PN_CPP_EXTERN void reply_to(const std::string&); /// Get the address for replies. PN_CPP_EXTERN std::string reply_to() const; /// Set the ID for matching related messages. PN_CPP_EXTERN void correlation_id(const message_id&); /// Get the ID for matching related messages. PN_CPP_EXTERN message_id correlation_id() const; /// @} /// @name Content /// @{ /// Set the body. Equivalent to `body() = x`. PN_CPP_EXTERN void body(const value& x); /// Get the body. PN_CPP_EXTERN const value& body() const; /// Get a reference to the body that can be modified in place. PN_CPP_EXTERN value& body(); /// Set the subject. PN_CPP_EXTERN void subject(const std::string&); /// Get the subject. PN_CPP_EXTERN std::string subject() const; /// Set the content type of the body. PN_CPP_EXTERN void content_type(const std::string&); /// Get the content type of the body. PN_CPP_EXTERN std::string content_type() const; /// Set the content encoding of the body. PN_CPP_EXTERN void content_encoding(const std::string&); /// Get the content encoding of the body. PN_CPP_EXTERN std::string content_encoding() const; /// Set the expiration time. PN_CPP_EXTERN void expiry_time(timestamp); /// Get the expiration time. PN_CPP_EXTERN timestamp expiry_time() const; /// Set the creation time. PN_CPP_EXTERN void creation_time(timestamp); /// Get the creation time. PN_CPP_EXTERN timestamp creation_time() const; /// Get the inferred flag. /// /// The inferred flag for a message indicates how the message /// content is encoded into AMQP sections. If the inferred is true /// then binary and list values in the body of the message will be /// encoded as AMQP DATA and AMQP SEQUENCE sections, /// respectively. If inferred is false, then all values in the /// body of the message will be encoded as AMQP VALUE sections /// regardless of their type. PN_CPP_EXTERN bool inferred() const; /// Set the inferred flag. PN_CPP_EXTERN void inferred(bool); /// @} /// @name Transfer headers /// @{ /// Get the durable flag. /// /// The durable flag indicates that any parties taking /// responsibility for the message must durably store the content. PN_CPP_EXTERN bool durable() const; /// Set the durable flag. PN_CPP_EXTERN void durable(bool); /// Get the TTL. /// /// The TTL (time to live) for a message determines how long a /// message is considered live. When a message is held for /// retransmit, the TTL is decremented. Once the TTL reaches zero, /// the message is considered dead. Once a message is considered /// dead, it may be dropped. PN_CPP_EXTERN duration ttl() const; /// Set the TTL. PN_CPP_EXTERN void ttl(duration); /// Get the priority. /// /// The priority of a message impacts ordering guarantees. Within /// a given ordered context, higher priority messages may jump /// ahead of lower priority messages. /// /// The default value set on newly constructed messages is message::default_priority. PN_CPP_EXTERN uint8_t priority() const; /// Set the priority. PN_CPP_EXTERN void priority(uint8_t); /// Get the first acquirer flag. /// /// When set to true, the first acquirer flag for a message /// indicates that the recipient of the message is the first /// recipient to acquire the message, i.e. there have been no /// failed delivery attempts to other acquirers. Note that this /// does not mean the message has not been delivered to, but not /// acquired, by other recipients. // XXX The triple-not in the last sentence above is confusing. PN_CPP_EXTERN bool first_acquirer() const; /// Set the first acquirer flag. PN_CPP_EXTERN void first_acquirer(bool); /// Get the delivery count. /// /// The delivery count field tracks how many attempts have been /// made to deliver a message. PN_CPP_EXTERN uint32_t delivery_count() const; /// Get the delivery count. PN_CPP_EXTERN void delivery_count(uint32_t); /// @} /// @name Message groups /// @{ /// Set the message group ID. PN_CPP_EXTERN void group_id(const std::string&); /// Get the message group ID. PN_CPP_EXTERN std::string group_id() const; /// Set the reply-to group ID. PN_CPP_EXTERN void reply_to_group_id(const std::string&); /// Get the reply-to group ID. PN_CPP_EXTERN std::string reply_to_group_id() const; /// Get the group sequence. /// /// The group sequence of a message identifies the relative /// ordering of messages within a group. The default value for the /// group sequence of a message is zero. PN_CPP_EXTERN int32_t group_sequence() const; /// Set the group sequence for a message. PN_CPP_EXTERN void group_sequence(int32_t); /// @} /// @name Extended attributes /// @{ /// Get the application properties map. It can /// be modified in place. PN_CPP_EXTERN property_map& properties(); /// Examine the application properties map. PN_CPP_EXTERN const property_map& properties() const; /// Get the message annotations map. It can /// be modified in place. PN_CPP_EXTERN annotation_map& message_annotations(); /// Examine the message annotations map. PN_CPP_EXTERN const annotation_map& message_annotations() const; /// Get the delivery annotations map. It can /// be modified in place. PN_CPP_EXTERN annotation_map& delivery_annotations(); /// Examine the delivery annotations map. PN_CPP_EXTERN const annotation_map& delivery_annotations() const; /// @} /// Default priority assigned to new messages. PN_CPP_EXTERN static const uint8_t default_priority; /// @cond INTERNAL private: struct impl; pn_message_t* pn_msg() const; struct impl& impl() const; mutable pn_message_t* pn_msg_; PN_CPP_EXTERN friend void swap(message&, message&); /// @endcond }; } // proton #endif // PROTON_MESSAGE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/map.hpp0000664000000000000000000001054213257152177021325 0ustar #ifndef PROTON_MAP_HPP #define PROTON_MAP_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./value.hpp" #include "./internal/pn_unique_ptr.hpp" #include /// @file /// @copybrief proton::map namespace proton { namespace codec { class decoder; class encoder; } template class map_type_impl; template class map; /// Decode from a proton::map template PN_CPP_EXTERN proton::codec::decoder& operator>>(proton::codec::decoder& d, map& m); /// Encode to a proton::map template PN_CPP_EXTERN proton::codec::encoder& operator<<(proton::codec::encoder& e, const map& m); /// Swap proton::map instances template PN_CPP_EXTERN void swap(map&, map&); /// A collection of key-value pairs. /// /// Used to access standard AMQP property, annotation, and filter maps /// attached to proton::message and proton::source. /// /// This class provides only basic get() and put() operations for /// convenience. For more complicated uses (iteration, preserving /// order, and so on), convert the value to a standard C++ map type /// such as `std::map`. See @ref message_properties.cpp and @ref /// types_page. template class PN_CPP_CLASS_EXTERN map { template struct assignable_map : public internal::enable_if::value, U> {}; public: /// Construct an empty map. PN_CPP_EXTERN map(); /// Copy a map. PN_CPP_EXTERN map(const map&); /// Copy a map. PN_CPP_EXTERN map& operator=(const map&); #if PN_CPP_HAS_RVALUE_REFERENCES /// Move a map. PN_CPP_EXTERN map(map&&); /// Move a map. PN_CPP_EXTERN map& operator=(map&&); #endif PN_CPP_EXTERN ~map(); /// Type-safe assign from a compatible map, for instance /// `std::map`. See @ref types_page. template typename assignable_map::type operator=(const M& x) { value(x); return *this; } /// Copy from a proton::value. /// /// @throw proton::conversion_error if `x` does not contain a /// compatible map. PN_CPP_EXTERN void value(const value& x); /// Access as a proton::value containing an AMQP map. PN_CPP_EXTERN proton::value& value(); /// Access as a proton::value containing an AMQP map. PN_CPP_EXTERN const proton::value& value() const; /// Get the map entry for key `k`. Return `T()` if there is no /// such entry. PN_CPP_EXTERN T get(const K& k) const; /// Put a map entry for key `k`. PN_CPP_EXTERN void put(const K& k, const T& v); /// Erase the map entry at `k`. PN_CPP_EXTERN size_t erase(const K& k); /// True if the map has an entry for `k`. PN_CPP_EXTERN bool exists(const K& k) const; /// Get the number of map entries. PN_CPP_EXTERN size_t size() const; /// Remove all map entries. PN_CPP_EXTERN void clear(); /// True if the map has no entries. PN_CPP_EXTERN bool empty() const; /// @cond INTERNAL explicit map(pn_data_t*); void reset(pn_data_t*); /// @endcond private: typedef map_type_impl map_type; mutable internal::pn_unique_ptr map_; mutable proton::value value_; map_type& cache() const; proton::value& flush() const; /// @cond INTERNAL friend PN_CPP_EXTERN proton::codec::decoder& operator>> <>(proton::codec::decoder&, map&); friend PN_CPP_EXTERN proton::codec::encoder& operator<< <>(proton::codec::encoder&, const map&); friend PN_CPP_EXTERN void swap<>(map&, map&); /// @endcond }; } // proton #endif // PROTON_MAP_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/listener.hpp0000664000000000000000000000411713257152177022376 0ustar #ifndef PROTON_LISTENER_HPP #define PROTON_LISTENER_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "./internal/export.hpp" /// @file /// @copybrief proton::listener struct pn_listener_t; namespace proton { /// A listener for incoming connections. class PN_CPP_CLASS_EXTERN listener { /// @cond INTERNAL listener(pn_listener_t*); /// @endcond public: /// Create an empty listener. PN_CPP_EXTERN listener(); /// Copy a listener. PN_CPP_EXTERN listener(const listener&); PN_CPP_EXTERN ~listener(); /// Copy a listener. PN_CPP_EXTERN listener& operator=(const listener&); /// Stop listening on the address provided to the call to /// container::listen that returned this listener. PN_CPP_EXTERN void stop(); /// **Unsettedled API** /// /// Return the port used by the listener. /// If port 0 was passed to container::listen, this will be a dynamically allocated port. /// @throw proton::error if the listener does not have a port PN_CPP_EXTERN int port(); /// **Unsettedled API** /// /// Get the container. /// @throw proton::error if this listener is not managed by a container. PN_CPP_EXTERN class container& container() const; private: pn_listener_t* listener_; friend class container; }; } // proton #endif // PROTON_LISTENER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/listen_handler.hpp0000664000000000000000000000424613257152177023547 0ustar #ifndef PROTON_LISTEN_HANDLER_HPP #define PROTON_LISTEN_HANDLER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include /// @file /// @copybrief proton::listen_handler namespace proton { // XXX Discuss more /// **Unsettled API** - A handler for incoming connections. /// /// Implement this interface and pass to proton::container::listen() /// to be notified of new connections. class PN_CPP_CLASS_EXTERN listen_handler { public: PN_CPP_EXTERN virtual ~listen_handler(); /// Called when the listener is opened successfully. PN_CPP_EXTERN virtual void on_open(listener&); /// Called for each accepted connection. /// /// Returns connection_options to apply, including a proton::messaging_handler for /// the connection. messaging_handler::on_connection_open() will be called with /// the proton::connection, it can call connection::open() to accept or /// connection::close() to reject the connection. PN_CPP_EXTERN virtual connection_options on_accept(listener&); /// Called if there is a listening error, with an error message. /// close() will also be called. PN_CPP_EXTERN virtual void on_error(listener&, const std::string&); /// Called when this listen_handler is no longer needed, and can be deleted. PN_CPP_EXTERN virtual void on_close(listener&); }; } // proton #endif // PROTON_LISTEN_HANDLER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/link.hpp0000664000000000000000000000606113257152177021506 0ustar #ifndef PROTON_LINK_HPP #define PROTON_LINK_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./endpoint.hpp" #include "./internal/object.hpp" #include /// @file /// @copybrief proton::link struct pn_link_t; namespace proton { /// A named channel for sending or receiving messages. It is the base /// class for sender and receiver. class PN_CPP_CLASS_EXTERN link : public internal::object , public endpoint { /// @cond INTERNAL link(pn_link_t* l) : internal::object(l) {} /// @endcond public: /// Create an empty link. link() : internal::object(0) {} PN_CPP_EXTERN bool uninitialized() const; PN_CPP_EXTERN bool active() const; PN_CPP_EXTERN bool closed() const; PN_CPP_EXTERN class error_condition error() const; PN_CPP_EXTERN void close(); PN_CPP_EXTERN void close(const error_condition&); /// Suspend the link without closing it. A suspended link may be /// reopened with the same or different link options if supported /// by the peer. A suspended durable subscription becomes inactive /// without cancelling it. // XXX Should take error condition PN_CPP_EXTERN void detach(); /// Credit available on the link. PN_CPP_EXTERN int credit() const; /// **Unsettled API** - True for a receiver if a drain cycle has /// been started and the corresponding `on_receiver_drain_finish` /// event is still pending. True for a sender if the receiver has /// requested a drain of credit and the sender has unused credit. /// /// @see @ref receiver::drain. PN_CPP_EXTERN bool draining(); /// Get the link name. PN_CPP_EXTERN std::string name() const; /// The container for this link. PN_CPP_EXTERN class container &container() const; /// Get the work_queue for the link. PN_CPP_EXTERN class work_queue& work_queue() const; /// The connection that owns this link. PN_CPP_EXTERN class connection connection() const; /// The session that owns this link. PN_CPP_EXTERN class session session() const; protected: /// @cond INTERNAL // Initiate the AMQP attach frame. void attach(); friend class internal::factory; /// @endcond }; } #endif // PROTON_LINK_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/io/0000775000000000000000000000000013257152177020444 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/io/connection_driver.hpp0000664000000000000000000002117713257152177024677 0ustar #ifndef PROTON_IO_CONNECTION_DRIVER_HPP #define PROTON_IO_CONNECTION_DRIVER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "../connection_options.hpp" #include "../error_condition.hpp" #include "../fwd.hpp" #include "../internal/config.hpp" #include "../types_fwd.hpp" #include #include /// @file /// @copybrief proton::io::connection_driver namespace proton { class work_queue; class proton_handler; namespace io { /// **Unsettled API** - A pointer to a mutable memory region with a /// size. struct mutable_buffer { char* data; ///< Beginning of the buffered data. size_t size; ///< Number of bytes in the buffer. /// Construct a buffer starting at data_ with size_ bytes. mutable_buffer(char* data_=0, size_t size_=0) : data(data_), size(size_) {} }; /// **Unsettled API** - A pointer to an immutable memory region with a /// size. struct const_buffer { const char* data; ///< Beginning of the buffered data. size_t size; ///< Number of bytes in the buffer. /// Construct a buffer starting at data_ with size_ bytes. const_buffer(const char* data_=0, size_t size_=0) : data(data_), size(size_) {} }; /// **Unsettled API** - An AMQP driver for a single connection. /// /// io::connection_driver manages a single proton::connection and dispatches /// events to a proton::messaging_handler. It does no IO of its own, but allows you to /// integrate AMQP protocol handling into any IO or concurrency framework. /// /// The application is coded the same way as for the /// proton::container. The application implements a /// proton::messaging_handler to respond to transport, connection, /// session, link, and message events. With a little care, the same /// handler classes can be used for both container and /// connection_driver. the @ref broker.cpp example illustrates this. /// /// You need to write the IO code to read AMQP data to the /// read_buffer(). The engine parses the AMQP frames. dispatch() calls /// the appropriate functions on the applications proton::messaging_handler. You /// write output data from the engine's write_buffer() to your IO. /// /// The engine is not safe for concurrent use, but you can process /// different engines concurrently. A common pattern for /// high-performance servers is to serialize read/write activity /// per connection and dispatch in a fixed-size thread pool. /// /// The engine is designed to work with a classic reactor (e.g., /// select, poll, epoll) or an async-request driven proactor (e.g., /// windows completion ports, boost.asio, libuv). /// /// The engine never throws exceptions. class PN_CPP_CLASS_EXTERN connection_driver { public: /// An engine without a container id. PN_CPP_EXTERN connection_driver(); /// Create a connection driver associated with a container id. PN_CPP_EXTERN connection_driver(const std::string&); PN_CPP_EXTERN ~connection_driver(); /// Configure a connection by applying exactly the options in opts (including proton::messaging_handler) /// Does not apply any default options, to apply container defaults use connect() or accept() /// instead. If server==true, configure a server connection. void configure(const connection_options& opts=connection_options(), bool server=false); /// Call configure() with client options and call connection::open() /// Options applied: container::id(), container::client_connection_options(), opts. PN_CPP_EXTERN void connect(const connection_options& opts); /// Call configure() with server options. /// Options applied: container::id(), container::server_connection_options(), opts. /// /// Note this does not call connection::open(). If there is a messaging_handler in the /// composed options it will receive messaging_handler::on_connection_open() and can /// respond with connection::open() or connection::close() PN_CPP_EXTERN void accept(const connection_options& opts); /// The engine's read buffer. Read data into this buffer then call read_done() when complete. /// Returns mutable_buffer(0, 0) if the engine cannot currently read data. /// Calling dispatch() may open up more buffer space. PN_CPP_EXTERN mutable_buffer read_buffer(); /// Indicate that the first n bytes of read_buffer() have valid data. /// This changes the buffer, call read_buffer() to get the updated buffer. PN_CPP_EXTERN void read_done(size_t n); /// Indicate that the read side of the transport is closed and no more data will be read. /// Note that there may still be events to dispatch() or data to write. PN_CPP_EXTERN void read_close(); /// The engine's write buffer. Write data from this buffer then call write_done() /// Returns const_buffer(0, 0) if the engine has nothing to write. /// Calling dispatch() may generate more data in the write buffer. PN_CPP_EXTERN const_buffer write_buffer(); /// Indicate that the first n bytes of write_buffer() have been written successfully. /// This changes the buffer, call write_buffer() to get the updated buffer. PN_CPP_EXTERN void write_done(size_t n); /// Indicate that the write side of the transport has closed and no more data can be written. /// Note that there may still be events to dispatch() or data to read. PN_CPP_EXTERN void write_close(); /// Indicate that time has passed /// /// @return the expiration time of the next unexpired timer. You must arrange to call tick() /// no later than this expiration time. In practice this will mean calling tick() every time /// there is anything read or written, and if nothing is read or written then as soon as possible /// after the returned timestamp (so you will probably need to set a platform specific timeout to /// know when this occurs). PN_CPP_EXTERN timestamp tick(timestamp now); /// Inform the engine that the transport been disconnected unexpectedly, /// without completing the AMQP connection close sequence. /// /// This calls read_close(), write_close(), sets the transport().error() and /// queues an `on_transport_error` event. You must call dispatch() one more /// time to dispatch the messaging_handler::on_transport_error() call and other final /// events. /// /// Note this does not close the connection() so that a proton::messaging_handler can /// distinguish between a connection close error sent by the remote peer and /// a transport failure. /// PN_CPP_EXTERN void disconnected(const error_condition& = error_condition()); /// There are events to be dispatched by dispatch() PN_CPP_EXTERN bool has_events() const; /// Dispatch all available events and call the corresponding \ref messaging_handler methods. /// /// Returns true if the engine is still active, false if it is finished and /// can be destroyed. The engine is finished when all events are dispatched /// and one of the following is true: /// /// - both read_close() and write_close() have been called, no more IO is possible. /// - The AMQP connection() is closed AND the write_buffer() is empty. /// /// May modify the read_buffer() and/or the write_buffer(). /// PN_CPP_EXTERN bool dispatch(); /// Get the AMQP connection associated with this connection_driver. PN_CPP_EXTERN proton::connection connection() const; /// Get the transport associated with this connection_driver. PN_CPP_EXTERN proton::transport transport() const; /// Get the container associated with this connection_driver, if there is one. PN_CPP_EXTERN proton::container* container() const; private: void init(); connection_driver(const connection_driver&); connection_driver& operator=(const connection_driver&); std::string container_id_; messaging_handler* handler_; pn_connection_driver_t driver_; }; } // io } // proton #endif // PROTON_IO_CONNECTION_DRIVER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/0000775000000000000000000000000013257152177021651 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp0000664000000000000000000002003713257152177024733 0ustar #ifndef PROTON_INTERNAL_TYPE_TRAITS_HPP #define PROTON_INTERNAL_TYPE_TRAITS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ // Type traits for mapping between AMQP and C++ types. // // Also provides workarounds for missing type_traits classes on older // C++ compilers. #include "./config.hpp" #include "../types_fwd.hpp" #include "../type_id.hpp" #include #include namespace proton { namespace internal { class decoder; class encoder; template struct enable_if {}; template struct enable_if { typedef T type; }; struct true_type { static const bool value = true; }; struct false_type { static const bool value = false; }; template struct is_integral : public false_type {}; template struct is_signed : public false_type {}; template <> struct is_integral : public true_type {}; template <> struct is_signed { static const bool value = std::numeric_limits::is_signed; }; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_signed : public false_type {}; template <> struct is_signed : public false_type {}; template <> struct is_signed : public false_type {}; template <> struct is_signed : public true_type {}; template <> struct is_signed : public true_type {}; template <> struct is_signed : public true_type {}; template <> struct is_signed : public true_type {}; #if PN_CPP_HAS_LONG_LONG_TYPE template <> struct is_integral : public true_type {}; template <> struct is_integral : public true_type {}; template <> struct is_signed : public false_type {}; template <> struct is_signed : public true_type {}; #endif template struct is_same { static const bool value=false; }; template struct is_same { static const bool value=true; }; template< class T > struct remove_const { typedef T type; }; template< class T > struct remove_const { typedef T type; }; template struct type_id_constant { typedef T type; static const type_id value = ID; }; /// @name Metafunction returning AMQP type for scalar C++ types. /// @{ template struct type_id_of; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; template<> struct type_id_of : public type_id_constant {}; /// @} /// Metafunction to test if a class has a type_id. template struct has_type_id : public false_type {}; template struct has_type_id::type> : public true_type {}; // The known/unknown integer type magic is required because the C++ standard is // vague a about the equivalence of integral types for overloading. E.g. char is // sometimes equivalent to signed char, sometimes unsigned char, sometimes // neither. int8_t or uint8_t may or may not be equivalent to a char type. // int64_t may or may not be equivalent to long long etc. C++ compilers are also // allowed to add their own non-standard integer types like __int64, which may // or may not be equivalent to any of the standard integer types. // // The solution is to use a fixed, standard set of integer types that are // guaranteed to be distinct for overloading (see type_id_of) and to use template // specialization to convert other integer types to a known integer type with the // same sizeof and is_signed. // Map arbitrary integral types to known integral types. template struct integer_type; template<> struct integer_type<1, true> { typedef int8_t type; }; template<> struct integer_type<2, true> { typedef int16_t type; }; template<> struct integer_type<4, true> { typedef int32_t type; }; template<> struct integer_type<8, true> { typedef int64_t type; }; template<> struct integer_type<1, false> { typedef uint8_t type; }; template<> struct integer_type<2, false> { typedef uint16_t type; }; template<> struct integer_type<4, false> { typedef uint32_t type; }; template<> struct integer_type<8, false> { typedef uint64_t type; }; // True if T is an integer type that does not have an explicit type_id. template struct is_unknown_integer { static const bool value = !has_type_id::value && is_integral::value; }; template::value>::type> struct known_integer : public integer_type::value> {}; // Helper base for SFINAE templates. struct sfinae { typedef char yes; typedef double no; struct any_t { template < typename T > any_t(T const&); }; }; template struct is_convertible : public sfinae { static yes test(const To&); static no test(...); static const From& from; // Windows compilers warn about data-loss caused by legal conversions. We // can't use static_cast because that will cause a hard error instead of // letting SFINAE overload resolution select the test(...) overload. #ifdef _WIN32 #pragma warning( push ) #pragma warning( disable : 4244 ) #endif static bool const value = sizeof(test(from)) == sizeof(yes); #ifdef _WIN32 #pragma warning( pop ) #endif }; } // internal } // proton #endif // PROTON_INTERNAL_TYPE_TRAITS_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp0000664000000000000000000000516113257152177025255 0ustar #ifndef PROTON_INTERNAL_UNIQUE_PTR_HPP #define PROTON_INTERNAL_UNIQUE_PTR_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./config.hpp" #include namespace proton { namespace internal { template class pn_unique_ptr; template void swap(pn_unique_ptr& x, pn_unique_ptr& y); /// A simple unique ownership pointer, used as a return value from /// functions that transfer ownership to the caller. /// /// pn_unique_ptr return values should be converted immediately to /// std::unique_ptr if that is available or std::auto_ptr (by calling /// release()) for older C++. You should not use pn_unique_ptr in your /// own code. It is a limited pointer class designed only to work /// around differences between C++11 and C++03. template class pn_unique_ptr { public: pn_unique_ptr(T* p=0) : ptr_(p) {} #if PN_CPP_HAS_RVALUE_REFERENCES pn_unique_ptr(pn_unique_ptr&& x) : ptr_(0) { std::swap(ptr_, x.ptr_); } #else pn_unique_ptr(const pn_unique_ptr& x) : ptr_() { std::swap(ptr_, const_cast(x).ptr_); } #endif ~pn_unique_ptr() { delete(ptr_); } T& operator*() const { return *ptr_; } T* operator->() const { return ptr_; } T* get() const { return ptr_; } void reset(T* p = 0) { pn_unique_ptr tmp(p); std::swap(ptr_, tmp.ptr_); } T* release() { T *p = ptr_; ptr_ = 0; return p; } #if PN_CPP_HAS_EXPLICIT_CONVERSIONS explicit operator bool() const { return get(); } #endif bool operator !() const { return !get(); } void swap(pn_unique_ptr& x) { std::swap(ptr_, x.ptr_); } #if PN_CPP_HAS_STD_UNIQUE_PTR operator std::unique_ptr() { T *p = ptr_; ptr_ = 0; return std::unique_ptr(p); } #endif private: T* ptr_; }; template void swap(pn_unique_ptr& x, pn_unique_ptr& y) { x.swap(y); } } // internal } // proton #endif // PROTON_INTERNAL_UNIQUE_PTR_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/object.hpp0000664000000000000000000000675713257152177023647 0ustar #ifndef PROTON_INTERNAL_OBJECT_HPP #define PROTON_INTERNAL_OBJECT_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./config.hpp" #include "./export.hpp" #include "./comparable.hpp" #include #include namespace proton { template class returned; namespace internal { class pn_ptr_base { protected: PN_CPP_EXTERN static void incref(void* p); PN_CPP_EXTERN static void decref(void* p); PN_CPP_EXTERN static std::string inspect(void* p); }; template class pn_ptr : private pn_ptr_base, private comparable > { public: pn_ptr() : ptr_(0) {} pn_ptr(T* p) : ptr_(p) { incref(ptr_); } pn_ptr(const pn_ptr& o) : ptr_(o.ptr_) { incref(ptr_); } #if PN_CPP_HAS_RVALUE_REFERENCES pn_ptr(pn_ptr&& o) : ptr_(0) { std::swap(ptr_, o.ptr_); } #endif ~pn_ptr() { decref(ptr_); } pn_ptr& operator=(pn_ptr o) { std::swap(ptr_, o.ptr_); return *this; } T* get() const { return ptr_; } T* release() { T *p = ptr_; ptr_ = 0; return p; } bool operator!() const { return !ptr_; } #if PN_CPP_HAS_EXPLICIT_CONVERSIONS explicit operator bool() const { return !!ptr_; } #endif std::string inspect() const { return pn_ptr_base::inspect(ptr_); } static pn_ptr take_ownership(T* p) { return pn_ptr(p, true); } private: T *ptr_; // Note that it is the presence of the bool in the constructor signature that matters // to get the "transfer ownership" constructor: The value of the bool isn't checked. pn_ptr(T* p, bool) : ptr_(p) {} friend bool operator==(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ == b.ptr_; } friend bool operator<(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ < b.ptr_; } }; template pn_ptr take_ownership(T* p) { return pn_ptr::take_ownership(p); } /// Base class for proton object types. template class object : private comparable > { public: bool operator!() const { return !object_; } #if PN_CPP_HAS_EXPLICIT_CONVERSIONS explicit operator bool() const { return object_.get(); } #endif protected: typedef T pn_type; object(pn_ptr o) : object_(o) {} T* pn_object() const { return object_.get(); } private: pn_ptr object_; friend bool operator==(const object& a, const object& b) { return a.object_ == b.object_; } friend bool operator<(const object& a, const object& b) { return a.object_ < b.object_; } friend std::ostream& operator<<(std::ostream& o, const object& a) { o << a.object_.inspect(); return o; } template friend class proton::returned; }; /// Factory class used internally to make wrappers and extract proton objects template class factory; } // internal } // proton #endif // PROTON_INTERNAL_OBJECT_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/export.hpp0000664000000000000000000000472313257152177023711 0ustar #ifndef PROTON_INTERNAL_EXPORT_HPP #define PROTON_INTERNAL_EXPORT_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @cond INTERNAL /// import/export macros #if defined(WIN32) && !defined(PN_CPP_DECLARE_STATIC) // // Import and Export definitions for Windows: // # define PN_CPP_EXPORT __declspec(dllexport) # define PN_CPP_IMPORT __declspec(dllimport) # define PN_CPP_CLASS_EXPORT # define PN_CPP_CLASS_IMPORT #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define PN_CPP_EXPORT __global # define PN_CPP_IMPORT # define PN_CPP_CLASS_EXPORT __global # define PN_CPP_CLASS_IMPORT #else // // Non-Windows (Linux, etc.) definitions: // # define PN_CPP_EXPORT __attribute__((visibility("default"))) # define PN_CPP_IMPORT # define PN_CPP_CLASS_EXPORT __attribute__((visibility("default"))) # define PN_CPP_CLASS_IMPORT #endif // For qpid-proton-cpp library symbols #ifdef qpid_proton_cpp_EXPORTS # define PN_CPP_EXTERN PN_CPP_EXPORT # define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_EXPORT #else # define PN_CPP_EXTERN PN_CPP_IMPORT # define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_IMPORT #endif #if defined(PN_CPP_USE_DEPRECATED_API) # define PN_CPP_DEPRECATED(message) #else # if defined(PN_COMPILER_CXX_ATTRIBUTE_DEPRECATED) && PN_COMPILER_CXX_ATTRIBUTE_DEPRECATED # define PN_CPP_DEPRECATED(message) [[deprecated(message)]] # elif defined(WIN32) # define PN_CPP_DEPRECATED(message) __declspec(deprecated(message)) # elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40500 # define PN_CPP_DEPRECATED(message) __attribute__((deprecated)) # else # define PN_CPP_DEPRECATED(message) __attribute__((deprecated(message))) # endif #endif /// @endcond #endif // PROTON_INTERNAL_EXPORT_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/data.hpp0000664000000000000000000000542213257152177023276 0ustar #ifndef PROTON_INTERNAL_DATA_HPP #define PROTON_INTERNAL_DATA_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "../internal/object.hpp" #include "../types_fwd.hpp" struct pn_data_t; namespace proton { class value; namespace internal { /// @cond INTERNAL /// A wrapper for a proton data object. class data : public object { /// Wrap an existing Proton-C data object. data(pn_data_t* d) : internal::object(d) {} public: /// Create an empty data object. data() : internal::object(0) {} /// Create a new data object. PN_CPP_EXTERN static data create(); /// Copy the contents of another data object. PN_CPP_EXTERN void copy(const data&); /// Clear the data. PN_CPP_EXTERN void clear(); /// Rewind current position to the start. PN_CPP_EXTERN void rewind(); /// True if there are no values. PN_CPP_EXTERN bool empty() const; /// Append the contents of another data object. PN_CPP_EXTERN int append(data src); /// Append up to limit items from data object. PN_CPP_EXTERN int appendn(data src, int limit); PN_CPP_EXTERN bool next(); PN_CPP_EXTERN const void* point() const; PN_CPP_EXTERN void restore(const void* h); protected: void narrow(); void widen(); friend class internal::factory; friend struct state_guard; friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const data&); }; /// @endcond /// **Unsettled API** - Save and restore codec state. /// /// A state guard saves the state and restores it in the destructor /// unless `cancel()` is called. struct state_guard { /// @cond INTERNAL data& data_; const void* point_; bool cancel_; /// @endcond /// @cond INTERNAL state_guard(data& d) : data_(d), point_(data_.point()), cancel_(false) {} /// @endcond ~state_guard() { if (!cancel_) data_.restore(point_); } /// Discard the saved state. void cancel() { cancel_ = true; } }; } // internal } // proton #endif // PROTON_INTERNAL_DATA_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/config.hpp0000664000000000000000000000732113257152177023632 0ustar #ifndef PROTON_INTERNAL_CONFIG_HPP #define PROTON_INTERNAL_CONFIG_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @cond INTERNAL /// @file /// /// Configuration macros. They can be set via -D compiler options or /// in code. /// /// On a C++11 compliant compiler, all C++11 features are enabled by /// default. Otherwise they can be enabled or disabled separately /// with -D on the compile line. // Read library compilation presets - // This sets the options the library itself was compiled with // and sets up the compilation options is we are compiling the library itself #include "config_presets.hpp" /// Whether the library supports threads depends on the configuration of the library compilation only #define PN_CPP_SUPPORTS_THREADS PN_CPP_LIB_HAS_CPP11 || (PN_CPP_LIB_HAS_STD_THREAD && PN_CPP_LIB_HAS_STD_MUTEX) /// @endcond /// The Apple clang compiler doesn't really support PN_CPP_HAS_THREAD_LOCAL /// before Xcode 8 even though it claims to be C++11 compatible #if defined(__clang__) && defined(__apple_build_version__) && ((__clang_major__ * 100) + __clang_minor__) >= 301 #if __has_feature(cxx_thread_local) #define PN_CPP_HAS_THREAD_LOCAL 1 #else #define PN_CPP_HAS_THREAD_LOCAL 0 #endif #endif #ifndef PN_CPP_HAS_CPP11 #if defined(__cplusplus) && __cplusplus >= 201103 #define PN_CPP_HAS_CPP11 1 #else #define PN_CPP_HAS_CPP11 0 #endif #endif #ifndef PN_CPP_HAS_LONG_LONG_TYPE #define PN_CPP_HAS_LONG_LONG_TYPE PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_NULLPTR #define PN_CPP_HAS_NULLPTR PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_RVALUE_REFERENCES #define PN_CPP_HAS_RVALUE_REFERENCES PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_OVERRIDE #define PN_CPP_HAS_OVERRIDE PN_CPP_HAS_CPP11 #endif #if PN_CPP_HAS_OVERRIDE #define PN_CPP_OVERRIDE override #else #define PN_CPP_OVERRIDE #endif #ifndef PN_CPP_HAS_EXPLICIT_CONVERSIONS #define PN_CPP_HAS_EXPLICIT_CONVERSIONS PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_DEFAULTED_FUNCTIONS #define PN_CPP_HAS_DEFAULTED_FUNCTIONS PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_DEFAULTED_MOVE_INITIALIZERS #define PN_CPP_HAS_DEFAULTED_MOVE_INITIALIZERS PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_DELETED_FUNCTIONS #define PN_CPP_HAS_DELETED_FUNCTIONS PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_THREAD_LOCAL #define PN_CPP_HAS_THREAD_LOCAL PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_VARIADIC_TEMPLATES #define PN_CPP_HAS_VARIADIC_TEMPLATES PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_LAMBDAS #define PN_CPP_HAS_LAMBDAS PN_CPP_HAS_CPP11 #endif // Library features #ifndef PN_CPP_HAS_HEADER_RANDOM #define PN_CPP_HAS_HEADER_RANDOM PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_STD_UNIQUE_PTR #define PN_CPP_HAS_STD_UNIQUE_PTR PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_STD_MUTEX #define PN_CPP_HAS_STD_MUTEX PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_STD_ATOMIC #define PN_CPP_HAS_STD_ATOMIC PN_CPP_HAS_CPP11 #endif #ifndef PN_CPP_HAS_STD_THREAD #define PN_CPP_HAS_STD_THREAD PN_CPP_HAS_CPP11 #endif #endif // PROTON_INTERNAL_CONFIG_HPP /// @endcond qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/internal/comparable.hpp0000664000000000000000000000262713257152177024476 0ustar #ifndef PROTON_INTERNAL_COMPARABLE_HPP #define PROTON_INTERNAL_COMPARABLE_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ namespace proton { namespace internal { /// Base class for comparable types with operator< and /// operator==. Provides remaining operators. template class comparable { friend bool operator>(const T &a, const T &b) { return b < a; } friend bool operator<=(const T &a, const T &b) { return !(a > b); } friend bool operator>=(const T &a, const T &b) { return !(a < b); } friend bool operator!=(const T &a, const T &b) { return !(a == b); } }; } // internal } // proton #endif // PROTON_INTERNAL_COMPARABLE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/fwd.hpp0000664000000000000000000000352513257152177021333 0ustar #ifndef PROTON_FWD_HPP #define PROTON_FWD_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// Forward declarations. #include "./internal/config.hpp" namespace proton { class annotation_key; class connection; class connection_options; class container; class delivery; class duration; class error_condition; class event; class message; class message_id; class messaging_handler; class listen_handler; class listener; class receiver; class receiver_iterator; class receiver_options; class reconnect_options; class sasl; class sender; class sender_iterator; class sender_options; class session; class session_options; class source_options; class ssl; class target_options; class tracker; class transport; class url; class void_function0; class work_queue; namespace internal { namespace v03 { class work; } } #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES namespace internal { namespace v11 { class work; } } using internal::v11::work; #else using internal::v03::work; #endif namespace io { class connection_driver; } template class returned; } #endif // PROTON_FWD_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/function.hpp0000664000000000000000000000323213257152177022373 0ustar #ifndef PROTON_FUNCTION_HPP #define PROTON_FUNCTION_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// @file /// **Deprecated** - Use the API in `work_queue.hpp`. /// @cond INTERNAL namespace proton { /// **Deprecated** - Use `proton::work`. /// /// A C++03-compatible void no-argument callback function object. /// /// Used by `container::schedule()` and `work_queue::add()`. In C++11 /// you can use `std::bind`, `std::function`, or a void-no-argument /// lambda instead. /// /// `void_function0` is passed by reference, so instances of /// subclasses do not have to be heap allocated. Once passed, the /// instance must not be deleted until its `operator()` is called or /// the container has stopped. class void_function0 { public: virtual ~void_function0() {} /// Override the call operator with your code. virtual void operator()() = 0; }; } // proton /// @endcond #endif // PROTON_FUNCTION_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/error_condition.hpp0000664000000000000000000000655013257152177023753 0ustar #ifndef PROTON_ERROR_CONDITION_H #define PROTON_ERROR_CONDITION_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/config.hpp" #include "./value.hpp" #include #include /// @file /// @copybrief proton::error_condition struct pn_condition_t; namespace proton { /// Describes an endpoint error state. class error_condition { /// @cond INTERNAL error_condition(pn_condition_t* c); /// @endcond public: /// Create an empty error condition. error_condition() {} /// Create an error condition with only a description. A default /// name will be used ("proton:io:error"). PN_CPP_EXTERN error_condition(std::string description); /// Create an error condition with a name and description. PN_CPP_EXTERN error_condition(std::string name, std::string description); /// **Unsettled API** - Create an error condition with name, /// description, and informational properties. PN_CPP_EXTERN error_condition(std::string name, std::string description, proton::value properties); #if PN_CPP_HAS_DEFAULTED_FUNCTIONS && PN_CPP_HAS_DEFAULTED_MOVE_INITIALIZERS /// @cond INTERNAL error_condition(const error_condition&) = default; error_condition& operator=(const error_condition&) = default; error_condition(error_condition&&) = default; error_condition& operator=(error_condition&&) = default; /// @endcond #endif #if PN_CPP_HAS_EXPLICIT_CONVERSIONS /// If you are using a C++11 compiler, you may use an /// error_condition in boolean contexts. The expression will be /// true if the error_condition is set. PN_CPP_EXTERN explicit operator bool() const; #endif /// No condition set. PN_CPP_EXTERN bool operator!() const; /// No condition has been set. PN_CPP_EXTERN bool empty() const; /// Condition name. PN_CPP_EXTERN std::string name() const; /// Descriptive string for condition. PN_CPP_EXTERN std::string description() const; /// Extra information for condition. PN_CPP_EXTERN value properties() const; /// Simple printable string for condition. PN_CPP_EXTERN std::string what() const; private: std::string name_; std::string description_; proton::value properties_; /// @cond INTERNAL friend class internal::factory; /// @endcond }; /// @cond INTERNAL // XXX Document these PN_CPP_EXTERN bool operator==(const error_condition& x, const error_condition& y); PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const error_condition& err); /// @endcond } // proton #endif // PROTON_ERROR_CONDITION_H qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/error.hpp0000664000000000000000000000340013257152177021674 0ustar #ifndef PROTON_ERROR_HPP #define PROTON_ERROR_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/config.hpp" #include "./internal/export.hpp" #include #include /// @file /// @copybrief proton::error namespace proton { /// The base Proton error. /// /// All exceptions thrown from functions in the proton namespace are /// subclasses of proton::error. struct PN_CPP_CLASS_EXTERN error : public std::runtime_error { /// Construct the error with a message. PN_CPP_EXTERN explicit error(const std::string&); }; /// An operation timed out. struct PN_CPP_CLASS_EXTERN timeout_error : public error { /// Construct the error with a message. PN_CPP_EXTERN explicit timeout_error(const std::string&); }; /// An error converting between AMQP and C++ data. struct PN_CPP_CLASS_EXTERN conversion_error : public error { /// Construct the error with a message. PN_CPP_EXTERN explicit conversion_error(const std::string&); }; } // proton #endif // PROTON_ERROR_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/endpoint.hpp0000664000000000000000000000617213257152177022374 0ustar #ifndef PROTON_ENDPOINT_HPP #define PROTON_ENDPOINT_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./error_condition.hpp" #include "./internal/config.hpp" #include "./internal/export.hpp" /// @file /// @copybrief proton::endpoint namespace proton { /// The base class for session, connection, and link. class PN_CPP_CLASS_EXTERN endpoint { public: PN_CPP_EXTERN virtual ~endpoint(); // XXX Add the container accessor here. /// True if the local end is uninitialized. virtual bool uninitialized() const = 0; /// True if the local end is active. virtual bool active() const = 0; /// True if the local and remote ends are closed. virtual bool closed() const = 0; /// Get the error condition of the remote endpoint. virtual class error_condition error() const = 0; // XXX Add virtual open() and open(endpoint_options) /// Close the endpoint. /// /// @see endpoint_lifecycle virtual void close() = 0; /// Close the endpoint with an error condition. /// /// @see endpoint_lifecycle virtual void close(const error_condition&) = 0; #if PN_CPP_HAS_DEFAULTED_FUNCTIONS && PN_CPP_HAS_DEFAULTED_MOVE_INITIALIZERS // Make everything explicit for C++11 compilers /// @cond INTERNAL endpoint() = default; endpoint& operator=(const endpoint&) = default; endpoint(const endpoint&) = default; endpoint& operator=(endpoint&&) = default; endpoint(endpoint&&) = default; /// @endcond #endif }; namespace internal { template class iter_base { public: typedef T value_type; T operator*() const { return obj_; } T* operator->() const { return const_cast(&obj_); } D operator++(int) { D x(*this); ++(*this); return x; } bool operator==(const iter_base& x) const { return obj_ == x.obj_; } bool operator!=(const iter_base& x) const { return obj_ != x.obj_; } protected: explicit iter_base(T p = 0) : obj_(p) {} T obj_; }; template class iter_range { public: typedef I iterator; explicit iter_range(I begin = I(), I end = I()) : begin_(begin), end_(end) {} I begin() const { return begin_; } I end() const { return end_; } bool empty() const { return begin_ == end_; } private: I begin_, end_; }; } // internal } // proton #endif // PROTON_ENDPOINT_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/duration.hpp0000664000000000000000000000541513257152177022400 0ustar #ifndef PROTON_DURATION_HPP #define PROTON_DURATION_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./internal/comparable.hpp" #include "./types_fwd.hpp" #include #include /// @file /// @copybrief proton::duration namespace proton { /// A span of time in milliseconds. class duration : private internal::comparable { public: /// A numeric type holding a value in milliseconds. typedef int64_t numeric_type; /// Construct from a value in milliseconds. explicit duration(numeric_type ms = 0) : ms_(ms) {} /// Assign a value in milliseconds. duration& operator=(numeric_type ms) { ms_ = ms; return *this; } /// Get the value in milliseconds. numeric_type milliseconds() const { return ms_; } PN_CPP_EXTERN static const duration FOREVER; ///< Wait forever PN_CPP_EXTERN static const duration IMMEDIATE; ///< Don't wait at all PN_CPP_EXTERN static const duration SECOND; ///< One second PN_CPP_EXTERN static const duration MILLISECOND; ///< One millisecond PN_CPP_EXTERN static const duration MINUTE; ///< One minute private: numeric_type ms_; }; /// Print a duration. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, duration); /// @name Comparison and arithmetic operators /// @{ inline bool operator<(duration x, duration y) { return x.milliseconds() < y.milliseconds(); } inline bool operator==(duration x, duration y) { return x.milliseconds() == y.milliseconds(); } inline duration operator+(duration x, duration y) { return duration(x.milliseconds() + y.milliseconds()); } inline duration operator-(duration x, duration y) { return duration(x.milliseconds() - y.milliseconds()); } inline duration operator*(duration d, uint64_t n) { return duration(d.milliseconds()*n); } inline duration operator*(uint64_t n, duration d) { return d * n; } inline duration operator/(duration d, uint64_t n) { return duration(d.milliseconds() / n); } /// @} } // proton #endif // PROTON_DURATION_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/delivery_mode.hpp0000664000000000000000000000364013257152177023400 0ustar #ifndef PROTON_DELIVERY_MODE_H #define PROTON_DELIVERY_MODE_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// @copybrief proton::delivery_mode namespace proton { /// The message delivery policy to establish when opening a link. /// This structure imitates the newer C++11 "enum class" so that /// The enumeration constants are in the delivery_mode namespace. struct delivery_mode { /// Delivery modes enum modes { /// No set policy. The application must settle messages /// itself according to its own policy. NONE = 0, /// Outgoing messages are settled immediately by the link. /// There are no duplicates. AT_MOST_ONCE, /// The receiver settles the delivery first with an /// accept/reject/release disposition. The sender waits to /// settle until after the disposition notification is /// received. AT_LEAST_ONCE }; /// @cond INTERNAL delivery_mode() : modes_(NONE) {} delivery_mode(modes m) : modes_(m) {} operator modes() { return modes_; } /// @endcond private: modes modes_; }; } // proton #endif // PROTON_DELIVERY_MODE_H qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/delivery.hpp0000664000000000000000000000365413257152177022401 0ustar #ifndef PROTON_DELIVERY_HPP #define PROTON_DELIVERY_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/object.hpp" #include "./transfer.hpp" /// @file /// @copybrief proton::delivery namespace proton { /// A received message. /// /// A delivery attempt can fail. As a result, a particular message may /// correspond to multiple deliveries. class delivery : public transfer { /// @cond INTERNAL delivery(pn_delivery_t* d); /// @endcond public: delivery() {} /// Return the receiver for this delivery. PN_CPP_EXTERN class receiver receiver() const; // XXX ATM the following don't reflect the differing behaviors we // get from the different delivery modes. - Deferred /// Settle with ACCEPTED state. PN_CPP_EXTERN void accept(); /// Settle with REJECTED state. PN_CPP_EXTERN void reject(); /// Settle with RELEASED state. PN_CPP_EXTERN void release(); /// Settle with MODIFIED state. PN_CPP_EXTERN void modify(); /// @cond INTERNAL friend class internal::factory; /// @endcond }; } // proton #endif // PROTON_DELIVERY_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/default_container.hpp0000664000000000000000000000225313257152177024236 0ustar #ifndef PROTON_DEFAULT_CONTAINER_HPP #define PROTON_DEFAULT_CONTAINER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" /// @file /// **Deprecated** - Use the API in `container.hpp`. namespace proton { /// **Deprecated** - Use `proton::container`. typedef class container PN_CPP_DEPRECATED("Use 'proton::container'") default_container; } // proton #endif // PROTON_DEFAULT_CONTAINER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/decimal.hpp0000664000000000000000000000410213257152177022141 0ustar #ifndef PROTON_DECIMAL_HPP #define PROTON_DECIMAL_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./byte_array.hpp" #include "./internal/export.hpp" #include "./internal/comparable.hpp" #include /// @file /// /// AMQP decimal types. /// /// AMQP uses the standard IEEE 754-2008 encoding for decimal types. /// /// This library does not provide support for decimal arithmetic, but /// it does provide access to the byte representation of decimal /// values. You can pass these values uninterpreted via AMQP, or you /// can use a library that supports IEEE 754-2008 and make a byte-wise /// copy between the real decimal values and `proton::decimal` values. namespace proton { /// A 32-bit decimal floating-point value. class decimal32 : public byte_array<4> {}; /// A 64-bit decimal floating-point value. class decimal64 : public byte_array<8> {}; /// A 128-bit decimal floating-point value. class decimal128 : public byte_array<16> {}; /// Print a 32-bit decimal value. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal32&); /// Print a 64-bit decimal value. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal64&); /// Print a 128-bit decimal value. PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal128&); } // proton #endif // PROTON_DECIMAL_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/container.hpp0000664000000000000000000003121613257152177022533 0ustar #ifndef PROTON_CONTAINER_HPP #define PROTON_CONTAINER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./returned.hpp" #include "./types_fwd.hpp" #include "./internal/config.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include /// @file /// @copybrief proton::container namespace proton { /// A top-level container of connections, sessions, and links. /// /// A container gives a unique identity to each communicating peer. It /// is often a process-level object. /// /// It also serves as an entry point to the API, allowing connections, /// senders, and receivers to be established. It can be supplied with /// an event handler in order to intercept important messaging events, /// such as newly received messages or newly issued credit for sending /// messages. class PN_CPP_CLASS_EXTERN container { public: /// Create a container with a global handler for messaging events. /// /// **Thread safety** - in a multi-threaded container this handler will be /// called concurrently. You can use locks to make that safe, or use a /// separate handler for each connection. See @ref mt_page. /// /// @param handler global handler, called for events on all connections /// managed by the container. /// /// @param id sets the container's unique identity. PN_CPP_EXTERN container(messaging_handler& handler, const std::string& id); /// Create a container with a global handler for messaging events. /// /// **Thread safety** - in a multi-threaded container this handler will be /// called concurrently. You can use locks to make that safe, or use a /// separate handler for each connection. See @ref mt_page. /// /// @param handler global handler, called for events on all connections /// managed by the container. PN_CPP_EXTERN container(messaging_handler& handler); /// Create a container. /// @param id sets the container's unique identity. PN_CPP_EXTERN container(const std::string& id); /// Create a container. /// /// This will create a default random identity PN_CPP_EXTERN container(); /// Destroy a container. /// /// A container must not be destroyed while a call to run() is in progress, /// in particular it must not be destroyed from a @ref messaging_handler /// callback. /// /// **Thread safety** - in a multi-threaded application, run() must return /// in all threads that call it before destroying the container. /// PN_CPP_EXTERN ~container(); /// Connect to `conn_url` and send an open request to the remote /// peer. /// /// Options are applied to the connection as follows. /// /// 1. client_connection_options() /// 2. Options passed to connect() /// /// Values in later options override earlier ones. The handler in /// the composed options is used to call /// `messaging_handler::on_connection_open()` when the open /// response is received from the remote peer. /// /// @copydetails returned PN_CPP_EXTERN returned connect(const std::string& conn_url, const connection_options& conn_opts); /// @copybrief connect() /// /// @copydetails returned PN_CPP_EXTERN returned connect(const std::string& conn_url); /// Listen for new connections on `listen_url`. /// /// If the listener opens successfully, listen_handler::on_open() is called. /// If it fails to open, listen_handler::on_error() then listen_handler::close() /// are called. /// /// listen_handler::on_accept() is called for each incoming connection to determine /// the @ref connection_options to use, including the @ref messaging_handler. /// /// **Thread safety** - Calls to `listen_handler` methods are serialized for /// this listener, but handlers attached to separate listeners may be called /// concurrently. PN_CPP_EXTERN listener listen(const std::string& listen_url, listen_handler& handler); /// @copybrief listen /// /// Use a fixed set of options for all accepted connections. See /// listen(const std::string&, listen_handler&). /// /// **Thread safety** - for multi-threaded applications we recommend using a /// @ref listen_handler to create a new @ref messaging_handler for each connection. /// See listen(const std::string&, listen_handler&) and @ref mt_page PN_CPP_EXTERN listener listen(const std::string& listen_url, const connection_options& conn_opts); /// @copybrief listen /// /// New connections will use the handler from /// `server_connection_options()`. See listen(const std::string&, const /// connection_options&); PN_CPP_EXTERN listener listen(const std::string& listen_url); /// Run the container in the current thread. /// /// The call returns when the container stops. See `auto_stop()` /// and `stop()`. /// /// **C++ versions** - With C++11 or later, you can call `run()` /// in multiple threads to create a thread pool. See also /// `run(int count)`. PN_CPP_EXTERN void run(); #if PN_CPP_SUPPORTS_THREADS /// Run the container with a pool of `count` threads, including the current thread. /// /// **C++ versions** - Available with C++11 or later. /// /// The call returns when the container stops. See `auto_stop()` /// and `stop()`. PN_CPP_EXTERN void run(int count); #endif /// Enable or disable automatic container stop. It is enabled by /// default. /// /// If true, the container stops when all active connections and /// listeners are closed. If false, the container keeps running /// until `stop()` is called. PN_CPP_EXTERN void auto_stop(bool enabled); /// Stop the container with error condition `err`. /// /// @copydetails stop() PN_CPP_EXTERN void stop(const error_condition& err); /// Stop the container with an empty error condition. /// /// This function initiates shutdown and immediately returns. The /// shutdown process has the following steps. /// /// - Abort all open connections and listeners. /// - Process final handler events and queued work. /// - If `!err.empty()`, fire `messaging_handler::on_transport_error`. /// /// When the process is complete, `run()` returns in all threads. /// /// **Thread safety** - It is safe to call this method in any thread. PN_CPP_EXTERN void stop(); /// Open a connection and sender for `addr_url`. /// /// @copydetails returned PN_CPP_EXTERN returned open_sender(const std::string& addr_url); /// Open a connection and sender for `addr_url`. /// /// Supplied sender options will override the container's /// template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_sender(const std::string& addr_url, const proton::sender_options& snd_opts); /// Open a connection and sender for `addr_url`. /// /// Supplied connection options will override the /// container's template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_sender(const std::string& addr_url, const connection_options& conn_opts); /// Open a connection and sender for `addr_url`. /// /// Supplied sender or connection options will override the /// container's template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_sender(const std::string& addr_url, const proton::sender_options& snd_opts, const connection_options& conn_opts); /// Open a connection and receiver for `addr_url`. /// /// @copydetails returned PN_CPP_EXTERN returned open_receiver(const std::string& addr_url); /// Open a connection and receiver for `addr_url`. /// /// Supplied receiver options will override the container's /// template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_receiver(const std::string& addr_url, const proton::receiver_options& rcv_opts); /// Open a connection and receiver for `addr_url`. /// /// Supplied receiver or connection options will override the /// container's template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_receiver(const std::string& addr_url, const connection_options& conn_opts); /// Open a connection and receiver for `addr_url`. /// /// Supplied receiver or connection options will override the /// container's template options. /// /// @copydetails returned PN_CPP_EXTERN returned open_receiver(const std::string& addr_url, const proton::receiver_options& rcv_opts, const connection_options& conn_opts); /// A unique identifier for the container. PN_CPP_EXTERN std::string id() const; /// Connection options applied to outgoing connections. These are /// applied first and then overridden by any options provided in /// `connect()` or `messaging_handler::on_connection_open()`. PN_CPP_EXTERN void client_connection_options(const connection_options& conn_opts); /// @copydoc client_connection_options PN_CPP_EXTERN connection_options client_connection_options() const; /// Connection options applied to incoming connections. These are /// applied first and then overridden by any options provided in /// `listen()`, `listen_handler::on_accept()`, or /// `messaging_handler::on_connection_open()`. PN_CPP_EXTERN void server_connection_options(const connection_options& conn_opts); /// @copydoc server_connection_options PN_CPP_EXTERN connection_options server_connection_options() const; /// Sender options applied to senders created by this /// container. They are applied before /// `messaging_handler::on_sender_open()` and can be overridden. PN_CPP_EXTERN void sender_options(const class sender_options& snd_opts); /// @copydoc sender_options PN_CPP_EXTERN class sender_options sender_options() const; /// Receiver options applied to receivers created by this /// container. They are applied before /// `messaging_handler::on_receiver_open()` and can be overridden. PN_CPP_EXTERN void receiver_options(const class receiver_options& rcv_opts); /// @copydoc receiver_options PN_CPP_EXTERN class receiver_options receiver_options() const; /// Schedule `fn` for execution after a duration. The piece of /// work can be created from a function object. /// /// **C++ versions** - With C++11 and later, use a /// `std::function` type for the `fn` parameter. PN_CPP_EXTERN void schedule(duration dur, work fn); /// **Deprecated** - Use `container::schedule(duration, work)`. PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn); /// @cond INTERNAL // This is a hack to ensure that the C++03 version is declared // only during the compilation of the library #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS) PN_CPP_EXTERN void schedule(duration dur, internal::v03::work fn); #endif /// @endcond private: class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class connection_options; friend class session_options; friend class receiver_options; friend class sender_options; friend class work_queue; /// @endcond }; } // proton #endif // PROTON_CONTAINER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/connection_options.hpp0000664000000000000000000001420013257152177024455 0ustar #ifndef PROTON_CONNECTION_OPTIONS_H #define PROTON_CONNECTION_OPTIONS_H /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./duration.hpp" #include "./fwd.hpp" #include "./internal/config.hpp" #include "./internal/export.hpp" #include "./internal/pn_unique_ptr.hpp" #include "./types_fwd.hpp" #include #include #include /// @file /// @copybrief proton::connection_options struct pn_connection_t; struct pn_transport_t; namespace proton { /// Options for creating a connection. /// /// Options can be "chained" like this: /// /// @code /// c = container.connect(url, connection_options().handler(h).max_frame_size(1234)); /// @endcode /// /// You can also create an options object with common settings and use /// it as a base for different connections that have mostly the same /// settings: /// /// @code /// connection_options opts; /// opts.idle_timeout(1000).max_frame_size(10000); /// c1 = container.connect(url1, opts.handler(h1)); /// c2 = container.connect(url2, opts.handler(h2)); /// @endcode /// /// Normal value semantics: copy or assign creates a separate copy of /// the options. class connection_options { public: /// Create an empty set of options. PN_CPP_EXTERN connection_options(); /// Shorthand for `connection_options().handler(h)`. PN_CPP_EXTERN connection_options(class messaging_handler& h); /// Copy options. PN_CPP_EXTERN connection_options(const connection_options&); PN_CPP_EXTERN ~connection_options(); /// Copy options. PN_CPP_EXTERN connection_options& operator=(const connection_options&); // XXX add C++11 move operations - Still relevant, and applies to all options /// Set a connection handler. /// /// The handler must not be deleted until /// messaging_handler::on_transport_close() is called. PN_CPP_EXTERN connection_options& handler(class messaging_handler&); /// Set the maximum frame size. It is unlimited by default. PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max); /// Set the maximum number of open sessions. The default is 32767. PN_CPP_EXTERN connection_options& max_sessions(uint16_t max); /// Set the idle timeout. The default is no timeout. /// /// If set, the local peer will disconnect if it receives no AMQP /// frames for an interval longer than `duration`. Also known as /// "heartbeating", this is a way to detect dead peers even in the /// presence of a live TCP connection. PN_CPP_EXTERN connection_options& idle_timeout(duration); /// Set the container ID. PN_CPP_EXTERN connection_options& container_id(const std::string& id); /// Set the virtual host name for the connection. For client /// connections, it defaults to the host name used to set up the /// connection. For server connections, it is unset by default. /// /// If making a client connection by SSL/TLS, this name is also /// used for certificate verification and Server Name Indication. PN_CPP_EXTERN connection_options& virtual_host(const std::string& name); /// Set the user name used to authenticate the connection. It is /// unset by default. /// /// This value overrides any user name that is specified in the /// URL used for `container::connect`. It is ignored if the /// connection is created by `container::listen` because a /// listening connection's identity is provided by the remote /// client. PN_CPP_EXTERN connection_options& user(const std::string&); /// Set the password used to authenticate the connection. /// /// This value is ignored if the connection is created by /// `container::listen`. PN_CPP_EXTERN connection_options& password(const std::string&); /// Set SSL client options. PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options&); /// Set SSL server options. PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options&); /// Enable or disable SASL. PN_CPP_EXTERN connection_options& sasl_enabled(bool); /// Force the enabling of SASL mechanisms that disclose cleartext /// passwords over the connection. By default, such mechanisms /// are disabled. PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool); /// Specify the allowed mechanisms for use on the connection. PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string&); /// **Unsettled API** - Set the SASL configuration name. PN_CPP_EXTERN connection_options& sasl_config_name(const std::string&); /// **Unsettled API** - Set the SASL configuration path. PN_CPP_EXTERN connection_options& sasl_config_path(const std::string&); /// **Unsettled API** - Set reconnect and failover options. PN_CPP_EXTERN connection_options& reconnect(const reconnect_options &); /// Update option values from values set in other. PN_CPP_EXTERN connection_options& update(const connection_options& other); private: void apply_unbound(connection&) const; void apply_unbound_client(pn_transport_t*) const; void apply_unbound_server(pn_transport_t*) const; messaging_handler* handler() const; class impl; internal::pn_unique_ptr impl_; /// @cond INTERNAL friend class container; friend class io::connection_driver; friend class connection; /// @endcond }; } // proton #endif // PROTON_CONNECTION_OPTIONS_H qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/connection.hpp0000664000000000000000000001320613257152177022707 0ustar #ifndef PROTON_CONNECTION_HPP #define PROTON_CONNECTION_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./fwd.hpp" #include "./internal/export.hpp" #include "./internal/object.hpp" #include "./endpoint.hpp" #include "./session.hpp" #include #include /// @file /// @copybrief proton::connection struct pn_connection_t; namespace proton { /// A connection to a remote AMQP peer. class PN_CPP_CLASS_EXTERN connection : public internal::object, public endpoint { /// @cond INTERNAL PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object(c) {} /// @endcond public: /// Create an empty connection. connection() : internal::object(0) {} PN_CPP_EXTERN bool uninitialized() const; PN_CPP_EXTERN bool active() const; PN_CPP_EXTERN bool closed() const; PN_CPP_EXTERN class error_condition error() const; /// Get the container. /// /// @throw proton::error if this connection is not managed by a /// container PN_CPP_EXTERN class container& container() const; /// Get the work_queue for the connection. PN_CPP_EXTERN class work_queue& work_queue() const; /// Get the transport for the connection. PN_CPP_EXTERN class transport transport() const; /// Return the AMQP hostname attribute for the connection. PN_CPP_EXTERN std::string virtual_host() const; /// Return the container ID for the connection. PN_CPP_EXTERN std::string container_id() const; /// Return authenticated user for the connection /// Note: The value returned is not stable until the on_transport_open event is received PN_CPP_EXTERN std::string user() const; /// Open the connection. /// /// @see endpoint_lifecycle PN_CPP_EXTERN void open(); /// @copydoc open PN_CPP_EXTERN void open(const connection_options&); PN_CPP_EXTERN void close(); PN_CPP_EXTERN void close(const error_condition&); /// Open a new session. PN_CPP_EXTERN session open_session(); /// @copydoc open_session PN_CPP_EXTERN session open_session(const session_options&); /// Get the default session. A default session is created on the /// first call and reused for the lifetime of the connection. PN_CPP_EXTERN session default_session(); /// Open a sender for `addr` on default_session(). PN_CPP_EXTERN sender open_sender(const std::string& addr); /// @copydoc open_sender PN_CPP_EXTERN sender open_sender(const std::string& addr, const sender_options&); /// Open a receiver for `addr` on default_session(). PN_CPP_EXTERN receiver open_receiver(const std::string& addr); /// @copydoc open_receiver PN_CPP_EXTERN receiver open_receiver(const std::string& addr, const receiver_options&); /// @see proton::container::sender_options() PN_CPP_EXTERN class sender_options sender_options() const; /// @see container::receiver_options() PN_CPP_EXTERN class receiver_options receiver_options() const; /// Return all sessions on this connection. PN_CPP_EXTERN session_range sessions() const; /// Return all receivers on this connection. PN_CPP_EXTERN receiver_range receivers() const; /// Return all senders on this connection. PN_CPP_EXTERN sender_range senders() const; /// Get the maximum frame size allowed by the remote peer. /// /// @see @ref connection_options::max_frame_size PN_CPP_EXTERN uint32_t max_frame_size() const; /// Get the maximum number of open sessions allowed by the remote /// peer. /// /// @see @ref connection_options::max_sessions PN_CPP_EXTERN uint16_t max_sessions() const; /// Get the idle timeout set by the remote peer. /// /// @see @ref connection_options::idle_timeout PN_CPP_EXTERN uint32_t idle_timeout() const; /// **Unsettled API** - Trigger an event from another thread. /// /// This method can be called from any thread. The Proton library /// will call `messaging_handler::on_connection_wake()` as soon as /// possible in the correct event-handling thread. /// /// **Thread-safety** - This is the *only* `proton::connection` /// function that can be called from outside the handler thread. /// /// @note Spurious `messaging_handler::on_connection_wake()` calls /// can occur even if the application does not call `wake()`. /// /// @note Multiple calls to `wake()` may be coalesced into a /// single call to `messaging_handler::on_connection_wake()` that /// occurs after all of them. /// /// The `proton::work_queue` interface provides an easier way /// execute code safely in the event-handler thread. PN_CPP_EXTERN void wake() const; /// @cond INTERNAL friend class internal::factory; friend class container; /// @endcond }; } // proton #endif // PROTON_CONNECTION_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/0000775000000000000000000000000013257152177021112 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/vector.hpp0000664000000000000000000000451613257152177023133 0ustar #ifndef PROTON_CODEC_VECTOR_HPP #define PROTON_CODEC_VECTOR_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::vector`. #include "./encoder.hpp" #include "./decoder.hpp" #include #include namespace proton { namespace codec { /// Encode std::vector as amqp::ARRAY (same type elements) template encoder& operator<<(encoder& e, const std::vector& x) { return e << encoder::array(x, internal::type_id_of::value); } /// Encode std::vector encode as amqp::LIST (mixed type elements) template encoder& operator<<(encoder& e, const std::vector& x) { return e << encoder::list(x); } /// Encode std::vector as amqp::LIST (mixed type elements) template encoder& operator<<(encoder& e, const std::vector& x) { return e << encoder::list(x); } /// Encode std::deque > as amqp::MAP, preserves order of entries. template encoder& operator<<(encoder& e, const std::vector, A>& x) { return e << encoder::map(x); } /// Decode to std::vector from an amqp::LIST or amqp::ARRAY. template decoder& operator>>(decoder& d, std::vector& x) { return d >> decoder::sequence(x); } /// Decode to std::vector from an amqp::MAP. template decoder& operator>>(decoder& d, std::vector , A>& x) { return d >> decoder::pair_sequence(x); } } // codec } // proton #endif // PROTON_CODEC_VECTOR_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp0000664000000000000000000000311313257152177024445 0ustar #ifndef PROTON_CODEC_UNORDERED_MAP_HPP #define PROTON_CODEC_UNORDERED_MAP_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::unordered_map`. #include "./encoder.hpp" #include "./decoder.hpp" #include namespace proton { namespace codec { /// Encode std::unordered_map as amqp::UNORDERED_MAP. template encoder& operator<<(encoder& e, const std::unordered_map& m) { return e << encoder::map(m); } /// Decode to std::unordered_map from amqp::UNORDERED_MAP. template decoder& operator>>(decoder& d, std::unordered_map& m) { return d >> decoder::associative(m); } } // codec } // proton #endif // PROTON_CODEC_UNORDERED_MAP_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/map.hpp0000664000000000000000000000273513257152177022407 0ustar #ifndef PROTON_CODEC_MAP_HPP #define PROTON_CODEC_MAP_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::map`. #include "./encoder.hpp" #include "./decoder.hpp" #include namespace proton { namespace codec { /// Encode std::map as amqp::MAP. template encoder& operator<<(encoder& e, const std::map& m) { return e << encoder::map(m); } /// Decode to std::map from amqp::MAP. template decoder& operator>>(decoder& d, std::map& m) { return d >> decoder::associative(m); } } // codec } // proton #endif // PROTON_CODEC_MAP_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/list.hpp0000664000000000000000000000454313257152177022604 0ustar #ifndef PROTON_CODEC_LIST_HPP #define PROTON_CODEC_LIST_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::list`. #include "./encoder.hpp" #include "./decoder.hpp" #include #include namespace proton { namespace codec { /// std::list for most T is encoded as an AMQP array. template encoder& operator<<(encoder& e, const std::list& x) { return e << encoder::array(x, internal::type_id_of::value); } /// Specialize for std::list, encode as AMQP list (variable type) template encoder& operator<<(encoder& e, const std::list& x) { return e << encoder::list(x); } /// Specialize for std::list, encode as AMQP list (variable type) template encoder& operator<<(encoder& e, const std::list& x) { return e << encoder::list(x); } /// Specialize for std::list >, encode as AMQP map. /// Allows control over the order of encoding map entries. template encoder& operator<<(encoder& e, const std::list, A>& x) { return e << encoder::map(x); } /// Decode to std::list from an amqp::LIST or amqp::ARRAY. template decoder& operator>>(decoder& d, std::list& x) { return d >> decoder::sequence(x); } /// Decode to std::list from an amqp::MAP. template decoder& operator>>(decoder& d, std::list , A>& x) { return d >> decoder::pair_sequence(x); } } // codec } // proton #endif // PROTON_CODEC_LIST_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp0000664000000000000000000000475513257152177024335 0ustar #ifndef PROTON_CODEC_FORWARD_LIST_HPP #define PROTON_CODEC_FORWARD_LIST_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::forward_list`. #include "./encoder.hpp" #include "./decoder.hpp" #include #include namespace proton { namespace codec { /// std::forward_list for most T is encoded as an AMQP array. template encoder& operator<<(encoder& e, const std::forward_list& x) { return e << encoder::array(x, internal::type_id_of::value); } /// Specialize for std::forward_list, encode as AMQP forward_list (variable type) template encoder& operator<<(encoder& e, const std::forward_list& x) { return e << encoder::list(x); } /// Specialize for std::forward_list, encode as AMQP list (variable type) template encoder& operator<<(encoder& e, const std::forward_list& x) { return e << encoder::list(x); } /// Specialize for std::forward_list >, encode as AMQP map. /// Allows control over the order of encoding map entries. template encoder& operator<<(encoder& e, const std::forward_list, A>& x) { return e << encoder::map(x); } /// Decode to std::forward_list from an amqp::LIST or amqp::ARRAY. template decoder& operator>>(decoder& d, std::forward_list& x) { return d >> decoder::sequence(x); } /// Decode to std::forward_list from an amqp::MAP. template decoder& operator>>(decoder& d, std::forward_list , A>& x) { return d >> decoder::pair_sequence(x); } } // codec } // proton #endif // PROTON_CODEC_FORWARD_LIST_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/encoder.hpp0000664000000000000000000001643713257152177023255 0ustar #ifndef PROTON_CODEC_ENCODER_HPP #define PROTON_CODEC_ENCODER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "../internal/data.hpp" #include "../internal/type_traits.hpp" #include "../types_fwd.hpp" #include "./common.hpp" #include /// @file /// @copybrief proton::codec::encoder namespace proton { class scalar_base; namespace internal{ class value_base; } namespace codec { /// **Unsettled API** - A stream-like encoder from C++ values to AMQP /// bytes. /// /// For internal use only. /// /// @see @ref types_page for the recommended ways to manage AMQP data class encoder : public internal::data { public: /// Wrap Proton-C data object. explicit encoder(const data& d) : data(d) {} /// Encoder into v. Clears any current value in v. PN_CPP_EXTERN explicit encoder(internal::value_base& v); /// Encode the current values into buffer and update size to reflect the /// number of bytes encoded. /// /// Clears the encoder. /// /// @return if buffer == 0 or size is too small, then return false /// and size to the required size. Otherwise, return true and set /// size to the number of bytes encoded. PN_CPP_EXTERN bool encode(char* buffer, size_t& size); /// Encode the current values into a std::string and resize the /// string if necessary. Clears the encoder. PN_CPP_EXTERN void encode(std::string&); /// Encode the current values into a std::string. Clears the /// encoder. PN_CPP_EXTERN std::string encode(); /// @name Insert built-in types /// @{ PN_CPP_EXTERN encoder& operator<<(bool); PN_CPP_EXTERN encoder& operator<<(uint8_t); PN_CPP_EXTERN encoder& operator<<(int8_t); PN_CPP_EXTERN encoder& operator<<(uint16_t); PN_CPP_EXTERN encoder& operator<<(int16_t); PN_CPP_EXTERN encoder& operator<<(uint32_t); PN_CPP_EXTERN encoder& operator<<(int32_t); PN_CPP_EXTERN encoder& operator<<(wchar_t); PN_CPP_EXTERN encoder& operator<<(uint64_t); PN_CPP_EXTERN encoder& operator<<(int64_t); PN_CPP_EXTERN encoder& operator<<(timestamp); PN_CPP_EXTERN encoder& operator<<(float); PN_CPP_EXTERN encoder& operator<<(double); PN_CPP_EXTERN encoder& operator<<(decimal32); PN_CPP_EXTERN encoder& operator<<(decimal64); PN_CPP_EXTERN encoder& operator<<(decimal128); PN_CPP_EXTERN encoder& operator<<(const uuid&); PN_CPP_EXTERN encoder& operator<<(const std::string&); PN_CPP_EXTERN encoder& operator<<(const symbol&); PN_CPP_EXTERN encoder& operator<<(const binary&); PN_CPP_EXTERN encoder& operator<<(const scalar_base&); PN_CPP_EXTERN encoder& operator<<(const null&); /// @} /// Insert a proton::value. /// /// @internal NOTE insert value_base, not value to avoid recursive /// implicit conversions. PN_CPP_EXTERN encoder& operator<<(const internal::value_base&); /// Start a complex type PN_CPP_EXTERN encoder& operator<<(const start&); /// Finish a complex type PN_CPP_EXTERN encoder& operator<<(const finish&); /// @cond INTERNAL // Undefined template to prevent pointers being implicitly converted to bool. template void* operator<<(const T*); template struct list_cref { T& ref; list_cref(T& r) : ref(r) {} }; template struct map_cref { T& ref; map_cref(T& r) : ref(r) {} }; template struct array_cref { start array_start; T& ref; array_cref(T& r, type_id el, bool described) : array_start(ARRAY, el, described), ref(r) {} }; template static list_cref list(T& x) { return list_cref(x); } template static map_cref map(T& x) { return map_cref(x); } template static array_cref array(T& x, type_id element, bool described=false) { return array_cref(x, element, described); } template encoder& operator<<(const map_cref& x) { internal::state_guard sg(*this); *this << start::map(); for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i) *this << i->first << i->second; *this << finish(); return *this; } template encoder& operator<<(const list_cref& x) { internal::state_guard sg(*this); *this << start::list(); for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i) *this << *i; *this << finish(); return *this; } template encoder& operator<<(const array_cref& x) { internal::state_guard sg(*this); *this << x.array_start; for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i) *this << *i; *this << finish(); return *this; } /// @endcond private: template encoder& insert(const T& x, int (*put)(pn_data_t*, U)); void check(long result); }; /// Treat char* as string inline encoder& operator<<(encoder& e, const char* s) { return e << std::string(s); } /// operator << for integer types that are not covered by the standard overrides. template typename internal::enable_if::value, encoder&>::type operator<<(encoder& e, T i) { using namespace internal; return e << static_cast::value>::type>(i); } /// @cond INTERNAL namespace is_encodable_impl { // Protect the world from fallback operator<< using namespace internal; sfinae::no operator<<(encoder const&, const sfinae::any_t &); // Fallback template struct is_encodable : public sfinae { static yes test(encoder&); static no test(...); // Failed test, no match. static encoder* e; static const T* t; static bool const value = sizeof(test(*e << *t)) == sizeof(yes); }; // Avoid recursion template <> struct is_encodable : public true_type {}; } // is_encodable_impl using is_encodable_impl::is_encodable; // Metafunction to test if a class looks like an encodable map from K to T. template struct is_encodable_map : public internal::false_type {}; template struct is_encodable_map< M, K, T, typename internal::enable_if< internal::is_same::value && internal::is_same::value && is_encodable::value >::type > : public internal::true_type {}; /// @endcond } // codec } // proton #endif /// PROTON_CODEC_ENCODER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/deque.hpp0000664000000000000000000000457213257152177022736 0ustar #ifndef PROTON_CODEC_DEQUE_HPP #define PROTON_CODEC_DEQUE_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// @file /// **Unsettled API** - Enable conversions between `proton::value` and `std::deque`. #include "./encoder.hpp" #include "./decoder.hpp" #include #include namespace proton { namespace codec { /// std::deque for most T is encoded as an amqp::ARRAY (same type elements) template encoder& operator<<(encoder& e, const std::deque& x) { return e << encoder::array(x, internal::type_id_of::value); } /// std::deque encodes as codec::list_type (mixed type elements) template encoder& operator<<(encoder& e, const std::deque& x) { return e << encoder::list(x); } /// std::deque encodes as codec::list_type (mixed type elements) template encoder& operator<<(encoder& e, const std::deque& x) { return e << encoder::list(x); } /// std::deque > encodes as codec::map_type. /// Map entries are encoded in order they appear in the list. template encoder& operator<<(encoder& e, const std::deque, A>& x) { return e << encoder::map(x); } /// Decode to std::deque from an amqp::LIST or amqp::ARRAY. template decoder& operator>>(decoder& d, std::deque& x) { return d >> decoder::sequence(x); } /// Decode to std::deque from an amqp::MAP. template decoder& operator>>(decoder& d, std::deque , A>& x) { return d >> decoder::pair_sequence(x); } } // codec } // proton #endif // PROTON_CODEC_DEQUE_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/decoder.hpp0000664000000000000000000001677113257152177023244 0ustar #ifndef PROTON_CODEC_DECODER_HPP #define PROTON_CODEC_DECODER_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "../internal/data.hpp" #include "../internal/type_traits.hpp" #include "../types_fwd.hpp" #include "./common.hpp" #include #include /// @file /// @copybrief proton::codec::decoder namespace proton { class annotation_key; class message_id; class scalar; class value; namespace internal { class value_base; } namespace codec { /// **Unsettled API** - A stream-like decoder from AMQP bytes to C++ /// values. /// /// For internal use only. /// /// @see @ref types_page for the recommended ways to manage AMQP data class decoder : public internal::data { public: /// Wrap a Proton C data object. The exact flag if set means /// decode only when there is an exact match between the AMQP and /// C++ type. If not set then perform automatic conversions. explicit decoder(const data& d, bool exact=false) : data(d), exact_(exact) {} /// Attach decoder to a proton::value. The decoder is rewound to /// the start of the data. PN_CPP_EXTERN explicit decoder(const internal::value_base&, bool exact=false); /// Decode AMQP data from a buffer and add it to the end of the /// decoders stream. PN_CPP_EXTERN void decode(const char* buffer, size_t size); /// Decode AMQP data from a std::string and add it to the end of /// the decoders stream. PN_CPP_EXTERN void decode(const std::string&); /// Return true if there are more value to extract at the current level. PN_CPP_EXTERN bool more(); /// Get the type of the next value that will be read by /// operator>>. /// /// @throw conversion_error if no more values. @see /// decoder::more(). PN_CPP_EXTERN type_id next_type(); /// @name Extract built-in types /// /// @throw conversion_error if the decoder is empty or has an /// incompatible type. /// /// @{ PN_CPP_EXTERN decoder& operator>>(bool&); PN_CPP_EXTERN decoder& operator>>(uint8_t&); PN_CPP_EXTERN decoder& operator>>(int8_t&); PN_CPP_EXTERN decoder& operator>>(uint16_t&); PN_CPP_EXTERN decoder& operator>>(int16_t&); PN_CPP_EXTERN decoder& operator>>(uint32_t&); PN_CPP_EXTERN decoder& operator>>(int32_t&); PN_CPP_EXTERN decoder& operator>>(wchar_t&); PN_CPP_EXTERN decoder& operator>>(uint64_t&); PN_CPP_EXTERN decoder& operator>>(int64_t&); PN_CPP_EXTERN decoder& operator>>(timestamp&); PN_CPP_EXTERN decoder& operator>>(float&); PN_CPP_EXTERN decoder& operator>>(double&); PN_CPP_EXTERN decoder& operator>>(decimal32&); PN_CPP_EXTERN decoder& operator>>(decimal64&); PN_CPP_EXTERN decoder& operator>>(decimal128&); PN_CPP_EXTERN decoder& operator>>(uuid&); PN_CPP_EXTERN decoder& operator>>(std::string&); PN_CPP_EXTERN decoder& operator>>(symbol&); PN_CPP_EXTERN decoder& operator>>(binary&); PN_CPP_EXTERN decoder& operator>>(message_id&); PN_CPP_EXTERN decoder& operator>>(annotation_key&); PN_CPP_EXTERN decoder& operator>>(scalar&); PN_CPP_EXTERN decoder& operator>>(internal::value_base&); PN_CPP_EXTERN decoder& operator>>(null&); ///@} /// Start decoding a container type, such as an ARRAY, LIST or /// MAP. This "enters" the container, more() will return false at /// the end of the container. Call finish() to "exit" the /// container and move on to the next value. PN_CPP_EXTERN decoder& operator>>(start&); /// Finish decoding a container type, and move on to the next /// value in the stream. PN_CPP_EXTERN decoder& operator>>(const finish&); /// @cond INTERNAL template struct sequence_ref { T& ref; sequence_ref(T& r) : ref(r) {} }; template struct associative_ref { T& ref; associative_ref(T& r) : ref(r) {} }; template struct pair_sequence_ref { T& ref; pair_sequence_ref(T& r) : ref(r) {} }; template static sequence_ref sequence(T& x) { return sequence_ref(x); } template static associative_ref associative(T& x) { return associative_ref(x); } template static pair_sequence_ref pair_sequence(T& x) { return pair_sequence_ref(x); } /// @endcond /// Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++ /// sequence container of T if the elements types are convertible /// to T. A MAP is extracted as `[key1, value1, key2, value2...]`. template decoder& operator>>(sequence_ref r) { start s; *this >> s; if (s.is_described) next(); r.ref.resize(s.size); for (typename T::iterator i = r.ref.begin(); i != r.ref.end(); ++i) *this >> *i; return *this; } /// Extract an AMQP MAP to a C++ associative container template decoder& operator>>(associative_ref r) { using namespace internal; start s; *this >> s; assert_type_equal(MAP, s.type); r.ref.clear(); for (size_t i = 0; i < s.size/2; ++i) { typename remove_const::type k; typename remove_const::type v; *this >> k >> v; r.ref[k] = v; } return *this; } /// Extract an AMQP MAP to a C++ push_back sequence of pairs /// preserving encoded order. template decoder& operator>>(pair_sequence_ref r) { using namespace internal; start s; *this >> s; assert_type_equal(MAP, s.type); r.ref.clear(); for (size_t i = 0; i < s.size/2; ++i) { typedef typename T::value_type value_type; typename remove_const::type k; typename remove_const::type v; *this >> k >> v; r.ref.push_back(value_type(k, v)); } return *this; } private: type_id pre_get(); template decoder& extract(T& x, U (*get)(pn_data_t*)); bool exact_; friend class message; }; /// @cond INTERNAL /// XXX Document this template T get(decoder& d) { assert_type_equal(internal::type_id_of::value, d.next_type()); T x; d >> x; return x; } /// @endcond /// operator>> for integer types that are not covered by the standard /// overrides. template typename internal::enable_if::value, decoder&>::type operator>>(decoder& d, T& i) { using namespace internal; typename integer_type::value>::type v; d >> v; // Extract as a known integer type i = v; // C++ conversion to the target type. return d; } } // codec } // proton #endif // PROTON_CODEC_DECODER_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/codec/common.hpp0000664000000000000000000000412213257152177023112 0ustar #ifndef PROTON_CODEC_COMMON_HPP #define PROTON_CODEC_COMMON_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "../type_id.hpp" /// @file /// **Unsettled API** - Shared codec functions. namespace proton { namespace codec { /// **Unsettled API** - Start encoding a complex type. struct start { /// @cond INTERNAL /// XXX Document start(type_id type_=NULL_TYPE, type_id element_=NULL_TYPE, bool described_=false, size_t size_=0) : type(type_), element(element_), is_described(described_), size(size_) {} type_id type; ///< The container type: ARRAY, LIST, MAP or DESCRIBED. type_id element; ///< the element type for array only. bool is_described; ///< true if first value is a descriptor. size_t size; ///< the element count excluding the descriptor (if any) /// @endcond /// @cond INTERNAL /// XXX Document static start array(type_id element, bool described=false) { return start(ARRAY, element, described); } static start list() { return start(LIST); } static start map() { return start(MAP); } static start described() { return start(DESCRIBED, NULL_TYPE, true); } /// @endcond }; /// **Unsettled API** - Finish inserting or extracting a complex type. struct finish {}; } // codec } // proton #endif // PROTON_CODEC_COMMON_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/byte_array.hpp0000664000000000000000000000644013257152177022713 0ustar #ifndef PROTON_BYTE_ARRAY_HPP #define PROTON_BYTE_ARRAY_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "./internal/export.hpp" #include "./internal/comparable.hpp" #include "./types_fwd.hpp" #include #include #include /// @file /// @copybrief proton::byte_array namespace proton { namespace internal { PN_CPP_EXTERN void print_hex(std::ostream& o, const uint8_t* p, size_t n); } /// Arbitrary fixed-size data. /// /// Used to represent fixed-sized data types that don't have a natural /// C++ representation as an array of bytes. template class byte_array : private internal::comparable > { public: /// @name Sequence container typedefs /// @{ typedef uint8_t value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef value_type* iterator; typedef const value_type* const_iterator; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; /// @} /// Zero-initialized byte array byte_array() { std::fill(bytes_, bytes_+N, '\0'); } /// Size of the array static size_t size() { return N; } /// @name Array operators /// @{ value_type* begin() { return bytes_; } value_type* end() { return bytes_+N; } value_type& operator[](size_t i) { return bytes_[i]; } const value_type* begin() const { return bytes_; } const value_type* end() const { return bytes_+N; } const value_type& operator[](size_t i) const { return bytes_[i]; } /// @} /// @name Comparison operators /// @{ friend bool operator==(const byte_array& x, const byte_array& y) { return std::equal(x.begin(), x.end(), y.begin()); } friend bool operator<(const byte_array& x, const byte_array& y) { return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } /// @} /// Print byte array in hex friend std::ostream& operator<<(std::ostream& o, const byte_array& b) { internal::print_hex(o, b.begin(), b.size()); return o; } private: value_type bytes_[N]; }; } // proton #endif // PROTON_BYTE_ARRAY_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/binary.hpp0000664000000000000000000000363413257152177022040 0ustar #ifndef PROTON_BINARY_HPP #define PROTON_BINARY_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./internal/export.hpp" #include "./types_fwd.hpp" #include #include #include #include /// @file /// @copybrief proton::binary namespace proton { /// Arbitrary binary data. class binary : public std::vector { public: /// @name Constructors /// @{ explicit binary() : std::vector() {} explicit binary(size_t n) : std::vector(n) {} explicit binary(size_t n, value_type x) : std::vector(n, x) {} explicit binary(const std::string& s) : std::vector(s.begin(), s.end()) {} template binary(Iter first, Iter last) : std::vector(first, last) {} /// @} /// Convert to std::string operator std::string() const { return std::string(begin(), end()); } /// Assignment binary& operator=(const std::string& x) { assign(x.begin(), x.end()); return *this; } }; /// Print a binary value PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const binary&); } // proton #endif // PROTON_BINARY_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/include/proton/annotation_key.hpp0000664000000000000000000000532513257152177023575 0ustar #ifndef PROTON_ANNOTATION_KEY_HPP #define PROTON_ANNOTATION_KEY_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "./scalar_base.hpp" #include "./symbol.hpp" #include /// @file /// @copybrief proton::annotation_key namespace proton { /// A key for use with AMQP annotation maps. /// /// An annotation_key can contain either a uint64_t or a proton::symbol. class annotation_key : public scalar_base { public: /// An empty annotation key. annotation_key() {} /// Construct from any type that can be assigned. template annotation_key(const T& x) { *this = x; } /// @name Assign from a uint64_t or symbol. /// @{ annotation_key& operator=(uint64_t x) { put_(x); return *this; } annotation_key& operator=(const symbol& x) { put_(x); return *this; } /// @} /// @name Extra conversions for strings, treated as codec::SYMBOL. /// @{ annotation_key& operator=(const std::string& x) { put_(symbol(x)); return *this; } annotation_key& operator=(const char *x) { put_(symbol(x)); return *this; } /// @} /// @cond INTERNAL friend class message; friend class codec::decoder; /// @endcond }; /// @cond INTERNAL /// Primary template for get(message_id), specialized for legal types. template T get(const annotation_key& x); /// @endcond /// Get the uint64_t value or throw conversion_error. /// /// @relatedalso annotation_key template<> inline uint64_t get(const annotation_key& x) { return internal::get(x); } /// Get the @ref symbol value or throw conversion_error. /// /// @relatedalso annotation_key template<> inline symbol get(const annotation_key& x) { return internal::get(x); } /// Get the @ref binary value or throw conversion_error. /// /// @copydoc scalar::coerce /// @relatedalso annotation_key template T coerce(const annotation_key& x) { return internal::coerce(x); } } // proton #endif // PROTON_ANNOTATION_KEY_HPP qpid-proton-0.22.0/proton-c/bindings/cpp/docs/0000775000000000000000000000000013257152177016021 5ustar qpid-proton-0.22.0/proton-c/bindings/cpp/docs/user.doxygen.in0000664000000000000000000000634513257152177021013 0ustar ## ## Licensed to the Apache Software Foundation (ASF) under one ## or more contributor license agreements. See the NOTICE file ## distributed with this work for additional information ## regarding copyright ownership. The ASF licenses this file ## to you under the Apache License, Version 2.0 (the ## "License"); you may not use this file except in compliance ## with the License. You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, ## software distributed under the License is distributed on an ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ## KIND, either express or implied. See the License for the ## specific language governing permissions and limitations ## under the License. ## # Project options PROJECT_NAME = "Qpid Proton C++" PROJECT_NUMBER = @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@ OUTPUT_DIRECTORY = . OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = YES JAVADOC_AUTOBRIEF = YES MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES BUILTIN_STL_SUPPORT = YES INLINE_SIMPLE_STRUCTS = YES HIDE_UNDOC_CLASSES = YES HIDE_COMPOUND_REFERENCE = YES HIDE_SCOPE_NAMES = YES MAX_INITIALIZER_LINES = 0 ALPHABETICAL_INDEX = NO SORT_MEMBER_DOCS = NO # Redefine protected as private and strip out the PN_CPP_EXTERN macro ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES PREDEFINED = protected=private PN_CPP_DEPRECATED(x)= PN_CPP_EXTERN= PN_CPP_OVERRIDE= PN_CPP_HAS_CPP11=1 PN_CPP_HAS_SHARED_PTR=1 PN_CPP_HAS_UNIQUE_PTR=1 PN_CPP_HAS_LONG_LONG=1 PN_CPP_HAS_NULLPTR=1 PN_CPP_HAS_RVALUE_REFERENCES=1 PN_CPP_HAS_OVERRIDE=override PN_CPP_HAS_EXPLICIT_CONVERSIONS=1 PN_CPP_HAS_DEFAULTED_FUNCTIONS=1 PN_CPP_HAS_DELETED_FUNCTIONS=1 PN_CPP_HAS_STD_FUNCTION=1 PN_CPP_HAS_CHRONO=1 PN_CPP_SUPPORTS_THREADS=1 EXCLUDE_SYMBOLS = internal internal::* # Configuration options related to warning and progress messages QUIET = YES WARNINGS = YES # Configuration options related to the input files INPUT = @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/include \ @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/docs \ @CMAKE_SOURCE_DIR@/examples/cpp FILE_PATTERNS = *.hpp *.md *.dox EXCLUDE_PATTERNS = @CMAKE_SOURCE_DIR@/examples/*.?pp \ @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/include/proton/internal/*.hpp FULL_PATH_NAMES = YES RECURSIVE = YES STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/include EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/examples/cpp EXAMPLE_RECURSIVE = YES # View and list options DISABLE_INDEX = YES GENERATE_TREEVIEW = YES GENERATE_TODOLIST = NO GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST = NO # Configuration options related to the output format GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html GENERATE_LATEX = NO qpid-proton-0.22.0/proton-c/bindings/cpp/docs/types.md0000664000000000000000000000740613257152177017516 0ustar # AMQP and C++ types {#types_page} An AMQP message body can hold binary data using any encoding you like. AMQP also defines its own encoding and types. The AMQP encoding is often used in message bodies because it is supported by AMQP libraries on many languages and platforms. You also need to use the AMQP types to set and examine message properties. ## Scalar types Each type is identified by a proton::type_id. C++ type | AMQP type_id | Description --------------------|----------------------|----------------------- bool | proton::BOOLEAN | Boolean true or false uint8_t | proton::UBYTE | 8-bit unsigned byte int8_t | proton::BYTE | 8-bit signed byte uint16_t | proton::USHORT | 16-bit unsigned integer int16_t | proton::SHORT | 16-bit signed integer uint32_t | proton::UINT | 32-bit unsigned integer int32_t | proton::INT | 32-bit signed integer uint64_t | proton::ULONG | 64-bit unsigned integer int64_t | proton::LONG | 64-bit signed integer wchar_t | proton::CHAR | 32-bit unicode code point float | proton::FLOAT | 32-bit binary floating point double | proton::DOUBLE | 64-bit binary floating point proton::timestamp | proton::TIMESTAMP | 64-bit signed milliseconds since 00:00:00 (UTC), 1 January 1970. proton::decimal32 | proton::DECIMAL32 | 32-bit decimal floating point proton::decimal64 | proton::DECIMAL64 | 64-bit decimal floating point proton::decimal128 | proton::DECIMAL128 | 128-bit decimal floating point proton::uuid | proton::UUID | 128-bit universally-unique identifier std::string | proton::STRING | UTF-8 encoded Unicode string proton::symbol | proton::SYMBOL | 7-bit ASCII encoded string proton::binary | proton::BINARY | Variable-length binary data ## Holder types `proton::message::body()` and other message-related data can contain different types of data at runtime. There are two "holder" types provided to hold runtime typed data: - `proton::scalar` can hold a scalar value of any type. - `proton::value` can hold any AMQP value, scalar or compound. You can set the value in a holder by assignment, and use the `proton::get()` and `proton::coerce()` templates to extract data in a type-safe way. Holders also provide functions to query the type of value they contain. ## Compound types C++ type | AMQP type_id | Description --------------------|----------------------|----------------------- See below | proton::ARRAY | Sequence of values of the same type See below | proton::LIST | Sequence of values of mixed types See below | proton::MAP | Map of key-value pairs A `proton::value` containing a `proton::ARRAY` can convert to and from C++ sequences of the corresponding C++ type: `std::vector`, `std::deque`, `std::list`, and `std::forward_list`. `proton::LIST` converts to and from sequences of `proton::value` or `proton::scalar`, which can hold mixed types of data. `proton::MAP` converts to and from `std::map`, `std::unordered_map`, and sequences of `std::pair`. For example, you can decode a message body with any AMQP map as follows. proton::message m = ...; std::map map; proton::get(m.body(), map); You can encode a message body with a map of string keys and `uint64_t` values like this: std::unordered_map map; map["foo"] = 123; m.body() = map; ## Include files `proton/types.hpp` includes all available type definitions and conversions. Alternatively, you can selectively include the `.hpp` files you want. qpid-proton-0.22.0/proton-c/bindings/cpp/docs/overview.md0000664000000000000000000001157213257152177020217 0ustar # Overview {#overview_page} Qpid Proton's concepts and capabilities closely match those of its wire protocol, AMQP. See [the Qpid AMQP page](https://qpid.apache.org/amqp/index.html) and [the AMQP 1.0 spec](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-overview-v1.0-os.html) for more information. ## Key concepts A `proton::message` has a *body* (the main content), application properties where you can store additional data, and specific properties defined by AMQP. Messages are transferred over *links*. The sending end of a link is a `proton::sender`, and the receiving end is a `proton::receiver`. Links have a *source* and *target* address, as explained [below](#sources-and-targets). Links are grouped in a `proton::session`. Messages in the same session are sent sequentially, while those on different sessions can be interleaved. A large message being sent on one session does not block messages being sent on another session. Sessions belong to a `proton::connection`. If you don't need multiple sessions, a connection will create links directly using a default session. A `proton::delivery` represents the transfer of a message and allows the receiver to accept or reject it. The sender can use a `proton::tracker` to track the status of a sent message and find out if it was accepted. A delivery is *settled* when both ends are done with it. Different settlement methods give different levels of reliability: *at-most-once*, *at-least-once*, and *exactly-once*. See [below](#delivery-guarantees). ## The anatomy of a Proton application `proton::container` is the top-level object in a Proton application. A client uses `proton::container::connect()` to establish connections. A server uses `proton::container::listen()` to accept connections. Proton is an event-driven API. You implement a subclass of `proton::messaging_handler` and override functions to handle AMQP events, such as `on_container_open()` or `on_message()`. Each connection is associated with a handler for its events. `proton::container::run()` polls all connections and listeners and dispatches events to your handlers. A message body can be a string or byte sequence encoded any way you like. However, AMQP also provides standard, interoperable encodings for basic data types and structures such as maps and lists. You can use this encoding for your message bodies via `proton::value` and `proton::scalar`, which convert C++ types to their AMQP equivalents. ## Sources and targets Every link has two addresses, *source* and *target*. The most common pattern for using these addresses is as follows. When a client creates a *receiver* link, it sets the *source* address. This means "I want to receive messages from this source". This is often referred to as "subscribing" to the source. When a client creates a *sender* link, it sets the *target* address. This means "I want to send to this target". In the case of a broker, the source or target usually refers to a queue or topic. In general they can refer to any AMQP-capable node. In the *request-response* pattern, a request message carries a *reply-to* address for the response message. This can be any AMQP address, but it is often useful to create a temporary address for the response message. The client creates a *receiver* with no source address and the *dynamic* flag set. The server generates a unique *source* address for the receiver, which is discarded when the link closes. The client uses this source address as the reply-to when it sends the request, so the response is delivered to the client's receiver. The @ref server_direct.cpp example shows how to implement a request-response server. ## Delivery guarantees Proton offers three levels of message delivery guarantee: *at-most-once*, *at-least-once*, and *exactly-once*. For *at-most-once*, the sender settles the message as soon as it sends it. If the connection is lost before the message is received by the receiver, the message will not be delivered. For *at-least-once*, the receiver accepts and settles the message on receipt. If the connection is lost before the sender is informed of the settlement, then the delivery is considered in-doubt and should be retried. This will ensure it eventually gets delivered (provided of course the connection and link can be reestablished). It may mean that it is delivered multiple times, however. Finally, for *exactly-once*, the receiver accepts the message but doesn't settle it. The sender settles once it is aware that the receiver accepted it. In this way the receiver retains knowledge of an accepted message until it is sure the sender knows it has been accepted. If the connection is lost before settlement, the receiver informs the sender of all the unsettled deliveries it knows about, and from this the sender can deduce which need to be redelivered. The sender likewise informs the receiver which deliveries it knows about, from which the receiver can deduce which have already been settled. qpid-proton-0.22.0/proton-c/bindings/cpp/docs/mt.md0000664000000000000000000001203413257152177016763 0ustar # Multithreading {#mt_page} Full multithreading support is available with C++11 and later. Limited multithreading is possible with older versions of C++. See the last section of this page for more information. `proton::container` handles multiple connections concurrently in a thread pool, created using `proton::container::run()`. As AMQP events occur on a connection the container calls `proton::messaging_handler` event callbacks. The calls for each connection are *serialized* - callbacks for the same connection are never made concurrently. You assign a handler to a connection in `proton::container::connect()` or `proton::listen_handler::on_accept()` with `proton::connection_options::handler()`. We recommend you create a separate handler for each connection. That means the handler doesn't need locks or other synchronization to protect it against concurrent use by Proton threads. If you use the handler concurrently from non-Proton threads then you will need synchronization. The examples @ref multithreaded_client.cpp and @ref multithreaded_client_flow_control.cpp illustrate these points. ## Thread-safety rules `proton::container` is thread-safe *with C++11 or greater*. An application thread can open (or listen for) new connections at any time. The container uses threads that call `proton::container::run()` to handle network IO and call user-defined `proton::messaging_handler` callbacks. `proton::container` ensures that calls to event callbacks for each connection instance are *serialized* (not called concurrently), but callbacks for different connections can be safely executed in parallel. `proton::connection` and related objects (`proton::session`, `proton::sender`, `proton::receiver`, `proton::delivery`) are *not* thread-safe and are subject to the following rules. 1. They can only be used from a `proton::messaging_handler` event callback called by Proton or a `proton::work_queue` function (more below). 2. You cannot use objects belonging to one connection from a callback for another connection. We recommend a single handler instance per connection to avoid confusion. 3. You can store Proton objects in member variables for use in a later callback, provided you respect rule two. `proton::message` is a value type with the same threading constraints as a standard C++ built-in type. It cannot be concurrently modified. ## Work queues `proton::work_queue` provides a safe way to communicate between different connection handlers or between non-Proton threads and connection handlers. * Each connection has an associated `proton::work_queue`. * The work queue is thread-safe (C++11 or greater). Any thread can add *work*. * *Work* is a `std::function`, and bound arguments will be called like an event callback. When the work function is called by Proton, it will be serialized safely so that you can treat the work function like an event callback and safely access the handler and Proton objects stored on it. The examples @ref multithreaded_client.cpp and @ref multithreaded_client_flow_control.cpp show how you can send and receive messages from non-Proton threads using work queues. ## The wake primitive `proton::connection::wake()` allows any thread to "wake up" a connection by generating an `on_connection_wake()` callback. This is the *only* thread-safe `proton::connection` function. This is a lightweight, low-level primitive for signaling between threads. * It does not carry any code or data (unlike `proton::work_queue`). * Multiple calls to `wake()` can be "coalesced" into a single `on_connection_wake()`. * Calls to `on_connection_wake()` can occur without any call to `connection::wake()`. Proton uses wake internally. The semantics of `wake()` are similar to `std::condition_variable::notify_one`. There will be a wakeup, but there must be some shared application state to determine why the wakeup occurred and what, if anything, to do about it. Work queues are easier to use in many instances, but `wake()` may be useful if you already have your own external thread-safe queues and just need an efficient way to wake a connection to check them for data. ## Using older versions of C++ Before C++11 there was no standard support for threading in C++. You can use Proton with threads but with the following limitations. * The container will not create threads, it will only use the single thread that calls `proton::container::run()`. * None of the Proton library classes are thread-safe, including `proton::container` and `proton::work_queue`. You need an external lock to use `proton::container` in multiple threads. The only exception is `proton::connection::wake()`, it *is* thread-safe even in older C++. You can implement your own `proton::container` using your own threading library, or ignore the container and embed the lower-level `proton::io::connection_driver` in an external poller. These approaches still use the same `proton::messaging_handler` callbacks, so you can reuse most of your application code. Note that this is an advanced undertaking. There are a few pointers in @ref io_page. qpid-proton-0.22.0/proton-c/bindings/cpp/docs/main.md0000664000000000000000000000524713257152177017277 0ustar # Introduction {#mainpage} The Qpid Proton C++ API enables writing clients and servers that send and receive messages using the AMQP protocol. It is part of the [Qpid Proton](https://qpid.apache.org/proton/index.html) suite of messaging APIs. The @ref overview_page presents the API's central concepts and mechanics. The @ref tutorial_page guides you through some basic examples. See [**Examples**](examples.html) for a complete list of the sample programs, including more advanced ones. Qpid Proton C++ can be used in single- and multithreaded applications. See @ref mt_page for guidance on writing efficient multithreaded messaging applications. ## Namespaces The main @ref proton namespace contains classes and functions representing AMQP concepts and key elements of the API. Together they form a "protocol engine" API to create AMQP @ref proton::connection "connections" and @ref proton::link "links", handle @ref proton::messaging\_handler "events", and send and receive @ref proton::message "messages". See @ref overview_page for more information. The main @ref proton namespace also contains C++ classes and functions for handling AMQP- and API-specific data types. See @ref types_page for more information. The @ref proton::codec namespace contains interfaces for AMQP data encoding and decoding. The @ref proton::io namespace contains interfaces for integrating with platform-native network IO. See @ref io_page for more information. ## Conventions Elements of the API marked as **Unsettled API**, including any elements contained within them, are still evolving and thus are subject to change. They are available to use, but newer versions of Proton may require changes to your application source code. Elements marked **Deprecated** are slated for removal in a future release. Sections labeled **Thread safety** describe when and where it is safe to call functions or access data across threads. Sections called **C++ versions** discuss features of the API that depend on particular versions of C++ such as C++11. ## URLs The API uses URLs to identify three different kinds of resources. All URL argument names are suffixed with `_url`. Connection URLs (`conn_url` in argument lists) specify a target for outgoing network connections. The path part of the URL is ignored. Address URLs (`addr_url`) extend the connection URL to reference an AMQP node such as a queue or topic. The path of the URL, minus the leading slash, is treated as the AMQP address of the node. Listener URLs (`listen_url`) specify a local network address and port for accepting incoming TCP connections. The path part of the URL is ignored. The host part may be empty, meaning "listen on all available interfaces". qpid-proton-0.22.0/proton-c/bindings/cpp/docs/io.md0000664000000000000000000000153113257152177016752 0ustar # IO integration {#io_page} **Unsettled API** - The `proton::io` interfaces are new and remain subject to change. The `proton::io` namespace contains a service provider interface (SPI) that allows you to embed Proton in alternative IO or threading libraries. The `proton::io::connection_driver` class converts an AMQP-encoded byte stream, read from any IO source, into `proton::messaging_handler` calls. It generates an AMQP-encoded byte stream as output that can be written to any IO destination. The connection driver has no threading or IO dependencies. It is not thread-safe, but separate instances are independent and can be run concurrently in a multithreaded framework. The driver is written in portable C++98-compatible code. For examples of use, see [the proton source code](qpid.apache.org/proton), in particular the C++ `proton::container`. qpid-proton-0.22.0/proton-c/bindings/cpp/docs/CMakeLists.txt0000664000000000000000000000276313257152177020571 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # find_package(Doxygen) if (DOXYGEN_FOUND) configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen) file(GLOB_RECURSE headers ../include/proton/*.hpp) add_custom_target (docs-cpp COMMAND ${CMAKE_COMMAND} -E remove_directory html # get rid of old files COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen DEPENDS ${headers} ) add_dependencies (docs docs-cpp) # HTML files are generated to ./html - put those in the install. install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "${PROTON_SHARE}/docs/api-cpp" COMPONENT documentation OPTIONAL) endif (DOXYGEN_FOUND) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html) qpid-proton-0.22.0/proton-c/bindings/cpp/cpp.cmake0000664000000000000000000000626513257152177016666 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Check C++ capabilities. include(CheckCXXSourceCompiles) macro (cxx_test prog name) check_cxx_source_compiles("${prog}" HAS_${name}) if (HAS_${name}) list(APPEND CPP_DEFINITIONS "HAS_${name}") else() set(CPP_TEST_FAILED True) endif() endmacro() set(CPP_DEFINITIONS "") set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD} ${CXX_WARNING_FLAGS}") cxx_test("#if defined(__cplusplus) && __cplusplus >= 201103\nint main(int, char**) { return 0; }\n#endif" CPP11) # Don't need to check individual flags if compiler claims to be C++11 or later as they will be set automatically if (NOT HAS_CPP11) set(CPP_TEST_FAILED False) cxx_test("long long ll; int main(int, char**) { return 0; }" LONG_LONG_TYPE) cxx_test("int* x = nullptr; int main(int, char**) { return 0; }" NULLPTR) cxx_test("#include \nvoid blah(std::string&&) {} int main(int, char**) { blah(\"hello\"); return 0; }" RVALUE_REFERENCES) cxx_test("class x {explicit operator int(); }; int main(int, char**) { return 0; }" EXPLICIT_CONVERSIONS) cxx_test("class x {x()=default; }; int main(int, char**) { return 0; }" DEFAULTED_FUNCTIONS) cxx_test("class x {x(x&&)=default; }; int main(int, char**) { return 0; }" DEFAULTED_MOVE_INITIALIZERS) cxx_test("class x {x()=delete; }; int main(int, char**) { return 0; }" DELETED_FUNCTIONS) cxx_test("struct x {x() {}}; int main(int, char**) { static thread_local x foo; return 0; }" THREAD_LOCAL) cxx_test("int main(int, char**) { int a=[](){return 42;}(); return a; }" LAMBDAS) cxx_test("template void x(X... a) {} int main(int, char**) { x(1); x(43, \"\"); return 0; }" VARIADIC_TEMPLATES) cxx_test("#include \nint main(int, char**) { return 0; }" HEADER_RANDOM) cxx_test("#include \nstd::unique_ptr u; int main(int, char**) { return 0; }" STD_UNIQUE_PTR) cxx_test("#include \nstd::thread t; int main(int, char**) { return 0; }" STD_THREAD) cxx_test("#include \nstd::mutex m; int main(int, char**) { return 0; }" STD_MUTEX) cxx_test("#include \nstd::atomic a; int main(int, char**) { return 0; }" STD_ATOMIC) # If all the tests passed this is the same as if we have C++11 for the purposes of compilation # (this shortens the compile command line for VS 2017 significantly) if (NOT CPP_TEST_FAILED) set(CPP_DEFINITIONS "HAS_CPP11") endif() endif() unset(CMAKE_REQUIRED_FLAGS) # Don't contaminate later C tests with C++ flags qpid-proton-0.22.0/proton-c/bindings/cpp/config_presets.hpp.in0000664000000000000000000000167513257152177021232 0ustar #ifndef PROTON_INTERNAL_CONFIG_PRESETS_HPP #define PROTON_INTERNAL_CONFIG_PRESETS_HPP /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ @presets@ #endif // PROTON_INTERNAL_CONFIG_PRESETS_HPPqpid-proton-0.22.0/proton-c/bindings/cpp/README.md0000664000000000000000000000217113257152177016351 0ustar # Qpid Proton C++ This is a C++ binding for the Proton API. The documentation includes a tutorial and API documentation. To generate the documentation go to your build directory, run `make docs-cpp`, and open `proton-c/bindings/cpp/docs/html/index.html` in a browser. ## Todo ### Tests - Interop/type testing: proton/tests/interop, new interop suite - More unit testing, measured code coverage - Test examples against ActiveMQ and qpidd ### Bugs - Error handling: - examples exit silently on broker exit/not running, core on no-such-queue (e.g., with qpidd) ### Features - SASL/SSL support with interop tests. - Reconnection - Browsing - Selectors - AMQP described types and arrays, full support and tests - Durable subscriptions & demos (see python changes) - Transactions - Heartbeats ### Nice to have - C++11 lambda version of handlers - Helpers (or at least doc) for multi-threaded use (container per connection) - Usable support for decimal types - Expose endpoint conditions as C++ proton::condition error class - Selectables and 3rd party event loop support - More efficient shared_ptr (single family per proton object) qpid-proton-0.22.0/proton-c/bindings/cpp/ProtonCppConfig.cmake.in0000664000000000000000000000213713257152177021555 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Name: Proton # Description: Qpid Proton C library # Version: @PN_VERSION@ # URL: http://qpid.apache.org/proton/ set (ProtonCpp_VERSION @PN_VERSION@) set (ProtonCpp_INCLUDE_DIRS @INCLUDEDIR@) set (ProtonCpp_LIBRARIES optimized @LIBDIR@/@PROTONCPPLIB@ debug @LIBDIR@/@PROTONCPPLIBDEBUG@) set (ProtonCpp_FOUND True) qpid-proton-0.22.0/proton-c/bindings/cpp/CMakeLists.txt0000664000000000000000000001670713257152177017644 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # cmake_minimum_required(VERSION 2.8.12) enable_language(CXX) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads) set (BUILD_CPP_03 OFF CACHE BOOL "Compile the C++ binding as C++03 even when C++11 is available") # This effectively checks for cmake version 3.1 or later if (DEFINED CMAKE_CXX_COMPILE_FEATURES) if (BUILD_CPP_03) set(STD 98) else () set(STD 11) list(APPEND PLATFORM_LIBS "${CMAKE_THREAD_LIBS_INIT}") endif () set(CMAKE_CXX_STANDARD ${STD}) set(CMAKE_CXX_EXTENSIONS OFF) if (MSVC) # Compiler feature checks only needed for Visual Studio in this case include(cpp.cmake) elseif (STD EQUAL 11) set(CPP_DEFINITIONS "HAS_CPP11") endif() else () if (BUILD_CPP_03) set(CXX_STANDARD "-std=c++98") else () include(CheckCXXCompilerFlag) # These flags work with GCC/Clang/SunPro compilers check_cxx_compiler_flag("-std=c++11" ACCEPTS_CXX11) check_cxx_compiler_flag("-std=c++0x" ACCEPTS_CXX0X) if (ACCEPTS_CXX11) set(CXX_STANDARD "-std=c++11") set(CPP_DEFINITIONS "HAS_CPP11") list(APPEND PLATFORM_LIBS "${CMAKE_THREAD_LIBS_INIT}") elseif(ACCEPTS_CXX0X) set(CXX_STANDARD "-std=c++0x") list(APPEND PLATFORM_LIBS "${CMAKE_THREAD_LIBS_INIT}") include(cpp.cmake) # Compiler checks needed for C++0x as not all C++11 may be supported else() include(cpp.cmake) # Compiler checks needed as we have no idea whats going on here! endif() endif() endif () # Construct #define lines to insert in config_presets.hpp foreach(d ${CPP_DEFINITIONS}) set(presets "${presets}#define PN_CPP_LIB_${d} 1\n") endforeach() # For Visual Studio define the app compile time macros now, for everything else don't if(MSVC) set(presets "${presets}\n// Compiled for MSVC version ${CMAKE_CXX_COMPILER_VERSION} (${MSVC_VERSION})\n") foreach(d ${CPP_DEFINITIONS}) set(presets "${presets}# define PN_CPP_${d} 1\n") endforeach() else() set(presets "${presets}\n#if qpid_proton_cpp_EXPORTS\n") foreach(d ${CPP_DEFINITIONS}) set(presets "${presets}# define PN_CPP_${d} 1\n") endforeach() set(presets "${presets}#endif // qpid_proton_cpp_EXPORTS\n") endif() configure_file(config_presets.hpp.in config_presets.hpp @ONLY) # Make these CACHE INTERNAL so they will be set for the C++ examples set(CXX_EXAMPLE_FLAGS "${CXX_WARNING_FLAGS} ${CMAKE_CXX_FLAGS} ${CXX_STANDARD}" CACHE INTERNAL "") set(CXX_EXAMPLE_LINK_FLAGS "${SANITIZE_FLAGS}" CACHE INTERNAL "") include_directories( "${CMAKE_SOURCE_DIR}/proton-c/include" "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}") add_definitions(${CXX_STANDARD} ${CXX_WARNING_FLAGS} "-DPN_CPP_USE_DEPRECATED_API=1") set(qpid-proton-cpp-source src/binary.cpp src/byte_array.cpp src/map.cpp src/connection.cpp src/connection_driver.cpp src/connection_options.cpp src/container.cpp src/proactor_container_impl.cpp src/contexts.cpp src/data.cpp src/decimal.cpp src/decoder.cpp src/delivery.cpp src/duration.cpp src/encoder.cpp src/endpoint.cpp src/error.cpp src/error_condition.cpp src/handler.cpp src/link.cpp src/link_namer.cpp src/listener.cpp src/message.cpp src/messaging_adapter.cpp src/node_options.cpp src/object.cpp src/proton_bits.cpp src/receiver.cpp src/receiver_options.cpp src/reconnect_options.cpp src/returned.cpp src/sasl.cpp src/scalar_base.cpp src/sender.cpp src/sender_options.cpp src/session.cpp src/session_options.cpp src/source.cpp src/ssl.cpp src/ssl_domain.cpp src/target.cpp src/terminus.cpp src/timestamp.cpp src/tracker.cpp src/transfer.cpp src/transport.cpp src/type_id.cpp src/url.cpp src/uuid.cpp src/value.cpp src/work_queue.cpp ) set_source_files_properties ( ${qpid-proton-cpp-source} PROPERTIES COMPILE_FLAGS "${LTO}" ) add_library(qpid-proton-cpp SHARED ${qpid-proton-cpp-source}) target_link_libraries (qpid-proton-cpp LINK_PRIVATE ${PLATFORM_LIBS} qpid-proton-core qpid-proton-proactor) set_target_properties ( qpid-proton-cpp PROPERTIES LINKER_LANGUAGE CXX VERSION "${PN_LIB_CPP_VERSION}" SOVERSION "${PN_LIB_CPP_MAJOR_VERSION}" LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) ## Install install(TARGETS qpid-proton-cpp EXPORT proton-cpp RUNTIME DESTINATION bin ARCHIVE DESTINATION ${LIB_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) # Install windows qpid-proton-cpp pdb files if (MSVC) install(FILES $ DESTINATION bin CONFIGURATIONS RelWithDebInfo Debug OPTIONAL) endif (MSVC) install (DIRECTORY "include/proton" DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.hpp") install (FILES "${CMAKE_CURRENT_BINARY_DIR}/config_presets.hpp" DESTINATION "${INCLUDE_INSTALL_DIR}/proton/internal") add_subdirectory(docs) # Pkg config file configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/libqpid-proton-cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc @ONLY) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) if (DEFINED CMAKE_IMPORT_LIBRARY_PREFIX) set(PROTONCPPLIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_IMPORT_LIBRARY_SUFFIX}) set(PROTONCPPLIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX}) else () set(PROTONCPPLIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_SHARED_LIBRARY_SUFFIX}) set(PROTONCPPLIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) endif () include(WriteBasicConfigVersionFile) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ProtonCppConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake @ONLY) write_basic_config_version_file( ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake VERSION ${PN_VERSION} COMPATIBILITY AnyNewerVersion) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp) macro(add_cpp_test test) add_executable (${test} src/${test}.cpp) target_link_libraries (${test} qpid-proton-cpp ${PLATFORM_LIBS}) if (CMAKE_SYSTEM_NAME STREQUAL Windows) add_test (NAME cpp-${test} COMMAND ${env_py} "PATH=$" $ ${ARGN}) else () add_test (NAME cpp-${test} COMMAND ${memcheck-cmd} ${CMAKE_CURRENT_BINARY_DIR}/${test} ${ARGN}) endif () endmacro(add_cpp_test) add_cpp_test(codec_test) add_cpp_test(connection_driver_test) add_cpp_test(interop_test ${CMAKE_SOURCE_DIR}/tests) add_cpp_test(message_test) add_cpp_test(map_test) add_cpp_test(scalar_test) add_cpp_test(value_test) add_cpp_test(container_test) add_cpp_test(url_test) add_cpp_test(reconnect_test) qpid-proton-0.22.0/proton-c/bindings/CMakeLists.txt0000664000000000000000000000572613257152177017061 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Add bindings that do not require swig here - the directory name must be the same as the binding name # See below for swig bindings set(BINDINGS cpp go) if (CMAKE_CXX_COMPILER) set (DEFAULT_CPP ON) endif() # Prerequisites for Go find_program(GO_EXE go) mark_as_advanced(GO_EXE) if (GO_EXE) if(WIN32) # Go on windows requires gcc tool chain set (DEFAULT_GO OFF) else() set (DEFAULT_GO ON) endif() endif (GO_EXE) if(SWIG_FOUND) # Add any new swig bindings here - the directory name must be the same as the binding name list(APPEND BINDINGS python ruby) include(UseSWIG) # All swig modules should include ${PROTON_HEADERS} in SWIG_MODULE__EXTRA_DEPS file(GLOB PROTON_HEADERS "${CMAKE_SOURCE_DIR}/proton-c/include/proton/*.h") # All swig modules should include ${BINDING_DEPS} in swig_link_libraries set (BINDING_DEPS qpid-proton) # Add a block here to detect the prerequisites to build each language binding: # # If the prerequisites for the binding are present set a variable called # DEFAULT_{uppercase name of binding} to ON # Prerequisites for Python wrapper: find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) if (PYTHONLIBS_FOUND) set (DEFAULT_PYTHON ON) endif (PYTHONLIBS_FOUND) # Prerequisites for Ruby: find_package(Ruby) if (RUBY_FOUND) set (DEFAULT_RUBY ON) endif (RUBY_FOUND) endif() # To kick-start a build with just a few bindings enabled by default, e.g. ruby and go: # # cmake -DBUILD_BINDINGS=ruby;go # # This is only used when CMakeCache.txt is first created, after that set the normal # BUILD_XXX variables to enable/disable bindings. # if (NOT DEFINED BUILD_BINDINGS) set(BUILD_BINDINGS "${BINDINGS}") endif() foreach(BINDING ${BINDINGS}) string(TOUPPER ${BINDING} UBINDING) list(FIND BUILD_BINDINGS ${BINDING} N) if(NOBUILD_${UBINDING} OR ( N EQUAL -1 ) ) # Over-ridden or not on the BUILD_BINDINGS list set(DEFAULT_${UBINDING} OFF) endif() option(BUILD_${UBINDING} "Build ${BINDING} language binding" ${DEFAULT_${UBINDING}}) if (BUILD_${UBINDING}) add_subdirectory(${BINDING}) endif () endforeach(BINDING) unset(BUILD_BINDINGS CACHE) # Remove from cache, only relevant when creating the initial cache. qpid-proton-0.22.0/proton-c/CMakeLists.txt0000664000000000000000000006526613257152177015271 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # include(CheckLibraryExists) include(CheckSymbolExists) include(CheckPythonModule) include(versions.cmake) add_custom_target(docs) add_custom_target(doc DEPENDS docs) # Set the default SSL/TLS implementation find_package(OpenSSL) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads) find_package(PythonInterp REQUIRED) find_package(SWIG) # FindSwig.cmake "forgets" to make its outputs advanced like a good citizen mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION) # See if Cyrus SASL is available find_library(CYRUS_SASL_LIBRARY sasl2) find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include) find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR) mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR) # Find saslpasswd2 executable to generate test config find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db for testing") mark_as_advanced(SASLPASSWD_EXE) if(WIN32 AND NOT CYGWIN) # linking against Windows native libraries, including mingw set (PN_WINAPI TRUE) endif(WIN32 AND NOT CYGWIN) set(ssl_impl, none) if(PN_WINAPI) set(ssl_impl schannel) set(ssl_providers "'none','schannel','openssl'") else(PN_WINAPI) if (OPENSSL_FOUND AND Threads_FOUND) set(ssl_impl openssl) endif () set(ssl_providers "'none','openssl'") endif(PN_WINAPI) set(SSL_IMPL ${ssl_impl} CACHE STRING "Library to use for SSL/TLS support. Valid values: ${ssl_providers}") set(sasl_providers cyrus none) if (CYRUSSASL_FOUND AND Threads_FOUND) set (sasl_impl cyrus) else () set (sasl_impl none) endif () set(SASL_IMPL ${sasl_impl} CACHE STRING "Library to use for SASL support. Valid values: ${sasl_providers}") configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/include/proton/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h" ) include_directories ("${CMAKE_CURRENT_BINARY_DIR}/src") include_directories ("${CMAKE_CURRENT_BINARY_DIR}/include") include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/src") include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include") set (env_py ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/env.py) add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py > ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py ) add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py > ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py ) add_custom_target( generated_c_files DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h ) # Select IO impl if(PN_WINAPI) set (pn_io_impl src/reactor/io/windows/io.c src/reactor/io/windows/iocp.c src/reactor/io/windows/write_pipeline.c) set (pn_selector_impl src/reactor/io/windows/selector.c) else(PN_WINAPI) set (pn_io_impl src/reactor/io/posix/io.c) set (pn_selector_impl src/reactor/io/posix/selector.c) endif(PN_WINAPI) # Link in SASL if present if (SASL_IMPL STREQUAL cyrus) set(pn_sasl_impl src/sasl/sasl.c src/sasl/default_sasl.c src/sasl/cyrus_sasl.c) include_directories (${CYRUS_SASL_INCLUDE_DIR}) set(SASL_LIB ${CYRUS_SASL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) elseif (SASL_IMPL STREQUAL none) set(pn_sasl_impl src/sasl/sasl.c src/sasl/default_sasl.c src/sasl/cyrus_stub.c) endif () # Set Compiler extra flags for Solaris when using SunStudio if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt" ) endif() if(CMAKE_C_COMPILER_ID STREQUAL "SunPro" ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mt") endif() # Link in openssl if present if (SSL_IMPL STREQUAL openssl) set (pn_ssl_impl src/ssl/openssl.c) include_directories (${OPENSSL_INCLUDE_DIR}) set (SSL_LIB ${OPENSSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) elseif (SSL_IMPL STREQUAL schannel) set (pn_ssl_impl src/ssl/schannel.c) set (SSL_LIB Crypt32.lib Secur32.lib) else () set (pn_ssl_impl src/ssl/ssl_stub.c) endif () # First check whether we get clock_gettime without any special library linked CHECK_SYMBOL_EXISTS(clock_gettime "time.h" CLOCK_GETTIME_IN_LIBC) if (CLOCK_GETTIME_IN_LIBC) list(APPEND PLATFORM_DEFINITIONS "USE_CLOCK_GETTIME") else (CLOCK_GETTIME_IN_LIBC) CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_RT) if (CLOCK_GETTIME_IN_RT) set (TIME_LIB rt) list(APPEND PLATFORM_DEFINITIONS "USE_CLOCK_GETTIME") else (CLOCK_GETTIME_IN_RT) CHECK_SYMBOL_EXISTS(GetSystemTimeAsFileTime "windows.h" WINDOWS_FILETIME) if (WINDOWS_FILETIME) list(APPEND PLATFORM_DEFINITIONS "USE_WIN_FILETIME") else (WINDOWS_FILETIME) list(APPEND PLATFORM_DEFINITIONS "USE_GETTIMEOFDAY") endif (WINDOWS_FILETIME) endif (CLOCK_GETTIME_IN_RT) endif (CLOCK_GETTIME_IN_LIBC) if (PN_WINAPI) CHECK_SYMBOL_EXISTS(strerror_s "string.h" STRERROR_S_IN_WINAPI) if (STRERROR_S_IN_WINAPI) list(APPEND PLATFORM_DEFINITIONS "USE_STRERROR_S") else (STRERROR_S_IN_WINAPI) if (MINGW) message (STATUS, "NOTE: your MinGW version lacks a thread safe strerror") list(APPEND PLATFORM_DEFINITIONS "USE_OLD_STRERROR") endif (MINGW) endif (STRERROR_S_IN_WINAPI) else (PN_WINAPI) CHECK_SYMBOL_EXISTS(strerror_r "string.h" STRERROR_R_IN_LIBC) if (STRERROR_R_IN_LIBC) list(APPEND PLATFORM_DEFINITIONS "USE_STRERROR_R") endif (STRERROR_R_IN_LIBC) endif (PN_WINAPI) CHECK_SYMBOL_EXISTS(atoll "stdlib.h" C99_ATOLL) if (C99_ATOLL) list(APPEND PLATFORM_DEFINITIONS "USE_ATOLL") else (C99_ATOLL) CHECK_SYMBOL_EXISTS(_atoi64 "stdlib.h" WINAPI_ATOI64) if (WINAPI_ATOI64) list(APPEND PLATFORM_DEFINITIONS "USE_ATOI64") else (WINAPI_ATOI64) message(FATAL_ERROR "No atoll API found") endif (WINAPI_ATOI64) endif (C99_ATOLL) if (PN_WINAPI) set (PLATFORM_LIBS ws2_32 Rpcrt4) list(APPEND PLATFORM_DEFINITIONS "PN_WINAPI") endif (PN_WINAPI) # Try to keep any platform specific overrides together here: # MacOS has a bunch of differences in build tools and process and so we have to turn some things # off if building there: if (APPLE) set (NOENABLE_WARNING_ERROR ON) set (NOENABLE_UNDEFINED_ERROR ON) # TODO: Currently segfaults on MacOS - fix bug and re-enable set (NOENABLE_FUZZ_TESTING ON) endif (APPLE) # TODO: Can't build fuzz tests/or run regression tests on MSVC currently # (due to limit on command line length) if (MSVC) set (NOENABLE_FUZZ_TESTING ON) endif (MSVC) # Make LTO default to off until we can figure out the valgrind issues set (NOENABLE_LINKTIME_OPTIMIZATION ON) # Add options here called they will turn into "ENABLE_ set (OPTIONS WARNING_ERROR UNDEFINED_ERROR LINKTIME_OPTIMIZATION HIDE_UNEXPORTED_SYMBOLS FUZZ_TESTING) foreach (OPTION ${OPTIONS}) if (NOT NOENABLE_${OPTION}) set ("DEFAULT_${OPTION}" ON) endif () endforeach (OPTION) # And add the option here too with help text option(ENABLE_WARNING_ERROR "Consider compiler warnings to be errors" ${DEFAULT_WARNING_ERROR}) option(ENABLE_UNDEFINED_ERROR "Check for unresolved library symbols" ${DEFAULT_UNDEFINED_ERROR}) option(ENABLE_LINKTIME_OPTIMIZATION "Perform link time optimization" ${DEFAULT_LINKTIME_OPTIMIZATION}) option(ENABLE_HIDE_UNEXPORTED_SYMBOLS "Only export library symbols that are explicitly requested" ${DEFAULT_HIDE_UNEXPORTED_SYMBOLS}) option(ENABLE_FUZZ_TESTING "Enable building fuzzers and regression testing with libFuzzer" ${DEFAULT_FUZZ_TESTING}) # Set any additional compiler specific flags if (CMAKE_COMPILER_IS_GNUCC) if (ENABLE_WARNING_ERROR) set (WERROR "-Werror") endif (ENABLE_WARNING_ERROR) set (COMPILE_WARNING_FLAGS "${WERROR} -Wall -pedantic-errors") # C++ allow "%z" format specifier and variadic macros set (CXX_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-format -Wno-variadic-macros") if (NOT BUILD_WITH_CXX) set (COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wstrict-prototypes -Wc++-compat -Wvla -Wsign-compare -Wwrite-strings") set (COMPILE_LANGUAGE_FLAGS "-std=c99") set (COMPILE_PLATFORM_FLAGS "-std=gnu99") else (NOT BUILD_WITH_CXX) set (COMPILE_WARNING_FLAGS "${CXX_WARNING_FLAGS}") endif (NOT BUILD_WITH_CXX) if (ENABLE_UNDEFINED_ERROR) set (CATCH_UNDEFINED "-Wl,--no-undefined") set (ALLOW_UNDEFINED "-Wl,--allow-shlib-undefined") endif (ENABLE_UNDEFINED_ERROR) if (ENABLE_LINKTIME_OPTIMIZATION) set (LTO "-flto") endif (ENABLE_LINKTIME_OPTIMIZATION) if (ENABLE_HIDE_UNEXPORTED_SYMBOLS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") endif (ENABLE_HIDE_UNEXPORTED_SYMBOLS) elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") if (ENABLE_HIDE_UNEXPORTED_SYMBOLS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xldscope=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xldscope=hidden") endif (ENABLE_HIDE_UNEXPORTED_SYMBOLS) endif (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID MATCHES "Clang") set (COMPILE_WARNING_FLAGS "-Wall -pedantic") set (COMPILE_LANGUAGE_FLAGS "-std=c99") if (ENABLE_WARNING_ERROR) set (COMPILE_WARNING_FLAGS "-Werror ${COMPILE_WARNING_FLAGS}") endif (ENABLE_WARNING_ERROR) # TODO aconway 2016-01-06: we should be able to clean up the code and turn on # some of these warnings. set (CXX_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables -Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast -Wno-missing-noreturn") endif() # Sanitizer flags apply to to both GNU and clang, C and C++ if(ENABLE_SANITIZERS) set(SANITIZE_FLAGS "-g -fno-omit-frame-pointer -fsanitize=address -fsanitize=leak -fsanitize=undefined") endif() if(ENABLE_TSAN) set(SANITIZE_FLAGS "-g -fno-omit-frame-pointer -fsanitize=thread") endif() if (SANITIZE_FLAGS) mark_as_advanced(SANITIZE_FLAGS) if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZE_FLAGS}") endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}") endif() endif() # Flags for example self-test build, CACHE INTERNAL for visibility set(C_EXAMPLE_FLAGS "${COMPILE_WARNING_FLAGS} ${CMAKE_C_FLAGS}" CACHE INTERNAL "") set(C_EXAMPLE_LINK_FLAGS "${SANITIZE_FLAGS}" CACHE INTERNAL "") if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_IS_GNUCC) # Ensure that examples build with c90, to deal with older c++03-as-c compilers. set(C_EXAMPLE_FLAGS "${C_EXAMPLE_FLAGS} -std=iso9899:1990 -pedantic") endif() if (MSVC) set(CMAKE_DEBUG_POSTFIX "d") add_definitions( /wd4244 /wd4267 /wd4800 /wd4996 ) set (qpid-proton-platform src/compiler/msvc/snprintf.c) endif (MSVC) macro (pn_absolute_install_dir NAME VALUE PREFIX) if(IS_ABSOLUTE ${VALUE}) set(${NAME} "${VALUE}") elseif(IS_ABSOLUTE ${PREFIX}) set(${NAME} "${PREFIX}/${VALUE}") else() set(${NAME} "${CMAKE_BINARY_DIR}/${PREFIX}/${VALUE}") endif(IS_ABSOLUTE ${VALUE}) get_filename_component(${NAME} ${${NAME}} ABSOLUTE) endmacro() pn_absolute_install_dir(PREFIX "." ${CMAKE_INSTALL_PREFIX}) pn_absolute_install_dir(EXEC_PREFIX "." ${CMAKE_INSTALL_PREFIX}) pn_absolute_install_dir(LIBDIR ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}) pn_absolute_install_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}) if (CMAKE_SYSTEM_NAME STREQUAL Windows) # No change needed for windows already use correct separator function(to_native_path path result) file (TO_NATIVE_PATH "${path}" path) set (${result} ${path} PARENT_SCOPE) endfunction() else (CMAKE_SYSTEM_NAME STREQUAL Windows) # Just change ';'->':' function(to_native_path path result) file (TO_NATIVE_PATH "${path}" path) string (REGEX REPLACE ";" ":" path "${path}") set (${result} ${path} PARENT_SCOPE) endfunction() endif (CMAKE_SYSTEM_NAME STREQUAL Windows) add_subdirectory(docs/api) add_subdirectory(../tests/tools/apps/c ../tests/tools/apps/c) # for full source distribution: set (qpid-proton-platform-all src/platform/platform.c src/reactor/io/windows/io.c src/reactor/io/windows/iocp.c src/reactor/io/windows/write_pipeline.c src/reactor/io/windows/selector.c src/reactor/io/posix/io.c src/reactor/io/posix/selector.c ) # platform specific library build: set (qpid-proton-platform-io src/platform/platform.c ${pn_io_impl} ${pn_selector_impl} ) # for full source distribution: set (qpid-proton-layers-all src/sasl/sasl.c src/sasl/default_sasl.c src/sasl/cyrus_sasl.c src/sasl/cyrus_stub.c src/ssl/openssl.c src/ssl/schannel.c src/ssl/ssl_stub.c ) # for current build system's environment: set (qpid-proton-layers ${pn_sasl_impl} ${pn_ssl_impl} ) set (qpid-proton-core src/core/object/object.c src/core/object/list.c src/core/object/map.c src/core/object/string.c src/core/object/iterator.c src/core/object/record.c src/core/log.c src/core/util.c src/core/error.c src/core/buffer.c src/core/types.c src/core/framing.c src/core/codec.c src/core/decoder.c src/core/encoder.c src/core/dispatcher.c src/core/connection_driver.c src/core/engine.c src/core/event.c src/core/autodetect.c src/core/transport.c src/core/message.c ) set (qpid-proton-include-generated ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h ) set (qpid-proton-private-includes src/messenger/store.h src/messenger/subscription.h src/messenger/messenger.h src/messenger/transform.h src/ssl/ssl-internal.h src/sasl/sasl-internal.h src/core/autodetect.h src/core/log_private.h src/core/config.h src/core/encoder.h src/core/dispatch_actions.h src/core/engine-internal.h src/core/transport.h src/core/framing.h src/core/buffer.h src/core/util.h src/core/dispatcher.h src/core/data.h src/core/decoder.h src/core/max_align.h src/core/message-internal.h src/reactor/io/windows/iocp.h src/reactor/selector.h src/reactor/io.h src/reactor/reactor.h src/reactor/selectable.h src/platform/platform.h src/platform/platform_fmt.h src/proactor/netaddr-internal.h src/proactor/proactor-internal.h ) set (qpid-proton-extra src/extra/url.c src/reactor/reactor.c src/reactor/handler.c src/reactor/connection.c src/reactor/acceptor.c src/reactor/selectable.c src/reactor/timer.c src/handlers/handshaker.c src/handlers/iohandler.c src/handlers/flowcontroller.c src/messenger/messenger.c src/messenger/subscription.c src/messenger/store.c src/messenger/transform.c ) set (qpid-proton-include include/proton/cid.h include/proton/codec.h include/proton/condition.h include/proton/connection.h include/proton/connection_driver.h include/proton/delivery.h include/proton/disposition.h include/proton/engine.h include/proton/error.h include/proton/event.h include/proton/import_export.h include/proton/link.h include/proton/listener.h include/proton/log.h include/proton/message.h include/proton/netaddr.h include/proton/object.h include/proton/proactor.h include/proton/sasl.h include/proton/sasl-plugin.h include/proton/session.h include/proton/ssl.h include/proton/terminus.h include/proton/transport.h include/proton/type_compat.h include/proton/types.h ) set (qpid-proton-include-extra include/proton/handlers.h include/proton/messenger.h include/proton/reactor.h include/proton/selectable.h include/proton/url.h ) # # Choose a proactor: user can set PROACTOR, or if not set pick a default. # The default is the first one that passes its build test, in order listed below. # "none" disables the proactor even if a default is available. # set(PROACTOR "" CACHE STRING "Override default proactor, one of: epoll, libuv, iocp, none") string(TOLOWER "${PROACTOR}" PROACTOR) if (PROACTOR STREQUAL "epoll" OR (NOT PROACTOR AND NOT BUILD_PROACTOR)) check_symbol_exists(epoll_wait "sys/epoll.h" HAVE_EPOLL) if (HAVE_EPOLL) set (PROACTOR_OK epoll) set (qpid-proton-proactor src/proactor/epoll.c src/proactor/proactor-internal.c) set (PROACTOR_LIBS ${CMAKE_THREAD_LIBS_INIT} ${TIME_LIB}) set_source_files_properties (${qpid-proton-proactor} PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LTO}" ) endif() endif() if (PROACTOR STREQUAL "iocp" OR (NOT PROACTOR AND NOT PROACTOR_OK)) if(WIN32 AND NOT CYGWIN) set (PROACTOR_OK iocp) set (qpid-proton-proactor src/proactor/win_iocp.c src/proactor/proactor-internal.c) set_source_files_properties (${qpid-proton-proactor} PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS} ${LTO}" COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}" ) endif(WIN32 AND NOT CYGWIN) endif() if (PROACTOR STREQUAL "libuv" OR (NOT PROACTOR AND NOT PROACTOR_OK)) find_package(Libuv) if (LIBUV_FOUND) set (PROACTOR_OK libuv) set (qpid-proton-proactor src/proactor/libuv.c src/proactor/proactor-internal.c) set (PROACTOR_LIBS ${Libuv_LIBRARIES}) set_source_files_properties (${qpid-proton-proactor} PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LTO}" ) include_directories(${Libuv_INCLUDE_DIRS}) endif() endif() if (PROACTOR_OK) message(STATUS "Building the ${PROACTOR_OK} proactor") elseif (PROACTOR AND NOT PROACTOR STREQUAL "none") message(FATAL_ERROR "Cannot build the ${PROACTOR} proactor") endif() if (CMAKE_SYSTEM_NAME STREQUAL Windows) # No change needed for windows already use correct separator function(to_native_path path result) file (TO_NATIVE_PATH "${path}" path) set (${result} ${path} PARENT_SCOPE) endfunction() else (CMAKE_SYSTEM_NAME STREQUAL Windows) # Just change ';'->':' function(to_native_path path result) file (TO_NATIVE_PATH "${path}" path) string (REGEX REPLACE ";" ":" path "${path}") set (${result} ${path} PARENT_SCOPE) endfunction() endif (CMAKE_SYSTEM_NAME STREQUAL Windows) # note: process bindings after the source lists have been defined so # the bindings can reference them add_subdirectory(bindings) source_group("API Header Files" FILES ${qpid-proton-include} ${qpid-proton-include-extra}) set_source_files_properties ( ${qpid-proton-core} ${qpid-proton-layers} ${qpid-proton-extra} PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LTO}" ) set_source_files_properties ( ${qpid-proton-platform} ${qpid-proton-platform-io} PROPERTIES COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS} ${LTO}" COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}" ) if (BUILD_WITH_CXX) set_source_files_properties ( ${qpid-proton-core} ${qpid-proton-proactor} ${qpid-proton-layers} ${qpid-proton-extra} ${qpid-proton-platform} ${qpid-proton-platform-io} PROPERTIES LANGUAGE CXX ) endif (BUILD_WITH_CXX) add_library ( qpid-proton-core SHARED ${qpid-proton-core} ${qpid-proton-layers} ${qpid-proton-platform} ${qpid-proton-include} ${qpid-proton-include-generated} ) add_dependencies(qpid-proton-core generated_c_files) target_link_libraries (qpid-proton-core LINK_PRIVATE ${SSL_LIB} ${SASL_LIB}) set_target_properties ( qpid-proton-core PROPERTIES VERSION "${PN_LIB_CORE_VERSION}" SOVERSION "${PN_LIB_CORE_MAJOR_VERSION}" LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) add_library( qpid-proton SHARED # Proton Core ${qpid-proton-core} ${qpid-proton-layers} ${qpid-proton-platform} ${qpid-proton-include} ${qpid-proton-include-generated} # Proactor ${qpid-proton-proactor} # Proton Reactor/Messenger ${qpid-proton-extra} ${qpid-proton-platform-io} ${qpid-proton-include-extra} ) add_dependencies(qpid-proton generated_c_files) if (MSVC) # Add a phony dependency for Windows builds to serialize creation # of generated files. See issue PROTON-1376. # When a Windows build creates src/encodings.h and src/protocol.h # only once then this can be removed. add_dependencies(qpid-proton qpid-proton-core) endif (MSVC) target_link_libraries (qpid-proton LINK_PRIVATE ${SSL_LIB} ${SASL_LIB} ${TIME_LIB} ${PLATFORM_LIBS} ${PROACTOR_LIBS}) set_target_properties ( qpid-proton PROPERTIES VERSION "${PN_LIB_LEGACY_VERSION}" SOVERSION "${PN_LIB_LEGACY_MAJOR_VERSION}" LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) if (MSVC) # guard against use of C99 violating functions on Windows include(WindowsC99CheckDef) endif(MSVC) if (qpid-proton-proactor) # Bizarre CMake variable setting set(HAS_PROACTOR True) set(HAS_PROACTOR ${HAS_PROACTOR} PARENT_SCOPE) add_library ( qpid-proton-proactor SHARED ${qpid-proton-proactor}) target_link_libraries (qpid-proton-proactor LINK_PUBLIC qpid-proton-core) target_link_libraries (qpid-proton-proactor LINK_PRIVATE ${PLATFORM_LIBS} ${PROACTOR_LIBS}) list(APPEND LIB_TARGETS qpid-proton-proactor) set_target_properties ( qpid-proton-proactor PROPERTIES VERSION "${PN_LIB_PROACTOR_VERSION}" SOVERSION "${PN_LIB_PROACTOR_MAJOR_VERSION}" LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) endif() # Install executables and libraries install(TARGETS qpid-proton qpid-proton-core ${LIB_TARGETS} EXPORT proton RUNTIME DESTINATION bin ARCHIVE DESTINATION ${LIB_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) # Install windows qpid-proton pdb files if (MSVC) install(FILES $ DESTINATION bin CONFIGURATIONS RelWithDebInfo Debug OPTIONAL) endif (MSVC) # Install header files file(GLOB headers "include/proton/*.[hi]") install (FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/proton) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h DESTINATION ${INCLUDE_INSTALL_DIR}/proton) # Set ${VAR}/${VAR}DEBUG variables, configure and install the packageconf files for LIB macro(configure_lib VAR LIB) if(DEFINED CMAKE_IMPORT_LIBRARY_PREFIX) set(LIB_PREFIX ${CMAKE_IMPORT_LIBRARY_PREFIX}) set(LIB_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX}) else() set(LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) set(LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) endif() set(${VAR} ${LIB_PREFIX}${LIB}${LIB_SUFFIX}) set("${VAR}DEBUG" ${LIB_PREFIX}${LIB}${CMAKE_DEBUG_POSTFIX}${LIB_SUFFIX}) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/lib${LIB}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}.pc @ONLY) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) endmacro() configure_lib(PROTONLIB qpid-proton) configure_lib(PROTONCORELIB qpid-proton-core) if(HAS_PROACTOR) configure_lib(PROTONPROACTORLIB qpid-proton-proactor) endif(HAS_PROACTOR) include(WriteBasicConfigVersionFile) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/ProtonConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake @ONLY) write_basic_config_version_file( ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake VERSION ${PN_VERSION} COMPATIBILITY AnyNewerVersion) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton) # c tests: add_subdirectory(src/tests) # python test: tests/python/proton-test if (BUILD_PYTHON) set (py_root "${pn_test_root}/python") set (py_src "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python") set (py_bin "${CMAKE_CURRENT_BINARY_DIR}/bindings/python") set (py_dll "$") set (py_bld "$") # For windows set (app_path $ "${pn_test_root}/tools/apps/python") set (py_path ${py_bld} ${app_path} $ENV{PATH}) set (py_pythonpath ${py_root} ${py_src} ${py_bin} ${py_dll} $ENV{PYTHONPATH}) to_native_path ("${py_pythonpath}" py_pythonpath) to_native_path ("${py_path}" py_path) if (CMAKE_BUILD_TYPE MATCHES "Coverage") set (python_coverage_options -m coverage run) endif(CMAKE_BUILD_TYPE MATCHES "Coverage") add_test (NAME python-test COMMAND ${env_py} "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}" "SASLPASSWD=${SASLPASSWD_EXE}" ${VALGRIND_ENV} ${PYTHON_EXECUTABLE} -- ${python_coverage_options} "${py_root}/proton-test") set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed") check_python_module("tox" TOX_MODULE_FOUND) if (NOT TOX_MODULE_FOUND) message(STATUS "The tox tool is not available; skipping the python-tox-tests") else () option(ENABLE_TOX_TEST "Enable multi-version python testing with TOX" ON) set(tox_default "py26,py27,py33,py34,py35,py36") set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments for TOX tests" ) mark_as_advanced(TOX_ENVLIST) if (NOT (TOX_ENVLIST STREQUAL tox_default)) message(WARNING "non-default TOX test set '${TOX_ENVLIST}' (default '${tox_default}')") endif() if (ENABLE_TOX_TEST) if (CMAKE_BUILD_TYPE MATCHES "Coverage") message(STATUS "Building for coverage analysis; skipping the python-tox-tests") else () configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/tox.ini.in" "${CMAKE_CURRENT_BINARY_DIR}/tox.ini") add_test (NAME python-tox-test COMMAND ${env_py} "PATH=${py_path}" "SASLPASSWD=${SASLPASSWD_EXE}" "SWIG=${SWIG_EXECUTABLE}" ${VALGRIND_ENV} -- ${PYTHON_EXECUTABLE} -m tox) set_tests_properties(python-tox-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 failed" FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: commands failed") endif () endif (ENABLE_TOX_TEST) endif(NOT TOX_MODULE_FOUND) endif (BUILD_PYTHON) qpid-proton-0.22.0/examples/0000775000000000000000000000000013257152177012567 5ustar qpid-proton-0.22.0/examples/ruby/0000775000000000000000000000000013257152177013550 5ustar qpid-proton-0.22.0/examples/ruby/ssl_send.rb0000664000000000000000000000415413257152177015713 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class SimpleSend < Qpid::Proton::MessagingHandler def initialize(url, address, expected) super() @url = url @address = address @sent = 0 @confirmed = 0 @expected = expected end def on_container_start(container) # Use a default client SSL domain ssl_domain = Qpid::Proton::SSLDomain.new(Qpid::Proton::SSLDomain::MODE_CLIENT) c = container.connect(@url, { :ssl_domain => ssl_domain }) c.open_sender(@address) end def on_connection_open(c) raise "No security!" unless c.transport.ssl? STDOUT.puts "Connection secured with #{c.transport.ssl.protocol_name.inspect}" end def on_sendable(sender) while sender.credit > 0 && @sent < @expected msg = Qpid::Proton::Message.new("sequence #{@sent}", { :id => @sent } ) sender.send(msg) @sent = @sent + 1 end end def on_tracker_accept(tracker) @confirmed = @confirmed + 1 if @confirmed == @expected puts "All #{@expected} messages confirmed!" tracker.connection.close end end end unless (2..3).include? ARGV.size STDERR.puts "Usage: #{__FILE__} URL ADDRESS [COUNT]} Connect to URL and send COUNT messages to ADDRESS" return 1 end url, address, count = ARGV count = Integer(count || 10) Qpid::Proton::Container.new(SimpleSend.new(url, address, count)).run qpid-proton-0.22.0/examples/ruby/ssl_certs/0000775000000000000000000000000013257152177015551 5ustar qpid-proton-0.22.0/examples/ruby/ssl_certs/tserver-private-key.pem0000664000000000000000000000345213257152177022210 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1cT0c2J3GcQCAggA MBQGCCqGSIb3DQMHBAi1hxSX2LJ+EgSCBMheHJ0iXr5A36Natjk/LcAEeKUMT9s+ sMzoQceCWe8qMlQluWksr9iDdZ4JRIE8cpK8dbmx4dLY/SShUzdlhJHCSa4zZBHq 8cZ/jGUF/RF1rqdgjK589eUq+uOl3/gXKzG/SxBqayy6PSn12kX3qnvmlkXCmtwU lg+iBm5wRcJ0MyVHaJkyA8sW8gr186C/VAau6Yu0crQXN7NRo9snrd4ewuYMIEhZ hgaG9XsYQWB1bPhAaKj80CZGxsQbJyTwcbKKkB3IY4WXx8mmhuiNl+vKT3HBJ9Ju YB6tgIjs8CJ4X2P4aU3yNJwG1QldgHSqmFGQ19bcZAw3s3kzwjdzRf4H2V16XOBd zQ5AEs/ffVMzMIAfkb1gYwgunZ2CVwwDJ2mi1RcgkX+Og2aFQc+fxXcVOnDcGLxV 6fuCuZ2lsXfoiIyRh9kj3L75N12GtVUvgBdnMuOc1wPw6XnGQtDwt0acJpdexLMG k0j57r/gcgzTcmF3qNM+y9L/HLssgrJkvVJw2Np5gmtIyfDocsDUWUbClS4dTpYf oTngUTU+vWtHBuaUnb+f5/WJaRS/S7mmR8usbVG3i9WnEr/vlPJpbJFSjW2S6u/H 7cFxKUmmBZsSuEv/EKt9a+Sh62kprOChm4myqfCI1/gvNKfUZC6m0Vp8zf+2LgAq 2RgbMuqysMjWUtV4kDRZT7oCYckUDwsCHdbLES3nmVrtBk2ShMKHBpDp8/GoRuiV jdV7/EjKM/M1kXtFYYe3z7Mxv++lKYIJ7bNwVrQ8nrhce/VwHw6D5emWXNCJXhKZ FW7EM2ZOZ9eaKOlCsIi8sbjV6Yie9IY6HJKKmi3CpO0Tv5kLBdHkru8vGCSFm3O1 n7wz7Ys5FBSlZ19X0NwQSCQX1Q4w+tido6i1SCRX0qJEdTNGuGwVXMHCf4/1zyHV hj8vnxh8fzo79LFrwlTTgwLg1Mr8sEUFFDJ/raJ1AhFXi8n24trtNR8EHxRW8wtD CLCKaqkEqfBiFXK/Yq3RrefCayPHiD+DaNsI8BwefMGpED3vD8YYCjAzXNPh/CSF sc1i1jWMzbJhzOoFSPNXhlfusbUFMFQ/6olatmH47SY6HBBOL3DDP5uQ0jw8P454 QBjlMOpEZmZxO6TcEtJwu0vzgog4rQ5g3NWy6SIpjWehNwTynLt7yM3R5WTI6cZs 0GTv/rqo2/SUoNsFmnGIUwj/DrBe4XOAq1nS2ZlEctxKhBsKH0hMFp6D1rXOzrgl bwcq+oistoB0TLcThShyNgSqzW1znQ1n5SVUk9b5rRhSttJxn3yOMewH0i3v8bPo HOhP5kaGjblPsCYyhlL/SNVF0OXEGTwLNey7FQdWFOwVwTRRXe7k+uGZ2d5hg+Jn It/trDZ1RDYbVmB7/Qy73c16J4mvhOUJ2de5ZciFBjkidbiiUKLj9xnjK9k9Sauo MKhNnDMAEU5VDQM3xNe5BRdX8dFLwfF5H64sU3nROF83aUnDgvfFEowYPnCuPYfm m4aQHfoBSg4j3v1OeOwktcl+Q2TjxPHfWhbWeRBfxOTqQ/suYhnQChuFSK/qyo9K ccgotqghhunRsWMoZT25H7AZM6yKb1sMz/0oyMRIKeGqoYh+ULM5XLY0xNYd4/xU WtQ= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/ruby/ssl_certs/tserver-full.p120000664000000000000000000000465413257152177020540 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  0ùxåÞ`’€‚¨CùÚZ¯­©N(´„ ©éɘõ?Ýè¾DÇ 2íËà0!õºß·uü»fÅ ÷‚¶ò󚓜Néͨ!`öRÎ,Â0F©ò-{¬æû6¤$Âhû1ÍäŸþCn-7bCP³ù®èzݹâæÑoÙÊEKK|̇'§Ka<´¹é‚¶uz¡ˆÆ)Ç£A¶êšÞ6¢§ºƒ«ªhžÄâ:~o¦]Q €q5ËÅ îõd@Í[û„sP-ÏT 2 9F¥©¶ÉÇ3™h¦NÚ¸(ÐÙ[ŽÕ?41*Ϫ°=oÅ­‰í êzµ>=ªYäÂ(ÔÞ¸¤utRû<åÃéè/8*Üà§åâî È)1‚Z[‘AOè•&x¼Ùƒ7ø8Íõ$7W/±¿ƒ¿3ܸzéßli¾!NfÕ–pbQwUpœÚ”ʉ™?Ï‘$·|…ýñ‚ê ¦Is-~, lÔÂêKUq1\iªÊœ Œ¥+>•à‘Eœš9D‡Q:Í4Õcóá IÇ>t¯dÍ3íȉp¢J¢Éþ××F%Ø¢AÀ×IÖyì† `]âÙþäpÚ_Cn›A/Ä€â™Ë7Cá`N>klMì^LV¦ÛjîÒpKÈ„µ²R%ãxœ:7 3¢ÿãÕ=}‚¶8Ná¢X>÷¶8û ))²Ó –"P-…•·aoÖVTùò’BXnõ7íÂq#T¶%C'ˆò‡&|Á®3Y¾GH+U wóñ#I¾…ä¿“öÆzOˆ˜%¥Ú–"›ÙCa‹f‰:1ð¬:âÚa¥fxpzù¥wÄëÐj~óÄä{»=¿Œ“–D¨ pܨ.NêÂ/ç˜a*®±’Û…ù©åÀl[‚•Úç Íyæen’XfÎO×(*1Ù}ãůt \&±®¦ó!ÁÆV_9Q¥£ºº‡r܆­hY¨·x÷Ë"Å…Œöž+nøF²-ê(ÔZïÖ)­À›Y³8u° •¸ó’ôïÇ>ÇÞ?Y†"ƒY†ãö,å™7F•¹ÀØÊ³&G!¥²ít„ ¹Ía/Ûá±j™zF,Ç"²¸¦äíâÌlúòù©ù”˜'Ï©< ~üNy–Ê*¬wT?}dm±¹AÒ3)ÈŽý$…c¼‹E*ö•›Ô7Í[UŒ©£ýð’}FœZC]þt"óÚ7HÔ ”A3 LœÁð\›™DJy0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0ü¿É¹ÂK>‚È"ÛâŠþ»bÊÖþa´eç~ÕGãßo8ÃoŽ—¡›êJ P&°ØÒ(’¸´±ƒX:kHðúƒÏüÐÕçòÝ|ö,†H4Üc£Sôtl]Û»Hò¬¶„ŒkÑ{¤ÜCØmÈSþËwé§ŒGki‚Ü3£¾n&¥NtÛ~•9ÆT2Xåø E׎sæf“VrèÈ»†æ˜)¨ýÀ‚Ðã+«ÙcL‹6dS€OŽÖÕ`"ŽürâE1gÇø\9Ї½‚Øõëï~i·ÿïŽ|CÊCè;ÅÙ¼èêC<>Ž×®àÀßB=.L‚½Û# ,ÁÖ¨Â%©pñ·™çu¢\Ýf|iŽßïTh·áP‡]TmÅ4tÜb?2Q9út­Ä›ª¶Xs¥îqî²Ë#t ` ß8ã zð¿Íð.»‘—ÕðÔ¿I‡‰ë7M Á÷æÛGGºz­G çºbbì’ÁŸYÏ¥=¼«·ðÜÍí¹žõýÍÁÞ%˜×¶bhðëC.iIp…x:&ûª+Ñ0¬ …`Æ&ª’¶Âìé³)T·ºÇ›a9æ€~Q ò¼“¹š}Ú#ÿ»?0¾$,”Rlf-.@~8ÐÜ0ðíø}5îã4Mw¤‡Øöýfzm`<"'×x–Ø]µ4/.ö3k'ü›º!@ð[§?|¤Ñ[=tä›Ã5¶¤×œ"{T $‘íiÙ/Ùö1¶»9/N·"ÃÊè@¿@¾‰¼¬ÛˆGçÏM¹]Ô]l!åW#khüŽ¿¥ mmÚÚ¬%+Ü“.qéŸãѽöb;4flDøñ ²épÕEö%öÒ‡r·^л>Lf7íõZœ¼¯ÉhK‰=ú"ÇGüÆGÝìÍÕÒ²ÛGY'F%¿Ï$›(+óDç²—ƒúÍô âÆà‡lŸ9L¸éFÚ4üOІ|ý`€wÞ®&Å" z>v°ô‡cÈ “ËuÞðÚ\NCÛëòzV¼ŠÈšW½¢5ñŽ˜‰ùý®«'Qëý!®N4ºøÿ€”sH’¸8‹:_¥ÿâû;ð¹éÏVi@ÛaEIówîdݯ7(œÅé[Žö{„{‚-yU -\~¬E«æU·Uáè÷u‡qåppkÉ:.‘¥z4pÛ6¾[GVæ v›j ðšœB5DÚÅ‘fn VPx 7ï’w©ú»d™,Ž´…]71\¬S…c`0(±H´u ‹²‘;eëèyŸä+ÏËÂõ¤ciÇF‚x…·oX âÇþÈ]‚ØL>ô¾2.V^Т~hI?uDÓq{Ò7`dthö:K3®DüýŒàpºgÕ`%ͬtL&ò§¥x,4»‚…ˆ’Za4k3]Mä ß{”Kd[@ã,ƒ’ÀCYï;é7f¨Ûv'+ŽVâ 'st¬|ç "©ä^z[;Ô-qpid-proton-0.22.0/examples/ruby/ssl_certs/tserver-certificate.pem0000664000000000000000000000220713257152177022227 0ustar -----BEGIN CERTIFICATE----- MIIDKzCCAhOgAwIBAgIJAPnYOOQCJ3kDMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV BAMMC3Rlc3Rfc2VydmVyMRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3Rfc2VydmVyMRQw EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAKJNB78lgw4KtXDAvXocTLud6mbn6zgfB6ETIF+kcrukOH9DnPxjLBBM4Lig sp1+kmeudFK5/X8riDrvIW52b/rlEBLgLB+oDtI74m6OTbBs9L+FUFYOuxApetQF qoJy2vf9pWfy4uku24vCpeo7eVLi6ypu4lXE3LR+Km3FruHI1NKonHBMhwXSOWqF pYM6/4IZJ4fbV0+eU0Jrx+05s6XHg5vone2BVJKxeSIBje+zWnNnh8+qG0Z70Jgp aMetME5KGnLNgD1okpH0vb3lwjvuqkkx4WswGVZGbLLkSqqBpXPyM9fCFVy5aKSL DBq7IABQtO67O2nBzK3OyigHrUUCAwEAAaNQME4wHQYDVR0OBBYEFGV1PY0FCFbJ gpcDVKI6JGiRTt3kMB8GA1UdIwQYMBaAFGV1PY0FCFbJgpcDVKI6JGiRTt3kMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIx1TOTGWnnbpan4bse7wuvH GYSNDJhoTVS+X1TC63xukJD1JBAsCNTqg/ZV6lN3XEl7vvOXfGoCiyXM6a9XOKUo gSDtMrIr+wTh6Ss1yRO8QcCJmxH5JDXNu1ojtwsjFW/vneI4IL9kwpDsSlMQEX/E EkkQwtAx/Cvfe7pecZL4qSeykJOUMTts9H8fCAZqEiRZBA3ugJxqF8jwLP3DoFVQ 6QZzKDY6CSPqfMnVb5i0MAIYVDpau+e3N9dgQpZD22F/zbua0OVbfAPdiRMnYxML FT4sxLnh+5YVqwpVWbEKp4onHe2Fq6YIvAxUYAJ3SBA2C8O2RAVKWxf1jko3jYI= -----END CERTIFICATE----- qpid-proton-0.22.0/examples/ruby/ssl_certs/tserver-certificate.p120000664000000000000000000000201013257152177022040 0ustar 0‚0‚Ê *†H†÷  ‚»‚·0‚³0‚¯ *†H†÷  ‚ 0‚œ0‚• *†H†÷ 0 *†H†÷  0àQÙÙ››€‚håÆ`!ìŸ÷ËÒ˜*®¾Þã…ú*eË%£ðj)F5ugIŸ ýYyÝÐÈq’ÅùŽʰªÐ£ ëD ýù‰_Îæ‰œ¯;-e…:ho_·5ÄMŽàß)~c@¸½é_ØòNQ´sŸ`ÉΫz¢¼y;;We"×Þa Õߤ#É¡ Ù«Îÿ>z8íÑ&Ê YÁµÀÿ ‘ÏúÌ &ÿ°ýÍ&èƒÿ7 y|a»ÉÙŠ„_Ÿ~¤äçVñØý—p®gp#ˆZ<‘:‚ÎKZ]í À,P½k~;3#A3¬I›¿€ÉxëÞûò(–;¸¬Ø-‡ŒI‹é’Z·1=Ê4Ehw<ÿpšE¯ οV¼w‹!ÓŒëÞƒ!ÁD šîáM˜%µF^pôD"û…†l6Ô‚,})5ò© ³TÌžë*ÔÊ,›Ÿs? òÕQpÈoñR$f®šþâ¦åªætÎ'Îé¿NóîÛ¿±P9”!VÓMƒÖ6OG݇h‹†€¶ò(õ¸”Iît±Õ\BÌ-»Ê”$„ÇS²×8ºÅ ¹qÍÿÇU¤RÖqRAó/ZvAõ~ÂõjûvÎe&ׂA™­ëªrOU LBHŠõá^³)ˆû"Ï”OD*£l,v!Mý"·ÍàrÐ&œ˜³žý©GçON-Ρ]͸.¥>‰RE¡°ÌVÊ›‹)žs†Ð(æsÇ3Å=ñi¡ÞÍÂULKSyÎSNÖÑø/cfœ,\:÷BÍ:·±¨€Q™n' ׃.•ånL£7¤I8Vá0emÀ%­ ×/~ÀÕÐ/kìp§3Qm)/â8'µXz‚S©‘Ù0Q°þs!xß´ ('˜ #ÌçÕ}›’rÈœ.]zNÓjDŒ õEz!‡žœY´il÷œ/mÇö>¬þ£1W]–CJþÓ8Á?1ưÙÊÀù¦Gi +SéÒµÔó;Ñf»Š<Úoy<¬ð7‘÷b·g¤†îÀ%“ù‰YxB UJäRŽåÙè÷ø¯%³ëà±uiä»QàVMŠeö–cúô!|ùó?Ê…ÊA7(R„h½OSÑø)LPæ,þ‡R_V“~“ é³¾†ã-Õ^¯øæã«®ßoH010!0 +úŒ àheíløéÇš=·.D{‘<ó¸vàqpid-proton-0.22.0/examples/ruby/ssl_certs/tclient-private-key.pem0000664000000000000000000000345213257152177022160 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQICy6ghWp45z4CAggA MBQGCCqGSIb3DQMHBAiVdDoo4NIghQSCBMixGm1bm/omMxsaKnIPO7zm5dyLexJ+ yTFpmh2KV7kQqmpzCyIOdoG6K8YqFnie2XdFWm3S8faRHoMq54bDmyEWIxfQPq5f I1iYFbIZkbnhUvK53RActsEUMf0locS4xylU7VQK3XTAwp0TVip3Lp3ehEMEdcXL iUWibGsoTPKcY9MIWGXZAJXsEXoeHt6k2hHo1G4E0/Bi6mLW1LY/cxZCjHTGD6qI Kt54SCCDvinqVa+rixw6yX9F14EA6bhALami8e+Ccd3lqHOyYlXcBaSS1ezCg6ig oNK97mC+gEGy1KlkZDKWXclFoOCBXRBe4DByre6Rlq3yeI9L42bvAuSBSmf5QT5g 73Yl8vjEAKR65awBT09dPuKu7t+Fb6vkwF8/t+uyj9IuL+42UuXhMLK3ohf+6DbU 8/zB4y3GXI80QmWM0+Wx4n6khFhPFLHt2q0Sn6V9PG1vtHyiq50oSCoyrPQLaecp hefnMCFBYTcT3JUwmoVGGy0boIAwL7T4aGsMt7QhwOx5tU35tKFxyY7m4fX14AKo 2EIy+TPQwCGkGf3Puy/Pc9VA8IAxB5+WwSrjk+NeCv88eIX7gy43k4rCr+OmD9FF wknr3xoP3KYhNXjdZ4Ep/1UHSK+JAtzzbNLQjDcqN+gQPg/yUX6ih0j5K3Wvh9bK E/DvzbpJroUZPgzR+8z5O68CfsD+OIdpHBFTKqAFmzvUuqpADpr998LdCjD+lW+V xZZgZa8KEblwgiH3fdGbYl46Ho1zrZisf439DbqyybAuBIQB4NSZcL/MAgVGO17k QDpVElWZWYrFm4CFTcvS2HvIzRmbefF5m5oJedsN7Q6WQCp+3gnwYx1xIOknd7pW N4AHNnqjscSj9yACj/EiBVKAKNnC5H7ZGZTsaAjMETZyjLXfI2AZ3Fviz4zFR+oz NkAfFB6WUpRpl7H02FzrzYT7XkkLcXd6H6g+mv2iDa9uKWk/PS2QlqnJt8/dHEHD JKTG331yDK5GHlKAVGF3nP5BwFGgTQMuSoeiOervMXPUwDpQ8OaYkuaRej0cZLgT kAF9sUjqdsoYNcXDFHALp6y5g8qYkfrxrlIbKs82zIsmB5I+dtZbUaD3a0zAUrmW 5Xm3Pc9dVP0EXKwfHz6zqPReEw2yYLisB5IoHd4M2wa3GzHBdra1ij4QTmvd3o7e buGFoX8KJQAcig0zpbYkoDP2gPhIh9rY4unVPQNX1Q8/wRsiJAZZsYvZY+A+SmuZ bwSwk+8ZJRsFzdYYYhQeRytD5cDAIQiClcI5Yj4T9dWQV/gf0N/wIBDNTMp0jJAy 1l7PuXTfGZodNJWZH0oqsrNoWbn/k67NildvvofIKX+h09Nxszr670Pvj0qoHd5/ CWq30lnxoJBUgbikFOz6ZuuHi/ZiCXL+haH+v8hJKN5ptRKnyYJQHchRB/IOGRoT 5lmWxo8a7K+yXhp0VBDHJfw3685ms0xQX8Xj4X3MEuN64zd0fB1JmhtP12ydK85J ABawNKlRQPw5weckwtCviXQX+vX25S/xu3xA6IuqlHyqL/1t3DICzuxeOyT2mZxD tKQxEgNihPvu32vn9m74qA3adEaxuWPRkPZuTeITHOkMTZolvqYX/5olBsSgYwka 7/g= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/ruby/ssl_certs/tclient-full.p120000664000000000000000000000465413257152177020510 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  018µVÀ ûB€‚¨ø±!Š›2d޲@¾˜ï,¼UÈ0Á> Æ•c¸³ŽíŸֱ‹ L8SÉ?ÂÔ'ç®YºG´]ØJd³Ð*b§¿Ì /I µŒv¯ø*§±ªHVnâ·bŸiÃU‹iRLÚ'ŠéÌУS¯¦²†î{Øñ²èÑ~ÇG8 }Ú¨]|ƒ«Ýi|)ä‘ý8žVMÀždÓýN‚ïÛÛžÕ…»{µ9ºßÎoS}¹ÎÔä?²c½1>67)òÁ:ˆ:ïÁÈ/é-_/‡öšˆF 7Š›Jmý/ïßÅ«w¦¼O¡`aW NLJU¡ËÅŸõ=îáÃqJíˆYT)µ‡sõ¯1ã–Dg“ZÇÞR4’/_rs#{0XØG¿—þfËÊSäGÝ„<ÿxe«Ä8ô~Ú :_ðÓ¼`ÿÛ©Kÿ~ Æø-snºØkºÙ[kÐIÔ hû9f“Ÿl9„BˆAU¸¼›ºAoIиNƒZvbzÈ.h„FÑËý«ÓÇù?–2±šªéØ0Ð>;9ëHE%8‹À“ÕÞúÓÕ1bBZ!¢Cx®y&þVŠ4?½]yf%Àå‚l4 *ÔÚÓ)¹ŸÎXr½>’ ›ÛL„“ <9ZŠðÜÿ Š(…íFšM´±ìmäZ½0LŒ‹D¢U«M¸C§Aý‘y!C¡1!ëK6î+—Ñ]XK¦Ì§-v,f<úkÐà>{¶çÄ!¹ùù¦2“Ä`÷EeÜOÐÀÎËA³è|$ºÙÂSéiMöª‘e]¦HÆ,s3%¨{öÜ1Cþ̧òDJ9õÀàÐ5:ý%BÁg2]‘Ý <;‹š…Eòš7ëÖ±·ÊÈŠÚê*)Êó'››87êÝ–ÒŽáaòš>†ÌuÙÓ5½¬Ϩ†‘SµC^t=gÞÿœ"Ê(gêú¶!£çôR_¾àM\芙KXlFÚ^$‹¿kl pSMdMÔ×?yUêÈÓ1 䌓"ÃòߦÖËÑœN:\5§õDﻼhD$Éý¨j ~úùlL ^eÄœ d´Àæíf(€7ÿ½²Aº\²ÍÖ˜˜'i.½Zxßø"¾ ¹ÀO¢øml0³É¡y#U·<ä¸Ö ›Y^.Æi6Ìnì,`lÍ‚tç÷~­æn®ì¢— F¥ö@œ‘##*+þ vsÓ qÌ6QoâÆ ª0€qHP³£VFe|Á¸ Ó_D £0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0MÌ©ŽéË‚È×süUsÉ‹«j¹T6?gb'dʸ܉³ö_frZ‰ÂJ‚Lg‹¨®}R$Z1 °ç2Ô‚õX“5‘d?âåž''µÛàÉÃ3¯¿ýñK-)@ `$  ÿw?H$¤vÞU<}»è£\Öï ÌQ OJ˜`¡Á7㥒L¼á¥L€Êy:yVTF*ñqSßšm£¤¼d+ÄÞ%3œ½ò‚cáÌŸ&l1ª0ï~ÞÁ€'¡¢ç‹WŸª\=ñ…CH¾ë `üäèÜPAW'Iþ™Hˆ: òRÒia­ó,þW^ýžž¾ÆŒ²ɧ‚ð #|ç?{DGh‚ßüÉ',/£ßå±;.ÖÛ}°\›"h­x™·Ošø€d@;Èù*Íffm  ­ñ™ÐÑ€&.¯ ed»µ HŸ7–.å'‹”)¤âR͹kpi‹ÐZ$Îr ÷W"E›N~¯ÓÊ@,R{Óá;-‚̼häÄÌÉ#=¨§äžŸI@Ñ‚·FÁ{Â">•³˜xxg«²ØHBŸ&ñ¡sâ^&¹Z¼Çõ‹}Œ/ÉyÍ5{rp{ ƃH¡³»†’?§$6íHàQ¼foð Àñ² lfôYí´¾SÆe…Ï=‡H=Èô}¬¨ƒãØ<: µ¹™ï:Yk¥ÕT®ý*áˆI’apØuOp|X*o^ûwK­‰{ôL?Ëß±ùEz#ÉD™§é³Çò)lĺѓdW0æá(®–$|·Ñp˜lú^$µ©5ØÉÊ'í» Ø>ŒÃì`u:òàšwò¸“[o™ áÛtMœÐpíJ§è/ üI4Iè’ý(#2æ|‘vÄE†6¡àmÿûܦ\tñ ÝyÎñ"6' ak‚Áb‚¸6nþÿ!IÚžl¸&-¼Úg‡—Üf½ ÀwƒfÊl7ãn}oìy‹*}š´½G'©±k¸½]P áªÓ ë÷GÁ’ù#güfoÑÿý|ÃÕâ÷ì"MýøÞÝRtoR++œzõUÓÞ$š!hŸv}z'妡­%”—Oµ”d*˜V­‰¼ýAËígôBW$´²7~ŽõO÷Œ¼ÂùúŽž¼qÞF2‚­rm€Q¢ÊprI m^íEaD¢'ßà(¼v=퇋òøßö¼…­âXäb¹F CôÛÏçr@ ë —\GÝf\å YGÿÊ#\6³²“êx¢V‰©´êô6Òå_&?”“4¿w?×Ü–l=—ì¨2yáj·3é”}Sï«íeƒ’dÑ_d1=½ë–âûŒWÝL`Õdc„ÕÉŽÜ݇CƒœÇ<1#–аèsJü}÷Ò¬ W;¶ŒX×ô³oÑÚOy Ä/ÿY­ôž²ð†.Í€PâŒä–íŠn³Ïg¶Öž¤®(#ó¿„&¨hÛ,†ö„ÅCç3H1D0 *†H†÷  1tclient0# *†H†÷  1ÅHEF²„±eIŒ¸Å÷ÇU_Ãàp?ÔK3b=sXšã¼Gæž/fsÙ z Æbž-R1J21µ ŸçTY°¬ŸÝÙùY—«Ò&®/ê÷ÛÃPà ŸÎ¹W «×¡~‰R˜_Ðî—vgaõ]+²nSqTó-¹‡Å?ß¾¥ò þ± øÖa(…q¼?À*à®yO R'Ü‹lFìaØVPÇ1ûÅì­%Jj» È&·ñyFï÷ËÓ<€ïH;ùTDT,©FBRcâ)^’¤iÙŸ»¾ï,¯ M’ß,ßÒÎÉNrŒÄ7S'>¶‡¾ñòð~ŒD?_ц"ŒÓO¶ØBL¡3°ñq⣑Æ)ÿ»1ç^}½ë>åM·/ÃיzÓéE´càCüßÑ­ðשj¼ÆØõª,¼ÈÄÆ.¹BI4݋ͥ+­ª‘§bà.•œÛǵ»<‰þZl£©X®öpñ€ÍÀE³¡>eóŒÂÜ13lrDoú Q_R®',*üs¨ã[á+ÚcÝqà{óT›þ˱åÝ ‚É(,:ÕL–0i˜ÕXr§Ù.ãÉ= Æ/RÒlïñõñá0`.¾TŽ8:dUö4š b„Xš\n®@’2è†ôÎS)PïŸø¢åhÜ:Âo“sîa›Þ^[¿Áä´|¼êSe÷L­jËèFÚZ%—vZï.!—6"Kê…Õüêœà]óñ]N„©P×Jß¡Ø ?èò,~¯OÑuØ*Ï «ìzêI ŠDöâ!ÃP—È>ßQñ¦Î™µ0ÝÙ‡éJm[„_ç-óbu„®}Û“Žíû}€GDÌÿ¾‰ÜùÈ |©iÙúœòº`¾à¢o^ÁŽÓds@ä÷]I@hO9CÈ·S›¸(Ä€»ÞU¤WÞ3¦dªK,ŠÞ\+D¤7ÍXÈx¬… ½ÿX؉0ôßÁ%™t¯kÇúW¢G›ÿq2ÂC|¸Ý€þŸâåÀüÑÐbMÈzá·$ú’¡×œ¢¯“Îq  [{A* Ë¶Ù³á;!ÂÍœ®nÑð(Cæô;w Àî"010!0 +Ø*×[. 0 && @sent < @expected msg = Qpid::Proton::Message.new("sequence #{@sent}", { :id => @sent } ) sender.send(msg) @sent = @sent + 1 end end def on_tracker_accept(tracker) @confirmed = @confirmed + 1 if @confirmed == @expected puts "All #{@expected} messages confirmed!" tracker.connection.close end end end unless (2..3).include? ARGV.size STDERR.puts "Usage: #{__FILE__} URL ADDRESS [COUNT]} Connect to URL and send COUNT messages to ADDRESS" return 1 end url, address, count = ARGV count = Integer(count || 10) Qpid::Proton::Container.new(SimpleSend.new(url, address, count)).run qpid-proton-0.22.0/examples/ruby/simple_recv.rb0000664000000000000000000000320613257152177016406 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class SimpleReceive < Qpid::Proton::MessagingHandler def initialize(url, address, count) super() @url = url @address = address @expected = count @received = 0 end def on_container_start(container) c = container.connect(@url) c.open_receiver(@address) end def on_message(delivery, message) if @expected.zero? || (@received < @expected) puts "Received: #{message.body}" @received = @received + 1 if @received == @expected delivery.connection.close end end end end unless (2..3).include? ARGV.size STDERR.puts "Usage: #{__FILE__} URL ADDRESS [COUNT]} Connect to URL and receive COUNT messages from ADDRESS" return 1 end url, address, count = ARGV count = Integer(count || 10) Qpid::Proton::Container.new(SimpleReceive.new(url, address, count)).run qpid-proton-0.22.0/examples/ruby/server.rb0000664000000000000000000000411213257152177015401 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class Server < Qpid::Proton::MessagingHandler def initialize(url, address) super() @url = url @address = address @senders = {} end def on_container_start(container) c = container.connect(@url) c.open_receiver(@address) @relay = nil end def on_connection_open(connection) if connection.offered_capabilities && connection.offered_capabilities.contain?("ANONYMOUS-RELAY") @relay = connection.open_sender({:target => nil}) end end def on_message(delivery, message) return unless message.reply_to # Not a request message puts "<- #{message.body}" unless (sender = @relay) sender = (@senders[message.reply_to] ||= delivery.connection.open_sender(message.reply_to)) end reply = Qpid::Proton::Message.new reply.address = message.reply_to reply.body = message.body.upcase puts "-> #{reply.body}" reply.correlation_id = message.correlation_id sender.send(reply) end def on_transport_error(transport) raise "Connection error: #{transport.condition}" end end if ARGV.size != 2 STDERR.puts "Usage: #{__FILE__} URL ADDRESS Server listening on URL, reply to messages to ADDRESS" return 1 end url, address = ARGV Qpid::Proton::Container.new(Server.new(url, address)).run qpid-proton-0.22.0/examples/ruby/helloworld.rb0000664000000000000000000000315113257152177016250 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class HelloWorld < Qpid::Proton::MessagingHandler def initialize(url, address) super() @url, @address = url, address end def on_container_start(container) conn = container.connect(@url) conn.open_sender(@address) conn.open_receiver(@address) end def on_sendable(sender) sender.send(Qpid::Proton::Message.new("Hello world!")) sender.close end def on_message(delivery, message) puts message.body delivery.connection.close end def on_transport_error(transport) raise "Connection error: #{transport.condition}" end end if ARGV.size != 2 STDERR.puts "Usage: #{__FILE__} URL ADDRESS Connect to URL, send a message to ADDRESS and receive it back" return 1 end url, address = ARGV Qpid::Proton::Container.new(HelloWorld.new(url, address)).run qpid-proton-0.22.0/examples/ruby/example_test.rb0000775000000000000000000000662613257152177016604 0ustar #!/usr/bin/env ruby # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # require 'minitest/autorun' require 'qpid_proton' require 'socket' require 'rbconfig' begin MiniTest::Test rescue NameError # For older versions of MiniTest MiniTest::Test = MiniTest::Unit::TestCase end # URL with an unused port def test_url() "amqp://:#{TCPServer.open(0) { |s| s.addr[1] }}" end class ExampleTest < MiniTest::Test def run_script(*args) return IO.popen([ RbConfig.ruby ] + args.map { |a| a.to_s }) end def assert_output(want, *args) assert_equal(want.strip, run_script(*args).read.strip) end def test_helloworld assert_output("Hello world!", "helloworld.rb", $url, "examples") end def test_client_server want = < Twas brillig, and the slithy toves <- TWAS BRILLIG, AND THE SLITHY TOVES -> Did gire and gymble in the wabe. <- DID GIRE AND GYMBLE IN THE WABE. -> All mimsy were the borogroves, <- ALL MIMSY WERE THE BOROGROVES, -> And the mome raths outgrabe. <- AND THE MOME RATHS OUTGRABE. EOS server = run_script("server.rb", $url, "examples") assert_output(want.strip, "client.rb", $url, "examples") ensure Process.kill :TERM, server.pid if server end def test_send_recv assert_output("All 10 messages confirmed!", "simple_send.rb", $url, "examples") want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_output(want.strip, "simple_recv.rb", $url, "examples") end def test_ssl_send_recv out = run_script("ssl_send.rb", $url, "examples").read.strip assert_match(/Connection secured with "...*\"\nAll 10 messages confirmed!/, out) want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_output(want.strip, "simple_recv.rb", $url, "examples") end def test_direct_recv url = test_url p = run_script("direct_recv.rb", url, "examples") p.readline # Wait till ready assert_output("All 10 messages confirmed!", "simple_send.rb", url, "examples") want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_equal(want.strip, p.read.strip) end def test_direct_send url = test_url p = run_script("direct_send.rb", url, "examples") p.readline # Wait till ready want = (0..9).reduce("") { |x,y| x << "Received: sequence #{y}\n" } assert_output(want.strip, "simple_recv.rb", url, "examples") assert_equal("All 10 messages confirmed!", p.read.strip) end end # Start the broker before all tests. $url = test_url $broker = IO.popen([RbConfig.ruby, 'broker.rb', $url]) $broker.readline # Kill the broker after all tests MiniTest.after_run do Process.kill(:TERM, $broker.pid) if $broker end qpid-proton-0.22.0/examples/ruby/direct_send.rb0000664000000000000000000000366713257152177016374 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class DirectSend < Qpid::Proton::MessagingHandler def initialize(url, address, expected) super() @url = url @address = address @sent = 0 @confirmed = 0 @expected = expected end class ListenOnce < Qpid::Proton::Listener::Handler def on_open(l) STDOUT.puts "Listening\n"; STDOUT.flush; end def on_accept(l) l.close; end end def on_container_start(container) container.listen(@url, ListenOnce.new) end def on_sendable(sender) while sender.credit > 0 && @sent < @expected msg = Qpid::Proton::Message.new("sequence #{@sent}", { :id => @sent } ) sender.send(msg) @sent = @sent + 1 end end def on_tracker_accept(tracker) @confirmed = @confirmed + 1 if @confirmed == @expected puts "All #{@expected} messages confirmed!" tracker.connection.close end end end unless (2..3).include? ARGV.size STDERR.puts "Usage: #{__FILE__} URL ADDRESS [COUNT] Listen on URL and send COUNT messages to ADDRESS" return 1 end url, address, count = ARGV count = Integer(count || 10) Qpid::Proton::Container.new(DirectSend.new(url, address, count)).run qpid-proton-0.22.0/examples/ruby/direct_recv.rb0000664000000000000000000000341713257152177016373 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class DirectReceive < Qpid::Proton::MessagingHandler def initialize(url, address, count) super() @url = url @address = address @expected = count @received = 0 end class ListenOnce < Qpid::Proton::Listener::Handler def on_open(l) STDOUT.puts "Listening\n"; STDOUT.flush; end def on_accept(l) l.close; end end def on_container_start(container) container.listen(@url, ListenOnce.new) end def on_message(delivery, message) if @expected.zero? || (@received < @expected) puts "Received: #{message.body}" @received = @received + 1 if @received == @expected delivery.connection.close end end end end unless (2..3).include? ARGV.size STDERR.puts "Usage: #{__FILE__} URL ADDRESS [COUNT] Listen on URL and receive COUNT messages from ADDRESS" return 1 end url, address, count = ARGV count = Integer(count || 10) Qpid::Proton::Container.new(DirectReceive.new(url, address, count)).run qpid-proton-0.22.0/examples/ruby/client.rb0000664000000000000000000000417413257152177015361 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' class Client < Qpid::Proton::MessagingHandler def initialize(url, address, requests) super() @url = url @address = address @requests = requests end def on_container_start(container) c = container.connect(@url) @sender = c.open_sender(@address) @receiver = c.open_receiver({:dynamic => true}) end def next_request if @receiver.remote_source.address req = Qpid::Proton::Message.new req.reply_to = @receiver.remote_source.address req.body = @requests.first puts "-> #{req.body}" @sender.send(req) end end def on_receiver_open(receiver) next_request end def on_message(delivery, message) puts "<- #{message.body}" @requests.delete_at(0) if !@requests.empty? next_request else delivery.connection.close end end def on_transport_error(transport) raise "Connection error: #{transport.condition}" end end REQUESTS = ["Twas brillig, and the slithy toves", "Did gire and gymble in the wabe.", "All mimsy were the borogroves,", "And the mome raths outgrabe."] if ARGV.size != 2 STDERR.puts "Usage: #{__FILE__} URL ADDRESS Connect to URL and send messages to ADDRESS" return 1 end url, address = ARGV Qpid::Proton::Container.new(Client.new(url, address, REQUESTS)).run qpid-proton-0.22.0/examples/ruby/broker.rb0000664000000000000000000001165513257152177015371 0ustar #-- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. #++ require 'qpid_proton' require 'optparse' require 'pathname' # Thread safe message queue that notifies waiting senders when messages arrive. class MessageQueue def initialize @lock = Mutex.new # Make ations on the queue atomic @messages = [] # Messages on the queue @waiting = [] # Senders that are waiting for messages end # Push a message onto the queue and notify any waiting senders def push(message) @lock.synchronize do @messages << message unless @waiting.empty? # Notify waiting senders # NOTE: the call to self.send_to is added to the sender's work_queue, # and will be executed in the sender's thread @waiting.each { |s| s.work_queue.add { self.send_to(s); } } @waiting.clear end end end # Pop a message off the queue. # If no messages available, record sender as waiting and return nil. def pop(sender) @lock.synchronize do if @messages.empty? @waiting << sender nil else @messages.shift end end end # NOTE: Called in sender's thread. # Pull messages from the queue as long as sender has credit. # If queue runs out of messages, record sender as waiting. def send_to(sender) while sender.credit > 0 && (message = pop(sender)) sender.send(message) end end def forget(sender) @lock.synchronize { @waiting.delete(sender) } end end # Handler for broker connections. In a multi-threaded application you should # normally create a separate handler instance for each connection. class BrokerHandler < Qpid::Proton::MessagingHandler def initialize(broker) @broker = broker end def on_sender_open(sender) if sender.remote_source.dynamic? sender.source.address = SecureRandom.uuid elsif sender.remote_source.address sender.source.address = sender.remote_source.address else sender.connection.close("no source address") return end q = @broker.queue(sender.source.address) q.send_to(sender) end def on_receiver_open(receiver) if receiver.remote_target.address receiver.target.address = receiver.remote_target.address else receiver.connection.close("no target address") end end def on_sender_close(sender) q = @broker.queue(sender.source.address) q.forget(sender) if q end def on_connection_close(connection) connection.each_sender { |s| on_sender_close(s) } end def on_transport_close(transport) transport.connection.each_sender { |s| on_sender_close(s) } end def on_sendable(sender) @broker.queue(sender.source.address).send_to(sender) end def on_message(delivery, message) @broker.queue(delivery.receiver.target.address).push(message) end end # Broker manages the queues and accepts incoming connections. class Broker < Qpid::Proton::Listener::Handler def initialize @queues = {} @connection_options = {} ssl_setup end def ssl_setup # Optional SSL setup ssl = Qpid::Proton::SSLDomain.new(Qpid::Proton::SSLDomain::MODE_SERVER) cert_passsword = "tserverpw" if Gem.win_platform? # Use P12 certs for windows schannel ssl.credentials("ssl_certs/tserver-certificate.p12", "", cert_passsword) else ssl.credentials("ssl_certs/tserver-certificate.pem", "ssl_certs/tserver-private-key.pem", cert_passsword) end ssl.allow_unsecured_client # SSL is optional, this is not secure. @connection_options[:ssl_domain] = ssl if ssl rescue # Don't worry if we can't set up SSL. end def on_open(l) STDOUT.puts "Listening on #{l}\n"; STDOUT.flush end # Create a new BrokerHandler instance for each connection we accept def on_accept(l) { :handler => BrokerHandler.new(self) }.update(@connection_options) end def queue(address) @queues[address] ||= MessageQueue.new end end if ARGV.size != 1 STDERR.puts "Usage: #{__FILE__} URL Start an example broker listening on URL" return 1 end url, = ARGV container = Qpid::Proton::Container.new container.listen(url, Broker.new) # Run the container in multiple threads. threads = 4.times.map { Thread.new { container.run }} threads.each { |t| t.join } qpid-proton-0.22.0/examples/ruby/README.md0000664000000000000000000001041513257152177015030 0ustar ## Simple Examples ### The Broker The examples come with a sample broker which can be used by other examples and which also works as an example itself. For now we'll just start up the broker example and tell it to listen on port 8888: ```` $ ruby broker.rb amqp://:8888 Listening on amqp://:8888 ```` This example broker will receive messages, create queues as needed, and deliver messages to endpoints. ### Hello World Using A Broker Our first example creates an endpoint that sends messages to a queue to which it is subscribed. So it both sends and receives a message. To start it, simply run: ``` $ ruby helloworld.rb //:8888 Hello world! ``` As you can see, the classic message was output by the example. Now let's take a look at what's going on under the covers. #### Events When Talking To A Broker The following events occur while **helloworld.rb** runs: * **on_start** - Fired when the application is started. * **on_sendable** - Fired when a message can be sent. * **on_message** - Fired when a message is received. ## More Complex Examples Now that we've covered the basics with the archetypical hello world app, let's look at some more interesting examples. The following two client examples send and receive messages to an external broker or server: * **simple_send.rb** - connect to a server, send messages to an address * **simple_recv.rb** - connect to a server, receives messages from an address For example: start `broker.rb`; run `simple_send.rb` to send messages to a broker queue; then `simple_recv.rb` to receive the messages from the broker. The following two examples are *servers* that can be connected to directly, without a broker: * **direct_send.rb** - sends messages directly to a receiver and listens for responses itself, and * **direct_recv.rb** - receives messages directly. For example if you start `direct_recv.rb`, you can connect to it directly with `simple_send.rb` vice-versa with `direct_send.rb` and `simple_recv.rb` In this set of examples we see the following event occurring, in addition to what we've seen before: * **on_transport_close** - Fired when the network transport is closed. ## Now About That Broker example The **broker.rb** example application is a nice demonstration of doing something more interesting in Ruby with Proton, and shows how to use multiple threads. The broker listens for incoming connections and sender/receiver links. It uses the source and target address of senders and receivers to identify a queue. Messages from receivers go on the queue, and are sent via senders. The components of the broker example include: * **Broker** is a Listener::Handler that accepts connections, and manages the set of named queues. * **BrokerHandler** extends MessagingHandler to accept incoming connections, senders and receivers and transfers messages between them and the Broker's queues. * **MessageQueue** - A queue of messages that keeps track of waiting senders. The broker application demonstrates a new set of events: * **on_sender_open** - Fired when a sender link is opened, the broker gets the address and starts sending messages from the corresponding queue. * **on_sender_close** - Fired when a sender link is closed, remove the sender from the queue so no more messages are sent. * **on_connection_close** - Fired when the remote connection is closes, close all senders. * **on_transport_close** - Fired when the transport (socket) has closed, close all senders. It also demonstrates aspects of multi-threaded proton: * **Thread safe MessageQueue** Uses a Mutex to make actions atomic when called concurrently. * **Using WorkQueue** Proton objects like Sender are not thread safe. They are normally only used in MessagingHandler#on_ callbacks. To request work from a different thread you can add a code block to a WorkQueue, as shown in MessageQueue#push. * **Listener::Handler** The broker creates a new BrokerHandler instance for each accepted connection. The container ensures that calls on each handler instance are serialized even if there are multiple threads in the container. * **Calling Container#run in multiple threads** The Container uses threads that call #run as a thread pool to dispatch calls to MessagingHandler instances. Even if there are multiple threads, calls to handler instance are serialized. qpid-proton-0.22.0/examples/python/0000775000000000000000000000000013257152177014110 5ustar qpid-proton-0.22.0/examples/python/tx_send.py0000775000000000000000000000672213257152177016140 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Message, Url from proton.reactor import Container from proton.handlers import MessagingHandler, TransactionHandler class TxSend(MessagingHandler, TransactionHandler): def __init__(self, url, messages, batch_size): super(TxSend, self).__init__() self.url = Url(url) self.current_batch = 0 self.committed = 0 self.confirmed = 0 self.total = messages self.batch_size = batch_size def on_start(self, event): self.container = event.container self.conn = self.container.connect(self.url) self.sender = self.container.create_sender(self.conn, self.url.path) self.container.declare_transaction(self.conn, handler=self) self.transaction = None def on_transaction_declared(self, event): self.transaction = event.transaction self.send() def on_sendable(self, event): self.send() def send(self): while self.transaction and self.sender.credit and (self.committed + self.current_batch) < self.total: seq = self.committed + self.current_batch + 1 msg = Message(id=seq, body={'sequence':seq}) self.transaction.send(self.sender, msg) self.current_batch += 1 if self.current_batch == self.batch_size: self.transaction.commit() self.transaction = None def on_accepted(self, event): if event.sender == self.sender: self.confirmed += 1 def on_transaction_committed(self, event): self.committed += self.current_batch if self.committed == self.total: print("all messages committed") event.connection.close() else: self.current_batch = 0 self.container.declare_transaction(self.conn, handler=self) def on_disconnected(self, event): self.current_batch = 0 parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send messages transactionally to the supplied address.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to send (default %default)") parser.add_option("-b", "--batch-size", type="int", default=10, help="number of messages in each transaction (default %default)") opts, args = parser.parse_args() try: Container(TxSend(opts.address, opts.messages, opts.batch_size)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/tx_recv_interactive.py0000775000000000000000000000535413257152177020543 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import sys import threading from proton.reactor import ApplicationEvent, Container, EventInjector from proton.handlers import MessagingHandler, TransactionHandler class TxRecv(MessagingHandler, TransactionHandler): def __init__(self): super(TxRecv, self).__init__(prefetch=0, auto_accept=False) def on_start(self, event): self.container = event.container self.conn = self.container.connect("localhost:5672") self.receiver = self.container.create_receiver(self.conn, "examples") self.container.declare_transaction(self.conn, handler=self, settle_before_discharge=True) self.transaction = None def on_message(self, event): print(event.message.body) self.transaction.accept(event.delivery) def on_transaction_declared(self, event): self.transaction = event.transaction print("transaction declared") def on_transaction_committed(self, event): print("transaction committed") self.container.declare_transaction(self.conn, handler=self) def on_transaction_aborted(self, event): print("transaction aborted") self.container.declare_transaction(self.conn, handler=self) def on_commit(self, event): self.transaction.commit() def on_abort(self, event): self.transaction.abort() def on_fetch(self, event): self.receiver.flow(1) def on_quit(self, event): c = self.receiver.connection self.receiver.close() c.close() try: reactor = Container(TxRecv()) events = EventInjector() reactor.selectable(events) thread = threading.Thread(target=reactor.run) thread.daemon=True thread.start() print("Enter 'fetch', 'commit' or 'abort'") while True: line = sys.stdin.readline() if line: events.trigger(ApplicationEvent(line.strip())) else: break except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/tx_recv.py0000775000000000000000000000603013257152177016136 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import optparse from proton import Url from proton.reactor import Container from proton.handlers import MessagingHandler, TransactionHandler class TxRecv(MessagingHandler, TransactionHandler): def __init__(self, url, messages, batch_size): super(TxRecv, self).__init__(prefetch=0, auto_accept=False) self.url = Url(url) self.expected = messages self.batch_size = batch_size self.current_batch = 0 self.committed = 0 def on_start(self, event): self.container = event.container self.conn = self.container.connect(self.url) self.receiver = self.container.create_receiver(self.conn, self.url.path) self.container.declare_transaction(self.conn, handler=self) self.transaction = None def on_message(self, event): print(event.message.body) self.transaction.accept(event.delivery) self.current_batch += 1 if self.current_batch == self.batch_size: self.transaction.commit() self.transaction = None def on_transaction_declared(self, event): self.receiver.flow(self.batch_size) self.transaction = event.transaction def on_transaction_committed(self, event): self.committed += self.current_batch self.current_batch = 0 if self.expected == 0 or self.committed < self.expected: self.container.declare_transaction(self.conn, handler=self) else: event.connection.close() def on_disconnected(self, event): self.current_batch = 0 parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to receive; 0 receives indefinitely (default %default)") parser.add_option("-b", "--batch-size", type="int", default=10, help="number of messages in each transaction (default %default)") opts, args = parser.parse_args() try: Container(TxRecv(opts.address, opts.messages, opts.batch_size)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/test_examples.py0000664000000000000000000001675613257152177017356 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import sys import subprocess import time import unittest if sys.version_info[0] == 2: _unicode_prefix = 'u' else: _unicode_prefix = '' class ExamplesTest(unittest.TestCase): def test_helloworld(self, example="helloworld.py"): p = subprocess.Popen([example], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) p.wait() output = [l.strip() for l in p.stdout] self.assertEqual(output, ['Hello World!']) def test_helloworld_direct(self): self.test_helloworld('helloworld_direct.py') def test_helloworld_blocking(self): self.test_helloworld('helloworld_blocking.py') def test_helloworld_tornado(self): self.test_helloworld('helloworld_tornado.py') def test_helloworld_direct_tornado(self): self.test_helloworld('helloworld_direct_tornado.py') def test_simple_send_recv(self, recv='simple_recv.py', send='simple_send.py'): r = subprocess.Popen([recv], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s = subprocess.Popen([send], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s.wait() r.wait() actual = [l.strip() for l in r.stdout] expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)] self.assertEqual(actual, expected) def test_client_server(self, client=['client.py'], server=['server.py'], sleep=0): s = subprocess.Popen(server, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) if sleep: time.sleep(sleep) c = subprocess.Popen(client, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) c.wait() s.terminate() actual = [l.strip() for l in c.stdout] inputs = ["Twas brillig, and the slithy toves", "Did gire and gymble in the wabe.", "All mimsy were the borogroves,", "And the mome raths outgrabe."] expected = ["%s => %s" % (l, l.upper()) for l in inputs] self.assertEqual(actual, expected) def test_sync_client_server(self): self.test_client_server(client=['sync_client.py']) def test_client_server_tx(self): self.test_client_server(server=['server_tx.py']) def test_sync_client_server_tx(self): self.test_client_server(client=['sync_client.py'], server=['server_tx.py']) def test_client_server_direct(self): self.test_client_server(client=['client.py', '-a', 'localhost:8888/examples'], server=['server_direct.py'], sleep=0.5) def test_sync_client_server_direct(self): self.test_client_server(client=['sync_client.py', '-a', 'localhost:8888/examples'], server=['server_direct.py'], sleep=0.5) def test_db_send_recv(self): self.maxDiff = None # setup databases subprocess.check_call(['db_ctrl.py', 'init', './src_db']) subprocess.check_call(['db_ctrl.py', 'init', './dst_db']) fill = subprocess.Popen(['db_ctrl.py', 'insert', './src_db'], stdin=subprocess.PIPE, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) for i in range(100): fill.stdin.write("Message-%i\n" % (i+1)) fill.stdin.close() fill.wait() # run send and recv r = subprocess.Popen(['db_recv.py', '-m', '100'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s = subprocess.Popen(['db_send.py', '-m', '100'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s.wait() r.wait() # verify output of receive actual = [l.strip() for l in r.stdout] expected = ["inserted message %i" % (i+1) for i in range(100)] self.assertEqual(actual, expected) # verify state of databases v = subprocess.Popen(['db_ctrl.py', 'list', './dst_db'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) v.wait() expected = ["(%i, %s'Message-%i')" % ((i+1), _unicode_prefix, (i+1)) for i in range(100)] actual = [l.strip() for l in v.stdout] self.assertEqual(actual, expected) def test_tx_send_tx_recv(self): self.test_simple_send_recv(recv='tx_recv.py', send='tx_send.py') def test_simple_send_direct_recv(self): self.maxDiff = None r = subprocess.Popen(['direct_recv.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) time.sleep(0.5) s = subprocess.Popen(['simple_send.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s.wait() r.wait() actual = [l.strip() for l in r.stdout] expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)] self.assertEqual(actual, expected) def test_direct_send_simple_recv(self): s = subprocess.Popen(['direct_send.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) time.sleep(0.5) r = subprocess.Popen(['simple_recv.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) r.wait() s.wait() actual = [l.strip() for l in r.stdout] expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)] self.assertEqual(actual, expected) def test_selected_recv(self): s = subprocess.Popen(['colour_send.py'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) s.wait() r = subprocess.Popen(['selected_recv.py', '-m', '50'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) r.wait() actual = [l.strip() for l in r.stdout] expected = ["green %i" % (i+1) for i in range(100) if i % 2 == 0] self.assertEqual(actual, expected) r2 = subprocess.Popen(['simple_recv.py', '-m', '50'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True) r2.wait() actual = [l.strip() for l in r2.stdout] expected = ["red %i" % (i+1) for i in range(100) if i % 2 == 1] self.assertEqual(actual, expected) qpid-proton-0.22.0/examples/python/sync_client.py0000775000000000000000000000422513257152177017002 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # """ Demonstrates the client side of the synchronous request-response pattern (also known as RPC or Remote Procedure Call) using proton. """ from __future__ import print_function, unicode_literals import optparse from proton import Message, Url, ConnectionException, Timeout from proton.utils import SyncRequestResponse, BlockingConnection from proton.handlers import IncomingMessageHandler import sys parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send requests to the supplied address and print responses.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-t", "--timeout", type="float", default=5, help="Give up after this time out (default %default)") opts, args = parser.parse_args() url = Url(opts.address) client = SyncRequestResponse(BlockingConnection(url, timeout=opts.timeout), url.path) try: REQUESTS= ["Twas brillig, and the slithy toves", "Did gire and gymble in the wabe.", "All mimsy were the borogroves,", "And the mome raths outgrabe."] for request in REQUESTS: response = client.call(Message(body=request)) print("%s => %s" % (request, response.body)) finally: client.connection.close() qpid-proton-0.22.0/examples/python/simple_send.py0000775000000000000000000000444213257152177016773 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container class Send(MessagingHandler): def __init__(self, url, messages): super(Send, self).__init__() self.url = url self.sent = 0 self.confirmed = 0 self.total = messages def on_start(self, event): event.container.create_sender(self.url) def on_sendable(self, event): while event.sender.credit and self.sent < self.total: msg = Message(id=(self.sent+1), body={'sequence':(self.sent+1)}) event.sender.send(msg) self.sent += 1 def on_accepted(self, event): self.confirmed += 1 if self.confirmed == self.total: print("all messages confirmed") event.connection.close() def on_disconnected(self, event): self.sent = self.confirmed parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send messages to the supplied address.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to send (default %default)") opts, args = parser.parse_args() try: Container(Send(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/simple_recv.py0000775000000000000000000000414013257152177016774 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import optparse from proton.handlers import MessagingHandler from proton.reactor import Container class Recv(MessagingHandler): def __init__(self, url, count): super(Recv, self).__init__() self.url = url self.expected = count self.received = 0 def on_start(self, event): event.container.create_receiver(self.url) def on_message(self, event): if event.message.id and event.message.id < self.received: # ignore duplicate message return if self.expected == 0 or self.received < self.expected: print(event.message.body) self.received += 1 if self.received == self.expected: event.receiver.close() event.connection.close() parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to receive; 0 receives indefinitely (default %default)") opts, args = parser.parse_args() try: Container(Recv(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/server_tx.py0000775000000000000000000000567513257152177016523 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton import Message from proton.reactor import Container from proton.handlers import MessagingHandler, TransactionHandler class TxRequest(TransactionHandler): def __init__(self, response, sender, request_delivery): super(TxRequest, self).__init__() self.response = response self.sender = sender self.request_delivery = request_delivery def on_transaction_declared(self, event): event.transaction.send(self.sender, self.response) event.transaction.accept(self.request_delivery) event.transaction.commit() def on_transaction_committed(self, event): print("Request processed successfully") def on_transaction_aborted(self, event): print("Request processing aborted") class TxServer(MessagingHandler): def __init__(self, host, address): super(TxServer, self).__init__(auto_accept=False) self.host = host self.address = address def on_start(self, event): self.container = event.container self.conn = event.container.connect(self.host, reconnect=False) self.receiver = event.container.create_receiver(self.conn, self.address) self.senders = {} self.relay = None def on_message(self, event): sender = self.relay if not sender: sender = self.senders.get(event.message.reply_to) if not sender: sender = self.container.create_sender(self.conn, event.message.reply_to) self.senders[event.message.reply_to] = sender response = Message(address=event.message.reply_to, body=event.message.body.upper(), correlation_id=event.message.correlation_id) self.container.declare_transaction(self.conn, handler=TxRequest(response, sender, event.delivery)) def on_connection_open(self, event): if event.connection.remote_offered_capabilities and 'ANONYMOUS-RELAY' in event.connection.remote_offered_capabilities: self.relay = self.container.create_sender(self.conn, None) try: Container(TxServer("localhost:5672", "examples")).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/server_direct.py0000775000000000000000000000471413257152177017333 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton import generate_uuid, Message from proton.handlers import MessagingHandler from proton.reactor import Container class Server(MessagingHandler): def __init__(self, url): super(Server, self).__init__() self.url = url self.senders = {} def on_start(self, event): print("Listening on", self.url) self.container = event.container self.acceptor = event.container.listen(self.url) def on_link_opening(self, event): if event.link.is_sender: if event.link.remote_source and event.link.remote_source.dynamic: event.link.source.address = str(generate_uuid()) self.senders[event.link.source.address] = event.link elif event.link.remote_target and event.link.remote_target.address: event.link.target.address = event.link.remote_target.address self.senders[event.link.remote_target.address] = event.link elif event.link.remote_source: event.link.source.address = event.link.remote_source.address elif event.link.remote_target: event.link.target.address = event.link.remote_target.address def on_message(self, event): print("Received", event.message) sender = self.senders.get(event.message.reply_to) if not sender: print("No link for reply") return sender.send(Message(address=event.message.reply_to, body=event.message.body.upper(), correlation_id=event.message.correlation_id)) try: Container(Server("0.0.0.0:8888")).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/server.py0000775000000000000000000000402613257152177015775 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import optparse from proton import Message, Url from proton.handlers import MessagingHandler from proton.reactor import Container class Server(MessagingHandler): def __init__(self, url, address): super(Server, self).__init__() self.url = url self.address = address def on_start(self, event): print("Listening on", self.url) self.container = event.container self.conn = event.container.connect(self.url) self.receiver = event.container.create_receiver(self.conn, self.address) self.server = self.container.create_sender(self.conn, None) def on_message(self, event): print("Received", event.message) self.server.send(Message(address=event.message.reply_to, body=event.message.body.upper(), correlation_id=event.message.correlation_id)) parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") opts, args = parser.parse_args() url = Url(opts.address) try: Container(Server(url, url.path)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/selected_recv.py0000775000000000000000000000405013257152177017273 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Url from proton.reactor import Container, Selector from proton.handlers import MessagingHandler class Recv(MessagingHandler): def __init__(self, url, count): super(Recv, self).__init__() self.url = Url(url) self.expected = count self.received = 0 def on_start(self, event): conn = event.container.connect(self.url) event.container.create_receiver(conn, self.url.path, options=Selector("colour = 'green'")) def on_message(self, event): print(event.message.body) self.received += 1 if self.received == self.expected: event.receiver.close() event.connection.close() parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") parser.add_option("-m", "--messages", type="int", default=0, help="number of messages to receive; 0 receives indefinitely (default %default)") opts, args = parser.parse_args() try: Container(Recv(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/recurring_timer_tornado.py0000775000000000000000000000262713257152177021422 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import time from proton.reactor import Handler from proton_tornado import TornadoLoop class Recurring(Handler): def __init__(self, period): self.period = period def on_start(self, event): self.container = event.container self.container.schedule(time.time() + self.period, subject=self) def on_timer(self, event): print("Tick...") self.container.schedule(time.time() + self.period, subject=self) try: container = TornadoLoop(Recurring(1.0)) container.run() except KeyboardInterrupt: container.stop() print() qpid-proton-0.22.0/examples/python/recurring_timer.py0000775000000000000000000000251313257152177017666 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton.reactor import Container, Handler class Recurring(Handler): def __init__(self, period): self.period = period def on_reactor_init(self, event): self.container = event.reactor self.container.schedule(self.period, self) def on_timer_task(self, event): print("Tick...") self.container.schedule(self.period, self) try: container = Container(Recurring(1.0)) container.run() except KeyboardInterrupt: container.stop() print() qpid-proton-0.22.0/examples/python/queue_browser.py0000775000000000000000000000262313257152177017357 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton.reactor import Container, Copy from proton.handlers import MessagingHandler class Recv(MessagingHandler): def __init__(self): super(Recv, self).__init__() def on_start(self, event): conn = event.container.connect("localhost:5672") event.container.create_receiver(conn, "examples", options=Copy()) def on_message(self, event): print(event.message) if event.receiver.queued == 0 and event.receiver.drained: event.connection.close() try: Container(Recv()).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/proton_tornado.py0000775000000000000000000000701113257152177017533 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import tornado.ioloop from proton.reactor import Container as BaseContainer from proton.handlers import IOHandler class TornadoLoopHandler: def __init__(self, loop=None, handler_base=None): self.loop = loop or tornado.ioloop.IOLoop.instance() self.io = handler_base or IOHandler() self.count = 0 def on_reactor_init(self, event): self.reactor = event.reactor def on_reactor_quiesced(self, event): event.reactor.yield_() def on_unhandled(self, name, event): event.dispatch(self.io) def _events(self, sel): events = self.loop.ERROR if sel.reading: events |= self.loop.READ if sel.writing: events |= self.loop.WRITE return events def _schedule(self, sel): if sel.deadline: self.loop.add_timeout(sel.deadline, lambda: self._expired(sel)) def _expired(self, sel): sel.expired() def _process(self): self.reactor.process() if not self.reactor.quiesced: self.loop.add_callback(self._process) def _callback(self, sel, events): if self.loop.READ & events: sel.readable() if self.loop.WRITE & events: sel.writable() self._process() def on_selectable_init(self, event): sel = event.context if sel.fileno() >= 0: self.loop.add_handler(sel.fileno(), lambda fd, events: self._callback(sel, events), self._events(sel)) self._schedule(sel) self.count += 1 def on_selectable_updated(self, event): sel = event.context if sel.fileno() > 0: self.loop.update_handler(sel.fileno(), self._events(sel)) self._schedule(sel) def on_selectable_final(self, event): sel = event.context if sel.fileno() > 0: self.loop.remove_handler(sel.fileno()) sel.release() self.count -= 1 if self.count == 0: self.loop.add_callback(self._stop) def _stop(self): self.reactor.stop() self.loop.stop() class Container(object): def __init__(self, *handlers, **kwargs): self.tornado_loop = kwargs.get('loop', tornado.ioloop.IOLoop.instance()) kwargs['global_handler'] = TornadoLoopHandler(self.tornado_loop, kwargs.get('handler_base', None)) self.container = BaseContainer(*handlers, **kwargs) def initialise(self): self.container.start() self.container.process() def run(self): self.initialise() self.tornado_loop.start() def touch(self): self._process() def _process(self): self.container.process() if not self.container.quiesced: self.tornado_loop.add_callback(self._process) qpid-proton-0.22.0/examples/python/proton_server.py0000775000000000000000000000337613257152177017405 0ustar from __future__ import print_function # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from proton import Message from proton.reactor import Container from proton.handlers import MessagingHandler class Server(MessagingHandler): def __init__(self, host, address): super(Server, self).__init__() self.container = Container(self) self.conn = self.container.connect(host) self.receiver = self.container.create_receiver(self.conn, address) self.sender = self.container.create_sender(self.conn, None) def on_message(self, event): self.on_request(event.message.body, event.message.reply_to) def on_connection_close(self, endpoint, error): if error: print("Closed due to %s" % error) self.conn.close() def run(self): self.container.run() def send(self, response, reply_to): msg = Message(body=response) if self.sender: msg.address = reply_to self.sender.send(msg) def on_request(self, request, reply_to): pass qpid-proton-0.22.0/examples/python/proton-server.conf0000664000000000000000000000003613257152177017603 0ustar mech_list: EXTERNAL ANONYMOUS qpid-proton-0.22.0/examples/python/helloworld_tornado.py0000775000000000000000000000312613257152177020370 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton import Message from proton.handlers import MessagingHandler from proton_tornado import Container class HelloWorld(MessagingHandler): def __init__(self, server, address): super(HelloWorld, self).__init__() self.server = server self.address = address def on_start(self, event): conn = event.container.connect(self.server) event.container.create_receiver(conn, self.address) event.container.create_sender(conn, self.address) def on_sendable(self, event): event.sender.send(Message(body="Hello World!")) event.sender.close() def on_message(self, event): print(event.message.body) event.connection.close() Container(HelloWorld("localhost:5672", "examples")).run() qpid-proton-0.22.0/examples/python/helloworld_direct_tornado.py0000775000000000000000000000311613257152177021721 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton import Message from proton.handlers import MessagingHandler from proton_tornado import Container class HelloWorld(MessagingHandler): def __init__(self, url): super(HelloWorld, self).__init__() self.url = url def on_start(self, event): self.acceptor = event.container.listen(self.url) event.container.create_sender(self.url) def on_sendable(self, event): event.sender.send(Message(body="Hello World!")) event.sender.close() def on_message(self, event): print(event.message.body) def on_accepted(self, event): event.connection.close() def on_connection_closed(self, event): self.acceptor.close() Container(HelloWorld("localhost:8888/examples")).run() qpid-proton-0.22.0/examples/python/helloworld_direct.py0000775000000000000000000000314013257152177020170 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container class HelloWorld(MessagingHandler): def __init__(self, url): super(HelloWorld, self).__init__() self.url = url def on_start(self, event): self.acceptor = event.container.listen(self.url) event.container.create_sender(self.url) def on_sendable(self, event): event.sender.send(Message(body="Hello World!")) event.sender.close() def on_message(self, event): print(event.message.body) def on_accepted(self, event): event.connection.close() def on_connection_closed(self, event): self.acceptor.close() Container(HelloWorld("localhost:8888/examples")).run() qpid-proton-0.22.0/examples/python/helloworld_blocking.py0000775000000000000000000000231313257152177020507 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton import Message from proton.utils import BlockingConnection from proton.handlers import IncomingMessageHandler conn = BlockingConnection("localhost:5672") receiver = conn.create_receiver("examples") sender = conn.create_sender("examples") sender.send(Message(body="Hello World!")); msg = receiver.receive(timeout=30) print(msg.body) receiver.accept() conn.close() qpid-proton-0.22.0/examples/python/helloworld.py0000775000000000000000000000315013257152177016637 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container class HelloWorld(MessagingHandler): def __init__(self, server, address): super(HelloWorld, self).__init__() self.server = server self.address = address def on_start(self, event): conn = event.container.connect(self.server) event.container.create_receiver(conn, self.address) event.container.create_sender(conn, self.address) def on_sendable(self, event): event.sender.send(Message(body="Hello World!")) event.sender.close() def on_message(self, event): print(event.message.body) event.connection.close() Container(HelloWorld("localhost:5672", "examples")).run() qpid-proton-0.22.0/examples/python/direct_send.py0000775000000000000000000000451513257152177016755 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container class Send(MessagingHandler): def __init__(self, url, messages): super(Send, self).__init__() self.url = url self.sent = 0 self.confirmed = 0 self.total = messages def on_start(self, event): self.acceptor = event.container.listen(self.url) def on_sendable(self, event): while event.sender.credit and self.sent < self.total: msg = Message(id=(self.sent+1), body={'sequence':(self.sent+1)}) event.sender.send(msg) self.sent += 1 def on_accepted(self, event): self.confirmed += 1 if self.confirmed == self.total: print("all messages confirmed") event.connection.close() self.acceptor.close() def on_disconnected(self, event): self.sent = self.confirmed parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send messages to the supplied address.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to send (default %default)") opts, args = parser.parse_args() try: Container(Send(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/direct_recv.py0000775000000000000000000000421513257152177016760 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import optparse from proton.handlers import MessagingHandler from proton.reactor import Container class Recv(MessagingHandler): def __init__(self, url, count): super(Recv, self).__init__() self.url = url self.expected = count self.received = 0 def on_start(self, event): self.acceptor = event.container.listen(self.url) def on_message(self, event): if event.message.id and event.message.id < self.received: # ignore duplicate message return if self.expected == 0 or self.received < self.expected: print(event.message.body) self.received += 1 if self.received == self.expected: event.receiver.close() event.connection.close() self.acceptor.close() parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to receive; 0 receives indefinitely (default %default)") opts, args = parser.parse_args() try: Container(Recv(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/db_send.py0000775000000000000000000000743513257152177016074 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse import time try: import Queue except: import queue as Queue from proton import Message from proton.handlers import MessagingHandler from proton.reactor import ApplicationEvent, Container, EventInjector from db_common import Db class Send(MessagingHandler): def __init__(self, url, count): super(Send, self).__init__() self.url = url self.delay = 0 self.sent = 0 self.confirmed = 0 self.load_count = 0 self.records = Queue.Queue(maxsize=50) self.target = count self.db = Db("src_db", EventInjector()) def keep_sending(self): return self.target == 0 or self.sent < self.target def on_start(self, event): self.container = event.container self.container.selectable(self.db.injector) self.sender = self.container.create_sender(self.url) def on_records_loaded(self, event): if self.records.empty(): if event.subject == self.load_count: print("Exhausted available data, waiting to recheck...") # check for new data after 5 seconds self.container.schedule(5, self) else: self.send() def request_records(self): if not self.records.full(): print("loading records...") self.load_count += 1 self.db.load(self.records, event=ApplicationEvent("records_loaded", link=self.sender, subject=self.load_count)) def on_sendable(self, event): self.send() def send(self): while self.sender.credit and not self.records.empty(): if not self.keep_sending(): return record = self.records.get(False) id = record['id'] self.sender.send(Message(id=id, durable=True, body=record['description']), tag=str(id)) self.sent += 1 print("sent message %s" % id) self.request_records() def on_settled(self, event): id = int(event.delivery.tag) self.db.delete(id) print("settled message %s" % id) self.confirmed += 1 if self.confirmed == self.target: event.connection.close() self.db.close() def on_disconnected(self, event): self.db.reset() self.sent = self.confirmed def on_timer_task(self, event): print("Rechecking for data...") self.request_records() parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send messages to the supplied address.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-m", "--messages", type="int", default=0, help="number of messages to send; 0 sends indefinitely (default %default)") opts, args = parser.parse_args() try: Container(Send(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/db_recv.py0000775000000000000000000000550413257152177016075 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import optparse from proton.handlers import MessagingHandler from proton.reactor import ApplicationEvent, Container, EventInjector from db_common import Db class Recv(MessagingHandler): def __init__(self, url, count): super(Recv, self).__init__(auto_accept=False) self.url = url self.delay = 0 self.last_id = None self.expected = count self.received = 0 self.accepted = 0 self.db = Db("dst_db", EventInjector()) def on_start(self, event): event.container.selectable(self.db.injector) e = ApplicationEvent("id_loaded") e.container = event.container self.db.get_id(e) def on_id_loaded(self, event): self.last_id = event.id event.container.create_receiver(self.url) def on_record_inserted(self, event): self.accept(event.delivery) self.accepted += 1 if self.accepted == self.expected: event.connection.close() self.db.close() def on_message(self, event): id = int(event.message.id) if (not self.last_id) or id > self.last_id: if self.received < self.expected: self.received += 1 self.last_id = id self.db.insert(id, event.message.body, ApplicationEvent("record_inserted", delivery=event.delivery)) print("inserted message %s" % id) else: self.release(event.delivery) else: self.accept(event.delivery) parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address from which messages are received (default %default)") parser.add_option("-m", "--messages", type="int", default=0, help="number of messages to receive; 0 receives indefinitely (default %default)") opts, args = parser.parse_args() try: Container(Recv(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/db_ctrl.py0000775000000000000000000000336413257152177016104 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import sqlite3 import sys if len(sys.argv) < 3: print("Usage: %s [init|insert|list] db" % sys.argv[0]) else: conn = sqlite3.connect(sys.argv[2]) with conn: if sys.argv[1] == "init": conn.execute("DROP TABLE IF EXISTS records") conn.execute("CREATE TABLE records(id INTEGER PRIMARY KEY AUTOINCREMENT, description TEXT)") conn.commit() elif sys.argv[1] == "list": cursor = conn.cursor() cursor.execute("SELECT * FROM records") rows = cursor.fetchall() for r in rows: print(r) elif sys.argv[1] == "insert": while True: l = sys.stdin.readline() if not l: break conn.execute("INSERT INTO records(description) VALUES (?)", (l.rstrip(),)) conn.commit() else: print("Unrecognised command: %s" % sys.argv[1]) qpid-proton-0.22.0/examples/python/db_common.py0000775000000000000000000000740713257152177016432 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # try: import Queue except: import queue as Queue import sqlite3 import threading class Db(object): def __init__(self, db, injector): self.db = db self.injector = injector self.tasks = Queue.Queue() self.position = None self.pending_events = [] self.running = True self.thread = threading.Thread(target=self._process) self.thread.daemon=True self.thread.start() def close(self): self.tasks.put(lambda conn: self._close()) def reset(self): self.tasks.put(lambda conn: self._reset()) def load(self, records, event=None): self.tasks.put(lambda conn: self._load(conn, records, event)) def get_id(self, event): self.tasks.put(lambda conn: self._get_id(conn, event)) def insert(self, id, data, event=None): self.tasks.put(lambda conn: self._insert(conn, id, data, event)) def delete(self, id, event=None): self.tasks.put(lambda conn: self._delete(conn, id, event)) def _reset(self, ignored=None): self.position = None def _close(self, ignored=None): self.running = False def _get_id(self, conn, event): cursor = conn.execute("SELECT * FROM records ORDER BY id DESC") row = cursor.fetchone() if event: if row: event.id = row['id'] else: event.id = 0 self.injector.trigger(event) def _load(self, conn, records, event): if self.position: cursor = conn.execute("SELECT * FROM records WHERE id > ? ORDER BY id", (self.position,)) else: cursor = conn.execute("SELECT * FROM records ORDER BY id") while not records.full(): row = cursor.fetchone() if row: self.position = row['id'] records.put(dict(row)) else: break if event: self.injector.trigger(event) def _insert(self, conn, id, data, event): if id: conn.execute("INSERT INTO records(id, description) VALUES (?, ?)", (id, data)) else: conn.execute("INSERT INTO records(description) VALUES (?)", (data,)) if event: self.pending_events.append(event) def _delete(self, conn, id, event): conn.execute("DELETE FROM records WHERE id=?", (id,)) if event: self.pending_events.append(event) def _process(self): conn = sqlite3.connect(self.db) conn.row_factory = sqlite3.Row with conn: while self.running: f = self.tasks.get(True) try: while True: f(conn) f = self.tasks.get(False) except Queue.Empty: pass conn.commit() for event in self.pending_events: self.injector.trigger(event) self.pending_events = [] self.injector.close() qpid-proton-0.22.0/examples/python/colour_send.py0000775000000000000000000000472313257152177017007 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container class Send(MessagingHandler): def __init__(self, url, messages): super(Send, self).__init__() self.url = url self.sent = 0 self.confirmed = 0 self.total = messages def on_start(self, event): event.container.create_sender(self.url) def on_sendable(self, event): while event.sender.credit and self.sent < self.total: if self.sent % 2: colour = 'red' else: colour = 'green' content = '%s %d' % (colour, self.sent+1) msg = Message(id=(self.sent+1), properties={'colour':colour}, body=content) event.sender.send(msg) self.sent += 1 def on_accepted(self, event): self.confirmed += 1 if self.confirmed == self.total: print("all messages confirmed") event.connection.close() def on_disconnected(self, event): self.sent = self.confirmed parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send messages to the supplied address.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") parser.add_option("-m", "--messages", type="int", default=100, help="number of messages to send (default %default)") opts, args = parser.parse_args() try: Container(Send(opts.address, opts.messages)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/client_http.py0000775000000000000000000000726013257152177017007 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function import tornado.ioloop import tornado.web from proton import Message from proton.handlers import MessagingHandler from proton_tornado import Container class Client(MessagingHandler): def __init__(self, host, address): super(Client, self).__init__() self.host = host self.address = address self.sent = [] self.pending = [] self.reply_address = None self.sender = None self.receiver = None def on_start(self, event): conn = event.container.connect(self.host) self.sender = event.container.create_sender(conn, self.address) self.receiver = event.container.create_receiver(conn, None, dynamic=True) def on_link_opened(self, event): if event.receiver == self.receiver: self.reply_address = event.link.remote_source.address self.do_request() def on_sendable(self, event): self.do_request() def on_message(self, event): if self.sent: request, handler = self.sent.pop(0) print("%s => %s" % (request, event.message.body)) handler(event.message.body) self.do_request() def do_request(self): if self.pending and self.reply_address and self.sender.credit: request, handler = self.pending.pop(0) self.sent.append((request, handler)) req = Message(reply_to=self.reply_address, body=request) self.sender.send(req) def request(self, body, handler): self.pending.append((body, handler)) self.do_request() self.container.touch() class ExampleHandler(tornado.web.RequestHandler): def initialize(self, client): self.client = client def get(self): self._write_open() self._write_form() self._write_close() @tornado.web.asynchronous def post(self): client.request(self.get_body_argument("message"), lambda x: self.on_response(x)) def on_response(self, body): self.set_header("Content-Type", "text/html") self._write_open() self._write_form() self.write("Response: " + body) self._write_close() self.finish() def _write_open(self): self.write('') def _write_close(self): self.write('') def _write_form(self): self.write('
' 'Request: ' '' '
') loop = tornado.ioloop.IOLoop.instance() client = Client("localhost:5672", "examples") client.container = Container(client, loop=loop) client.container.initialise() app = tornado.web.Application([tornado.web.url(r"/client", ExampleHandler, dict(client=client))]) app.listen(8888) try: loop.start() except KeyboardInterrupt: loop.stop() qpid-proton-0.22.0/examples/python/client.py0000775000000000000000000000471413257152177015751 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function, unicode_literals import optparse from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container, DynamicNodeProperties class Client(MessagingHandler): def __init__(self, url, requests): super(Client, self).__init__() self.url = url self.requests = requests def on_start(self, event): self.sender = event.container.create_sender(self.url) self.receiver = event.container.create_receiver(self.sender.connection, None, dynamic=True) def next_request(self): if self.receiver.remote_source.address: req = Message(reply_to=self.receiver.remote_source.address, body=self.requests[0]) self.sender.send(req) def on_link_opened(self, event): if event.receiver == self.receiver: self.next_request() def on_message(self, event): print("%s => %s" % (self.requests.pop(0), event.message.body)) if self.requests: self.next_request() else: event.connection.close() REQUESTS= ["Twas brillig, and the slithy toves", "Did gire and gymble in the wabe.", "All mimsy were the borogroves,", "And the mome raths outgrabe."] parser = optparse.OptionParser(usage="usage: %prog [options]", description="Send requests to the supplied address and print responses.") parser.add_option("-a", "--address", default="localhost:5672/examples", help="address to which messages are sent (default %default)") opts, args = parser.parse_args() Container(Client(opts.address, args or REQUESTS)).run() qpid-proton-0.22.0/examples/python/broker.py0000775000000000000000000001027513257152177015756 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import collections, optparse from proton import Endpoint, generate_uuid from proton.handlers import MessagingHandler from proton.reactor import Container class Queue(object): def __init__(self, dynamic=False): self.dynamic = dynamic self.queue = collections.deque() self.consumers = [] def subscribe(self, consumer): self.consumers.append(consumer) def unsubscribe(self, consumer): if consumer in self.consumers: self.consumers.remove(consumer) return len(self.consumers) == 0 and (self.dynamic or self.queue.count == 0) def publish(self, message): self.queue.append(message) self.dispatch() def dispatch(self, consumer=None): if consumer: c = [consumer] else: c = self.consumers while self._deliver_to(c): pass def _deliver_to(self, consumers): try: result = False for c in consumers: if c.credit: c.send(self.queue.popleft()) result = True return result except IndexError: # no more messages return False class Broker(MessagingHandler): def __init__(self, url): super(Broker, self).__init__() self.url = url self.queues = {} def on_start(self, event): self.acceptor = event.container.listen(self.url) def _queue(self, address): if address not in self.queues: self.queues[address] = Queue() return self.queues[address] def on_link_opening(self, event): if event.link.is_sender: if event.link.remote_source.dynamic: address = str(generate_uuid()) event.link.source.address = address q = Queue(True) self.queues[address] = q q.subscribe(event.link) elif event.link.remote_source.address: event.link.source.address = event.link.remote_source.address self._queue(event.link.source.address).subscribe(event.link) elif event.link.remote_target.address: event.link.target.address = event.link.remote_target.address def _unsubscribe(self, link): if link.source.address in self.queues and self.queues[link.source.address].unsubscribe(link): del self.queues[link.source.address] def on_link_closing(self, event): if event.link.is_sender: self._unsubscribe(event.link) def on_connection_closing(self, event): self.remove_stale_consumers(event.connection) def on_disconnected(self, event): self.remove_stale_consumers(event.connection) def remove_stale_consumers(self, connection): l = connection.link_head(Endpoint.REMOTE_ACTIVE) while l: if l.is_sender: self._unsubscribe(l) l = l.next(Endpoint.REMOTE_ACTIVE) def on_sendable(self, event): self._queue(event.link.source.address).dispatch(event.link) def on_message(self, event): self._queue(event.link.target.address).publish(event.message) parser = optparse.OptionParser(usage="usage: %prog [options]") parser.add_option("-a", "--address", default="localhost:5672", help="address router listens on (default %default)") opts, args = parser.parse_args() try: Container(Broker(opts.address)).run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/abstract_server.py0000775000000000000000000000235513257152177017663 0ustar #!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from __future__ import print_function from proton_server import Server class Application(Server): def __init__(self, host, address): super(Application, self).__init__(host, address) def on_request(self, request, reply_to): response = request.upper() self.send(response, reply_to) print("Request from: %s" % reply_to) try: Application("localhost:5672", "examples").run() except KeyboardInterrupt: pass qpid-proton-0.22.0/examples/python/README0000664000000000000000000001512713257152177014776 0ustar Most (though not all) of the current examples require a broker or similar intermediary that supports the AMQP 1.0 protocol, allows anonymous connections and accepts links to and from a node named 'examples'. A very simple broker emulating script - broker.py - is provided against which the examples can also be run (transactions are not yet supported in this script). Note: For builds that include SASL support via the cyrus sasl library, those examples that accept incoming connections may require some SASL configuration which is described below. ------------------------------------------------------------------ helloworld.py Basic example that connects to an intermediary on localhost:5672, establishes a subscription from the 'examples' node on that intermediary, then creates a sending link to the same node and sends one message. On receiving the message back via the subscription, the connection is closed. helloworld_blocking.py The same as the basic helloworld.py, but using a synchronous/sequential style wrapper on top of the asynchronous/reactive API. The purpose of this example is just to show how different functionality can be easily layered should it be desired. helloworld_direct.py A variant of the basic helloworld example, that does not use an intermediary, but listens for incoming connections itself. It establishes a connection to itself with a link over which a single message is sent. This demonstrates the ease with which a simple daemon can be built using the API. helloworld_tornado.py helloworld_direct_tornado.py These are variant of the helloworld.py and helloworld_direct.py examples that use the event loop from the tornado library, rather than that provided within proton itself and demonstrate how proton can be used with external loops. ------------------------------------------------------------------- simple_send.py An example of sending a fixed number of messages and tracking their (asynchronous) acknowledgement. Handles disconnection while maintaining an at-least-once guarantee (there may be duplicates, but no message in the sequence should be lost). Messages are sent through the 'examples' node on an intermediary accessible on port 5672 on localhost. simple_recv.py Subscribes to the 'examples' node on an intermediary accessible on port 5672 on localhost. Simply prints out the body of received messages. db_send.py A more realistic sending example, where the messages come from records in a simple database table. On being acknowledged the records can be deleted from the table. The database access is done in a separate thread, so as not to block the event thread during data access. Messages are sent through the 'examples' node on an intermediary accessible on port 5672 on localhost. db_recv.py A receiving example that records messages received from the 'examples' node on localhost:5672 in a database table and only acknowledges them when the insert completes. Database access is again done in a separate thread from the event loop. db_ctrl.py A utility for setting up the database tables for the two examples above. Takes two arguments, the action to perform and the name of the database on which to perform it. The database used by db_send.py is src_db, that by db_recv.py is dst_db. The valid actions are 'init', which creates the table, 'list' which displays the contents and 'insert' which inserts records from standard-in and is used to populate src_db, e.g. for i in `seq 1 50`; do echo "Message-$i"; done | ./db_ctrl.py insert src_db. tx_send.py A sender that sends messages in atomic batches using local transactions (this example does not persist the messages in any way). tx_recv.py A receiver example that accepts batches of messages using local transactions. tx_recv_interactive.py A testing utility that allow interactive control of the transactions. Actions are keyed in to the console, 'fetch' will request another message, 'abort' will abort the transaction, 'commit' will commit it. The various send/recv examples can be mixed and matched if desired. direct_send.py An example that accepts incoming links and connections over which it will then send out messages. Can be used with simple_recv.py or db_recv.py for direct, non-intermediated communication. direct_recv.py An example that accepts incoming links and connections over which it will then receive messages, printing out the content. Can be used with simple_send.py or db_send.py for direct, non-intermediated communication. ------------------------------------------------------------------- client.py The client part of a request-response example. Sends requests and prints out responses. Requires an intermediary that supports the AMQP 1.0 dynamic nodes on which the responses are received. The requests are sent through the 'examples' node. server.py The server part of a request-response example, that receives requests via the examples node, converts the body to uppercase and sends the result back to the indicated reply address. sync_client.py A variant of the client part, that uses a blocking/synchronous style instead of the reactive/asynchronous style. client_http.py A variant of the client part that takes the input to be submitted in the request over HTTP (point your browser to localhost:8888/client) server_tx.py A variant of the server part that consumes the request and sends out the response atomically in a local transaction. direct_server.py A variant of the server part of a request-response example, that accepts incoming connections and does not need an intermediary. Much like the original server, it receives incoming requests, converts the body to uppercase and sends the result back to the indicated reply address. Can be used in conjunction with any of the client alternatives. ------------------------------------------------------------------- selected_recv.py An example that uses a selector filter. ------------------------------------------------------------------- recurring_timer.py An example showing a simple timer event. recurring_timer_tornado.py A variant of the above that uses the tornado eventloop instead. ------------------------------------------------------------------- SASL configuration If your build includes extra SASL support (provided via the cyrus SASL library), you may need to provide some configuration to enable examples that accept incoming connections (i.e. those with 'direct' in the name). This is done by supplying a config file name proton-server.conf. The directory in which it is in can be specified via the PN_SASL_CONFIG_PATH environment variable. A simple example config file is included along with these examples, enabling only the EXTERNAL and ANONYMOUS mechanisms by default.qpid-proton-0.22.0/examples/go/0000775000000000000000000000000013257152177013174 5ustar qpid-proton-0.22.0/examples/go/proton/0000775000000000000000000000000013257152177014515 5ustar qpid-proton-0.22.0/examples/go/proton/broker.go0000664000000000000000000002453013257152177016334 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // This is a simple AMQP broker implemented using the event-driven proton package. // // It maintains a set of named in-memory queues of messages. Clients can send // messages to queues or subscribe to receive messages from them. // // TODO: show how to handle acknowledgements from receivers and put rejected or // un-acknowledged messages back on their queues. package main import ( "flag" "fmt" "log" "net" "os" "qpid.apache.org/amqp" "qpid.apache.org/proton" "sync" ) // Usage and command-line flags func usage() { fmt.Fprintf(os.Stderr, ` Usage: %s A simple broker-like demo. Queues are created automatically for sender or receiver addresses. `, os.Args[0]) flag.PrintDefaults() } var addr = flag.String("addr", ":amqp", "Listening address") var credit = flag.Int("credit", 100, "Receiver credit window") var qsize = flag.Int("qsize", 1000, "Max queue size") var debug = flag.Bool("debug", false, "Print detailed debug output") var debugf = func(format string, data ...interface{}) {} // Default no debugging output func main() { flag.Usage = usage flag.Parse() if *debug { debugf = func(format string, data ...interface{}) { log.Printf(format, data...) } } b := &broker{makeQueues(*qsize)} if err := b.run(); err != nil { log.Fatal(err) } } // State for the broker type broker struct { queues queues } // Listens for connections and starts a proton.Engine for each one. func (b *broker) run() error { listener, err := net.Listen("tcp", *addr) if err != nil { return err } defer listener.Close() fmt.Printf("Listening on %s\n", listener.Addr()) for { conn, err := listener.Accept() if err != nil { debugf("Accept error: %v", err) continue } adapter := proton.NewMessagingAdapter(newHandler(&b.queues)) // We want to accept messages when they are enqueued, not just when they // are received, so we turn off auto-accept and prefetch by the adapter. adapter.Prefetch = 0 adapter.AutoAccept = false engine, err := proton.NewEngine(conn, adapter) if err != nil { debugf("Connection error: %v", err) continue } engine.Server() // Enable server-side protocol negotiation. debugf("Accepted connection %s", engine) go func() { // Start goroutine to run the engine event loop engine.Run() debugf("Closed %s", engine) }() } } // handler handles AMQP events. There is one handler per connection. The // handler does not need to be concurrent-safe as proton.Engine will serialize // all calls to the handler. We use channels to communicate between the handler // goroutine and other goroutines sending and receiving messages. type handler struct { queues *queues receivers map[proton.Link]*receiver senders map[proton.Link]*sender injecter proton.Injecter } func newHandler(queues *queues) *handler { return &handler{ queues: queues, receivers: make(map[proton.Link]*receiver), senders: make(map[proton.Link]*sender), } } // HandleMessagingEvent handles an event, called in the handler goroutine. func (h *handler) HandleMessagingEvent(t proton.MessagingEvent, e proton.Event) { switch t { case proton.MStart: h.injecter = e.Injecter() case proton.MLinkOpening: if e.Link().IsReceiver() { h.startReceiver(e) } else { h.startSender(e) } case proton.MLinkClosed: h.linkClosed(e.Link(), e.Link().RemoteCondition().Error()) case proton.MSendable: if s, ok := h.senders[e.Link()]; ok { s.sendable() // Signal the send goroutine that we have credit. } else { proton.CloseError(e.Link(), amqp.Errorf(amqp.NotFound, "link %s sender not found", e.Link())) } case proton.MMessage: m, err := e.Delivery().Message() // Message() must be called while handling the MMessage event. if err != nil { proton.CloseError(e.Link(), err) break } r, ok := h.receivers[e.Link()] if !ok { proton.CloseError(e.Link(), amqp.Errorf(amqp.NotFound, "link %s receiver not found", e.Link())) break } // This will not block as AMQP credit is set to the buffer capacity. r.buffer <- receivedMessage{e.Delivery(), m} debugf("link %s received %#v", e.Link(), m) case proton.MConnectionClosed, proton.MDisconnected: for l, _ := range h.receivers { h.linkClosed(l, nil) } for l, _ := range h.senders { h.linkClosed(l, nil) } } } // linkClosed is called when a link has been closed by both ends. // It removes the link from the handlers maps and stops its goroutine. func (h *handler) linkClosed(l proton.Link, err error) { if s, ok := h.senders[l]; ok { s.stop() delete(h.senders, l) } else if r, ok := h.receivers[l]; ok { r.stop() delete(h.receivers, l) } } // link has some common data and methods that are used by the sender and receiver types. // // An active link is represented by a sender or receiver value and a goroutine // running its run() method. The run() method communicates with the handler via // channels. type link struct { l proton.Link q queue h *handler } func makeLink(l proton.Link, q queue, h *handler) link { lnk := link{l: l, q: q, h: h} return lnk } // receiver has a channel to buffer messages that have been received by the // handler and are waiting to go on the queue. AMQP credit ensures that the // handler does not overflow the buffer and block. type receiver struct { link buffer chan receivedMessage } // receivedMessage holds a message and a Delivery so that the message can be // acknowledged when it is put on the queue. type receivedMessage struct { delivery proton.Delivery message amqp.Message } // startReceiver creates a receiver and a goroutine for its run() method. func (h *handler) startReceiver(e proton.Event) { q := h.queues.Get(e.Link().RemoteTarget().Address()) r := &receiver{ link: makeLink(e.Link(), q, h), buffer: make(chan receivedMessage, *credit), } h.receivers[r.l] = r r.l.Flow(cap(r.buffer)) // Give credit to fill the buffer to capacity. go r.run() } // run runs in a separate goroutine. It moves messages from the buffer to the // queue for a receiver link, and injects a handler function to acknowledge the // message and send a credit. func (r *receiver) run() { for rm := range r.buffer { r.q <- rm.message d := rm.delivery // We are not in the handler goroutine so we Inject the accept function as a closure. r.h.injecter.Inject(func() { // Check that the receiver is still open, it may have been closed by the remote end. if r == r.h.receivers[r.l] { d.Accept() // Accept the delivery r.l.Flow(1) // Add one credit } }) } } // stop closes the buffer channel and waits for the run() goroutine to stop. func (r *receiver) stop() { close(r.buffer) } // sender has a channel that is used to signal when there is credit to send messages. type sender struct { link credit chan struct{} // Channel to signal availability of credit. } // startSender creates a sender and starts a goroutine for sender.run() func (h *handler) startSender(e proton.Event) { q := h.queues.Get(e.Link().RemoteSource().Address()) s := &sender{ link: makeLink(e.Link(), q, h), credit: make(chan struct{}, 1), // Capacity of 1 for signalling. } h.senders[e.Link()] = s go s.run() } // stop closes the credit channel and waits for the run() goroutine to stop. func (s *sender) stop() { close(s.credit) } // sendable signals that the sender has credit, it does not block. // sender.credit has capacity 1, if it is already full we carry on. func (s *sender) sendable() { select { // Non-blocking case s.credit <- struct{}{}: default: } } // run runs in a separate goroutine. It monitors the queue for messages and injects // a function to send them when there is credit func (s *sender) run() { var q queue // q is nil initially as we have no credit. for { select { case _, ok := <-s.credit: if !ok { // sender closed return } q = s.q // We have credit, enable selecting on the queue. case m, ok := <-q: // q is only enabled when we have credit. if !ok { // queue closed return } q = nil // Assume all credit will be used used, will be signaled otherwise. s.h.injecter.Inject(func() { // Inject handler function to actually send if s.h.senders[s.l] != s { // The sender has been closed by the remote end. q.PutBack(m) // Put the message back on the queue but don't block return } if s.sendOne(m) != nil { return } // Send as many more messages as we can without blocking for s.l.Credit() > 0 { select { // Non blocking receive from q case m, ok := <-s.q: if ok { s.sendOne(m) } default: // Queue is empty but we have credit, signal the run() goroutine. s.sendable() } } }) } } } // sendOne runs in the handler goroutine. It sends a single message. func (s *sender) sendOne(m amqp.Message) error { delivery, err := s.l.Send(m) if err == nil { delivery.Settle() // Pre-settled, unreliable. debugf("link %s sent %#v", s.l, m) } else { s.q.PutBack(m) // Put the message back on the queue, don't block } return err } // Use a buffered channel as a very simple queue. type queue chan amqp.Message // Put a message back on the queue, does not block. func (q queue) PutBack(m amqp.Message) { select { case q <- m: default: // Not an efficient implementation but ensures we don't block the caller. go func() { q <- m }() } } // Concurrent-safe map of queues. type queues struct { queueSize int m map[string]queue lock sync.Mutex } func makeQueues(queueSize int) queues { return queues{queueSize: queueSize, m: make(map[string]queue)} } // Create a queue if not found. func (qs *queues) Get(name string) queue { qs.lock.Lock() defer qs.lock.Unlock() q := qs.m[name] if q == nil { q = make(queue, qs.queueSize) qs.m[name] = q } return q } qpid-proton-0.22.0/examples/go/example_test.go0000664000000000000000000001577613257152177016235 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Tests to verify that example code behaves as expected. // Run in this directory with `go test example_test.go` // package main import ( "bufio" "bytes" "flag" "fmt" "io" "math/rand" "net" "os" "os/exec" "path" "path/filepath" "reflect" "testing" "time" ) func fatalIf(t *testing.T, err error) { if err != nil { t.Fatalf("%s", err) } } // A demo broker process type broker struct { cmd *exec.Cmd addr string runerr chan error err error } // Try to connect to the broker to verify it is ready, give up after a timeout func (b *broker) check() error { dialer := net.Dialer{Deadline: time.Now().Add(time.Second * 10)} for { c, err := dialer.Dial("tcp", b.addr) if err == nil { // Success c.Close() return nil } select { case runerr := <-b.runerr: // Broker exited. return runerr default: } if neterr, ok := err.(net.Error); ok && neterr.Timeout() { // Running but timed out b.stop() return fmt.Errorf("timed out waiting for broker") } time.Sleep(time.Second / 10) } } // Start the demo broker, wait till it is listening on *addr. No-op if already started. func (b *broker) start(t *testing.T) error { if b.cmd == nil { // Not already started b.addr = fmt.Sprintf("127.0.0.1:%d", rand.Intn(10000)+10000) b.cmd = exampleCommand(t, *brokerName, "-addr", b.addr) b.runerr = make(chan error) b.cmd.Stderr, b.cmd.Stdout = os.Stderr, os.Stdout b.err = b.cmd.Start() if b.err == nil { go func() { b.runerr <- b.cmd.Wait() }() } else { b.runerr <- b.err } b.err = b.check() } return b.err } func (b *broker) stop() { if b != nil && b.cmd != nil { b.cmd.Process.Kill() <-b.runerr } } func checkEqual(want interface{}, got interface{}) error { if reflect.DeepEqual(want, got) { return nil } return fmt.Errorf("%#v != %#v", want, got) } // exampleCommand returns an exec.Cmd to run an example. func exampleCommand(t *testing.T, prog string, arg ...string) (cmd *exec.Cmd) { args := []string{} if *debug { args = append(args, "-debug=true") } args = append(args, arg...) prog, err := filepath.Abs(path.Join(*dir, prog)) fatalIf(t, err) if _, err := os.Stat(prog); err == nil { cmd = exec.Command(prog, args...) } else if _, err := os.Stat(prog + ".go"); err == nil { args = append([]string{"run", prog + ".go"}, args...) cmd = exec.Command("go", args...) } else { t.Fatalf("Cannot find binary or source for %s", prog) } cmd.Stderr = os.Stderr return cmd } // Run an example Go program, return the combined output as a string. func runExample(t *testing.T, prog string, arg ...string) (string, error) { cmd := exampleCommand(t, prog, arg...) out, err := cmd.Output() return string(out), err } func prefix(prefix string, err error) error { if err != nil { return fmt.Errorf("%s: %s", prefix, err) } return nil } func runExampleWant(t *testing.T, want string, prog string, args ...string) error { out, err := runExample(t, prog, args...) if err != nil { return fmt.Errorf("%s failed: %s: %s", prog, err, out) } return prefix(prog, checkEqual(want, out)) } func exampleArgs(args ...string) []string { for i := 0; i < *connections; i++ { args = append(args, fmt.Sprintf("amqp://%s/%s%d", testBroker.addr, "q", i)) } return args } // Send then receive func TestExampleSendReceive(t *testing.T) { if testing.Short() { t.Skip("Skip demo tests in short mode") } testBroker.start(t) err := runExampleWant(t, fmt.Sprintf("Received all %d acknowledgements\n", expected), "send", exampleArgs("-count", fmt.Sprintf("%d", *count))...) if err != nil { t.Fatal(err) } err = runExampleWant(t, fmt.Sprintf("Listening on %v connections\nReceived %v messages\n", *connections, *count**connections), "receive", exampleArgs("-count", fmt.Sprintf("%d", *count**connections))...) if err != nil { t.Fatal(err) } } var ready error func init() { ready = fmt.Errorf("Ready") } // Run receive in a goroutine. // Send ready on errchan when it is listening. // Send final error when it is done. // Returns the Cmd, caller must Wait() func goReceiveWant(t *testing.T, errchan chan<- error, want string, arg ...string) *exec.Cmd { cmd := exampleCommand(t, "receive", arg...) go func() { pipe, err := cmd.StdoutPipe() if err != nil { errchan <- err return } out := bufio.NewReader(pipe) cmd.Start() line, err := out.ReadString('\n') if err != nil && err != io.EOF { errchan <- err return } listening := "Listening on 3 connections\n" if line != listening { errchan <- checkEqual(listening, line) return } errchan <- ready buf := bytes.Buffer{} io.Copy(&buf, out) // Collect the rest of the output cmd.Wait() errchan <- checkEqual(want, buf.String()) close(errchan) }() return cmd } // Start receiver first, wait till it is running, then send. func TestExampleReceiveSend(t *testing.T) { if testing.Short() { t.Skip("Skip demo tests in short mode") } testBroker.start(t) // Start receiver, wait for "listening" message on stdout recvCmd := exampleCommand(t, "receive", exampleArgs(fmt.Sprintf("-count=%d", expected))...) pipe, err := recvCmd.StdoutPipe() if err != nil { t.Fatal(err) } recvCmd.Start() out := bufio.NewReader(pipe) line, err := out.ReadString('\n') if err := checkEqual("Listening on 3 connections\n", line); err != nil { t.Fatal(err) } if err := runExampleWant(t, fmt.Sprintf("Received all %d acknowledgements\n", expected), "send", exampleArgs("-count", fmt.Sprintf("%d", *count))...); err != nil { t.Fatal(err) } buf := bytes.Buffer{} io.Copy(&buf, out) if err := checkEqual(fmt.Sprintf("Received %d messages\n", expected), buf.String()); err != nil { t.Fatal(err) } } var testBroker *broker var debug = flag.Bool("debug", false, "Debugging output from examples") var brokerName = flag.String("broker", "broker", "Name of broker executable to run") var count = flag.Int("count", 3, "Count of messages to send in tests") var connections = flag.Int("connections", 3, "Number of connections to make in tests") var dir = flag.String("dir", "electron", "Directory containing example sources or binaries") var expected int func TestMain(m *testing.M) { expected = (*count) * (*connections) rand.Seed(time.Now().UTC().UnixNano()) testBroker = &broker{} // Broker is started on-demand by tests. status := m.Run() testBroker.stop() os.Exit(status) } qpid-proton-0.22.0/examples/go/electron/0000775000000000000000000000000013257152177015007 5ustar qpid-proton-0.22.0/examples/go/electron/send.go0000664000000000000000000000704113257152177016271 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import ( "flag" "fmt" "log" "os" "qpid.apache.org/amqp" "qpid.apache.org/electron" "strings" "sync" ) // Usage and command-line flags func usage() { fmt.Fprintf(os.Stderr, `Usage: %s url [url ...] Send messages to each URL concurrently. URLs are of the form "amqp://:/" `, os.Args[0]) flag.PrintDefaults() } var count = flag.Int64("count", 1, "Send this many messages to each address.") var debug = flag.Bool("debug", false, "Print detailed debug output") var Debugf = func(format string, data ...interface{}) {} // Default no debugging output func main() { flag.Usage = usage flag.Parse() if *debug { Debugf = func(format string, data ...interface{}) { log.Printf(format, data...) } } urls := flag.Args() // Non-flag arguments are URLs to receive from if len(urls) == 0 { log.Println("No URL provided") flag.Usage() os.Exit(1) } sentChan := make(chan electron.Outcome) // Channel to receive acknowledgements. var wait sync.WaitGroup wait.Add(len(urls)) // Wait for one goroutine per URL. container := electron.NewContainer(fmt.Sprintf("send[%v]", os.Getpid())) connections := make(chan electron.Connection, len(urls)) // Connections to close on exit // Start a goroutine for each URL to send messages. for _, urlStr := range urls { Debugf("Connecting to %v\n", urlStr) go func(urlStr string) { defer wait.Done() // Notify main() when this goroutine is done. url, err := amqp.ParseURL(urlStr) fatalIf(err) c, err := container.Dial("tcp", url.Host) // NOTE: Dial takes just the Host part of the URL fatalIf(err) connections <- c // Save connection so we can Close() when main() ends addr := strings.TrimPrefix(url.Path, "/") s, err := c.Sender(electron.Target(addr)) fatalIf(err) // Loop sending messages. for i := int64(0); i < *count; i++ { m := amqp.NewMessage() body := fmt.Sprintf("%v%v", addr, i) m.Marshal(body) s.SendAsync(m, sentChan, body) // Outcome will be sent to sentChan } }(urlStr) } // Wait for all the acknowledgements expect := int(*count) * len(urls) Debugf("Started senders, expect %v acknowledgements\n", expect) for i := 0; i < expect; i++ { out := <-sentChan // Outcome of async sends. if out.Error != nil { log.Fatalf("acknowledgement[%v] %v error: %v", i, out.Value, out.Error) } else if out.Status != electron.Accepted { log.Fatalf("acknowledgement[%v] unexpected status: %v", i, out.Status) } else { Debugf("acknowledgement[%v] %v (%v)\n", i, out.Value, out.Status) } } fmt.Printf("Received all %v acknowledgements\n", expect) wait.Wait() // Wait for all goroutines to finish. close(connections) for c := range connections { // Close all connections if c != nil { c.Close(nil) } } } func fatalIf(err error) { if err != nil { log.Fatal(err) } } qpid-proton-0.22.0/examples/go/electron/receive.go0000664000000000000000000000756213257152177016772 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import ( "flag" "fmt" "log" "os" "qpid.apache.org/amqp" "qpid.apache.org/electron" "strings" "sync" ) // Usage and command-line flags func usage() { fmt.Fprintf(os.Stderr, `Usage: %s url [url ...] Receive messages from all URLs concurrently and print them. URLs are of the form "amqp://:/" `, os.Args[0]) flag.PrintDefaults() } var count = flag.Uint64("count", 1, "Stop after receiving this many messages in total") var prefetch = flag.Int("prefetch", 0, "enable a pre-fetch window to improve throughput") var debug = flag.Bool("debug", false, "Print detailed debug output") var debugf = func(format string, data ...interface{}) {} // Default no debugging output func main() { flag.Usage = usage flag.Parse() if *debug { debugf = func(format string, data ...interface{}) { log.Printf(format, data...) } } urls := flag.Args() // Non-flag arguments are URLs to receive from if len(urls) == 0 { log.Println("No URL provided") usage() os.Exit(1) } messages := make(chan amqp.Message) // Channel for messages from goroutines to main() defer close(messages) var wait sync.WaitGroup // Used by main() to wait for all goroutines to end. wait.Add(len(urls)) // Wait for one goroutine per URL. container := electron.NewContainer(fmt.Sprintf("receive[%v]", os.Getpid())) connections := make(chan electron.Connection, len(urls)) // Connections to close on exit // Start a goroutine to for each URL to receive messages and send them to the messages channel. // main() receives and prints them. for _, urlStr := range urls { debugf("Connecting to %s\n", urlStr) go func(urlStr string) { // Start the goroutine defer wait.Done() // Notify main() when this goroutine is done. url, err := amqp.ParseURL(urlStr) fatalIf(err) c, err := container.Dial("tcp", url.Host) // NOTE: Dial takes just the Host part of the URL fatalIf(err) connections <- c // Save connection so we can Close() when main() ends addr := strings.TrimPrefix(url.Path, "/") opts := []electron.LinkOption{electron.Source(addr)} if *prefetch > 0 { opts = append(opts, electron.Capacity(*prefetch), electron.Prefetch(true)) } r, err := c.Receiver(opts...) fatalIf(err) // Loop receiving messages and sending them to the main() goroutine for { if rm, err := r.Receive(); err == nil { rm.Accept() messages <- rm.Message } else if err == electron.Closed { return } else { log.Fatalf("receive error %v: %v", urlStr, err) } } }(urlStr) } // All goroutines are started, we are receiving messages. fmt.Printf("Listening on %d connections\n", len(urls)) // print each message until the count is exceeded. for i := uint64(0); i < *count; i++ { m := <-messages debugf("%v\n", m.Body()) } fmt.Printf("Received %d messages\n", *count) // Close all connections, this will interrupt goroutines blocked in Receiver.Receive() // with electron.Closed. for i := 0; i < len(urls); i++ { c := <-connections debugf("close %s", c) c.Close(nil) } wait.Wait() // Wait for all goroutines to finish. } func fatalIf(err error) { if err != nil { log.Fatal(err) } } qpid-proton-0.22.0/examples/go/electron/broker.go0000664000000000000000000001502413257152177016624 0ustar /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // This is a simple AMQP broker implemented using the procedural electron package. // // It maintains a set of named in-memory queues of messages. Clients can send // messages to queues or subscribe to receive messages from them. // package main import ( "flag" "fmt" "log" "net" "os" "qpid.apache.org/amqp" "qpid.apache.org/electron" "sync" ) // Usage and command-line flags func usage() { fmt.Fprintf(os.Stderr, ` Usage: %s A simple message broker. Queues are created automatically for sender or receiver addresses. `, os.Args[0]) flag.PrintDefaults() } var addr = flag.String("addr", ":amqp", "Network address to listen on, in the form \"host:port\"") var credit = flag.Int("credit", 100, "Receiver credit window") var qsize = flag.Int("qsize", 1000, "Max queue size") var debug = flag.Bool("debug", false, "Print detailed debug output") var debugf = func(format string, data ...interface{}) {} // Default no debugging output func main() { flag.Usage = usage flag.Parse() if *debug { debugf = func(format string, data ...interface{}) { log.Printf(format, data...) } } b := &broker{ queues: makeQueues(*qsize), container: electron.NewContainer(fmt.Sprintf("broker[%v]", os.Getpid())), acks: make(chan electron.Outcome), sent: make(chan sentMessage), } if err := b.run(); err != nil { log.Fatal(err) } } // State for the broker type broker struct { queues queues // A collection of queues. container electron.Container // electron.Container manages AMQP connections. sent chan sentMessage // Channel to record sent messages. acks chan electron.Outcome // Channel to receive the Outcome of sent messages. } // Record of a sent message and the queue it came from. // If a message is rejected or not acknowledged due to a failure, we will put it back on the queue. type sentMessage struct { m amqp.Message q queue } // run listens for incoming net.Conn connections and starts an electron.Connection for each one. func (b *broker) run() error { listener, err := net.Listen("tcp", *addr) if err != nil { return err } defer listener.Close() fmt.Printf("Listening on %v\n", listener.Addr()) go b.acknowledgements() // Handles acknowledgements for all connections. // Start a goroutine for each new connections for { c, err := b.container.Accept(listener) if err != nil { debugf("Accept error: %v", err) continue } cc := &connection{b, c} go cc.run() // Handle the connection debugf("Accepted %v", c) } } // State for a broker connection type connection struct { broker *broker connection electron.Connection } // accept remotely-opened endpoints (Session, Sender and Receiver) on a connection // and start goroutines to service them. func (c *connection) run() { for in := range c.connection.Incoming() { debugf("incoming %v", in) switch in := in.(type) { case *electron.IncomingSender: s := in.Accept().(electron.Sender) go c.sender(s) case *electron.IncomingReceiver: in.SetPrefetch(true) in.SetCapacity(*credit) // Pre-fetch up to credit window. r := in.Accept().(electron.Receiver) go c.receiver(r) default: in.Accept() // Accept sessions unconditionally } } debugf("incoming closed: %v", c.connection) } // receiver receives messages and pushes to a queue. func (c *connection) receiver(receiver electron.Receiver) { q := c.broker.queues.Get(receiver.Target()) for { if rm, err := receiver.Receive(); err == nil { debugf("%v: received %v", receiver, rm.Message.Body()) q <- rm.Message rm.Accept() } else { debugf("%v error: %v", receiver, err) break } } } // sender pops messages from a queue and sends them. func (c *connection) sender(sender electron.Sender) { q := c.broker.queues.Get(sender.Source()) for { if sender.Error() != nil { debugf("%v closed: %v", sender, sender.Error()) return } select { case m := <-q: debugf("%v: sent %v", sender, m.Body()) sm := sentMessage{m, q} c.broker.sent <- sm // Record sent message sender.SendAsync(m, c.broker.acks, sm) // Receive outcome on c.broker.acks with Value sm case <-sender.Done(): // break if sender is closed break } } } // acknowledgements keeps track of sent messages and receives outcomes. // // We could have handled outcomes separately per-connection, per-sender or even // per-message. Message outcomes are returned via channels defined by the user // so they can be grouped in any way that suits the application. func (b *broker) acknowledgements() { sentMap := make(map[sentMessage]bool) for { select { case sm, ok := <-b.sent: // A local sender records that it has sent a message. if ok { sentMap[sm] = true } else { return // Closed } case outcome := <-b.acks: // The message outcome is available sm := outcome.Value.(sentMessage) delete(sentMap, sm) if outcome.Status != electron.Accepted { // Error, release or rejection sm.q.PutBack(sm.m) // Put the message back on the queue. debugf("message %v put back, status %v, error %v", sm.m.Body(), outcome.Status, outcome.Error) } } } } // Use a buffered channel as a very simple queue. type queue chan amqp.Message // Put a message back on the queue, does not block. func (q queue) PutBack(m amqp.Message) { select { case q <- m: default: // Not an efficient implementation but ensures we don't block the caller. go func() { q <- m }() } } // Concurrent-safe map of queues. type queues struct { queueSize int m map[string]queue lock sync.Mutex } func makeQueues(queueSize int) queues { return queues{queueSize: queueSize, m: make(map[string]queue)} } // Create a queue if not found. func (qs *queues) Get(name string) queue { qs.lock.Lock() defer qs.lock.Unlock() q := qs.m[name] if q == nil { q = make(queue, qs.queueSize) qs.m[name] = q } return q } qpid-proton-0.22.0/examples/go/README.md0000664000000000000000000001244413257152177014460 0ustar # Go examples ## Electron examples [qpid.apache.org/electron](http://godoc.org/qpid.apache.org/electron) is a simple API for writing concurrent AMQP clients and servers. - [receive.go](electron/receive.go) receive from many connections concurrently. - [send.go](electron/send.go) send to many connections concurrently. - [broker.go](electron/broker.go) a simple broker using the electron API ## Proton examples [qpid.apache.org/proton](http://godoc.org/qpid.apache.org/proton) is an event-driven, concurrent-unsafe Go wrapper for the proton-C library. The [electron](http://godoc.org/qpid.apache.org/electron) package provides a more Go-friendly concurrent API built on top of proton. - [broker.go](proton/broker.go) a simple broker using the proton API See [A Tale of Two Brokers](#a-tale-of-two-brokers) for a comparison of the two APIs. ## Using the Go packages If you have the proton-C library and headers installed you can get the latest go packages with go get qpid.apache.org/electron If Proton-C is installed in a non-standard place (other than /usr or /usr/local) you should set these environment variables before `go get`: export CGO_LDFLAGS="-L//lib[64]" export CGO_CFLAGS="-I//include" go get qpid.apache.org/electron If you have a proton build you don't need to `go get`, you can set your GOPATH to use the binding from the checkout with: source /config.sh Once you are set up, the go tools will work as normal. You can see documentation in your web browser at `localhost:6060` by running: godoc -http=:6060 ## Running the examples You can run the examples directly from source like this: go run .go This is a little slow (a couple of seconds) as it compiles the program and runs it in one step. You can compile the program first and then run the executable to avoid the delay: go build .go ./ All the examples take a `-h` flag to show usage information, and the comments in the example source have more details. First start the broker on the default AMQP port 5672 (the optional `-debug` flag will print extra information about what the broker is doing) go run broker.go -addr=:5672 -debug # Use a different port if 5672 is not available. Send messages concurrently to queues "foo" and "bar", 10 messages to each queue: go run send.go -count 10 amqp://localhost:5672/foo amqp://localhost:5672/bar Receive messages concurrently from "foo" and "bar". Note -count 20 for 10 messages each on 2 queues: go run receive.go -count 20 amqp://localhost:5672/foo amqp://localhost:5672/bar The broker and clients use the standard AMQP port (5672) on the local host by default, to use a different address use the `-addr host:port` flag. If you have other Proton examples available you can try communicating between programs in in different languages. For example use the python broker with Go clients: python ../python/broker.py go run send.go -count 10 localhost:/foo localhost:/bar Or use the Go broker and the python clients: go run broker.go -debug python ../python/simple_send.py python ../python/simple_recv.py ## A tale of two brokers. The [proton](http://godoc.org/qpid.apache.org/proton) and [electron](http://godoc.org/qpid.apache.org/electron) packages provide two different APIs for building AMQP applications. For most applications, [electron](http://godoc.org/qpid.apache.org/electron) is easier to use. [The proton Go README](https://github.com/apache/qpid-proton/blob/master/proton-c/bindings/go/src/qpid.apache.org/README.md) has some discussion about why there are two APIs. The examples [proton/broker.go](proton/broker.go) and [electron/broker.go](electron/broker.go) implement the same simple broker functionality using each of the two APIs. They both handle multiple connections concurrently and store messages on bounded queues implemented by Go channels. However the [electron/broker.go](electron/broker.go) is less than half as long as the [proton/broker.go](proton/broker.go) illustrating why it is better suited for most Go applications. [proton/broker.go](proton/broker.go) implements an event-driven loop per connection that reacts to events like 'incoming link', 'incoming message' and 'sender has credit'. It uses channels to exchange data between the event-loop goroutine for each connection and shared queues that are accessible to all connections. Sending messages is particularly tricky, the broker must monitor the queue for available messages and the sender link for available credit. [electron/broker.go](electron/broker.go) does not need any "upside-down" event-driven code, it is implemented as straightforward loops. The broker is a loop listening for connections. Each connection is a loop accepting for incoming sender or receiver links. Each receiving link is a loop that receives a message and pushes it to a queue. Each sending link is a loop that pops a message from a queue and sends it. Queue bounds and credit manage themselves: popping from a queue blocks till there is a message, sending blocks until there is credit, receiving blocks till something is received and pushing onto a queue blocks until there is space. There's no need for code that monitors the state of multiple queues and links. Each loop has one simple job to do, and the Go run-time schedules them efficiently. qpid-proton-0.22.0/examples/go/CMakeLists.txt0000664000000000000000000000414213257152177015735 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # if(BUILD_GO) set(examples electron/broker electron/receive electron/send proton/broker) file(GLOB_RECURSE example_source FOLLOW_SYMLINKS ${CMAKE_CURRENT_SOURCE_DIR}/*.go) # Build example exes foreach(example ${examples}) string(REPLACE / _ target ${example}) set(target "go_example_${target}") set(output ${CMAKE_CURRENT_BINARY_DIR}/${example}) # Always run go_build, it will do nothing if there is nothing to do. # Otherwise it's too hard to get the dependencies right. add_custom_target(${target} ALL COMMAND ${GO_BUILD} ${GO_EXAMPLE_FLAGS} -o ${output} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.go WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS go-build) list(APPEND example_targets ${target}) endforeach() # Build test driver exe set(test_exe ${CMAKE_CURRENT_BINARY_DIR}/example_test) add_custom_target(go_example_test ALL COMMAND ${GO_TEST} -c -o ${test_exe} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.go WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) add_test( NAME go-example-electron COMMAND ${GO_ENV} ${test_exe} -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker broker) add_test( NAME go-example-proton COMMAND ${GO_ENV} ${test_exe} -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker ../proton/broker) list(APPEND ADDITIONAL_MAKE_CLEAN_FILES ${examples}) endif() qpid-proton-0.22.0/examples/cpp/0000775000000000000000000000000013257152177013351 5ustar qpid-proton-0.22.0/examples/cpp/tutorial.dox0000664000000000000000000003050413257152177015732 0ustar // -*-markdown-*- // NOTE: doxygen can include markdown pages directly but there seems to be a bug // that shows messed-up line numbers in \skip \until code extracts. This file // is markdown wrapped in a doxygen comment - which works. The file is best viewed/edited // as markdown. /** @page tutorial_page Tutorial This is a brief guide to to the fundamentals of building messaging applications using Qpid Proton C++. Proton provides an "event-driven" programming model, where you implement a subclass of `proton::messaging_handler` and override functions that react to various AMQP events (connections opening and closing, messages being delivered, and so on). The examples below show how to implement handlers for clients and servers and how to run them using the `proton::container`, a portable, easy-to-use way to build single-threaded clients or servers. Some of the examples require an AMQP *broker* that can receive, store, and send messages. @ref broker.cpp defines a simple example broker. If run without arguments, it listens on `0.0.0.0:5672`, the standard AMQP port on all network interfaces. To use a different port or network interface, use the `-a` option. broker -a : Instead of the example broker, you can use any AMQP 1.0-compliant broker. You must configure your broker to have a queue (or topic) named "examples". The `helloworld` examples take an optional URL argument. The other examples take an option `-a URL`. A URL looks like this: HOST:PORT/ADDRESS It usually defaults to `127.0.0.1:5672/examples`, but you can change this if your broker is on a different host or port, or you want to use a different queue or topic name (the ADDRESS part of the URL). Hello World! ------------ \dontinclude helloworld.cpp Tradition dictates that we start with Hello World! This example sends a message to a broker and then receives the same message back. In a realistic system the sender and receiver would normally be in different processes. The complete example is @ref helloworld.cpp We will include the following classes. `proton::container` runs an event loop which dispatches events to a `proton::messaging_handler`. This allows a *reactive* style of programming which is well suited to messaging applications. `proton::connection` and `proton::delivery` are AMQP entities used in the handler functions. `proton::url` is a simple parser for the URL format mentioned above. \skip proton/connection \until proton/url We will define a class `hello_world` which is a subclass of `proton::messaging_handler` and overrides functions to handle the events of interest in sending and receiving a message. \skip class hello_world \until {} `proton::messaging_handler::on_container_start()` is called when the event loop first starts. We handle that by establishing a connection and creating a sender and a receiver. \skip on_container_start \until } \until } `proton::messaging_handler::on_sendable()` is called when the message can be transferred over the associated sender link to the remote peer. We create a `proton::message`, set the message body to `"Hello World!"`, and send the message. Then we close the sender, since we only want to send one message. Closing the sender will prevent further calls to `proton::messaging_handler::on_sendable()`. \skip on_sendable \until } `proton::messaging_handler::on_message()` is called when a message is received. We just print the body of the message and close the connection, as we only want one message. \skip on_message \until } The message body is a `proton::value`. See @ref types_page for more on how to extract the message body as type-safe C++ values. Our `main` function creates an instance of the `hello_world` handler and a `proton::container` using that handler. Calling `proton::container::run()` sets things in motion and returns when we close the connection. It may throw an exception, which will be a subclass of `proton::error`. That in turn is a subclass of `std::exception`. \skip main \until } \until } \until } Asynchronous send and receive ----------------------------- Of course, these `Hello World!` examples are very artificial, communicating as they do over a network connection but with the same process. A more realistic example involves communication between separate processes, which could indeed be running on completely separate machines. Let's separate the sender from the receiver, and transfer more than a single message between them. We'll start with a simple sender, @ref simple_send.cpp. \dontinclude simple_send.cpp As with the previous example, we define the application logic in a class that handles events. Because we are transferring more than one message, we need to keep track of how many we have sent. We'll use a `sent` member variable for that. The `total` member variable will hold the number of messages we want to send. \skip class simple_send \until total As before, we use the `proton::messaging_handler::on_container_start()` event to establish our sender link over which we will transfer messages. \skip on_container_start \until } AMQP defines a credit-based flow-control mechanism. Flow control allows the receiver to control how many messages it is prepared to receive at a given time and thus prevents any component being overwhelmed by the number of messages it is sent. In the `proton::messaging_handler::on_sendable()` callback, we check that our sender has credit before sending messages. We also check that we haven't already sent the required number of messages. \skip on_sendable \until } \until } The `proton::sender::send()` call above is asynchronous. When it returns, the message has not yet actually been transferred across the network to the receiver. By handling the `proton::messaging_handler::on_tracker_accept()` event, we can get notified when the receiver has received and accepted the message. In our example we use this event to track the confirmation of the messages we have sent. We only close the connection and exit when the receiver has received all the messages we wanted to send. \skip on_tracker_accept \until } \until } If we are disconnected after a message is sent and before it has been confirmed by the receiver, it is said to be "in doubt". We don't know whether or not it was received. In this example, we will handle that by resending any in-doubt messages. This is known as an "at-least-once" guarantee, since each message should eventually be received at least once, though a given message may be received more than once (i.e., duplicates are possible). In the `proton::messaging_handler::on_transport_close()` callback, we reset the sent count to reflect only those that have been confirmed. The library will automatically try to reconnect for us, and when our sender is sendable again, we can restart from the point we know the receiver got to. \skip on_transport_close \until } \dontinclude simple_recv.cpp Now let's look at the corresponding receiver, @ref simple_recv.cpp. This time we'll use an `expected` member variable for for the number of messages we expect and a `received` variable to count how many we have received so far. \skip class simple_recv \until received We handle `proton::messaging_handler::on_container_start()` by creating our receiver, much like we did for the sender. \skip on_container_start \until } We also handle the `proton::messaging_handler::on_message()` event for received messages and print the message out as in the `Hello World!` examples. However, we add some logic to allow the receiver to wait for a given number of messages and then close the connection and exit. We also add some logic to check for and ignore duplicates, using a simple sequential ID scheme. \skip on_message \until } Direct send and receive ----------------------- Sending between these two examples requires an intermediary broker since neither accepts incoming connections. AMQP allows us to send messages directly between two processes. In that case, one or other of the processes needs to accept incoming connections. Let's create a modified version of the receiving example that does this with @ref direct_recv.cpp. \dontinclude direct_recv.cpp There are only two differences here. Instead of initiating a link (and implicitly a connection), we listen for incoming connections. \skip on_container_start \until } When we have received all the expected messages, we then stop listening for incoming connections by calling `proton::listener::stop()` \skip on_message \until } \until } \until } \until } You can use the @ref simple_send.cpp example to send to this receiver directly. (Note: you will need to stop any broker that is listening on the 5672 port, or else change the port used by specifying a different address to each example via the `-a` command-line switch). We can also modify the sender to allow the original receiver to connect to it, in @ref direct_send.cpp. Again, that requires just two modifications: \dontinclude direct_send.cpp As with the modified receiver, instead of initiating establishment of a link, we listen for incoming connections. \skip on_container_start \until } When we have received confirmation of all the messages we sent, we call `container::listener::stop()` to exit. \skip on_tracker_accept \until } \until } To try this modified sender, run the original @ref simple_recv.cpp against it. The symmetry in the underlying AMQP wire protocol that enables this is quite unique and elegant, and in reflecting this the Proton API provides a flexible toolkit for implementing all sorts of interesting intermediaries. Request and response -------------------- A common pattern is to send a request message and expect a response message in return. AMQP has special support for this pattern. Let's have a look at a simple example. We'll start with @ref server.cpp, the program that will process the request and send the response. Note that we are still using a broker in this example. Our server will provide a very simple service: it will respond with the body of the request converted to uppercase. \dontinclude server.cpp \skip class server \until }; The code here is not too different from the simple receiver example. However, when we receive a request in `proton::messaging_handler::on_message`, we look at the `proton::message::reply_to` address and create a sender with that address for the response. We'll cache the senders in case we get further requests with the same `reply_to`. Now let's create a simple @ref client.cpp to test this service out. \dontinclude client.cpp Our client takes a list of strings to send as requests. \skipline client( Since we will be sending and receiving, we create a sender and a receiver in `proton::messaging_handler::on_container_start`. Our receiver has a blank address and sets the `dynamic` flag to true, which means we expect the remote end (the broker or server) to assign a unique address for us. \skip on_container_start \until } Now we need a function to send the next request from our list of requests. We set the `reply_to` address to be the dynamically assigned address of our receiver. \skip send_request \until } We need to use the address assigned by the broker as the `reply_to` address of our requests, so we can't send them until our receiver has been set up. To do that, we add an `proton::messaging_handler::on_receiver_open()` method to our handler class and use that as the trigger to send our first request. \skip on_receiver_open \until } When we receive a reply, we send the next request. \skip on_message \until } \until } \until } Direct request and response --------------------------- We can avoid the intermediary process by writing a server that accepts connections directly, @ref server_direct.cpp. It involves the following changes to our original server: \dontinclude server_direct.cpp Our server must generate unique `reply-to` addresses for links from the client that request a dynamic address (previously this was done by the broker). We use a simple counter. \skip generate_address \until } Next we need to handle incoming requests for links with dynamic addresses from the client. We give the link a unique address and record it in our `senders` map. \skip on_sender_open \until } Note that we are interested in *sender* links above because we are implementing the server. A *receiver* link created on the client corresponds to a *sender* link on the server. Finally when we receive a message we look up its `reply_to` in our senders map and send the reply. \skip on_message \until } \until } \until } */ qpid-proton-0.22.0/examples/cpp/ssl_client_cert.cpp0000664000000000000000000001656013257152177017241 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" using proton::connection_options; using proton::ssl_client_options; using proton::ssl_server_options; using proton::ssl_certificate; using proton::sasl; // Helper functions defined below. bool using_OpenSSL(); std::string platform_CA(const std::string &base_name); ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd); static std::string cert_directory; static std::string find_CN(const std::string &); struct server_handler : public proton::messaging_handler { proton::listener listener; void on_connection_open(proton::connection &c) OVERRIDE { std::cout << "Inbound server connection connected via SSL. Protocol: " << c.transport().ssl().protocol() << std::endl; if (c.transport().sasl().outcome() == sasl::OK) { std::string subject = c.transport().ssl().remote_subject(); std::cout << "Inbound client certificate identity " << find_CN(subject) << std::endl; } else { std::cout << "Inbound client authentication failed" < 1) { cert_directory = argv[1]; size_t sz = cert_directory.size(); if (sz && cert_directory[sz -1] != '/') cert_directory.append("/"); } else { cert_directory = "ssl_certs/"; } hello_world_direct hwd; proton::container(hwd).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } bool using_OpenSSL() { // Current defaults. #if defined(WIN32) return false; #else return true; #endif } ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd) { if (using_OpenSSL()) { // The first argument will be the name of the file containing the public certificate, the // second argument will be the name of the file containing the private key. return ssl_certificate(cert_directory + base_name + "-certificate.pem", cert_directory + base_name + "-private-key.pem", passwd); } else { // Windows SChannel // The first argument will be the database or store that contains one or more complete certificates // (public and private data). The second will be an optional name of the certificate in the store // (not used in this example with one certificate per store). return ssl_certificate(cert_directory + base_name + "-full.p12", "", passwd); } } std::string platform_CA(const std::string &base_name) { if (using_OpenSSL()) { // In this simple example with self-signed certificates, the peer's certificate is the CA database. return cert_directory + base_name + "-certificate.pem"; } else { // Windows SChannel. Use a pkcs#12 file with just the peer's public certificate information. return cert_directory + base_name + "-certificate.p12"; } } std::string find_CN(const std::string &subject) { // The subject string is returned with different whitespace and component ordering between platforms. // Here we just return the common name by searching for "CN=...." in the subject, knowing that // the test certificates do not contain any escaped characters. size_t pos = subject.find("CN="); if (pos == std::string::npos) throw std::runtime_error("No common name in certificate subject"); std::string cn = subject.substr(pos); pos = cn.find(','); return pos == std::string::npos ? cn : cn.substr(0, pos); } qpid-proton-0.22.0/examples/cpp/ssl_certs/0000775000000000000000000000000013257152177015352 5ustar qpid-proton-0.22.0/examples/cpp/ssl_certs/tserver-private-key.pem0000664000000000000000000000345213257152177022011 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1cT0c2J3GcQCAggA MBQGCCqGSIb3DQMHBAi1hxSX2LJ+EgSCBMheHJ0iXr5A36Natjk/LcAEeKUMT9s+ sMzoQceCWe8qMlQluWksr9iDdZ4JRIE8cpK8dbmx4dLY/SShUzdlhJHCSa4zZBHq 8cZ/jGUF/RF1rqdgjK589eUq+uOl3/gXKzG/SxBqayy6PSn12kX3qnvmlkXCmtwU lg+iBm5wRcJ0MyVHaJkyA8sW8gr186C/VAau6Yu0crQXN7NRo9snrd4ewuYMIEhZ hgaG9XsYQWB1bPhAaKj80CZGxsQbJyTwcbKKkB3IY4WXx8mmhuiNl+vKT3HBJ9Ju YB6tgIjs8CJ4X2P4aU3yNJwG1QldgHSqmFGQ19bcZAw3s3kzwjdzRf4H2V16XOBd zQ5AEs/ffVMzMIAfkb1gYwgunZ2CVwwDJ2mi1RcgkX+Og2aFQc+fxXcVOnDcGLxV 6fuCuZ2lsXfoiIyRh9kj3L75N12GtVUvgBdnMuOc1wPw6XnGQtDwt0acJpdexLMG k0j57r/gcgzTcmF3qNM+y9L/HLssgrJkvVJw2Np5gmtIyfDocsDUWUbClS4dTpYf oTngUTU+vWtHBuaUnb+f5/WJaRS/S7mmR8usbVG3i9WnEr/vlPJpbJFSjW2S6u/H 7cFxKUmmBZsSuEv/EKt9a+Sh62kprOChm4myqfCI1/gvNKfUZC6m0Vp8zf+2LgAq 2RgbMuqysMjWUtV4kDRZT7oCYckUDwsCHdbLES3nmVrtBk2ShMKHBpDp8/GoRuiV jdV7/EjKM/M1kXtFYYe3z7Mxv++lKYIJ7bNwVrQ8nrhce/VwHw6D5emWXNCJXhKZ FW7EM2ZOZ9eaKOlCsIi8sbjV6Yie9IY6HJKKmi3CpO0Tv5kLBdHkru8vGCSFm3O1 n7wz7Ys5FBSlZ19X0NwQSCQX1Q4w+tido6i1SCRX0qJEdTNGuGwVXMHCf4/1zyHV hj8vnxh8fzo79LFrwlTTgwLg1Mr8sEUFFDJ/raJ1AhFXi8n24trtNR8EHxRW8wtD CLCKaqkEqfBiFXK/Yq3RrefCayPHiD+DaNsI8BwefMGpED3vD8YYCjAzXNPh/CSF sc1i1jWMzbJhzOoFSPNXhlfusbUFMFQ/6olatmH47SY6HBBOL3DDP5uQ0jw8P454 QBjlMOpEZmZxO6TcEtJwu0vzgog4rQ5g3NWy6SIpjWehNwTynLt7yM3R5WTI6cZs 0GTv/rqo2/SUoNsFmnGIUwj/DrBe4XOAq1nS2ZlEctxKhBsKH0hMFp6D1rXOzrgl bwcq+oistoB0TLcThShyNgSqzW1znQ1n5SVUk9b5rRhSttJxn3yOMewH0i3v8bPo HOhP5kaGjblPsCYyhlL/SNVF0OXEGTwLNey7FQdWFOwVwTRRXe7k+uGZ2d5hg+Jn It/trDZ1RDYbVmB7/Qy73c16J4mvhOUJ2de5ZciFBjkidbiiUKLj9xnjK9k9Sauo MKhNnDMAEU5VDQM3xNe5BRdX8dFLwfF5H64sU3nROF83aUnDgvfFEowYPnCuPYfm m4aQHfoBSg4j3v1OeOwktcl+Q2TjxPHfWhbWeRBfxOTqQ/suYhnQChuFSK/qyo9K ccgotqghhunRsWMoZT25H7AZM6yKb1sMz/0oyMRIKeGqoYh+ULM5XLY0xNYd4/xU WtQ= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/cpp/ssl_certs/tserver-full.p120000664000000000000000000000465413257152177020341 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  0ùxåÞ`’€‚¨CùÚZ¯­©N(´„ ©éɘõ?Ýè¾DÇ 2íËà0!õºß·uü»fÅ ÷‚¶ò󚓜Néͨ!`öRÎ,Â0F©ò-{¬æû6¤$Âhû1ÍäŸþCn-7bCP³ù®èzݹâæÑoÙÊEKK|̇'§Ka<´¹é‚¶uz¡ˆÆ)Ç£A¶êšÞ6¢§ºƒ«ªhžÄâ:~o¦]Q €q5ËÅ îõd@Í[û„sP-ÏT 2 9F¥©¶ÉÇ3™h¦NÚ¸(ÐÙ[ŽÕ?41*Ϫ°=oÅ­‰í êzµ>=ªYäÂ(ÔÞ¸¤utRû<åÃéè/8*Üà§åâî È)1‚Z[‘AOè•&x¼Ùƒ7ø8Íõ$7W/±¿ƒ¿3ܸzéßli¾!NfÕ–pbQwUpœÚ”ʉ™?Ï‘$·|…ýñ‚ê ¦Is-~, lÔÂêKUq1\iªÊœ Œ¥+>•à‘Eœš9D‡Q:Í4Õcóá IÇ>t¯dÍ3íȉp¢J¢Éþ××F%Ø¢AÀ×IÖyì† `]âÙþäpÚ_Cn›A/Ä€â™Ë7Cá`N>klMì^LV¦ÛjîÒpKÈ„µ²R%ãxœ:7 3¢ÿãÕ=}‚¶8Ná¢X>÷¶8û ))²Ó –"P-…•·aoÖVTùò’BXnõ7íÂq#T¶%C'ˆò‡&|Á®3Y¾GH+U wóñ#I¾…ä¿“öÆzOˆ˜%¥Ú–"›ÙCa‹f‰:1ð¬:âÚa¥fxpzù¥wÄëÐj~óÄä{»=¿Œ“–D¨ pܨ.NêÂ/ç˜a*®±’Û…ù©åÀl[‚•Úç Íyæen’XfÎO×(*1Ù}ãůt \&±®¦ó!ÁÆV_9Q¥£ºº‡r܆­hY¨·x÷Ë"Å…Œöž+nøF²-ê(ÔZïÖ)­À›Y³8u° •¸ó’ôïÇ>ÇÞ?Y†"ƒY†ãö,å™7F•¹ÀØÊ³&G!¥²ít„ ¹Ía/Ûá±j™zF,Ç"²¸¦äíâÌlúòù©ù”˜'Ï©< ~üNy–Ê*¬wT?}dm±¹AÒ3)ÈŽý$…c¼‹E*ö•›Ô7Í[UŒ©£ýð’}FœZC]þt"óÚ7HÔ ”A3 LœÁð\›™DJy0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0ü¿É¹ÂK>‚È"ÛâŠþ»bÊÖþa´eç~ÕGãßo8ÃoŽ—¡›êJ P&°ØÒ(’¸´±ƒX:kHðúƒÏüÐÕçòÝ|ö,†H4Üc£Sôtl]Û»Hò¬¶„ŒkÑ{¤ÜCØmÈSþËwé§ŒGki‚Ü3£¾n&¥NtÛ~•9ÆT2Xåø E׎sæf“VrèÈ»†æ˜)¨ýÀ‚Ðã+«ÙcL‹6dS€OŽÖÕ`"ŽürâE1gÇø\9Ї½‚Øõëï~i·ÿïŽ|CÊCè;ÅÙ¼èêC<>Ž×®àÀßB=.L‚½Û# ,ÁÖ¨Â%©pñ·™çu¢\Ýf|iŽßïTh·áP‡]TmÅ4tÜb?2Q9út­Ä›ª¶Xs¥îqî²Ë#t ` ß8ã zð¿Íð.»‘—ÕðÔ¿I‡‰ë7M Á÷æÛGGºz­G çºbbì’ÁŸYÏ¥=¼«·ðÜÍí¹žõýÍÁÞ%˜×¶bhðëC.iIp…x:&ûª+Ñ0¬ …`Æ&ª’¶Âìé³)T·ºÇ›a9æ€~Q ò¼“¹š}Ú#ÿ»?0¾$,”Rlf-.@~8ÐÜ0ðíø}5îã4Mw¤‡Øöýfzm`<"'×x–Ø]µ4/.ö3k'ü›º!@ð[§?|¤Ñ[=tä›Ã5¶¤×œ"{T $‘íiÙ/Ùö1¶»9/N·"ÃÊè@¿@¾‰¼¬ÛˆGçÏM¹]Ô]l!åW#khüŽ¿¥ mmÚÚ¬%+Ü“.qéŸãѽöb;4flDøñ ²épÕEö%öÒ‡r·^л>Lf7íõZœ¼¯ÉhK‰=ú"ÇGüÆGÝìÍÕÒ²ÛGY'F%¿Ï$›(+óDç²—ƒúÍô âÆà‡lŸ9L¸éFÚ4üOІ|ý`€wÞ®&Å" z>v°ô‡cÈ “ËuÞðÚ\NCÛëòzV¼ŠÈšW½¢5ñŽ˜‰ùý®«'Qëý!®N4ºøÿ€”sH’¸8‹:_¥ÿâû;ð¹éÏVi@ÛaEIówîdݯ7(œÅé[Žö{„{‚-yU -\~¬E«æU·Uáè÷u‡qåppkÉ:.‘¥z4pÛ6¾[GVæ v›j ðšœB5DÚÅ‘fn VPx 7ï’w©ú»d™,Ž´…]71\¬S…c`0(±H´u ‹²‘;eëèyŸä+ÏËÂõ¤ciÇF‚x…·oX âÇþÈ]‚ØL>ô¾2.V^Т~hI?uDÓq{Ò7`dthö:K3®DüýŒàpºgÕ`%ͬtL&ò§¥x,4»‚…ˆ’Za4k3]Mä ß{”Kd[@ã,ƒ’ÀCYï;é7f¨Ûv'+ŽVâ 'st¬|ç "©ä^z[;Ô-qpid-proton-0.22.0/examples/cpp/ssl_certs/tserver-certificate.pem0000664000000000000000000000220713257152177022030 0ustar -----BEGIN CERTIFICATE----- MIIDKzCCAhOgAwIBAgIJAPnYOOQCJ3kDMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV BAMMC3Rlc3Rfc2VydmVyMRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3Rfc2VydmVyMRQw EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAKJNB78lgw4KtXDAvXocTLud6mbn6zgfB6ETIF+kcrukOH9DnPxjLBBM4Lig sp1+kmeudFK5/X8riDrvIW52b/rlEBLgLB+oDtI74m6OTbBs9L+FUFYOuxApetQF qoJy2vf9pWfy4uku24vCpeo7eVLi6ypu4lXE3LR+Km3FruHI1NKonHBMhwXSOWqF pYM6/4IZJ4fbV0+eU0Jrx+05s6XHg5vone2BVJKxeSIBje+zWnNnh8+qG0Z70Jgp aMetME5KGnLNgD1okpH0vb3lwjvuqkkx4WswGVZGbLLkSqqBpXPyM9fCFVy5aKSL DBq7IABQtO67O2nBzK3OyigHrUUCAwEAAaNQME4wHQYDVR0OBBYEFGV1PY0FCFbJ gpcDVKI6JGiRTt3kMB8GA1UdIwQYMBaAFGV1PY0FCFbJgpcDVKI6JGiRTt3kMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIx1TOTGWnnbpan4bse7wuvH GYSNDJhoTVS+X1TC63xukJD1JBAsCNTqg/ZV6lN3XEl7vvOXfGoCiyXM6a9XOKUo gSDtMrIr+wTh6Ss1yRO8QcCJmxH5JDXNu1ojtwsjFW/vneI4IL9kwpDsSlMQEX/E EkkQwtAx/Cvfe7pecZL4qSeykJOUMTts9H8fCAZqEiRZBA3ugJxqF8jwLP3DoFVQ 6QZzKDY6CSPqfMnVb5i0MAIYVDpau+e3N9dgQpZD22F/zbua0OVbfAPdiRMnYxML FT4sxLnh+5YVqwpVWbEKp4onHe2Fq6YIvAxUYAJ3SBA2C8O2RAVKWxf1jko3jYI= -----END CERTIFICATE----- qpid-proton-0.22.0/examples/cpp/ssl_certs/tserver-certificate.p120000664000000000000000000000201013257152177021641 0ustar 0‚0‚Ê *†H†÷  ‚»‚·0‚³0‚¯ *†H†÷  ‚ 0‚œ0‚• *†H†÷ 0 *†H†÷  0àQÙÙ››€‚håÆ`!ìŸ÷ËÒ˜*®¾Þã…ú*eË%£ðj)F5ugIŸ ýYyÝÐÈq’ÅùŽʰªÐ£ ëD ýù‰_Îæ‰œ¯;-e…:ho_·5ÄMŽàß)~c@¸½é_ØòNQ´sŸ`ÉΫz¢¼y;;We"×Þa Õߤ#É¡ Ù«Îÿ>z8íÑ&Ê YÁµÀÿ ‘ÏúÌ &ÿ°ýÍ&èƒÿ7 y|a»ÉÙŠ„_Ÿ~¤äçVñØý—p®gp#ˆZ<‘:‚ÎKZ]í À,P½k~;3#A3¬I›¿€ÉxëÞûò(–;¸¬Ø-‡ŒI‹é’Z·1=Ê4Ehw<ÿpšE¯ οV¼w‹!ÓŒëÞƒ!ÁD šîáM˜%µF^pôD"û…†l6Ô‚,})5ò© ³TÌžë*ÔÊ,›Ÿs? òÕQpÈoñR$f®šþâ¦åªætÎ'Îé¿NóîÛ¿±P9”!VÓMƒÖ6OG݇h‹†€¶ò(õ¸”Iît±Õ\BÌ-»Ê”$„ÇS²×8ºÅ ¹qÍÿÇU¤RÖqRAó/ZvAõ~ÂõjûvÎe&ׂA™­ëªrOU LBHŠõá^³)ˆû"Ï”OD*£l,v!Mý"·ÍàrÐ&œ˜³žý©GçON-Ρ]͸.¥>‰RE¡°ÌVÊ›‹)žs†Ð(æsÇ3Å=ñi¡ÞÍÂULKSyÎSNÖÑø/cfœ,\:÷BÍ:·±¨€Q™n' ׃.•ånL£7¤I8Vá0emÀ%­ ×/~ÀÕÐ/kìp§3Qm)/â8'µXz‚S©‘Ù0Q°þs!xß´ ('˜ #ÌçÕ}›’rÈœ.]zNÓjDŒ õEz!‡žœY´il÷œ/mÇö>¬þ£1W]–CJþÓ8Á?1ưÙÊÀù¦Gi +SéÒµÔó;Ñf»Š<Úoy<¬ð7‘÷b·g¤†îÀ%“ù‰YxB UJäRŽåÙè÷ø¯%³ëà±uiä»QàVMŠeö–cúô!|ùó?Ê…ÊA7(R„h½OSÑø)LPæ,þ‡R_V“~“ é³¾†ã-Õ^¯øæã«®ßoH010!0 +úŒ àheíløéÇš=·.D{‘<ó¸vàqpid-proton-0.22.0/examples/cpp/ssl_certs/tclient-private-key.pem0000664000000000000000000000345213257152177021761 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQICy6ghWp45z4CAggA MBQGCCqGSIb3DQMHBAiVdDoo4NIghQSCBMixGm1bm/omMxsaKnIPO7zm5dyLexJ+ yTFpmh2KV7kQqmpzCyIOdoG6K8YqFnie2XdFWm3S8faRHoMq54bDmyEWIxfQPq5f I1iYFbIZkbnhUvK53RActsEUMf0locS4xylU7VQK3XTAwp0TVip3Lp3ehEMEdcXL iUWibGsoTPKcY9MIWGXZAJXsEXoeHt6k2hHo1G4E0/Bi6mLW1LY/cxZCjHTGD6qI Kt54SCCDvinqVa+rixw6yX9F14EA6bhALami8e+Ccd3lqHOyYlXcBaSS1ezCg6ig oNK97mC+gEGy1KlkZDKWXclFoOCBXRBe4DByre6Rlq3yeI9L42bvAuSBSmf5QT5g 73Yl8vjEAKR65awBT09dPuKu7t+Fb6vkwF8/t+uyj9IuL+42UuXhMLK3ohf+6DbU 8/zB4y3GXI80QmWM0+Wx4n6khFhPFLHt2q0Sn6V9PG1vtHyiq50oSCoyrPQLaecp hefnMCFBYTcT3JUwmoVGGy0boIAwL7T4aGsMt7QhwOx5tU35tKFxyY7m4fX14AKo 2EIy+TPQwCGkGf3Puy/Pc9VA8IAxB5+WwSrjk+NeCv88eIX7gy43k4rCr+OmD9FF wknr3xoP3KYhNXjdZ4Ep/1UHSK+JAtzzbNLQjDcqN+gQPg/yUX6ih0j5K3Wvh9bK E/DvzbpJroUZPgzR+8z5O68CfsD+OIdpHBFTKqAFmzvUuqpADpr998LdCjD+lW+V xZZgZa8KEblwgiH3fdGbYl46Ho1zrZisf439DbqyybAuBIQB4NSZcL/MAgVGO17k QDpVElWZWYrFm4CFTcvS2HvIzRmbefF5m5oJedsN7Q6WQCp+3gnwYx1xIOknd7pW N4AHNnqjscSj9yACj/EiBVKAKNnC5H7ZGZTsaAjMETZyjLXfI2AZ3Fviz4zFR+oz NkAfFB6WUpRpl7H02FzrzYT7XkkLcXd6H6g+mv2iDa9uKWk/PS2QlqnJt8/dHEHD JKTG331yDK5GHlKAVGF3nP5BwFGgTQMuSoeiOervMXPUwDpQ8OaYkuaRej0cZLgT kAF9sUjqdsoYNcXDFHALp6y5g8qYkfrxrlIbKs82zIsmB5I+dtZbUaD3a0zAUrmW 5Xm3Pc9dVP0EXKwfHz6zqPReEw2yYLisB5IoHd4M2wa3GzHBdra1ij4QTmvd3o7e buGFoX8KJQAcig0zpbYkoDP2gPhIh9rY4unVPQNX1Q8/wRsiJAZZsYvZY+A+SmuZ bwSwk+8ZJRsFzdYYYhQeRytD5cDAIQiClcI5Yj4T9dWQV/gf0N/wIBDNTMp0jJAy 1l7PuXTfGZodNJWZH0oqsrNoWbn/k67NildvvofIKX+h09Nxszr670Pvj0qoHd5/ CWq30lnxoJBUgbikFOz6ZuuHi/ZiCXL+haH+v8hJKN5ptRKnyYJQHchRB/IOGRoT 5lmWxo8a7K+yXhp0VBDHJfw3685ms0xQX8Xj4X3MEuN64zd0fB1JmhtP12ydK85J ABawNKlRQPw5weckwtCviXQX+vX25S/xu3xA6IuqlHyqL/1t3DICzuxeOyT2mZxD tKQxEgNihPvu32vn9m74qA3adEaxuWPRkPZuTeITHOkMTZolvqYX/5olBsSgYwka 7/g= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/cpp/ssl_certs/tclient-full.p120000664000000000000000000000465413257152177020311 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  018µVÀ ûB€‚¨ø±!Š›2d޲@¾˜ï,¼UÈ0Á> Æ•c¸³ŽíŸֱ‹ L8SÉ?ÂÔ'ç®YºG´]ØJd³Ð*b§¿Ì /I µŒv¯ø*§±ªHVnâ·bŸiÃU‹iRLÚ'ŠéÌУS¯¦²†î{Øñ²èÑ~ÇG8 }Ú¨]|ƒ«Ýi|)ä‘ý8žVMÀždÓýN‚ïÛÛžÕ…»{µ9ºßÎoS}¹ÎÔä?²c½1>67)òÁ:ˆ:ïÁÈ/é-_/‡öšˆF 7Š›Jmý/ïßÅ«w¦¼O¡`aW NLJU¡ËÅŸõ=îáÃqJíˆYT)µ‡sõ¯1ã–Dg“ZÇÞR4’/_rs#{0XØG¿—þfËÊSäGÝ„<ÿxe«Ä8ô~Ú :_ðÓ¼`ÿÛ©Kÿ~ Æø-snºØkºÙ[kÐIÔ hû9f“Ÿl9„BˆAU¸¼›ºAoIиNƒZvbzÈ.h„FÑËý«ÓÇù?–2±šªéØ0Ð>;9ëHE%8‹À“ÕÞúÓÕ1bBZ!¢Cx®y&þVŠ4?½]yf%Àå‚l4 *ÔÚÓ)¹ŸÎXr½>’ ›ÛL„“ <9ZŠðÜÿ Š(…íFšM´±ìmäZ½0LŒ‹D¢U«M¸C§Aý‘y!C¡1!ëK6î+—Ñ]XK¦Ì§-v,f<úkÐà>{¶çÄ!¹ùù¦2“Ä`÷EeÜOÐÀÎËA³è|$ºÙÂSéiMöª‘e]¦HÆ,s3%¨{öÜ1Cþ̧òDJ9õÀàÐ5:ý%BÁg2]‘Ý <;‹š…Eòš7ëÖ±·ÊÈŠÚê*)Êó'››87êÝ–ÒŽáaòš>†ÌuÙÓ5½¬Ϩ†‘SµC^t=gÞÿœ"Ê(gêú¶!£çôR_¾àM\芙KXlFÚ^$‹¿kl pSMdMÔ×?yUêÈÓ1 䌓"ÃòߦÖËÑœN:\5§õDﻼhD$Éý¨j ~úùlL ^eÄœ d´Àæíf(€7ÿ½²Aº\²ÍÖ˜˜'i.½Zxßø"¾ ¹ÀO¢øml0³É¡y#U·<ä¸Ö ›Y^.Æi6Ìnì,`lÍ‚tç÷~­æn®ì¢— F¥ö@œ‘##*+þ vsÓ qÌ6QoâÆ ª0€qHP³£VFe|Á¸ Ó_D £0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0MÌ©ŽéË‚È×süUsÉ‹«j¹T6?gb'dʸ܉³ö_frZ‰ÂJ‚Lg‹¨®}R$Z1 °ç2Ô‚õX“5‘d?âåž''µÛàÉÃ3¯¿ýñK-)@ `$  ÿw?H$¤vÞU<}»è£\Öï ÌQ OJ˜`¡Á7㥒L¼á¥L€Êy:yVTF*ñqSßšm£¤¼d+ÄÞ%3œ½ò‚cáÌŸ&l1ª0ï~ÞÁ€'¡¢ç‹WŸª\=ñ…CH¾ë `üäèÜPAW'Iþ™Hˆ: òRÒia­ó,þW^ýžž¾ÆŒ²ɧ‚ð #|ç?{DGh‚ßüÉ',/£ßå±;.ÖÛ}°\›"h­x™·Ošø€d@;Èù*Íffm  ­ñ™ÐÑ€&.¯ ed»µ HŸ7–.å'‹”)¤âR͹kpi‹ÐZ$Îr ÷W"E›N~¯ÓÊ@,R{Óá;-‚̼häÄÌÉ#=¨§äžŸI@Ñ‚·FÁ{Â">•³˜xxg«²ØHBŸ&ñ¡sâ^&¹Z¼Çõ‹}Œ/ÉyÍ5{rp{ ƃH¡³»†’?§$6íHàQ¼foð Àñ² lfôYí´¾SÆe…Ï=‡H=Èô}¬¨ƒãØ<: µ¹™ï:Yk¥ÕT®ý*áˆI’apØuOp|X*o^ûwK­‰{ôL?Ëß±ùEz#ÉD™§é³Çò)lĺѓdW0æá(®–$|·Ñp˜lú^$µ©5ØÉÊ'í» Ø>ŒÃì`u:òàšwò¸“[o™ áÛtMœÐpíJ§è/ üI4Iè’ý(#2æ|‘vÄE†6¡àmÿûܦ\tñ ÝyÎñ"6' ak‚Áb‚¸6nþÿ!IÚžl¸&-¼Úg‡—Üf½ ÀwƒfÊl7ãn}oìy‹*}š´½G'©±k¸½]P áªÓ ë÷GÁ’ù#güfoÑÿý|ÃÕâ÷ì"MýøÞÝRtoR++œzõUÓÞ$š!hŸv}z'妡­%”—Oµ”d*˜V­‰¼ýAËígôBW$´²7~ŽõO÷Œ¼ÂùúŽž¼qÞF2‚­rm€Q¢ÊprI m^íEaD¢'ßà(¼v=퇋òøßö¼…­âXäb¹F CôÛÏçr@ ë —\GÝf\å YGÿÊ#\6³²“êx¢V‰©´êô6Òå_&?”“4¿w?×Ü–l=—ì¨2yáj·3é”}Sï«íeƒ’dÑ_d1=½ë–âûŒWÝL`Õdc„ÕÉŽÜ݇CƒœÇ<1#–аèsJü}÷Ò¬ W;¶ŒX×ô³oÑÚOy Ä/ÿY­ôž²ð†.Í€PâŒä–íŠn³Ïg¶Öž¤®(#ó¿„&¨hÛ,†ö„ÅCç3H1D0 *†H†÷  1tclient0# *†H†÷  1ÅHEF²„±eIŒ¸Å÷ÇU_Ãàp?ÔK3b=sXšã¼Gæž/fsÙ z Æbž-R1J21µ ŸçTY°¬ŸÝÙùY—«Ò&®/ê÷ÛÃPà ŸÎ¹W «×¡~‰R˜_Ðî—vgaõ]+²nSqTó-¹‡Å?ß¾¥ò þ± øÖa(…q¼?À*à®yO R'Ü‹lFìaØVPÇ1ûÅì­%Jj» È&·ñyFï÷ËÓ<€ïH;ùTDT,©FBRcâ)^’¤iÙŸ»¾ï,¯ M’ß,ßÒÎÉNrŒÄ7S'>¶‡¾ñòð~ŒD?_ц"ŒÓO¶ØBL¡3°ñq⣑Æ)ÿ»1ç^}½ë>åM·/ÃיzÓéE´càCüßÑ­ðשj¼ÆØõª,¼ÈÄÆ.¹BI4݋ͥ+­ª‘§bà.•œÛǵ»<‰þZl£©X®öpñ€ÍÀE³¡>eóŒÂÜ13lrDoú Q_R®',*üs¨ã[á+ÚcÝqà{óT›þ˱åÝ ‚É(,:ÕL–0i˜ÕXr§Ù.ãÉ= Æ/RÒlïñõñá0`.¾TŽ8:dUö4š b„Xš\n®@’2è†ôÎS)PïŸø¢åhÜ:Âo“sîa›Þ^[¿Áä´|¼êSe÷L­jËèFÚZ%—vZï.!—6"Kê…Õüêœà]óñ]N„©P×Jß¡Ø ?èò,~¯OÑuØ*Ï «ìzêI ŠDöâ!ÃP—È>ßQñ¦Î™µ0ÝÙ‡éJm[„_ç-óbu„®}Û“Žíû}€GDÌÿ¾‰ÜùÈ |©iÙúœòº`¾à¢o^ÁŽÓds@ä÷]I@hO9CÈ·S›¸(Ä€»ÞU¤WÞ3¦dªK,ŠÞ\+D¤7ÍXÈx¬… ½ÿX؉0ôßÁ%™t¯kÇúW¢G›ÿq2ÂC|¸Ý€þŸâåÀüÑÐbMÈzá·$ú’¡×œ¢¯“Îq  [{A* Ë¶Ù³á;!ÂÍœ®nÑð(Cæô;w Àî"010!0 +Ø*×[. #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" using proton::connection_options; using proton::ssl_client_options; using proton::ssl_server_options; using proton::ssl_certificate; // Helper functions defined below. bool using_OpenSSL(); std::string platform_CA(const std::string &base_name); ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd); std::string find_CN(const std::string &); namespace { const std::string verify_full("full"); // Normal verification const std::string verify_noname("noname"); // Skip matching host name against the certificate const std::string verify_fail("fail"); // Force name mismatch failure std::string verify(verify_full); // Default for example std::string cert_directory; } struct server_handler : public proton::messaging_handler { proton::listener listener; void on_connection_open(proton::connection &c) OVERRIDE { std::cout << "Inbound server connection connected via SSL. Protocol: " << c.transport().ssl().protocol() << std::endl; listener.stop(); // Just expecting the one connection. // Go and do default inbound open stuff too messaging_handler::on_connection_open(c); } void on_transport_error(proton::transport &t) OVERRIDE { listener.stop(); } void on_message(proton::delivery &, proton::message &m) OVERRIDE { std::cout << m.body() << std::endl; } }; class hello_world_direct : public proton::messaging_handler { private: class listener_open_handler : public proton::listen_handler { void on_open(proton::listener& l) OVERRIDE { std::ostringstream url; url << "//:" << l.port() << "/example"; // Connect to the actual port l.container().open_sender(url.str()); } }; listener_open_handler listen_handler; server_handler s_handler; public: void on_container_start(proton::container &c) OVERRIDE { // Configure listener. Details vary by platform. ssl_certificate server_cert = platform_certificate("tserver", "tserverpw"); ssl_server_options ssl_srv(server_cert); connection_options server_opts; server_opts.ssl_server_options(ssl_srv).handler(s_handler); c.server_connection_options(server_opts); // Configure client with a Certificate Authority database // populated with the server's self signed certificate. connection_options client_opts; if (verify == verify_full) { ssl_client_options ssl_cli(platform_CA("tserver")); client_opts.ssl_client_options(ssl_cli); // The next line is optional in normal use. Since the // example uses IP addresses in the connection string, use // the virtual_host option to set the server host name // used for certificate verification: client_opts.virtual_host("test_server"); } else if (verify == verify_noname) { // Downgrade the verification from VERIFY_PEER_NAME to VERIFY_PEER. ssl_client_options ssl_cli(platform_CA("tserver"), proton::ssl::VERIFY_PEER); client_opts.ssl_client_options(ssl_cli); } else if (verify == verify_fail) { ssl_client_options ssl_cli(platform_CA("tserver")); client_opts.ssl_client_options(ssl_cli); client_opts.virtual_host("wrong_name_for_server"); // Pick any name that doesn't match. } else throw std::logic_error("bad verify mode: " + verify); c.client_connection_options(client_opts); s_handler.listener = c.listen("//:0", listen_handler); // Listen on port 0 for a dynamic port } void on_connection_open(proton::connection &c) OVERRIDE { std::string subject = c.transport().ssl().remote_subject(); std::cout << "Outgoing client connection connected via SSL. Server certificate identity " << find_CN(subject) << std::endl; } void on_transport_error(proton::transport &t) OVERRIDE { std::string err = t.error().what(); if (verify == verify_fail && err.find("certificate") != std::string::npos) { std::cout << "Expected failure of connection with wrong peer name: " << err << std::endl; } else { std::cout << "Unexpected transport error: " << err << std::endl; } } void on_sendable(proton::sender &s) OVERRIDE { proton::message m; m.body("Hello World!"); s.send(m); s.close(); } void on_tracker_accept(proton::tracker &t) OVERRIDE { // All done. t.connection().close(); } }; int main(int argc, char **argv) { example::options opts(argc, argv); opts.add_value(cert_directory, 'c', "cert_directory", "directory containing SSL certificates and private key information", "CERTDIR"); opts.add_value(verify, 'v', "verify", "verify type: \"minimum\", \"full\", \"fail\"", "VERIFY"); try { opts.parse(); size_t sz = cert_directory.size(); if (sz && cert_directory[sz -1] != '/') cert_directory.append("/"); else cert_directory = "ssl_certs/"; if (verify != verify_noname && verify != verify_full && verify != verify_fail) throw std::runtime_error("bad verify argument: " + verify); hello_world_direct hwd; proton::container(hwd).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } bool using_OpenSSL() { // Current defaults. #if defined(WIN32) return false; #else return true; #endif } ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd) { if (using_OpenSSL()) { // The first argument will be the name of the file containing the public certificate, the // second argument will be the name of the file containing the private key. return ssl_certificate(cert_directory + base_name + "-certificate.pem", cert_directory + base_name + "-private-key.pem", passwd); } else { // Windows SChannel // The first argument will be the database or store that contains one or more complete certificates // (public and private data). The second will be an optional name of the certificate in the store // (not used in this example with one certificate per store). return ssl_certificate(cert_directory + base_name + "-full.p12", "", passwd); } } std::string platform_CA(const std::string &base_name) { if (using_OpenSSL()) { // In this simple example with self-signed certificates, the peer's certificate is the CA database. return cert_directory + base_name + "-certificate.pem"; } else { // Windows SChannel. Use a pkcs#12 file with just the peer's public certificate information. return cert_directory + base_name + "-certificate.p12"; } } std::string find_CN(const std::string &subject) { // The subject string is returned with different whitespace and component ordering between platforms. // Here we just return the common name by searching for "CN=...." in the subject, knowing that // the test certificates do not contain any escaped characters. size_t pos = subject.find("CN="); if (pos == std::string::npos) throw std::runtime_error("No common name in certificate subject"); std::string cn = subject.substr(pos); pos = cn.find(','); return pos == std::string::npos ? cn : cn.substr(0, pos); } qpid-proton-0.22.0/examples/cpp/simple_send.cpp0000664000000000000000000000643413257152177016366 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class simple_send : public proton::messaging_handler { private: std::string url; std::string user; std::string password; proton::sender sender; int sent; int confirmed; int total; public: simple_send(const std::string &s, const std::string &u, const std::string &p, int c) : url(s), user(u), password(p), sent(0), confirmed(0), total(c) {} void on_container_start(proton::container &c) OVERRIDE { proton::connection_options co; if (!user.empty()) co.user(user); if (!password.empty()) co.password(password); sender = c.open_sender(url, co); } void on_sendable(proton::sender &s) OVERRIDE { while (s.credit() && sent < total) { proton::message msg; std::map m; m["sequence"] = sent + 1; msg.id(sent + 1); msg.body(m); s.send(msg); sent++; } } void on_tracker_accept(proton::tracker &t) OVERRIDE { confirmed++; if (confirmed == total) { std::cout << "all messages confirmed" << std::endl; t.connection().close(); } } void on_transport_close(proton::transport &) OVERRIDE { sent = confirmed; } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); std::string user; std::string password; int message_count = 100; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect and send to URL", "URL"); opts.add_value(message_count, 'm', "messages", "send COUNT messages", "COUNT"); opts.add_value(user, 'u', "user", "authenticate as USER", "USER"); opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD"); try { opts.parse(); simple_send send(address, user, password, message_count); proton::container(send).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/simple_recv.cpp0000664000000000000000000000616613257152177016376 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class simple_recv : public proton::messaging_handler { private: std::string url; std::string user; std::string password; proton::receiver receiver; int expected; int received; public: simple_recv(const std::string &s, const std::string &u, const std::string &p, int c) : url(s), user(u), password(p), expected(c), received(0) {} void on_container_start(proton::container &c) OVERRIDE { proton::connection_options co; if (!user.empty()) co.user(user); if (!password.empty()) co.password(password); receiver = c.open_receiver(url, co); } void on_message(proton::delivery &d, proton::message &msg) OVERRIDE { if (proton::coerce(msg.id()) < received) { return; // Ignore duplicate } if (expected == 0 || received < expected) { std::cout << msg.body() << std::endl; received++; if (received == expected) { d.receiver().close(); d.connection().close(); } } } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); std::string user; std::string password; int message_count = 100; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect to and receive from URL", "URL"); opts.add_value(message_count, 'm', "messages", "receive COUNT messages", "COUNT"); opts.add_value(user, 'u', "user", "authenticate as USER", "USER"); opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD"); try { opts.parse(); simple_recv recv(address, user, password, message_count); proton::container(recv).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/simple_connect.cpp0000664000000000000000000000746613257152177017074 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include "fake_cpp11.hpp" class simple_connect : public proton::messaging_handler { private: std::string url; std::string user; std::string password; bool reconnect; bool sasl; std::string mechs; bool insecure; proton::connection connection; public: simple_connect(const std::string &a, const std::string &u, const std::string &p, bool r, bool s, const std::string& ms, bool in) : url(a), user(u), password(p), reconnect(r), sasl(s), mechs(ms), insecure(in) {} void on_container_start(proton::container &c) OVERRIDE { proton::connection_options co; if (!user.empty()) co.user(user); if (!password.empty()) co.password(password); if (reconnect) co.reconnect(proton::reconnect_options()); if (sasl) co.sasl_enabled(true); // // NB: We only set sasl options if they are not default to avoid // forcing SASL negotiation on when it's not needed. // // This is because the SASL negotiation is turned off unless // it is needed. Setting a username/password or any SASL option will // force the SASL negotiation to be turned on. // if (!mechs.empty()) co.sasl_allowed_mechs(mechs); if (insecure) co.sasl_allow_insecure_mechs(true); connection = c.connect(url, co); } void on_connection_open(proton::connection &c) OVERRIDE { c.close(); } void on_error(const proton::error_condition& e) OVERRIDE { throw std::runtime_error(e.what()); } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); std::string user; std::string password; bool reconnect = false; bool sasl = false; std::string mechs; bool insecure = false; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect and send to URL", "URL"); opts.add_value(user, 'u', "user", "authenticate as USER", "USER"); opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD"); opts.add_flag(reconnect, 'r', "reconnect", "reconnect on connection failure"); opts.add_flag(sasl,'s', "sasl", "force SASL authentication with no user specified (Use for Kerberos/GSSAPI)"); opts.add_value(mechs, 'm', "mechs", "allowed SASL mechanisms", "MECHS"); opts.add_flag(insecure, 'i', "insecure", "allow clear-text passwords"); try { opts.parse(); simple_connect connect(address, user, password, reconnect, sasl, mechs, insecure); proton::container(connect).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/service_bus.cpp0000664000000000000000000003104213257152177016366 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ /* * Service Bus example. * * This is an example of using "Service Bus sessions" (not the same thing as an * AMQP session) to selectively retrieve messages from a queue. The queue must * be configured within Service Bus to support sessions. Service Bus uses the * AMQP group_id message property to associate messages with a particular * Service Bus session. It uses AMQP filters to specify which session is * associated with a receiver. * * The mechanics for sending and receiving to other types of service bus queue * are broadly the same, as long as the step using the * receiver.source().filters() is omitted. * * Other Service Bus notes: There is no drain support, hence the need to to use * timeouts in this example to detect the end of the message stream. There is * no browse support when setting the AMQP link distribution mode to COPY. * Service Bus claims to support browsing, but it is unclear how to manage that * with an AMQP client. Maximum message sizes (for body and headers) vary * between queue types and fee tier ranging from 64KB to 1MB. Due to the * distributed nature of Service Bus, queues do not automatically preserve FIFO * order of messages unless the user takes steps to force the message stream to * a single partition of the queue or creates the queue with partitioning disabled. * * This example shows use of the simpler SAS (Shared Access Signature) * authentication scheme where the credentials are supplied on the connection. * Service Bus does not actually check these credentials when setting up the * connection, it merely caches the SAS key and policy (AKA key name) for later * access authorization when creating senders and receivers. There is a second * authentication scheme that allows for multiple tokens and even updating them * within a long-lived connection which uses special management request-response * queues in Service Bus. The format of this exchange may be documented * somewhere but is also available by working through the CbsAsyncExample.cs * program in the Amqp.Net Lite project. * * The sample output for this program is: sent message: message 0 in service bus session "red" sent message: message 1 in service bus session "green" sent message: message 2 in service bus session "blue" sent message: message 3 in service bus session "red" sent message: message 4 in service bus session "black" sent message: message 5 in service bus session "blue" sent message: message 6 in service bus session "yellow" receiving messages with session identifier "green" from queue ses_q1 received message: message 1 in service bus session "green" receiving messages with session identifier "red" from queue ses_q1 received message: message 0 in service bus session "red" received message: message 3 in service bus session "red" receiving messages with session identifier "blue" from queue ses_q1 received message: message 2 in service bus session "blue" received message: message 5 in service bus session "blue" receiving messages with session identifier "black" from queue ses_q1 received message: message 4 in service bus session "black" receiving messages with session identifier "yellow" from queue ses_q1 received message: message 6 in service bus session "yellow" Done. No more messages. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" using proton::source_options; using proton::connection_options; using proton::sender_options; using proton::receiver_options; void do_next_sequence(); namespace { void check_arg(const std::string &value, const std::string &name) { if (value.empty()) throw std::runtime_error("missing argument for \"" + name + "\""); } } /// Connect to Service Bus queue and retrieve messages in a particular session. class session_receiver : public proton::messaging_handler { private: const std::string &connection_url; const std::string &entity; proton::value session_identifier; // AMQP null type by default, matches any Service Bus sequence identifier int message_count; bool closed; proton::duration read_timeout; proton::timestamp last_read; proton::container *container; proton::receiver receiver; public: session_receiver(const std::string &c, const std::string &e, const char *sid) : connection_url(c), entity(e), message_count(0), closed(false), read_timeout(5000), last_read(0), container(0) { if (sid) session_identifier = std::string(sid); // session_identifier is now either empty/null or an AMQP string type. // If null, Service Bus will pick the first available message and create // a filter at its end with that message's session identifier. // Technically, an AMQP string is not a valid filter-set value unless it // is annotated as an AMQP described type, so this may change. } void run (proton::container &c) { message_count = 0; closed = false; c.connect(connection_url, connection_options().handler(*this)); container = &c; } void on_connection_open(proton::connection &connection) OVERRIDE { proton::source::filter_map sb_filter_map; proton::symbol key("com.microsoft:session-filter"); sb_filter_map.put(key, session_identifier); receiver = connection.open_receiver(entity, receiver_options().source(source_options().filters(sb_filter_map))); // Start timeout processing here. If Service Bus has no pending // messages, it may defer completing the receiver open until a message // becomes available (e.g. to be able to set the actual session // identifier if none was specified). last_read = proton::timestamp::now(); // Call this->process_timeout after read_timeout. container->schedule(read_timeout, [this]() { this->process_timeout(); }); } void on_receiver_open(proton::receiver &r) OVERRIDE { if (closed) return; // PROTON-1264 proton::value actual_session_id = r.source().filters().get("com.microsoft:session-filter"); std::cout << "receiving messages with session identifier \"" << actual_session_id << "\" from queue " << entity << std::endl; last_read = proton::timestamp::now(); } void on_message(proton::delivery &, proton::message &m) OVERRIDE { message_count++; std::cout << " received message: " << m.body() << std::endl; last_read = proton::timestamp::now(); } void process_timeout() { proton::timestamp deadline = last_read + read_timeout; proton::timestamp now = proton::timestamp::now(); if (now >= deadline) { receiver.close(); closed = true; receiver.connection().close(); if (message_count) do_next_sequence(); else std::cout << "Done. No more messages." << std::endl; } else { proton::duration next = deadline - now; container->schedule(next, [this]() { this->process_timeout(); }); } } }; /// Connect to Service Bus queue and send messages divided into different sessions. class session_sender : public proton::messaging_handler { private: const std::string &connection_url; const std::string &entity; int msg_count; int total; int accepts; public: session_sender(const std::string &c, const std::string &e) : connection_url(c), entity(e), msg_count(0), total(7), accepts(0) {} void run(proton::container &c) { c.open_sender(connection_url + "/" + entity, sender_options(), connection_options().handler(*this)); } void send_remaining_messages(proton::sender &s) { std::string gid; for (; msg_count < total && s.credit() > 0; msg_count++) { switch (msg_count) { case 0: gid = "red"; break; case 1: gid = "green"; break; case 2: gid = "blue"; break; case 3: gid = "red"; break; case 4: gid = "black"; break; case 5: gid = "blue"; break; case 6: gid = "yellow"; break; } std::ostringstream mbody; mbody << "message " << msg_count << " in service bus session \"" << gid << "\""; proton::message m(mbody.str()); m.group_id(gid); // Service Bus uses the group_id property to as the session identifier. s.send(m); std::cout << " sent message: " << m.body() << std::endl; } } void on_sendable(proton::sender &s) OVERRIDE { send_remaining_messages(s); } void on_tracker_accept(proton::tracker &t) OVERRIDE { accepts++; if (accepts == total) { // upload complete t.sender().close(); t.sender().connection().close(); do_next_sequence(); } } }; /// Orchestrate the sequential actions of sending and receiving session-based messages. class sequence : public proton::messaging_handler { private: proton::container *container; int sequence_no; session_sender snd; session_receiver rcv_red, rcv_green, rcv_null; public: static sequence *the_sequence; sequence (const std::string &c, const std::string &e) : container(0), sequence_no(0), snd(c, e), rcv_red(c, e, "red"), rcv_green(c, e, "green"), rcv_null(c, e, NULL) { the_sequence = this; } void on_container_start(proton::container &c) OVERRIDE { container = &c; next_sequence(); } void next_sequence() { switch (sequence_no++) { // run these in order exactly once case 0: snd.run(*container); break; case 1: rcv_green.run(*container); break; case 2: rcv_red.run(*container); break; // Run this until the receiver decides there is no messages left to sequence through default: rcv_null.run(*container); break; } } }; sequence *sequence::the_sequence = NULL; void do_next_sequence() { sequence::the_sequence->next_sequence(); } int main(int argc, char **argv) { std::string sb_namespace; // i.e. "foo.servicebus.windows.net" // Make sure the next two are urlencoded for Proton std::string sb_key_name; // shared access key name for entity (AKA "Policy Name") std::string sb_key; // shared access key std::string sb_entity; // AKA the service bus queue. Must enable // sessions on it for this example. example::options opts(argc, argv); opts.add_value(sb_namespace, 'n', "namespace", "Service Bus full namespace", "NAMESPACE"); opts.add_value(sb_key_name, 'p', "policy", "policy name that specifies access rights (key name)", "POLICY"); opts.add_value(sb_key, 'k', "key", "secret key for the policy", "key"); opts.add_value(sb_entity, 'e', "entity", "entity path (queue name)", "ENTITY"); try { opts.parse(); check_arg(sb_namespace, "namespace"); check_arg(sb_key_name, "policy"); check_arg(sb_key, "key"); check_arg(sb_entity, "entity"); std::string connection_string("amqps://" + sb_key_name + ":" + sb_key + "@" + sb_namespace); sequence seq(connection_string, sb_entity); proton::container(seq).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/server_direct.cpp0000664000000000000000000000732513257152177016724 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class server : public proton::messaging_handler { private: class listener_ready_handler : public proton::listen_handler { void on_open(proton::listener& l) OVERRIDE { std::cout << "listening on " << l.port() << std::endl; } }; typedef std::map sender_map; listener_ready_handler listen_handler; std::string url; sender_map senders; int address_counter; public: server(const std::string &u) : url(u), address_counter(0) {} void on_container_start(proton::container &c) OVERRIDE { c.listen(url, listen_handler); } std::string to_upper(const std::string &s) { std::string uc(s); size_t l = uc.size(); for (size_t i=0; i(std::toupper(uc[i])); return uc; } std::string generate_address() { std::ostringstream addr; addr << "server" << address_counter++; return addr.str(); } void on_sender_open(proton::sender &sender) OVERRIDE { if (sender.source().dynamic()) { std::string addr = generate_address(); sender.open(proton::sender_options().source(proton::source_options().address(addr))); senders[addr] = sender; } } void on_message(proton::delivery &, proton::message &m) OVERRIDE { std::cout << "Received " << m.body() << std::endl; std::string reply_to = m.reply_to(); sender_map::iterator it = senders.find(reply_to); if (it == senders.end()) { std::cout << "No link for reply_to: " << reply_to << std::endl; } else { proton::sender sender = it->second; proton::message reply; reply.to(reply_to); reply.body(to_upper(proton::get(m.body()))); reply.correlation_id(m.correlation_id()); sender.send(reply); } } }; int main(int argc, char **argv) { std::string address("amqp://127.0.0.1:5672/examples"); example::options opts(argc, argv); opts.add_value(address, 'a', "address", "listen on URL", "URL"); try { opts.parse(); server srv(address); proton::container(srv).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/server.cpp0000664000000000000000000000522613257152177015370 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class server : public proton::messaging_handler { std::string conn_url_; std::string addr_; proton::connection conn_; std::map senders_; public: server(const std::string& u, const std::string& a) : conn_url_(u), addr_(a) {} void on_container_start(proton::container& c) OVERRIDE { conn_ = c.connect(conn_url_); conn_.open_receiver(addr_); std::cout << "Server connected to " << conn_url_ << std::endl; } std::string to_upper(const std::string& s) { std::string uc(s); size_t l = uc.size(); for (size_t i=0; i(std::toupper(uc[i])); } return uc; } void on_message(proton::delivery&, proton::message& m) OVERRIDE { std::cout << "Received " << m.body() << std::endl; std::string reply_to = m.reply_to(); proton::message reply; reply.to(reply_to); reply.body(to_upper(proton::get(m.body()))); reply.correlation_id(m.correlation_id()); if (!senders_[reply_to]) { senders_[reply_to] = conn_.open_sender(reply_to); } senders_[reply_to].send(reply); } }; int main(int argc, char** argv) { try { std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672"; std::string addr = argc > 2 ? argv[2] : "examples"; server srv(conn_url, addr); proton::container(srv).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/selected_recv.cpp0000664000000000000000000000556213257152177016674 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include "fake_cpp11.hpp" namespace { // Example custom function to configure an AMQP filter, // specifically an APACHE.ORG:SELECTOR // (http://www.amqp.org/specification/1.0/filters) void set_filter(proton::source_options &opts, const std::string& selector_str) { proton::source::filter_map map; proton::symbol filter_key("selector"); proton::value filter_value; // The value is a specific AMQP "described type": binary string with symbolic descriptor proton::codec::encoder enc(filter_value); enc << proton::codec::start::described() << proton::symbol("apache.org:selector-filter:string") << selector_str << proton::codec::finish(); // In our case, the map has this one element map.put(filter_key, filter_value); opts.filters(map); } } class selected_recv : public proton::messaging_handler { std::string conn_url_; std::string addr_; public: selected_recv(const std::string& u, const std::string& a) : conn_url_(u), addr_(a) {} void on_container_start(proton::container &c) OVERRIDE { proton::source_options opts; set_filter(opts, "colour = 'green'"); proton::connection conn = c.connect(conn_url_); conn.open_receiver(addr_, proton::receiver_options().source(opts)); } void on_message(proton::delivery &, proton::message &m) OVERRIDE { std::cout << m.body() << std::endl; } }; int main(int argc, char **argv) { try { std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672"; std::string addr = argc > 2 ? argv[2] : "examples"; selected_recv recv(conn_url, addr); proton::container(recv).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/scheduled_send_03.cpp0000664000000000000000000000737513257152177017344 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" // Send messages at a constant rate one per interval. cancel after a timeout. // This example uses only C++03 features. class scheduled_sender : public proton::messaging_handler { private: std::string url; proton::duration interval, timeout; proton::work_queue *work_queue; bool ready, canceled; public: scheduled_sender(const std::string &s, double d, double t) : url(s), interval(int(d*proton::duration::SECOND.milliseconds())), // Send interval. timeout(int(t*proton::duration::SECOND.milliseconds())), // Cancel after timeout. work_queue(0), ready(true), // Ready to send. canceled(false) // Canceled. {} void on_container_start(proton::container &c) OVERRIDE { c.open_sender(url); } void on_sender_open(proton::sender & s) OVERRIDE { work_queue = &s.work_queue(); work_queue->schedule(timeout, make_work(&scheduled_sender::cancel, this, s)); work_queue->schedule(interval, make_work(&scheduled_sender::tick, this, s)); } void cancel(proton::sender sender) { canceled = true; sender.connection().close(); } void tick(proton::sender sender) { if (!canceled) { work_queue->schedule(interval, make_work(&scheduled_sender::tick, this, sender)); // Next tick if (sender.credit() > 0) // Only send if we have credit send(sender); else ready = true; // Set the ready flag, send as soon as we get credit. } } void on_sendable(proton::sender &sender) OVERRIDE { if (ready) // We have been ticked since the last send. send(sender); } void send(proton::sender& sender) { std::cout << "send" << std::endl; sender.send(proton::message("ping")); ready = false; } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); double interval = 1.0; double timeout = 5.0; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect and send to URL", "URL"); opts.add_value(interval, 'i', "interval", "send a message every INTERVAL seconds", "INTERVAL"); opts.add_value(timeout, 't', "timeout", "stop after T seconds", "T"); try { opts.parse(); scheduled_sender h(address, interval, timeout); proton::container(h).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/scheduled_send.cpp0000664000000000000000000001002313257152177017022 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" // Send messages at a constant rate one per interval. cancel after a timeout. class scheduled_sender : public proton::messaging_handler { private: std::string url; proton::sender sender; proton::duration interval, timeout; proton::work_queue* work_queue; bool ready, canceled; public: scheduled_sender(const std::string &s, double d, double t) : url(s), interval(int(d*proton::duration::SECOND.milliseconds())), // Send interval. timeout(int(t*proton::duration::SECOND.milliseconds())), // Cancel after timeout. work_queue(0), ready(true), // Ready to send. canceled(false) // Canceled. {} // The awkward looking double lambda is necessary because the scheduled lambdas run in the container context // and must arrange lambdas for send and close to happen in the connection context. void on_container_start(proton::container &c) OVERRIDE { c.open_sender(url); } void on_sender_open(proton::sender &s) OVERRIDE { sender = s; work_queue = &s.work_queue(); // Call this->cancel after timeout. s.container().schedule(timeout, [this]() { this->work_queue->add( [this]() { this->cancel(); }); }); // Start regular ticks every interval. s.container().schedule(interval, [this]() { this->work_queue->add( [this]() { this->tick(); }); }); } void cancel() { canceled = true; sender.connection().close(); } void tick() { // Schedule the next tick unless we have been cancelled. if (!canceled) sender.container().schedule(interval, [this]() { this->work_queue->add( [this]() { this->tick(); }); }); if (sender.credit() > 0) // Only send if we have credit send(); else ready = true; // Set the ready flag, send as soon as we get credit. } void on_sendable(proton::sender &) OVERRIDE { if (ready) // We have been ticked since the last send. send(); } void send() { std::cout << "send" << std::endl; sender.send(proton::message("ping")); ready = false; } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); double interval = 1.0; double timeout = 5.0; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect and send to URL", "URL"); opts.add_value(interval, 'i', "interval", "send a message every INTERVAL seconds", "INTERVAL"); opts.add_value(timeout, 't', "timeout", "stop after T seconds", "T"); try { opts.parse(); scheduled_sender h(address, interval, timeout); proton::container(h).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/reconnect_client.cpp0000664000000000000000000001044513257152177017377 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class reconnect_client : public proton::messaging_handler { std::string url; std::string address; std::vector failovers; proton::sender sender; int sent; int expected; int received; public: reconnect_client(const std::string &u, const std::string& a, int c, const std::vector& f) : url(u), address(a), failovers(f), sent(0), expected(c), received(0) {} private: void on_container_start(proton::container &c) OVERRIDE { proton::connection_options co; proton::reconnect_options ro; ro.failover_urls(failovers); co.reconnect(ro); c.connect(url, co); } void on_connection_open(proton::connection & c) OVERRIDE { c.open_receiver(address); c.open_sender(address); // reconnect we probably lost the last message sent sent = received; std::cout << "simple_recv listening on " << url << std::endl; } void on_message(proton::delivery &d, proton::message &msg) OVERRIDE { if (proton::coerce(msg.id()) < received) { return; // Ignore duplicate } if (expected == 0 || received < expected) { std::cout << msg.body() << std::endl; received++; if (received == expected) { d.receiver().close(); sender.close(); d.connection().close(); } else { // See if we can send any messages now send(sender); } } } void send(proton::sender& s) { // Only send with credit and only allow one outstanding message while (s.credit() && sent < received+1) { std::map m; m["sequence"] = sent + 1; proton::message msg; msg.id(sent + 1); msg.body(m); std::cout << "Sending: " << sent+1 << std::endl; s.send(msg); sent++; } } void on_sender_open(proton::sender & s) OVERRIDE { sender = s; } void on_sendable(proton::sender &s) OVERRIDE { send(s); } }; int main(int argc, const char** argv) { try { if (argc < 4) { std ::cerr << "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT FAILOVER-URL...\n" "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n" "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n" "MESSAGE-COUNT: number of messages to receive\n" "FAILOVER_URL...: zero or more failover urls\n"; return 1; } const char *url = argv[1]; const char *address = argv[2]; int message_count = atoi(argv[3]); std::vector failovers(&argv[4], &argv[argc]); reconnect_client client(url, address, message_count, failovers); proton::container(client).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/queue_browser.cpp0000664000000000000000000000413713257152177016751 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class queue_browser : public proton::messaging_handler { std::string conn_url_; std::string addr_; public: queue_browser(const std::string& u, const std::string& a) : conn_url_(u), addr_(a) {} void on_container_start(proton::container& c) OVERRIDE { proton::receiver_options ropts; proton::source_options sopts; ropts.source(sopts.distribution_mode(proton::source::COPY)); proton::connection conn = c.connect(conn_url_); conn.open_receiver(addr_, ropts); } void on_message(proton::delivery&, proton::message& m) OVERRIDE { std::cout << m.body() << std::endl; } }; int main(int argc, char** argv) { try { std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672"; std::string addr = argc > 2 ? argv[2] : "examples"; queue_browser qb(conn_url, addr); proton::container(qb).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/options.hpp0000664000000000000000000001357713257152177015572 0ustar #ifndef OPTIONS_HPP #define OPTIONS_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include #include namespace example { /** bad_option is thrown for option parsing errors */ struct bad_option : public std::runtime_error { bad_option(const std::string& s) : std::runtime_error(s) {} }; /** Simple command-line option parser for example programs */ class options { public: options(int argc, char const * const * argv) : argc_(argc), argv_(argv), prog_(argv[0]), help_() { size_t slash = prog_.find_last_of("/\\"); if (slash != std::string::npos) prog_ = prog_.substr(slash+1); // Extract prog name from path add_flag(help_, 'h', "help", "Print the help message"); } ~options() { for (opts::iterator i = opts_.begin(); i != opts_.end(); ++i) delete *i; } /** Updates value when parse() is called if option is present with a value. */ template void add_value(T& value, char short_name, const std::string& long_name, const std::string& description, const std::string var) { opts_.push_back(new option_value(value, short_name, long_name, description, var)); } /** Sets flag when parse() is called if option is present. */ void add_flag(bool& flag, char short_name, const std::string& long_name, const std::string& description) { opts_.push_back(new option_flag(flag, short_name, long_name, description)); } /** Parse the command line, return the index of the first non-option argument. *@throws bad_option if there is a parsing error or unknown option. */ int parse() { int arg = 1; for (; arg < argc_ && argv_[arg][0] == '-'; ++arg) { opts::iterator i = opts_.begin(); while (i != opts_.end() && !(*i)->parse(argc_, argv_, arg)) ++i; if (i == opts_.end()) throw bad_option(std::string("unknown option ") + argv_[arg]); } if (help_) throw bad_option(""); return arg; } /** Print a usage message */ friend std::ostream& operator<<(std::ostream& os, const options& op) { os << std::endl << "usage: " << op.prog_ << " [options]" << std::endl; os << std::endl << "options:" << std::endl; for (opts::const_iterator i = op.opts_.begin(); i < op.opts_.end(); ++i) os << **i << std::endl; return os; } private: class option { public: option(char s, const std::string& l, const std::string& d, const std::string v) : short_(std::string("-") + s), long_("--" + l), desc_(d), var_(v) {} virtual ~option() {} virtual bool parse(int argc, char const * const * argv, int &i) = 0; virtual void print_default(std::ostream&) const {} friend std::ostream& operator<<(std::ostream& os, const option& op) { os << " " << op.short_; if (!op.var_.empty()) os << " " << op.var_; os << ", " << op.long_; if (!op.var_.empty()) os << "=" << op.var_; os << std::endl << " " << op.desc_; op.print_default(os); return os; } protected: std::string short_, long_, desc_, var_; }; template class option_value : public option { public: option_value(T& value, char s, const std::string& l, const std::string& d, const std::string& v) : option(s, l, d, v), value_(value) {} bool parse(int argc, char const * const * argv, int &i) { std::string arg(argv[i]); if (arg == short_ || arg == long_) { if (i < argc-1) { set_value(arg, argv[++i]); return true; } else { throw bad_option("missing value for " + arg); } } if (arg.compare(0, long_.size(), long_) == 0 && arg[long_.size()] == '=' ) { set_value(long_, arg.substr(long_.size()+1)); return true; } return false; } virtual void print_default(std::ostream& os) const { os << " (default " << value_ << ")"; } void set_value(const std::string& opt, const std::string& s) { std::istringstream is(s); is >> value_; if (is.fail() || is.bad()) throw bad_option("bad value for " + opt + ": " + s); } private: T& value_; }; class option_flag: public option { public: option_flag(bool& flag, const char s, const std::string& l, const std::string& d) : option(s, l, d, ""), flag_(flag) { flag_ = false; } bool parse(int /*argc*/, char const * const * argv, int &i) { if (argv[i] == short_ || argv[i] == long_) { flag_ = true; return true; } else { return false; } } private: bool &flag_; }; typedef std::vector opts; int argc_; char const * const * argv_; std::string prog_; opts opts_; bool help_; }; } #endif // OPTIONS_HPP qpid-proton-0.22.0/examples/cpp/multithreaded_client_flow_control.cpp0000664000000000000000000002526313257152177023045 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // // C++11 or greater // // A multi-threaded client that sends and receives messages from multiple AMQP // addresses. // // Demonstrates how to: // // - implement proton handlers that interact with user threads safely // - block sender threads to respect AMQP flow control // - use AMQP flow control to limit message buffering for receivers threads // // We define sender and receiver classes with simple, thread-safe blocking // send() and receive() functions. // // These classes are also privately proton::message_handler instances. They use // the thread-safe proton::work_queue and standard C++ synchronization (std::mutex // etc.) to pass messages between user and proton::container threads. // // NOTE: no proper error handling #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Lock output from threads to avoid scrambling std::mutex out_lock; #define OUT(x) do { std::lock_guard l(out_lock); x; } while (false) // A thread-safe sending connection that blocks sending threads when there // is no AMQP credit to send messages. class sender : private proton::messaging_handler { // Only used in proton handler thread proton::sender sender_; // Shared by proton and user threads, protected by lock_ std::mutex lock_; proton::work_queue *work_queue_; std::condition_variable sender_ready_; int queued_; // Queued messages waiting to be sent int credit_; // AMQP credit - number of messages we can send public: sender(proton::container& cont, const std::string& url, const std::string& address) : work_queue_(0), queued_(0), credit_(0) { cont.open_sender(url+"/"+address, proton::connection_options().handler(*this)); } // Thread safe void send(const proton::message& m) { { std::unique_lock l(lock_); // Don't queue up more messages than we have credit for while (!work_queue_ || queued_ >= credit_) sender_ready_.wait(l); ++queued_; } work_queue_->add([=]() { this->do_send(m); }); // work_queue_ is thread safe } // Thread safe void close() { work_queue()->add([=]() { sender_.connection().close(); }); } private: proton::work_queue* work_queue() { // Wait till work_queue_ and sender_ are initialized. std::unique_lock l(lock_); while (!work_queue_) sender_ready_.wait(l); return work_queue_; } // == messaging_handler overrides, only called in proton handler thread void on_sender_open(proton::sender& s) override { // Make sure sender_ and work_queue_ are set atomically std::lock_guard l(lock_); sender_ = s; work_queue_ = &s.work_queue(); } void on_sendable(proton::sender& s) override { std::lock_guard l(lock_); credit_ = s.credit(); sender_ready_.notify_all(); // Notify senders we have credit } // work_queue work items is are automatically dequeued and called by proton // This function is called because it was queued by send() void do_send(const proton::message& m) { sender_.send(m); std::lock_guard l(lock_); --queued_; // work item was consumed from the work_queue credit_ = sender_.credit(); // update credit sender_ready_.notify_all(); // Notify senders we have space on queue } void on_error(const proton::error_condition& e) override { OUT(std::cerr << "unexpected error: " << e << std::endl); exit(1); } }; // A thread safe receiving connection that blocks receiving threads when there // are no messages available, and maintains a bounded buffer of incoming // messages by issuing AMQP credit only when there is space in the buffer. class receiver : private proton::messaging_handler { static const size_t MAX_BUFFER = 100; // Max number of buffered messages // Used in proton threads only proton::receiver receiver_; // Used in proton and user threads, protected by lock_ std::mutex lock_; proton::work_queue* work_queue_; std::queue buffer_; // Messages not yet returned by receive() std::condition_variable can_receive_; // Notify receivers of messages public: // Connect to url receiver(proton::container& cont, const std::string& url, const std::string& address) : work_queue_() { // NOTE:credit_window(0) disables automatic flow control. // We will use flow control to match AMQP credit to buffer capacity. cont.open_receiver(url+"/"+address, proton::receiver_options().credit_window(0), proton::connection_options().handler(*this)); } // Thread safe receive proton::message receive() { std::unique_lock l(lock_); // Wait for buffered messages while (!work_queue_ || buffer_.empty()) can_receive_.wait(l); proton::message m = std::move(buffer_.front()); buffer_.pop(); // Add a lambda to the work queue to call receive_done(). // This will tell the handler to add more credit. work_queue_->add([=]() { this->receive_done(); }); return m; } void close() { std::lock_guard l(lock_); if (work_queue_) work_queue_->add([this]() { this->receiver_.connection().close(); }); } private: // ==== The following are called by proton threads only. void on_receiver_open(proton::receiver& r) override { receiver_ = r; std::lock_guard l(lock_); work_queue_ = &receiver_.work_queue(); receiver_.add_credit(MAX_BUFFER); // Buffer is empty, initial credit is the limit } void on_message(proton::delivery &d, proton::message &m) override { // Proton automatically reduces credit by 1 before calling on_message std::lock_guard l(lock_); buffer_.push(m); can_receive_.notify_all(); } // called via work_queue void receive_done() { // Add 1 credit, a receiver has taken a message out of the buffer. receiver_.add_credit(1); } void on_error(const proton::error_condition& e) override { OUT(std::cerr << "unexpected error: " << e << std::endl); exit(1); } }; // ==== Example code using the sender and receiver // Send n messages void send_thread(sender& s, int n) { auto id = std::this_thread::get_id(); for (int i = 0; i < n; ++i) { std::ostringstream ss; ss << std::this_thread::get_id() << "-" << i; s.send(proton::message(ss.str())); OUT(std::cout << id << " sent \"" << ss.str() << '"' << std::endl); } OUT(std::cout << id << " sent " << n << std::endl); } // Receive messages till atomic remaining count is 0. // remaining is shared among all receiving threads void receive_thread(receiver& r, std::atomic_int& remaining) { auto id = std::this_thread::get_id(); int n = 0; // atomically check and decrement remaining *before* receiving. // If it is 0 or less then return, as there are no more // messages to receive so calling r.receive() would block forever. while (remaining-- > 0) { auto m = r.receive(); ++n; OUT(std::cout << id << " received \"" << m.body() << '"' << std::endl); } OUT(std::cout << id << " received " << n << " messages" << std::endl); } int main(int argc, const char **argv) { try { if (argc != 5) { std::cerr << "Usage: " << argv[0] << " MESSAGE-COUNT THREAD-COUNT URL\n" "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n" "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n" "MESSAGE-COUNT: number of messages to send\n" "THREAD-COUNT: number of sender/receiver thread pairs\n"; return 1; } const char *url = argv[1]; const char *address = argv[2]; int n_messages = atoi(argv[3]); int n_threads = atoi(argv[4]); int count = n_messages * n_threads; // Total messages to be received, multiple receiver threads will decrement this. std::atomic_int remaining; remaining.store(count); // Run the proton container proton::container container; auto container_thread = std::thread([&]() { container.run(); }); // A single sender and receiver to be shared by all the threads sender send(container, url, address); receiver recv(container, url, address); // Start receiver threads, then sender threads. // Starting receivers first gives all receivers a chance to compete for messages. std::vector threads; threads.reserve(n_threads*2); // Avoid re-allocation once threads are started for (int i = 0; i < n_threads; ++i) threads.push_back(std::thread([&]() { receive_thread(recv, remaining); })); for (int i = 0; i < n_threads; ++i) threads.push_back(std::thread([&]() { send_thread(send, n_messages); })); // Wait for threads to finish for (auto& t : threads) t.join(); send.close(); recv.close(); container_thread.join(); if (remaining > 0) throw std::runtime_error("not all messages were received"); std::cout << count << " messages sent and received" << std::endl; return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/multithreaded_client.cpp0000664000000000000000000001376213257152177020257 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // // C++11 or greater // // A multi-threaded client that calls proton::container::run() in one thread, sends // messages in another and receives messages in a third. // // Note this client does not deal with flow-control. If the sender is faster // than the receiver, messages will build up in memory on the sending side. // See @ref multithreaded_client_flow_control.cpp for a more complex example with // flow control. // // NOTE: no proper error handling #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Lock output from threads to avoid scrambling std::mutex out_lock; #define OUT(x) do { std::lock_guard l(out_lock); x; } while (false) // Handler for a single thread-safe sending and receiving connection. class client : public proton::messaging_handler { // Invariant const std::string url_; const std::string address_; // Only used in proton handler thread proton::sender sender_; // Shared by proton and user threads, protected by lock_ std::mutex lock_; proton::work_queue *work_queue_; std::condition_variable sender_ready_; std::queue messages_; std::condition_variable messages_ready_; public: client(const std::string& url, const std::string& address) : url_(url), address_(address), work_queue_(0) {} // Thread safe void send(const proton::message& msg) { // Use [=] to copy the message, we cannot pass it by reference since it // will be used in another thread. work_queue()->add([=]() { sender_.send(msg); }); } // Thread safe proton::message receive() { std::unique_lock l(lock_); while (messages_.empty()) messages_ready_.wait(l); auto msg = std::move(messages_.front()); messages_.pop(); return msg; } // Thread safe void close() { work_queue()->add([=]() { sender_.connection().close(); }); } private: proton::work_queue* work_queue() { // Wait till work_queue_ and sender_ are initialized. std::unique_lock l(lock_); while (!work_queue_) sender_ready_.wait(l); return work_queue_; } // == messaging_handler overrides, only called in proton handler thread // Note: this example creates a connection when the container starts. // To create connections after the container has started, use // container::connect(). // See @ref multithreaded_client_flow_control.cpp for an example. void on_container_start(proton::container& cont) override { cont.connect(url_); } void on_connection_open(proton::connection& conn) override { conn.open_sender(address_); conn.open_receiver(address_); } void on_sender_open(proton::sender& s) override { // sender_ and work_queue_ must be set atomically std::lock_guard l(lock_); sender_ = s; work_queue_ = &s.work_queue(); sender_ready_.notify_all(); } void on_message(proton::delivery& dlv, proton::message& msg) override { std::lock_guard l(lock_); messages_.push(msg); messages_ready_.notify_all(); } void on_error(const proton::error_condition& e) override { OUT(std::cerr << "unexpected error: " << e << std::endl); exit(1); } }; int main(int argc, const char** argv) { try { if (argc != 4) { std ::cerr << "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT\n" "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n" "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n" "MESSAGE-COUNT: number of messages to send\n"; return 1; } const char *url = argv[1]; const char *address = argv[2]; int n_messages = atoi(argv[3]); client cl(url, address); proton::container container(cl); std::thread container_thread([&]() { container.run(); }); std::thread sender([&]() { for (int i = 0; i < n_messages; ++i) { proton::message msg(std::to_string(i + 1)); cl.send(msg); OUT(std::cout << "sent \"" << msg.body() << '"' << std::endl); } }); int received = 0; std::thread receiver([&]() { for (int i = 0; i < n_messages; ++i) { auto msg = cl.receive(); OUT(std::cout << "received \"" << msg.body() << '"' << std::endl); ++received; } }); sender.join(); receiver.join(); cl.close(); container_thread.join(); std::cout << received << " messages sent and received" << std::endl; return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/message_properties.cpp0000664000000000000000000000772613257152177017771 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include int main(int argc, char **argv) { try { proton::message m; // Setting properties: legal types are converted automatically to their // AMQP counterpart. m.properties().put("short", int16_t(123)); m.properties().put("string", "foo"); m.properties().put("symbol", proton::symbol("sym")); // Examining properties using proton::get() // 1 argument get<>() template specifies expected type of property. std::string s = proton::get(m.properties().get("string")); // 2 argument get, property must have matching type to output argument. int16_t i; proton::get(m.properties().get("short"), i); // Checking property types proton::type_id type = m.properties().get("symbol").type(); if (type != proton::SYMBOL) { throw std::logic_error("wrong type!"); } // proton::scalar has its own ostream << std::cout << "using put/get:" << " short=" << i << " string=" << s << " symbol=" << m.properties().get("symbol") << std::endl; // Converting properties to a convertible type std::cout << "using coerce:" << " short(as long)=" << proton::coerce(m.properties().get("short")) << std::endl; // Extract the properties as a std::map for more complex map operations. // You can use other map and sequence types to hold a map, see @ref types_page typedef std::map property_map; property_map props; proton::get(m.properties(), props); for (property_map::iterator i = props.begin(); i != props.end(); ++i) { std::cout << "props[" << i->first << "]=" << i->second << std::endl; } props["string"] = "bar"; props["short"] = 42; // Update the properties in the message from the modified props map m.properties() = props; std::cout << "short=" << m.properties().get("short") << " string=" << m.properties().get("string") << std::endl; // proton::get throws an exception if types do not match exactly. try { proton::get(m.properties().get("short")); // bad: uint32_t != int16_t throw std::logic_error("expected exception"); } catch (const proton::conversion_error& e) { std::cout << "expected conversion_error: \"" << e.what() << '"' << std::endl; } // proton::coerce throws an exception if types are not convertible. try { proton::get(m.properties().get("string")); // bad: string to uint32_t throw std::logic_error("expected exception"); } catch (const proton::conversion_error& e) { std::cout << "expected conversion_error: \"" << e.what() << '"' << std::endl; } return 0; } catch (const std::exception& e) { std::cerr << "unexpected exception: " << e.what() << std::endl; return 1; } } qpid-proton-0.22.0/examples/cpp/helloworld.cpp0000664000000000000000000000420313257152177016227 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class hello_world : public proton::messaging_handler { std::string conn_url_; std::string addr_; public: hello_world(const std::string& u, const std::string& a) : conn_url_(u), addr_(a) {} void on_container_start(proton::container& c) OVERRIDE { c.connect(conn_url_); } void on_connection_open(proton::connection& c) OVERRIDE { c.open_receiver(addr_); c.open_sender(addr_); } void on_sendable(proton::sender &s) OVERRIDE { proton::message m("Hello World!"); s.send(m); s.close(); } void on_message(proton::delivery &d, proton::message &m) OVERRIDE { std::cout << m.body() << std::endl; d.connection().close(); } }; int main(int argc, char **argv) { try { std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672"; std::string addr = argc > 2 ? argv[2] : "examples"; hello_world hw(conn_url, addr); proton::container(hw).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/flow_control.cpp0000664000000000000000000002040313257152177016563 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" namespace { bool verbose = true; void verify(bool success, const std::string &msg) { if (!success) throw std::runtime_error("example failure:" + msg); else { std::cout << "success: " << msg << std::endl; if (verbose) std::cout << std::endl; } } } // flow_sender manages the incoming connection and acts as the message sender. class flow_sender : public proton::messaging_handler { private: int available; // Number of messages the sender may send assuming sufficient credit. int sequence; public: flow_sender() : available(0), sequence(0) {} void send_available_messages(proton::sender &s) { for (int i = sequence; available && s.credit() > 0; i++) { std::ostringstream mbody; mbody << "flow_sender message " << sequence++; proton::message m(mbody.str()); s.send(m); available--; } } void on_sendable(proton::sender &s) OVERRIDE { if (verbose) std::cout << "flow_sender in \"on_sendable\" with credit " << s.credit() << " and " << available << " available messages" << std::endl; send_available_messages(s); } void on_sender_drain_start(proton::sender &s) OVERRIDE { if (verbose) std::cout << "flow_sender in \"on_drain_start\" with credit " << s.credit() << " and " << available << " available messages" << std::endl; send_available_messages(s); if (s.credit()) { s.return_credit(); // return the rest } } void set_available(int n) { available = n; } }; class flow_receiver : public proton::messaging_handler { public: int stage; int received; flow_sender &sender; flow_receiver(flow_sender &s) : stage(0), received(0), sender(s) {} void example_setup(int n) { received = 0; sender.set_available(n); } void run_stage(proton::receiver &r, const std::string &caller) { // Serialize the progression of the flow control examples. switch (stage) { case 0: if (verbose) std::cout << "Example 1. Simple use of credit." << std::endl; // TODO: add timeout callbacks, show no messages until credit. example_setup(2); r.add_credit(2); break; case 1: if (r.credit() > 0) return; verify(received == 2, "Example 1: simple credit"); if (verbose) std::cout << "Example 2. Use basic drain, sender has 3 \"immediate\" messages." << std::endl; example_setup(3); r.add_credit(5); // ask for up to 5 r.drain(); // but only use what's available break; case 2: if (caller == "on_message") return; if (caller == "on_receiver_drain_finish") { // Note that unused credit of 2 at sender is returned and is now 0. verify(received == 3 && r.credit() == 0, "Example 2: basic drain"); if (verbose) std::cout << "Example 3. Drain use with no credit." << std::endl; example_setup(0); r.drain(); break; } verify(false, "example 2 run_stage"); return; case 3: verify(caller == "on_receiver_drain_finish" && received == 0, "Example 3: drain without credit"); if (verbose) std::cout << "Example 4. Show using high(10)/low(3) watermark for 25 messages." << std::endl; example_setup(25); r.add_credit(10); break; case 4: if (received < 25) { // Top up credit as needed. uint32_t credit = r.credit(); if (credit <= 3) { uint32_t new_credit = 10; uint32_t remaining = 25 - received; if (new_credit > remaining) new_credit = remaining; if (new_credit > credit) { r.add_credit(new_credit - credit); if (verbose) std::cout << "flow_receiver adding credit for " << new_credit - credit << " messages" << std::endl; } } return; } verify(received == 25 && r.credit() == 0, "Example 4: high/low watermark"); r.connection().close(); break; default: throw std::runtime_error("run_stage sequencing error"); } stage++; } void on_receiver_open(proton::receiver &r) OVERRIDE { run_stage(r, "on_receiver_open"); } void on_message(proton::delivery &d, proton::message &m) OVERRIDE { if (verbose) std::cout << "flow_receiver in \"on_message\" with " << m.body() << std::endl; proton::receiver r(d.receiver()); received++; run_stage(r, "on_message"); } void on_receiver_drain_finish(proton::receiver &r) OVERRIDE { if (verbose) std::cout << "flow_receiver in \"on_receiver_drain_finish\"" << std::endl; run_stage(r, "on_receiver_drain_finish"); } }; class flow_listener : public proton::listen_handler { proton::connection_options opts; public: flow_listener(flow_sender& sh) { opts.handler(sh); } void on_open(proton::listener& l) OVERRIDE { std::ostringstream url; url << "//:" << l.port() << "/example"; // Connect to the actual listening port l.container().connect(url.str()); } proton::connection_options on_accept(proton::listener&) OVERRIDE { return opts; } }; class flow_control : public proton::messaging_handler { private: proton::listener listener; flow_sender send_handler; flow_receiver receive_handler; flow_listener listen_handler; public: flow_control() : receive_handler(send_handler), listen_handler(send_handler) {} void on_container_start(proton::container &c) OVERRIDE { // Listen on a dynamic port on the local host. listener = c.listen("//:0", listen_handler); } void on_connection_open(proton::connection &c) OVERRIDE { if (c.active()) { // outbound connection c.open_receiver("flow_example", proton::receiver_options().handler(receive_handler).credit_window(0)); } } void on_connection_close(proton::connection &) OVERRIDE { listener.stop(); } }; int main(int argc, char **argv) { // Pick an "unusual" port since we are going to be talking to // ourselves, not a broker. bool quiet = false; example::options opts(argc, argv); opts.add_flag(quiet, 'q', "quiet", "suppress additional commentary of credit allocation and consumption"); try { opts.parse(); if (quiet) verbose = false; flow_control fc; proton::container(fc).run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/fake_cpp11.hpp0000664000000000000000000000215613257152177016000 0ustar #ifndef FAKE_CPP11_HPP #define FAKE_CPP11_HPP /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /// These definitions allow us to use some new C++11 features in previous compilers /// /// It is strongly recommended not to copy this - just use C++11/C++14 instead! #if __cplusplus < 201103L #define OVERRIDE #else #define OVERRIDE override #endif #endif // FAKE_CPP11_HPP qpid-proton-0.22.0/examples/cpp/example_test.py0000664000000000000000000002445113257152177016423 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License # # This is a test script to run the examples and verify that they behave as expected. import unittest import os, sys, socket, time, re, inspect from proctest import * from random import randrange from subprocess import Popen, PIPE, STDOUT, call from copy import copy import platform from os.path import dirname as dirname from threading import Thread, Event from string import Template createdSASLDb = False def _cyrusSetup(conf_dir): """Write out simple SASL config.tests """ saslpasswd = os.getenv('SASLPASSWD') if saslpasswd: t = Template("""sasldb_path: ${db} mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS """) abs_conf_dir = os.path.abspath(conf_dir) call(args=['rm','-rf',abs_conf_dir]) os.mkdir(abs_conf_dir) db = os.path.join(abs_conf_dir,'proton.sasldb') conf = os.path.join(abs_conf_dir,'proton-server.conf') f = open(conf, 'w') f.write(t.substitute(db=db)) f.close() cmd_template = Template("echo password | ${saslpasswd} -c -p -f ${db} -u proton user") cmd = cmd_template.substitute(db=db, saslpasswd=saslpasswd) call(args=cmd, shell=True) os.environ['PN_SASL_CONFIG_PATH'] = abs_conf_dir global createdSASLDb createdSASLDb = True # Globally initialize Cyrus SASL configuration _cyrusSetup('sasl_conf') def wait_listening(proc): m = proc.wait_re(".*listening on ([0-9]+)$") return m.group(1), m.group(0)+"\n" # Return (port, line) class BrokerTestCase(ProcTestCase): """ ExampleTest that starts a broker in setUpClass and kills it in tearDownClass. Subclasses must set `broker_exe` class variable with the name of the broker executable. """ @classmethod def setUpClass(cls): cls.broker = None # In case Proc throws, create the attribute. cls.broker = Proc([cls.broker_exe, "-a", "//:0"]) cls.port, line = wait_listening(cls.broker) cls.addr = "//:%s/example" % cls.port @classmethod def tearDownClass(cls): if cls.broker: cls.broker.kill() def tearDown(self): b = type(self).broker if b and b.poll() != None: # Broker crashed type(self).setUpClass() # Start another for the next test. raise ProcError(b, "broker crash") super(BrokerTestCase, self).tearDown() CLIENT_EXPECT="""Twas brillig, and the slithy toves => TWAS BRILLIG, AND THE SLITHY TOVES Did gire and gymble in the wabe. => DID GIRE AND GYMBLE IN THE WABE. All mimsy were the borogroves, => ALL MIMSY WERE THE BOROGROVES, And the mome raths outgrabe. => AND THE MOME RATHS OUTGRABE. """ def recv_expect(): return "".join(['{"sequence"=%s}\n' % (i+1) for i in range(100)]) class ContainerExampleTest(BrokerTestCase): """Run the container examples, verify they behave as expected.""" broker_exe = "broker" def test_helloworld(self): self.assertMultiLineEqual('Hello World!\n', self.proc(["helloworld", self.addr]).wait_exit()) def test_simple_send_recv(self): self.assertMultiLineEqual("all messages confirmed\n", self.proc(["simple_send", "-a", self.addr]).wait_exit()) self.assertMultiLineEqual(recv_expect(), self.proc(["simple_recv", "-a", self.addr]).wait_exit()) def test_simple_recv_send(self): # Start receiver first, then run sender""" recv = self.proc(["simple_recv", "-a", self.addr]) self.assertMultiLineEqual("all messages confirmed\n", self.proc(["simple_send", "-a", self.addr]).wait_exit()) self.assertMultiLineEqual(recv_expect(), recv.wait_exit()) def test_simple_send_direct_recv(self): recv = self.proc(["direct_recv", "-a", "//:0"]) port, line = wait_listening(recv) addr = "//:%s/examples" % port self.assertMultiLineEqual("all messages confirmed\n", self.proc(["simple_send", "-a", addr]).wait_exit()) self.assertMultiLineEqual(line+recv_expect(), recv.wait_exit()) def test_simple_recv_direct_send(self): send = self.proc(["direct_send", "-a", "//:0"]) port, line = wait_listening(send) addr = "//:%s/examples" % port self.assertMultiLineEqual(recv_expect(), self.proc(["simple_recv", "-a", addr]).wait_exit()) self.assertMultiLineEqual(line+"all messages confirmed\n", send.wait_exit()) def test_request_response(self): server = self.proc(["server", self.addr, "example"]) # self.addr has the connection info server.wait_re("connected") self.assertMultiLineEqual(CLIENT_EXPECT, self.proc(["client", "-a", self.addr]).wait_exit()) def test_request_response_direct(self): server = self.proc(["server_direct", "-a", "//:0"]) port, line = wait_listening(server); addr = "//:%s/examples" % port self.assertMultiLineEqual(CLIENT_EXPECT, self.proc(["client", "-a", addr]).wait_exit()) def test_flow_control(self): want="""success: Example 1: simple credit success: Example 2: basic drain success: Example 3: drain without credit success: Example 4: high/low watermark """ self.assertMultiLineEqual(want, self.proc(["flow_control", "--quiet"]).wait_exit()) def test_encode_decode(self): want=""" == Array, list and map of uniform type. array[int(1), int(2), int(3)] [ 1 2 3 ] list[int(1), int(2), int(3)] [ 1 2 3 ] map{string(one):int(1), string(two):int(2)} { one:1 two:2 } map{string(z):int(3), string(a):int(4)} [ z:3 a:4 ] list[string(a), string(b), string(c)] == List and map of mixed type values. list[int(42), string(foo)] [ 42 foo ] map{int(4):string(four), string(five):int(5)} { 4:four five:5 } == Insert with stream operators. array[int(1), int(2), int(3)] list[int(42), boolean(0), symbol(x)] map{string(k1):int(42), symbol(k2):boolean(0)} """ self.maxDiff = None self.assertMultiLineEqual(want, self.proc(["encode_decode"]).wait_exit()) def test_scheduled_send_03(self): # Output should be a bunch of "send" lines but can't guarantee exactly how many. out = self.proc(["scheduled_send_03", "-a", self.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).wait_exit().split() self.assertTrue(len(out) > 0); self.assertEqual(["send"]*len(out), out) @unittest.skipUnless(os.getenv('HAS_CPP11'), "not a C++11 build") def test_scheduled_send(self): out = self.proc(["scheduled_send", "-a", self.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).wait_exit().split() self.assertTrue(len(out) > 0); self.assertEqual(["send"]*len(out), out) def test_message_properties(self): expect="""using put/get: short=123 string=foo symbol=sym using coerce: short(as long)=123 props[short]=123 props[string]=foo props[symbol]=sym short=42 string=bar expected conversion_error: "unexpected type, want: uint got: int" expected conversion_error: "unexpected type, want: uint got: string" """ self.assertMultiLineEqual(expect, self.proc(["message_properties"]).wait_exit()) @unittest.skipUnless(os.getenv('HAS_CPP11'), "not a C++11 build") def test_multithreaded_client(self): got = self.proc(["multithreaded_client", self.addr, "examples", "10"], helgrind=True).wait_exit() self.maxDiff = None self.assertRegexpMatches(got, "10 messages sent and received"); # @unittest.skipUnless(os.getenv('HAS_CPP11'), "not a C++11 build") @unittest.skip("Test is unstable, will enable when fixed") def test_multithreaded_client_flow_control(self): got = self.proc(["multithreaded_client_flow_control", self.addr, "examples", "10", "2"], helgrind=True).wait_exit() self.maxDiff = None self.assertRegexpMatches(got, "20 messages sent and received"); class ContainerExampleSSLTest(BrokerTestCase): """Run the SSL container examples, verify they behave as expected.""" broker_exe = "broker" valgrind = False # Disable for all tests, including inherited def setUp(self): super(ContainerExampleSSLTest, self).setUp() def tearDown(self): super(ContainerExampleSSLTest, self).tearDown() def ssl_certs_dir(self): """Absolute path to the test SSL certificates""" pn_root = dirname(dirname(dirname(sys.argv[0]))) return os.path.join(pn_root, "examples/cpp/ssl_certs") def test_ssl(self): # SSL without SASL, VERIFY_PEER_NAME # Disable valgrind when using OpenSSL out = self.proc(["ssl", "-c", self.ssl_certs_dir()]).wait_exit() expect = "Server certificate identity CN=test_server\nHello World!" self.assertIn(expect, out) def test_ssl_no_name(self): # VERIFY_PEER # Disable valgrind when using OpenSSL out = self.proc(["ssl", "-c", self.ssl_certs_dir(), "-v", "noname"], valgrind=False).wait_exit() expect = "Outgoing client connection connected via SSL. Server certificate identity CN=test_server\nHello World!" self.assertIn(expect, out) def test_ssl_bad_name(self): # VERIFY_PEER out = self.proc(["ssl", "-c", self.ssl_certs_dir(), "-v", "fail"]).wait_exit() expect = "Expected failure of connection with wrong peer name" self.assertIn(expect, out) def test_ssl_client_cert(self): # SSL with SASL EXTERNAL expect="""Inbound client certificate identity CN=test_client Outgoing client connection connected via SSL. Server certificate identity CN=test_server Hello World! """ # Disable valgrind when using OpenSSL out = self.proc(["ssl_client_cert", self.ssl_certs_dir()]).wait_exit() self.assertIn(expect, out) if __name__ == "__main__": unittest.main() qpid-proton-0.22.0/examples/cpp/encode_decode.cpp0000664000000000000000000001773213257152177016627 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include #include #include #include #include #include #include // Examples of how to use the encoder and decoder to create and examine AMQP values. // // Print is defined at the end as an example of how to query and extract complex // values from a decoder in terms of their simple components. void print(proton::value&); // Some helper templates to print map and std::vector results. namespace std { template ostream& operator<<(ostream& o, const std::pair& p) { return o << p.first << ":" << p.second; } template ostream& operator<<(ostream& o, const std::vector& v) { o << "[ "; ostream_iterator oi(o, " "); copy(v.begin(), v.end(), oi); return o << "]"; } template ostream& operator<<(ostream& o, const std::list& v) { o << "[ "; ostream_iterator oi(o, " "); copy(v.begin(), v.end(), oi); return o << "]"; } template ostream& operator<<(ostream& o, const map& m) { o << "{ "; ostream_iterator > oi(o, " "); copy(m.begin(), m.end(), oi); return o << "}"; } } // Insert/extract native C++ containers with uniform type values. static void uniform_containers() { std::cout << std::endl << "== Array, list and map of uniform type." << std::endl; proton::value v; std::vector a; a.push_back(1); a.push_back(2); a.push_back(3); // By default a C++ container is encoded as an AMQP array. v = a; print(v); std::list a1; proton::get(v, a1); std::cout << a1 << std::endl; // You can specify that a container should be encoded as an AMQP list instead. v = proton::codec::encoder::list(a1); print(v); std::cout << proton::get >(v) << std::endl; // C++ map types (types with key_type, mapped_type) convert to an AMQP map by default. std::map m; m["one"] = 1; m["two"] = 2; v = m; print(v); std::cout << proton::get >(v) << std::endl; // A sequence of pairs encodes as an AMQP MAP, which lets you control the encoded order. std::vector > pairs; pairs.push_back(std::make_pair("z", 3)); pairs.push_back(std::make_pair("a", 4)); v = pairs; print(v); // You can also decode an AMQP map as a sequence of pairs to preserve encode order. std::vector > pairs2; proton::codec::decoder d(v); d >> pairs2; std::cout << pairs2 << std::endl; // A vector of proton::value is normally encoded as a mixed-type AMQP LIST, // but you can encoded it as an array provided all the values match the array type. std::vector vv; vv.push_back(proton::value("a")); vv.push_back(proton::value("b")); vv.push_back(proton::value("c")); v = vv; print(v); } // Containers with mixed types use value to represent arbitrary AMQP types. static void mixed_containers() { std::cout << std::endl << "== List and map of mixed type values." << std::endl; proton::value v; std::vector l; l.push_back(proton::value(42)); l.push_back(proton::value(std::string("foo"))); // By default, a sequence of proton::value is treated as an AMQP list. v = l; print(v); std::vector l2 = proton::get >(v); std::cout << l2 << std::endl; std::map m; m[proton::value("five")] = proton::value(5); m[proton::value(4)] = proton::value("four"); v = m; print(v); typedef std::map value_map; value_map m2(proton::get(v)); std::cout << m2 << std::endl; } // Insert using stream operators (see print_next for example of extracting with stream ops.) static void insert_stream_operators() { std::cout << std::endl << "== Insert with stream operators." << std::endl; proton::value v; // Create an array of INT with values [1, 2, 3] proton::codec::encoder e(v); e << proton::codec::start::array(proton::INT) << int32_t(1) << int32_t(2) << int32_t(3) << proton::codec::finish(); print(v); // Create a mixed-type list of the values [42, 0, "x"]. proton::codec::encoder e2(v); e2 << proton::codec::start::list() << int32_t(42) << false << proton::symbol("x") << proton::codec::finish(); print(v); // Create a map { "k1":42, "k2": false } proton::codec::encoder e3(v); e3 << proton::codec::start::map() << "k1" << int32_t(42) << proton::symbol("k2") << false << proton::codec::finish(); print(v); } int main(int, char**) { try { uniform_containers(); mixed_containers(); insert_stream_operators(); return 0; } catch (const std::exception& e) { std::cerr << std::endl << "error: " << e.what() << std::endl; } return 1; } // print_next prints the next value from values by recursively descending into complex values. // // NOTE this is for example purposes only: There is a built in ostream operator<< for values. // // static void print_next(proton::codec::decoder& d) { proton::type_id type = d.next_type(); proton::codec::start s; switch (type) { case proton::ARRAY: { d >> s; std::cout << "array<" << s.element; if (s.is_described) { std::cout << ", descriptor="; print_next(d); } std::cout << ">["; for (size_t i = 0; i < s.size; ++i) { if (i) std::cout << ", "; print_next(d); } std::cout << "]"; d >> proton::codec::finish(); break; } case proton::LIST: { d >> s; std::cout << "list["; for (size_t i = 0; i < s.size; ++i) { if (i) std::cout << ", "; print_next(d); } std::cout << "]"; d >> proton::codec::finish(); break; } case proton::MAP: { d >> s; std::cout << "map{"; for (size_t i = 0; i < s.size/2; ++i) { if (i) std::cout << ", "; print_next(d); std::cout << ":"; // key:value print_next(d); } std::cout << "}"; d >> proton::codec::finish(); break; } case proton::DESCRIBED: { d >> s; std::cout << "described("; print_next(d); // Descriptor print_next(d); // value d >> proton::codec::finish(); break; } default: // A simple type. We could continue the switch for all AMQP types but // we will take a short cut and extract to another value and print that. proton::value v2; d >> v2; std::cout << type << "(" << v2 << ")"; } } // Print a value, for example purposes. Normal code can use operator<< void print(proton::value& v) { proton::codec::decoder d(v); d.rewind(); while (d.more()) { print_next(d); if (d.more()) std::cout << ", "; } std::cout << std::endl; } qpid-proton-0.22.0/examples/cpp/direct_send.cpp0000664000000000000000000000624113257152177016343 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class simple_send : public proton::messaging_handler { private: class listener_ready_handler : public proton::listen_handler { void on_open(proton::listener& l) OVERRIDE { std::cout << "listening on " << l.port() << std::endl; } }; std::string url; proton::listener listener; listener_ready_handler listen_handler; int sent; int confirmed; int total; public: simple_send(const std::string &s, int c) : url(s), sent(0), confirmed(0), total(c) {} void on_container_start(proton::container &c) OVERRIDE { listener = c.listen(url, listen_handler); } void on_sendable(proton::sender &sender) OVERRIDE { while (sender.credit() && sent < total) { proton::message msg; std::map m; m["sequence"] = sent + 1; msg.id(sent + 1); msg.body(m); sender.send(msg); sent++; } } void on_tracker_accept(proton::tracker &t) OVERRIDE { confirmed++; if (confirmed == total) { std::cout << "all messages confirmed" << std::endl; t.connection().close(); listener.stop(); } } void on_transport_close(proton::transport &) OVERRIDE { sent = confirmed; } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); int message_count = 100; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "listen and send on URL", "URL"); opts.add_value(message_count, 'm', "messages", "send COUNT messages", "COUNT"); try { opts.parse(); simple_send send(address, message_count); proton::container(send).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/direct_recv.cpp0000664000000000000000000000566313257152177016360 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class direct_recv : public proton::messaging_handler { private: class listener_ready_handler : public proton::listen_handler { void on_open(proton::listener& l) OVERRIDE { std::cout << "listening on " << l.port() << std::endl; } }; std::string url; proton::listener listener; listener_ready_handler listen_handler; int expected; int received; public: direct_recv(const std::string &s, int c) : url(s), expected(c), received(0) {} void on_container_start(proton::container &c) OVERRIDE { listener = c.listen(url, listen_handler); } void on_message(proton::delivery &d, proton::message &msg) OVERRIDE { if (proton::coerce(msg.id()) < received) { return; // Ignore duplicate } if (expected == 0 || received < expected) { std::cout << msg.body() << std::endl; received++; } if (received == expected) { d.receiver().close(); d.connection().close(); listener.stop(); } } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); int message_count = 100; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "listen and receive on URL", "URL"); opts.add_value(message_count, 'm', "messages", "receive COUNT messages", "COUNT"); try { opts.parse(); direct_recv recv(address, message_count); proton::container(recv).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/connection_options.cpp0000664000000000000000000000511513257152177017771 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include using proton::connection_options; #include "fake_cpp11.hpp" class handler_2 : public proton::messaging_handler { void on_connection_open(proton::connection &c) OVERRIDE { std::cout << "connection events going to handler_2" << std::endl; std::cout << "connection max_frame_size: " << c.max_frame_size() << ", idle timeout: " << c.idle_timeout() << std::endl; c.close(); } }; class main_handler : public proton::messaging_handler { private: std::string url; handler_2 conn_handler; public: main_handler(const std::string& u) : url(u) {} void on_container_start(proton::container &c) OVERRIDE { // Connection options for this connection. Merged with and overriding the container's // client_connection_options() settings. c.connect(url, connection_options().handler(conn_handler).max_frame_size(2468)); } void on_connection_open(proton::connection &c) OVERRIDE { std::cout << "unexpected connection event on main handler" << std::endl; c.close(); } }; int main(int argc, char **argv) { try { std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples"; main_handler handler(url); proton::container container(handler); // Global connection options for future connections on container. container.client_connection_options(connection_options().max_frame_size(12345).idle_timeout(proton::duration(15000))); container.run(); return 0; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/colour_send.cpp0000664000000000000000000000665513257152177016405 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" class colour_send : public proton::messaging_handler { private: std::string url; std::string user; std::string password; proton::sender sender; int sent; int confirmed; int total; public: colour_send(const std::string &s, const std::string &u, const std::string &p, int c) : url(s), user(u), password(p), sent(0), confirmed(0), total(c) {} void on_container_start(proton::container &c) OVERRIDE { proton::connection_options co; if (!user.empty()) co.user(user); if (!password.empty()) co.password(password); sender = c.open_sender(url, co); } void on_sendable(proton::sender &s) OVERRIDE { while (s.credit() && sent < total) { proton::message msg; std::string colour = sent % 2 ? "red" : "green"; msg.properties().put("colour", colour); msg.id(sent + 1); std::stringstream body; body << colour << " " << (sent +1); msg.body(body.str()); s.send(msg); sent++; } } void on_tracker_accept(proton::tracker &t) OVERRIDE { confirmed++; if (confirmed == total) { std::cout << "all messages confirmed" << std::endl; t.connection().close(); } } void on_transport_close(proton::transport &) OVERRIDE { sent = confirmed; } }; int main(int argc, char **argv) { std::string address("127.0.0.1:5672/examples"); std::string user; std::string password; int message_count = 100; example::options opts(argc, argv); opts.add_value(address, 'a', "address", "connect and send to URL", "URL"); opts.add_value(message_count, 'm', "messages", "send COUNT messages", "COUNT"); opts.add_value(user, 'u', "user", "authenticate as USER", "USER"); opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD"); try { opts.parse(); colour_send send(address, user, password, message_count); proton::container(send).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/client.cpp0000664000000000000000000000647113257152177015343 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include "fake_cpp11.hpp" using proton::receiver_options; using proton::source_options; class client : public proton::messaging_handler { private: std::string url; std::vector requests; proton::sender sender; proton::receiver receiver; public: client(const std::string &u, const std::vector& r) : url(u), requests(r) {} void on_container_start(proton::container &c) OVERRIDE { sender = c.open_sender(url); // Create a receiver requesting a dynamically created queue // for the message source. receiver_options opts = receiver_options().source(source_options().dynamic(true)); receiver = sender.connection().open_receiver("", opts); } void send_request() { proton::message req; req.body(requests.front()); req.reply_to(receiver.source().address()); sender.send(req); } void on_receiver_open(proton::receiver &) OVERRIDE { send_request(); } void on_message(proton::delivery &d, proton::message &response) OVERRIDE { if (requests.empty()) return; // Spurious extra message! std::cout << requests.front() << " => " << response.body() << std::endl; requests.erase(requests.begin()); if (!requests.empty()) { send_request(); } else { d.connection().close(); } } }; int main(int argc, char **argv) { std::string url("127.0.0.1:5672/examples"); example::options opts(argc, argv); opts.add_value(url, 'a', "address", "connect and send to URL", "URL"); try { opts.parse(); std::vector requests; requests.push_back("Twas brillig, and the slithy toves"); requests.push_back("Did gire and gymble in the wabe."); requests.push_back("All mimsy were the borogroves,"); requests.push_back("And the mome raths outgrabe."); client c(url, requests); proton::container(c).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/broker.cpp0000664000000000000000000003522713257152177015352 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "options.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if PN_CPP_HAS_STD_THREAD #include int hardware_concurrency() {return std::thread::hardware_concurrency();} #else int hardware_concurrency() {return 1;} #endif #include "fake_cpp11.hpp" // This is a simplified model for a message broker, that only allows for messages to go to a // single receiver. // // This broker is multithread safe and if compiled with C++11 with a multithreaded Proton // binding library will use as many threads as there are thread resources available (usually // cores) // // Queues are only created and never destroyed // // Broker Entities (that need to be individually serialised) // QueueManager - Creates new queues, finds queues // Queue - Queues msgs, records subscribers, sends msgs to subscribers // Connection - Receives Messages from network, sends messages to network. // Work // FindQueue(queueName, connection) - From a Connection to the QueueManager // This will create the queue if it doesn't already exist and send a BoundQueue // message back to the connection. // BoundQueue(queue) - From the QueueManager to a Connection // // QueueMsg(msg) - From a Connection (receiver) to a Queue // Subscribe(sender) - From a Connection (sender) to a Queue // Flow(sender, credit) - From a Connection (sender) to a Queue // Unsubscribe(sender) - From a Connection (sender) to a Queue // // SendMsg(msg) - From a Queue to a Connection (sender) // Unsubscribed() - From a Queue to a Connection (sender) // Simple debug output bool verbose; #define DOUT(x) do {if (verbose) {x};} while (false) class Queue; class Sender; typedef std::map senders; class Sender : public proton::messaging_handler { friend class connection_handler; proton::sender sender_; senders& senders_; proton::work_queue& work_queue_; std::string queue_name_; Queue* queue_; int pending_credit_; // Messaging handlers void on_sendable(proton::sender &sender) OVERRIDE; void on_sender_close(proton::sender &sender) OVERRIDE; public: Sender(proton::sender s, senders& ss) : sender_(s), senders_(ss), work_queue_(s.work_queue()), queue_(0), pending_credit_(0) {} bool add(proton::work f) { return work_queue_.add(f); } void boundQueue(Queue* q, std::string qn); void sendMsg(proton::message m) { DOUT(std::cerr << "Sender: " << this << " sending\n";); sender_.send(m); } void unsubscribed() { DOUT(std::cerr << "Sender: " << this << " deleting\n";); delete this; } }; // Queue - round robin subscriptions class Queue { proton::work_queue work_queue_; const std::string name_; std::deque messages_; typedef std::map subscriptions; // With credit subscriptions subscriptions_; subscriptions::iterator current_; void tryToSend() { DOUT(std::cerr << "Queue: " << this << " tryToSend: " << subscriptions_.size();); // Starting at current_, send messages to subscriptions with credit: // After each send try to find another subscription; Wrap around; // Finish when we run out of messages or credit. size_t outOfCredit = 0; while (!messages_.empty() && outOfCreditsecond << ") ";); if (current_->second>0) { DOUT(std::cerr << current_->first << " ";); current_->first->add(make_work(&Sender::sendMsg, current_->first, messages_.front())); messages_.pop_front(); --current_->second; ++current_; } else { ++outOfCredit; } } DOUT(std::cerr << "\n";); } public: Queue(proton::container& c, const std::string& n) : work_queue_(c), name_(n), current_(subscriptions_.end()) {} bool add(proton::work f) { return work_queue_.add(f); } void queueMsg(proton::message m) { DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") queueMsg\n";); messages_.push_back(m); tryToSend(); } void flow(Sender* s, int c) { DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") flow: " << c << " to " << s << "\n";); subscriptions_[s] = c; tryToSend(); } void subscribe(Sender* s) { DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") subscribe Sender: " << s << "\n";); subscriptions_[s] = 0; } void unsubscribe(Sender* s) { DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") unsubscribe Sender: " << s << "\n";); // If we're about to erase the current subscription move on if (current_ != subscriptions_.end() && current_->first==s) ++current_; subscriptions_.erase(s); s->add(make_work(&Sender::unsubscribed, s)); } }; // We have credit to send a message. void Sender::on_sendable(proton::sender &sender) { if (queue_) { queue_->add(make_work(&Queue::flow, queue_, this, sender.credit())); } else { pending_credit_ = sender.credit(); } } void Sender::on_sender_close(proton::sender &sender) { if (queue_) { queue_->add(make_work(&Queue::unsubscribe, queue_, this)); } else { // TODO: Is it possible to be closed before we get the queue allocated? // If so, we should have a way to mark the sender deleted, so we can delete // on queue binding } senders_.erase(sender); } void Sender::boundQueue(Queue* q, std::string qn) { DOUT(std::cerr << "Sender: " << this << " bound to Queue: " << q <<"(" << qn << ")\n";); queue_ = q; queue_name_ = qn; q->add(make_work(&Queue::subscribe, q, this)); sender_.open(proton::sender_options() .source((proton::source_options().address(queue_name_))) .handler(*this)); if (pending_credit_>0) { queue_->add(make_work(&Queue::flow, queue_, this, pending_credit_)); } std::cout << "sending from " << queue_name_ << std::endl; } class Receiver : public proton::messaging_handler { friend class connection_handler; proton::receiver receiver_; proton::work_queue& work_queue_; Queue* queue_; std::deque messages_; // A message is received. void on_message(proton::delivery &, proton::message &m) OVERRIDE { messages_.push_back(m); if (queue_) { queueMsgs(); } } void queueMsgs() { DOUT(std::cerr << "Receiver: " << this << " queueing " << messages_.size() << " msgs to: " << queue_ << "\n";); while (!messages_.empty()) { queue_->add(make_work(&Queue::queueMsg, queue_, messages_.front())); messages_.pop_front(); } } public: Receiver(proton::receiver r) : receiver_(r), work_queue_(r.work_queue()), queue_(0) {} bool add(proton::work f) { return work_queue_.add(f); } void boundQueue(Queue* q, std::string qn) { DOUT(std::cerr << "Receiver: " << this << " bound to Queue: " << q << "(" << qn << ")\n";); queue_ = q; receiver_.open(proton::receiver_options() .source((proton::source_options().address(qn))) .handler(*this)); std::cout << "receiving to " << qn << std::endl; queueMsgs(); } }; class QueueManager { proton::container& container_; proton::work_queue work_queue_; typedef std::map queues; queues queues_; int next_id_; // Use to generate unique queue IDs. public: QueueManager(proton::container& c) : container_(c), work_queue_(c), next_id_(0) {} bool add(proton::work f) { return work_queue_.add(f); } template void findQueue(T& connection, std::string& qn) { if (qn.empty()) { // Dynamic queue creation std::ostringstream os; os << "_dynamic_" << next_id_++; qn = os.str(); } Queue* q = 0; queues::iterator i = queues_.find(qn); if (i==queues_.end()) { q = new Queue(container_, qn); queues_[qn] = q; } else { q = i->second; } connection.add(make_work(&T::boundQueue, &connection, q, qn)); } void findQueueSender(Sender* s, std::string qn) { findQueue(*s, qn); } void findQueueReceiver(Receiver* r, std::string qn) { findQueue(*r, qn); } }; class connection_handler : public proton::messaging_handler { QueueManager& queue_manager_; senders senders_; public: connection_handler(QueueManager& qm) : queue_manager_(qm) {} void on_connection_open(proton::connection& c) OVERRIDE { c.open(); // Accept the connection } // A sender sends messages from a queue to a subscriber. void on_sender_open(proton::sender &sender) OVERRIDE { std::string qn = sender.source().dynamic() ? "" : sender.source().address(); Sender* s = new Sender(sender, senders_); senders_[sender] = s; queue_manager_.add(make_work(&QueueManager::findQueueSender, &queue_manager_, s, qn)); } // A receiver receives messages from a publisher to a queue. void on_receiver_open(proton::receiver &receiver) OVERRIDE { std::string qname = receiver.target().address(); if (qname == "shutdown") { std::cout << "broker shutting down" << std::endl; // Sending to the special "shutdown" queue stops the broker. receiver.connection().container().stop( proton::error_condition("shutdown", "stop broker")); } else { if (qname.empty()) { DOUT(std::cerr << "ODD - trying to attach to a empty address\n";); } Receiver* r = new Receiver(receiver); queue_manager_.add(make_work(&QueueManager::findQueueReceiver, &queue_manager_, r, qname)); } } void on_session_close(proton::session &session) OVERRIDE { // Unsubscribe all senders that belong to session. for (proton::sender_iterator i = session.senders().begin(); i != session.senders().end(); ++i) { senders::iterator j = senders_.find(*i); if (j == senders_.end()) continue; Sender* s = j->second; if (s->queue_) { s->queue_->add(make_work(&Queue::unsubscribe, s->queue_, s)); } senders_.erase(j); } } void on_error(const proton::error_condition& e) OVERRIDE { std::cerr << "error: " << e.what() << std::endl; } // The container calls on_transport_close() last. void on_transport_close(proton::transport& t) OVERRIDE { // Unsubscribe all senders. for (proton::sender_iterator i = t.connection().senders().begin(); i != t.connection().senders().end(); ++i) { senders::iterator j = senders_.find(*i); if (j == senders_.end()) continue; Sender* s = j->second; if (s->queue_) { s->queue_->add(make_work(&Queue::unsubscribe, s->queue_, s)); } } delete this; // All done. } }; class broker { public: broker(const std::string addr) : container_("broker"), queues_(container_), listener_(queues_) { container_.listen(addr, listener_); } void run() { #if PN_CPP_SUPPORTS_THREADS int threads = hardware_concurrency(); std::cout << "starting " << threads << " listening threads\n"; std::cout.flush(); container_.run(threads); #else std::cout << "no thread support - starting 1 listening thread\n"; std::cout.flush(); container_.run(); #endif } private: struct listener : public proton::listen_handler { listener(QueueManager& c) : queues_(c) {} proton::connection_options on_accept(proton::listener&) OVERRIDE{ return proton::connection_options().handler(*(new connection_handler(queues_))); } void on_open(proton::listener& l) OVERRIDE { std::cout << "broker listening on " << l.port() << std::endl; } void on_error(proton::listener&, const std::string& s) OVERRIDE { std::cerr << "listen error: " << s << std::endl; throw std::runtime_error(s); } QueueManager& queues_; }; proton::container container_; QueueManager queues_; listener listener_; }; int main(int argc, char **argv) { // Command line options std::string address("0.0.0.0"); example::options opts(argc, argv); opts.add_flag(verbose, 'v', "verbose", "verbose (debugging) output"); opts.add_value(address, 'a', "address", "listen on URL", "URL"); try { verbose = false; opts.parse(); broker(address).run(); return 0; } catch (const example::bad_option& e) { std::cout << opts << std::endl << e.what() << std::endl; } catch (const std::exception& e) { std::cerr << "broker shutdown: " << e.what() << std::endl; } return 1; } qpid-proton-0.22.0/examples/cpp/README.dox0000664000000000000000000000735613257152177015035 0ustar // C++ examples list (doxygen format) // // For a tutorial-style description of the examples see tutorial.dox. // To build the full HTML tutorial and documentation, in your build directory do: // // make docs-cpp // // then open proton-c/bindings/cpp/docs/html/tutorial.html in your browser. // DEVELOPER NOTE: If you add or modify examples, please add/update a short // description below and (if appropriate) extend/update tutorial.dox. /** @example helloworld.cpp Connects to a broker on 127.0.0.1:5672, establishes a subscription from the 'examples' node, and creates a sending link to the same node. Sends one message and receives it back. */ /** @example simple_send.cpp An example of sending a fixed number of messages and tracking their (asynchronous) acknowledgement. Messages are sent through the 'examples' node on an intermediary accessible on 127.0.0.1:5672. */ /** @example simple_recv.cpp Subscribes to the 'examples' node on an intermediary accessible on 127.0.0.1:5672. Simply prints out the body of received messages. */ /** @example message_properties.cpp Shows how to set and examine message properties. */ /** @example direct_send.cpp Accepts an incoming connection and then sends like `simple_send`. You can connect directly to `direct_send` *without* a broker using @ref simple_recv.cpp. Make sure to stop the broker first or use a different port for `direct_send`. */ /** @example direct_recv.cpp Accepts an incoming connection and then receives like `simple_recv`. You can connect directly to `direct_recv` *without* a broker using @ref simple_send.cpp. Make sure to stop the broker first or use a different port for `direct_recv`. */ /// @cond INTERNAL /** @example encode_decode.cpp Shows how C++ data types can be converted to and from AMQP types. */ /// @endcond /** @example client.cpp The client part of a request-response example. Sends requests and prints out responses. Requires an intermediary that supports the AMQP 1.0 dynamic nodes on which the responses are received. The requests are sent through the 'examples' node. */ /** @example server.cpp The server part of a request-response example, that receives requests via the examples node, converts the body to uppercase and sends the result back to the indicated reply address. */ /** @example server_direct.cpp A variant of the server part of a request-response example that accepts incoming connections and does not need an intermediary. Much like the original server, it receives incoming requests, converts the body to uppercase and sends the result back to the indicated reply address. Can be used in conjunction with any of the client alternatives. */ /** @example broker.cpp A broker using the `proton::container`. You can use this to run other examples that require an intermediary, or you can use any AMQP 1.0 broker. This broker creates queues automatically when a client tries to send or subscribe. */ /** @example scheduled_send.cpp Shows how to use proton::container::schedule to schedule a timed callback. This version uses std::function and so requires C++11 or better. For a C++03 compatible approach see @ref scheduled_send_03.cpp. */ /** @example scheduled_send_03.cpp Shows how to use proton::container::schedule to schedule a timed callback in a C++03 compatible way. See @ref scheduled_send.cpp for a more convenient approach using std::function if you have C++11. */ /** @example service_bus.cpp A working example for accessing Service Bus session-enabled queues. Also provides some general notes on Service Bus usage. */ /** @example multithreaded_client.cpp A multithreaded sender and receiver. __Requires C++11__ */ /** @example multithreaded_client_flow_control.cpp A multithreaded sender and receiver enhanced for flow control. __Requires C++11__ */ qpid-proton-0.22.0/examples/cpp/CMakeLists.txt0000664000000000000000000000706713257152177016123 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # cmake_minimum_required (VERSION 2.8.12) enable_language(CXX) find_package(ProtonCpp REQUIRED) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads) include_directories(${ProtonCpp_INCLUDE_DIRS}) link_libraries(${ProtonCpp_LIBRARIES}) add_definitions(${ProtonCpp_DEFINITIONS}) macro (has_cxx_features result) set(${result} OFF) if (DEFINED CMAKE_CXX_COMPILE_FEATURES) set(${result} ON) foreach(feature ${ARGN}) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_${feature} N) if (N EQUAL -1) set(${result} OFF) break() endif() endforeach() endif() endmacro() set (BUILD_CPP_03 OFF CACHE BOOL "Compile as C++03 even when C++11 is available") # This effectively checks for cmake version 3.1 or later if (DEFINED CMAKE_CXX_COMPILE_FEATURES) if (BUILD_CPP_03) set(STD 98) else () set(STD 11) has_cxx_features(HAS_ENOUGH_CPP11 lambdas variadic_templates) message(STATUS "Compiling C++11 examples: ${HAS_ENOUGH_CPP11}") endif () set(CMAKE_CXX_STANDARD ${STD}) set(CMAKE_CXX_EXTENSIONS OFF) endif() # Single-threaded examples that work on C++03 foreach(example broker helloworld simple_connect simple_recv simple_send reconnect_client message_properties scheduled_send_03 direct_recv direct_send client server server_direct connection_options queue_browser colour_send selected_recv flow_control ssl ssl_client_cert encode_decode) add_executable(${example} ${example}.cpp) endforeach() if(HAS_ENOUGH_CPP11) # Examples that require C++11 foreach(example scheduled_send service_bus) add_executable(${example} ${example}.cpp) endforeach() # Examples that use threads directly if (Threads_FOUND) foreach(example multithreaded_client multithreaded_client_flow_control) add_executable(${example} ${example}.cpp) target_link_libraries(${example} ${CMAKE_THREAD_LIBS_INIT}) endforeach() endif() endif() # Add a test with the correct environment to find test executables and valgrind. macro(add_cpp_test name) if(WIN32) set(test_path "$;$;$") else(WIN32) set(test_path "$:$ENV{PATH}") endif(WIN32) set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV}) add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} "HAS_CPP11=$<$:1>" -- ${ARGN}) endmacro() add_cpp_test(cpp-example-container ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleTest) if (NOT SSL_IMPL STREQUAL none) add_cpp_test(cpp-example-container-ssl ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleSSLTest) endif() qpid-proton-0.22.0/examples/c/0000775000000000000000000000000013257152177013011 5ustar qpid-proton-0.22.0/examples/c/thread.h0000664000000000000000000000372113257152177014434 0ustar #ifndef _PROTON_EXAMPLES_C_THREADS_H #define _PROTON_EXAMPLES_C_THREADS_H 1 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* EXAMPLE USE ONLY. Simulate the subset of POSIX threads used by examples for windows */ #ifdef _WIN32 #include #include typedef struct { HANDLE handle; void *(*func)(void *); void *arg; } pthread_t; static unsigned __stdcall pthread_run(void *thr0) { pthread_t *t = (pthread_t *) thr0; t->func(t->arg); return 0; } static int pthread_create(pthread_t *t, void *unused, void *(*f)(void *), void *arg) { t->func = f; t->arg = arg; t->handle = (HANDLE) _beginthreadex(0, 0, &pthread_run, t, 0, 0); if (t->handle) { return 0; } return -1; } static int pthread_join(pthread_t t, void **unused) { if (t.handle) { WaitForSingleObject(t.handle, INFINITE); CloseHandle(t.handle); } return 0; } typedef CRITICAL_SECTION pthread_mutex_t; #define pthread_mutex_init(m, unused) InitializeCriticalSectionAndSpinCount(m, 4000) #define pthread_mutex_destroy(m) DeleteCriticalSection(m) #define pthread_mutex_lock(m) EnterCriticalSection(m) #define pthread_mutex_unlock(m) LeaveCriticalSection(m) #else #include #endif #endif /* thread.h */ qpid-proton-0.22.0/examples/c/ssl_certs/0000775000000000000000000000000013257152177015012 5ustar qpid-proton-0.22.0/examples/c/ssl_certs/tserver-private-key.pem0000664000000000000000000000345213257152177021451 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1cT0c2J3GcQCAggA MBQGCCqGSIb3DQMHBAi1hxSX2LJ+EgSCBMheHJ0iXr5A36Natjk/LcAEeKUMT9s+ sMzoQceCWe8qMlQluWksr9iDdZ4JRIE8cpK8dbmx4dLY/SShUzdlhJHCSa4zZBHq 8cZ/jGUF/RF1rqdgjK589eUq+uOl3/gXKzG/SxBqayy6PSn12kX3qnvmlkXCmtwU lg+iBm5wRcJ0MyVHaJkyA8sW8gr186C/VAau6Yu0crQXN7NRo9snrd4ewuYMIEhZ hgaG9XsYQWB1bPhAaKj80CZGxsQbJyTwcbKKkB3IY4WXx8mmhuiNl+vKT3HBJ9Ju YB6tgIjs8CJ4X2P4aU3yNJwG1QldgHSqmFGQ19bcZAw3s3kzwjdzRf4H2V16XOBd zQ5AEs/ffVMzMIAfkb1gYwgunZ2CVwwDJ2mi1RcgkX+Og2aFQc+fxXcVOnDcGLxV 6fuCuZ2lsXfoiIyRh9kj3L75N12GtVUvgBdnMuOc1wPw6XnGQtDwt0acJpdexLMG k0j57r/gcgzTcmF3qNM+y9L/HLssgrJkvVJw2Np5gmtIyfDocsDUWUbClS4dTpYf oTngUTU+vWtHBuaUnb+f5/WJaRS/S7mmR8usbVG3i9WnEr/vlPJpbJFSjW2S6u/H 7cFxKUmmBZsSuEv/EKt9a+Sh62kprOChm4myqfCI1/gvNKfUZC6m0Vp8zf+2LgAq 2RgbMuqysMjWUtV4kDRZT7oCYckUDwsCHdbLES3nmVrtBk2ShMKHBpDp8/GoRuiV jdV7/EjKM/M1kXtFYYe3z7Mxv++lKYIJ7bNwVrQ8nrhce/VwHw6D5emWXNCJXhKZ FW7EM2ZOZ9eaKOlCsIi8sbjV6Yie9IY6HJKKmi3CpO0Tv5kLBdHkru8vGCSFm3O1 n7wz7Ys5FBSlZ19X0NwQSCQX1Q4w+tido6i1SCRX0qJEdTNGuGwVXMHCf4/1zyHV hj8vnxh8fzo79LFrwlTTgwLg1Mr8sEUFFDJ/raJ1AhFXi8n24trtNR8EHxRW8wtD CLCKaqkEqfBiFXK/Yq3RrefCayPHiD+DaNsI8BwefMGpED3vD8YYCjAzXNPh/CSF sc1i1jWMzbJhzOoFSPNXhlfusbUFMFQ/6olatmH47SY6HBBOL3DDP5uQ0jw8P454 QBjlMOpEZmZxO6TcEtJwu0vzgog4rQ5g3NWy6SIpjWehNwTynLt7yM3R5WTI6cZs 0GTv/rqo2/SUoNsFmnGIUwj/DrBe4XOAq1nS2ZlEctxKhBsKH0hMFp6D1rXOzrgl bwcq+oistoB0TLcThShyNgSqzW1znQ1n5SVUk9b5rRhSttJxn3yOMewH0i3v8bPo HOhP5kaGjblPsCYyhlL/SNVF0OXEGTwLNey7FQdWFOwVwTRRXe7k+uGZ2d5hg+Jn It/trDZ1RDYbVmB7/Qy73c16J4mvhOUJ2de5ZciFBjkidbiiUKLj9xnjK9k9Sauo MKhNnDMAEU5VDQM3xNe5BRdX8dFLwfF5H64sU3nROF83aUnDgvfFEowYPnCuPYfm m4aQHfoBSg4j3v1OeOwktcl+Q2TjxPHfWhbWeRBfxOTqQ/suYhnQChuFSK/qyo9K ccgotqghhunRsWMoZT25H7AZM6yKb1sMz/0oyMRIKeGqoYh+ULM5XLY0xNYd4/xU WtQ= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/c/ssl_certs/tserver-full.p120000664000000000000000000000465413257152177020001 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  0ùxåÞ`’€‚¨CùÚZ¯­©N(´„ ©éɘõ?Ýè¾DÇ 2íËà0!õºß·uü»fÅ ÷‚¶ò󚓜Néͨ!`öRÎ,Â0F©ò-{¬æû6¤$Âhû1ÍäŸþCn-7bCP³ù®èzݹâæÑoÙÊEKK|̇'§Ka<´¹é‚¶uz¡ˆÆ)Ç£A¶êšÞ6¢§ºƒ«ªhžÄâ:~o¦]Q €q5ËÅ îõd@Í[û„sP-ÏT 2 9F¥©¶ÉÇ3™h¦NÚ¸(ÐÙ[ŽÕ?41*Ϫ°=oÅ­‰í êzµ>=ªYäÂ(ÔÞ¸¤utRû<åÃéè/8*Üà§åâî È)1‚Z[‘AOè•&x¼Ùƒ7ø8Íõ$7W/±¿ƒ¿3ܸzéßli¾!NfÕ–pbQwUpœÚ”ʉ™?Ï‘$·|…ýñ‚ê ¦Is-~, lÔÂêKUq1\iªÊœ Œ¥+>•à‘Eœš9D‡Q:Í4Õcóá IÇ>t¯dÍ3íȉp¢J¢Éþ××F%Ø¢AÀ×IÖyì† `]âÙþäpÚ_Cn›A/Ä€â™Ë7Cá`N>klMì^LV¦ÛjîÒpKÈ„µ²R%ãxœ:7 3¢ÿãÕ=}‚¶8Ná¢X>÷¶8û ))²Ó –"P-…•·aoÖVTùò’BXnõ7íÂq#T¶%C'ˆò‡&|Á®3Y¾GH+U wóñ#I¾…ä¿“öÆzOˆ˜%¥Ú–"›ÙCa‹f‰:1ð¬:âÚa¥fxpzù¥wÄëÐj~óÄä{»=¿Œ“–D¨ pܨ.NêÂ/ç˜a*®±’Û…ù©åÀl[‚•Úç Íyæen’XfÎO×(*1Ù}ãůt \&±®¦ó!ÁÆV_9Q¥£ºº‡r܆­hY¨·x÷Ë"Å…Œöž+nøF²-ê(ÔZïÖ)­À›Y³8u° •¸ó’ôïÇ>ÇÞ?Y†"ƒY†ãö,å™7F•¹ÀØÊ³&G!¥²ít„ ¹Ía/Ûá±j™zF,Ç"²¸¦äíâÌlúòù©ù”˜'Ï©< ~üNy–Ê*¬wT?}dm±¹AÒ3)ÈŽý$…c¼‹E*ö•›Ô7Í[UŒ©£ýð’}FœZC]þt"óÚ7HÔ ”A3 LœÁð\›™DJy0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0ü¿É¹ÂK>‚È"ÛâŠþ»bÊÖþa´eç~ÕGãßo8ÃoŽ—¡›êJ P&°ØÒ(’¸´±ƒX:kHðúƒÏüÐÕçòÝ|ö,†H4Üc£Sôtl]Û»Hò¬¶„ŒkÑ{¤ÜCØmÈSþËwé§ŒGki‚Ü3£¾n&¥NtÛ~•9ÆT2Xåø E׎sæf“VrèÈ»†æ˜)¨ýÀ‚Ðã+«ÙcL‹6dS€OŽÖÕ`"ŽürâE1gÇø\9Ї½‚Øõëï~i·ÿïŽ|CÊCè;ÅÙ¼èêC<>Ž×®àÀßB=.L‚½Û# ,ÁÖ¨Â%©pñ·™çu¢\Ýf|iŽßïTh·áP‡]TmÅ4tÜb?2Q9út­Ä›ª¶Xs¥îqî²Ë#t ` ß8ã zð¿Íð.»‘—ÕðÔ¿I‡‰ë7M Á÷æÛGGºz­G çºbbì’ÁŸYÏ¥=¼«·ðÜÍí¹žõýÍÁÞ%˜×¶bhðëC.iIp…x:&ûª+Ñ0¬ …`Æ&ª’¶Âìé³)T·ºÇ›a9æ€~Q ò¼“¹š}Ú#ÿ»?0¾$,”Rlf-.@~8ÐÜ0ðíø}5îã4Mw¤‡Øöýfzm`<"'×x–Ø]µ4/.ö3k'ü›º!@ð[§?|¤Ñ[=tä›Ã5¶¤×œ"{T $‘íiÙ/Ùö1¶»9/N·"ÃÊè@¿@¾‰¼¬ÛˆGçÏM¹]Ô]l!åW#khüŽ¿¥ mmÚÚ¬%+Ü“.qéŸãѽöb;4flDøñ ²épÕEö%öÒ‡r·^л>Lf7íõZœ¼¯ÉhK‰=ú"ÇGüÆGÝìÍÕÒ²ÛGY'F%¿Ï$›(+óDç²—ƒúÍô âÆà‡lŸ9L¸éFÚ4üOІ|ý`€wÞ®&Å" z>v°ô‡cÈ “ËuÞðÚ\NCÛëòzV¼ŠÈšW½¢5ñŽ˜‰ùý®«'Qëý!®N4ºøÿ€”sH’¸8‹:_¥ÿâû;ð¹éÏVi@ÛaEIówîdݯ7(œÅé[Žö{„{‚-yU -\~¬E«æU·Uáè÷u‡qåppkÉ:.‘¥z4pÛ6¾[GVæ v›j ðšœB5DÚÅ‘fn VPx 7ï’w©ú»d™,Ž´…]71\¬S…c`0(±H´u ‹²‘;eëèyŸä+ÏËÂõ¤ciÇF‚x…·oX âÇþÈ]‚ØL>ô¾2.V^Т~hI?uDÓq{Ò7`dthö:K3®DüýŒàpºgÕ`%ͬtL&ò§¥x,4»‚…ˆ’Za4k3]Mä ß{”Kd[@ã,ƒ’ÀCYï;é7f¨Ûv'+ŽVâ 'st¬|ç "©ä^z[;Ô-qpid-proton-0.22.0/examples/c/ssl_certs/tserver-certificate.pem0000664000000000000000000000220713257152177021470 0ustar -----BEGIN CERTIFICATE----- MIIDKzCCAhOgAwIBAgIJAPnYOOQCJ3kDMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV BAMMC3Rlc3Rfc2VydmVyMRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3Rfc2VydmVyMRQw EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAKJNB78lgw4KtXDAvXocTLud6mbn6zgfB6ETIF+kcrukOH9DnPxjLBBM4Lig sp1+kmeudFK5/X8riDrvIW52b/rlEBLgLB+oDtI74m6OTbBs9L+FUFYOuxApetQF qoJy2vf9pWfy4uku24vCpeo7eVLi6ypu4lXE3LR+Km3FruHI1NKonHBMhwXSOWqF pYM6/4IZJ4fbV0+eU0Jrx+05s6XHg5vone2BVJKxeSIBje+zWnNnh8+qG0Z70Jgp aMetME5KGnLNgD1okpH0vb3lwjvuqkkx4WswGVZGbLLkSqqBpXPyM9fCFVy5aKSL DBq7IABQtO67O2nBzK3OyigHrUUCAwEAAaNQME4wHQYDVR0OBBYEFGV1PY0FCFbJ gpcDVKI6JGiRTt3kMB8GA1UdIwQYMBaAFGV1PY0FCFbJgpcDVKI6JGiRTt3kMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIx1TOTGWnnbpan4bse7wuvH GYSNDJhoTVS+X1TC63xukJD1JBAsCNTqg/ZV6lN3XEl7vvOXfGoCiyXM6a9XOKUo gSDtMrIr+wTh6Ss1yRO8QcCJmxH5JDXNu1ojtwsjFW/vneI4IL9kwpDsSlMQEX/E EkkQwtAx/Cvfe7pecZL4qSeykJOUMTts9H8fCAZqEiRZBA3ugJxqF8jwLP3DoFVQ 6QZzKDY6CSPqfMnVb5i0MAIYVDpau+e3N9dgQpZD22F/zbua0OVbfAPdiRMnYxML FT4sxLnh+5YVqwpVWbEKp4onHe2Fq6YIvAxUYAJ3SBA2C8O2RAVKWxf1jko3jYI= -----END CERTIFICATE----- qpid-proton-0.22.0/examples/c/ssl_certs/tserver-certificate.p120000664000000000000000000000201013257152177021301 0ustar 0‚0‚Ê *†H†÷  ‚»‚·0‚³0‚¯ *†H†÷  ‚ 0‚œ0‚• *†H†÷ 0 *†H†÷  0àQÙÙ››€‚håÆ`!ìŸ÷ËÒ˜*®¾Þã…ú*eË%£ðj)F5ugIŸ ýYyÝÐÈq’ÅùŽʰªÐ£ ëD ýù‰_Îæ‰œ¯;-e…:ho_·5ÄMŽàß)~c@¸½é_ØòNQ´sŸ`ÉΫz¢¼y;;We"×Þa Õߤ#É¡ Ù«Îÿ>z8íÑ&Ê YÁµÀÿ ‘ÏúÌ &ÿ°ýÍ&èƒÿ7 y|a»ÉÙŠ„_Ÿ~¤äçVñØý—p®gp#ˆZ<‘:‚ÎKZ]í À,P½k~;3#A3¬I›¿€ÉxëÞûò(–;¸¬Ø-‡ŒI‹é’Z·1=Ê4Ehw<ÿpšE¯ οV¼w‹!ÓŒëÞƒ!ÁD šîáM˜%µF^pôD"û…†l6Ô‚,})5ò© ³TÌžë*ÔÊ,›Ÿs? òÕQpÈoñR$f®šþâ¦åªætÎ'Îé¿NóîÛ¿±P9”!VÓMƒÖ6OG݇h‹†€¶ò(õ¸”Iît±Õ\BÌ-»Ê”$„ÇS²×8ºÅ ¹qÍÿÇU¤RÖqRAó/ZvAõ~ÂõjûvÎe&ׂA™­ëªrOU LBHŠõá^³)ˆû"Ï”OD*£l,v!Mý"·ÍàrÐ&œ˜³žý©GçON-Ρ]͸.¥>‰RE¡°ÌVÊ›‹)žs†Ð(æsÇ3Å=ñi¡ÞÍÂULKSyÎSNÖÑø/cfœ,\:÷BÍ:·±¨€Q™n' ׃.•ånL£7¤I8Vá0emÀ%­ ×/~ÀÕÐ/kìp§3Qm)/â8'µXz‚S©‘Ù0Q°þs!xß´ ('˜ #ÌçÕ}›’rÈœ.]zNÓjDŒ õEz!‡žœY´il÷œ/mÇö>¬þ£1W]–CJþÓ8Á?1ưÙÊÀù¦Gi +SéÒµÔó;Ñf»Š<Úoy<¬ð7‘÷b·g¤†îÀ%“ù‰YxB UJäRŽåÙè÷ø¯%³ëà±uiä»QàVMŠeö–cúô!|ùó?Ê…ÊA7(R„h½OSÑø)LPæ,þ‡R_V“~“ é³¾†ã-Õ^¯øæã«®ßoH010!0 +úŒ àheíløéÇš=·.D{‘<ó¸vàqpid-proton-0.22.0/examples/c/ssl_certs/tclient-private-key.pem0000664000000000000000000000345213257152177021421 0ustar -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQICy6ghWp45z4CAggA MBQGCCqGSIb3DQMHBAiVdDoo4NIghQSCBMixGm1bm/omMxsaKnIPO7zm5dyLexJ+ yTFpmh2KV7kQqmpzCyIOdoG6K8YqFnie2XdFWm3S8faRHoMq54bDmyEWIxfQPq5f I1iYFbIZkbnhUvK53RActsEUMf0locS4xylU7VQK3XTAwp0TVip3Lp3ehEMEdcXL iUWibGsoTPKcY9MIWGXZAJXsEXoeHt6k2hHo1G4E0/Bi6mLW1LY/cxZCjHTGD6qI Kt54SCCDvinqVa+rixw6yX9F14EA6bhALami8e+Ccd3lqHOyYlXcBaSS1ezCg6ig oNK97mC+gEGy1KlkZDKWXclFoOCBXRBe4DByre6Rlq3yeI9L42bvAuSBSmf5QT5g 73Yl8vjEAKR65awBT09dPuKu7t+Fb6vkwF8/t+uyj9IuL+42UuXhMLK3ohf+6DbU 8/zB4y3GXI80QmWM0+Wx4n6khFhPFLHt2q0Sn6V9PG1vtHyiq50oSCoyrPQLaecp hefnMCFBYTcT3JUwmoVGGy0boIAwL7T4aGsMt7QhwOx5tU35tKFxyY7m4fX14AKo 2EIy+TPQwCGkGf3Puy/Pc9VA8IAxB5+WwSrjk+NeCv88eIX7gy43k4rCr+OmD9FF wknr3xoP3KYhNXjdZ4Ep/1UHSK+JAtzzbNLQjDcqN+gQPg/yUX6ih0j5K3Wvh9bK E/DvzbpJroUZPgzR+8z5O68CfsD+OIdpHBFTKqAFmzvUuqpADpr998LdCjD+lW+V xZZgZa8KEblwgiH3fdGbYl46Ho1zrZisf439DbqyybAuBIQB4NSZcL/MAgVGO17k QDpVElWZWYrFm4CFTcvS2HvIzRmbefF5m5oJedsN7Q6WQCp+3gnwYx1xIOknd7pW N4AHNnqjscSj9yACj/EiBVKAKNnC5H7ZGZTsaAjMETZyjLXfI2AZ3Fviz4zFR+oz NkAfFB6WUpRpl7H02FzrzYT7XkkLcXd6H6g+mv2iDa9uKWk/PS2QlqnJt8/dHEHD JKTG331yDK5GHlKAVGF3nP5BwFGgTQMuSoeiOervMXPUwDpQ8OaYkuaRej0cZLgT kAF9sUjqdsoYNcXDFHALp6y5g8qYkfrxrlIbKs82zIsmB5I+dtZbUaD3a0zAUrmW 5Xm3Pc9dVP0EXKwfHz6zqPReEw2yYLisB5IoHd4M2wa3GzHBdra1ij4QTmvd3o7e buGFoX8KJQAcig0zpbYkoDP2gPhIh9rY4unVPQNX1Q8/wRsiJAZZsYvZY+A+SmuZ bwSwk+8ZJRsFzdYYYhQeRytD5cDAIQiClcI5Yj4T9dWQV/gf0N/wIBDNTMp0jJAy 1l7PuXTfGZodNJWZH0oqsrNoWbn/k67NildvvofIKX+h09Nxszr670Pvj0qoHd5/ CWq30lnxoJBUgbikFOz6ZuuHi/ZiCXL+haH+v8hJKN5ptRKnyYJQHchRB/IOGRoT 5lmWxo8a7K+yXhp0VBDHJfw3685ms0xQX8Xj4X3MEuN64zd0fB1JmhtP12ydK85J ABawNKlRQPw5weckwtCviXQX+vX25S/xu3xA6IuqlHyqL/1t3DICzuxeOyT2mZxD tKQxEgNihPvu32vn9m74qA3adEaxuWPRkPZuTeITHOkMTZolvqYX/5olBsSgYwka 7/g= -----END ENCRYPTED PRIVATE KEY----- qpid-proton-0.22.0/examples/c/ssl_certs/tclient-full.p120000664000000000000000000000465413257152177017751 0ustar 0‚ ¨0‚ n *†H†÷  ‚ _‚ [0‚ W0‚ï *†H†÷  ‚à0‚Ü0‚Õ *†H†÷ 0 *†H†÷  018µVÀ ûB€‚¨ø±!Š›2d޲@¾˜ï,¼UÈ0Á> Æ•c¸³ŽíŸֱ‹ L8SÉ?ÂÔ'ç®YºG´]ØJd³Ð*b§¿Ì /I µŒv¯ø*§±ªHVnâ·bŸiÃU‹iRLÚ'ŠéÌУS¯¦²†î{Øñ²èÑ~ÇG8 }Ú¨]|ƒ«Ýi|)ä‘ý8žVMÀždÓýN‚ïÛÛžÕ…»{µ9ºßÎoS}¹ÎÔä?²c½1>67)òÁ:ˆ:ïÁÈ/é-_/‡öšˆF 7Š›Jmý/ïßÅ«w¦¼O¡`aW NLJU¡ËÅŸõ=îáÃqJíˆYT)µ‡sõ¯1ã–Dg“ZÇÞR4’/_rs#{0XØG¿—þfËÊSäGÝ„<ÿxe«Ä8ô~Ú :_ðÓ¼`ÿÛ©Kÿ~ Æø-snºØkºÙ[kÐIÔ hû9f“Ÿl9„BˆAU¸¼›ºAoIиNƒZvbzÈ.h„FÑËý«ÓÇù?–2±šªéØ0Ð>;9ëHE%8‹À“ÕÞúÓÕ1bBZ!¢Cx®y&þVŠ4?½]yf%Àå‚l4 *ÔÚÓ)¹ŸÎXr½>’ ›ÛL„“ <9ZŠðÜÿ Š(…íFšM´±ìmäZ½0LŒ‹D¢U«M¸C§Aý‘y!C¡1!ëK6î+—Ñ]XK¦Ì§-v,f<úkÐà>{¶çÄ!¹ùù¦2“Ä`÷EeÜOÐÀÎËA³è|$ºÙÂSéiMöª‘e]¦HÆ,s3%¨{öÜ1Cþ̧òDJ9õÀàÐ5:ý%BÁg2]‘Ý <;‹š…Eòš7ëÖ±·ÊÈŠÚê*)Êó'››87êÝ–ÒŽáaòš>†ÌuÙÓ5½¬Ϩ†‘SµC^t=gÞÿœ"Ê(gêú¶!£çôR_¾àM\芙KXlFÚ^$‹¿kl pSMdMÔ×?yUêÈÓ1 䌓"ÃòߦÖËÑœN:\5§õDﻼhD$Éý¨j ~úùlL ^eÄœ d´Àæíf(€7ÿ½²Aº\²ÍÖ˜˜'i.½Zxßø"¾ ¹ÀO¢øml0³É¡y#U·<ä¸Ö ›Y^.Æi6Ìnì,`lÍ‚tç÷~­æn®ì¢— F¥ö@œ‘##*+þ vsÓ qÌ6QoâÆ ª0€qHP³£VFe|Á¸ Ó_D £0‚` *†H†÷  ‚Q‚M0‚I0‚E *†H†÷   ‚î0‚ê0 *†H†÷  0MÌ©ŽéË‚È×süUsÉ‹«j¹T6?gb'dʸ܉³ö_frZ‰ÂJ‚Lg‹¨®}R$Z1 °ç2Ô‚õX“5‘d?âåž''µÛàÉÃ3¯¿ýñK-)@ `$  ÿw?H$¤vÞU<}»è£\Öï ÌQ OJ˜`¡Á7㥒L¼á¥L€Êy:yVTF*ñqSßšm£¤¼d+ÄÞ%3œ½ò‚cáÌŸ&l1ª0ï~ÞÁ€'¡¢ç‹WŸª\=ñ…CH¾ë `üäèÜPAW'Iþ™Hˆ: òRÒia­ó,þW^ýžž¾ÆŒ²ɧ‚ð #|ç?{DGh‚ßüÉ',/£ßå±;.ÖÛ}°\›"h­x™·Ošø€d@;Èù*Íffm  ­ñ™ÐÑ€&.¯ ed»µ HŸ7–.å'‹”)¤âR͹kpi‹ÐZ$Îr ÷W"E›N~¯ÓÊ@,R{Óá;-‚̼häÄÌÉ#=¨§äžŸI@Ñ‚·FÁ{Â">•³˜xxg«²ØHBŸ&ñ¡sâ^&¹Z¼Çõ‹}Œ/ÉyÍ5{rp{ ƃH¡³»†’?§$6íHàQ¼foð Àñ² lfôYí´¾SÆe…Ï=‡H=Èô}¬¨ƒãØ<: µ¹™ï:Yk¥ÕT®ý*áˆI’apØuOp|X*o^ûwK­‰{ôL?Ëß±ùEz#ÉD™§é³Çò)lĺѓdW0æá(®–$|·Ñp˜lú^$µ©5ØÉÊ'í» Ø>ŒÃì`u:òàšwò¸“[o™ áÛtMœÐpíJ§è/ üI4Iè’ý(#2æ|‘vÄE†6¡àmÿûܦ\tñ ÝyÎñ"6' ak‚Áb‚¸6nþÿ!IÚžl¸&-¼Úg‡—Üf½ ÀwƒfÊl7ãn}oìy‹*}š´½G'©±k¸½]P áªÓ ë÷GÁ’ù#güfoÑÿý|ÃÕâ÷ì"MýøÞÝRtoR++œzõUÓÞ$š!hŸv}z'妡­%”—Oµ”d*˜V­‰¼ýAËígôBW$´²7~ŽõO÷Œ¼ÂùúŽž¼qÞF2‚­rm€Q¢ÊprI m^íEaD¢'ßà(¼v=퇋òøßö¼…­âXäb¹F CôÛÏçr@ ë —\GÝf\å YGÿÊ#\6³²“êx¢V‰©´êô6Òå_&?”“4¿w?×Ü–l=—ì¨2yáj·3é”}Sï«íeƒ’dÑ_d1=½ë–âûŒWÝL`Õdc„ÕÉŽÜ݇CƒœÇ<1#–аèsJü}÷Ò¬ W;¶ŒX×ô³oÑÚOy Ä/ÿY­ôž²ð†.Í€PâŒä–íŠn³Ïg¶Öž¤®(#ó¿„&¨hÛ,†ö„ÅCç3H1D0 *†H†÷  1tclient0# *†H†÷  1ÅHEF²„±eIŒ¸Å÷ÇU_Ãàp?ÔK3b=sXšã¼Gæž/fsÙ z Æbž-R1J21µ ŸçTY°¬ŸÝÙùY—«Ò&®/ê÷ÛÃPà ŸÎ¹W «×¡~‰R˜_Ðî—vgaõ]+²nSqTó-¹‡Å?ß¾¥ò þ± øÖa(…q¼?À*à®yO R'Ü‹lFìaØVPÇ1ûÅì­%Jj» È&·ñyFï÷ËÓ<€ïH;ùTDT,©FBRcâ)^’¤iÙŸ»¾ï,¯ M’ß,ßÒÎÉNrŒÄ7S'>¶‡¾ñòð~ŒD?_ц"ŒÓO¶ØBL¡3°ñq⣑Æ)ÿ»1ç^}½ë>åM·/ÃיzÓéE´càCüßÑ­ðשj¼ÆØõª,¼ÈÄÆ.¹BI4݋ͥ+­ª‘§bà.•œÛǵ»<‰þZl£©X®öpñ€ÍÀE³¡>eóŒÂÜ13lrDoú Q_R®',*üs¨ã[á+ÚcÝqà{óT›þ˱åÝ ‚É(,:ÕL–0i˜ÕXr§Ù.ãÉ= Æ/RÒlïñõñá0`.¾TŽ8:dUö4š b„Xš\n®@’2è†ôÎS)PïŸø¢åhÜ:Âo“sîa›Þ^[¿Áä´|¼êSe÷L­jËèFÚZ%—vZï.!—6"Kê…Õüêœà]óñ]N„©P×Jß¡Ø ?èò,~¯OÑuØ*Ï «ìzêI ŠDöâ!ÃP—È>ßQñ¦Î™µ0ÝÙ‡éJm[„_ç-óbu„®}Û“Žíû}€GDÌÿ¾‰ÜùÈ |©iÙúœòº`¾à¢o^ÁŽÓds@ä÷]I@hO9CÈ·S›¸(Ä€»ÞU¤WÞ3¦dªK,ŠÞ\+D¤7ÍXÈx¬… ½ÿX؉0ôßÁ%™t¯kÇúW¢G›ÿq2ÂC|¸Ý€þŸâåÀüÑÐbMÈzá·$ú’¡×œ¢¯“Îq  [{A* Ë¶Ù³á;!ÂÍœ®nÑð(Cæô;w Àî"010!0 +Ø*×[. #include #include #include #include #include #include #include #include #include typedef struct app_data_t { const char *host, *port; const char *amqp_address; const char *container_id; int message_count; pn_proactor_t *proactor; pn_rwbytes_t message_buffer; int sent; int acknowledged; } app_data_t; static int exit_code = 0; static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); pn_connection_close(pn_event_connection(e)); exit_code = 1; } } /* Create a message with a map { "sequence" : number } encode it and return the encoded buffer. */ static pn_bytes_t encode_message(app_data_t* app) { /* Construct a message with the map { "sequence": app.sent } */ pn_message_t* message = pn_message(); pn_data_t* body = pn_message_body(message); pn_data_put_int(pn_message_id(message), app->sent); /* Set the message_id also */ pn_data_put_map(body); pn_data_enter(body); pn_data_put_string(body, pn_bytes(sizeof("sequence")-1, "sequence")); pn_data_put_int(body, app->sent); /* The sequence number */ pn_data_exit(body); /* encode the message, expanding the encode buffer as needed */ if (app->message_buffer.start == NULL) { static const size_t initial_size = 128; app->message_buffer = pn_rwbytes(initial_size, (char*)malloc(initial_size)); } /* app->message_buffer is the total buffer space available. */ /* mbuf wil point at just the portion used by the encoded message */ { pn_rwbytes_t mbuf = pn_rwbytes(app->message_buffer.size, app->message_buffer.start); int status = 0; while ((status = pn_message_encode(message, mbuf.start, &mbuf.size)) == PN_OVERFLOW) { app->message_buffer.size *= 2; app->message_buffer.start = (char*)realloc(app->message_buffer.start, app->message_buffer.size); mbuf.size = app->message_buffer.size; mbuf.start = app->message_buffer.start; } if (status != 0) { fprintf(stderr, "error encoding message: %s\n", pn_error_text(pn_message_error(message))); exit(1); } pn_message_free(message); return pn_bytes(mbuf.size, mbuf.start); } } /* Returns true to continue, false if finished */ static bool handle(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t* c = pn_event_connection(event); pn_session_t* s = pn_session(pn_event_connection(event)); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_open(s); { pn_link_t* l = pn_sender(s, "my_sender"); pn_terminus_set_address(pn_link_target(l), app->amqp_address); pn_link_open(l); break; } } case PN_LINK_FLOW: { /* The peer has given us some credit, now we can send messages */ pn_link_t *sender = pn_event_link(event); while (pn_link_credit(sender) > 0 && app->sent < app->message_count) { ++app->sent; /* Use sent counter as unique delivery tag. */ pn_delivery(sender, pn_dtag((const char *)&app->sent, sizeof(app->sent))); { pn_bytes_t msgbuf = encode_message(app); pn_link_send(sender, msgbuf.start, msgbuf.size); } pn_link_advance(sender); } break; } case PN_DELIVERY: { /* We received acknowledgement from the peer that a message was delivered. */ pn_delivery_t* d = pn_event_delivery(event); if (pn_delivery_remote_state(d) == PN_ACCEPTED) { if (++app->acknowledged == app->message_count) { printf("%d messages sent and acknowledged\n", app->acknowledged); pn_connection_close(pn_event_connection(event)); /* Continue handling events till we receive TRANSPORT_CLOSED */ } } else { fprintf(stderr, "unexpected delivery state %d\n", (int)pn_delivery_remote_state(d)); pn_connection_close(pn_event_connection(event)); exit_code=1; } break; } case PN_TRANSPORT_CLOSED: check_condition(event, pn_transport_condition(pn_event_transport(event))); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; case PN_PROACTOR_INACTIVE: return false; default: break; } return true; } void run(app_data_t *app) { /* Loop and handle events */ do { pn_event_batch_t *events = pn_proactor_wait(app->proactor); pn_event_t *e; for (e = pn_event_batch_next(events); e; e = pn_event_batch_next(events)) { if (!handle(app, e)) { return; } } pn_proactor_done(app->proactor, events); } while(true); } int main(int argc, char **argv) { struct app_data_t app = {0}; char addr[PN_MAX_ADDR]; app.container_id = argv[0]; /* Should be unique */ app.host = (argc > 1) ? argv[1] : ""; app.port = (argc > 2) ? argv[2] : "amqp"; app.amqp_address = (argc > 3) ? argv[3] : "examples"; app.message_count = (argc > 4) ? atoi(argv[4]) : 10; app.proactor = pn_proactor(); pn_proactor_addr(addr, sizeof(addr), app.host, app.port); pn_proactor_connect2(app.proactor, NULL, NULL, addr); run(&app); pn_proactor_free(app.proactor); free(app.message_buffer.start); return exit_code; } qpid-proton-0.22.0/examples/c/send-ssl.c0000664000000000000000000002010213257152177014700 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include #include typedef struct app_data_t { const char *host, *port; const char *amqp_address; const char *container_id; int message_count; pn_proactor_t *proactor; pn_rwbytes_t message_buffer; int sent; int acknowledged; pn_ssl_domain_t *ssl_domain; } app_data_t; static int exit_code = 0; /* Note must be run in the current directory to find certificate files */ #define SSL_FILE(NAME) CMAKE_CURRENT_SOURCE_DIR "/ssl_certs/" NAME #define SSL_PW "tclientpw" /* Windows vs. OpenSSL certificates */ #if defined(_WIN32) # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.p12") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, SSL_FILE(NAME "-full.p12"), "", SSL_PW) #else # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.pem") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, CERTIFICATE(NAME), SSL_FILE(NAME "-private-key.pem"), SSL_PW) #endif static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); pn_connection_close(pn_event_connection(e)); exit_code = 1; } } /* Create a message with a map { "sequence" : number } encode it and return the encoded buffer. */ static pn_bytes_t encode_message(app_data_t* app) { /* Construct a message with the map { "sequence": app.sent } */ pn_message_t* message = pn_message(); pn_data_t* body = pn_message_body(message); pn_data_put_int(pn_message_id(message), app->sent); /* Set the message_id also */ pn_data_put_map(body); pn_data_enter(body); pn_data_put_string(body, pn_bytes(sizeof("sequence")-1, "sequence")); pn_data_put_int(body, app->sent); /* The sequence number */ pn_data_exit(body); /* encode the message, expanding the encode buffer as needed */ if (app->message_buffer.start == NULL) { static const size_t initial_size = 128; app->message_buffer = pn_rwbytes(initial_size, (char*)malloc(initial_size)); } /* app->message_buffer is the total buffer space available. */ /* mbuf wil point at just the portion used by the encoded message */ { pn_rwbytes_t mbuf = pn_rwbytes(app->message_buffer.size, app->message_buffer.start); int status = 0; while ((status = pn_message_encode(message, mbuf.start, &mbuf.size)) == PN_OVERFLOW) { app->message_buffer.size *= 2; app->message_buffer.start = (char*)realloc(app->message_buffer.start, app->message_buffer.size); mbuf.size = app->message_buffer.size; mbuf.start = app->message_buffer.start; } if (status != 0) { fprintf(stderr, "error encoding message: %s\n", pn_error_text(pn_message_error(message))); exit(1); } pn_message_free(message); return pn_bytes(mbuf.size, mbuf.start); } } /* Returns true to continue, false if finished */ static bool handle(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t* c = pn_event_connection(event); pn_session_t* s = pn_session(pn_event_connection(event)); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_open(s); { pn_link_t* l = pn_sender(s, "my_sender"); pn_terminus_set_address(pn_link_target(l), app->amqp_address); pn_link_open(l); break; } } case PN_CONNECTION_REMOTE_OPEN: { pn_ssl_t *ssl = pn_ssl(pn_event_transport(event)); if (ssl) { char name[1024]; pn_ssl_get_protocol_name(ssl, name, sizeof(name)); printf("secure connection: %s\n", name); fflush(stdout); } } case PN_LINK_FLOW: { /* The peer has given us some credit, now we can send messages */ pn_link_t *sender = pn_event_link(event); while (pn_link_credit(sender) > 0 && app->sent < app->message_count) { ++app->sent; /* Use sent counter as unique delivery tag. */ pn_delivery(sender, pn_dtag((const char *)&app->sent, sizeof(app->sent))); { pn_bytes_t msgbuf = encode_message(app); pn_link_send(sender, msgbuf.start, msgbuf.size); } pn_link_advance(sender); } break; } case PN_DELIVERY: { /* We received acknowledgement from the peer that a message was delivered. */ pn_delivery_t* d = pn_event_delivery(event); if (pn_delivery_remote_state(d) == PN_ACCEPTED) { if (++app->acknowledged == app->message_count) { printf("%d messages sent and acknowledged\n", app->acknowledged); fflush(stdout); pn_connection_close(pn_event_connection(event)); /* Continue handling events till we receive TRANSPORT_CLOSED */ } } else { fprintf(stderr, "unexpected delivery state %d\n", (int)pn_delivery_remote_state(d)); pn_connection_close(pn_event_connection(event)); exit_code=1; } break; } case PN_TRANSPORT_CLOSED: check_condition(event, pn_transport_condition(pn_event_transport(event))); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; case PN_PROACTOR_INACTIVE: return false; default: break; } return true; } void run(app_data_t *app) { /* Loop and handle events */ do { pn_event_batch_t *events = pn_proactor_wait(app->proactor); pn_event_t *e; for (e = pn_event_batch_next(events); e; e = pn_event_batch_next(events)) { if (!handle(app, e)) { return; } } pn_proactor_done(app->proactor, events); } while(true); } int main(int argc, char **argv) { struct app_data_t app = {0}; char addr[PN_MAX_ADDR]; pn_transport_t *t = NULL; int err; app.container_id = argv[0]; /* Should be unique */ app.host = (argc > 1) ? argv[1] : ""; app.port = (argc > 2) ? argv[2] : "amqp"; app.amqp_address = (argc > 3) ? argv[3] : "examples"; app.message_count = (argc > 4) ? atoi(argv[4]) : 10; app.ssl_domain = pn_ssl_domain(PN_SSL_MODE_CLIENT); app.proactor = pn_proactor(); pn_proactor_addr(addr, sizeof(addr), app.host, app.port); /* Configure a transport for SSL. The transport will be freed by the proactor. */ t = pn_transport(); err = pn_ssl_init(pn_ssl(t), app.ssl_domain, NULL); if (err) { fprintf(stderr, "error initializing SSL: %s\n", pn_code(err)); return 1; } pn_proactor_connect2(app.proactor, NULL, t, addr); run(&app); pn_ssl_domain_free(app.ssl_domain); pn_proactor_free(app.proactor); free(app.message_buffer.start); return exit_code; } qpid-proton-0.22.0/examples/c/send-abort.c0000664000000000000000000001663213257152177015223 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include /* * Send aborted messages. * * An 80 Kbyte (MSG_SIZE) message is generated. * The size is chosen to be large enough so that some of the message * will go out on the wire before the abort is sent. * * 79 Kbytes (MSG_SIZE - HOLDBACK) are sent on one link flow event. * The message is aborted on the next link flow event. */ #define MSG_SIZE 80000 #define HOLDBACK 1000 #if MSG_SIZE <= HOLDBACK #error "MSG_SIZE must be greater than HOLDBACK" #endif typedef struct app_data_t { const char *host, *port; const char *amqp_address; const char *container_id; int message_count; pn_proactor_t *proactor; pn_rwbytes_t message_buffer; int sent; int aborted; bool in_progress; } app_data_t; static int exit_code = 0; static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); pn_connection_close(pn_event_connection(e)); exit_code = 1; } } /* Create a message with a map { "sequence" : number } encode it and return the encoded buffer. */ static pn_bytes_t encode_message(app_data_t* app) { /* Construct a message with the map { "sequence": app.sent } */ pn_message_t* message = pn_message(); char data[MSG_SIZE + 11] = {0}; pn_data_t* body; pn_data_put_int(pn_message_id(message), app->sent); /* Set the message_id also */ body = pn_message_body(message); pn_data_enter(body); pn_data_put_string(body, pn_bytes(MSG_SIZE, data)); pn_data_exit(body); /* encode the message, expanding the encode buffer as needed */ if (app->message_buffer.start == NULL) { static const size_t initial_size = MSG_SIZE + 1000; app->message_buffer = pn_rwbytes(initial_size, (char*)malloc(initial_size)); } /* app->message_buffer is the total buffer space available. */ /* mbuf wil point at just the portion used by the encoded message */ { pn_rwbytes_t mbuf = pn_rwbytes(app->message_buffer.size, app->message_buffer.start); int status = 0; while ((status = pn_message_encode(message, mbuf.start, &mbuf.size)) == PN_OVERFLOW) { app->message_buffer.size *= 2; app->message_buffer.start = (char*)realloc(app->message_buffer.start, app->message_buffer.size); mbuf.size = app->message_buffer.size; } if (status != 0) { fprintf(stderr, "error encoding message: %s\n", pn_error_text(pn_message_error(message))); exit(1); } pn_message_free(message); return pn_bytes(mbuf.size, mbuf.start); } } /* Returns true to continue, false if finished */ static bool handle(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t* c = pn_event_connection(event); pn_session_t* s = pn_session(pn_event_connection(event)); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_open(s); { pn_link_t* l = pn_sender(s, "my_sender"); pn_terminus_set_address(pn_link_target(l), app->amqp_address); pn_link_open(l); break; } } case PN_LINK_FLOW: { /* The peer has given us some credit, now we can send messages */ pn_link_t *sender = pn_event_link(event); while (app->in_progress || (pn_link_credit(sender) > 0 && app->sent < app->message_count)) { if (!app->in_progress) { pn_bytes_t msgbuf = encode_message(app); /* Use sent counter as unique delivery tag. */ pn_delivery(sender, pn_dtag((const char *)&app->sent, sizeof(app->sent))); pn_link_send(sender, msgbuf.start, msgbuf.size - HOLDBACK); /* Send some part of message */ app->in_progress = true; /* Return from this link flow event and abort the message on next, */ break; } else { pn_delivery_t * pnd = pn_link_current(sender); pn_delivery_abort(pnd); /* aborted delivery is presettled and never ack'd. */ if (++app->aborted == app->message_count) { printf("%d messages started and aborted\n", app->aborted); pn_connection_close(pn_event_connection(event)); /* Continue handling events till we receive TRANSPORT_CLOSED */ } ++app->sent; app->in_progress = false; } } break; } case PN_DELIVERY: { /* We received acknowledgement from the peer that a message was delivered. */ pn_delivery_t* d = pn_event_delivery(event); fprintf(stderr, "Aborted deliveries should not receive delivery events. Delivery state %d\n", (int)pn_delivery_remote_state(d)); pn_connection_close(pn_event_connection(event)); exit_code=1; break; } case PN_TRANSPORT_CLOSED: check_condition(event, pn_transport_condition(pn_event_transport(event))); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; case PN_PROACTOR_INACTIVE: return false; default: break; } return true; } void run(app_data_t *app) { /* Loop and handle events */ do { pn_event_batch_t *events = pn_proactor_wait(app->proactor); pn_event_t* e; for (e = pn_event_batch_next(events); e; e = pn_event_batch_next(events)) { if (!handle(app, e)) { return; } } pn_proactor_done(app->proactor, events); } while(true); } int main(int argc, char **argv) { struct app_data_t app = {0}; char addr[PN_MAX_ADDR]; app.container_id = argv[0]; /* Should be unique */ app.host = (argc > 1) ? argv[1] : ""; app.port = (argc > 2) ? argv[2] : "amqp"; app.amqp_address = (argc > 3) ? argv[3] : "examples"; app.message_count = (argc > 4) ? atoi(argv[4]) : 10; app.proactor = pn_proactor(); pn_proactor_addr(addr, sizeof(addr), app.host, app.port); pn_proactor_connect2(app.proactor, NULL, NULL, addr); run(&app); pn_proactor_free(app.proactor); free(app.message_buffer.start); return exit_code; } qpid-proton-0.22.0/examples/c/receive.c0000664000000000000000000001503613257152177014604 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include typedef struct app_data_t { const char *host, *port; const char *amqp_address; const char *container_id; int message_count; pn_proactor_t *proactor; int received; bool finished; pn_rwbytes_t msgin; /* Partially received message */ } app_data_t; static const int BATCH = 1000; /* Batch size for unlimited receive */ static int exit_code = 0; static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); pn_connection_close(pn_event_connection(e)); exit_code = 1; } } static void decode_message(pn_rwbytes_t data) { pn_message_t *m = pn_message(); int err = pn_message_decode(m, data.start, data.size); if (!err) { /* Print the decoded message */ pn_string_t *s = pn_string(NULL); pn_inspect(pn_message_body(m), s); printf("%s\n", pn_string_get(s)); pn_free(s); pn_message_free(m); free(data.start); } else { fprintf(stderr, "decode_message: %s\n", pn_code(err)); exit_code = 1; } } /* Return true to continue, false to exit */ static bool handle(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_CONNECTION_INIT: { pn_connection_t* c = pn_event_connection(event); pn_session_t* s = pn_session(c); pn_connection_set_container(c, app->container_id); pn_connection_open(c); pn_session_open(s); { pn_link_t* l = pn_receiver(s, "my_receiver"); pn_terminus_set_address(pn_link_source(l), app->amqp_address); pn_link_open(l); /* cannot receive without granting credit: */ pn_link_flow(l, app->message_count ? app->message_count : BATCH); } } break; case PN_DELIVERY: { /* A message has been received */ pn_delivery_t *d = pn_event_delivery(event); if (pn_delivery_readable(d)) { pn_link_t *l = pn_delivery_link(d); size_t size = pn_delivery_pending(d); pn_rwbytes_t* m = &app->msgin; /* Append data to incoming message buffer */ int recv; size_t oldsize = m->size; m->size += size; m->start = (char*)realloc(m->start, m->size); recv = pn_link_recv(l, m->start + oldsize, m->size); if (recv == PN_ABORTED) { fprintf(stderr, "Message aborted\n"); m->size = 0; /* Forget the data we accumulated */ pn_delivery_settle(d); /* Free the delivery so we can receive the next message */ pn_link_flow(l, 1); /* Replace credit for aborted message */ } else if (recv < 0 && recv != PN_EOS) { /* Unexpected error */ pn_condition_format(pn_link_condition(l), "broker", "PN_DELIVERY error: %s", pn_code(recv)); pn_link_close(l); /* Unexpected error, close the link */ } else if (!pn_delivery_partial(d)) { /* Message is complete */ decode_message(*m); *m = pn_rwbytes_null; /* Reset the buffer for the next message*/ /* Accept the delivery */ pn_delivery_update(d, PN_ACCEPTED); pn_delivery_settle(d); /* settle and free d */ if (app->message_count == 0) { /* receive forever - see if more credit is needed */ if (pn_link_credit(l) < BATCH/2) { /* Grant enough credit to bring it up to BATCH: */ pn_link_flow(l, BATCH - pn_link_credit(l)); } } else if (++app->received >= app->message_count) { pn_session_t *ssn = pn_link_session(l); printf("%d messages received\n", app->received); pn_link_close(l); pn_session_close(ssn); pn_connection_close(pn_session_connection(ssn)); } } } break; } case PN_TRANSPORT_CLOSED: check_condition(event, pn_transport_condition(pn_event_transport(event))); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event))); pn_connection_close(pn_event_connection(event)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event))); pn_connection_close(pn_event_connection(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event))); pn_connection_close(pn_event_connection(event)); break; case PN_PROACTOR_INACTIVE: return false; break; default: break; } return true; } void run(app_data_t *app) { /* Loop and handle events */ do { pn_event_batch_t *events = pn_proactor_wait(app->proactor); pn_event_t *e; for (e = pn_event_batch_next(events); e; e = pn_event_batch_next(events)) { if (!handle(app, e) || exit_code != 0) { return; } } pn_proactor_done(app->proactor, events); } while(true); } int main(int argc, char **argv) { struct app_data_t app = {0}; char addr[PN_MAX_ADDR]; app.container_id = argv[0]; /* Should be unique */ app.host = (argc > 1) ? argv[1] : ""; app.port = (argc > 2) ? argv[2] : "amqp"; app.amqp_address = (argc > 3) ? argv[3] : "examples"; app.message_count = (argc > 4) ? atoi(argv[4]) : 10; /* Create the proactor and connect */ app.proactor = pn_proactor(); pn_proactor_addr(addr, sizeof(addr), app.host, app.port); pn_proactor_connect2(app.proactor, NULL, NULL, addr); run(&app); pn_proactor_free(app.proactor); return exit_code; } qpid-proton-0.22.0/examples/c/example_test.py0000664000000000000000000001207113257152177016056 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License # # This is a test script to run the examples and verify that they behave as expected. import unittest, sys, time from proctest import * def python_cmd(name): dir = os.path.dirname(__file__) return [sys.executable, os.path.join(dir, "..", "..", "python", name)] MESSAGES=10 def receive_expect_messages(n=MESSAGES): return ''.join(['{"sequence"=%s}\n'%i for i in range(1, n+1)]) def receive_expect_total(n=MESSAGES): return "%s messages received\n"%n def receive_expect(n=MESSAGES): return receive_expect_messages(n)+receive_expect_total(n) def send_expect(n=MESSAGES): return "%s messages sent and acknowledged\n" % n def send_abort_expect(n=MESSAGES): return "%s messages started and aborted\n" % n def wait_listening(proc): m = proc.wait_re("listening on ([0-9]+)$") return m.group(1), m.group(0)+"\n" # Return (port, line) class Broker(object): def __init__(self, test): self.test = test def __enter__(self): self.proc = self.test.proc(["broker", "", "0"]) self.port, _ = wait_listening(self.proc) return self def __exit__(self, *args): b = getattr(self, "proc") if b: if b.poll() != None: # Broker crashed raise ProcError(b, "broker crash") b.kill() class CExampleTest(ProcTestCase): def runex(self, name, port, messages=MESSAGES): """Run an example with standard arguments, return output""" return self.proc([name, "", str(port), "xtest", str(messages)]).wait_exit() def test_send_receive(self): """Send first then receive""" with Broker(self) as b: self.assertEqual(send_expect(), self.runex("send", b.port)) self.assertMultiLineEqual(receive_expect(), self.runex("receive", b.port)) def test_receive_send(self): """Start receiving first, then send.""" with Broker(self) as b: self.assertEqual(send_expect(), self.runex("send", b.port)) self.assertMultiLineEqual(receive_expect(), self.runex("receive", b.port)) def test_send_direct(self): """Send to direct server""" d = self.proc(["direct", "", "0"]) port, line = wait_listening(d) self.assertEqual(send_expect(), self.runex("send", port)) self.assertMultiLineEqual(line+receive_expect(), d.wait_exit()) def test_receive_direct(self): """Receive from direct server""" d = self.proc(["direct", "", "0"]) port, line = wait_listening(d) self.assertMultiLineEqual(receive_expect(), self.runex("receive", port)) self.assertEqual(line+"10 messages sent and acknowledged\n", d.wait_exit()) def test_send_abort_broker(self): """Sending aborted messages to a broker""" with Broker(self) as b: self.assertEqual(send_expect(), self.runex("send", b.port)) self.assertEqual(send_abort_expect(), self.runex("send-abort", b.port)) b.proc.wait_re("Message aborted\n"*MESSAGES) self.assertEqual(send_expect(), self.runex("send", b.port)) expect = receive_expect_messages(MESSAGES)+receive_expect_messages(MESSAGES)+receive_expect_total(20) self.assertMultiLineEqual(expect, self.runex("receive", b.port, "20")) def test_send_abort_direct(self): """Send aborted messages to the direct server""" d = self.proc(["direct", "", "0", "examples", "20"]) port, line = wait_listening(d) expect = line self.assertEqual(send_expect(), self.runex("send", port)) expect += receive_expect_messages() d.wait_re(expect) self.assertEqual(send_abort_expect(), self.runex("send-abort", port)) expect += "Message aborted\n"*MESSAGES d.wait_re(expect) self.assertEqual(send_expect(), self.runex("send", port)) expect += receive_expect_messages()+receive_expect_total(20) self.maxDiff = None self.assertMultiLineEqual(expect, d.wait_exit()) def test_send_ssl_receive(self): """Send first then receive""" with Broker(self) as b: got = self.runex("send-ssl", b.port) self.assertIn("secure connection:", got) self.assertIn(send_expect(), got) self.assertMultiLineEqual(receive_expect(), self.runex("receive", b.port)) if __name__ == "__main__": unittest.main() qpid-proton-0.22.0/examples/c/direct.c0000664000000000000000000002632513257152177014437 0ustar /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct app_data_t { const char *host, *port; const char *amqp_address; const char *container_id; int message_count; pn_proactor_t *proactor; pn_listener_t *listener; pn_rwbytes_t msgin, msgout; /* Buffers for incoming/outgoing messages */ /* Sender values */ int sent; int acknowledged; pn_link_t *sender; /* Receiver values */ int received; } app_data_t; static const int BATCH = 1000; /* Batch size for unlimited receive */ static int exit_code = 0; /* Close the connection and the listener so so we will get a * PN_PROACTOR_INACTIVE event and exit, once all outstanding events * are processed. */ static void close_all(pn_connection_t *c, app_data_t *app) { if (c) pn_connection_close(c); if (app->listener) pn_listener_close(app->listener); } static void check_condition(pn_event_t *e, pn_condition_t *cond, app_data_t *app) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); close_all(pn_event_connection(e), app); exit_code = 1; } } /* Create a message with a map { "sequence" : number } encode it and return the encoded buffer. */ static pn_bytes_t encode_message(app_data_t* app) { /* Construct a message with the map { "sequence": app.sent } */ pn_message_t* message = pn_message(); pn_data_t* body = pn_message_body(message); pn_data_put_int(pn_message_id(message), app->sent); /* Set the message_id also */ pn_data_put_map(body); pn_data_enter(body); pn_data_put_string(body, pn_bytes(sizeof("sequence")-1, "sequence")); pn_data_put_int(body, app->sent); /* The sequence number */ pn_data_exit(body); /* encode the message, expanding the encode buffer as needed */ if (app->msgout.start == NULL) { static const size_t initial_size = 128; app->msgout = pn_rwbytes(initial_size, (char*)malloc(initial_size)); } /* app->msgout is the total buffer space available. */ /* mbuf wil point at just the portion used by the encoded message */ { pn_rwbytes_t mbuf = pn_rwbytes(app->msgout.size, app->msgout.start); int status = 0; while ((status = pn_message_encode(message, mbuf.start, &mbuf.size)) == PN_OVERFLOW) { app->msgout.size *= 2; app->msgout.start = (char*)realloc(app->msgout.start, app->msgout.size); mbuf.size = app->msgout.size; } if (status != 0) { fprintf(stderr, "error encoding message: %s\n", pn_error_text(pn_message_error(message))); exit(1); } pn_message_free(message); return pn_bytes(mbuf.size, mbuf.start); } } static void decode_message(pn_rwbytes_t data) { pn_message_t *m = pn_message(); int err = pn_message_decode(m, data.start, data.size); if (!err) { /* Print the decoded message */ pn_string_t *s = pn_string(NULL); pn_inspect(pn_message_body(m), s); printf("%s\n", pn_string_get(s)); fflush(stdout); pn_free(s); pn_message_free(m); free(data.start); } else { fprintf(stderr, "decode_message: %s\n", pn_code(err)); exit_code = 1; } } /* This function handles events when we are acting as the receiver */ static void handle_receive(app_data_t *app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_LINK_REMOTE_OPEN: { pn_link_t *l = pn_event_link(event); pn_link_open(l); pn_link_flow(l, app->message_count ? app->message_count : BATCH); } break; case PN_DELIVERY: { /* Incoming message data */ pn_delivery_t *d = pn_event_delivery(event); if (pn_delivery_readable(d)) { pn_link_t *l = pn_delivery_link(d); size_t size = pn_delivery_pending(d); pn_rwbytes_t* m = &app->msgin; /* Append data to incoming message buffer */ ssize_t recv; m->size += size; m->start = (char*)realloc(m->start, m->size); recv = pn_link_recv(l, m->start, m->size); if (recv == PN_ABORTED) { fprintf(stderr, "Message aborted\n"); fflush(stderr); m->size = 0; /* Forget the data we accumulated */ pn_delivery_settle(d); /* Free the delivery so we can receive the next message */ pn_link_flow(l, 1); /* Replace credit for aborted message */ } else if (recv < 0 && recv != PN_EOS) { /* Unexpected error */ pn_condition_format(pn_link_condition(l), "broker", "PN_DELIVERY error: %s", pn_code(recv)); pn_link_close(l); /* Unexpected error, close the link */ } else if (!pn_delivery_partial(d)) { /* Message is complete */ decode_message(*m); *m = pn_rwbytes_null; pn_delivery_update(d, PN_ACCEPTED); pn_delivery_settle(d); /* settle and free d */ if (app->message_count == 0) { /* receive forever - see if more credit is needed */ if (pn_link_credit(l) < BATCH/2) { pn_link_flow(l, BATCH - pn_link_credit(l)); } } else if (++app->received >= app->message_count) { printf("%d messages received\n", app->received); close_all(pn_event_connection(event), app); } } } break; } default: break; } } /* This function handles events when we are acting as the sender */ static void handle_send(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_LINK_REMOTE_OPEN: { pn_link_t* l = pn_event_link(event); pn_terminus_set_address(pn_link_target(l), app->amqp_address); pn_link_open(l); } break; case PN_LINK_FLOW: { /* The peer has given us some credit, now we can send messages */ pn_link_t *sender = pn_event_link(event); while (pn_link_credit(sender) > 0 && app->sent < app->message_count) { ++app->sent; /* Use sent counter as unique delivery tag. */ pn_delivery(sender, pn_dtag((const char *)&app->sent, sizeof(app->sent))); { pn_bytes_t msgbuf = encode_message(app); pn_link_send(sender, msgbuf.start, msgbuf.size); pn_link_advance(sender); } } break; } case PN_DELIVERY: { /* We received acknowledgement from the peer that a message was delivered. */ pn_delivery_t* d = pn_event_delivery(event); if (pn_delivery_remote_state(d) == PN_ACCEPTED) { if (++app->acknowledged == app->message_count) { printf("%d messages sent and acknowledged\n", app->acknowledged); close_all(pn_event_connection(event), app); } } } break; default: break; } } /* Handle all events, delegate to handle_send or handle_receive depending on link mode. Return true to continue, false to exit */ static bool handle(app_data_t* app, pn_event_t* event) { switch (pn_event_type(event)) { case PN_LISTENER_OPEN: { char port[256]; /* Get the listening port */ pn_netaddr_host_port(pn_listener_addr(pn_event_listener(event)), NULL, 0, port, sizeof(port)); printf("listening on %s\n", port); fflush(stdout); break; } case PN_LISTENER_ACCEPT: pn_listener_accept2(pn_event_listener(event), NULL, NULL); break; case PN_CONNECTION_INIT: pn_connection_set_container(pn_event_connection(event), app->container_id); break; case PN_CONNECTION_BOUND: { /* Turn off security */ pn_transport_t *t = pn_event_transport(event); pn_transport_require_auth(t, false); pn_sasl_allowed_mechs(pn_sasl(t), "ANONYMOUS"); break; } case PN_CONNECTION_REMOTE_OPEN: { pn_connection_open(pn_event_connection(event)); /* Complete the open */ break; } case PN_SESSION_REMOTE_OPEN: { pn_session_open(pn_event_session(event)); break; } case PN_TRANSPORT_CLOSED: check_condition(event, pn_transport_condition(pn_event_transport(event)), app); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(event, pn_connection_remote_condition(pn_event_connection(event)), app); pn_connection_close(pn_event_connection(event)); /* Return the close */ break; case PN_SESSION_REMOTE_CLOSE: check_condition(event, pn_session_remote_condition(pn_event_session(event)), app); pn_session_close(pn_event_session(event)); /* Return the close */ pn_session_free(pn_event_session(event)); break; case PN_LINK_REMOTE_CLOSE: case PN_LINK_REMOTE_DETACH: check_condition(event, pn_link_remote_condition(pn_event_link(event)), app); pn_link_close(pn_event_link(event)); /* Return the close */ pn_link_free(pn_event_link(event)); break; case PN_PROACTOR_TIMEOUT: /* Wake the sender's connection */ pn_connection_wake(pn_session_connection(pn_link_session(app->sender))); break; case PN_LISTENER_CLOSE: app->listener = NULL; /* Listener is closed */ check_condition(event, pn_listener_condition(pn_event_listener(event)), app); break; case PN_PROACTOR_INACTIVE: return false; break; default: { pn_link_t *l = pn_event_link(event); if (l) { /* Only delegate link-related events */ if (pn_link_is_sender(l)) { handle_send(app, event); } else { handle_receive(app, event); } } } } return true; } void run(app_data_t *app) { /* Loop and handle events */ do { pn_event_batch_t *events = pn_proactor_wait(app->proactor); pn_event_t *e; for (e = pn_event_batch_next(events); e; e = pn_event_batch_next(events)) { if (!handle(app, e)) { return; } } pn_proactor_done(app->proactor, events); } while(true); } int main(int argc, char **argv) { struct app_data_t app = {0}; char addr[PN_MAX_ADDR]; app.container_id = argv[0]; /* Should be unique */ app.host = (argc > 1) ? argv[1] : ""; app.port = (argc > 2) ? argv[2] : "amqp"; app.amqp_address = (argc > 3) ? argv[3] : "examples"; app.message_count = (argc > 4) ? atoi(argv[4]) : 10; /* Create the proactor and connect */ app.proactor = pn_proactor(); app.listener = pn_listener(); pn_proactor_addr(addr, sizeof(addr), app.host, app.port); pn_proactor_listen(app.proactor, app.listener, addr, 16); run(&app); pn_proactor_free(app.proactor); free(app.msgout.start); free(app.msgin.start); return exit_code; } qpid-proton-0.22.0/examples/c/broker.c0000664000000000000000000003654613257152177014457 0ustar /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "thread.h" #include #include #include #include #include #include #include #include #include #include /* The ssl_certs subdir must be in the current directory for an ssl-enabled broker */ #define SSL_FILE(NAME) "ssl_certs/" NAME #define SSL_PW "tserverpw" /* Windows vs. OpenSSL certificates */ #if defined(_WIN32) # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.p12") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, SSL_FILE(NAME "-full.p12"), "", SSL_PW) #else # define CERTIFICATE(NAME) SSL_FILE(NAME "-certificate.pem") # define SET_CREDENTIALS(DOMAIN, NAME) \ pn_ssl_domain_set_credentials(DOMAIN, CERTIFICATE(NAME), SSL_FILE(NAME "-private-key.pem"), SSL_PW) #endif /* Simple re-sizable vector that acts as a queue */ #define VEC(T) struct { T* data; size_t len, cap; } #define VEC_INIT(V) \ do { \ void **vp = (void**)&V.data; \ V.len = 0; \ V.cap = 16; \ *vp = malloc(V.cap * sizeof(*V.data)); \ } while(0) #define VEC_FINAL(V) free(V.data) #define VEC_PUSH(V, X) \ do { \ if (V.len == V.cap) { \ void **vp = (void**)&V.data; \ V.cap *= 2; \ *vp = realloc(V.data, V.cap * sizeof(*V.data)); \ } \ V.data[V.len++] = X; \ } while(0) \ #define VEC_POP(V) \ do { \ if (V.len > 0) \ memmove(V.data, V.data+1, (--V.len)*sizeof(*V.data)); \ } while(0) /* Simple thread-safe queue implementation */ typedef struct queue_t { pthread_mutex_t lock; char *name; VEC(pn_rwbytes_t) messages; /* Messages on the queue_t */ VEC(pn_connection_t*) waiting; /* Connections waiting to send messages from this queue */ struct queue_t *next; /* Next queue in chain */ size_t sent; /* Count of messages sent, used as delivery tag */ } queue_t; static void queue_init(queue_t *q, const char* name, queue_t *next) { pthread_mutex_init(&q->lock, NULL); q->name = (char*)malloc(strlen(name)+1); memcpy(q->name, name, strlen(name)+1); VEC_INIT(q->messages); VEC_INIT(q->waiting); q->next = next; q->sent = 0; } static void queue_destroy(queue_t *q) { size_t i; pthread_mutex_destroy(&q->lock); for (i = 0; i < q->messages.len; ++i) free(q->messages.data[i].start); VEC_FINAL(q->messages); for (i = 0; i < q->waiting.len; ++i) pn_decref(q->waiting.data[i]); VEC_FINAL(q->waiting); free(q->name); } /* Send a message on s, or record s as waiting if there are no messages to send. Called in s dispatch loop, assumes s has credit. */ static void queue_send(queue_t *q, pn_link_t *s) { pn_rwbytes_t m = { 0 }; size_t tag = 0; pthread_mutex_lock(&q->lock); if (q->messages.len == 0) { /* Empty, record connection as waiting */ /* Record connection for wake-up if not already on the list. */ pn_connection_t *c = pn_session_connection(pn_link_session(s)); size_t i = 0; for (; i < q->waiting.len && q->waiting.data[i] != c; ++i) ; if (i == q->waiting.len) { VEC_PUSH(q->waiting, c); } } else { m = q->messages.data[0]; VEC_POP(q->messages); tag = ++q->sent; } pthread_mutex_unlock(&q->lock); if (m.start) { pn_delivery_t *d = pn_delivery(s, pn_dtag((char*)&tag, sizeof(tag))); pn_link_send(s, m.start, m.size); pn_link_advance(s); pn_delivery_settle(d); /* Pre-settled: unreliable, there will be no ack/ */ free(m.start); } } /* Use the connection context pointer as a boolean flag to indicate we need to check queues */ void set_check_queues(pn_connection_t *c, bool check) { pn_connection_set_context(c, (void*)check); } bool get_check_queues(pn_connection_t *c) { return (bool)pn_connection_get_context(c); } /* Use a buffer per link to accumulate message data - message can arrive in multiple deliveries, and the broker can receive messages on many concurrently. */ pn_rwbytes_t *message_buffer(pn_link_t *l) { if (!pn_link_get_context(l)) { pn_link_set_context(l, calloc(1, sizeof(pn_rwbytes_t))); } return (pn_rwbytes_t*)pn_link_get_context(l); } /* Put a message on the queue, called in receiver dispatch loop. If the queue was previously empty, notify waiting senders. */ static void queue_receive(pn_proactor_t *d, queue_t *q, pn_rwbytes_t m) { pthread_mutex_lock(&q->lock); VEC_PUSH(q->messages, m); if (q->messages.len == 1) { /* Was empty, notify waiting connections */ size_t i; for (i = 0; i < q->waiting.len; ++i) { pn_connection_t *c = q->waiting.data[i]; set_check_queues(c, true); pn_connection_wake(c); /* Wake the connection */ } q->waiting.len = 0; } pthread_mutex_unlock(&q->lock); } /* Thread safe set of queues */ typedef struct queues_t { pthread_mutex_t lock; queue_t *queues; size_t sent; } queues_t; void queues_init(queues_t *qs) { pthread_mutex_init(&qs->lock, NULL); qs->queues = NULL; } void queues_destroy(queues_t *qs) { while (qs->queues) { queue_t *q = qs->queues; qs->queues = qs->queues->next; queue_destroy(q); free(q); } pthread_mutex_destroy(&qs->lock); } /** Get or create the named queue. */ queue_t* queues_get(queues_t *qs, const char* name) { queue_t *q; pthread_mutex_lock(&qs->lock); for (q = qs->queues; q && strcmp(q->name, name) != 0; q = q->next) ; if (!q) { q = (queue_t*)malloc(sizeof(queue_t)); queue_init(q, name, qs->queues); qs->queues = q; } pthread_mutex_unlock(&qs->lock); return q; } /* The broker implementation */ typedef struct broker_t { pn_proactor_t *proactor; size_t threads; const char *container_id; /* AMQP container-id */ queues_t queues; bool finished; pn_ssl_domain_t *ssl_domain; } broker_t; void broker_stop(broker_t *b) { /* Interrupt the proactor to stop the working threads. */ pn_proactor_interrupt(b->proactor); } /* Try to send if link is sender and has credit */ static void link_send(broker_t *b, pn_link_t *s) { if (pn_link_is_sender(s) && pn_link_credit(s) > 0) { const char *qname = pn_terminus_get_address(pn_link_source(s)); queue_t *q = queues_get(&b->queues, qname); queue_send(q, s); } } static void queue_unsub(queue_t *q, pn_connection_t *c) { size_t i; pthread_mutex_lock(&q->lock); for (i = 0; i < q->waiting.len; ++i) { if (q->waiting.data[i] == c){ q->waiting.data[i] = q->waiting.data[0]; /* save old [0] */ VEC_POP(q->waiting); break; } } pthread_mutex_unlock(&q->lock); } /* Unsubscribe from the queue of interest to this link. */ static void link_unsub(broker_t *b, pn_link_t *s) { if (pn_link_is_sender(s)) { const char *qname = pn_terminus_get_address(pn_link_source(s)); if (qname) { queue_t *q = queues_get(&b->queues, qname); queue_unsub(q, pn_session_connection(pn_link_session(s))); } } } /* Called in connection's event loop when a connection is woken for messages.*/ static void connection_unsub(broker_t *b, pn_connection_t *c) { pn_link_t *l; for (l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0)) link_unsub(b, l); } static void session_unsub(broker_t *b, pn_session_t *ssn) { pn_connection_t *c = pn_session_connection(ssn); pn_link_t *l; for (l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0)) { if (pn_link_session(l) == ssn) link_unsub(b, l); } } static void check_condition(pn_event_t *e, pn_condition_t *cond) { if (pn_condition_is_set(cond)) { fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)), pn_condition_get_name(cond), pn_condition_get_description(cond)); } } const int WINDOW=5; /* Very small incoming credit window, to show flow control in action */ static void handle(broker_t* b, pn_event_t* e) { pn_connection_t *c = pn_event_connection(e); switch (pn_event_type(e)) { case PN_LISTENER_OPEN: { char port[256]; /* Get the listening port */ pn_netaddr_host_port(pn_listener_addr(pn_event_listener(e)), NULL, 0, port, sizeof(port)); printf("listening on %s\n", port); fflush(stdout); break; } case PN_LISTENER_ACCEPT: { /* Configure a transport to allow SSL and SASL connections. See ssl_domain setup in main() */ pn_transport_t *t = pn_transport(); pn_transport_require_auth(t, false); pn_sasl_allowed_mechs(pn_sasl(t), "ANONYMOUS"); if (b->ssl_domain) { pn_ssl_init(pn_ssl(t), b->ssl_domain, NULL); } pn_listener_accept2(pn_event_listener(e), NULL, t); break; } case PN_CONNECTION_INIT: pn_connection_set_container(c, b->container_id); break; case PN_CONNECTION_REMOTE_OPEN: { pn_connection_open(pn_event_connection(e)); /* Complete the open */ break; } case PN_CONNECTION_WAKE: { if (get_check_queues(c)) { int flags = PN_LOCAL_ACTIVE&PN_REMOTE_ACTIVE; pn_link_t *l; set_check_queues(c, false); for (l = pn_link_head(c, flags); l != NULL; l = pn_link_next(l, flags)) link_send(b, l); } break; } case PN_SESSION_REMOTE_OPEN: { pn_session_open(pn_event_session(e)); break; } case PN_LINK_REMOTE_OPEN: { pn_link_t *l = pn_event_link(e); if (pn_link_is_sender(l)) { const char *source = pn_terminus_get_address(pn_link_remote_source(l)); pn_terminus_set_address(pn_link_source(l), source); } else { const char* target = pn_terminus_get_address(pn_link_remote_target(l)); pn_terminus_set_address(pn_link_target(l), target); pn_link_flow(l, WINDOW); } pn_link_open(l); break; } case PN_LINK_FLOW: { link_send(b, pn_event_link(e)); break; } case PN_LINK_FINAL: { pn_rwbytes_t *buf = (pn_rwbytes_t*)pn_link_get_context(pn_event_link(e)); if (buf) { free(buf->start); free(buf); } break; } case PN_DELIVERY: { /* Incoming message data */ pn_delivery_t *d = pn_event_delivery(e); if (pn_delivery_readable(d)) { pn_link_t *l = pn_delivery_link(d); size_t size = pn_delivery_pending(d); pn_rwbytes_t* m = message_buffer(l); /* Append data to incoming message buffer */ ssize_t recv; m->size += size; m->start = (char*)realloc(m->start, m->size); recv = pn_link_recv(l, m->start, m->size); if (recv == PN_ABORTED) { /* */ fprintf(stderr, "Message aborted\n"); fflush(stderr); m->size = 0; /* Forget the data we accumulated */ pn_delivery_settle(d); /* Free the delivery so we can receive the next message */ pn_link_flow(l, WINDOW - pn_link_credit(l)); /* Replace credit for the aborted message */ } else if (recv < 0 && recv != PN_EOS) { /* Unexpected error */ pn_condition_format(pn_link_condition(l), "broker", "PN_DELIVERY error: %s", pn_code((int)recv)); pn_link_close(l); /* Unexpected error, close the link */ } else if (!pn_delivery_partial(d)) { /* Message is complete */ const char *qname = pn_terminus_get_address(pn_link_target(l)); queue_receive(b->proactor, queues_get(&b->queues, qname), *m); *m = pn_rwbytes_null; /* Reset the buffer for the next message*/ pn_delivery_update(d, PN_ACCEPTED); pn_delivery_settle(d); pn_link_flow(l, WINDOW - pn_link_credit(l)); } } break; } case PN_TRANSPORT_CLOSED: check_condition(e, pn_transport_condition(pn_event_transport(e))); connection_unsub(b, pn_event_connection(e)); break; case PN_CONNECTION_REMOTE_CLOSE: check_condition(e, pn_connection_remote_condition(pn_event_connection(e))); pn_connection_close(pn_event_connection(e)); break; case PN_SESSION_REMOTE_CLOSE: check_condition(e, pn_session_remote_condition(pn_event_session(e))); session_unsub(b, pn_event_session(e)); pn_session_close(pn_event_session(e)); pn_session_free(pn_event_session(e)); break; case PN_LINK_REMOTE_CLOSE: check_condition(e, pn_link_remote_condition(pn_event_link(e))); link_unsub(b, pn_event_link(e)); pn_link_close(pn_event_link(e)); pn_link_free(pn_event_link(e)); break; case PN_LISTENER_CLOSE: check_condition(e, pn_listener_condition(pn_event_listener(e))); broker_stop(b); break; case PN_PROACTOR_INACTIVE: /* listener and all connections closed */ broker_stop(b); break; case PN_PROACTOR_INTERRUPT: b->finished = true; pn_proactor_interrupt(b->proactor); /* Pass along the interrupt to the other threads */ break; default: break; } } static void* broker_thread(void *void_broker) { broker_t *b = (broker_t*)void_broker; do { pn_event_batch_t *events = pn_proactor_wait(b->proactor); pn_event_t *e; while ((e = pn_event_batch_next(events))) { handle(b, e); } pn_proactor_done(b->proactor, events); } while(!b->finished); return NULL; } int main(int argc, char **argv) { const char *host = (argc > 1) ? argv[1] : ""; const char *port = (argc > 2) ? argv[2] : "amqp"; broker_t b = {0}; b.proactor = pn_proactor(); queues_init(&b.queues); b.container_id = argv[0]; b.threads = 4; b.ssl_domain = pn_ssl_domain(PN_SSL_MODE_SERVER); SET_CREDENTIALS(b.ssl_domain, "tserver"); pn_ssl_domain_allow_unsecured_client(b.ssl_domain); /* Allow SSL and plain connections */ { /* Listen on addr */ char addr[PN_MAX_ADDR]; pn_proactor_addr(addr, sizeof(addr), host, port); pn_proactor_listen(b.proactor, pn_listener(), addr, 16); } { /* Start n-1 threads */ pthread_t* threads = (pthread_t*)calloc(sizeof(pthread_t), b.threads); size_t i; for (i = 0; i < b.threads-1; ++i) { pthread_create(&threads[i], NULL, broker_thread, &b); } broker_thread(&b); /* Use the main thread too. */ /* Join the other threads */ for (i = 0; i < b.threads-1; ++i) { pthread_join(threads[i], NULL); } pn_proactor_free(b.proactor); free(threads); pn_ssl_domain_free(b.ssl_domain); return 0; } } qpid-proton-0.22.0/examples/c/README.dox0000664000000000000000000000136013257152177014462 0ustar /** * @example send.c * * Send a fixed number of messages to the "examples" node. * Can be used with @ref broker.c, @ref direct.c or an external AMQP broker. * * @example receive.c * * Subscribes to the 'example' node and prints the message bodies received. * Can be used with @ref broker.c, @ref direct.c or an external AMQP broker. * * @example direct.c * * A server that can be used to demonstrate direct (no broker) peer-to-peer communication * It can accept an incoming connection from either the @ref send.c or @ref receive.c examples * and will act as the directly-connected counterpart (receive or send) * * @example broker.c * * A simple multithreaded broker that works with the @ref send.c and @ref receive.c examples. */ qpid-proton-0.22.0/examples/c/CMakeLists.txt0000664000000000000000000000361313257152177015554 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # cmake_minimum_required (VERSION 2.8.12) find_package(Proton REQUIRED Core Proactor) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads REQUIRED) include_directories(${Proton_INCLUDE_DIRS}) add_definitions(${Proton_DEFINITIONS}) foreach (name broker send receive direct send-abort send-ssl) add_executable(c-${name} ${name}.c) target_link_libraries(c-${name} ${Proton_Proactor_LIBRARIES} ${Proton_Core_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) set_target_properties(c-${name} PROPERTIES OUTPUT_NAME ${name}) endforeach() # Add a test to run all examples # Make correct environment to find test executables and valgrind. if(WIN32) set(test_path "$;$;$") else() set(test_path "$:$ENV{PATH}") endif() set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV}) add_test( NAME c-example-tests COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} -- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) qpid-proton-0.22.0/examples/ProtonCppConfig.cmake0000664000000000000000000000313013257152177016640 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Note that this file is used *only* when building the examples within # the proton source tree not when the examples are installed separately # from it (for example in an OS distribution package). # # So if you find this file installed on your system something went wrong # with the packaging and/or package installation. # # For a packaged installation the equivalent file is created by the source # tree build and installed in the appropriate place for cmake on that system. set (ProtonCpp_VERSION ${PN_VERSION}) set (ProtonCpp_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/proton-c/include ${CMAKE_SOURCE_DIR}/proton-c/bindings/cpp/include ${CMAKE_BINARY_DIR}/proton-c/bindings/cpp) set (ProtonCpp_LIBRARIES ${C_EXAMPLE_LINK_FLAGS} qpid-proton-cpp) set (ProtonCpp_DEFINITIONS ${CXX_EXAMPLE_FLAGS}) set (ProtonCpp_FOUND True) qpid-proton-0.22.0/examples/ProtonConfig.cmake0000664000000000000000000000437213257152177016206 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Note that this file is used *only* when building the examples within # the proton source tree not when the examples are installed separately # from it (for example in an OS distribution package). # # So if you find this file installed on your system something went wrong # with the packaging and/or package installation. # # For a packaged installation the equivalent file is created by the source # tree build and installed in the appropriate place for cmake on that system. set (Proton_VERSION ${PN_VERSION}) set (Proton_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/proton-c/include) set (Proton_LIBRARIES ${C_EXAMPLE_LINK_FLAGS} qpid-proton) set (Proton_DEFINITIONS ${C_EXAMPLE_FLAGS}) set (Proton_FOUND True) set (Proton_Core_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/proton-c/include) set (Proton_Core_LIBRARIES ${C_EXAMPLE_LINK_FLAGS} qpid-proton-core) set (Proton_Core_DEFINITIONS ${C_EXAMPLE_FLAGS}) set (Proton_Core_FOUND True) if (${HAS_PROACTOR}) set (Proton_Proactor_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/proton-c/include) set (Proton_Proactor_LIBRARIES ${C_EXAMPLE_LINK_FLAGS} qpid-proton-proactor) set (Proton_Proactor_DEFINITIONS ${C_EXAMPLE_FLAGS}) set (Proton_Proactor_FOUND True) endif() # Check for all required components foreach(comp ${Proton_FIND_COMPONENTS}) if(NOT Proton_${comp}_FOUND) if(Proton_FIND_REQUIRED_${comp}) set(Proton_FOUND FALSE) set(Proton_NOT_FOUND_MESSAGE "Didn't find required component ${comp}") endif() endif() endforeach() qpid-proton-0.22.0/examples/CMakeLists.txt0000664000000000000000000000425213257152177015332 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # NOTE: The examples and their build files are self-contained, and installed # stand-alone independent of the library build tree. They must build and work in # this mode. # # For self-test purposes, the library and binding CMake files can provide extra # settings in _EXAMPLE_* variables - for example to enable extra error # checking or ensure compiler consistency with the library build. However, the # examples must also build correctly stand-alone, with none of those variables set. set (Proton_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (ProtonCpp_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # Add the tools directory for the 'proctest' module set_search_path(EXAMPLE_PYTHONPATH "${CMAKE_SOURCE_DIR}/tools/py" "$ENV{PYTHON_PATH}") set(EXAMPLE_ENV "PYTHONPATH=${EXAMPLE_PYTHONPATH}") add_subdirectory(c) add_subdirectory(go) if (BUILD_CPP) add_subdirectory(cpp) endif() install(DIRECTORY c cpp go DESTINATION ${PROTON_SHARE}/examples) install(DIRECTORY python DESTINATION ${PROTON_SHARE}/examples PATTERN "*.py" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) install(DIRECTORY ruby DESTINATION ${PROTON_SHARE}/examples PATTERN "*.rb" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) qpid-proton-0.22.0/config.sh.in0000775000000000000000000000500213257152177013157 0ustar #!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # merge_paths() { # Merge paths, remove duplicates (keep first instance) path=$(echo $* | sed 's/:/ /'g) # Split with spaces. newpath="" for d in $path; do # Remove duplicates { echo $newpath | grep -q "\(:\|^\)$d\(:\|$\)"; } || newpath="$newpath:$d" done echo $newpath | sed 's/^://' # Remove leading : } PROTON_HOME=@CMAKE_SOURCE_DIR@ PROTON_BUILD=@CMAKE_BINARY_DIR@ PROTON_BINDINGS=$PROTON_BUILD/proton-c/bindings PYTHON_BINDINGS=$PROTON_BINDINGS/python # Python COMMON_PYPATH=$PROTON_HOME/tests/python:$PROTON_HOME/proton-c/bindings/python:$PROTON_HOME/tools/py export PYTHONPATH=$COMMON_PYPATH:$PYTHON_BINDINGS # Ruby RUBY_BINDINGS=$PROTON_BINDINGS/ruby RUBY_SRC=$PROTON_HOME/proton-c/bindings/ruby export RUBYLIB=$RUBY_BINDINGS:$RUBY_SRC/lib:$RUBY_SRC/tests:$RUBY_SRC/spec # Go export GOPATH="$PROTON_BUILD/proton-c/bindings/go" # Help Go compiler find libraries and include files. export C_INCLUDE_PATH="$(merge_paths $PROTON_HOME/proton-c/include $PROTON_BUILD/proton-c/include $C_INCLUDE_PATH)" export LIBRARY_PATH="$(merge_paths $PROTON_BUILD/proton-c $LIBRARY_PATH)" export LD_LIBRARY_PATH="$(merge_paths $PROTON_BUILD/proton-c $LD_LIBRARY_PATH)" # test applications export PATH="$(merge_paths $PATH $PROTON_BUILD/tests/tools/apps/c $PROTON_HOME/tests/tools/apps/python $PROTON_HOME/tests/python)" # can the test harness use valgrind? if [[ -x "$(type -p valgrind)" && "@ENABLE_VALGRIND@" == "ON" ]] ; then export VALGRIND=$(type -p valgrind) export VALGRIND_ARGS="@VALGRIND_OPTIONS@" fi # can the test harness use saslpasswd2? if [[ -x "$(type -p saslpasswd2)" ]] ; then export SASLPASSWD=$(type -p saslpasswd2) fi # Location of interop test files. export PN_INTEROP_DIR=$PROTON_HOME/tests/interop qpid-proton-0.22.0/config.bat.in0000664000000000000000000000362713257152177013323 0ustar REM REM Licensed to the Apache Software Foundation (ASF) under one REM or more contributor license agreements. See the NOTICE file REM distributed with this work for additional information REM regarding copyright ownership. The ASF licenses this file REM to you under the Apache License, Version 2.0 (the REM "License"); you may not use this file except in compliance REM with the License. You may obtain a copy of the License at REM REM http://www.apache.org/licenses/LICENSE-2.0 REM REM Unless required by applicable law or agreed to in writing, REM software distributed under the License is distributed on an REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY REM KIND, either express or implied. See the License for the REM specific language governing permissions and limitations REM under the License. REM REM This is a generated file and will be overwritten the next REM time that cmake is run. REM This build may be one of @CMAKE_CONFIGURATION_TYPES@ REM Choose the configuration this script should reference: SET PROTON_BUILD_CONFIGURATION=relwithdebinfo REM PROTON_HOME is the root of the proton checkout REM PROTON_BUILD is where cmake was run set PROTON_HOME=@CMAKE_SOURCE_DIR@ set PROTON_BUILD=@CMAKE_BINARY_DIR@ set PROTON_HOME=%PROTON_HOME:/=\% set PROTON_BUILD=%PROTON_BUILD:/=\% set PROTON_BINDINGS=%PROTON_BUILD%\proton-c\bindings REM Python set PYTHON_BINDINGS=%PROTON_BINDINGS%\python set COMMON_PYPATH=%PROTON_HOME%\tests\python;%PROTON_HOME%\proton-c\bindings\python set PYTHONPATH=%COMMON_PYPATH%;%PYTHON_BINDINGS% REM Ruby set RUBY_BINDINGS=%PROTON_BINDINGS%\ruby set RUBYLIB=%RUBY_BINDINGS%;%PROTON_HOME%\proton-c\bindings\ruby\lib;%PROTON_HOME%\tests\ruby REM test applications set PATH=%PATH%;%PROTON_BUILD%\tests\tools\apps\c set PATH=%PATH%;%PROTON_HOME%\tests\tools\apps\python set PATH=%PATH%;%PROTON_HOME%\tests\python set PATH=%PATH%;%PROTON_BUILD%\proton-c\%PROTON_BUILD_CONFIGURATION% qpid-proton-0.22.0/bin/0000775000000000000000000000000013257152177011521 5ustar qpid-proton-0.22.0/bin/version.sh0000775000000000000000000000222013257152177013541 0ustar #!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # version.sh - Sets the version of the proton source tree to the given # value. ME=$(basename ${0}) usage() { echo "Usage: ${ME} [SRC] VERSION" exit 1 } if [ $# == 2 ]; then SRC=$1 VERSION=$2 elif [ $# == 1 ]; then SRC=$(dirname $(dirname $(readlink -f $0))) VERSION=$1 else usage fi echo ${VERSION} > ${SRC}/version.txt qpid-proton-0.22.0/bin/release.sh0000775000000000000000000000316513257152177013505 0ustar #!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # release.sh - Creates a release. ME=$(basename ${0}) CURRDIR=$PWD SRC=$(dirname $(dirname $(readlink -f $0))) usage() { echo "Usage: ${ME} VERSION TAG" exit 1 } if [ $# == 2 ]; then VERSION=$1 TAG=$2 else usage fi die() { printf "ERROR: %s\n" "$*" exit 1 } ## ## Create the tag ## ( cd ${SRC} if [ -n "$(git status -uno --porcelain)" ]; then die must release from a clean checkout fi BRANCH=$(git symbolic-ref -q --short HEAD) if [ -n "${BRANCH}" ]; then REMOTE=$(git config branch.${BRANCH}.remote) else REMOTE="origin" fi git checkout --detach && \ bin/version.sh $VERSION && \ git commit -a -m "Release $VERSION" && \ git tag -m "Release $VERSION" $TAG && \ echo "Run 'git push ${REMOTE} ${TAG}' to push the tag upstream." ) qpid-proton-0.22.0/bin/record-coverage.sh0000775000000000000000000000353613257152177015136 0ustar #! /usr/bin/env bash # This script collates coverage data already present from running instrumented code. # # It requires the lcov tool to be installed (this provides the lcov and genhtml commands) # # It will produce a coverage analysis for gcc or clang compiled builds and currently for # C and C++ parts of the build tree. # # It takes two command line arguments: # - The first is the proton source tree: this is mandatory. # - The second is the build tree: this is optional and if not specified is assumed to be the # current directory. # # The output is in the form of an html report which will be found in the generated html directory. # - There will also be a number of intermediate files left in the current directory. # # The typical way to use it would be to use the "Coverage" build type to get instrumented # code, then to run the tests then to extract the coverage information from running the # tests. # Something like: # cmake $PROTON_SRC -DCMAKE_BUILD_TYPE=Coverage # make # make test # make coverage # set -x # get full path function getpath { pushd -n $1 > /dev/null echo $(dirs -0 -l) popd -n > /dev/null } SRC=${1?} BLD=${2:-.} BLDPATH=$(getpath $BLD) SRCPATH=$(getpath $SRC) # Get base profile # - this initialises 0 counts for every profiled file # without this step any file with no counts at all wouldn't # show up on the final output. lcov -c -i -d $BLDPATH -o proton-base.info # Get actual coverage data lcov -c -d $BLDPATH -o proton-ctest.info # Total them up lcov --add proton-base.info --add proton-ctest.info > proton-total-raw.info # Snip out stuff in /usr (we don't care about coverage in system code) lcov --remove proton-total-raw.info "/usr/include*" "/usr/share*" > proton-total.info # Generate report rm -rf html genhtml -p $SRCPATH -p $BLDPATH proton-total.info --title "Proton CTest Coverage" --demangle-cpp -o html qpid-proton-0.22.0/bin/jenkins-proton-c-build.sh0000775000000000000000000000427613257152177016366 0ustar #!/bin/bash -e # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # This is the continuous delivery build script executed after a git # extract by the Jenkins build process located at the following URL: # https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-c/ # CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=$PWD/build/ship" XMLOUTPUT=../testresults/TEST-protonc.xml echo Arch: `arch` Uname: `uname -a` lsb_release: `lsb_release -a` User: `whoami` echo ========================= echo Listing installed packages dpkg -l | \ awk '/^ii (cmake |maven |ruby |python |.*jdk |swig[0-9]*)/{print $2, $3}'| \ sort echo ========================= which python || exit 1 which swig || exit 1 # if python-pip is available, install the python tox test tool RUN_TOX=false PIP=$(type -p pip || true) if [ -n $PIP ] && [ -x "$PIP" ]; then ldir=$(python -c 'import site; print("%s" % site.USER_BASE)') PATH="$ldir/bin:$PATH" echo "PATH=$PATH" if [ $VIRTUAL_ENV ]; then pip install -U tox else pip install --user -U tox fi RUN_TOX=true fi ls rm -rf build testresults >/dev/null 2>&1 mkdir build testresults >/dev/null 2>&1 cd build >/dev/null 2>&1 cmake ${CMAKE_FLAGS} .. cmake --build . --target install echo Running tests $RUN_TOX && ctest -V -R 'python-tox-test' source config.sh # proton-c tests via python python ../tests/python/proton-test --xml=${XMLOUTPUT} # proton-c native c-* tests ctest -V -R '^c-*' echo 'Build completed' qpid-proton-0.22.0/bin/export.sh0000775000000000000000000000374513257152177013412 0ustar #!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # export.sh - Create a release archive. set -e trap "cleanup" 0 1 2 3 9 11 13 15 ME=$(basename ${0}) SRC=$(dirname $(dirname $(readlink -f $0))) usage() { echo echo "Usage: ${ME} [DIR] [TAG]" exit 1 } cleanup() { trap - 0 1 2 3 9 11 13 15 echo [ ${WORKDIR} ] && [ -d ${WORKDIR} ] && rm -rf ${WORKDIR} } DIR=$PWD TAG=$(git describe --tags --always) ## ## Allow overrides to be passed on the cmdline ## if [ $# -gt 2 ]; then usage elif [ $# -ge 1 ]; then DIR=$1 if [ $# -eq 2 ]; then TAG=$2 fi fi # verify the tag exists git rev-list -1 tags/${TAG} -- >/dev/null || usage WORKDIR=$(mktemp -d) ## ## Create the archive ## ( cd ${SRC} MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S') VERSION=$(git show tags/${TAG}:version.txt) ARCHIVE=$DIR/qpid-proton-${VERSION}.tar.gz PREFIX=qpid-proton-${VERSION} [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR} git archive --format=tar --prefix=${PREFIX}/ tags/${TAG} \ | tar -x -C ${WORKDIR} cd ${WORKDIR} tar -c -z \ --owner=root --group=root --numeric-owner \ --mtime="${MTIME}" \ -f ${ARCHIVE} ${PREFIX} echo "${ARCHIVE}" ) qpid-proton-0.22.0/appveyor.yml0000664000000000000000000000127413257152177013345 0ustar version: '{branch}.{build}' configuration: RelWithDebInfo environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 CMAKE_GENERATOR: Visual Studio 15 - CMAKE_GENERATOR: Visual Studio 12 - CMAKE_GENERATOR: Visual Studio 10 install: - cinst -y swig cache: - C:\ProgramData\chocolatey\bin -> appveyor.yml - C:\ProgramData\chocolatey\lib -> appveyor.yml before_build: - mkdir BLD - cd BLD - cmake -G "%CMAKE_GENERATOR%" %QPID_PROTON_CMAKE_ARGS% .. - cd .. build: project: BLD/Proton.sln parallel: true verbosity: normal test_script: - cd BLD - cmake --build . --target install --config %CONFIGURATION% - ctest -V -C %CONFIGURATION% %QPID_PROTON_CTEST_ARGS% - cd .. qpid-proton-0.22.0/RELEASE.md0000664000000000000000000000307213257152177012355 0ustar ### Building a release for vote: 1. Grab a clean checkout for safety. 2. Run: "git checkout ${BRANCH}" if needed. 3. Update the versions: - Run: "bin/version.sh ${VERSION}", e.g: bin/version.sh 0.18.0 - Update the version(s) if needed in file: proton-c/bindings/python/docs/conf.py 4. Commit the changes, tag them. - Run: "git add ." - Run: 'git commit -m "update versions for ${TAG}"' - Run: 'git tag -m "tag ${TAG}" ${TAG}', e.g: git tag -m "tag 0.18.0-rc1" 0.18.0-rc1 5. Run: "bin/export.sh $PWD ${TAG}" to create the qpid-proton-${VERSION}.tar.gz release archive. 6. Create signature and checksum files for the archive: - e.g "gpg --detach-sign --armor qpid-proton-${VERSION}.tar.gz" - e.g "sha512sum qpid-proton-${VERSION}.tar.gz > qpid-proton-${VERSION}.tar.gz.sha512" 7. Push branch changes and tag. - Also update versions to the applicable snapshot version for future work on it. 8. Commit artifacts to dist dev repo in https://dist.apache.org/repos/dist/dev/qpid/proton/${TAG} dir. 9. Send vote email, provide links to dist dev repo and JIRA release notes. ### After a vote succeeds: 1. Tag the RC with the final version. 2. Add the artifacts to dist release repo: svn cp -m "add files for qpid-proton-${VERSION}" https://dist.apache.org/repos/dist/dev/qpid/proton/${TAG} https://dist.apache.org/repos/dist/release/qpid/proton/${VERSION} 3. Give the mirrors some time to distribute things. Can take 24hrs for good coverage. - Status is visible at: https://www.apache.org/mirrors/ 4. Update the website with release content. 5. Send release announcement email. qpid-proton-0.22.0/README.md0000664000000000000000000000400613257152177012230 0ustar Qpid Proton - AMQP messaging toolkit ==================================== Linux/OSX Build | Windows Build ----------------|--------------- [![Linux/OSX Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/apache/qpid-proton?branch=master&svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton/branch/master) Qpid Proton is a high-performance, lightweight messaging library. It can be used in the widest range of messaging applications, including brokers, client libraries, routers, bridges, proxies, and more. Proton makes it trivial to integrate with the AMQP 1.0 ecosystem from any platform, environment, or language Features -------- - A flexible and capable reactive messaging API - Full control of AMQP 1.0 protocol semantics - Portable C implementation with bindings to popular languages - Peer-to-peer and brokered messaging - Secure communication via SSL and SASL Universal - Proton is designed to scale both up and down. Equally suitable for simple clients or high-powered servers, it can be deployed in simple peer-to-peer configurations or as part of a global federated messaging network. Embeddable - Proton is carefully written to be portable and cross platform. It has minimal dependencies, and it is architected to be usable with any threading model, as well as with non-threaded applications. These features make it uniquely suited for embedding messaging capabilities into existing software. Standard - Built around the AMQP 1.0 messaging standard, Proton is not only ideal for building out your own messaging applications but also for connecting them to the broader ecosystem of AMQP 1.0-based messaging applications. Getting Started --------------- See the included INSTALL.md file for build and install instructions and the DEVELOPERS file for information on how to modify and test the library code itself. Please see http://qpid.apache.org/proton for a more info. qpid-proton-0.22.0/NOTICE0000664000000000000000000000025413257152177011656 0ustar Apache Qpid Proton Copyright 2012-2018 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). qpid-proton-0.22.0/LICENSE0000664000000000000000000002713513257152177011766 0ustar Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. PROTON SUBCOMPONENTS: Proton includes freegetopt with a separate BSD license. Your use of the source code for freegetopt is subject to the terms and conditions of its license in examples/include/pncompat/internal/LICENSE. The setup scripts for the python bindings include files derived by PyZMQ and are licensed with a separate Modified BSD license. Use of the source code in these setup files are subject to the terms and conditions in the license: proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD. qpid-proton-0.22.0/INSTALL.md0000664000000000000000000001431513257152177012405 0ustar Installing Qpid Proton ====================== The CMake build system can build the entire codebase, including proton-c, and all its language bindings. Dependencies ------------ Cross-platform dependencies - CMake 2.8.7+ - Swig 1.3+ (for the bindings) - Python 2.6+ (for the Python binding) - Ruby 1.9+ (for the Ruby binding) Linux dependencies - GNU Make 3.81+ - GCC 4.4+ - Cyrus SASL 2.1+ (for SASL support) - OpenSSL 1.0+ (for SSL support) Windows dependencies - Visual Studio 2005 or newer (regular or C++ Express) CMake (Linux) ------------- The following prerequisites are required to do a full build on RPM-based systems (RHEL, Fedora, etc.). If you do not wish to build a given language binding you can omit the devel package for that language. # Required dependencies $ yum install gcc gcc-c++ make cmake libuuid-devel # Dependencies needed for SSL support $ yum install openssl-devel # Dependencies needed for Cyrus SASL support $ yum install cyrus-sasl-devel cyrus-sasl-plain cyrus-sasl-md5 # Dependencies needed for bindings $ yum install swig # Required for all bindings $ yum install python-devel # Python $ yum install ruby-devel rubygem-minitest # Ruby # Dependencies needed to generate documentation $ yum install epydoc # Python $ yum install rubygem-yard # Ruby $ yum install doxygen # C, C++ The following prerequisites are required to do a full build on Debian-based systems (Ubuntu). If you do not wish to build a given language binding you can omit the dev package for that language. # Required dependencies $ apt-get install gcc g++ cmake cmake-curses-gui uuid-dev # Dependencies needed for SSL support $ apt-get install libssl-dev # dependencies needed for Cyrus SASL support $ apt-get install libsasl2-2 libsasl2-dev libsasl2-modules # dependencies needed for bindings $ apt-get install swig python-dev ruby-dev # dependencies needed for python docs $ apt-get install python-epydoc From the directory where you found this `INSTALL.md` file: $ mkdir build $ cd build # Set the install prefix. You may need to adjust it depending on your # system. $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DSYSINSTALL_BINDINGS=ON # Omit the docs target if you do not wish to build or install # documentation. $ make all docs # Note that this step will require root privileges. $ make install When make install completes, all installed files are listed in the `install_manifest.txt` file. The contents of this file may be used to uninstall. CMake (Windows) --------------- This describes how to build the Proton library on Windows using Microsoft Visual C++. The Proton build uses the CMake tool to generate the Visual Studio project files. These project files can then be loaded into Visual Studio and used to build the Proton library. The following packages must be installed: - Visual Studio 2005 or newer (regular or C++ Express) - Python (www.python.org) - CMake (www.cmake.org) Additional packages are required for the language bindings: - Swig (www.swig.org) - Development headers and libraries for the language of choice Notes: - Be sure to install relevant Microsoft Service Packs and updates - python.exe, cmake.exe and swig.exe _must_ all be added to your PATH To generate the Visual Studio project files, from the directory where you found this `INSTALL.md` file: > mkdir build > cd build > cmake .. If CMake doesn't guess things correctly, useful additional arguments are: -G "Visual Studio 10" -DSWIG_EXECUTABLE=C:\swigwin-2.0.7\swig.exe Refer to the CMake documentation for more information. Build and install from a command prompt (using msbuild): > cmake --build . --target install --config RelWithDebInfo Loading the `ALL_BUILD` project into Visual Studio: 1. Run the Microsoft Visual Studio IDE 2. From within the IDE, open the `ALL_BUILD` project file or Proton solution file - it should be in the `build` directory you created above. 3. Select the appropriate configuration. RelWithDebInfo works best with the included CMake/CTest scripts Note that if you wish to build debug version of Proton for use with Swig bindings on Windows, you must have the appropriate debug target libraries to link against. Other Platforms --------------- Proton can use the http://libuv.org IO library on any platform where it is available. Install the libuv library and header files and adapt the instructions for building on Linux. The libuv library is not required on Linux or Windows, but if you wish you can use it instead of the default native IO by running cmake with `-Dproactor=libuv`. Installing Language Bindings ---------------------------- Most dynamic languages provide a way for asking where to install libraries in order to place them in a default search path. When `SYSINSTALL_BINDINGS` is enabled (`ON`), the `CMAKE_INSTALL_PREFIX` does not affect the location for where the language bindings (Python and Ruby) are installed. For those elements, the location is determined by the language interpreter itself; that is, each interpreter is queried for the proper location for extensions. When `SYSINSTALL_BINDINGS` is disabled (`OFF`), Proton installs all dynamic language bindings into a central, default location: BINDINGS=${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/proton/bindings In order to use these bindings, you'll need to configure your interpreter to load the bindings from the appropriate directory. - Python - Add ${BINDINGS}/python to PYTHONPATH - Ruby - Add ${BINDINGS}/ruby to RUBYLIB You can configure the build to install a specific binding to the location specified by the system interpreter with the SYSINSTALL_[LANGUAGE] options, where [LANGUAGE] is one of PYTHON or RUBY. $ cmake .. -DSYSINSTALL_PYTHON=ON Disabling Language Bindings --------------------------- To disable any given language bindings, you can use the BUILD_[LANGUAGE] option where [LANGUAGE] is one of PYTHON or RUBY, for example: $ cmake .. -DBUILD_PYTHON=OFF qpid-proton-0.22.0/DEVELOPERS.md0000664000000000000000000000606213257152177012747 0ustar Qpid Proton Developer Information ================================= Development Environment ----------------------- First you will need to set up your basic build environment with CMake and all prerequisites (see the instructions in INSTALL) so that you can build the full code base. To setup shell variables for your development environment, you must source the file config.sh from the CMake build directory. $ cd build $ source config.sh This file sets the necessary environment variables for all supported dynamic languages (Python and Ruby) and for running the tests. Testing ------- As a developer on Proton, it is a good idea to build and test with the appropriate dependencies and settings in place so that the complete set of language bindings and implementations are present. ### Running tests To test Proton you should use the CMake build. By default this will invoke the maven tests as well, so the maven prerequisites will additionally be required. By default the unit tests are run using the system's default Python interpreter. However, Proton's Python language bindings support both versions of the python language (Python 2.x and Python 3.x). These bindings should be tested using both versions of the Python interpreter. CMake makes this possible by automatically running the python unit tests under all versions of python installed on the system. Developers can ensure that Proton remains compatible with both versions of Python by installing the following prerequisites: _Note: currently CMake only supports multi-Python testing in **Linux** based environments. Non-Linux developers may skip the following two steps._ 1. Installing both Python2.x and Python3.x and their associated development environments on your system. Most modern Linux distributions support installing Python 2.x and Python 3.x in parallel. 2. Install the **tox** Python testing tool, e.g. for older Fedora: $ yum install python-tox For newer fedora: $ dnf install python3-tox redhat-rpm-config To run the tests, cd into your build directory and use the following commands: # to run all the tests, summary mode $ ctest # to list the available testsuites $ ctest -N # to run a single testsuite, verbose output $ ctest -V -R c-engine-tests Additional packages required for testing the language bindings: # ruby dependencies $ yum install rubygem-minitest # alternatively ruby depedencies on non-RPM based systems $ gem install minitest To run coverage reporting: # install coverage tools $ dnf install lcov $ pip install coverage $ cmake -DCMAKE_BUILD_TYPE=Coverage && make && ctest && make coverage # Then browse to {CMAKE_BUILD_DIR}/coverage_results/html/index.html Mailing list ------------ Subscribe to the Qpid mailing lists using details at: http://qpid.apache.org/discussion.html Patches ------- The best way to submit patches is to create a bug report or feature request on the project's JIRA instance: http://issues.apache.org/jira/browse/PROTON You can attach any patch(es) to the report/request there qpid-proton-0.22.0/CMakeLists.txt0000664000000000000000000002136513257152177013520 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # cmake_minimum_required (VERSION 2.8.12) project (Proton C) # Enable testing enable_testing() include (CTest) # Pull in local cmake modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/Modules/") include (CheckLanguage) check_language(CXX) if (CMAKE_CXX_COMPILER) enable_language(CXX) endif() # TODO - Should change this test to take account of recent MSVC that does support C99 if (MSVC) # No C99 capability, use C++ set(DEFAULT_BUILD_WITH_CXX ON) endif (MSVC) if (CMAKE_CXX_COMPILER) option(BUILD_WITH_CXX "Compile Proton using C++" ${DEFAULT_BUILD_WITH_CXX}) endif() if (CMAKE_CONFIGURATION_TYPES) # There is no single "build type"... message(STATUS "Build types are ${CMAKE_CONFIGURATION_TYPES}") else (CMAKE_CONFIGURATION_TYPES) # There is a single build configuration # If the build type is not set then set the default if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string "Build type: Debug, Release, RelWithDebInfo, MinSizeRel or Coverage (default RelWithDebInfo)" FORCE) endif () # Set up extra coverage analysis options for gcc and clang if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage") set (CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage") set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage") set (CMAKE_MODULE_LINKER_FLAGS_COVERAGE "--coverage") set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage") mark_as_advanced( CMAKE_C_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_MODULE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE) endif() if (CMAKE_BUILD_TYPE MATCHES "Deb") set (has_debug_symbols " (has debug symbols)") endif (CMAKE_BUILD_TYPE MATCHES "Deb") message(STATUS "Build type is \"${CMAKE_BUILD_TYPE}\"${has_debug_symbols}") endif (CMAKE_CONFIGURATION_TYPES) # Add coverage target if we're building for test coverage if (CMAKE_BUILD_TYPE MATCHES "Coverage") make_directory(coverage_results) add_custom_target(coverage WORKING_DIRECTORY ./coverage_results COMMAND ${CMAKE_SOURCE_DIR}/bin/record-coverage.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) endif() if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (NOT CMAKE_OSX_ARCHITECTURES) set(CMAKE_OSX_ARCHITECTURES "x86_64") set(LIB_SUFFIX "") set(CMAKE_MACOSX_RPATH ON) endif () endif () file(READ version.txt PN_VERSION_FILE) string(STRIP ${PN_VERSION_FILE} PN_VERSION_LINE) string(REPLACE "-" ";" PN_VERSION_SPLIT "${PN_VERSION_LINE}") list(GET PN_VERSION_SPLIT 0 PN_VERSION_CLEAN) list(REMOVE_AT PN_VERSION_SPLIT 0) string(REPLACE ";" "-" PN_VERSION_QUALIFIER "${PN_VERSION_SPLIT}") string(REGEX MATCHALL "[0-9]+" PN_VERSION_LIST "${PN_VERSION_CLEAN}") list(GET PN_VERSION_LIST 0 PN_VERSION_MAJOR) list(GET PN_VERSION_LIST 1 PN_VERSION_MINOR) list(LENGTH PN_VERSION_LIST PN_VERSION_LENGTH) if (${PN_VERSION_LENGTH} GREATER 2) list(GET PN_VERSION_LIST 2 PN_VERSION_POINT) set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}.${PN_VERSION_POINT}") else() set (PN_VERSION_POINT 0) set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}") endif() message(STATUS "PN_VERSION: ${PN_VERSION} (${PN_VERSION_QUALIFIER})") set (pn_test_root "${CMAKE_CURRENT_SOURCE_DIR}/tests") set (pn_test_bin "${CMAKE_CURRENT_BINARY_DIR}/tests") # In rpm builds the build sets some variables: # CMAKE_INSTALL_PREFIX - this is a standard cmake variable # INCLUDE_INSTALL_DIR # LIB_INSTALL_DIR # SYSCONF_INSTALL_DIR # SHARE_INSTALL_DIR # So make these cached variables and the specific variables non cached # and derived from them. if (NOT DEFINED LIB_SUFFIX) get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) if ("${LIB64}" STREQUAL "TRUE" AND ${CMAKE_SIZEOF_VOID_P} STREQUAL "8") set(LIB_SUFFIX 64) else() set(LIB_SUFFIX "") endif() endif() # Start of variables used during install set (INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory") set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library object file directory") set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration directory") set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") set (MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory") mark_as_advanced (INCLUDE_INSTALL_DIR LIB_INSTALL_DIR SYSCONF_INSTALL_DIR SHARE_INSTALL_DIR MAN_INSTALL_DIR) ## LANGUAGE BINDINGS # Default directory for language bindings not being installed into # system specified locations. set (BINDINGS_DIR ${LIB_INSTALL_DIR}/proton/bindings) set (SYSINSTALL_BINDINGS OFF CACHE BOOL "If SYSINSTALL_BINDINGS is OFF then proton bindings will be installed underneath ${BINDINGS_DIR} and each user will need to modify their interpreter configuration to load the appropriate binding. If SYSINSTALL_BINDINGS is ON, then each language interpreter will be queried for the appropriate directory and proton bindings will be installed and available system wide with no additional per user configuration.") set (BINDING_LANGS PYTHON RUBY) foreach (LANG ${BINDING_LANGS}) set (SYSINSTALL_${LANG} OFF CACHE BOOL "Install ${LANG} bindings into interpreter specified location.") if (SYSINSTALL_BINDINGS OR SYSINSTALL_${LANG}) set (CHECK_SYSINSTALL_${LANG} ON) else () set (CHECK_SYSINSTALL_${LANG} OFF) endif () endforeach() set (PROTON_SHARE ${SHARE_INSTALL_DIR}/proton-${PN_VERSION}) # End of variables used during install # Can't do valgrind and coverage at athe same time - coverage takes precedence if (CMAKE_BUILD_TYPE MATCHES "Coverage") message(STATUS "Building for coverage analysis; no run-time error detection") else () # Check for valgrind here so tests under proton-c/ and examples/ can use it. find_program(VALGRIND_EXECUTABLE valgrind DOC "Location of the valgrind program") mark_as_advanced (VALGRIND_EXECUTABLE) option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON) if (ENABLE_VALGRIND) if (VALGRIND_EXECUTABLE) set (VALGRIND_SUPPRESSIONS ${CMAKE_SOURCE_DIR}/proton-c/src/tests/valgrind.supp CACHE STRING "Default valgrind suppressions") set (VALGRIND_OPTIONS "--error-exitcode=42 --quiet --leak-check=full --trace-children=yes" CACHE STRING "Default valgrind options") mark_as_advanced(VALGRIND_SUPPRESSIONS VALGRIND_OPTIONS) set (VALGRIND_ENV "VALGRIND=${VALGRIND_EXECUTABLE}" "VALGRIND_ARGS=${VALGRIND_OPTIONS} --suppressions=${VALGRIND_SUPPRESSIONS}") separate_arguments(VALGRIND_OPTIONS_LIST UNIX_COMMAND ${VALGRIND_OPTIONS}) set (memcheck-cmd ${VALGRIND_EXECUTABLE} ${VALGRIND_OPTIONS_LIST} "--suppressions=${VALGRIND_SUPPRESSIONS}") else () message(STATUS "Can't locate the valgrind command; no run-time error detection") endif () endif () endif () # Options to enable sanitizing compile flags. Compile flags are set in proton-c/CMakeLists.txt option(ENABLE_SANITIZERS "Compile with sanitizers (ASan, UBSan, TSan); incompatible with Valgrind" OFF) option(ENABLE_TSAN "Compile with Thread Sanitizer (TSan); incompatible with Valgrind" OFF) if (ENABLE_SANITIZERS OR ENABLE_TSAN) set(DISABLE ENABLE_VALGRIND ENABLE_UNDEFINED_ERROR BUILD_GO) message(STATUS "Building with sanitizers; disables ${DISABLE}") foreach(d ${DISABLE}) set(${d} OFF CACHE BOOL "Disabled to run sanitizers" FORCE) endforeach() unset(VALGRIND_ENV) endif() # Set result to a native search path - used by examples and binding tests. # args after result are directories or search paths. macro(set_search_path result) set(${result} ${ARGN}) if (UNIX) string(REPLACE ";" ":" ${result} "${${result}}") # native search path separators. endif() file(TO_NATIVE_PATH "${${result}}" ${result}) # native slash separators endmacro() add_subdirectory(proton-c) add_subdirectory(examples) install (FILES LICENSE README.md DESTINATION ${PROTON_SHARE}) # Generate test environment settings configure_file(${CMAKE_SOURCE_DIR}/config.sh.in ${CMAKE_BINARY_DIR}/config.sh @ONLY) configure_file(${CMAKE_SOURCE_DIR}/config.bat.in ${CMAKE_BINARY_DIR}/config.bat @ONLY) qpid-proton-0.22.0/.travis.yml0000664000000000000000000000455713257152177013075 0ustar # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License # sudo: false language: cpp compiler: - gcc - clang matrix: include: - os: linux env: - QPID_PROTON_CMAKE_ARGS='-DCMAKE_BUILD_TYPE=Coverage' after_success: - bash <(curl -s https://codecov.io/bash) - os: osx osx_image: xcode7.3 env: - PKG_CONFIG_PATH='/usr/local/opt/openssl/lib/pkgconfig' - PATH="/usr/local/opt/python/libexec/bin:/usr/local/bin:$PATH" - QPID_PROTON_CMAKE_ARGS='-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DSASL_IMPL=none -DBUILD_RUBY=OFF' before_install: - brew update - brew upgrade cmake python openssl - brew install libuv swig - os: osx osx_image: xcode9 env: - PKG_CONFIG_PATH='/usr/local/opt/openssl/lib/pkgconfig' - PATH="/usr/local/opt/python/libexec/bin:/usr/local/bin:$PATH" - QPID_PROTON_CMAKE_ARGS='-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DSASL_IMPL=none -DBUILD_RUBY=OFF' before_install: - brew update - brew upgrade cmake python openssl - brew install libuv swig # Note addons is apt specific at the moment and will not be applied for osx. # See before_install brew commands below addons: apt: packages: - cmake - libssl-dev - libsasl2-dev - sasl2-bin - swig - python-dev - valgrind - ruby - ruby-dev - python3-dev - golang - lcov install: - python -m pip install --user --upgrade pip - python -m pip install --user coverage tox - gem install minitest before_script: - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install ${QPID_PROTON_CMAKE_ARGS} script: - cmake --build . --target install && ctest -V ${QPID_PROTON_CTEST_ARGS} qpid-proton-0.22.0/.reviewboardrc0000664000000000000000000000012113257152177013602 0ustar REVIEWBOARD_URL = "https://reviews.apache.org" REPOSITORY = 'qpid-proton-git' qpid-proton-0.22.0/.mailmap0000664000000000000000000000011113257152177012363 0ustar Clifford Jansen Ken Giusti