Skip to content

AsyncWrap: HTTP has no handle context #3241

Closed
@AndreasMadsen

Description

@AndreasMadsen

When creating a simple HTTPserver and connecting to it one looses the handle context. Meaning there is no way to know what handle or callback created the new handle.

'use strict';
const http = require('http');
const server = http.createServer(function (req, res) {
  res.end('hallo world');
});

server.listen(0, 'localhost', function () {
  const addr = server.address();
  const req = http.get(`http://${addr.address}:${addr.port}`, function (res) {
    res.resume();
    res.once('end', server.close.bind(server));
  });
});

Note that this issues exists even after applying #3216 (adds parent to init hook)

complete test case: https://gist.github.com/AndreasMadsen/f56bbdbcd18a2c6358f3
dprof dump: http://bl.ocks.org/AndreasMadsen/raw/6c460eb0e7d6eeadb31a/

skaermbillede 2015-10-07 kl 20 21 09

/cc @trevnorris

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.httpIssues or PRs related to the http subsystem.questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions