Skip to content
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

Support miniupnpc-2.2.8 #31

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 23 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
cpu: amd64
- os: linux
cpu: i386
## non-free runner image:
#- os: macos
#cpu: amd64
- os: macos
Expand All @@ -31,11 +30,11 @@ jobs:
os: linux
builder: ubuntu-22.04
shell: bash
## non-free runner image:
## weird locale problem, where we can't get dots to be decimal separators, failing a JSON test
#- target:
#os: macos
#cpu: amd64
#builder: macos-latest-large
#builder: macos-13
#shell: bash
- target:
os: macos
Expand Down Expand Up @@ -86,11 +85,13 @@ jobs:
;;
"macOS")
NCPU="$(sysctl -n hw.logicalcpu)"
CPPFLAGS="${CPPFLAGS} -I/opt/homebrew/opt/gettext/include"
LDFLAGS="${LDFLAGS} -L/opt/homebrew/opt/gettext/lib"
CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/gettext/include -I/opt/homebrew/opt/gettext/include"
LDFLAGS="${LDFLAGS} -L/usr/local/opt/gettext/lib -L/opt/homebrew/opt/gettext/lib"
echo "/usr/local/opt/qt@5/bin" >> ${GITHUB_PATH}
echo "/opt/homebrew/opt/qt@5/bin" >> ${GITHUB_PATH}
echo "/usr/local/opt/gettext/bin" >> ${GITHUB_PATH}
echo "/opt/homebrew/opt/gettext/bin" >> ${GITHUB_PATH}
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/qt@5/lib/pkgconfig:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig" >> ${GITHUB_ENV}
echo "PKG_CONFIG_PATH=/usr/local/opt/qt@5/lib/pkgconfig:/opt/homebrew/opt/qt@5/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig" >> ${GITHUB_ENV}
echo "MACOSX_DEPLOYMENT_TARGET=12.0" >> ${GITHUB_ENV}
;;
"Windows")
Expand Down Expand Up @@ -249,8 +250,16 @@ jobs:
elif [[ "${{ runner.os }}" == "macOS" ]]; then
CMAKE_ARGS+=(
-DENABLE_MAC=ON
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl
)
if [[ "${{ matrix.target.cpu }}" == "amd64" ]]; then
CMAKE_ARGS+=(
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
)
elif [[ "${{ matrix.target.cpu }}" == "arm64" ]]; then
CMAKE_ARGS+=(
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl
)
fi
elif [[ "${{ runner.os }}" == "Linux" ]]; then
if [[ "${{ matrix.libs }}" == "system" ]]; then
CMAKE_ARGS+=(
Expand Down Expand Up @@ -304,8 +313,13 @@ jobs:
fi
elif [[ "${{ runner.os }}" == "macOS" ]]; then
if [[ "${{ matrix.libs }}" == "system" ]]; then
CPPFLAGS="${CPPFLAGS} -I/opt/homebrew/opt/miniupnpc/include"
LDFLAGS="${LDFLAGS} -L/opt/homebrew/opt/miniupnpc/lib"
if [[ "${{ matrix.target.cpu }}" == "amd64" ]]; then
CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/miniupnpc/include"
LDFLAGS="${LDFLAGS} -L/usr/local/opt/miniupnpc/lib"
elif [[ "${{ matrix.target.cpu }}" == "arm64" ]]; then
CPPFLAGS="${CPPFLAGS} -I/opt/homebrew/opt/miniupnpc/include"
LDFLAGS="${LDFLAGS} -L/opt/homebrew/opt/miniupnpc/lib"
fi
fi
elif [[ "${{ runner.os }}" == "Linux" ]]; then
if [[ "${{ matrix.libs }}" == "system" ]]; then
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### All Platforms
- Fix XFS quota support with GCC 14 ([#30](https://github.com/stefantalpalaru/transmission-og/pull/30))
- Support miniupnpc-2.2.8 ([#31](https://github.com/stefantalpalaru/transmission-og/pull/31))

## [Transmission OG 3.02](https://github.com/stefantalpalaru/transmission-og/releases/tag/3.02) (2024-05-19)

Expand Down
17 changes: 15 additions & 2 deletions libtransmission/upnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ struct tr_upnp {
struct IGDdatas data;
int port;
char lanaddr[16];
#if MINIUPNPC_API_VERSION >= 18
char wanaddr[16];
#endif
struct {
char const *proto;
char proto_no[8];
Expand Down Expand Up @@ -408,8 +411,18 @@ int tr_upnpPulse(tr_upnp *handle, int port, bool isEnabled, bool doPortCheck)

errno = 0;

if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr)) ==
UPNP_IGD_VALID_CONNECTED) {
if (UPNP_GetValidIGD(
devlist,
&handle->urls,
&handle->data,
handle->lanaddr,
sizeof(handle->lanaddr)
#if MINIUPNPC_API_VERSION >= 18
,
handle->wanaddr,
sizeof(handle->wanaddr)
#endif
) == UPNP_IGD_VALID_CONNECTED) {
tr_logAddNamedInfo(getKey(), _("Found Internet Gateway Device \"%s\""), handle->urls.controlURL);
tr_logAddNamedInfo(getKey(), _("Local Address is \"%s\""), handle->lanaddr);
handle->state = TR_UPNP_IDLE;
Expand Down
Loading