Port 65535 incorrectly excluded

Description

The following code is used in src/clj/clojure/core/server.clj to validate whether a port number is valid:

src/clj/clojure/core/server.clj

However this is very slightly incorrect, since port 65535 is excluded but it is actually a valid port.

repl

This is corroborated by ServerSocket's Javadoc:

IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.

Patch: port-65535-obo-v2.patch

Prescreened: Alex Miller

Environment

n/a

Activity

Show:
Keyhan Vakil
August 17, 2018, 3:00 AM

Yes, just earlier today.

I agree that looks better. Current patch is port-65535-obo-v2.patch.

Alex Miller
August 17, 2018, 2:29 AM

Hi Keyhan, have you signed the Clojure Contributor Agreement? https://clojure.org/community/contributing. If not, please do so.

Another, maybe better, solution here is (<= 0 port 65535) - that reads more closely to the check.

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Keyhan Vakil

Labels

Approval

Prescreened

Patch

Code

Priority

Minor

Affects versions