correctly reflect the server's port in httpd.js

RESOLVED FIXED in mozilla24

Status

RESOLVED FIXED
6 years ago
10 months ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

(Blocks: 1 bug)

unspecified
mozilla24
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

6 years ago
Created attachment 763714 [details] [diff] [review]
correctly reflect the server's port in httpd.js

httpd.start says that you can pass -1 in to automagically choose a port.
Unfortunately, the identity of that port is not correctly reflected in the
ServerIdentity that the server exposes, since the -1 port is passed directly
in to ServerIdentity, with bad consequences:

http://mxr.mozilla.org/mozilla-central/source/netwerk/test/httpserver/httpd.js#903

Instead, initialize the ServerIdentity with the port from the listening socket
we initialized.
Attachment #763714 - Flags: review?(ted)
(Assignee)

Updated

6 years ago
Blocks: 813742
Comment on attachment 763714 [details] [diff] [review]
correctly reflect the server's port in httpd.js

Review of attachment 763714 [details] [diff] [review]:
-----------------------------------------------------------------

Does -1 actually work? I know zero is the common way to do this at the actual BSD socket API level.
Attachment #763714 - Flags: review?(ted) → review+
Assignee: nobody → nfroyd
(Assignee)

Comment 3

6 years ago
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #2)
> Does -1 actually work? I know zero is the common way to do this at the
> actual BSD socket API level.

nsServerSocket will accept 0, but nsIServerSocket and nsIHttpServer both document -1 as the "let a port be chosen for me".  So it seemed better to use that instead.

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/c660bb960b57
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24

Updated

6 years ago
Blocks: 884421
Component: httpd.js → General
Product: Testing → Testing
You need to log in before you can comment on or make changes to this bug.