Commit Graph

3601 Commits

Author SHA1 Message Date
sgjesse@google.com 144e6d044c Add handling of HTTP header "Expires"
The value of the "Expires" header is now available as a property on
the HttpResponse and the HttpClientResponse.

Added formatting of dates as HTTP dates in RFC 1123 format and parsing
of HTTP dates in all three formats mentioned in RFC 2616.

R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpDateTest.dart

Review URL: https://chromiumcodereview.appspot.com//9602011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5016 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 11:24:11 +00:00
sgjesse@google.com 93eecd778e Add handling of the HTTP header "Host"
R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpTest.dart

Review URL: https://chromiumcodereview.appspot.com//9616004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5015 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 10:59:28 +00:00
antonm@google.com 7c443aefcf Force not-Unicode version of libdart_builtin.
Current implementation of file/process/etc. assumes it anyway.

Review URL: https://chromiumcodereview.appspot.com//9600017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4955 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 15:11:51 +00:00
ager@google.com b2b123d24b Update Timer API to take the callback as the last parameter.
This makes the code easier to read when the callback actually does
work:

  new Timer(1000, (t) {
    // do
    // lots
    // of
    // stuff
  });

Also, it is more consistent with the rest of the APIs.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9597015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4945 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 12:43:41 +00:00
sgjesse@google.com b29e72fdbd Make the HttpParser and HttpUtil classes private
Move to separate files for sourcing these in the tests.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9581011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4934 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 08:04:04 +00:00
sgjesse@google.com 086c1f0c3a Handle closing of HTTP client and server
For the server keep track of the state of the connection and close the
socket when it is closed by the client. The client might close the
connection both when processing a request and while the connection is
an idle keep alive connection.

For the client keep track of the active connections as well as the
idle keep alive connections. When the client is closed make sure to
close all connections.

R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpShutdownTest.dart

Review URL: https://chromiumcodereview.appspot.com//9589001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4932 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 07:06:37 +00:00
sgjesse@google.com 096badbb62 Use a pool of native ports for file operations
See description on https://chromiumcodereview.appspot.com/9568010/

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyFileOperationsTest.dart

Review URL: https://chromiumcodereview.appspot.com//9569010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4854 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 07:29:20 +00:00
sgjesse@google.com b52a27889d Use a pool of native ports for directory operations
Each directory object creates a new service port which will start a
new thread. As these service ports are currently never closed this is
a huge problem causing the standalone VM to fail when running out of
threads.

This change uses a pool of native ports for directory operations. This
still ensures that the operations for each directory object are
serialized and limits the number of native ports allocated and thus
threads started.

Even when closing of native ports is possible we might want to keep
some kind of pool like this. The reason for this is that to actually
determine when the native port is not needed any more we need a
finalizer callback on the directory object.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyDirectoryOperationsTest.dart

Review URL: https://chromiumcodereview.appspot.com//9568010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4795 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 14:29:12 +00:00
sgjesse@google.com 9091eeff05 Missing handling of default arguments in socket stream readInto
Also made it a bit easier to write a socket connection test.

R=ager@google.com

BUG=dart:1925
TEST=tests/standalone/src/Regress-1925.dart

Review URL: https://chromiumcodereview.appspot.com//9568006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4793 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 12:32:52 +00:00
ager@google.com 242bba108b Reapply dart:io API changes.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9568004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4790 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 10:07:35 +00:00
ager@google.com fd31551ca4 Revert "Rename blahHandler to onBlah throughout dart:io."
D'oh! I need to update the test binaries as well. Reverting, building
and putting back in again.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9570004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4785 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:43:15 +00:00
ager@google.com 40e0bceab5 Rename blahHandler to onBlah throughout dart:io.
Additionally, change all single-shot methods to take their callback as an argument instead of registering it on the object.

I have attempted to find all uses in the repo but there might
be some firefighting to do when this lands.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9500002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4784 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:36:04 +00:00
ager@google.com f1b2e219ce Fix close callback on FileInputStreams.
Not waiting for the underlying file to actually close before
setting streamMarkedClosed can lead to too early close callbacks.

R=sgjesse@google.com
BUG=dart:1922
TEST=standalone/FileTest.dart

Review URL: https://chromiumcodereview.appspot.com//9540009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4754 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 15:42:19 +00:00
sgjesse@google.com 1ae77db2aa Add statusCode and reasonPhrase getters and setters to the HttpResponse interface
These where missing in the interface.

R=ager@google.com

BUG=dart:1919
TEST=tests/standalone/src/HttpTest.dart

Review URL: https://chromiumcodereview.appspot.com//9500014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4750 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 12:59:44 +00:00
asiva@google.com 738f458956 Changes to get rid of dependency on openssl in the dart VM.
(This will enable dartium to be built on the windows platform).
Review URL: https://chromiumcodereview.appspot.com//9481019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4717 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 18:36:39 +00:00
sgjesse@google.com 17abda51e5 Include HTTP library in the standalone VM
HTTP support is part of library dart:io.

The current interface is defined in runtime/bin/http.dart

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9488008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4692 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 15:11:34 +00:00
sgjesse@google.com d7c1a2835f Prepare the HTTP library for inclusion in the standalone VM (step 2)
Change the handling of the received data on HTTPRequest and
HTTPClientResponse to use the InputStream interface instead of
dataReceived and dataEnd handlers.

We should probably do something to make the following serer side and
client side patterns simpler:

void handler(HTTPRequest request, HTTPResponse response) {
  ...
  StringBuffer body = new StringBuffer();
  StringInputStream input = new StringInputStream(request.inputStream);
  input.dataHandler = () => body.add(input.read());
  input.closeHandler = () {
    String data = body.toString();
    ...
  }
}

HTTPClientConnection conn = ...
  conn.responseHandler = (HTTPClientResponse r) {
  ...
  StringBuffer body = new StringBuffer();
  StringInputStream input = new StringInputStream(request.inputStream);
  input.dataHandler = () => body.add(input.read());
  input.closeHandler = () {
    String data = body.toString();
    ...
  }
}

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

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9495007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4679 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 13:04:04 +00:00
ager@google.com 4d94b5c4d9 Move back to having File.open{Input,Output}Stream return the stream directly.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9487005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4677 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 12:28:42 +00:00
whesse@google.com 87466eccdd Fix type warnings in dart:io library.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9494004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4672 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 11:09:41 +00:00
ager@google.com acc7252c25 Fix type warning.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9487003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4663 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 08:51:07 +00:00
ager@google.com 103804d7f2 Make FileInputStream and FileOutputStream actually asynchronous.
Use the async API of the underlying file.

This also means that openInputStream and openOutputStream can
directly return the stream without performing IO. I'll do that
change as a follow-up.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9474004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4662 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 08:38:25 +00:00
sigmund@google.com ee6a907611 isolates refactor: this change introduces 'dart:isolate' as a library. This is a
big global change, so let me explain in more detail. This refactoring CL does
the following:
- moves all the dart code for isolates in a common library (lib/isolate)

- changes frog to understand 'dart:isolate' imoprts by loading the code from the
  location above.

- changes the vm to undernstand 'dart:isolate' imports by creating a separate
  library that is part of the bootstrap. This follows the same code-structure
  that Todd suggested in his CL introducing the mirror library

- changes dartc to use the shared isolate library as the source of truth for
  type checking. I left around some of the internal js code in dartc so that the
  backend continues to work for apps that don't use isolates.

- changes all tests that use isolates to import the library explicitly (this is a large bulk of the files in this CL)

- changes test status for tests we can't fix in this repo (e.g. co19)

- splits the isolate library code to make it possible to preserve some tests
  without exposing internal types (e.g. tests about
  serialization/deserialization)

- changes the create_sdk script to copy the isolate library to the sdk

- includes the isolate library in dartdoc

I'll wait for at least one lgtm from each area (dartc, vm, frog, sdk)

There is one important pending thing this CL doesn't do:
- update test_runner.dart: This should be updated next time we upload the new
  binaries to tool/testing/bin
- dartium specific changes: Vijay, is there anything I need to do for dartium?

Review URL: https://chromiumcodereview.appspot.com//9422019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4647 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:50:44 +00:00
ager@google.com e286176171 Implement File.{readAsBytes, readAsText, readAsLines}.
Convenience methods to use if all you care about is getting the
entire contents of a file.

R=sgjesse@google.com
BUG=1579
TEST=standalone/FileTest

Review URL: https://chromiumcodereview.appspot.com//9452014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4568 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-24 13:31:38 +00:00
whesse@google.com f3ab33610d Use correct format for gyp file when adding -ldl linker flag.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9452013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4536 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 14:52:40 +00:00
whesse@google.com 47f51c1053 Add -ldl linker flag to libdart_builtin link step.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9447018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4532 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 14:25:52 +00:00
whesse@google.com 33acdc584a Add -ldl linker flag to Dart shell extensions test shared library link.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9442016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4530 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 13:46:36 +00:00
whesse@google.com 0e40002890 Add native extensions to the Dart shell, on the linux platform.
BUG=
TEST=standalone/TestExtensionTest

Review URL: https://chromiumcodereview.appspot.com//9430051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4529 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 13:25:11 +00:00
sgjesse@google.com e07a1f818e Fix bug in Directory after porting to using native ports
The full path was no longer provided to the directory handler

R=ager@google.com

TEST=tests/standalone/src/DirectoryTest.dart

BUG=

Review URL: https://chromiumcodereview.appspot.com//9452009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4521 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 11:13:35 +00:00
sgjesse@google.com 5a38a88099 Port async file operations to be using native ports instead or an isolate
R=ager@google.com

Review URL: https://chromiumcodereview.appspot.com//9415043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4520 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 11:11:48 +00:00
ager@google.com 7e4a36278f Implement File.directory() and File.directorySync() to get
containing directory for a file.

BUG=dart:1618
TEST=standalone/FileTest

Review URL: https://chromiumcodereview.appspot.com//9416096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4464 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 16:18:39 +00:00
sgjesse@google.com 46e44ecba1 Add both sync and async methods for getting streams for a File
The File class used to have two synchronous methods
openInputStream and openOutputStream for getting streams for a
file. These have now been changed to work asynchronously by the
associated callback inputStreamHandler or outputStreamHandler
when the stream is opened and available.

To support the synchronous API two new methods
openInputStreamSync and openOutputStreamSync which returns the
stream directly as before have been added.

The actual implemnetation of the file streams still uses the
synchronous file API internally. However this change
adds "simulated" handling of noPendingWriteHandler and
closeHandler for file output stream.

R=ager@google.com

BUG=dart:1784

TEST=

Review URL: https://chromiumcodereview.appspot.com//9432023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4452 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 14:11:04 +00:00
iposva@google.com a68ea7e455 - Windows only: Move the BN library link dependency into the standalone binaries.
Review URL: https://chromiumcodereview.appspot.com//9433021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4416 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 00:36:14 +00:00
sgjesse@google.com 18df1964f7 Fix bug from r4390 on Windows
The file handler did not pass the full path.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9428002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4391 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 13:29:52 +00:00
sgjesse@google.com 9390f1577a Run all directory async operations on a separate thread using native ports
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9310082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4390 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 11:35:42 +00:00
sgjesse@google.com f02c9e45d6 Add utility functions for creating and accessing Dart_CObject structures
All allocation is done using Dart_ScopeAllocate, so no explicit feeing
is required. This also means that these utilities require an active
ApiZone.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9403012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4388 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 08:59:41 +00:00
ager@google.com e2c233c750 Disallow opening of directories as files.
R=sgjesse@google.com
BUG=1614
TEST=tests/standalone/src/FileTest.dart

Review URL: https://chromiumcodereview.appspot.com//9427014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4387 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 07:22:20 +00:00
iposva@google.com 9dc3d0f49d - Add dart:json, dart:uri and dart:utf8 to the known and builtin libraries.
- Unify and simplify the building of the creation of the source file.
Review URL: https://chromiumcodereview.appspot.com//9417012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4336 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-16 19:59:19 +00:00
turnidge@google.com 5c9dbe6a05 Revert my last change. Windows dislikes long strings...
Review URL: https://chromiumcodereview.appspot.com//9407017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4281 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-15 19:25:22 +00:00
turnidge@google.com 7177dce4e9 Make gen files more human-readable by using a string initializer
instead of an integer array initializer.

For example, the initializer in builtin_gen.cc now looks something like this:

const char Builtin::builtin_source_[] =
 
  // ----- bin/builtin.dart -----

  "// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file\n"
  "// for details. All rights reserved. Use of this source code is governed by a\n"
  "// BSD-style license that can be found in the LICENSE file.\n"
  "\n"
  "#library(\"builtin\");\n"
  "#import(\"dart:nativewrappers\");\n"
  "#import(\"dart:coreimpl\");\n"
  "\n"
  "void print(arg) {\n"
  "  _Logger._printString(arg.toString());\n" /* L10 */
  "}\n"
  "\n"
  "void exit(int status) {\n"
  "  if (status is !int) {\n"
  "    throw new IllegalArgumentException(\"int status expected\");\n"
  "  }\n"
  "  _exit(status);\n"
  "}\n"
  "\n"
  "_exit(int status) native \"Exit\";\n" /* L20 */
  "\n"
  "class _Logger {\n"
  "  static void _printString(String s) native \"Logger_PrintString\";\n"
  "}\n"

;
Review URL: https://chromiumcodereview.appspot.com//9348112

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4280 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-15 19:14:03 +00:00
sgjesse@google.com b4d571dcdd Handle stdio redirection in standalone VM
The recent change to epoll on Linux and kqueue on Mac OS for getting
notifications from file descriptors caused the redirection of stdin,
stdout and stderr for the stand alone VM to stop working.

On Linux epoll failed when file descriptor 0, 1 or 2 redirected from
or to a file war registered. On Mac OS there was just no events
generated from kqueue.

The streams created for stdio, stdout and stderr is now of the correct
type and for file redirections no longer a socket object holding a
file descriptor for a regular file.

Added testing of stdio redirection using both pipes and files. These
tests are currently skipped on Windows.

Fixed handlin of short socket read when reading the process exit code.

Always close the socket port when not waiting for any events.

R=iposva@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9360040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4226 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 15:20:27 +00:00
asiva@google.com d50bbba277 Implement support for specifying string interopolation style variable substitution in the import and source statements.
e.g:
sivamach[runtime]>more /workspace/asiva/expr/test1.dart
#library('test1.dart');
#import('${GOOGLE}$SRC/test2.dart');
#import('$DART/test3.dart');
test1() {
  print("test1");
}
main() {
  test1();
  test2();
  test3();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2.dart
#library('test2.dart');
#source('$GOOGLE$SRC/test2a.dart');
test2() {
  print("test2");
  test2a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2a.dart
test2a() {
  print("test2a");
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3.dart
#library('test3.dart');
#source('test3a.dart');
test3() {
  print("test3");
  test3a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3a.dart
test3a() {
  print("test3a");
}

sivamach[runtime]>out/Debug_ia32/dart --import_map=GOOGLE,/workspace/asiva/expr --import_map=SRC,src --import_map=DART,/workspace/asiva/expr/src /workspace/asiva/expr/test1.dart
test1
test2
test2a
test3
test3a
Review URL: https://chromiumcodereview.appspot.com//9359009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4199 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 22:50:19 +00:00
sgjesse@google.com bba0b40536 Fix x64 compilation
R=srdjan@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9392003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4189 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 14:51:52 +00:00
sgjesse@google.com 0365cf42d0 Refactored thread pool
The thread pool has been refactored to hold all implementation state
in the ThreadPool class and have all internal state protected by a
single monitor.

Added support for starting and stopping the same pool several
times. When stopping the queue can be drained or not.

Added two tests which handles messages.

This change is based on https://chromiumcodereview.appspot.com/9141005/.

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

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9212043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4181 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 12:05:08 +00:00
sgjesse@google.com 18743ce4fb Fix kqueue handling of no timeout
Using a tiemout value of 0 when there was no timeout caused busy
looping int the eventhandler thread as that actually ment
immediate timeout. No timeout is specified using NULL.

BUG=dart:1641

R=iposva@google.com

TEST=

Review URL: https://chromiumcodereview.appspot.com//9350034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4176 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 09:16:57 +00:00
ager@google.com 4b8a31e201 Set SO_LINGER on sockets on windows.
Uncovered by fixed Socket tests.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9381003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4132 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 12:41:13 +00:00
ager@google.com ac5c191683 Another attempt at fixing the Socket tests.
The tests did not wait for the server isolate to finish before
exiting the main isolate.

The tests did not correctly count the number of bytes received on
the server-side. We have to count bytes per connection.

There were issues with close handlers being confused for timeouts.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9382001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4127 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 11:00:15 +00:00
ager@google.com aaed22d42e Revert "Fix potential flakiness of SocketStreamCloseTest."
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9368058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4120 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 07:06:18 +00:00
ager@google.com 4b2bfef991 Fix potential flakiness of SocketStreamCloseTest.
Not reading out all 5 bytes before moving on.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9361034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4119 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 06:57:37 +00:00
ager@google.com 3e590345ca Fix event handler assert stupidity. :-)
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9361032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4035 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-08 14:28:24 +00:00
ager@google.com 0a0f1d9504 Move the event handler on macos from poll to kqueue. Simpler and faster.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9365010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4028 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-08 12:18:29 +00:00