Commit graph

802 commits

Author SHA1 Message Date
Søren Gjesse c05c8c6606 Revert change to Platform.excutable and add Platform.resolvedExecutable
The change to Platform.excutable in
e03ab17437 was a breaking change and it
has been reverted.

A new getter Platform.resolvedExecutable has been added to provide the
the fully qualified path of the executable.

BUG=https://github.com/dart-lang/sdk/issues/16994
R=lrn@google.com, kustermann@google.com, len@google.com

Review URL: https://codereview.chromium.org//1180623006.
2015-06-15 10:13:21 +02:00
Søren Gjesse f05608c49d Fix errors in previous commit
Commit was 897d05b6f0.

TBR=lrn@google.com
BUG=http://dartbug.com/23521

Review URL: https://codereview.chromium.org//1145403004
2015-05-27 11:18:03 +02:00
Søren Gjesse 897d05b6f0 Fix argument processing for RandomAccessFile.writeFrom
It is now the same as for RandomAccessFile.writeFromSync

Added some tests.

R=lrn@google.com
BUG=http://dartbug.com/23521

Review URL: https://codereview.chromium.org//1156993003
2015-05-27 10:01:24 +02:00
Søren Gjesse e03ab17437 Make Platform.executable return the fully qualified path of the executable
BUG=http://dartbug.com/16994
R=kustermann@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1145053002
2015-05-20 13:14:51 +02:00
johnmccutchan@google.com 64f6d0db2e Fix Typo in exitCode documentation
This should probably be merged into 1.10 if possible.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45686 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 14:20:39 +00:00
sgjesse@google.com 6a4e6571f4 Add handling of HTTP '100 Continue' intermediate response
The '100 Continue' intermediate response is just ignored, as there
is currently no API for the client to wait to this.

BUG=http://dartbug.com/23413
R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45685 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 13:48:15 +00:00
sgjesse@google.com 197f336534 Make sure to process WebSocket frames when closing a WebSocket
On a WebSocket the actual listening on the stream is causing the
processing of inbound frames to start. If the connection is closed
without ever being listened on, then a close frame from the other end
will not be processed.  In this case the timeout of waiting for a
close from the other end will always be hit.

If you are _only_ using the WebSocket connection in one direction it
seems a bit artificial to have to listen on the stream to even process
the close frame.

This change will make sure the stream is listened to when closing a
WebSocket.

This is a breaking change. Before you could close and then
listen. With this change that sequence will throw on the listen. This
is reflected in the changes that was needed for the tests.

R=kustermann@google.com, lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45679 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 09:32:39 +00:00
sgjesse@google.com 4d85e2a2aa Revert "Fix warnings and hints in the SDK"
This reverts r45331.

TBR=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45338 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 11:08:38 +00:00
sgjesse@google.com f8eaff5b69 Fix warnings and hints in the SDK
BUG=
R=paulberry@google.com, sgjesse@google.com, whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45331 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:35:49 +00:00
sgjesse@google.com 170be8d7d1 Process outstanding events before making a new HTTP client request
This re-applies r45127, which was reverted in r45129. The revert was due
to a failing test which is re-written here to perform the separate steps
in a deterministic order.

Original change description:

This fixes the issue of using a HTTP client connection from the
connection pool which was closed and where the close indication has
already been received by the event handler.

This specifically fixes the 'pub get' issue where a long running
constraint resolver would end with the error "Connection closed before
full header was received"

Retrying GET methods when the connection is closed after succesfuly
sending (parts of) the request is still missing.

R=lrn@google.com

BUG=http://dartbug.com/21798

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45313 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 12:14:55 +00:00
lrn@google.com d8dbb4a60f Add Uri.directory constructor.
Make Directory.uri getter use the new constructor.
This also fixes that the uri getter doesn't work correctly on Windows.

Add uri getter on file system entity.

BUG= http://dartbug.com/17065
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45227 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 08:56:03 +00:00
lrn@google.com 8cf32dc1a1 Add uri getter on file system entity.
BUG= http://dartbug.com/20362
Also:
BUG= http://dartbug.com/19428
BUG= http://dartbug.com/17065
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45226 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 07:31:26 +00:00
lrn@google.com 5cbb84dfa2 Add normalizePath to Uri class.
The algorithm for removing '.' and '..' from a path is only available through the [resolve] method.
This change makes it available directly as a function on a Uri, returning a new Uri if necessary.
The current workaround is to do:
  var normalizedUri = new Uri().resolveUri(originalUri);

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45163 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 11:56:35 +00:00
sgjesse@google.com 03406cc9a3 Revert "Process outstanding events before making a new HTTP client request"
Broke the test standalone/io/https_bad_certificate_test

TBR=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45129 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 09:25:18 +00:00
sgjesse@google.com f2ff9a3046 Process outstanding events before making a new HTTP client request
This fixes the issue of using a HTTP client connection from the
connection pool which was closed and where the close indication has
already been received by the event handler.

This specifically fixes the 'pub get' issue where a long running
constraint resolver would end with the error "Connection closed before
full header was received"

Retrying GET methods when the connection is closed after succesfuly
sending (parts of) the request is still missing.

R=kustermann@google.com

BUG=http://dartbug.com/21798

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45127 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 08:24:57 +00:00
sgjesse@google.com 5bfb1c608d Cleanup change in r44998 a bit
This also makes it easier to inline _headersEnd again if required (for
performance reasons).

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44999 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 11:53:03 +00:00
sgjesse@google.com c6e632bcdb Be more lean when parsing HTTP headers
Allow only LF instaed of CRLF when parsing headers. Sometimes old or
hacked up clients will send the headers like this.

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44998 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 11:15:29 +00:00
sgjesse@google.com 5973b2c422 Make the construction of a ProcessResult public
There was really no need for it to be a private implementation.

BUG=http://dartbug.com/23070
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44935 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-07 13:05:45 +00:00
rmacnak@google.com cb1294bf3c Fix spawning a data uri on Windows.
BUG=http://dartbug.com/22943
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44691 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 18:15:12 +00:00
lrn@google.com 7a67f00b00 Ensure that stack traces are propagated more often in dart:io.
BUG= http://dartbug.com/22873
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44551 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-18 10:12:05 +00:00
sgjesse@google.com fba62ab6f9 Add case to avoid warning when dart2js analyzes dart:io files
R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44360 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 09:19:43 +00:00
paulberry@google.com 68c2533f62 Fix warnings in socket.dart.
TBR=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44334 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 18:21:59 +00:00
whesse@google.com 6e539eab53 Fix error where upgrading a closed socket to secure will hang.
BUG=dartbug.com/22658
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44324 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 16:08:09 +00:00
sgjesse@google.com 1d808d071b 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=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44319 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 13:33:28 +00:00
sgjesse@google.com 8cd4d4d425 Add the shared flag to HttpServer as well
Also mark the ServerSocketReference and friends as deprecated and to
be removed in Dart 1.10

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43809 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 13:14:49 +00:00
sgjesse@google.com 59f8932c9d Update documentation for Platform.version
Add test that Platform.version does start with a valid semver string.

BUG=http://dartbug/22244
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43723 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 13:35:56 +00:00
sgjesse@google.com 57f7d429d6 Make an enumeration added for 1.9 a real enum
R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43714 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 08:11:39 +00:00
kustermann@google.com 615d1a01ac Reland "Introduce optional 'bool shared' parameter to ServerSocket.bind() ..."
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43678 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 10:01:20 +00:00
sgjesse@google.com 7b7ac3620a Add support to specify the source address for socket connect
BUG=http://dartbug.com/22253
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43638 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 11:56:51 +00:00
sgjesse@google.com 3e993231d1 Add support for user info on ws: and wss: URLs
BUG=http://dartbug.com/22152
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43586 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 09:17:55 +00:00
sgjesse@google.com 7fdc66cc67 Change Mac OS to OS X in dart:io dartdoc
OS X is the official name.

R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43501 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 11:47:04 +00:00
rmacnak@google.com cc2e1e4bd1 Make _FileSystemWatcher.watch private.
It doesn't verify the path is a string before running native code, so when invoked via mirrors it will hit an uncatchable API error instead of a Dart exception.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43487 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 21:39:38 +00:00
kustermann@google.com 1d6231bacd Revert "Introduce optional 'bool shared' parameter to ServerSocket.bind() ..."
Review URL: https://codereview.chromium.org//896213002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43476 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 16:00:21 +00:00
kustermann@google.com 3c6c29fee9 Introduce optional 'bool shared' parameter to ServerSocket.bind() ...
R=sgjesse@google.com, wibling@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43467 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 13:41:41 +00:00
sgjesse@google.com 833e5d9aee Add support for killing a process with a given PID to dart:io
R=lrn@google.com, kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43455 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 08:20:33 +00:00
sgjesse@google.com 9aa4805e21 Add an option for starting a detached process with stdio connected
R=lrn@google.com, kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43393 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 13:38:38 +00:00
iposva@google.com ad008bf8ba - Move timer implementation closer to the rest of message handling.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43225 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:39:35 +00:00
sgjesse@google.com f6a10fbdf1 Add support for starting a detached process
BUG=http://dartbug.com/20970
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43070 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 11:49:39 +00:00
rmacnak@google.com 2fb0bb020b Reapply "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broken assumption in Dartium fixed in blink r188698.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43053 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 20:44:04 +00:00
rmacnak@google.com ed88ac7f0c Revert "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broke Dartium.

TBR=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43026 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 20:56:59 +00:00
rmacnak@google.com 045bd762d7 Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list.
An invisible function is hidden from stack traces, will not be enumerated
by mirrors, and cannot be directly invoked by mirrors. Note that private
classes remain accessible.

Fix a few internal dart:io functions that should be private.

Fix bug where mirrors would enumerate top-level invisible functions.

Mark observatory test that was using such private functions through
mirrors as failing.

BUG=http://dartbug.com/15274
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43019 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 18:32:19 +00:00
iposva@google.com d451b0336c - Reduce the amount of messages being sent for Timer.run().
- Fast exit for empty timer queues.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43015 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 16:02:31 +00:00
sgjesse@google.com 30ae29f4f2 Reapply revert of "Make stdout/stderr async"
This re-applies r42909 which was reverted in r42910 with a few fixes.

TBR=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42953 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 13:35:37 +00:00
sgjesse@google.com c831cdf97f Revert "Revert "Make stdout/stderr async""
This reverts commit r42909

TBR=ricow@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42910 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 14:33:35 +00:00
sgjesse@google.com bc1be9c45f Revert "Make stdout/stderr async"
This makes writes to the stdout and stderr IOSinks in dart:io blocking again.

To get the non-blocking behaviour the getter "nonBlocking" will return an
IOSink with real non-blocking behaviour.

Updated the class exposed for stderr to also support checking for whether it
is connected to a terminal and checking the terminal size.

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

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42909 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 14:18:16 +00:00
sgjesse@google.com cff4524be3 Remove the explicit scheduling of HTTP requests
With the changed timer implementation removing this improves performance.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42871 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 13:48:14 +00:00
sgjesse@google.com aae3e42f82 Allow additional headers for WebSocket connect
The WebSocket.connect now takes an Map of headers to add to the
initial handshake request.

BUG=http://dartbug.com/15855
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42870 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 13:43:43 +00:00
asiva@google.com ca1c3241c4 Fix for issue 21398.
Accept only 'literal-like' objects when sending messages to isolates
spawned using spawnURI. Allow all objects for isolates spawned using
spawnFunction.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42793 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 23:14:30 +00:00
sgjesse@google.com 218e366f89 Add support for file locking
This adds support for file locking in dart:io.

BUG=http://dartbug.com/17045
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42733 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 13:06:37 +00:00
sgjesse@google.com 6a6e55d804 Update the documentation for FielSystemEntity.resolveSymbolicLinks
The platform difference was the opposite of what was documented.

With the following directory structure

 /tmp/xxx
        a/b
        x -> a/b

resolving x/.. on Windows results in /tmp/xxx and on Linux results in
/tmp/xxx/a. Resolving just x results in /tmp/xxx/a/b on both platforms.

R=whesse@google.com, lrn@google.com
BUG=http://dartbug.com/21967

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42725 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 08:20:11 +00:00