Fix #80: TCP Window scaling not correctly updated

Setting SO_SNDBUF on the socket disable tcp dynamic window autoscaling
  :x


Former-commit-id: 3b71fa85467653bddb9fb8fbb6669d00d71a7c3b
Former-commit-id: 1324444b38e72abedd38ccc8530b5451855dab20 [formerly dd16d8fe7c0a41eeafdd960b8fd8f9315ace6cce] [formerly c6b8fa013ef71e046498a94d30c710c1b6979b08 [formerly 7bc9bba32dd0dc864144ec5b665bb10d8a362c2b [formerly 7bc9bba32dd0dc864144ec5b665bb10d8a362c2b [formerly 7bc9bba32dd0dc864144ec5b665bb10d8a362c2b [formerly 19da7a13989b79f5e56f4635bfc09c0118098eb5]]]]]
Former-commit-id: 8b17a027fa82de4f91771f2d30ce5df9da4b1789 [formerly 8bfb3fac6108497d8de72479e2537a47552ae327]
Former-commit-id: b690397effb9983ece695fcda5876e3f5bd5ff2b
Former-commit-id: 280f123aa99adacc1be2dfb35ae689f07444df3b
Former-commit-id: f3b381959d2e39cc91c856f9d3f0832777f97c5c
Former-commit-id: c7e1fa6e3e1fcc582344fcc3e8af70bceabe83e0 [formerly dd7c8f27f5b1ac6f63c47cfd5998baee0f989dcd]
Former-commit-id: 38dd6ff81fb91fa013879ca735616ece2f4d7ffb
This commit is contained in:
Romain GERARD 2021-06-06 12:37:00 +02:00
parent 601cb3fc79
commit 025f7e4d21
2 changed files with 0 additions and 5 deletions

View file

@ -43,8 +43,6 @@ rrunTCPClient :: N.ClientSettings -> (Connection -> IO a) -> IO a
rrunTCPClient cfg app = bracket
(do
(s,addr) <- N.getSocketFamilyTCP (N.getHost cfg) (N.getPort cfg) (N.getAddrFamily cfg)
N.setSocketOption s N.RecvBuffer defaultRecvBufferSize
N.setSocketOption s N.SendBuffer defaultSendBufferSize
so_mark_val <- readIORef sO_MARK_Value
when (so_mark_val /= 0 && N.isSupportedSocketOption sO_MARK) (N.setSocketOption s sO_MARK so_mark_val)
return (s,addr)

View file

@ -34,9 +34,6 @@ defaultRecvBufferSize :: Int
defaultRecvBufferSize = unsafeDupablePerformIO $
bracket (N.socket N.AF_INET N.Stream 0) N.close (\sock -> N.getSocketOption sock N.RecvBuffer)
defaultSendBufferSize :: Int
defaultSendBufferSize = defaultRecvBufferSize
sO_MARK :: N.SocketOption
sO_MARK = N.CustomSockOpt (1, 36) -- https://elixir.bootlin.com/linux/latest/source/arch/alpha/include/uapi/asm/socket.h#L64