Closed
Bug 956328
(stream.js)
Opened 10 years ago
Closed 10 years ago
/lib/sdk/io/net.js -- Stream.resume triggers a resume on an unpaused stream pump.
Categories
(Add-on SDK Graveyard :: General, defect, P3)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: rodneyd.teal, Assigned: rodneyd.teal)
References
()
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release) Build ID: 20131228030204 Steps to reproduce: var net = require('sdk/io/net'); var server = net.createServer(function(c) { //'connection' listener console.log('server connected'); c.on('end', function() { console.log('server disconnected'); }); //c.write('hello\r\n'); c.pipe(c); }); server.listen(8124, function() { //'listening' listener console.log('server bound'); }); function test() { var client = net.connect({port: 8124}, function() { //'connect' listener console.log('client connected'); client.write('world!\r\n'); }); client.on('data', function(data) { console.log(data.toString()); client.end(); }); client.on('end', function() { console.log('client disconnected'); }); } test(); test(); test(); Actual results: nsIInputStreamPump.resume throws NS_ERROR_UNEXPECTED
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
Patch attached.
Assignee | ||
Updated•10 years ago
|
Summary: /lib/io/net.js Stream.resume triggers a resume on an unpaused stream pump. → /lib/sdk/io/net.js Stream.resume triggers a resume on an unpaused stream pump.
Assignee | ||
Updated•10 years ago
|
Alias: stream.js
Summary: /lib/sdk/io/net.js Stream.resume triggers a resume on an unpaused stream pump. → /lib/sdk/io/net.js -- Stream.resume triggers a resume on an unpaused stream pump.
Comment 2•10 years ago
|
||
Comment on attachment 8355568 [details]
patch.diff.js Stream.pipe defines an onResume listener on target stream
Irakli, can you help decipher get this fixed?
Attachment #8355568 -
Flags: review?(rFobic)
Comment 3•10 years ago
|
||
I think proper fix would be to fix InputStream.resume instead: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/io/stream.js#L193 probably by checking if underlying request is pending before resuming it: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/NsIRequest#isPending%28%29 We should also add a test case to ensure no regressions are introduced in a future, which may be tricky without net module, but still probably possible using fs.createReadStream. @rodneyd do you wanna make a pull request and send it our way ?
Updated•10 years ago
|
Attachment #8355568 -
Flags: review?(rFobic) → review-
Priority: -- → P3
Assignee | ||
Comment 4•10 years ago
|
||
https://github.com/mozilla/addon-sdk/pull/1339
Comment 5•10 years ago
|
||
Updated•10 years ago
|
Attachment #8486936 -
Flags: review?(rFobic)
Updated•10 years ago
|
Assignee: nobody → rodneyd.teal
Updated•10 years ago
|
Attachment #8486936 -
Flags: review?(rFobic) → review+
Comment 6•10 years ago
|
||
Commit pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/0d878a2eb711f79fd96da962098554a9829755a7 Merge pull request #1339 from DecipherCode/master Bug 956328 Stream.resume triggers a resume on an unpaused stream pump r=@gozala
Updated•10 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•