/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "llist.h"
#include "istream.h"
#include "write-full.h"
#include "time-util.h"
#include "dns-lookup.h"
#include <stdio.h>
#include <unistd.h>
struct dns_lookup {
bool ptr_lookup;
unsigned int warn_msecs;
unsigned int ip_idx;
char *name;
void *context;
};
struct dns_client {
int fd;
char *path;
bool deinit_client_at_free;
};
{
}
}
{
if (lookup->ptr_lookup) {
/* <ret> [<name>] */
} else {
return -1;
}
}
return 1;
}
/* first line: <ret> [<ip count>] */
return -1;
return 1;
}
return -1;
} else {
return -1;
return 1;
}
}
return 0;
}
{
int diff;
i_fatal("gettimeofday() failed: %m");
if (diff > 0)
}
{
const char *line;
int ret = 0;
return;
}
if (ret > 0)
break;
if (ret < 0) {
return;
}
}
/* already got the error */
return;
return;
}
if (ret > 0) {
}
if (retry)
}
{
}
struct dns_lookup **lookup_r)
{
return -1;
}
return 0;
}
const struct dns_lookup_settings *set,
struct dns_lookup **lookup_r)
{
return -1;
}
return 0;
}
{
}
{
if (client->deinit_client_at_free)
}
}
{
}
{
}
{
return client;
}
{
}
{
return 0;
return -1;
}
return 0;
}
static int
const char **error_r)
{
int ret;
return -1;
ret = -1;
} else {
/* already connected. if write() fails, retry connecting */
ret = 0;
}
return ret;
}
return 1;
}
static int
const char *cmd, bool ptr_lookup,
struct dns_lookup **lookup_r)
{
int ret;
if (ret == 0) {
/* retry once */
}
if (ret <= 0) {
return -1;
}
}
if (client->timeout_msecs != 0) {
}
i_fatal("gettimeofday() failed: %m");
return 0;
}
struct dns_lookup **lookup_r)
{
}
struct dns_lookup **lookup_r)
{
}
{
return;
}