Skip to content

Commit

Permalink
Merge branch 'main' into coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Sep 18, 2023
2 parents e41598f + 863fb69 commit 498c648
Show file tree
Hide file tree
Showing 28 changed files with 589 additions and 370 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/abi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: 'v3.4.0'
ref: 'v3.5.0'
path: old

- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:

strategy:
matrix:
build_type: [Release, Debug]
compiler: [gcc, clang]
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
exclude:
Expand Down Expand Up @@ -56,7 +57,8 @@ jobs:
- name: cmake
run: |
cmake -B build -Werror -DCMAKE_C_FLAGS="-Werror" && cmake --build build -t retest
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -Werror -DCMAKE_C_FLAGS="-Werror"
cmake --build build -t retest
- name: retest
run: |
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,68 @@ All notable changes to libre will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v3.5.1] - 2023-09-12

## What's Changed
* cmake: fix RELEASE definition for older cmake releases by @sreimers in https://github.com/baresip/re/pull/953
* ci/build: add release build check by @sreimers in https://github.com/baresip/re/pull/954
* cmake: fix definitions for older cmake by @sreimers in https://github.com/baresip/re/pull/955

**Full Changelog**: https://github.com/baresip/re/compare/v3.5.0...v3.5.1

## [v3.5.0] - 2023-09-12

## What's Changed
* ci/sonar: update scanner and java version by @sreimers in https://github.com/baresip/re/pull/895
* ci/sonar: fix java distribution by @sreimers in https://github.com/baresip/re/pull/897
* udp: add doxygen comments by @alfredh in https://github.com/baresip/re/pull/896
* tls: fix some doxygen warnings by @alfredh in https://github.com/baresip/re/pull/894
* mk: add release target by @sreimers in https://github.com/baresip/re/pull/901
* types: add re_assert and re_assert_se definition by @sreimers in https://github.com/baresip/re/pull/900
* btrace improvements by @sreimers in https://github.com/baresip/re/pull/902
* Safe RE_VA_ARG helpers by @sreimers in https://github.com/baresip/re/pull/758
* mbuf: add safe mbuf_printf by @sreimers in https://github.com/baresip/re/pull/899
* auth: cast time_t timestamp by @sreimers in https://github.com/baresip/re/pull/903
* mbuf: add mbuf_write_ptr and mbuf_read_ptr by @sreimers in https://github.com/baresip/re/pull/898
* ci/mingw: remove cmake workaround by @sreimers in https://github.com/baresip/re/pull/906
* tls: assume OpenSSL version 1.1.1 or later by @alfredh in https://github.com/baresip/re/pull/907
* cmake: cleanup, remove unused define USE_OPENSSL_DTLS by @alfredh in https://github.com/baresip/re/pull/908
* test/turn: use mutex instead atomic by @sreimers in https://github.com/baresip/re/pull/909
* stun: remove unused struct members by @alfredh in https://github.com/baresip/re/pull/910
* stun: complete doxygen for struct by @alfredh in https://github.com/baresip/re/pull/912
* tcp,udp: full IPv6 dual-stack socket support by @sreimers in https://github.com/baresip/re/pull/911
* aufile: add methods to get size in bytes/length in ms by @larsimmisch in https://github.com/baresip/re/pull/913
* async: signal ESHUTDOWN to all open worker callbacks by @sreimers in https://github.com/baresip/re/pull/915
* dns/client: fix async getaddr query abort (not thread safe) by @sreimers in https://github.com/baresip/re/pull/914
* async,dns/client: replace ESHUTDOWN with ECANCELED and optimize err handling by @sreimers in https://github.com/baresip/re/pull/918
* sip: remove unused local variable by @cspiel1 in https://github.com/baresip/re/pull/920
* dns/client: optimize udp timeout by @sreimers in https://github.com/baresip/re/pull/916
* ice: add candidate sdp mdns support by @sreimers in https://github.com/baresip/re/pull/917
* ice/icesdp: fix freeaddrinfo by @sreimers in https://github.com/baresip/re/pull/923
* retest: fix format string in test_listcases for size_t argument by @cHuberCoffee in https://github.com/baresip/re/pull/922
* httpauth: http digest challenge request using RFC 7616 by @cHuberCoffee in https://github.com/baresip/re/pull/919
* types: fix RE_ARG_SIZE default argument promotions by @sreimers in https://github.com/baresip/re/pull/924
* sip: fix TCP source port by @cspiel1 in https://github.com/baresip/re/pull/921
* fmt/print: add 64-bit length modifier %Li, %Ld and %Lu by @sreimers in https://github.com/baresip/re/pull/905
* fmt/print: improve print RE_VA_ARG debugging by @sreimers in https://github.com/baresip/re/pull/925
* sip/request: fix check return code (found by coverity) by @sreimers in https://github.com/baresip/re/pull/926
* httpauth/digest: use %L instead of PRI*64 macros by @sreimers in https://github.com/baresip/re/pull/927
* types: add RE_ARG_SIZE struct pl (avoids wrong print fmt %r usage) by @sreimers in https://github.com/baresip/re/pull/928
* dns/client: fix getaddrinfo err handling and mem_ref dnsc by @sreimers in https://github.com/baresip/re/pull/929
* rtp/rtp_debug: fix printf size format by @sreimers in https://github.com/baresip/re/pull/933
* main: optimize re_lock and re_unlock by @alfredh in https://github.com/baresip/re/pull/935
* hexdump: fix format and add test by @alfredh in https://github.com/baresip/re/pull/936
* test: fix bug in performance test format by @alfredh in https://github.com/baresip/re/pull/937
* types: remove some duplicated error codes by @alfredh in https://github.com/baresip/re/pull/939
* test: minor improvements in remain test by @alfredh in https://github.com/baresip/re/pull/931
* dbg: remove unused functions by @sreimers in https://github.com/baresip/re/pull/941
* cmake/re-config: add default CMAKE_BUILD_TYPE and fix RELEASE definition by @sreimers in https://github.com/baresip/re/pull/945

## New Contributors
* @larsimmisch made their first contribution in https://github.com/baresip/re/pull/913

**Full Changelog**: https://github.com/baresip/re/compare/v3.4.0...v3.5.0

## [v3.4.0] - 2023-08-09

## What's Changed
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
cmake_minimum_required(VERSION 3.13)

project(re
VERSION 3.4.0
VERSION 3.5.1
LANGUAGES C
HOMEPAGE_URL https://github.com/baresip/re
DESCRIPTION "Generic library for real-time communications"
)

set(PROJECT_SOVERSION 16) # bump if ABI breaks
set(PROJECT_SOVERSION 17) # bump if ABI breaks

# Pre-release identifier, comment out on a release
# Increment for breaking changes (dev2, dev3...)
Expand Down
104 changes: 55 additions & 49 deletions cmake/re-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,34 @@ option(USE_OPENSSL "Enable OpenSSL" ${OPENSSL_FOUND})
option(USE_UNIXSOCK "Enable Unix Domain Sockets" ON)
option(USE_TRACE "Enable Tracing helpers" OFF)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build."
FORCE)
endif()

check_symbol_exists("arc4random" "stdlib.h" HAVE_ARC4RANDOM)
if(HAVE_ARC4RANDOM)
list(APPEND RE_DEFINITIONS -DHAVE_ARC4RANDOM)
list(APPEND RE_DEFINITIONS HAVE_ARC4RANDOM)
endif()

if(ZLIB_FOUND)
list(APPEND RE_DEFINITIONS -DUSE_ZLIB)
list(APPEND RE_DEFINITIONS USE_ZLIB)
endif()

check_include_file(syslog.h HAVE_SYSLOG_H)
if(HAVE_SYSLOG_H)
list(APPEND RE_DEFINITIONS -DHAVE_SYSLOG)
list(APPEND RE_DEFINITIONS HAVE_SYSLOG)
endif()

check_include_file(getopt.h HAVE_GETOPT_H)
if(HAVE_GETOPT_H)
list(APPEND RE_DEFINITIONS -DHAVE_GETOPT)
list(APPEND RE_DEFINITIONS HAVE_GETOPT)
endif()

check_include_file(unistd.h HAVE_UNISTD_H)
if(HAVE_UNISTD_H)
list(APPEND RE_DEFINITIONS -DHAVE_UNISTD_H)
list(APPEND RE_DEFINITIONS HAVE_UNISTD_H)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
Expand All @@ -49,140 +55,140 @@ else()
endif()
if(HAVE_RESOLV)
set(RESOLV_LIBRARY resolv)
list(APPEND RE_DEFINITIONS -DHAVE_RESOLV)
list(APPEND RE_DEFINITIONS HAVE_RESOLV)
else()
set(RESOLV_LIBRARY)
endif()

if(Backtrace_FOUND)
list(APPEND RE_DEFINITIONS -DHAVE_EXECINFO)
list(APPEND RE_DEFINITIONS HAVE_EXECINFO)
else()
set(Backtrace_LIBRARIES)
endif()

check_function_exists(thrd_create HAVE_THREADS)
if(HAVE_THREADS)
list(APPEND RE_DEFINITIONS -DHAVE_THREADS)
list(APPEND RE_DEFINITIONS HAVE_THREADS)
endif()

check_function_exists(accept4 HAVE_ACCEPT4)
if(HAVE_ACCEPT4)
list(APPEND RE_DEFINITIONS -DHAVE_ACCEPT4)
list(APPEND RE_DEFINITIONS HAVE_ACCEPT4)
endif()

if(CMAKE_USE_PTHREADS_INIT)
list(APPEND RE_DEFINITIONS -DHAVE_PTHREAD)
list(APPEND RE_DEFINITIONS HAVE_PTHREAD)
set(HAVE_PTHREAD ON)
endif()

if(UNIX)
check_symbol_exists(epoll_create "sys/epoll.h" HAVE_EPOLL)
if(HAVE_EPOLL)
list(APPEND RE_DEFINITIONS -DHAVE_EPOLL)
list(APPEND RE_DEFINITIONS HAVE_EPOLL)
endif()
check_symbol_exists(kqueue "sys/types.h;sys/event.h" HAVE_KQUEUE)
if(HAVE_KQUEUE)
list(APPEND RE_DEFINITIONS -DHAVE_KQUEUE)
list(APPEND RE_DEFINITIONS HAVE_KQUEUE)
endif()
endif()

check_include_file(sys/prctl.h HAVE_PRCTL)
if(HAVE_PRCTL)
list(APPEND RE_DEFINITIONS -DHAVE_PRCTL)
list(APPEND RE_DEFINITIONS HAVE_PRCTL)
endif()


list(APPEND RE_DEFINITIONS
-DHAVE_ATOMIC
-DHAVE_INET6
-DHAVE_SELECT
HAVE_ATOMIC
HAVE_INET6
HAVE_SELECT
)

if(UNIX)
list(APPEND RE_DEFINITIONS
-DHAVE_PWD_H
-DHAVE_ROUTE_LIST
-DHAVE_SETRLIMIT
-DHAVE_STRERROR_R
-DHAVE_STRINGS_H
-DHAVE_SYS_TIME_H
-DHAVE_UNAME
-DHAVE_SELECT_H
-DHAVE_SIGNAL
-DHAVE_FORK
HAVE_PWD_H
HAVE_ROUTE_LIST
HAVE_SETRLIMIT
HAVE_STRERROR_R
HAVE_STRINGS_H
HAVE_SYS_TIME_H
HAVE_UNAME
HAVE_SELECT_H
HAVE_SIGNAL
HAVE_FORK
)
if(NOT ANDROID)
list(APPEND RE_DEFINITIONS -DHAVE_GETIFADDRS)
list(APPEND RE_DEFINITIONS HAVE_GETIFADDRS)
endif()
endif()


if(MSVC)
list(APPEND RE_DEFINITIONS
-DHAVE_IO_H
-D_CRT_SECURE_NO_WARNINGS
HAVE_IO_H
_CRT_SECURE_NO_WARNINGS
)
endif()

if(WIN32)
list(APPEND RE_DEFINITIONS
-DWIN32 -D_WIN32_WINNT=0x0600
WIN32
_WIN32_WINNT=0x0600
)
endif()

if(USE_OPENSSL)
list(APPEND RE_DEFINITIONS
-DUSE_DTLS
-DUSE_OPENSSL
-DUSE_OPENSSL_AES
-DUSE_OPENSSL_HMAC
-DUSE_OPENSSL_SRTP
-DUSE_TLS
USE_DTLS
USE_OPENSSL
USE_OPENSSL_AES
USE_OPENSSL_HMAC
USE_OPENSSL_SRTP
USE_TLS
)
endif()

if(USE_MBEDTLS)
list(APPEND RE_DEFINITIONS
-DUSE_MBEDTLS
USE_MBEDTLS
)
endif()

if(USE_UNIXSOCK)
list(APPEND RE_DEFINITIONS
-DHAVE_UNIXSOCK=1
HAVE_UNIXSOCK=1
)
else()
list(APPEND RE_DEFINITIONS
-DHAVE_UNIXSOCK=0
HAVE_UNIXSOCK=0
)
endif()

if(USE_TRACE)
list(APPEND RE_DEFINITIONS
-DRE_TRACE_ENABLED
RE_TRACE_ENABLED
)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND RE_DEFINITIONS -DDARWIN)
list(APPEND RE_DEFINITIONS DARWIN)
include_directories(/opt/local/include)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
list(APPEND RE_DEFINITIONS -DFREEBSD)
list(APPEND RE_DEFINITIONS FREEBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
list(APPEND RE_DEFINITIONS -DOPENBSD)
list(APPEND RE_DEFINITIONS OPENBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND RE_DEFINITIONS -DLINUX)
list(APPEND RE_DEFINITIONS LINUX)
endif()


list(APPEND RE_DEFINITIONS
-DARCH="${CMAKE_SYSTEM_PROCESSOR}"
-DOS="${CMAKE_SYSTEM_NAME}"
ARCH="${CMAKE_SYSTEM_PROCESSOR}"
OS="${CMAKE_SYSTEM_NAME}"
$<$<NOT:$<CONFIG:DEBUG>>:RELEASE>
)

if(${CMAKE_BUILD_TYPE} MATCHES "[Rr]el")
list(APPEND RE_DEFINITIONS -DRELEASE)
else()
if(NOT ${CMAKE_BUILD_TYPE} MATCHES "[Rr]el")
if(Backtrace_FOUND)
set(CMAKE_ENABLE_EXPORTS ON)
endif()
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
libre (3.5.1) unstable; urgency=medium

* version 3.5.1

-- Sebastian Reimers <[email protected]> Tue, 12 Sep 2023 14:00:00 +0200

libre (3.5.0) unstable; urgency=medium

* version 3.5.0

-- Sebastian Reimers <[email protected]> Tue, 12 Sep 2023 08:00:00 +0200

libre (3.4.0) unstable; urgency=medium

* version 3.4.0
Expand Down
4 changes: 0 additions & 4 deletions include/re_dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ void dbg_close(void);
int dbg_logfile_set(const char *name);
void dbg_handler_set(dbg_print_h *ph, void *arg);
void dbg_printf(int level, const char *fmt, ...);
void dbg_noprintf(const char *fmt, ...);
void dbg_warning(const char *fmt, ...);
void dbg_notice(const char *fmt, ...);
void dbg_info(const char *fmt, ...);
const char *dbg_level_str(int level);

#ifdef __cplusplus
Expand Down
7 changes: 4 additions & 3 deletions include/re_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "re_async.h"

struct re;
struct re_fhs;

enum {
#ifndef FD_READ
Expand Down Expand Up @@ -35,10 +36,10 @@ typedef void (fd_h)(int flags, void *arg);
typedef void (re_signal_h)(int sig);


int fd_listen(re_sock_t fd, int flags, fd_h *fh, void *arg);
void fd_close(re_sock_t fd);
int fd_listen(struct re_fhs **fhs, re_sock_t fd, int flags, fd_h *fh,
void *arg);
struct re_fhs *fd_close(struct re_fhs *fhs);
int fd_setsize(int maxfds);
void fd_debug(void);

int libre_init(void);
void libre_close(void);
Expand Down
Loading

0 comments on commit 498c648

Please sign in to comment.