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

Prevent recursion #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Prevent recursion #25

wants to merge 1 commit into from

Conversation

DBX12
Copy link

@DBX12 DBX12 commented Oct 17, 2017

Initial motivation:
If the connection to the MySQL server is unstable, Nimda might lose connection to the server and attempts to re-run the query after a reconnecting to the server. Given the unstable connection, it might fail again to execute the query. Rinse and repeat, it will descend into recursion breaking Nimda.

What I have done:
Added a counter for the reconnection attempts (actually it counts the failed queries until one succeeds but it boils down to the reconnection attempts) and a trigger_error after n failed attempts (currently 5).

Request for comments: Always (what else ;) ) I picked the severity E_USER_WARNING based on the other calls of trigger_error

Copy link
Contributor

@livinskull livinskull left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants