Commit graph

742 commits

Author SHA1 Message Date
kustermann@google.com 53cc8c512d Support for the ALPN extension of the TLS protocol for Client and Server
This CL uses the NSS support for the ALPN extension of the TLS protocol
(see RFC 7301).

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//625953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41628 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 12:31:02 +00:00
sgjesse@google.com 7770efc4a9 Update documentation for RandomAccessFile
R=kustermann@google.com, lrn@google.com
BUG=http://dartbug.com/21516

Review URL: https://codereview.chromium.org//702363002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41548 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 12:05:19 +00:00
ajohnsen@google.com 8240d9a4cf Only lower-case ContentType's values if the name is 'charset'.
BUG=https://code.google.com/p/dart/issues/detail?id=21385
R=lrn@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//694293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41456 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 12:34:08 +00:00
sgjesse@google.com 65e1149f8c Make stdout/stderr async
This makes stdout.write and stderr.write async.

This effectively reverts https://code.google.com/p/dart/source/detail?r=33645

Reapplies r41350 after the dart2js batch-runner have been changed to handle
async stdout/stderr.

R=ricow@google.com
BUG=

Review URL: https://codereview.chromium.org//693793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41436 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 12:11:53 +00:00
sgjesse@google.com b6d16215aa Revert "Make stdout/stderr async"
This reverts r41350.

There are test-failures that needs to be analyzed.

TBR=iposva@google.com, ajohnsen@google.com
BUG=

Review URL: https://codereview.chromium.org//686703002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41353 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 09:07:56 +00:00
sgjesse@google.com c50df5e563 Make stdout/stderr async
This makes stdout.write and stderr.write async.

This effectively reverts https://code.google.com/p/dart/source/detail?r=33645

R=iposva@google.com, ajohnsen@google.com
BUG=

Review URL: https://codereview.chromium.org//673193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41350 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 08:53:10 +00:00
iposva@google.com bf6f6de97b - String array should be const.
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//641983002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41003 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 05:58:36 +00:00
sgjesse@google.com 50c17cd3c4 Fix SecureServerSocket documentation
R=whesse@google.com
BUG=http://dartbug.com/21175

Review URL: https://codereview.chromium.org//622503003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40830 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 08:10:03 +00:00
kustermann@google.com e6e8fd93fc Fix circular ringbuffer used in socket implementation
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//615923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40811 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 13:19:36 +00:00
ajohnsen@google.com bffaae9a37 Update watch docs.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//589373002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40589 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 11:35:31 +00:00
ajohnsen@google.com 35fb108468 Add HttpServer:autoCompress option, to disable auto gzip compression.
BUG=
R=lrn@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//598453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40587 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 11:08:24 +00:00
ajohnsen@google.com f75e71d95c Remove unused string interpolations.
BUG=
R=lrn@google.com

Review URL: https://codereview.chromium.org//532233002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39802 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:35:50 +00:00
kustermann@google.com 1ce303fa80 Bugfix in dart:io's WebSocketTransformer implementation, correctly test async behaviour of websocket, some test cleanup
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//517513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39641 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 10:44:46 +00:00
sgjesse@google.com 064fe27add Fix HttpServer documentation
The list of default headers was not rendered verbatim (https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-io.HttpServer#id_defaultResponseHeaders).

R=ricow@google.com
BUG=

Review URL: https://codereview.chromium.org//513973003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39639 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 09:59:19 +00:00
kustermann@google.com 705b05c93d Fix idle connection pool issue in dart:io's HttpClient
So far if all connections in the connection pool of an http client were idle,
the idle connections were closed after 100ms. This goes obviously against the
idea of having a connection pool to avoid repeated reconnects. If a client makes
a request, does some work for 110 ms and makes another request, the idle
connection would be gone and it would reconnect.

When a user is done with an HttpClient and called close() on it the HTTP client
would in certain cases still sit around for another 100ms before closing all
connections. For command line applications this might delay the time when the VM
exists.

This 100ms idle connection pool timeout was hard-coded and not changeable. There
is still a idle timeout on a connection basis, defaulting to 15 seconds.

This CL removes the mentioned 100ms timer and has 2 consequences:
a) A connection stays in the pool for 15 seconds by default.
b) The idle connections will be closed immediately if HttpClient.close() was
called.

Users who relied on the behaviour of a VM shutdown after 100ms without calling
HttpClient.close() are broken and must be fixed.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//486853005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39542 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 09:46:38 +00:00
sgjesse@google.com ac911ff0bf Make the default HTTP server configuration more secure
Add a mechanism for setting default headers to add to all responses.

By default each the HTTP response now will contain the following headers:

  Content-Type: text/plain; charset=utf-8
  X-Frame-Options: SAMEORIGIN
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block

New cookies created are now 'httpOnly' by default.

BUG=http://dartbug.com/19676
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//443373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39118 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 07:12:03 +00:00
sgjesse@google.com a2875d1768 Fix bug in caching of chunked transfer encoding in HTTP headers
R=ajohnsen@google.com
BUG=http://dartbug.com/20335

Review URL: https://codereview.chromium.org//460653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39116 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 06:39:12 +00:00
ajohnsen@google.com 7ea3f05253 Clean up socket:connect change.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//441903003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38918 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 05:10:44 +00:00
ajohnsen@google.com 0e33676cf2 Don't resolve 'package:*' and 'dart:*' Uris, in Platform:script.
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org//426643002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38622 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 14:04:20 +00:00
ajohnsen@google.com f560436366 Fix two other issues, with my previous commit.
BUG=

Review URL: https://codereview.chromium.org//425733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38619 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 13:12:22 +00:00
ajohnsen@google.com d56b11bf59 Compute absolute script path at isolate startup.
BUG=https://code.google.com/p/dart/issues/detail?id=20119
R=whesse@google.com

Review URL: https://codereview.chromium.org//423843002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38616 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 12:31:29 +00:00
kevmoo@google.com 3ff56268eb Fix typo in Socket.connect
BUG: https://code.google.com/p/dart/issues/detail?id=20198

R=kevmoo@google.com

Review URL: https://codereview.chromium.org//420683002

Patch from Kenneth Endfinger <kaendfinger@gmail.com>.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38578 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 18:14:51 +00:00
sgjesse@google.com cef31ae5e0 Improve HTTP error message
R=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org//382773002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38115 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-10 10:53:53 +00:00
sgjesse@google.com 8213dd365b Add option to HttpClient to turn of auto uncompression
R=ajohnsen@google.com
BUG=http://dartbug.com/19769

Review URL: https://codereview.chromium.org//370743003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38012 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-04 12:59:37 +00:00
ajohnsen@google.com 877d4c2138 Validate headers when added to HttpHeaders.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//364313002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38009 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-04 11:04:03 +00:00
asiva@google.com a2d7a425c9 - Remove Dart_ReceivePortGetId, Dart_GetReceivePort and Dart_PostMessage.
- Change _EventHandler._sendData to use a sendport object instead of a
  receiveport object.

R=iposva@google.com

Review URL: https://codereview.chromium.org//359673002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37827 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 17:46:26 +00:00
ricow@google.com 9e8dcea244 Fix typo in dart:io process documentation
BUG: http://dartbug.com/19590

R=ajohnsen@google.com, ricow@google.com

Review URL: https://codereview.chromium.org//349753002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37775 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-27 07:06:24 +00:00
whesse@google.com 7c2cc61e30 Fix type error in r37647
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//349403003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37654 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 11:30:15 +00:00
whesse@google.com cd2b96afd8 Add _owner setter to RawSecureSocket.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//354593002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37647 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 09:40:48 +00:00
lrn@google.com 736db44293 New Uri.parse and validation.
Ensures that the resulting URI is valid.
Escapes invalid characters except the gen-delim group of delimites, where
escapes are allowed.

R=ajohnsen@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//335373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37479 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 09:05:07 +00:00
lrn@google.com 31eeb6caf2 Revert "New, more validating, parser for URI." and follow-up patches.
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//337033003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37359 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 12:32:35 +00:00
lrn@google.com c7d98e335b New, more validating, parser for URI.
BUG= https://code.google.com/p/dart/issues/detail?id=16081
R=ajohnsen@google.com, fschneider@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//321543003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37346 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 07:00:22 +00:00
kevmoo@google.com 8822c6c905 Fixed toString of Platform.environment on Windows
BUG= https://code.google.com/p/dart/issues/detail?id=19244
R=lrn@google.com

Review URL: https://codereview.chromium.org//325533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37192 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 18:37:08 +00:00
ajohnsen@google.com b908de9ec0 Add HttpServerConnection to Observatory.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//302173007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37166 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 07:33:37 +00:00
ajohnsen@google.com 4daef42a37 Enable throttleing of HttpClient per host, with default being 6.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//311513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36861 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 10:38:02 +00:00
ajohnsen@google.com e92ee05abc Fix assertion in http-client.
It's okay to have outstanding socket connections, while doing a force
close. They will be cleaned up later (we have no way of breaking a
socket connect).

BUG=

Review URL: https://codereview.chromium.org//309033002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36859 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 09:46:59 +00:00
ajohnsen@google.com e6137e4d1e When a connection is upgraded, don't return it as idle.
Instead we now simply close the socket and return a 'done' stream
subscription, if the user listened to the response. The only way to get
data from a 'upgraded' response, is now by actually doing a detach.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//308923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36858 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 08:17:38 +00:00
ajohnsen@google.com 41489d93fa Make the _ConnectionTarget responsible of doing the Socket connect.
This also introduces the concept of a connecting-counter, for the number
of sockets currently performing a new connection.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//304393005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36857 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 07:52:09 +00:00
ajohnsen@google.com 8b612e8780 Add read/write stats to Socket and RandomAccessFile.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//298353002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36738 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 13:29:51 +00:00
ajohnsen@google.com 9c7979ed1f Add 'owner' field to sockets, that point to a potential IO resource using that Socket.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//304513004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36680 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 14:10:31 +00:00
ajohnsen@google.com 7a7a63a513 Untype 'Socket' a few places, where we try to call a hidden function.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//300113005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36673 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 13:17:56 +00:00
ajohnsen@google.com 217e8b8605 Add WebSockets to Observatory.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//300043011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36667 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 11:37:51 +00:00
ajohnsen@google.com 7aed60d005 Show actualy FD for files in Observatory.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//296403005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36656 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 09:18:43 +00:00
ajohnsen@google.com dbb592ed0a Put delivering of parsed http-requests at the end of the message-queue.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//298143003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36655 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 09:17:57 +00:00
ajohnsen@google.com 6bb3c6e99b Merge _idleConnections and _activeConnections into one structure, _ConnectionTarget.
The connection-target will at some point be in charge of handling
http client throttling.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//280813003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36646 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 06:58:06 +00:00
ajohnsen@google.com 44d8df4bb4 Add Socket ref to HttpServer.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//297213005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36644 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 06:38:15 +00:00
johnmccutchan@google.com 19efb28eab Add initial Random Access File information to Observatory
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//291343009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36638 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 15:34:31 +00:00
ajohnsen@google.com 968fb8ee31 Add missing files.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//293013008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36420 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 11:27:47 +00:00
ajohnsen@google.com 198b11bd9b Add IO service object handler, with initial implementation for HTTP server.
This is tempoary disabling the Socket service handler.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//284313011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36417 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 11:12:49 +00:00
ajohnsen@google.com 50a8f03b5a Fix websocket status-code for when the close-timer or error cases.
BUG=
R=ricow@google.com

Review URL: https://codereview.chromium.org//297653003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36346 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 07:48:58 +00:00