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

refactor: changed user-agent, more logging, removed infinite loop #883

Merged
merged 20 commits into from
Sep 25, 2023
Merged

refactor: changed user-agent, more logging, removed infinite loop #883

merged 20 commits into from
Sep 25, 2023

Conversation

Jaskowicz1
Copy link
Contributor

This PR changes the user-agent in wsclient (to match versions.h, sorta), adds more logging in sslclient.cpp, and removes an infinite loop in discord_voice_client::thread_run.

The logging in sslclient.cpp will now send a warning when we encounter a HTTP code that isn't 204, 101, or 200. This means people can see what's going on and report it, without modifying D++ which is very helpful the more we move towards getting people to use pre-compiled binaries (view the image above the checklist for a preview).

The infinite loop in discord_voice_client::thread_run was caused by the error code 400 (you can view #714 for more info). Whilst we haven't fix the issue that #714 is about, we now tell users what's going on if things start to break (as mentioned above). The infinite loop simply checks how many times the do while loop has ran, if it's ran 5 times (without a 3 second break inbetween a loop) then we break the loop. This will mean we also don't spam the console too much with the above addition.

image

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@netlify
Copy link

netlify bot commented Sep 23, 2023

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit ac5b21c
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/65113de1648c6900080aef36
😎 Deploy Preview https://deploy-preview-883--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/dpp/discordvoiceclient.cpp Outdated Show resolved Hide resolved
src/dpp/wsclient.cpp Outdated Show resolved Hide resolved
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
src/dpp/discordvoiceclient.cpp Outdated Show resolved Hide resolved
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
src/dpp/wsclient.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 24, 2023
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
src/dpp/sslclient.cpp Outdated Show resolved Hide resolved
@Commandserver Commandserver removed the documentation Improvements or additions to documentation label Sep 24, 2023
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants