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

Unified Diff: net/udp/udp_socket_win.cc

Issue 2235973002: Add a SetDoNotFragment() method to DatagramSocket, and call this for (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months 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/udp/udp_socket_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_win.cc
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index 42cb05af9d24bc6aace1f09918d9881ffdfc8666..b8c3b5831a346be6cbdf0587b4604ce389676f2f 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -538,6 +538,19 @@ int UDPSocketWin::SetSendBufferSize(int32_t size) {
return ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE;
}
+int UDPSocketWin::SetDoNotFragment() {
+ DCHECK_NE(socket_, INVALID_SOCKET);
+ DCHECK(CalledOnValidThread());
+
+ if (addr_family_ == AF_INET6)
+ return OK;
+
+ DWORD val = 1;
+ int rv = setsockopt(socket_, IPPROTO_IP, IP_DONTFRAGMENT,
+ reinterpret_cast<const char*>(&val), sizeof(val));
+ return rv == 0 ? OK : MapSystemError(WSAGetLastError());
+}
+
int UDPSocketWin::AllowAddressReuse() {
DCHECK_NE(socket_, INVALID_SOCKET);
DCHECK(CalledOnValidThread());
« no previous file with comments | « net/udp/udp_socket_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698