Merged
Conversation
…ets payload by reusing jsmn_pair
…ens and jsmnf pairs)
…o() for dynamic realloc
Ratelimiting refactor
…sh.h * refactor(discord-adapter_refcount.c): organize reference counter by creating a struct discord_refcounter structure
…uct discord_event' to src file scope
|
We will run this on VAX ULTRIX one day. |
Collaborator
|
Let it be known that Concord works fine on Solaris 9 and 10, when compiled with the Sun C compiler (Sun Studio 10 and Sun Studio 11)! |
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.
What?
1.1. uthash.h replaced with chash.h, as the latter is more portable, and easier to maintain.
1.2. jsmn-find.h most recent, zero-allocation, stable version (v1.0.0).
config.jsonWhy?
1.1. chash.h has proven to be more portable, with an easier syntax (therefore easier to maintain) - and provides greater memory control.
1.2. v1.0.0 jsmn-find.h provides a stackful API (much like json-build), meaning creating a duplicate (for context sharing) is as easy as doing a single memory allocation and
memcpy()'ing from the original (see_discord_clone_gateway()at discord-client.c).How?
1.1.
discord-adapter_ratelimit.c,discord-adapter_refcount.cused to rely onuthash.h, those have been refactored to work with chash.h accordingly.Testing?
Preliminary testing have shown that the ratelimiting handling behavior prior to this PR have been kept - ratelimiting has been tested via
test/async.candtest/sync.cmulti-channels spamming.Side-note: A out-of-bounds read (off by one byte) occurs at
test/sync.conce the worker-thread threshold has been reach, it can be reproduced by runningtest/sync.cexecutable under valgrind, and then sending!spamcommand four times in some guild the bot is part of. Because worker-threads are deprecated and should be removed in the future, fixing this is not a priority.