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

Issue 1381233003: Increase the datagram receive buffer on Windows to 64k (Closed)

Created:
5 years, 2 months ago by Søren Gjesse
Modified:
5 years, 2 months ago
Reviewers:
Ivan Posva, kustermann
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Increase the datagram receive buffer on Windows to 64k A datagram can can be up to 64k, and if the buffer is too small the received data is truncated. This change also correctly handles errors when receiving datagrams on Windows. BUG= #24426 R=kustermann@google.com, iposva@google.com Committed: https://github.com/dart-lang/sdk/commit/33e2d9cd7e3d6191194bee1f93e33de53f3e5b05

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressed review comments #

Patch Set 3 : Removed tabs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -13 lines) Patch
M runtime/bin/eventhandler_win.cc View 1 4 chunks +18 lines, -7 lines 0 comments Download
M sdk/lib/io/socket.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tests/standalone/io/raw_datagram_socket_test.dart View 1 2 6 chunks +12 lines, -6 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Gjesse
5 years, 2 months ago (2015-10-02 15:17:54 UTC) #1
kustermann
LGTM https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_win.cc File runtime/bin/eventhandler_win.cc (right): https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_win.cc#newcode993 runtime/bin/eventhandler_win.cc:993: OverlappedBuffer::AllocateRecvFromBuffer(64 * 1024); Maybe make a constant kMaxUDPPackageLength ...
5 years, 2 months ago (2015-10-02 15:36:59 UTC) #2
Søren Gjesse
Committed patchset #3 (id:40001) manually as 33e2d9cd7e3d6191194bee1f93e33de53f3e5b05 (presubmit successful).
5 years, 2 months ago (2015-10-06 06:43:22 UTC) #3
Søren Gjesse
5 years, 2 months ago (2015-10-06 07:01:42 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_wi...
File runtime/bin/eventhandler_win.cc (right):

https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_wi...
runtime/bin/eventhandler_win.cc:993: OverlappedBuffer::AllocateRecvFromBuffer(64
* 1024);
On 2015/10/02 15:36:58, kustermann wrote:
> Maybe make a constant kMaxUDPPackageLength ?
> 
> [Theoretically they can actually be bigger:
https://tools.ietf.org/html/rfc2675]

Added a constant and mentioned the current limit in the dartdoc for receive.

https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_wi...
runtime/bin/eventhandler_win.cc:1227: HandleError(handle);
On 2015/10/02 15:36:58, kustermann wrote:
> Is there a way to test that we report the error to Dart?

I have not found one. I did a manual test with the small constant and received
the ERROR_MORE_DATA in Dart.

https://codereview.chromium.org/1381233003/diff/1/runtime/bin/eventhandler_wi...
runtime/bin/eventhandler_win.cc:1230: 
On 2015/10/02 15:36:58, kustermann wrote:
> extra empty line

Removed.

https://codereview.chromium.org/1381233003/diff/1/tests/standalone/io/raw_dat...
File tests/standalone/io/raw_datagram_socket_test.dart (right):

https://codereview.chromium.org/1381233003/diff/1/tests/standalone/io/raw_dat...
tests/standalone/io/raw_datagram_socket_test.dart:130: broadcastTimer = new
Timer.periodic(new Duration(milliseconds: 10), send);
On 2015/10/02 15:36:59, kustermann wrote:
> long line

Done.

https://codereview.chromium.org/1381233003/diff/1/tests/standalone/io/raw_dat...
tests/standalone/io/raw_datagram_socket_test.dart:285: switch (event) {
On 2015/10/02 15:36:58, kustermann wrote:
> You could use package:async_helper / ... for ensuring twe get the correct
number
> of calls inside the .then() and .listen() callbacks

This is already done in the sender.

https://codereview.chromium.org/1381233003/diff/1/tests/standalone/io/raw_dat...
tests/standalone/io/raw_datagram_socket_test.dart:288: if (datagram != null) {
On 2015/10/02 15:36:58, kustermann wrote:
> Maybe expect that we get the correct number of bytes here and not  less? [or
is
> this checked somewhere else?]

Done.

https://codereview.chromium.org/1381233003/diff/1/tests/standalone/io/raw_dat...
tests/standalone/io/raw_datagram_socket_test.dart:324:
testSendReceive(InternetAddress.LOOPBACK_IP_V6, 32 * 1024);
On 2015/10/02 15:36:58, kustermann wrote:
> Is it possible to test this with a size of "64kb - ip/udp header sizes"
> 
> I guess we can only test bigger packages (and thereby trigger the error) by
> manually increasing the MTU?

Added a test for size 64k - 32.

Powered by Google App Engine
This is Rietveld 408576698