- Since the `if` condition already causes the loop to `break`,
the `else` is not necessary. We wouldn't have reached the `else`
block, anyway, if the prior `if` condition passed.
- We are more likely to poll a successful chunk than finish
the request or throw an error. Thus, it is best if we go
for the optimistic route and check for the successful
case first.
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
This defines an extension type used in requests for the client that is
used to setup a callback for receipt of informational (1xx) responses.
The type isn't currently public, and is only usable in the C API.