Skip to content

_HttpInputStream can fire both onError and onClosed #7013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nex3 opened this issue Nov 28, 2012 · 4 comments
Closed

_HttpInputStream can fire both onError and onClosed #7013

nex3 opened this issue Nov 28, 2012 · 4 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@nex3
Copy link
Member

nex3 commented Nov 28, 2012

The following code consistently reproduces this:

    void main() {
      var server = new HttpServer();
      server.defaultRequestHandler = (request, response) {
        request.inputStream.onData = request.inputStream.read;
        request.inputStream.onClosed = response.outputStream.close;
      };
      server.listen('127.0.0.1', 0);

      var client = new HttpClient();
      var url = new Uri.fromString("http://localhost:${server.port}");
      var connection = client.openUrl("GET", url);
      connection.onError = (e) => print("connection error: $e");
      connection.onRequest = (request) => request.outputStream.close();
      connection.onResponse = (response) {
        response.inputStream.onData = response.inputStream.read;
        response.inputStream.onError = (e) => print("response stream error: $e");
        response.inputStream.onClosed = () {
          print("response stream closed");
          server.close();
        };

        print("response headers received");
        client.shutdown(force: true);
      };
    }

@nex3
Copy link
Member Author

nex3 commented Nov 28, 2012

Added this to the M2 milestone.
Removed Priority-Medium label.
Added Priority-High label.

@madsager
Copy link
Contributor

Set owner to @sgjesse.

@sgjesse
Copy link
Contributor

sgjesse commented Dec 3, 2012

Fixed in https://code.google.com/p/dart/source/detail?r=15570.


Added Fixed label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@nex3 nex3 added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels May 14, 2014
@nex3 nex3 added this to the M2 milestone May 14, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants