On Sat, May 14, 2011 at 6:40 AM, Thomas S Hatch <[email protected]> wrote:

> I have just posed a small, quick article on the back end required for a
> VERY simple file server in ZeroMQ, for those of you interested:
>
> http://red45.wordpress.com/2011/05/13/zeromq-file-server/
>
> I am, of course, and as usual, open to suggestions!
>

Adding to Martin's and Pieter's suggestions:
 * you use isfile() which does stat() call anyway, so use getsize() instead
and allocate buffer all at once (as Martin said file is held in memory
anyway)
 * you *must* check the path against limited set of directories to send
from, even if you will run server in fully controlled environment (and use
realpath() for checking)
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to