Hi Christian,

I have a problem with the latest releases of libmicrohttpd

Previously I was using version 0.9.7 and I have recently upgraded to 0.9.20
and I have also checked this in 0.9.24

 

I use a ContentReader Callback to chunk my video data
 
response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,

                                                1024,

                                                &crc, responseptr, &crcf);

 

Sometime, in the callback I throw away a frame of data, so I return zero
from the callback, like this.

 

static ssize_t
crc (void *cls, uint64_t pos, char *buf, size_t max)
{

.

.

.

if (NothingToDo)

{

    return 0; // MHD should call me back later

}

else

{

  //do stuff

.

.

.

    return no_of_bytes_processed; 

}

 

}

 

If I return zero from the callback I expect MHD to call me back some short
time later.

This has always worked for me in the past but now, when I return zero, from
the callback, version 0.9.20 does not call me back until after a delay of
around 6 seconds by which time the client has timed out. Version 0.9.24 is
worse and actually crashes the program with the following error:-

 

Fatal error in GNU libmicrohttpd connection.c:395: API violation

                                                                Aborted

 

Is it no longer allowed to return zero from a ContentReaderCallback?

 

Best regards

David

Reply via email to