[pmg-devel] [PATCH http-server v2 1/1] AnyEvent: extend send_file with content-type

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Oct 4 09:45:42 CEST 2019


On 9/30/19 2:55 PM, Dominik Csapak wrote:
> for pmg, we need to send temporary files (for the attachment quarantine),
> but we cannot know beforehand what content-type it is, so we
> optionally give it to send_file_start
> 
> we give a hash with the open filehandle and the content-type in that case
> 
> this also removes the unnecessary open on the filename, since we open
> it in send_file_start anyway...
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> changes from v1:
> * do not delete here, let the caller handle it
> * expect either a filename or a hash with fh and content-type
> * remove unnecessary IO::File->new in caller (we open it there anyway)

so you took this version of my proposal, what spoke against the other
idea of passing the whole content already in the info data structure.
In general fine for me, but some rational would be interesting here.
Any issues with the other approach or just liked this one better?



More information about the pmg-devel mailing list