-
Notifications
You must be signed in to change notification settings - Fork 286
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
feat: Add back the tox_loop
implementation for low latency.
#1821
base: master
Are you sure you want to change the base?
Conversation
f8ce6f6
to
e18504e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf)
auto_tests/tox_loop_test.c, line 20 at r1 (raw file):
typedef struct { int start_count, stop_count;
Should be on separate lines
auto_tests/tox_loop_test.c, line 49 at r1 (raw file):
{ pthread_t worker, worker_tcp; struct Tox_Options *opts = tox_options_new(NULL);
nullptr (this needs to be fixed PR-wide)
toxcore/Messenger.c, line 1911 at r1 (raw file):
#if defined(HAVE_LIBEV) || defined(HAVE_LIBEVENT) if (!m->dispatcher) {
== nullptr
toxcore/TCP_connection.c, line 63 at r1 (raw file):
* Return number of elements of TCP connection array. * * @param tcp_c struct containing TCP_con array
Lots of missing .
's in the comments
toxcore/tox.c, line 875 at r1 (raw file):
uint32_t len = tcp_connections_length(nc_get_tcp_c(m->net_crypto)); for (uint32_t i = 0; i < len; i++) {
++i (one of many)
toxcore/tox.c, line 1025 at r1 (raw file):
#endif bool tox_loop(Tox *tox, void *user_data, TOX_ERR_LOOP *error)
Would it make sense to split this up via helper functions for each ifdef condition?
toxcore/tox.c, line 1037 at r1 (raw file):
#ifdef HAVE_LIBEV bool ret = true; Event_Arg *tmp = (Event_Arg *) calloc(1, sizeof(Event_Arg));
Missing null check after calloc
toxcore/tox.c, line 1070 at r1 (raw file):
free(tmp); #elif defined(HAVE_LIBEVENT) Event_Arg *tmp = (Event_Arg *) calloc(1, sizeof(Event_Arg));
Missing null check after calloc
6bde99f
to
9d57d32
Compare
00e9def
to
87b3876
Compare
16675c5
to
608d5b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @iphydf)
auto_tests/tox_loop_test.c, line 11 at r2 (raw file):
#define TCP_RELAY_PORT 33448 /* The Travis-CI container responds poorly to ::1 as a localhost address
We don't use Travis anymore, still needed? At least update the comment
toxcore/tox.c, line 947 at r2 (raw file):
uint32_t i = 0; while (i < fdcount - 1 && i < len) {
this could be rewritten as for loop with upper bound of len
since fdcount = len + 1
a few lines above, which is easier to read. This whole section could use some cleanup.
toxcore/tox.c, line 994 at r2 (raw file):
// TODO(Ansa89): travis states that "ev_run" returns "void", // but "man 3 ev" states it returns "bool" #if 0
don't commit dead code?
toxcore/tox.c, line 1083 at r2 (raw file):
free(fdlist); #endif
which #if
terminates here? I'd generally add a comment if the preprocessor instructions are nested or span several lines
b226f14
to
e6e195c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1821 +/- ##
==========================================
+ Coverage 74.51% 74.64% +0.12%
==========================================
Files 87 87
Lines 26313 26334 +21
==========================================
+ Hits 19607 19656 +49
+ Misses 6706 6678 -28 ☔ View full report in Codecov by Sentry. |
247d058
to
dec479e
Compare
a0ca575
to
a3a9df6
Compare
36aae48
to
d0dec04
Compare
ec9309a
to
d47f9ca
Compare
dd61134
to
38a0587
Compare
40eccaf
to
b335fc2
Compare
86f43fe
to
489a7f5
Compare
Copied code from TokTok#335.
Copied code from #335.
Fixes #225.
This change is