Closed
Bug 862740
Opened 11 years ago
Closed 11 years ago
httpd doesn't work if port is -1
Categories
(Add-on SDK Graveyard :: General, defect, P3)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: slash, Unassigned)
References
Details
Attachments
(2 files)
1021 bytes,
patch
|
jsantell
:
review+
|
Details | Diff | Splinter Review |
479 bytes,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 Iceweasel/20.0 Build ID: 20130402195902 Steps to reproduce: Set DEBUG to true and run this code: const { nsHttpServer } = require("sdk/test/httpd"); const srv = new nsHttpServer(); srv.start(-1); srv.stop(function(){}); Actual results: error: test: An exception occurred. undefined: undefined undefined undefined Traceback (most recent call last): HTTPD-INFO | >>> listening on port 37744, 11 pending connections HTTPD-INFO | *** unexpected port: '-1' HTTPD-INFO | !!! could not start server on port -1: 2147942487 Expected results: HTTPD-INFO | >>> listening on port 43110, 11 pending connections HTTPD-INFO | >>> stopping listening on port 43110 HTTPD-INFO | >>> shutting down server on port 43110 HTTPD-INFO | *** no open connections, notifying async from onStopListening HTTPD-INFO | *** _notifyStopped async callback
What do you expect this to do?
Flags: needinfo?(slash)
Reporter | ||
Comment 2•11 years ago
|
||
(In reply to Wes Kocher (:KWierso) from comment #1) > What do you expect this to do? A server picks a free port. This is the document of nsIHttpServer::start: /** * Starts up this server, listening upon the given port. * * @param port * the port upon which listening should happen, or -1 if no specific port is * desired
Flags: needinfo?(slash)
Priority: -- → P3
Attachment #738425 -
Flags: review?(jsantell)
Comment 3•11 years ago
|
||
Kusanagi, thank you for this. Can you add a test for ports with -1?
Flags: needinfo?(slash)
Reporter | ||
Comment 4•11 years ago
|
||
Flags: needinfo?(slash)
Updated•11 years ago
|
Attachment #738425 -
Flags: review?(jsantell) → review+
Comment 5•11 years ago
|
||
Kusanagi, looks good! To get those changes into the repo though, we need to submit through a GitHub PR -- if you'd like to have the honours, shoot over a pull request at https://github.com/mozilla/addon-sdk, or I can do it, but figured I'd ask first if you're interested. Thanks!
Flags: needinfo?(slash)
Reporter | ||
Comment 6•11 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #5) > Kusanagi, looks good! To get those changes into the repo though, we need to > submit through a GitHub PR -- if you'd like to have the honours, shoot over > a pull request at https://github.com/mozilla/addon-sdk, or I can do it, but > figured I'd ask first if you're interested. Thanks! Could you send a pull request?
Flags: needinfo?(slash)
Comment 7•11 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/6bff70e2dedfca7c6f4c6427db45b152135fd303 Bug 862740 set httpd port to any valid port if set to -1 https://github.com/mozilla/addon-sdk/commit/c009458b6512a933ad2b508edbccccb62623077e Merge pull request #985 from jsantell/httpd Bug 862740 set httpd port to any valid port if set to -1
Updated•11 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Blocks: 869687
You need to log in
before you can comment on or make changes to this bug.
Description
•