fix: prevent redundant auth for basic_http modems (v3.13.1)#122
Merged
fix: prevent redundant auth for basic_http modems (v3.13.1)#122
Conversation
The _pre_authenticate() gate condition used `if not pre_auth_html` as a proxy for "was auth performed?" but basic_http auth is stateless and intentionally never returns HTML. This caused _authenticate() to always run for basic_http modems, making 2 login() calls and 4 HTTP requests per poll instead of 1 and 3. The extra requests triggered connection resets on modems that rate-limit rapid HTTPS requests (e.g., CM1200). Changed _pre_authenticate() to return a 3-tuple (success, html, auth_performed) with an explicit boolean flag, and gate on `if not pre_auth_performed` instead. Related to #121 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kwschulz
added a commit
that referenced
this pull request
Apr 6, 2026
fix: prevent redundant auth for basic_http modems (v3.13.1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
basic_httpmodems (CM1200, C7000v2, CM600, C3700, TC4400). The_pre_authenticate()gate condition used HTML presence as a proxy for "was auth performed?" but basic_http is stateless and never returns HTML — causing a second_login()call and extra HTTP request every poll cycle. Modems that rate-limit rapid HTTPS requests (e.g., CM1200) returned zero channel data as a result._pre_authenticate()to return an explicitauth_performedflag instead of inferring from HTML.Test plan
Related to #121
🤖 Generated with Claude Code