Skip to content

Automated Pull Request #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cfde494
Add missing openssl SECLEVEL=0 support (#3890)
naf419 Mar 19, 2024
a7c4d83
Enable Late Offer Answer Mode (LOAM) feature in the pjsua (#3869)
goodicus Mar 21, 2024
ca4b078
Fix warnings for 32-bit compiler and misc fixes. (#3896)
amubiera Mar 25, 2024
427a2b3
Add some missing unlocks (#3893)
xhit Mar 26, 2024
c0de1a4
Prevent race condition in DTLS media stop (#3901)
sauwming Mar 26, 2024
478aeb9
Fix data race reported by ThreadSanitizer in caching pool (#3897)
nanangizz Mar 26, 2024
51e5206
Fixed Metal renderer memory leak (#3909)
sauwming Mar 29, 2024
86b7dd4
Fixed DTLS clock stoppage race (#3905)
sauwming Apr 1, 2024
e7e7f28
Improve IP address change IPv4 <-> IPv6 (#3910)
sauwming Apr 3, 2024
ca37acc
Merge branch 'pjsip:master' into master
dshamaev-intermedia Apr 4, 2024
6d114d7
pjsua_acc: Fix warnings for comparison between ‘pjsua_nat64_opt’ and …
amubiera Apr 5, 2024
12d0468
Fix to ext_fmts accessed out of stack scope. (#3916)
amubiera Apr 15, 2024
898dacd
Merge upstream/master into master
Apr 15, 2024
72d885d
Add check in siprtp sample app for inactive audio media (#3927)
sauwming Apr 17, 2024
c5bc3d1
Add function to initialize MediaFormat audio & video (#3925)
sauwming Apr 17, 2024
0d2ebdc
Fixed incorrect SDP buffer length calculation (#3924)
sauwming Apr 17, 2024
8c81f32
Merge upstream/master into master
Apr 21, 2024
472bda5
Support Push Notification in iOS sample app (#3913)
sauwming Apr 23, 2024
4f3df90
Fixed PJSUA2 API to get/set Opus config (#3935)
sauwming Apr 23, 2024
88da88e
Merge upstream/master into master
Apr 28, 2024
f38d781
Fix bad address length check in pj_ioqueue_sendto(). (#3941)
nanangizz Apr 29, 2024
f0bde0f
Merge upstream/master into master
Apr 30, 2024
f406002
Fix warning of uninitialized value in fuzz-crypto (#3946)
sauwming May 7, 2024
ca2dacf
Print log on successful send (#3942)
nanangizz May 7, 2024
24ac587
Fixed CI Mac build failure (#3947)
sauwming May 7, 2024
30829f0
Update Android JNI audio dev to use 16bit PCM only (#3945)
nanangizz May 8, 2024
1dab9b6
Add TLS/SSL backend: Windows Schannel (#3867)
nanangizz May 8, 2024
7394b1e
pjsip_find_msg: Log warning if Content-Length field not found (#3960)
pespin May 20, 2024
a250942
Fix audiodev index (#3962)
trengginas May 20, 2024
2e8f361
Fix assertion on call hangup from DTMF callback (#3970)
nanangizz May 27, 2024
13741d9
Fix yaml error in github feature template (#3972)
peldszus May 27, 2024
c715e2e
Fix version string in Python setup (#3976)
sauwming May 29, 2024
2d5e351
Prevent pjmedia_codec_param.info.enc_ptime_denum division by zero in …
sauwming May 29, 2024
471e6a1
Merge upstream/master into master
Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ body:
id: alt-solution
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've
considered.
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: context
attributes:
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 opencore-amr swig sipp
run: brew install openssl opencore-amr swig sipp
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-g -fPIC" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb) -fPIC" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" CXXFLAGS="-g -fPIC" ./configure
- name: make
run: make
- name: set up Python
Expand All @@ -47,11 +47,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 opencore-amr
run: brew install openssl opencore-amr
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb)" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" ./configure
- name: make
run: make
- name: disable firewall
Expand All @@ -65,11 +65,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 opencore-amr
run: brew install openssl opencore-amr
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb)" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" ./configure
- name: make
run: make
- name: disable firewall
Expand All @@ -86,9 +86,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 swig
run: brew install openssl swig
- name: configure
run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure
run: CFLAGS="$(pkg-config --cflags openssl) -fPIC" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib" CXXFLAGS="-fPIC" ./configure
- name: make
run: make
- name: set up Python
Expand Down Expand Up @@ -123,11 +123,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 openh264 libvpx opencore-amr swig sipp
run: brew install openssl openh264 libvpx opencore-amr swig sipp
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -DHAS_VID_CODEC_TEST=0 -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-g -fPIC" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb) -DHAS_VID_CODEC_TEST=0 -fPIC" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" CXXFLAGS="-g -fPIC" ./configure
- name: make
run: make
- name: set up Python
Expand All @@ -147,11 +147,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 openh264 libvpx opencore-amr
run: brew install openssl openh264 libvpx opencore-amr
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb)" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" ./configure
- name: make
run: make
- name: disable firewall
Expand All @@ -165,11 +165,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 openh264 libvpx opencore-amr
run: brew install openssl openh264 libvpx opencore-amr
- name: config site
run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h
- name: configure
run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure
run: CFLAGS="-g $(pkg-config --cflags openssl) $(pkg-config --cflags opencore-amrnb)" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib $(pkg-config --libs-only-L opencore-amrnb)" ./configure
- name: make
run: make
- name: disable firewall
Expand All @@ -183,17 +183,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 x264 libvpx nasm swig
run: brew install openssl x264 libvpx nasm swig
- name: get ffmpeg
run: git clone --single-branch --branch release/4.2 https://github.com/FFmpeg/FFmpeg.git
run: git clone --single-branch --branch release/7.0 https://github.com/FFmpeg/FFmpeg.git
- name: configure ffmpeg
run: cd FFmpeg && ./configure --enable-shared --disable-static --enable-gpl --enable-libx264
run: cd FFmpeg && LDFLAGS="-Wl,-ld_classic" ./configure --enable-shared --disable-static --enable-gpl --enable-libx264
- name: build ffmpeg
run: cd FFmpeg && make -j10 && sudo make install
- name: config site
run: echo -e "#define PJMEDIA_HAS_VIDEO 1\n" > pjlib/include/pj/config_site.h
- name: configure
run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure
run: CFLAGS="$(pkg-config --cflags openssl) -fPIC" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib" CXXFLAGS="-fPIC" ./configure
- name: make
run: make
- name: set up Python
Expand All @@ -209,11 +209,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: brew install openssl@1.1 libvpx swig
run: brew install openssl libvpx swig
- name: config site
run: echo -e "#define PJMEDIA_HAS_VIDEO 1\n#define PJMEDIA_HAS_VID_TOOLBOX_CODEC 1\n" > pjlib/include/pj/config_site.h
- name: configure
run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure
run: CFLAGS="$(pkg-config --cflags openssl) -fPIC" LDFLAGS="$(pkg-config --libs-only-L openssl) $(pkg-config --libs-only-L openssl)/lib" CXXFLAGS="-fPIC" ./configure
- name: make
run: make
- name: set up Python
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,10 @@ jobs:
msbuild pjproject-vs14.sln /p:PlatformToolset=v143 /p:Configuration=Release /p:Platform=win32 /p:UseEnv=true
shell: cmd

windows-with-video-libvpx-unit-test-1:
windows-with-video-libvpx-schannel-unit-test-1:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: get openssl
run: Invoke-WebRequest -Uri "https://github.com/pjsip/third_party_libs/raw/main/openssl-1.1.1s-win.zip" -OutFile ".\openssl.zip"
shell: powershell
- name: expand openssl
run: |
Expand-Archive -LiteralPath .\openssl.zip -DestinationPath .; pwd
cd openssl_build
Add-Content ..\openssl_dir.txt $pwd.Path
shell: powershell
- name: check openssl folder
run: |
set /P OPENSSL_DIR=<openssl_dir.txt
dir "%OPENSSL_DIR%\include"
dir "%OPENSSL_DIR%\lib"
shell: cmd
- name: get vpx
run: Invoke-WebRequest -Uri "https://github.com/pjsip/third_party_libs/raw/main/vpx-1.12-win.zip" -Outfile "vpx.zip"
shell: powershell
Expand Down Expand Up @@ -231,6 +216,8 @@ jobs:
run: |
cd pjlib/include/pj; cp config_site_test.h config_site.h
Add-Content config_site.h "#define PJ_HAS_SSL_SOCK 1"
Add-Content config_site.h "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_SCHANNEL"
Add-Content config_site.h "#undef PJMEDIA_SRTP_HAS_DTLS"
Add-Content config_site.h "#define PJMEDIA_HAS_VIDEO 1"
Add-Content config_site.h "#define PJMEDIA_VIDEO_DEV_HAS_DSHOW 1"
Add-Content config_site.h "#define PJMEDIA_HAS_LIBYUV 1"
Expand Down Expand Up @@ -258,7 +245,7 @@ jobs:
set /P SDL_DIR=<sdl_dir.txt
cd tests/pjsua/tools
set INCLUDE=%INCLUDE%;%OPENSSL_DIR%\include;%VPX_DIR%\include;%SDL_DIR%\include
set LIB=%LIB%;%OPENSSL_DIR%\lib;%VPX_DIR%\lib;%SDL_DIR%\lib\x86
set LIB=%LIB%;%VPX_DIR%\lib;%SDL_DIR%\lib\x86
call "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
msbuild cmp_wav.vcxproj /p:PlatformToolset=v143 /p:Configuration=Release /p:Platform=win32 /p:UseEnv=true
shell: cmd
Expand All @@ -268,9 +255,8 @@ jobs:
python-version: '3.10'
- name: unit tests
run: |
$env:OPENSSL_DIR = Get-Content .\openssl_dir.txt
$env:SDL_DIR = Get-Content .\sdl_dir.txt
$env:PATH+=";$env:OPENSSL_DIR\bin;$env:SDL_DIR\lib\x86;"
$env:PATH+=";$env:SDL_DIR\lib\x86;"
cd tests/pjsua; python runall.py
cd ../../pjlib/bin; ./pjlib-test-i386-Win32-vc14-Release.exe --ci-mode
cd ../../pjlib-util/bin; ./pjlib-util-test-i386-Win32-vc14-Release.exe
Expand Down
8 changes: 4 additions & 4 deletions pjlib-util/src/pjlib-util/resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,15 +1840,15 @@ PJ_DEF(pj_status_t) pj_dns_resolver_add_entry( pj_dns_resolver *resolver,
pj_bzero(&key, sizeof(struct res_key));
if (pkt->hdr.anscount) {
/* Make sure name is not too long. */
PJ_ASSERT_RETURN(pkt->ans[0].name.slen < PJ_MAX_HOSTNAME,
PJ_ENAMETOOLONG);
PJ_ASSERT_ON_FAIL(pkt->ans[0].name.slen < PJ_MAX_HOSTNAME,
{ pj_grp_lock_release(resolver->grp_lock); return PJ_ENAMETOOLONG; });

init_res_key(&key, pkt->ans[0].type, &pkt->ans[0].name);

} else {
/* Make sure name is not too long. */
PJ_ASSERT_RETURN(pkt->q[0].name.slen < PJ_MAX_HOSTNAME,
PJ_ENAMETOOLONG);
PJ_ASSERT_ON_FAIL(pkt->q[0].name.slen < PJ_MAX_HOSTNAME,
{ pj_grp_lock_release(resolver->grp_lock); return PJ_ENAMETOOLONG; });

init_res_key(&key, pkt->q[0].type, &pkt->q[0].name);
}
Expand Down
3 changes: 2 additions & 1 deletion pjlib/build/pjlib.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-Dynamic|ARM">
Expand Down Expand Up @@ -998,6 +998,7 @@
</ClCompile>
<ClCompile Include="..\src\pj\ssl_sock_ossl.c" />
<ClCompile Include="..\src\pj\ssl_sock_gtls.c" />
<ClCompile Include="..\src\pj\ssl_sock_schannel.c" />
<ClCompile Include="..\src\pj\string.c" />
<ClCompile Include="..\src\pj\symbols.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild>
Expand Down
3 changes: 3 additions & 0 deletions pjlib/include/pj/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,9 @@
/** Using Apple's Network framework */
#define PJ_SSL_SOCK_IMP_APPLE 4

/** Using Windows's Schannel */
#define PJ_SSL_SOCK_IMP_SCHANNEL 5

/**
* Select which SSL socket implementation to use. Currently pjlib supports
* PJ_SSL_SOCK_IMP_OPENSSL, which uses OpenSSL, and PJ_SSL_SOCK_IMP_GNUTLS,
Expand Down
4 changes: 4 additions & 0 deletions pjlib/include/pj/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,16 @@ struct pj_caching_pool

/**
* Total size of memory currently used by application.
*
* This field is deprecated.
*/
pj_size_t used_size;

/**
* The maximum size of memory used by application throughout the life
* of the caching pool.
*
* This field is deprecated.
*/
pj_size_t peak_used_size;

Expand Down
82 changes: 82 additions & 0 deletions pjlib/include/pj/ssl_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ typedef enum pj_ssl_cert_verify_flag_t
*/
PJ_SSL_CERT_ECHAIN_TOO_LONG = (1 << 8),

/**
* The certificate signature is created using a weak hashing algorithm.
*/
PJ_SSL_CERT_EWEAK_SIGNATURE = (1 << 9),

/**
* The server identity does not match to any identities specified in
* the certificate, e.g: subjectAltName extension, subject common name.
Expand Down Expand Up @@ -145,6 +150,59 @@ typedef enum pj_ssl_cert_name_type
PJ_SSL_CERT_NAME_IP
} pj_ssl_cert_name_type;

/**
* Field type for looking up SSL certificate in the certificate stores.
*/
typedef enum pj_ssl_cert_lookup_type
{
/**
* No certificate to be looked up.
*/
PJ_SSL_CERT_LOOKUP_NONE,

/**
* Lookup by subject, this will lookup any first certificate whose
* subject containing the specified keyword. Note that subject may not
* be unique in the store, so the lookup may end up selecting a wrong
* certificate.
*/
PJ_SSL_CERT_LOOKUP_SUBJECT,

/**
* Lookup by fingerprint/thumbprint (SHA1 hash), this will lookup
* any first certificate whose fingerprint matching the specified
* keyword. The keyword is an array of hash octets.
*/
PJ_SSL_CERT_LOOKUP_FINGERPRINT,

/**
* Lookup by friendly name, this will lookup any first certificate
* whose friendly name containing the specified keyword. Note that
* friendly name may not be unique in the store, so the lookup may end up
* selecting a wrong certificate.
*/
PJ_SSL_CERT_LOOKUP_FRIENDLY_NAME

} pj_ssl_cert_lookup_type;

/**
* Describe structure of certificate lookup criteria.
*/
typedef struct pj_ssl_cert_lookup_criteria
{
/**
* Certificate field type to look.
*/
pj_ssl_cert_lookup_type type;

/*
* Keyword to match on the field specified in \a type.
*/
pj_str_t keyword;

} pj_ssl_cert_lookup_criteria;


/**
* Describe structure of certificate info.
*/
Expand Down Expand Up @@ -273,6 +331,30 @@ PJ_DECL(pj_status_t) pj_ssl_cert_load_from_buffer(pj_pool_t *pool,
const pj_str_t *privkey_pass,
pj_ssl_cert_t **p_cert);

/**
* Create credential from OS certificate store, this function will lookup
* certificate using the specified criterias.
*
* Currently this is used by Windows Schannel backend only, it will lookup
* in the Current User store first, if no certificate with the specified
* criteria is not found, it will lookup in the Local Machine store.
*
* Note that for manual verification (e.g: when pj_ssl_sock_param.verify_peer
* is disabled), the backend will provide pre-verification result against
* trusted CA certificates in Current User store only (will not check CA
* certificates in the Local Machine store).
*
* @param pool The pool.
* @param criteria The lookup criteria.
* @param p_cert Pointer to credential instance to be created.
*
* @return PJ_SUCCESS when successful.
*/
PJ_DECL(pj_status_t) pj_ssl_cert_load_from_store(
pj_pool_t *pool,
const pj_ssl_cert_lookup_criteria *criteria,
pj_ssl_cert_t **p_cert);

/**
* Dump SSL certificate info.
*
Expand Down
6 changes: 4 additions & 2 deletions pjlib/src/pj/activesock.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ static void ioqueue_on_read_complete(pj_ioqueue_key_t *key,
ret = (*asock->cb.on_data_read)(asock, r->pkt, r->size,
PJ_SUCCESS, &remainder);
PJ_ASSERT_ON_FAIL(
!asock->stream_oriented || remainder <= r->size, {
!ret || !asock->stream_oriented || remainder <= r->size,
{
PJ_LOG(2, ("",
"App bug! Invalid remainder length from "
"activesock on_data_read()."));
Expand Down Expand Up @@ -589,7 +590,8 @@ static void ioqueue_on_read_complete(pj_ioqueue_key_t *key,
ret = (*asock->cb.on_data_read)(asock, r->pkt, r->size,
status, &remainder);
PJ_ASSERT_ON_FAIL(
!asock->stream_oriented || remainder <= r->size, {
!ret || !asock->stream_oriented || remainder <= r->size,
{
PJ_LOG(2, ("",
"App bug! Invalid remainder length from "
"activesock on_data_read()."));
Expand Down
2 changes: 1 addition & 1 deletion pjlib/src/pj/ioqueue_common_abs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key,
/*
* Check that address storage can hold the address parameter.
*/
PJ_ASSERT_RETURN(addrlen <= (int)sizeof(pj_sockaddr_in), PJ_EBUG);
PJ_ASSERT_RETURN(addrlen <= (int)sizeof(pj_sockaddr), PJ_EBUG);

/*
* Schedule asynchronous send.
Expand Down
2 changes: 1 addition & 1 deletion pjlib/src/pj/ioqueue_common_abs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct write_operation
pj_size_t size;
pj_ssize_t written;
unsigned flags;
pj_sockaddr_in rmt_addr;
pj_sockaddr rmt_addr;
int rmt_addrlen;
};

Expand Down
Loading
Loading