http-client-host.c revision b66def5dadd3e7c250313a938d26ad113663f86b
/* Copyright (c) 2013-2014 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "net.h"
#include "str.h"
#include "hash.h"
#include "array.h"
#include "llist.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "dns-lookup.h"
#include "http-response-parser.h"
#include "http-client-private.h"
/*
* Logging
*/
static inline void
static inline void
const char *format, ...)
{
i_debug("http-client: host %s: %s",
}
}
/*
* Host
*/
static void
const char *error)
{
struct http_client_queue *const *queue_idx;
}
}
static void
struct http_client_host *host)
{
struct http_client_queue *const *queue_idx;
unsigned int requests = 0;
return;
}
/* FIXME: make DNS result expire */
/* make connections to requested ports */
unsigned int reqs_pending =
if (reqs_pending > 0)
requests += reqs_pending;
}
}
static void http_client_host_lookup
(struct http_client_host *host)
{
struct dns_lookup_settings dns_set;
unsigned int ips_count;
int ret;
"Performing asynchronous DNS lookup");
"Performing asynchronous DNS lookup");
} else {
if (ret != 0) {
return;
}
"DNS lookup successful; got %d IPs", ips_count);
}
}
struct http_client_host *http_client_host_get
{
struct http_client_host *host;
// FIXME: limit the maximum number of inactive cached hosts
if (host_url->have_host_ip) {
}
}
return host;
}
struct http_client_request *req)
{
struct http_client_queue *queue;
struct http_client_peer_addr addr;
const char *error;
return;
}
}
/* add request to queue (grouped by tcp port) */
/* start DNS lookup if necessary */
/* make a connection if we have an IP already */
return;
}
{
struct http_client_queue *const *queue_idx;
/* drop request queues */
}
}
}
static void
{
struct http_client_request *const *req_idx =
}
}
struct http_client_request *req)
{
}
}
struct http_client_request *req)
{
struct http_client_request *const *reqs;
unsigned int i, count;
for (i = 0; i < count; i++) {
return;
}
}
}
{
struct http_client_queue *const *queue_idx;
}
}