https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6bc61f63f1e0ad20ab09f…
commit 6bc61f63f1e0ad20ab09f881d6968558eba9a8e6
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Feb 25 22:30:01 2019 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Mon Feb 25 22:34:29 2019 +0100
[MSAFD] Implement socket options SO_SNDBUF and SO_RCVBUF
---
dll/win32/msafd/misc/dllmain.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c
index c761cff13e..520cf1a3ce 100644
--- a/dll/win32/msafd/misc/dllmain.c
+++ b/dll/win32/msafd/misc/dllmain.c
@@ -2866,8 +2866,21 @@ WSPSetSockOpt(
return SOCKET_ERROR;
}
- /* TODO: The total per-socket buffer space reserved for sends */
- ERR("Setting send buf to %x is not implemented yet\n", optval);
+ SetSocketInformation(Socket,
+ AFD_INFO_SEND_WINDOW_SIZE,
+ NULL,
+ (PULONG)optval,
+ NULL,
+ NULL,
+ NULL);
+ GetSocketInformation(Socket,
+ AFD_INFO_SEND_WINDOW_SIZE,
+ NULL,
+ &Socket->SharedData->SizeOfSendBuffer,
+ NULL,
+ NULL,
+ NULL);
+
return NO_ERROR;
case SO_RCVBUF:
@@ -2877,8 +2890,21 @@ WSPSetSockOpt(
return SOCKET_ERROR;
}
- /* TODO: The total per-socket buffer space reserved for receives */
- ERR("Setting receive buf to %x is not implemented yet\n",
optval);
+ SetSocketInformation(Socket,
+ AFD_INFO_RECEIVE_WINDOW_SIZE,
+ NULL,
+ (PULONG)optval,
+ NULL,
+ NULL,
+ NULL);
+ GetSocketInformation(Socket,
+ AFD_INFO_RECEIVE_WINDOW_SIZE,
+ NULL,
+ &Socket->SharedData->SizeOfSendBuffer,
+ NULL,
+ NULL,
+ NULL);
+
return NO_ERROR;
case SO_ERROR: