Report total traffic used per allocation via Redis#191
Merged
misi merged 1 commit intocoturn:masterfrom Nov 24, 2017
Merged
Conversation
Publish total traffic information when an allocation is deleted. This makes it easier for applications to monitor total usage per session.
Contributor
|
Thanks for PR. |
Member
Author
|
Sounds good :) |
ggarber
reviewed
Nov 21, 2017
|
|
||
| // report total traffic usage for this allocation | ||
| if(ss->realm_options.name[0]) { | ||
| snprintf(key, sizeof(key), "turn/realm/%s/user/%s/allocation/%018llu/total_traffic", ss->realm_options.name, (char*)ss->username, (unsigned long long)ss->id); |
Contributor
There was a problem hiding this comment.
isnt' "/" a valid character in the realm and username? Shouldn't you escape it?
Contributor
There was a problem hiding this comment.
True.
It is a general issue with the db backend.
Member
Author
There was a problem hiding this comment.
I hadn't considered that, actually. I just followed the pattern for the other Redis keys.
Contributor
There was a problem hiding this comment.
I think I will merge this and open a new issue about the string escaping.
Contributor
There was a problem hiding this comment.
@ggarber Many thanks again for pointing out the issue..
Member
Author
|
Thanks :) |
mathieu-aubin
added a commit
to mathieu-aubin/coturn
that referenced
this pull request
Nov 11, 2018
* Typo Fixes small typo in rpm spec file for changelog section * Updates make-man.sh Changes from cd's to pushd/popd Switches from hardcoding to script looping Changed the rm call to act on manpages (.1) files only which adds a bit of safety while still doing the job * man pages util fixed * Typo in the ALPN callback: ta_len should be ha_len Fixes coturn#113. Credit for the fix goes to @davidben. * changelog fixed * code cleaning * Enhancement: Add option to disable Web-Management-Interface * Build by docker To build, run ./build-docker.sh. The outputs will be in the same directory. Signed-off-by: Hui Kang <kangh@us.ibm.com> * added config warning about using use-auth-secret * Display Local address * Tidy:Remove trailing witespace * Preserve STUN server IP:port during the map/filter tests even if FQDN is used * Add collision test * Add man collision * Add padding and tidy * Add ALG detection discovery * refactor stun client (send/receive) * rephrase * Add hairpinning check * ALG fix * Add hairpinning natdiscovery to README and man * tidy * hairpinning usage * fix init_socket * hairpinning fixes * Add mapping lifetime discovery * Update man and README according natdiscovery changes * Add git ignore * indent * Add the realm parameter in the example config file * Report total traffic used per allocation via Redis Publish total traffic information when an allocation is deleted. This makes it easier for applications to monitor total usage per session. * Add Changelog PR coturn#191 * Add PR coturn#184 to Changelog * ignore sqlite folder * bumping up the release version * Centos version bumped up * version bumped up and some spelling errors fixed * fix typos in netarch.txt * Review PR coturn#160 * Revert "Add the realm parameter in the example config file" This reverts commit 99da6e7. * Fix Verbose config option & -v cli option override * Add a Notice to config about realm default value is the domain name * Update total usage on client shutdown Call turn_report_session_usage() from shutdown_client_connection(), so that any accumulated packets and data sent/received gets added to the totals before passing it to report_turn_session_info(). This also ensures that the total_traffic message sent to redis contains correct values. Add a force_invalid argument to turn_report_session_usage() to ensure that report_turn_session_info() is still called when the former is called from shutdown_client_connection(). This should avoid any unexpected change in behavior. * Add changelog entry for PR coturn#212 * Makefile.in: do not remove Makefile on 'make clean' This is the way how Autotools behaves, where is little reason to surprise newcomers with different behavior. Also, it may be really inconvenient to constantly rerun ./configure if one has to make a number of rebuilds which differ in CFLAGS only. Signed-off-by: Pavel Kretov <firegurafiku@gmail.com> * Makefile.in: list all phony targets as .PHONY Otherwise, these targets will fail to run if a developer incidentally created files named 'test' or 'sqlite_empty_db' in their working copy, which may be rather likely. Signed-off-by: Pavel Kretov <firegurafiku@gmail.com> * Make SIGUSR2 reload TLS certificates This commit does the following: * Factor out loading of TLS keys and certificates into turn_params SSL context so that it can be repeated. (Contexts are not overwritten when loading encounters errors, but initial contexts will be set regardless of errors. This keeps existing semantics.) * Isolate copying of turn_params SSL context to ioa_engine structs into callback functions appropriate for libevent invocation. * Chain both of the above to a signal event handler responding to SIGUSR2. This allows replacement of keys and certificates during run-time without interrupting relaying operations. * Revert "fix quota options" This reverts commit 59ee141. * Fix mixed user/total quota params * fix(doc): Updated copy on postinstall.txt Fixed typos in postinstall.txt * Update ChangeLog * Fix typo * Fixes leaking udp6 sockets. Guess address family from client socket address when STUN_ATTRIBUTE_REQUESTED_ADDRESS_FAMILY is missing. * fix get_family * Added to Changelog * tidy Changelog * Add +2 to not truncate string and avoid warning * add hint fallthrough to compiler to avoid warning * Add Travis CI integration * add email notification * small changes * add precise dist * add more osx dist * fix to add more osx dist * upgrade sqlite * update osx versions * step back from osx 7.3 to 7 * switch back from 6.4 to 6 due error * Revert "add hint fallthrough to compiler to avoid warning" This reverts commit 5772435. * add Falls Through comment hint to compiler to avoid warning * add changes * add travis CI badge * use less osX version * fix typo * Adding a encryption logic for the password of MySQL DB user. Co-authored-by: Erdem Duman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * Removed unnecessary a line. Co-authored-by: erdemduman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * Changing file reading format. Co-authored-by: erdemduman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * Update the example config file: use-auth-secret overrides lt-cred-mech. * Changing aes encrypiton format. Co-authored-by: erdemduman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * replace notification email * Changing aes encrypiton format. Co-authored-by: erdemduman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * Edited aes encrypiton format. Co-authored-by: erdemduman <erdemduman23@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * remove extra parenthesis * initialize new turn_params * Refactor for macOS * Add mysql password encryption to changelog * Add new feature to README.turnadmin * Add mysql pwd enc to turnserver help * Add mysql pwd enc to README.turnserver and regenerate man pages * Add missing header * Do not write to log before logging configuration is read from a config file * Add PR#264 to Changelog * Add more explanation to REST auth mechanism * Add more explanation to REST auth mechanism to config * Add warning to lines that ends with semicolon * Co-authored-by: mustafabingul <bnglmstf@gmail.com> Co-authored-by: mashary <mashar.yazici@gmail.com> * fix typo in netarch.txt * typo in makefile * --prod pointer bug fix * fix: missing newline * Fix: race auth_server thread create & detach * Add new feature: keep-address-family * tidy: missing space secret-key-file * fix: double free ssl crash AFAIU Openssl 1.1 SSL_set0_rbio() calls BIO_free_ all automatically.. "On calling this function, any existing rbio that was previously set will also be freed via a call to BIO_free_all" * Tidy: Changelog * Set mysql charset to fix key was too long error "Specified key was too long; max key length is 767 bytes" Innodb utf8 sotres 4byte a char. In the turndb/schema.sql the name[512] is too long.. * Fix: unecessrey if (thx damencho) * compilation warning fixed * compilation fixed with older OpenSSL versions * c++ compilation errors fixed * replace email address * bumping up the release version
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.
Publish total traffic information when an allocation is deleted. This
makes it easier for applications to monitor total usage per session.