Commit graph

47 commits

Author SHA1 Message Date
sgjesse@google.com 395dd9961a Improve the HttpClient documentation
BUG=http://dartbug.org/9534

R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25704 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 09:26:30 +00:00
sgjesse@google.com 869cc6d4c9 Make the parameters map of the HTTP HeaderValue unmodifiable
BUG=http://dartbug.com/8951

R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25663 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 13:59:46 +00:00
ajohnsen@google.com 9c4ad196bc Add 'deadline' to HttpResponse, making it possible to give a max duration for the liveness of the response.
BUG=https://code.google.com/p/dart/issues/detail?id=8425
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25408 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 12:45:05 +00:00
ajohnsen@google.com 2bd55c23c7 Keep track of when a socket has been destroyed
This adds the event CLOSED to RawSocket and RawServerSocket. This
event indicate that the underlying socket is now destroyed.

This is used to make Socket.close and ServerSocket.close return a
future which is completed when the unserlying socket is
destroyed. This can be used to start listening on the same port after
closing a server socket.

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

BUG=https://code.google.com/p/dart/issues/detail?id=4155

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25213 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 13:26:48 +00:00
ajohnsen@google.com 9689ada62b Add 'uri' to HttpException, and include in toString.
BUG=
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24786 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-05 13:08:44 +00:00
ajohnsen@google.com ec99eb5190 Document HttpServer.
BUG=https://code.google.com/p/dart/issues/detail?id=11169
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24513 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 11:35:55 +00:00
ajohnsen@google.com 122b7cde00 Document HttpClientResponse data.
BUG=https://code.google.com/p/dart/issues/detail?id=10592
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24456 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 08:40:17 +00:00
ajohnsen@google.com 04b7752d32 Remove references to RedirectLimitExceededException.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23851 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:45:16 +00:00
ajohnsen@google.com 5ce3b9ddea Clean up dart:io exceptions.
- Introduce IOException.
- Remove HttpParserException.
- Merge RedirectLimitExceededException and RedirectLoopException into
RedirectException.
- Remove 'IO' from FileIOException, DirectoryIOException, LinkIOException
and SocketIOException.

BUG=https://code.google.com/p/dart/issues/detail?id=9955
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23848 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:15:46 +00:00
ajohnsen@google.com 2149b3a859 Add 'Server' and 'User-Agent' default header fields.
They include the major and minor version of Dart.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23844 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 11:54:15 +00:00
sgjesse@google.com 69df933ff3 Remove the HttpRequest.queryParameters getter
The parsed query parameters are now now available from the Uri object.

TBR=whesse@google.com

BUG=http://dartbug/2641

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23413 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 13:39:24 +00:00
ajohnsen@google.com 310e5b54b4 Support auto-drain of HttpRequest data.
When headers of the HttpResponse are about to be sent, and the HttpRequest have not had any subscriber yet, drain the request body and then write the headers.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23228 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 15:43:34 +00:00
ajohnsen@google.com 7715b19218 Add timeouts to HttpClient.
This introduces a per-connection timeout, configurable by setting
HttpClient.idleTimeout.

This also introduces a per-HttpClient timeout that will close idle
connections, if there have been no active connections for 100 ms.

BUG=https://code.google.com/p/dart/issues/detail?id=4857
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22920 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 09:01:20 +00:00
sgjesse@google.com f13b6178e1 Change fromString constructor to parse static method
on HeaderValue and ContentType.

R=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22406 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 07:30:02 +00:00
sgjesse@google.com a6bc37f118 Implementation of HTTP digest authentication
This is the initial implementation. I am still missing the handling of
the server changing the nonce, but will do that in a separate CL.

Also this is currently not for proxy authentication.

R=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22356 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 08:58:39 +00:00
ajohnsen@google.com d548955117 Enable parsing of IPv6 form addresse (see rfc2373 and rfc2732).
This also wraps the 'domain' component in toString with [...], if it
contains any ':' characters.

BUG=
R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22228 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 09:27:50 +00:00
sgjesse@google.com 2fdb878ebe Change the signature for all network bind calls.
All the bind calls on RawServerSocket, ServerSocket,
RawSecureServerSocket, SecureServerSocket and HttpServer (and
bindSecure on HttpServer) now have mandatory address and port
parameters. All the rest of the parameters are named optional
(including backlog).

The address parameter can be an InternetAddress or a String for all
these calls.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22227 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 09:14:04 +00:00
sgjesse@google.com 6f14d9678a Fix static type errors in a number of tests
R=ager@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21919 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 06:12:08 +00:00
sgjesse@google.com e00762188a Improve documentation on address for socket bind
R=ajohnsen@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=8410

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21545 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 12:04:38 +00:00
ajohnsen@google.com 34c499bc3f Fix HttpBodyHandler to handle missing mimeType.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21432 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 11:24:33 +00:00
sgjesse@google.com cffe6d5cd3 Fix errors in previous commit
Add method declaration to a base calss.

Actually commit comment update.

TBR=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21418 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 08:07:19 +00:00
sgjesse@google.com b5e08c477f Add support for proxies requiing authentication
R=ajohnsen@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=5468

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21417 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 07:51:33 +00:00
ajohnsen@google.com 67650cb16e Remove .writeStream, .consume and rewrite IOSink to correctly implement a (sane) well-defined behaviour of the .done future.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21416 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 07:35:45 +00:00
sgjesse@google.com 8d3d404c09 Update the dartdoc for HttpClient
There is still no docuemntation on error handling. I will add that later.

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

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21333 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 08:31:24 +00:00
sgjesse@google.com 126cbc3a3e Make the proxy server resolution from environment variables the default for HttpClient
In almost all situations where a HttpClient is used proxy support will
be needed. Having the default be enabling proxies through environment
variables will make everyones life easier.

R=ager@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21332 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 08:08:47 +00:00
ajohnsen@google.com 21451e1d3d Remove HttpClientRequest.response, as it's identical to HttpClientRequest.done.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21198 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 12:54:23 +00:00
sgjesse@google.com 484a94834b Add a function for finding the HTTP proxy server from environment variables
R=ager@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=5468

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20202 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:59:52 +00:00
sgjesse@google.com b6096848b1 Make IOSink implement StringSink
Besides adding the StringSink methods I also added writeBytes and
deprecated both add and addString.

To handle the encoding of strings the IOSike has an encoding
property. This property is mutable in situation when it makes sense to
change encoding of what is written. The exception here is for HTTP
where the encoding is determined from the header and the encoding
cannot be changed.

R=ajohnsen@google.com, ager@google.com, nweiz@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19676 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 10:06:28 +00:00
sgjesse@google.com ff47888a0d Make instances of HeaderValue and ContentType immutable
Their parameters map is still mutable though.

R=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19598 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 07:25:56 +00:00
ager@google.com 496f6edec3 Fix type warnings and remove unimplemented stuff from HttpClient interface.
R=whesse@google.com,sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19304 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 12:34:45 +00:00
ager@google.com 7b5e766190 Add missing certificate getter on HttpClientResponse and add a regression test.
Also cleaned up some internal type annotations to avoid type warnings.

R=whesse@google.com,sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19302 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 12:32:49 +00:00
sgjesse@google.com 6455f1ecee Change the HTTP header field names to lowercase
This simplifies the code and avoids duplicated constants in different cases.

R=ajohnsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18971 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 15:10:01 +00:00
whesse@google.com 396491d007 Fix some dart:io documentation comments.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18968 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 14:47:38 +00:00
sgjesse@google.com 488b016a2f Merge IO v2 branch to bleeding edge
R=ager@google.com, ajohnsen@google.com, whesse@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00
floitsch@google.com fb7b9e3c5c Rename Date to DateTime.
BUG=http://dartbug.com/1424

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17549 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 12:16:37 +00:00
floitsch@google.com 4d78b505be Switch libraries to using new tags.
Committed: https://code.google.com/p/dart/source/detail?r=15499

Committed: https://code.google.com/p/dart/source/detail?r=16255

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16287 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 21:31:34 +00:00
lrn@google.com e33455dd1f Revert "Switch libraries to using new tags."
Still errs in the editor.

TBR=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16257 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 14:01:28 +00:00
lrn@google.com a9b64329c0 Switch libraries to using new tags.
Committed: https://code.google.com/p/dart/source/detail?r=15499

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16255 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 13:09:57 +00:00
whesse@google.com ff80433b70 Add client certificates to HttpsServer and HttpClient.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16097 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 10:10:17 +00:00
sgjesse@google.com 254eae71a1 Follow the redirect rules from RFC 2616
R=ajohnsen@google.com

BUG=dart:7150

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15960 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 10:01:32 +00:00
lrn@google.com d681878a6d Revert "Switch libraries to using new tags."
It breaks completion in the editor.

TBR=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15516 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 13:44:58 +00:00
lrn@google.com abd2cf311a Switch libraries to using new tags.
Review URL: https://codereview.chromium.org//11419032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15499 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 08:54:30 +00:00
whesse@google.com 359759884b Add HttpsServer class and test.
BUG=dart:3593

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15452 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 15:36:10 +00:00
whesse@google.com d77dfe6ca0 Add support for https scheme in dart:io HttpClient.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15450 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 13:47:17 +00:00
sgjesse@google.com 7805f03972 Generate an error for active connections when the HTTP client is shutdown
Before the underlying sockets where just silently closed causing no more IO events on active connections no matter what state they where in.

Also added an optional "force" argument to HttpClient.shutdown. If that is false (the default) The HttpClient will not close active connections until they are done. This causes all pkg/http and pub tests to pass.

R=ager@google.com, nweiz@google.com

BUG=dart:6594

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15275 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-23 09:28:34 +00:00
sgjesse@google.com 6e09071a58 Make HTTP server close sockets when closed in idle state
If a connection was in the idle state and the socket was closed by the
client the server did close the connection. This caused the server to
quickly run out of resources. There was a state check missing after a
state change.

Added a COSING state as well and a way to get the number of
connections if various states.

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

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15069 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 11:11:00 +00:00
dgrove@google.com 037b2f8c60 svn add sdk
svn mv lib/sdk
svn mv lib/sdk/compiler sdk/lib/_internal
svn mv pkg/dartdoc sdk/lib/_internal

(cannot gcl upload due to .png's in dartdoc)

TBR=iposva
  


git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14473 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 14:53:15 +00:00
Renamed from lib/io/http.dart (Browse further)