Exemplo n.º 1
0
/**
 * Destroy a response object and associated resources.  Note that
 * libmicrohttpd may keep some of the resources around if the response
 * is still in the queue for some clients, so the memory may not
 * necessarily be freed immediatley.
 *
 * @param response response to destroy
 * @ingroup response
 */
void
MHD_destroy_response (struct MHD_Response *response)
{
  struct MHD_HTTP_Header *pos;

  if (NULL == response)
    return;
  (void) MHD_mutex_lock_ (&response->mutex);
  if (0 != --(response->reference_count))
    {
      (void) MHD_mutex_unlock_ (&response->mutex);
      return;
    }
  (void) MHD_mutex_unlock_ (&response->mutex);
  (void) MHD_mutex_destroy_ (&response->mutex);
  if (response->crfc != NULL)
    response->crfc (response->crc_cls);
  while (NULL != response->first_header)
    {
      pos = response->first_header;
      response->first_header = pos->next;
      free (pos->header);
      free (pos->value);
      free (pos);
    }
  free (response);
}
Exemplo n.º 2
0
void
MHD_increment_response_rc (struct MHD_Response *response)
{
  (void) MHD_mutex_lock_ (&response->mutex);
  (response->reference_count)++;
  (void) MHD_mutex_unlock_ (&response->mutex);
}
Exemplo n.º 3
0
static int
gcry_w32_mutex_unlock (void **ppmtx)
{
  return MHD_mutex_unlock_ ((MHD_mutex_*)*ppmtx) ? 0 : EINVAL;
}