48 if ((response ==
NULL) ||
51 (strlen (header) == 0) ||
52 (strlen (content) == 0) ||
53 (
NULL != strstr (header,
"\t")) ||
54 (
NULL != strstr (header,
"\r")) ||
55 (
NULL != strstr (header,
"\n")) ||
56 (
NULL != strstr (content,
"\t")) ||
57 (
NULL != strstr (content,
"\r")) || (
NULL != strstr (content,
"\n")))
62 hdr->
header = strdup (header);
68 hdr->
value = strdup (content);
92 const char *
header,
const char *content)
111 const char *footer,
const char *content)
130 const char *
header,
const char *content)
135 if ((header ==
NULL) || (content ==
NULL))
141 if ((0 == strcmp (header, pos->
header)) &&
142 (0 == strcmp (content, pos->
value)))
178 if ((iterator !=
NULL) &&
179 (
MHD_YES != iterator (iterator_cls,
204 if (0 == strcmp (key, pos->
header))
236 if ((crc ==
NULL) || (block_size == 0))
238 retVal = malloc (
sizeof (
struct MHD_Response) + block_size);
243 retVal->
data = (
void *) &retVal[1];
245 if (pthread_mutex_init (&retVal->
mutex,
NULL) != 0)
274 (void) lseek (response->
fd, pos + response->
fd_off, SEEK_SET);
275 return read (response->
fd, buf, max);
289 (void) close (response->
fd);
355 void *
data,
int must_free,
int must_copy)
360 if ((data ==
NULL) && (size > 0))
367 if (pthread_mutex_init (&retVal->
mutex,
NULL) != 0)
372 if ((must_copy) && (size > 0))
377 pthread_mutex_destroy (&retVal->
mutex);
381 memcpy (tmp, data, size);
386 retVal->
crfc = must_free ? &free :
NULL;
428 if (response ==
NULL)
430 pthread_mutex_lock (&response->
mutex);
433 pthread_mutex_unlock (&response->
mutex);
436 pthread_mutex_unlock (&response->
mutex);
437 pthread_mutex_destroy (&response->
mutex);
455 pthread_mutex_lock (&response->
mutex);
457 pthread_mutex_unlock (&response->
mutex);