bugGNU Wget - Bugs: bug #21358, Specify a range of ports for Wget...

 
 

bug #21358: Specify a range of ports for Wget to bind to

Submitter:  Micah Cowan <micahcowan>
Submitted:  Wed 17 Oct 2007 08:18:55 PM UTC
   
 
Category:  Feature Request Severity:  1 - Wish
Priority:  1 - Later Status:  Confirmed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  None Operating System:  None
Reproducibility:  None Fixed Release:  None
Planned Release:  1.15 Regression:  None
Work Required:  0 - Hours Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 19 Oct 2007 02:03:41 AM UTC, comment #1: 

As Tony Godshall points out in response to the 8k bit-array idea, we could just use a pseudo-random number generator with a sufficiently long period:

http://www.mail-archive.com/wget%40sunsite.dk/msg10460.html

We'd just need to be careful in seeding it.

http://www.mail-archive.com/wget%40sunsite.dk/msg10464.html

Micah Cowan <micahcowan>
Wed 17 Oct 2007 08:18:55 PM UTC, original submission:  

My response to a message on-list:

Oleg Ace wrote:

> > Greetings,
> >
> > Was the feature being discussed here
> > http://www.mail-archive.com/wget@sunsite.dk/msg05546.html
> > and here
> > http://www.mail-archive.com/wget@sunsite.dk/msg05577.html
> > ever get implemented?
> >
> > In other words, is it possible to do:
> > wget --bind-address=1.2.3.4:2000-3000 http://...
> >
> >>From trying it out and looking briefly at the code, it would appear it
> > is not, but wanted to make sure.
> >
> > If that is the case, does anyone still have the old patch available,
> > or has a similar new one?


Looking at the threads you indicated, it appears that people were
generally happy to include the feature, but were unhappy with the
specific implementation from the patch:

  * parsing of --bind-address belongs in the getopt loop
  * sscanf() should be avoided for use in the parsing.
  * the ports should be chosen from that range at random, rather than
sequentially, to address an issue pointed out by the Sockets FAQ.

The third point above introduces its own problems: how many bind()
attempts should we make before throwing in the towel? Or should we
attempt every port in that range, keeping an 8k array of bits to track
which ports we've tried already?

Clearly, whatever approach we take will be vastly less
efficient/intelligent than the way the OS picks a port for us, and we'll
need to point these limitations out in the documentation.

I'm not going to write the code for this (at least not any time soon);
if someone is interested enough to rewrite the patch to address these
shortcomings, though, I'll be happy to include it, seeing as how it
apparently met with Hrvoje's and Mauro's approval (and I see how it
could be useful as well; though of course its primary use is probably to
get around broken environments).

I will submit a low-pri issue for it, in the meantime, in case someone
sees it and wants to pick it up.  :)

Micah Cowan <micahcowan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by micahcowan (Submitted the item)
  •  

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-02-23 micahcowan SummarySpecify ports for Wget to bind to Specify a range of ports for Wget to bind to
    2007-10-17 micahcowan Priority5 - Normal 1 - Later

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code