Nmap Development mailing list archives
Re: Possible bug in ncat 6.01?
From: David Fifield <david () bamsoftware com>
Date: Thu, 6 Sep 2012 11:20:18 -0700
On Wed, Sep 05, 2012 at 04:08:45PM +0200, Henri Doreau wrote:
2012/9/4 Jonas Wielicki <nmap-dev () sotecware net>:On 04.09.2012 15:18, Alex Weber wrote:I've attached a patch to ncat_core.c - I just set each socket to blocking before the send, and back to non-blocking after the send. That may mean Ncat has to block for a moment when sending a lot of data, but I can't think of a better way to handle it. It also causes two extra syscalls per send per socket - I don't know if this will have an appreciable performance impact, just something to consider.I could think of two ways to handle that differently: (a) correctly handle the EAGAIN code (b) set the sockets to blocking once and for all and use MSG_DONTWAIT flag at places where non-blocking behaviour is expected.Not sure which approach I prefer, I'd therefore propose another one[1]: what about using nsock? At some point I think it would be nice to have ncat fully leverage it anyway (nsock has to provide a "server" mode first). I just wrote a small patch, attached, to illustrate it. It works fine for me, even though it's just a simple draft without SSL support.
I applied Alex's idea. I think Henri's approach is a better general solution, once it handles SSL. David Fifield _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Possible bug in ncat 6.01? Jonas Wielicki (Aug 28)
- Message not available
- Re: Possible bug in ncat 6.01? Alex Weber (Sep 03)
- Message not available
- Message not available
- Re: Possible bug in ncat 6.01? Alex Weber (Sep 03)
- Re: Possible bug in ncat 6.01? Henri Doreau (Sep 04)
- Re: Possible bug in ncat 6.01? Alex Weber (Sep 04)
- Re: Possible bug in ncat 6.01? Jonas Wielicki (Sep 04)
- Re: Possible bug in ncat 6.01? Henri Doreau (Sep 05)
- Re: Possible bug in ncat 6.01? David Fifield (Sep 06)
- Re: Possible bug in ncat 6.01? Jonas Wielicki (Sep 08)
- Re: Possible bug in ncat 6.01? Alex Weber (Sep 03)
- Re: Possible bug in ncat 6.01? David Fifield (Sep 06)