http-server-request.c revision ee2633056e67353157bfbce4d9e0d1c3ceaa627a
/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "ostream.h"
#include "http-server-private.h"
/*
* Logging
*/
static inline void
static inline void
const char *format, ...)
{
i_debug("http-server: request %s: %s",
}
}
/*
* Request
*/
struct http_server_request *
{
static unsigned int id_counter = 0;
struct http_server_request *req;
return req;
}
{
}
{
return TRUE;
}
}
return FALSE;
}
{
/* just make sure the request ends in a proper state */
if (req->delay_destroy) {
}
}
void (*callback)(void *),
void *context)
{
}
const char *reason)
{
/* send best-effort response if appropriate */
if (!conn->output_locked &&
static const char *response =
"HTTP/1.1 500 Internal Server Error\r\n"
"Content-Length: 0\r\n"
"\r\n";
}
/* close the connection */
}
}
}
}
}
const struct http_request *
{
}
{
}
struct http_server_response *
{
}
struct http_auth_credentials *credentials)
{
const char *auth;
return 0;
return -1;
return 1;
}
{
}
{
}
{
}
{
}
{
if (!http_server_request_is_complete(req)) {
break;
}
break;
break;
default:
i_unreached();
}
}
{
t_strdup_printf("Server closed connection: %u %s",
} else {
"Client requested connection close");
}
return;
}
if (tunnel_callback != NULL) {
return;
}
}
static struct http_server_response *
{
struct http_server_response *resp;
return resp;
}
static void
{
struct http_server_response *resp;
if (close)
else
}
{
}
{
}
{
struct http_server_response *resp;
reason = "Unauthenticated";
}
{
struct http_auth_challenge chlng;
}