aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/response.c')
-rw-r--r--src/daemon/response.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/daemon/response.c b/src/daemon/response.c
index 3adb6bc9..56333396 100644
--- a/src/daemon/response.c
+++ b/src/daemon/response.c
@@ -160,21 +160,20 @@ MHD_get_response_header (struct MHD_Response *response, const char *key)
160 */ 160 */
161struct MHD_Response * 161struct MHD_Response *
162MHD_create_response_from_callback (size_t size, 162MHD_create_response_from_callback (size_t size,
163 unsigned int block_size, 163 unsigned int block_size,
164 MHD_ContentReaderCallback crc, 164 MHD_ContentReaderCallback crc,
165 void *crc_cls, 165 void *crc_cls,
166 MHD_ContentReaderFreeCallback crfc) 166 MHD_ContentReaderFreeCallback crfc)
167{ 167{
168 struct MHD_Response *retVal; 168 struct MHD_Response *retVal;
169 169
170 if ( (crc == NULL) || 170 if ((crc == NULL) || (block_size == 0))
171 (block_size == 0) )
172 return NULL; 171 return NULL;
173 retVal = malloc (sizeof (struct MHD_Response) + block_size); 172 retVal = malloc (sizeof (struct MHD_Response) + block_size);
174 if (retVal == NULL) 173 if (retVal == NULL)
175 return NULL; 174 return NULL;
176 memset (retVal, 0, sizeof (struct MHD_Response)); 175 memset (retVal, 0, sizeof (struct MHD_Response));
177 retVal->data = (void*) &retVal[1]; 176 retVal->data = (void *) &retVal[1];
178 retVal->data_buffer_size = MHD_BUF_INC_SIZE; 177 retVal->data_buffer_size = MHD_BUF_INC_SIZE;
179 if (pthread_mutex_init (&retVal->mutex, NULL) != 0) 178 if (pthread_mutex_init (&retVal->mutex, NULL) != 0)
180 { 179 {