pure-ftpd 在哪里调用它的上传脚本?

Where does pure-ftpd call its uploadscript?

我一直在查看 pure-ftpd-1.0.42 源代码:

https://github.com/jedisct1/pure-ftpd

正在尝试查找触发时间:

https://github.com/jedisct1/pure-ftpd/blob/master/src/pure-uploadscript.c

即什么时候 运行 上传文件后的上传脚本。

如果您查看 src/ftp_parser.cdostor 方法是文件开始上传过程的方式。然后它转到 ul_send 然后 ul_handle_data 但我在这一点上迷路了。我从来没有看到它什么时候说,好的,这个文件现在已经上传了,是时候打电话了 uploadscript。有人可以告诉我线路吗?

pureftpd_start() function in src/ftpd.c, pure-ftpd starts up and parses all of its command-line options. It also opens a pipe to the pure-uploadscript, if configured; herepure-ftpd 不会在每次上传时调用上传脚本(并导致 fork()exec() 开销 per-upload),而是保持上传脚本进程运行分开,将上传的文件路径通过管道发送给它。

知道了这一点,然后,我们使用 upload_pipe_push() function. Interestingly, that function is called heredisplayrate() 函数查找该管道被写入的位置,该函数被 dostor()doretr()src/ftpd.c 文件中。

希望对您有所帮助!