48 if ( (
NULL == response) ||
51 (0 == strlen (header)) ||
52 (0 == strlen (content)) ||
53 (
NULL != strchr (header,
'\t')) ||
54 (
NULL != strchr (header,
'\r')) ||
55 (
NULL != strchr (header,
'\n')) ||
56 (
NULL != strchr (content,
'\t')) ||
57 (
NULL != strchr (content,
'\r')) ||
58 (
NULL != strchr (content,
'\n')) )
67 if (
NULL == (hdr->
value = strdup (content)))
91 const char *
header,
const char *content)
111 const char *footer,
const char *content)
137 if ( (
NULL == header) || (
NULL == content) )
143 if ((0 == strcmp (header, pos->
header)) &&
144 (0 == strcmp (content, pos->
value)))
182 if ((
NULL != iterator) &&
183 (
MHD_YES != iterator (iterator_cls,
208 if (0 == strcmp (key, pos->
header))
239 if ((
NULL == crc) || (0 == block_size))
241 if (
NULL == (response = malloc (
sizeof (
struct MHD_Response) + block_size)))
245 response->
data = (
void *) &response[1];
247 if (0 != pthread_mutex_init (&response->
mutex,
NULL))
277 (void) lseek (response->
fd, pos + response->
fd_off, SEEK_SET);
278 n = read (response->
fd, buf, max);
298 (void) close (response->
fd);
331 if (
NULL == response)
334 response->
fd_off = offset;
373 void *
data,
int must_free,
int must_copy)
378 if ((
NULL == data) && (size > 0))
384 if (0 != pthread_mutex_init (&response->
mutex,
NULL))
389 if ((must_copy) && (size > 0))
391 if (
NULL == (tmp = malloc (size)))
393 pthread_mutex_destroy (&response->
mutex);
397 memcpy (tmp, data, size);
402 response->
crfc = must_free ? &free :
NULL;
448 if (
NULL == response)
450 pthread_mutex_lock (&response->
mutex);
453 pthread_mutex_unlock (&response->
mutex);
456 pthread_mutex_unlock (&response->
mutex);
457 pthread_mutex_destroy (&response->
mutex);
475 pthread_mutex_lock (&response->
mutex);
477 pthread_mutex_unlock (&response->
mutex);