[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Cleanup callback isn't called
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Cleanup callback isn't called |
Date: |
Tue, 31 Aug 2010 15:41:55 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.32-trunk-vserver-amd64; KDE/4.4.4; x86_64; ; ) |
Hi!
I think I found & fixed the issue in SVN 12778. Please try SVN HEAD and report
if it fixes the problem.
Thanks!
Christian
On Tuesday 31 August 2010 10:04:49 Erik Slagter wrote:
> Hi,
>
> I am using the MHD_create_response_from_callback function with a "data"
> callback and a "cleanup" callback.
>
> The "data" callback gets called as expected, but the "cleanup" doesn't.
>
> The context is as follows: the thread passes data on that another thread
> generates, so it doesn't know the length in advance. This is done using
> pipes (well actually socketpair, for various reasons).
>
> The data callback is called, the available data from the pipe is given
> to mhd, it even finds its way to wget. that's no problem. The problem
> comes when wget is interrupted (^C) or browers window is "stopped" etc.
> MHD says "Failed to send data: Broken pipe" on stderr and also the call
> to send (actually sendto) returns EPIPE. which is exactly what I'd
> expect. Next, I'd expect the "cleanup" callback function to be called,
> so I can closed my pipe fd, as to signal the producer thread to stop
> inserting data into the pipe. But this doesn't happen :-(
>
> I am using libmhd on fedora 12 (libmicrohttpd-0.4.2-2.fc12.x86_64).
>
> Thanks.
>
> P.S. I am subscribed to the list!