Nmap Development mailing list archives

Re: [NSE][PATCH] add an eof option to comm.lua


From: Sven Klemm <sven () c3d2 de>
Date: Thu, 02 Oct 2008 14:18:06 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sven Klemm wrote:
| Hi everyone,
|
| currently comm.lua stops after reading the first chunk returned by
| receive_lines() or receive_bytes() but in some circumstances it
might be
| nice to read until EOF to get everything sent. The patch adds an eof
| option to the comm library. If this option is set it will continue
| receiving data until it gets EOF and in this case true and all data
will
| be returned other error cases will still be handled normally.
|
| Usage:
|   comm.exchange( host, port, data, {eof=true} )
|
| I think this functionality is very useful and with this option the http
| library and rpcinfo.nse could be changed to use the comm library again.

On second thought maybe this should be made more generic or extended
to allow specifying the errors it should react on. A lot of scripts
have a receive loop to read until an error occurs I think it would be
nice if the comm library had an option to do the same.

Cheers,
Sven


- --
Sven Klemm
http://cthulhu.c3d2.de/~sven/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjku/4ACgkQevlgTHEIT4avOwCeMqMw8GnHXngDeHayQyWjKeWC
hrEAnjDldvKHwusRBR6nCIt+xuJqCrkj
=mDVK
-----END PGP SIGNATURE-----

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: