On 8/28/07, Brandon Enright <bmenrigh_at_ucsd.edu> wrote:
> Maybe there needs to be some (tunable) cap on the number parallel NSE
> scripts or number of sockets allowed open by NSE at a time. I'm thinking
> that nmap.new_socket() could block if the number of connected/open sockets
> goes above some threshold.
>
> Brandon
Hi!
I implemented it exactly as you proposed. nsock_connect blocks when the
number of opened connections exceeds some threshold.
For this moment this threshold is hardcoded in
#define NSOCK_DESCRIPTORS_THRESHOLD 768
(btw. in future maybe it's good idea to decrease this value to 1 for
easier nse debugging, you know, only one script running at a time)
My patch is rather hackish but it should work.
(It can run two times lua_yield on lua thread, but it seems that it isn't
bad, although it's not theoretically proper I think),
Cheers!
Marek Majkowski
(patch attached)
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Aug 30 2007