summaryrefslogtreecommitdiff
path: root/toxcore/ping_array.c
AgeCommit message (Collapse)Author
2020-05-02Fix errors on error paths found by oomer.iphydf
* Use-after-free because we free network before dht in one case. * Various unchecked allocs in tests (not so important). * We used to not check whether ping arrays were actually allocated in DHT. * `ping_kill` and `ping_array_kill` used to crash when passing NULL. Also: * Added an assert in all public API functions to ensure tox isn't NULL. The error message you get from that is a bit nicer than "Segmentation fault" when clients (or our tests) do things wrong. * Decreased the sleep time in iterate_all_wait from 20ms to 5ms. Everything seems to still work with 5ms, and this greatly decreases the amount of time spent per test run, making oomer run much faster.
2020-03-14Use spdx license identifier instead of GPL blurb.iphydf
2018-08-26Update copyright to 2018.iphydf
2018-08-26Add some tests for `ping_array`.iphydf
No timeout test here yet, because we don't yet have the ability to manipulate time at will, so we would have to actually sleep.
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ```
2018-07-08Rename `BS_LIST` to `BS_List` to follow the naming conventions.iphydf
`BS_LIST` would be a constant. `BS_List` is a type name.
2018-05-20Move system header includes from network.h to network.ciphydf
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2018-01-14Add random_u16 function and rename the others to match.iphydf
2018-01-13Make Ping_Array a module-private type.iphydf
2017-01-19Update license headers and remove redundant file name comment.iphydf
"All rights reserved" was incorrect. The project was licensed under GPL3, which means a lot of rights are licensed to everybody in the world, i.e. not reserved to the "Tox Project".
2016-09-24Make toxcore code C++ compatible.iphydf
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
2016-09-13Group #include directives in 3-4 groups.iphydf
1. Current module (if C file). 2. Headers from current library. 3. Headers from other library (e.g. toxcore includes in toxav). 4. System headers.
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2014-07-06Update ping_array.ckyle condon
Change calloc call on line 138 from empty_array->entries = calloc(size * sizeof(Ping_Array_Entry), 1);, to empty_array->entries = calloc(size, sizeof(Ping_Array_Entry));
2014-06-10Const correctness in various interdependent filesMarc Schütz
2014-05-12Fixed segfault.irungentoo
2014-05-12Added ping_array, a special efficient array for use in operationsirungentoo
that require sending ping type packets. Made ping packets use it.