[zeromq-dev] ZeroMQ File Server

Paul Colomiets paul at colomiets.name
Sat May 14 16:32:53 CEST 2011


On Sat, May 14, 2011 at 6:40 AM, Thomas S Hatch <thatch45 at gmail.com> 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110514/b559806b/attachment.htm>


More information about the zeromq-dev mailing list