cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [bagder/curl] 219a0f: remote_port: allow connect to port 0

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 6 Mar 2014 00:54:30 +0100 (CET)

On Wed, 5 Mar 2014, Steve Holme wrote:

> I don't know if we support 16-bit systems (The last DOS build on the
> download page was 7.10.5 so maybe not) but shouldn't the "int" be a "long"
> just in case we do as technically it will be smaller than an "unsigned
> short" on those systems? Not only that but I see that the port variable is
> also defined as a long ;-)

I'm pretty sure lots of things will break if int is less than 32 bits so I
rather think that using 64 bit for a long is a waste...

I basically only needed one extra bit for "unknown" since port 0 is actually a
legitimate port number.

> Also, I'm not sure if I missed something but is it possible to set this
> variable to a large number like 2 million (on 32-bit systems), so do we need
> to validate against values above 65535?

Yes, we need to check that and we do!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-06