This commit is contained in:
Christian Grothoff
2010-06-13 09:06:34 +00:00
parent 0b23a93cb2
commit b6ed288d26
+8 -2
View File
@@ -105,6 +105,13 @@ file_reader (void *cls, uint64_t pos, char *buf, int max)
return fread (buf, 1, max, file);
}
static void
file_free_callback (void *cls)
{
FILE *file = cls;
fclose (file);
}
/* HTTP access handler call back */
static int
http_ahc (void *cls,
@@ -148,8 +155,7 @@ http_ahc (void *cls,
{
response = MHD_create_response_from_callback (buf.st_size, 32 * 1024, /* 32k PAGE_NOT_FOUND size */
&file_reader, file,
(MHD_ContentReaderFreeCallback)
& fclose);
&file_free_callback);
if (response == NULL)
{
fclose (file);