Skip to content

fix: resolve network detection failure and ping-pong switching in mul…#570

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
ut003640:master
Jun 23, 2026
Merged

fix: resolve network detection failure and ping-pong switching in mul…#570
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
ut003640:master

Conversation

@ut003640

Copy link
Copy Markdown
Contributor

…ti-NIC scenario

Two issues are fixed:

  1. UB in HttpManager::get(url, timeoutSec): pass std::string to variadic function curl_easy_setopt instead of const char*, causing all HTTP requests to fail with "URL using bad/illegal format or missing URL". This made StatusChecker always report Limited and triggered the ping-pong switching loop.

  2. Race condition in StatusChecker::realStartCheck(): when the check blocks for DNS timeout (~5s),InternetChecker may switch the primary connection in another thread. The stale result (based on old route) would incorrectly trigger network switching, creating a ping-pong loop between NICs.

Fix: (1) use urlStd.c_str() in curl_easy_setopt; (2) snapshot the primary connection UUID before check and discard result if it changed.

PMS:BUG-351163

…ti-NIC scenario

Two issues are fixed:

1. UB in HttpManager::get(url, timeoutSec): pass std::string to variadic function curl_easy_setopt instead of const char*, causing all HTTP requests to fail with "URL using bad/illegal format or missing URL". This made StatusChecker always report Limited and triggered the ping-pong switching loop.

2. Race condition in StatusChecker::realStartCheck(): when the check blocks for DNS timeout (~5s),InternetChecker may switch the primary connection in another thread. The stale result (based on old route) would incorrectly trigger network switching, creating a ping-pong loop between NICs.

Fix: (1) use urlStd.c_str() in curl_easy_setopt; (2) snapshot the
primary connection UUID before check and discard result if it changed.

PMS:BUG-351163

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @ut003640, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, ut003640

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ut003640

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot deepin-bot Bot merged commit 7e0683d into linuxdeepin:master Jun 23, 2026
16 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants