Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: net/tools/quic/quic_socket_utils.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_socket_utils.h ('k') | net/tools/quic/quic_spdy_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_socket_utils.cc
diff --git a/net/tools/quic/quic_socket_utils.cc b/net/tools/quic/quic_socket_utils.cc
index 3ac0bf3199b86d1451b7a8dad4181e18c0799b7f..0eb11858cbe36425eca78b844dd4af70f8902064 100644
--- a/net/tools/quic/quic_socket_utils.cc
+++ b/net/tools/quic/quic_socket_utils.cc
@@ -23,7 +23,7 @@ namespace net {
namespace tools {
// static
-IPAddressNumber QuicSocketUtils::GetAddressFromMsghdr(struct msghdr *hdr) {
+IPAddressNumber QuicSocketUtils::GetAddressFromMsghdr(struct msghdr* hdr) {
if (hdr->msg_controllen > 0) {
for (cmsghdr* cmsg = CMSG_FIRSTHDR(hdr);
cmsg != nullptr;
@@ -51,11 +51,10 @@ IPAddressNumber QuicSocketUtils::GetAddressFromMsghdr(struct msghdr *hdr) {
}
// static
-bool QuicSocketUtils::GetOverflowFromMsghdr(
- struct msghdr *hdr,
- QuicPacketCount *dropped_packets) {
+bool QuicSocketUtils::GetOverflowFromMsghdr(struct msghdr* hdr,
+ QuicPacketCount* dropped_packets) {
if (hdr->msg_controllen > 0) {
- struct cmsghdr *cmsg;
+ struct cmsghdr* cmsg;
for (cmsg = CMSG_FIRSTHDR(hdr);
cmsg != nullptr;
cmsg = CMSG_NXTHDR(hdr, cmsg)) {
@@ -103,7 +102,7 @@ int QuicSocketUtils::ReadPacket(int fd, char* buffer, size_t buf_len,
QuicPacketCount* dropped_packets,
IPAddressNumber* self_address,
IPEndPoint* peer_address) {
- CHECK(peer_address != nullptr);
+ DCHECK(peer_address != nullptr);
const int kSpaceForOverflowAndIp =
CMSG_SPACE(sizeof(int)) + CMSG_SPACE(sizeof(in6_pktinfo));
char cbuf[kSpaceForOverflowAndIp];
@@ -119,7 +118,7 @@ int QuicSocketUtils::ReadPacket(int fd, char* buffer, size_t buf_len,
hdr.msg_iovlen = 1;
hdr.msg_flags = 0;
- struct cmsghdr *cmsg = (struct cmsghdr *) cbuf;
+ struct cmsghdr* cmsg = (struct cmsghdr*)cbuf;
cmsg->cmsg_len = arraysize(cbuf);
hdr.msg_control = cmsg;
hdr.msg_controllen = arraysize(cbuf);
@@ -209,7 +208,7 @@ WriteResult QuicSocketUtils::WritePacket(int fd,
} else {
hdr.msg_control = cbuf;
hdr.msg_controllen = kSpaceForIp;
- cmsghdr *cmsg = CMSG_FIRSTHDR(&hdr);
+ cmsghdr* cmsg = CMSG_FIRSTHDR(&hdr);
SetIpInfoInCmsg(self_address, cmsg);
hdr.msg_controllen = cmsg->cmsg_len;
}
« no previous file with comments | « net/tools/quic/quic_socket_utils.h ('k') | net/tools/quic/quic_spdy_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698