Commit Graph

7 Commits

Author SHA1 Message Date
cui fliter
89598dfcfe docs(lib): fix some typos (#2818)
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-25 11:05:48 -07:00
Sean McArthur
3b26572876 refactor(ffi): check pointer arguments for NULL (#2624)
This changes all the extern C functions in `hyper::ffi` to check passed
pointer arguments for being `NULL` before trying to use them. Before, we
would just assume the programmer had passed a good pointer, which could
result in segmentation faults. Now:

- In debug builds, it will assert they aren't null, and so if they are,
  a message identifying the argument name will be printed and then the
  process will crash.
- In release builds, it will still check for null, but if found, it will
  return early, with a return value indicating failure if the return type
  allows (such as returning NULL, or `HYPERE_INVALID_ARG`).

Closes #2620
2021-08-18 14:15:14 -07:00
David Cook
6393a0cc03 docs(ffi): fix copy-paste error on hyper_waker_wake (#2604) 2021-07-26 11:18:50 -07:00
Rasmus Nylander
895e4cf3fb refactor(ffi): return null ptr instead of aborting in C API (#2478)
Make C API functions that return pointers return null in case of a
panic, instead of aborting.

Add ffi_fn! macro rules that enable default error values to be returned
by writing "?= <value>" after an ffi function's body.
2021-03-26 11:26:44 -07:00
Sean McArthur
f162ca2f2f docs(ffi): generate FFI documentation (#2447) 2021-02-26 19:00:37 -08:00
CfirTsabari
a60280873b refactor(ffi): Removed need for cbindgen type renames (#2442)
Fixes hyperium/hyper#2428
2021-02-22 16:12:06 -08:00
Sean McArthur
3ae1581a53 feat(ffi): Initial C API for hyper 2021-01-08 10:25:53 -08:00