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)))
90 const char *
header,
const char *content)
109 const char *footer,
const char *content)
128 const char *
header,
const char *content)
133 if ( (
NULL == header) || (
NULL == content) )
139 if ((0 == strcmp (header, pos->
header)) &&
140 (0 == strcmp (content, pos->
value)))
176 if ((
NULL != iterator) &&
177 (
MHD_YES != iterator (iterator_cls,
199 if (0 == strcmp (key, pos->
header))
229 if ((
NULL == crc) || (0 == block_size))
231 if (
NULL == (response = malloc (
sizeof (
struct MHD_Response) + block_size)))
235 response->
data = (
void *) &response[1];
237 if (0 != pthread_mutex_init (&response->
mutex,
NULL))
267 (void) lseek (response->
fd, pos + response->
fd_off, SEEK_SET);
268 n = read (response->
fd, buf, max);
288 (void) close (response->
fd);
313 if (
NULL == response)
316 response->
fd_off = offset;
352 void *
data,
int must_free,
int must_copy)
357 if ((
NULL == data) && (size > 0))
363 if (0 != pthread_mutex_init (&response->
mutex,
NULL))
368 if ((must_copy) && (size > 0))
370 if (
NULL == (tmp = malloc (size)))
372 pthread_mutex_destroy (&response->
mutex);
376 memcpy (tmp, data, size);
381 response->
crfc = must_free ? &free :
NULL;
423 if (
NULL == response)
425 pthread_mutex_lock (&response->
mutex);
428 pthread_mutex_unlock (&response->
mutex);
431 pthread_mutex_unlock (&response->
mutex);
432 pthread_mutex_destroy (&response->
mutex);
450 pthread_mutex_lock (&response->
mutex);
452 pthread_mutex_unlock (&response->
mutex);