diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 3926a9084..a287d4873 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: 'v3.7.0' + ref: 'v3.9.0' path: old - uses: actions/checkout@v4 diff --git a/.github/workflows/clang-analyze.yml b/.github/workflows/clang-analyze.yml index 10de2c285..567e95ae7 100644 --- a/.github/workflows/clang-analyze.yml +++ b/.github/workflows/clang-analyze.yml @@ -23,10 +23,10 @@ jobs: - name: Install clang-tools run: | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - sudo apt-get update && sudo apt-get install -y clang-tools-15 + sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" + sudo apt-get update && sudo apt-get install -y clang-tools-17 - name: analyze run: | - cmake -B build -DCMAKE_C_COMPILER=clang-15 - analyze-build-15 --cdb build/compile_commands.json + cmake -B build -DCMAKE_C_COMPILER=clang-17 + analyze-build-17 --cdb build/compile_commands.json --status-bugs -v diff --git a/CHANGELOG.md b/CHANGELOG.md index e8fc0b66c..0d15fd9fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,27 @@ 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.10.0] - 2024-03-06 + +## What's Changed +* transp: deref qent only if qentp is not set by @maximilianfridrich in https://github.com/baresip/re/pull/1061 +* sipsess: fix doxygen comments by @alfredh in https://github.com/baresip/re/pull/1062 +* aufile: fix doxygen comment by @alfredh in https://github.com/baresip/re/pull/1063 +* ci/codeql: bump action v3 by @sreimers in https://github.com/baresip/re/pull/1064 +* misc: text2pcap helpers (RTP/RTCP capturing) by @sreimers in https://github.com/baresip/re/pull/1065 +* ci/mingw: bump upload/download-artifact and cache versions by @sreimers in https://github.com/baresip/re/pull/1066 +* transp,tls: add TLS client verification by @maximilianfridrich in https://github.com/baresip/re/pull/1059 +* fmt/text2pcap: cleanup by @sreimers in https://github.com/baresip/re/pull/1067 +* ci/android: cache openssl build by @sreimers in https://github.com/baresip/re/pull/1068 +* ci/misc: fix double push/pull runs by @sreimers in https://github.com/baresip/re/pull/1069 +* fmt/text2pcap: fix coverity return value warning by @sreimers in https://github.com/baresip/re/pull/1070 +* sipsess/listen: improve glare handling by @maximilianfridrich in https://github.com/baresip/re/pull/1071 +* conf: add conf_get_i32 by @sreimers in https://github.com/baresip/re/pull/1072 + + +**Full Changelog**: https://github.com/baresip/re/compare/v3.9.0...v3.10.0 + + ## [v3.9.0] - 2024-01-31 ## What's Changed diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f9af1f6e..a2a3d0e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,13 +14,13 @@ cmake_minimum_required(VERSION 3.14) project(re - VERSION 3.9.0 + VERSION 3.10.0 LANGUAGES C HOMEPAGE_URL https://github.com/baresip/re DESCRIPTION "Generic library for real-time communications" ) -set(PROJECT_SOVERSION 21) # bump if ABI breaks +set(PROJECT_SOVERSION 22) # bump if ABI breaks # Pre-release identifier, comment out on a release # Increment for breaking changes (dev2, dev3...) diff --git a/debian/changelog b/debian/changelog index 680bcc80e..bcc86a4ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +libre (3.10.0) unstable; urgency=medium + + * version 3.10.0 + + -- Christian Spielberger Wed, 6 Mar 2024 11:40:00 +0100 + +libre (3.9.0) unstable; urgency=medium + + * version 3.9.0 + + -- Alfred E. Heggestad Wed, 31 Jan 2024 08:29:02 +0100 + libre (3.8.0) unstable; urgency=medium * version 3.8.0 diff --git a/mk/Doxyfile b/mk/Doxyfile index fcca5223e..c946e921c 100644 --- a/mk/Doxyfile +++ b/mk/Doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = libre -PROJECT_NUMBER = 3.9.0 +PROJECT_NUMBER = 3.10.0 OUTPUT_DIRECTORY = ../re-dox CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/src/fmt/time.c b/src/fmt/time.c index 76410c438..20e8c7d50 100644 --- a/src/fmt/time.c +++ b/src/fmt/time.c @@ -148,7 +148,7 @@ int fmt_timestamp_us(struct re_printf *pf, void *arg) int h, m, s; uint64_t us; struct timespec tspec; - struct tm tm; + struct tm tm = {0}; #if defined(WIN32) && !defined(__MINGW32__) timespec_get(&tspec, TIME_UTC); diff --git a/src/main/main.c b/src/main/main.c index 923988341..8e08d7d50 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -72,6 +71,7 @@ struct re_fhs { int flags; /**< Polling flags (Read, Write, etc.) */ fd_h* fh; /**< Event handler */ void* arg; /**< Handler argument */ + struct re_fhs* next; /**< Next element in the delete list */ }; /** Polling loop data */ @@ -82,7 +82,7 @@ struct re { RE_ATOMIC bool polling; /**< Is polling flag */ int sig; /**< Last caught signal */ struct tmrl *tmrl; /**< List of timers */ - struct mbuf *fhsld; /**< fhs delete list */ + struct re_fhs *fhsld; /**< fhs single-linked delete list */ #ifdef HAVE_SELECT struct re_fhs **fhsl; /**< Select fhs pointer list */ #endif @@ -111,18 +111,14 @@ static void poll_close(struct re *re); static void fhsld_flush(struct re *re) { - if (!re->fhsld) - return; - - re->fhsld->pos = 0; + struct re_fhs *fhs = re->fhsld; + re->fhsld = NULL; - while (re->fhsld->pos < re->fhsld->end) { - intptr_t p = mbuf_read_ptr(re->fhsld); - mem_deref((void *)p); + while (fhs) { + struct re_fhs *next = fhs->next; + mem_deref(fhs); + fhs = next; } - - re->fhsld->pos = 0; - re->fhsld->end = 0; } @@ -135,7 +131,6 @@ static void re_destructor(void *arg) mem_deref(re->mutex); mem_deref(re->async); mem_deref(re->tmrl); - mem_deref(re->fhsld); } @@ -163,12 +158,6 @@ int re_alloc(struct re **rep) if (!re) return ENOMEM; - re->fhsld = mbuf_alloc(64 * sizeof(void *)); - if (!re->fhsld) { - err = ENOMEM; - goto out; - } - err = mutex_alloc_tp(&re->mutex, mtx_recursive); if (err) { @@ -722,7 +711,10 @@ struct re_fhs *fd_close(struct re_fhs *fhs) DEBUG_INFO("fd_close: fd=%d\n", fhs->fd); } - mbuf_write_ptr(re->fhsld, (intptr_t)fhs); + re_assert(fhs->next == NULL); + fhs->next = re->fhsld; + re->fhsld = fhs; + --re->nfds; return NULL; @@ -741,6 +733,7 @@ static int fd_poll(struct re *re) const uint64_t to = tmr_next_timeout(re->tmrl); int i, n; int nfds = re->nfds; + int err = 0; struct re_fhs *fhs = NULL; #ifdef HAVE_SELECT fd_set rfds, wfds, efds; @@ -827,11 +820,14 @@ static int fd_poll(struct re *re) default: (void)to; DEBUG_WARNING("no polling method set\n"); - return EINVAL; + err = EINVAL; + goto out; } - if (n < 0) - return RE_ERRNO_SOCK; + if (n < 0) { + err = RE_ERRNO_SOCK; + goto out; + } /* Check for events */ for (i=0; (n > 0) && (i < nfds); i++) { @@ -908,7 +904,8 @@ static int fd_poll(struct re *re) #endif default: - return EINVAL; + err = EINVAL; + goto out; } if (!flags) @@ -926,10 +923,11 @@ static int fd_poll(struct re *re) --n; } + out: /* Delayed fhs deref to avoid dangling fhs pointers */ fhsld_flush(re); - return 0; + return err; } diff --git a/src/sip/transp.c b/src/sip/transp.c index eb6062fd6..e62e9f18d 100644 --- a/src/sip/transp.c +++ b/src/sip/transp.c @@ -945,6 +945,8 @@ static void websock_recv_handler(const struct websock_hdr *hdr, if (mb->end <= 4) return; + tmr_start(&conn->tmr, TCP_IDLE_TIMEOUT * 1000, conn_tmr_handler, conn); + start = mb->pos; err = sip_msg_decode(&msg, mb); diff --git a/test/httpauth.c b/test/httpauth.c index 950b7c64e..322dc0b13 100644 --- a/test/httpauth.c +++ b/test/httpauth.c @@ -651,13 +651,13 @@ int test_httpauth_digest_response(void) goto out; } - mb_printed = mem_deref (mb_printed); - resp = mem_deref(resp); + mem_deref(mb_printed); + mem_deref(resp); continue; out: - mb_printed = mem_deref (mb_printed); - resp = mem_deref(resp); + mem_deref(mb_printed); + mem_deref(resp); break; } diff --git a/test/sipsess.c b/test/sipsess.c index 0fd63f035..f9cd05b85 100644 --- a/test/sipsess.c +++ b/test/sipsess.c @@ -203,7 +203,7 @@ static int make_sdp(struct mbuf **mbp, const char *sdp) static void send_update_a(void *arg) { struct test *test = arg; - struct mbuf *desc; + struct mbuf *desc = NULL; int err; err = make_sdp(&desc, sdp_a); @@ -223,7 +223,7 @@ static void send_update_a(void *arg) static void send_update_b(void *arg) { struct test *test = arg; - struct mbuf *desc; + struct mbuf *desc = NULL; int err; err = make_sdp(&desc, sdp_b); @@ -433,7 +433,7 @@ static void close_handler(int err, const struct sip_msg *msg, void *arg) static void conn_handler(const struct sip_msg *msg, void *arg) { struct test *test = arg; - struct mbuf *desc; + struct mbuf *desc = NULL; int err; char *hdrs = test->rel100_b == REL100_REQUIRED ? "Require: 100rel\r\n" : "";