Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package nanomsg for openSUSE:Factory checked 
in at 2022-12-06 14:23:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nanomsg (Old)
 and      /work/SRC/openSUSE:Factory/.nanomsg.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nanomsg"

Tue Dec  6 14:23:19 2022 rev:7 rq:1040411 version:1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/nanomsg/nanomsg.changes  2020-03-31 
17:16:32.427676950 +0200
+++ /work/SRC/openSUSE:Factory/.nanomsg.new.1835/nanomsg.changes        
2022-12-06 14:23:27.957673152 +0100
@@ -1,0 +2,6 @@
+Fri Dec  2 21:54:53 UTC 2022 - Dirk Müller <dmuel...@suse.com>
+
+- update to 1.2:
+  * IPv6 support and fixes a couple of bugs.
+
+-------------------------------------------------------------------

Old:
----
  nanomsg-1.1.5.tar.gz

New:
----
  nanomsg-1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nanomsg.spec ++++++
--- /var/tmp/diff_new_pack.7oqX4o/_old  2022-12-06 14:23:28.489677687 +0100
+++ /var/tmp/diff_new_pack.7oqX4o/_new  2022-12-06 14:23:28.497677756 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package nanomsg
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,14 +16,14 @@
 #
 
 
-%define sover 5
+%define sover 6
 Name:           nanomsg
-Version:        1.1.5
+Version:        1.2
 Release:        0
 Summary:        Socket library providing several common communication patterns
 License:        MIT
 Group:          Development/Languages/C and C++
-URL:            http://nanomsg.org/
+URL:            https://nanomsg.org/
 Source:         
https://github.com/nanomsg/nanomsg/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Patch0:         nanomsg-fix-rpath-issue.patch
 BuildRequires:  cmake
@@ -74,8 +74,8 @@
 %{_libdir}/libnanomsg.so
 %{_bindir}/nanocat
 %{_libdir}/pkgconfig/nanomsg.pc
-%dir %{_libdir}/cmake/nanomsg-%{version}
-%{_libdir}/cmake/nanomsg-%{version}/nanomsg-config*.cmake
-%{_libdir}/cmake/nanomsg-%{version}/nanomsg-target*.cmake
+%dir %{_libdir}/cmake/nanomsg-1.1.5
+%{_libdir}/cmake/nanomsg-1.1.5/nanomsg-config*.cmake
+%{_libdir}/cmake/nanomsg-1.1.5/nanomsg-target*.cmake
 
 %changelog

++++++ nanomsg-1.1.5.tar.gz -> nanomsg-1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/.appveyor.yml 
new/nanomsg-1.2/.appveyor.yml
--- old/nanomsg-1.1.5/.appveyor.yml     2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/.appveyor.yml       1970-01-01 01:00:00.000000000 +0100
@@ -1,53 +0,0 @@
-version: 0.8.{build}
-environment:
-  global:
-    ASCIIDOCTOR_VER: 1.5.4
-    CFLAGS: /MP
-  matrix:
-    # array of all environments used to test builds
-    - GENERATOR: NMake Makefiles
-      CFG: Debug
-      VS_VERSION: 12.0
-    - GENERATOR: Visual Studio 14 2015
-      VS_VERSION: 14.0
-      CFG: Debug
-    - GENERATOR: Visual Studio 12 2013
-      VS_VERSION: 12.0
-      CFG: Debug
-    - GENERATOR: Visual Studio 14 2015 Win64
-      CFG: Debug
-      VS_VERSION: 14.0
-    - GENERATOR: Visual Studio 12 2013 Win64
-      CFG: Debug
-      VS_VERSION: 12.0
-
-cache:
-  - '%USERPROFILE%\asciidoctor-%ASCIIDOCTOR_VER%.gem -> .appveyor.yml'
-
-install:
-  # Gem fetching can sometimes be excruciatingly slow due to the rubygems 
database,
-  # so we have to manually download our target gem.
-  - ps: |
-      $asciidoctor = 
"$($env:USERPROFILE)\asciidoctor-$($env:ASCIIDOCTOR_VER).gem"
-      if (-not (Test-Path $asciidoctor)) {
-          $url = 
"https://rubygems.org/downloads/asciidoctor-$($env:ASCIIDOCTOR_VER).gem"
-          Write-Output "Downloading asciidoctor $env:ASCIIDOCTOR_VER from $url"
-          (New-Object Net.WebClient).DownloadFile($url, $asciidoctor)
-      }
-      gem install --no-document --local $asciidoctor
-
-# This section is a workaround for: 
https://github.com/nanomsg/nanomsg/issues/683
-before_build:
-  - del "C:\Program Files 
(x86)\MSBuild\%VS_VERSION%\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
-
-build:
-  parallel: true
-build_script:
-  - cmd: IF NOT %VS_VERSION% == NONE call "C:/Program Files (x86)/Microsoft 
Visual Studio %VS_VERSION%/Common7/Tools/vsvars32.bat"
-  - cmd: cmake --version
-  - cmd: md build
-  - cmd: cd build
-  - cmd: cmake -G "%GENERATOR%" ..
-  - cmd: cmake --build .
-test_script:
-  - cmd: ctest --output-on-failure -C "%CFG%"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/.github/workflows/darwin.yml 
new/nanomsg-1.2/.github/workflows/darwin.yml
--- old/nanomsg-1.1.5/.github/workflows/darwin.yml      1970-01-01 
01:00:00.000000000 +0100
+++ new/nanomsg-1.2/.github/workflows/darwin.yml        2022-04-19 
01:29:26.000000000 +0200
@@ -0,0 +1,22 @@
+name: darwin
+on: [push, pull_request]
+jobs:
+
+  build:
+    name: build
+    runs-on: [ macos-latest ]
+    steps:
+    - name: Check out code
+      uses: actions/checkout@v1
+
+    - name: Install ninja
+      run: brew install ninja
+
+    - name: Configure
+      run: mkdir build && cd build && cmake -G Ninja ..
+
+    - name: build
+      run: cd build && ninja
+
+    - name: Test
+      run: cd build && ctest --output-on-failure
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/.github/workflows/linux.yml 
new/nanomsg-1.2/.github/workflows/linux.yml
--- old/nanomsg-1.1.5/.github/workflows/linux.yml       1970-01-01 
01:00:00.000000000 +0100
+++ new/nanomsg-1.2/.github/workflows/linux.yml 2022-04-19 01:29:26.000000000 
+0200
@@ -0,0 +1,22 @@
+name: linux
+on: [push, pull_request]
+jobs:
+
+  build:
+    name: build
+    runs-on: [ ubuntu-latest ]
+    steps:
+    - name: Check out code
+      uses: actions/checkout@v1
+
+    - name: Install ninja
+      run: sudo apt-get install ninja-build
+
+    - name: Configure
+      run: mkdir build && cd build && cmake -G Ninja -D NNG_ENABLE_TLS=ON ..
+
+    - name: Build
+      run: cd build && ninja
+
+    - name: Test
+      run: cd build && ctest --output-on-failure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/.github/workflows/windows.yml 
new/nanomsg-1.2/.github/workflows/windows.yml
--- old/nanomsg-1.1.5/.github/workflows/windows.yml     1970-01-01 
01:00:00.000000000 +0100
+++ new/nanomsg-1.2/.github/workflows/windows.yml       2022-04-19 
01:29:26.000000000 +0200
@@ -0,0 +1,22 @@
+name: windows
+on: [push, pull_request]
+jobs:
+
+  build:
+    name: build
+    runs-on: [ windows-latest ]
+    steps:
+    - name: Check out code
+      uses: actions/checkout@v1
+
+    - name: Configure
+      run: cmake -B build
+
+    - name: Build
+      run: cmake --build build
+
+    - name: Test
+      run: |
+        cd build
+        ctest -C Debug --output-on-failure
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/CMakeLists.txt 
new/nanomsg-1.2/CMakeLists.txt
--- old/nanomsg-1.1.5/CMakeLists.txt    2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/CMakeLists.txt      2022-04-19 01:29:26.000000000 +0200
@@ -400,9 +400,9 @@
 
     #  Transport tests.
     add_libnanomsg_test (inproc 5)
-    add_libnanomsg_test (inproc_shutdown 5)
+    add_libnanomsg_test (inproc_shutdown 10)
     add_libnanomsg_test (ipc 5)
-    add_libnanomsg_test (ipc_shutdown 30)
+    add_libnanomsg_test (ipc_shutdown 40)
     add_libnanomsg_test (ipc_stress 5)
     add_libnanomsg_test (tcp 20)
     add_libnanomsg_test (tcp_shutdown 120)
@@ -443,7 +443,7 @@
     add_libnanomsg_test (cmsg 5)
     add_libnanomsg_test (bug328 5)
     add_libnanomsg_test (bug777 5)
-    add_libnanomsg_test (ws_async_shutdown 5)
+    add_libnanomsg_test (ws_async_shutdown 10)
     add_libnanomsg_test (reqttl 10)
     add_libnanomsg_test (surveyttl 10)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/README.md new/nanomsg-1.2/README.md
--- old/nanomsg-1.1.5/README.md 2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/README.md   2022-04-19 01:29:26.000000000 +0200
@@ -3,10 +3,10 @@
 
 
[![Release](https://img.shields.io/github/release/nanomsg/nanomsg.svg)](https://github.com/nanomsg/nanomsg/releases/latest)
 [![MIT 
License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nanomsg/nanomsg/blob/master/COPYING)
-[![Linux 
Status](https://img.shields.io/circleci/project/github/nanomsg/nanomsg/master.svg?label=linux)](https://circleci.com/gh/nanomsg/nanomsg)
-[![Windows 
Status](https://img.shields.io/appveyor/ci/nanomsg/nanomsg/master.svg?label=windows)](https://ci.appveyor.com/project/nanomsg/nanomsg)
-[![Coverage](https://codecov.io/gh/nanomsg/nanomsg/branch/master/graph/badge.svg?label=coverage)](https://codecov.io/gh/nanomsg/nanomsg)
-[![Gitter](https://img.shields.io/badge/gitter-join-brightgreen.svg)](https://gitter.im/nanomsg/nanomsg)
+[![Linux](https://img.shields.io/github/workflow/status/nanomsg/nanomsg/linux?logoColor=grey&logo=linux&label=)](https://github.com/nanomsg/nanomsg/actions/workflows/linux.yml)
+[![Windows](https://img.shields.io/github/workflow/status/nanomsg/nanomsg/windows?logoColor=grey&logo=windows&label=)](https://github.com/nanomsg/nanomsg/actions/workflows/windows.yml)
+[![Darwin](https://img.shields.io/github/workflow/status/nanomsg/nanomsg/darwin?logoColor=grey&logo=apple&label=)](https://github.com/nanomsg/nanomsg/actions/workflows/darwin.yml)
+[![Discord](https://img.shields.io/discord/639573728212156478?label=&logo=discord)](https://discord.com/channels/639573728212156478/639574516812742686)
 
 The nanomsg library is a simple high-performance implementation of several
 "scalability protocols". These scalability protocols are light-weight messaging
@@ -25,18 +25,18 @@
    * Microsoft Visual Studio 2010 (including C++) or newer, or mingw-w64.
      (Specifically mingw and older Microsoft compilers are *NOT supported,
      and we do not test mingw-w64 at all, so YMMV.)
-   * CMake 2.8.7 or newer, available in $PATH as `cmake`
+   * CMake 2.8.12 or newer, available in $PATH as `cmake`
 
 2. POSIX (Linux, MacOS X, UNIX)
    * ANSI C compiler supporting C89
    * POSIX pthreads (should be present on all modern POSIX systems)
    * BSD sockets support for both TCP and UNIX domain sockets
-   * CMake (http://cmake.org) 2.8.7 or newer, available in $PATH as `cmake`
+   * CMake (http://cmake.org) 2.8.12 or newer, available in $PATH as `cmake`
 
 3. Documentation (optional)
    * asciidoctor (http://asciidoctor.org/) available as `asciidoctor`
    * If not present, docs are not formatted, but left in readable ASCII
-   * Also available on-line at http://nanomsg.org/documentation
+   * Available on-line at http://nanomsg.org/documentation
 
 Quick Build Instructions
 ------------------------
@@ -77,6 +77,17 @@
 6.  `cmake --build . --config Debug --target install`
     *NB:* This may have to be done using an Administrator account.
 
+Alternatively, you can build and install nanomsg using 
[vcpkg](https://github.com/microsoft/vcpkg/) dependency manager:
+
+1.  `git clone https://github.com/Microsoft/vcpkg.git`
+2.  `cd vcpkg`
+3.  `./bootstrap-vcpkg.bat`
+4.  `./vcpkg integrate install`
+5.  `./vcpkg install nanomsg`
+
+The nanomsg port in vcpkg is kept up to date by microsoft team members and 
community contributors.
+If the version is out of date, please [create an issue or pull 
request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
+
 Static Library
 --------------
 
@@ -107,25 +118,8 @@
 feature development has ended, and bug fixes are made only when strictly
 necessary for severe issues.
 
-New development is now occuring in the [NNG](https://github.com/nanomsg/nng)
+New development is now occurring in the [NNG](https://github.com/nanomsg/nng)
 project, which offers both protocol and API compatibility with this project.
 Please consider using NNG for new projects.
 
 Please see the file SUPPORT for more details.
-
-Resources
----------
-
-Website: [http://nanomsg.org](http://nanomsg.org)
-
-Source code: 
[https://github.com/nanomsg/nanomsg](http://github.com/nanomsg/nanomsg)
-
-Documentation: 
[http://nanomsg.org/documentation.html](http://nanomsg.org/documentation.html)
-
-Bug tracker: 
[https://github.com/nanomsg/nanomsg/issues](http://github.com/nanomsg/nanomsg/issues)
-
-Mailing list: [nano...@freelists.org](http://www.freelists.org/list/nanomsg)
-
-Gitter Chat: 
[https://gitter.im/nanomsg/nanomsg](https://gitter.im/nanomsg/nanomsg)
-
-IRC chatroom: [#nanomsg at 
irc.freenode.net/8001](http://webchat.freenode.net?channels=%23nanomsg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/doc/nanocat.adoc 
new/nanomsg-1.2/doc/nanocat.adoc
--- old/nanomsg-1.1.5/doc/nanocat.adoc  2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/doc/nanocat.adoc    2022-04-19 01:29:26.000000000 +0200
@@ -162,7 +162,7 @@
 
 Send heartbeats to imaginary monitoring service:
 
-    nanocat --pub --connect tpc://monitoring.example.org -D"I am alive!" 
--interval 10
+    nanocat --pub --connect tcp://monitoring.example.org -D"I am alive!" 
--interval 10
 
 
 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/CMakeLists.txt 
new/nanomsg-1.2/src/CMakeLists.txt
--- old/nanomsg-1.1.5/src/CMakeLists.txt        2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/CMakeLists.txt  2022-04-19 01:29:26.000000000 +0200
@@ -393,7 +393,7 @@
     COMPATIBILITY SameMajorVersion
 )
 configure_package_config_file(
-    ${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in
+    ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in
     ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
     INSTALL_DESTINATION ${PACKAGE_INSTALL_DESTINATION}
     PATH_VARS CMAKE_INSTALL_PREFIX
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/aio/usock_win.inc 
new/nanomsg-1.2/src/aio/usock_win.inc
--- old/nanomsg-1.1.5/src/aio/usock_win.inc     2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/aio/usock_win.inc       2022-04-19 01:29:26.000000000 
+0200
@@ -271,7 +271,7 @@
     int rc;
     BOOL brc;
     DWORD nbytes;
- 
+
     /* NamedPipes have their own accepting mechanism. */
     if (listener->domain == AF_UNIX) {
         nn_usock_accept_pipe (self, listener);
@@ -403,7 +403,7 @@
     memset (&self->out.olpd, 0, sizeof (self->out.olpd));
     if (self->domain == AF_UNIX)
     {
-        /* TODO: Do not copy the buffer, find an efficent way to Write 
+        /* TODO: Do not copy the buffer, find an efficent way to Write
            multiple buffers that doesn't affect the state machine. */
 
         /*  Ensure the total buffer size does not exceed size limitation
@@ -910,6 +910,10 @@
                 return;
             case NN_WORKER_OP_ERROR:
                 if (nn_usock_cancel_io (usock) == 0) {
+                    if (usock->pipesendbuf) {
+                        nn_free(usock->pipesendbuf);
+                        usock->pipesendbuf = NULL;
+                    }
                     nn_fsm_raise(&usock->fsm, &usock->event_error,
                         NN_USOCK_ERROR);
                     nn_usock_close(usock);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/core/poll.c 
new/nanomsg-1.2/src/core/poll.c
--- old/nanomsg-1.1.5/src/core/poll.c   2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/src/core/poll.c     2022-04-19 01:29:26.000000000 +0200
@@ -66,7 +66,7 @@
     tv.tv_sec = timeout / 1000;
     tv.tv_usec = timeout % 1000 * 1000;
     if (nn_fast (nfds)) {
-        rc = select (-1, &fdset, NULL, NULL, &tv);
+        rc = select (-1, &fdset, NULL, NULL, timeout == -1 ? NULL : &tv);
         if (nn_slow (rc == 0))
             return 0;
         if (nn_slow (rc == SOCKET_ERROR)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/core/sock.c 
new/nanomsg-1.2/src/core/sock.c
--- old/nanomsg-1.1.5/src/core/sock.c   2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/src/core/sock.c     2022-04-19 01:29:26.000000000 +0200
@@ -503,6 +503,9 @@
 
     /*  Instantiate the endpoint. */
     ep = nn_alloc (sizeof (struct nn_ep), "endpoint");
+    if (!ep) {
+        return -ENOMEM;
+    }
     rc = nn_ep_init (ep, NN_SOCK_SRC_EP, self, self->eid, transport,
         bind, addr);
     if (nn_slow (rc < 0)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/nn.h new/nanomsg-1.2/src/nn.h
--- old/nanomsg-1.1.5/src/nn.h  2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/src/nn.h    2022-04-19 01:29:26.000000000 +0200
@@ -2,7 +2,7 @@
     Copyright (c) 2012-2014 Martin Sustrik  All rights reserved.
     Copyright (c) 2013 GoPivotal, Inc.  All rights reserved.
     Copyright (c) 2015-2016 Jack R. Dunaway.  All rights reserved.
-    Copyright 2017 Garrett D'Amore <garr...@damore.org>
+    Copyright 2022 Staysail Systems, Inc. <i...@staysail.tech>
 
     Permission is hereby granted, free of charge, to any person obtaining a 
copy
     of this software and associated documentation files (the "Software"),
@@ -57,13 +57,13 @@
 /*  www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html  
*/
 
 /*  The current interface version. */
-#define NN_VERSION_CURRENT 5
+#define NN_VERSION_CURRENT 6
 
 /*  The latest revision of the current interface. */
-#define NN_VERSION_REVISION 1
+#define NN_VERSION_REVISION 0
 
 /*  How many past interface versions are still supported. */
-#define NN_VERSION_AGE 0
+#define NN_VERSION_AGE 1
 
 
/******************************************************************************/
 /*  Errors.                                                                   
*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/ipc/cipc.c 
new/nanomsg-1.2/src/transports/ipc/cipc.c
--- old/nanomsg-1.1.5/src/transports/ipc/cipc.c 2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/transports/ipc/cipc.c   2022-04-19 01:29:26.000000000 
+0200
@@ -315,7 +315,7 @@
 
/******************************************************************************/
 /*  WAITING state.                                                            
*/
 /*  Waiting before re-connection is attempted. This way we won't overload     
*/
-/*  the system by continuous re-connection attemps.                           
*/
+/*  the system by continuous re-connection attempts.                          
*/
 
/******************************************************************************/
     case NN_CIPC_STATE_WAITING:
         switch (src) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/tcp/btcp.c 
new/nanomsg-1.2/src/transports/tcp/btcp.c
--- old/nanomsg-1.1.5/src/transports/tcp/btcp.c 2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/transports/tcp/btcp.c   2022-04-19 01:29:26.000000000 
+0200
@@ -48,7 +48,7 @@
 #endif
 
 /*  The backlog is set relatively high so that there are not too many failed
-    connection attemps during re-connection storms. */
+    connection attempts during re-connection storms. */
 #define NN_BTCP_BACKLOG 100
 
 #define NN_BTCP_STATE_IDLE 1
@@ -113,8 +113,8 @@
 
     /*  Allocate the new endpoint object. */
     self = nn_alloc (sizeof (struct nn_btcp), "btcp");
-    self->ep = ep;
     alloc_assert (self);
+    self->ep = ep;
 
     nn_ep_tran_setup (ep, &nn_btcp_ep_ops, self);
     addr = nn_ep_getaddr (ep);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/tcp/ctcp.c 
new/nanomsg-1.2/src/transports/tcp/ctcp.c
--- old/nanomsg-1.1.5/src/transports/tcp/ctcp.c 2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/transports/tcp/ctcp.c   2022-04-19 01:29:26.000000000 
+0200
@@ -439,7 +439,7 @@
 
/******************************************************************************/
 /*  WAITING state.                                                            
*/
 /*  Waiting before re-connection is attempted. This way we won't overload     
*/
-/*  the system by continuous re-connection attemps.                           
*/
+/*  the system by continuous re-connection attempts.                          
*/
 
/******************************************************************************/
     case NN_CTCP_STATE_WAITING:
         switch (src) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/utils/literal.c 
new/nanomsg-1.2/src/transports/utils/literal.c
--- old/nanomsg-1.1.5/src/transports/utils/literal.c    2018-10-15 
15:50:59.000000000 +0200
+++ new/nanomsg-1.2/src/transports/utils/literal.c      2022-04-19 
01:29:26.000000000 +0200
@@ -1,5 +1,6 @@
 /*
     Copyright (c) 2012-2013 Martin Sustrik  All rights reserved.
+    Copyright 2022 Staysail Systems, Inc.
 
     Permission is hereby granted, free of charge, to any person obtaining a 
copy
     of this software and associated documentation files (the "Software"),
@@ -28,10 +29,31 @@
 #include <string.h>
 
 #ifndef NN_HAVE_WINDOWS
+#include <netdb.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#else
+#include <winsock.h>
 #endif
 
+void nn_literal_link_local_resolve(struct in6_addr *in6addr, int64_t 
*sin6_scope_id, char *addr)
+{
+    if (! IN6_IS_ADDR_LINKLOCAL(in6addr)) {
+        return;
+    }
+    struct addrinfo hints, *res;
+    memset (&hints, 0, sizeof (hints));
+    hints.ai_family = AF_INET6;
+    hints.ai_socktype = 0;
+    hints.ai_flags = AI_NUMERICHOST;
+    int rc = getaddrinfo(addr, NULL, &hints, &res);
+    if (0 == rc && res) {
+        struct sockaddr_in6 * curr = ((struct sockaddr_in6 *) res->ai_addr);
+        // set scope_id
+        *sin6_scope_id = (int64_t) curr->sin6_scope_id;
+    }
+}
+
 int nn_literal_resolve (const char *addr, size_t addrlen,
     int ipv4only, struct sockaddr_storage *result, size_t *resultlen)
 {
@@ -40,6 +62,8 @@
         INET6_ADDRSTRLEN :  INET_ADDRSTRLEN];
     struct in_addr inaddr;
     struct in6_addr in6addr;
+    int64_t sin6_scope_id = -1;
+    char *ifname_dindex = NULL;     // pointer to ifname's delimiter, '%'
 
     /*  Try to treat the address as a literal string. If the size of
         the address is larger than longest possible literal, skip the step.
@@ -61,11 +85,25 @@
 
     /*  Try to interpret the literal as an IPv6 address. */
     if (!ipv4only) {
-        rc = inet_pton (AF_INET6, addrz, &in6addr);
-        if (rc == 1) {
+        // check if '%' exists in addrz (i.e. '$addr%$ifname')
+        ifname_dindex = strstr(addrz, "%");
+        if (NULL == ifname_dindex) {
+            rc = inet_pton (AF_INET6, addrz, &in6addr);
+        } else {
+            // set addrz[index] = '\0', so that inet_pton won't fail
+            *ifname_dindex = '\0';
+            rc = inet_pton (AF_INET6, addrz, &in6addr);
+            // re-add the '%' so we'll be able to get the scope_id for 
link-local IPv6
+            *ifname_dindex = '%';
+        }
+        if (1 == rc) {
             if (result) {
+                nn_literal_link_local_resolve(&in6addr, &sin6_scope_id, addrz);
                 result->ss_family = AF_INET6;
                 ((struct sockaddr_in6*) result)->sin6_addr = in6addr;
+                if (-1 < sin6_scope_id) {
+                    ((struct sockaddr_in6*) result)->sin6_scope_id = 
(uint32_t) sin6_scope_id;
+                }
              }
              if (resultlen)
                 *resultlen = sizeof (struct sockaddr_in6);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/ws/bws.c 
new/nanomsg-1.2/src/transports/ws/bws.c
--- old/nanomsg-1.1.5/src/transports/ws/bws.c   2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/transports/ws/bws.c     2022-04-19 01:29:26.000000000 
+0200
@@ -47,7 +47,7 @@
 #endif
 
 /*  The backlog is set relatively high so that there are not too many failed
-    connection attemps during re-connection storms. */
+    connection attempts during re-connection storms. */
 #define NN_BWS_BACKLOG 100
 
 #define NN_BWS_STATE_IDLE 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/transports/ws/cws.c 
new/nanomsg-1.2/src/transports/ws/cws.c
--- old/nanomsg-1.1.5/src/transports/ws/cws.c   2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/transports/ws/cws.c     2022-04-19 01:29:26.000000000 
+0200
@@ -519,7 +519,7 @@
 
/******************************************************************************/
 /*  WAITING state.                                                            
*/
 /*  Waiting before re-connection is attempted. This way we won't overload     
*/
-/*  the system by continuous re-connection attemps.                           
*/
+/*  the system by continuous re-connection attempts.                          
*/
 
/******************************************************************************/
     case NN_CWS_STATE_WAITING:
         switch (src) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/src/utils/stopwatch.h 
new/nanomsg-1.2/src/utils/stopwatch.h
--- old/nanomsg-1.1.5/src/utils/stopwatch.h     2018-10-15 15:50:59.000000000 
+0200
+++ new/nanomsg-1.2/src/utils/stopwatch.h       2022-04-19 01:29:26.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
     Copyright (c) 2012 Martin Sustrik  All rights reserved.
-    Copyright 2015 Garrett D'Amore <garr...@damore.org>
+    Copyright 2022 Staysail Systems, Inc.
 
     Permission is hereby granted, free of charge, to any person obtaining a 
copy
     of this software and associated documentation files (the "Software"),
@@ -31,12 +31,13 @@
 /*  Check whether measured time is the expected time (in microseconds).
     The upper tolerance is 50ms so that the test doesn't fail even on
     very slow or very loaded systems.  Likewise on some systems we can
-    wind up firing up to a single tick early (Windows), so the lower bound
+    fire up to a single tick early (Windows), so the lower bound
     is pretty low.  The consequence of this is that programs which  specify
-    a timeout should be a little more pessimistic (at least 10ms) then they
+    a timeout should be a little more pessimistic (at least 10ms) than they
     might otherwise think they need to be. */
 #define time_assert(actual,expected) \
-    nn_assert (actual > ((expected) - 10000) && actual < ((expected) + 
50000)); 
+    nn_assert (actual > ((expected) - 10000));                                 
\
+    nn_assert ( actual < ((expected) + 500000));
 
 /*  Measures time interval in microseconds. */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/tests/ipc.c new/nanomsg-1.2/tests/ipc.c
--- old/nanomsg-1.1.5/tests/ipc.c       2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/tests/ipc.c 2022-04-19 01:29:26.000000000 +0200
@@ -81,6 +81,10 @@
     /*  Send something large enough to trigger overlapped I/O on Windows. */
     size = 10000;
     buf = malloc (size);
+    if (!buf){
+        fprintf (stderr, "Out of memory");
+        exit(1);
+    }
     for (i = 0; i < size; ++i) {
         buf[i] = 48 + i % 10;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nanomsg-1.1.5/tools/options.c 
new/nanomsg-1.2/tools/options.c
--- old/nanomsg-1.1.5/tools/options.c   2018-10-15 15:50:59.000000000 +0200
+++ new/nanomsg-1.2/tools/options.c     2022-04-19 01:29:26.000000000 +0200
@@ -454,6 +454,8 @@
         case NN_OPT_LIST_APPEND_FMT:
             data_buf = strlen (argument) + strlen (opt->pointer);
             data = malloc (data_buf);
+            if (!data)
+                nn_memory_error (ctx);            
 #if defined NN_HAVE_WINDOWS
             data_len = _snprintf_s (data, data_buf, _TRUNCATE, opt->pointer,
                 argument);

Reply via email to