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

Move Networking_Core struct into the .c file. #662

Merged
merged 6 commits into from
Jan 11, 2018

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 10, 2018

To make it an abstract type everywhere except in network.c.


This change is Reviewable

@iphydf iphydf added this to the v0.2.0 milestone Jan 10, 2018
Without these, we'll have a memory leak on error paths.
These potentially cause uninitialised reads on some platforms or msgpack
library versions.
We return E_WRITE because closing only fails when an I/O error occurs,
which is likely an error from the write() call above. See close(2) for
details.

http://man7.org/linux/man-pages/man2/close.2.html
Also replace &(x) with &x for consistency.
This basically means: try until you run out of time (50 minutes on
Travis). On Linux, we really want the tests to pass, so there is no point
in limiting the number of retries. On windows, we don't retry, on FreeBSD
it's limited to 1.
@robinlinden
Copy link
Member

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 14 of 14 files at r4, 1 of 1 files at r5, 8 of 8 files at r6.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks broke.


toxcore/network.c, line 407 at r6 (raw file):

Family net_family(const Networking_Core *net) {
  return net->family;

Wrong indentation. Should be 4 spaces.


toxcore/network.c, line 411 at r6 (raw file):

uint16_t net_port(const Networking_Core *net) {
  return net->port;

Wrong indentation. Should be 4 spaces.


toxcore/network.c, line 843 at r6 (raw file):

Networking_Core *new_networking_no_udp(Logger *log) {
  /* this is the easiest way to completely disable UDP without changing too much code. */

Wrong indentation. Should be 4 spaces.


Comments from Reviewable

@robinlinden
Copy link
Member

:lgtm_strong:


Reviewed 1 of 1 files at r7.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

To make it an abstract type everywhere except in network.c.
@iphydf iphydf closed this Jan 11, 2018
@iphydf iphydf deleted the adt-networking branch January 11, 2018 20:56
@iphydf iphydf merged commit 2fbed5b into TokTok:master Jan 11, 2018
@iphydf iphydf modified the milestones: v0.2.0-RC1, v0.2.0 Jan 14, 2018
This pull request was closed.
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