-
Notifications
You must be signed in to change notification settings - Fork 7.3k
XMLHttpRequest piped in a writable file stream hangs next request #2263
Comments
Thanks for the report. Your test case depends on express however and we don't support third-party modules. I'll have to ask you to either rewrite it or contact the express people. |
Hi Ben, Thanks for the short reply, but I don't agree with you here since it looks like you stopped parsing at line 1. Express was used as a way to make the example cleaner. And I guess it's pretty obvious the problem has probably nothing to do with express. Neither do have: "XMLHttpRequest", "pipe", "writable file stream", "request". But because of that probably, I went back and minimized it further for you: http.createServer(function (req, res) {
console.log(req.url);
if (req.url == '/test') {
var fs = require('fs');
var fileStream = fs.createWriteStream('./test.txt');
req.on('end', function() {
res.writeHead(200);
res.end();
});
req.pipe(fileStream);
} else {
var response = '<html><body><script type="text/javascript">var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4) alert("XMLHttpRequest POST request performed."); }; xhr.open("POST", "/test", true); xhr.send("12345");</script><a href="/test.html">Reload</a> (This will only work every second click)</body></html>'
res.end(response);
}
}).listen(3000);
console.log('Server running at http://127.0.0.1:3000/'); |
"You don't have permission to reopen this issue." Do you mind reopening it? Thanks! |
@gabipetrovay: Thanks, I confirmed it.
Therefore, because nobody calls |
Can someone review koichik/node@b4da500? |
@bnoordhuis Can you review koichik/node@b4da500? |
@koichik: LGTM. I ran some http_simple benchmarks and didn't notice a performance difference (nothing above the level of noise anyway) but can you double-check that before you merge it? |
@bnoordhuis Thanks!
I confirmed it. I did not find the difference, too. Merging. |
@gabipetrovay Thanks for the report, fixed in a337ac7. |
* Upgrade V8 to 3.6.6.15 * Upgrade npm to 1.1.0-beta-10 (isaacs) * many doc updates (Ben Noordhuis, Jeremy Martin, koichik, Dave Irvine, Seong-Rak Choi, Shannen, Adam Malcontenti-Wilson, koichik) * nodejs#2438 segfault in node v0.6.6 * dgram, timers: fix memory leaks (Ben Noordhuis, Yoshihiro Kukuchi) * repl: fix repl.start not passing the `ignoreUndefined` arg (Damon Oehlman) * nodejs#1980: Socket.pause null reference when called on a closed Stream (koichik) * nodejs#2263: XMLHttpRequest piped in a writable file stream hang (koichik) * nodejs#2069: http resource leak (koichik) * buffer.readInt global pollution fix (Phil Sung) * timers: fix performance regression (Ben Noordhuis) * nodejs#2308, nodejs#2246: node swallows openssl error on request (koichik) * nodejs#2114: timers: remove _idleTimeout from item in .unenroll() (James Hartig) * nodejs#2379: debugger: Request backtrace w/o refs (Fedor Indutny) * simple DTrace ustack helper (Dave Pacheco) * crypto: rewrite HexDecode without snprintf (Roman Shtylman) * crypto: add SecureContext.clearOptions() method (Ben Noordhuis) * crypto: don't ignore DH init errors (Ben Noordhuis)
* V8 hash collision fix (Breaks MIPS) (Bert Belder, Erik Corry) * Upgrade V8 to 3.6.6.15 * Upgrade npm to 1.1.0-beta-10 (isaacs) * many doc updates (Ben Noordhuis, Jeremy Martin, koichik, Dave Irvine, Seong-Rak Choi, Shannen, Adam Malcontenti-Wilson, koichik) * Fix segfault in node_http_parser.cc * dgram, timers: fix memory leaks (Ben Noordhuis, Yoshihiro Kukuchi) * repl: fix repl.start not passing the `ignoreUndefined` arg (Damon Oehlman) * #1980: Socket.pause null reference when called on a closed Stream (koichik) * #2263: XMLHttpRequest piped in a writable file stream hang (koichik) * #2069: http resource leak (koichik) * buffer.readInt global pollution fix (Phil Sung) * timers: fix performance regression (Ben Noordhuis) * #2308, #2246: node swallows openssl error on request (koichik) * #2114: timers: remove _idleTimeout from item in .unenroll() (James Hartig) * #2379: debugger: Request backtrace w/o refs (Fedor Indutny) * simple DTrace ustack helper (Dave Pacheco) * crypto: rewrite HexDecode without snprintf (Roman Shtylman) * crypto: don't ignore DH init errors (Ben Noordhuis)
Hi,
This is the thread where I came across this problem:
http://groups.google.com/group/nodejs/browse_thread/thread/5691a9fd25a6a65d
In that thread there was also another bug of mine but now I managed to minimize the remaining problem here:
http://dl.dropbox.com/u/2161705/test.zip
I also paste the code here if somebody can directly see a flaw in it:
app.js
test.html
Gabriel
The text was updated successfully, but these errors were encountered: