2004-04-26 09:20:11 +02:00
|
|
|
/***************************************************************************
|
2004-10-06 09:50:18 +02:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
2004-04-26 09:20:11 +02:00
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2007-04-03 20:25:18 +02:00
|
|
|
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2004-04-26 09:20:11 +02:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
2004-10-06 09:50:18 +02:00
|
|
|
*
|
2004-04-26 09:20:11 +02:00
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "setup.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2006-07-25 15:49:49 +02:00
|
|
|
#ifdef NEED_MALLOC_H
|
2004-04-26 09:20:11 +02:00
|
|
|
#include <malloc.h>
|
2006-04-26 19:23:28 +02:00
|
|
|
#endif
|
2004-04-26 09:20:11 +02:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
#include <netdb.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ARPA_INET_H
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STDLIB_H
|
2004-10-06 09:50:18 +02:00
|
|
|
#include <stdlib.h> /* required for free() prototypes */
|
2004-04-26 09:20:11 +02:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h> /* for the close() proto */
|
|
|
|
#endif
|
2004-10-06 09:50:18 +02:00
|
|
|
#ifdef VMS
|
2004-04-26 09:20:11 +02:00
|
|
|
#include <in.h>
|
|
|
|
#include <inet.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SETJMP_H
|
|
|
|
#include <setjmp.h>
|
|
|
|
#endif
|
|
|
|
|
2006-04-26 19:23:28 +02:00
|
|
|
#ifdef HAVE_PROCESS_H
|
2004-04-26 09:20:11 +02:00
|
|
|
#include <process.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "urldata.h"
|
|
|
|
#include "sendf.h"
|
|
|
|
#include "hostip.h"
|
|
|
|
#include "hash.h"
|
|
|
|
#include "share.h"
|
|
|
|
#include "strerror.h"
|
|
|
|
#include "url.h"
|
|
|
|
|
|
|
|
#define _MPRINTF_REPLACE /* use our functions only */
|
|
|
|
#include <curl/mprintf.h>
|
|
|
|
|
|
|
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
|
|
|
#include "inet_ntoa_r.h"
|
|
|
|
#endif
|
|
|
|
|
2004-05-11 13:30:23 +02:00
|
|
|
#include "memory.h"
|
2004-04-26 09:20:11 +02:00
|
|
|
/* The last #include file should be: */
|
|
|
|
#include "memdebug.h"
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Only for builds using synchronous name resolves
|
|
|
|
**********************************************************************/
|
|
|
|
#ifdef CURLRES_SYNCH
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Curl_wait_for_resolv() for synch-builds. Curl_resolv() can never return
|
|
|
|
* wait==TRUE, so this function will never be called. If it still gets called,
|
|
|
|
* we return failure at once.
|
|
|
|
*
|
|
|
|
* We provide this function only to allow multi.c to remain unaware if we are
|
|
|
|
* doing asynch resolves or not.
|
|
|
|
*/
|
|
|
|
CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|
|
|
struct Curl_dns_entry **entry)
|
|
|
|
{
|
|
|
|
(void)conn;
|
|
|
|
*entry=NULL;
|
|
|
|
return CURLE_COULDNT_RESOLVE_HOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This function will never be called when synch-built. If it still gets
|
|
|
|
* called, we return failure at once.
|
|
|
|
*
|
|
|
|
* We provide this function only to allow multi.c to remain unaware if we are
|
|
|
|
* doing asynch resolves or not.
|
|
|
|
*/
|
|
|
|
CURLcode Curl_is_resolved(struct connectdata *conn,
|
|
|
|
struct Curl_dns_entry **dns)
|
|
|
|
{
|
|
|
|
(void)conn;
|
|
|
|
*dns = NULL;
|
|
|
|
|
|
|
|
return CURLE_COULDNT_RESOLVE_HOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We just return OK, this function is never actually used for synch builds.
|
|
|
|
* It is present here to keep #ifdefs out from multi.c
|
|
|
|
*/
|
|
|
|
|
2006-04-10 17:00:53 +02:00
|
|
|
int Curl_resolv_getsock(struct connectdata *conn,
|
|
|
|
curl_socket_t *sock,
|
|
|
|
int numsocks)
|
2004-04-26 09:20:11 +02:00
|
|
|
{
|
|
|
|
(void)conn;
|
2006-04-10 17:00:53 +02:00
|
|
|
(void)sock;
|
|
|
|
(void)numsocks;
|
2004-04-26 09:20:11 +02:00
|
|
|
|
2006-04-10 17:00:53 +02:00
|
|
|
return 0; /* no bits since we don't use any socks */
|
2004-04-26 09:20:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* truly sync */
|