pxdns.c revision 1c08b0ec28ca5c600c21c0ab5a53cae73f1c821d
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/* -*- indent-tabs-mode: nil; -*- */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright (C) 2009-2013 Oracle Corporation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * available from http://www.virtualbox.org. This file is free software;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * General Public License (GPL) as published by the Free Software
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright (c) 2003,2004,2005 Armin Wolfermann
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * copy of this software and associated documentation files (the "Software"),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * to deal in the Software without restriction, including without limitation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * and/or sell copies of the Software, and to permit persons to whom the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Software is furnished to do so, subject to the following conditions:
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * The above copyright notice and this permission notice shall be included in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * all copies or substantial portions of the Software.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * DEALINGS IN THE SOFTWARE.
#include "proxy.h"
#include "proxy_pollmgr.h"
#ifndef RT_OS_WINDOWS
#include <netdb.h>
#include "winpoll.h"
#include <stdio.h>
#include <string.h>
union sockaddr_inet {
struct request;
struct pxdns {
} g_pxdns;
struct request {
const char **nameservers);
goto err_cleanup_pcb;
goto err_cleanup_pcb;
goto err_cleanup_pcb;
goto err_cleanup_pcb;
goto err_cleanup_pcb;
return ERR_OK;
return error;
int status;
nresolvers = 0;
goto update_resolvers;
nnames = 0;
++nnames;
if (nnames == 0) {
goto update_resolvers;
nresolvers = 0;
goto update_resolvers;
const char *name = *p;
if (status != 0) {
++nresolvers;
if (nresolvers == 0) {
if (omask == 0) {
static struct request *
return req;
if (mask != 0) {
int sent;
pbuf_free(p);
pbuf_free(p);
if (!sent) {
if (!sent) {
if (nsent < 0) {
int sent;
} while (!sent);
return POLLIN;
int status;
if (status < 0) {
return POLLIN;
if (nread < 0) {
return POLLIN;
return POLLIN;
return POLLIN;
return POLLIN;
return POLLIN;
return POLLIN;