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

Issue 984403004: Fixed a number of bugs on RawSocket and Socket (Closed)

Created:
5 years, 9 months ago by Søren Gjesse
Modified:
5 years, 9 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fixed a number of bugs on RawSocket and Socket The checking of the closed state was not present when dealing with the properties port, remotePort, address and remoteAddress on RawSocket and Socket. Then now all throw SocketException when the RawSocket or Socket is closed. * Calling port on a RawSocket would return the port even if it was closed * Calling remotePort, address and remoteAddress did not check for OSError * Calling remotePort, address and remoteAddress on a closed RawSocket caused syscalls using the already closed fd, which might also have been re-allocated already. * Calling port, remotePort, address and remoteAddress on a closed Socket caused null pointer exception R=ajohnsen@google.com Correctly check for errors when getting remote address and port BUG= Committed: https://code.google.com/p/dart/source/detail?r=44319

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -16 lines) Patch
M runtime/bin/socket_patch.dart View 7 chunks +40 lines, -13 lines 2 comments Download
M sdk/lib/io/socket.dart View 1 chunk +1 line, -0 lines 0 comments Download
M tests/standalone/io/http_detach_socket_test.dart View 2 chunks +2 lines, -1 line 0 comments Download
M tests/standalone/io/raw_socket_test.dart View 2 chunks +33 lines, -0 lines 2 comments Download
M tests/standalone/io/socket_exception_test.dart View 3 chunks +44 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Gjesse
5 years, 9 months ago (2015-03-09 11:54:31 UTC) #1
Anders Johnsen
LGTM! Very nice. https://codereview.chromium.org/984403004/diff/1/runtime/bin/socket_patch.dart File runtime/bin/socket_patch.dart (right): https://codereview.chromium.org/984403004/diff/1/runtime/bin/socket_patch.dart#newcode695 runtime/bin/socket_patch.dart:695: InternetAddress get address { This is ...
5 years, 9 months ago (2015-03-09 12:00:45 UTC) #2
Søren Gjesse
Committed patchset #1 (id:1) manually as 44319 (presubmit successful).
5 years, 9 months ago (2015-03-09 13:33:39 UTC) #3
Søren Gjesse
5 years, 9 months ago (2015-03-09 13:33:46 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/984403004/diff/1/runtime/bin/socket_patch.dart
File runtime/bin/socket_patch.dart (right):

https://codereview.chromium.org/984403004/diff/1/runtime/bin/socket_patch.dar...
runtime/bin/socket_patch.dart:695: InternetAddress get address {
On 2015/03/09 12:00:45, Anders Johnsen wrote:
> This is a breaking change. Before we allowed the user to read a cached value
> after the socket was closed, now we don't. Not sure if we need to announce
this.

Yes (I had to fix a test), it is the same for port if it was already known. I
will think about whether sending out an announcement.

https://codereview.chromium.org/984403004/diff/1/tests/standalone/io/raw_sock...
File tests/standalone/io/raw_socket_test.dart (right):

https://codereview.chromium.org/984403004/diff/1/tests/standalone/io/raw_sock...
tests/standalone/io/raw_socket_test.dart:453: socket.port;
On 2015/03/09 12:00:45, Anders Johnsen wrote:
> use Expect.throws instead?

Done.

Powered by Google App Engine
This is Rietveld 408576698