Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: [NSE] WHOIS - Attempts to queue coroutines to limit the number of whois queries.
From: Fyodor <fyodor () insecure org>
Date: Sat, 5 Apr 2008 16:12:45 -0700

On Fri, Feb 15, 2008 at 01:54:53AM +0000, jah wrote:
On 03/02/2008 22:47, Fyodor wrote:
On Sun, Feb 03, 2008 at 01:46:35AM +0000, jah wrote:
On some occasions, a service will take so long to respond that a huge
number of queries are generated and this is very undesirable given the
possibility of having ones IP address banned from using the service.
I've set about trying to find a way to queue coroutines and have them
wait in the queue until either a matching cached result was available
(->return a pointer) or the coroutine arrives at the front of the queue
(->proceed with a query).

My problem is; how to make a coroutine wait?

I've tried coroutine.yield() which does exactly what it says on the tin,
but there's seemingly no way to make a yield() from inside a script
resume() again and the coroutine sits there waiting for a callback from
NSOCK, which it never gets.

Great question.  I'm not sure of the best way to do this.  Does anyone
have ideas?  Jah included a bunch more details in his email at
http://seclists.org/nmap-dev/2008/q1/0294.html .

A solution to this would help with whois.nse, and likely many other scripts too.


Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]