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

Issue 9958059: Discard HTTP data written after a socket error (Closed)

Created:
8 years, 8 months ago by Søren Gjesse
Modified:
8 years, 8 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Discard HTTP data written after a socket error If any type of HTTP connection encounters an error writing additional data is an error. However in many cases getting exceptions from writes in this situation is inconvenient. With this change any data written will be silently discarded after an error have occoured. The onError will always be called and the user of the library have the ability to stop generating output data as soon as possible. Currently this is default behaviour with no option for changing it. R=ajohnsen@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=6089

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -27 lines) Patch
M runtime/bin/http_impl.dart View 12 chunks +45 lines, -27 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 8 months ago (2012-04-02 08:37:06 UTC) #1
Anders Johnsen
LGTM, with comment. https://chromiumcodereview.appspot.com/9958059/diff/1/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): https://chromiumcodereview.appspot.com/9958059/diff/1/runtime/bin/http_impl.dart#newcode521 runtime/bin/http_impl.dart:521: void _onClosed() { Could the socket ...
8 years, 8 months ago (2012-04-02 08:42:31 UTC) #2
Søren Gjesse
8 years, 8 months ago (2012-04-02 09:14:31 UTC) #3
https://chromiumcodereview.appspot.com/9958059/diff/1/runtime/bin/http_impl.dart
File runtime/bin/http_impl.dart (right):

https://chromiumcodereview.appspot.com/9958059/diff/1/runtime/bin/http_impl.d...
runtime/bin/http_impl.dart:521: void _onClosed() {
On 2012/04/02 08:42:32, ajohnsen wrote:
> Could the socket be closed normally from the client, when not all data have
been
> written? (E.g. the state where all current data is flushed, and the socket is
> waiting for more data).

The client can half-close the socket when finished writing the request. That
will result in an onClosed event but the server can still write the full
response before closing the socket for writing.

However you have a point that the client can do a full close, and then writing
will fail. It should still go through onError though.

I will try to add a test.

Powered by Google App Engine
This is Rietveld 408576698