Revert the do while and if

pull/17332/head
Yash Tibrewal 6 years ago
parent af16b2c09d
commit ba45e77413
  1. 17
      src/core/lib/iomgr/tcp_posix.cc

@ -732,12 +732,9 @@ static void process_errors(grpc_tcp* tcp) {
/* There was no control message found. It was probably spurious. */ /* There was no control message found. It was probably spurious. */
return; return;
} }
auto cmsg = CMSG_FIRSTHDR(&msg); bool seen = false;
if (cmsg == nullptr || cmsg->cmsg_len == 0) { for (auto cmsg = CMSG_FIRSTHDR(&msg); cmsg && cmsg->cmsg_len;
/* No control message found. */ cmsg = CMSG_NXTHDR(&msg, cmsg)) {
return;
}
do {
if (cmsg->cmsg_level != SOL_SOCKET || if (cmsg->cmsg_level != SOL_SOCKET ||
cmsg->cmsg_type != SCM_TIMESTAMPING) { cmsg->cmsg_type != SCM_TIMESTAMPING) {
/* Got a control message that is not a timestamp. Don't know how to /* Got a control message that is not a timestamp. Don't know how to
@ -749,8 +746,12 @@ static void process_errors(grpc_tcp* tcp) {
} }
return; return;
} }
cmsg = CMSG_NXTHDR(&msg, process_timestamp(tcp, &msg, cmsg)); cmsg = process_timestamp(tcp, &msg, cmsg);
} while (cmsg && cmsg->cmsg_len); seen = true;
}
if (!seen) {
return;
}
} }
} }

Loading…
Cancel
Save