Code

src/liboping.c: Refactor ping_send() further.
authorFlorian Forster <ff@octo.it>
Fri, 5 May 2017 08:42:35 +0000 (10:42 +0200)
committerFlorian Forster <ff@octo.it>
Fri, 5 May 2017 08:47:32 +0000 (10:47 +0200)
commit1eb6f8f2eff9d3f9024a6c9e70007a5684eaa462
treeb70c4733492cd73ff9a093c606ca4e80c9814fb3
parent4ef7c73e336179f61a432f087090cc48ffce3478
src/liboping.c: Refactor ping_send() further.

* Give more meaningful names to the central "ptr" and "pings" variables
  (now "host_to_ping" and "pings_in_flight").
* Remove special case for (errno == EINTR); effectively we only printed a
  different debugging message in that case.
* Remove err_fds. We were not checking it at all.
* Simplify the logic so only one receive or send operation happens per
  loop iteration. Previously, one IPv4 and one IPv6 operation might happen
  in the same loop iteration. The new logic always receives all replies
  before starting to send out more requests.
* Assign the write file descriptor to its own variable to make clear that
  only file descriptor is set in the write_fds bitmask.
src/liboping.c