D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/hostip.c File Reference

#include "setup.h"
#include <string.h>
#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
#include "share.h"
#include "strerror.h"
#include "url.h"
#include "inet_ntop.h"
#include <curl/mprintf.h>
#include "memory.h"
#include "memdebug.h"

Go to the source code of this file.

Classes

struct  hostcache_prune_data
struct  namebuf

Defines

#define _MPRINTF_REPLACE
#define MEMALIGN(x)   ((x)+(8-(((unsigned long)(x))&0x7)))

Functions

static void freednsentry (void *freethis)
void Curl_global_host_cache_init (void)
struct curl_hashCurl_global_host_cache_get (void)
void Curl_global_host_cache_dtor (void)
int Curl_num_addresses (const Curl_addrinfo *addr)
const char * Curl_printable_address (const Curl_addrinfo *ip, char *buf, size_t bufsize)
static char * create_hostcache_id (const char *server, int port)
static int hostcache_timestamp_remove (void *datap, void *hc)
static void hostcache_prune (struct curl_hash *hostcache, int cache_timeout, time_t now)
void Curl_hostcache_prune (struct SessionHandle *data)
static int remove_entry_if_stale (struct SessionHandle *data, struct Curl_dns_entry *dns)
struct Curl_dns_entryCurl_cache_addr (struct SessionHandle *data, Curl_addrinfo *addr, const char *hostname, int port)
int Curl_resolv (struct connectdata *conn, const char *hostname, int port, struct Curl_dns_entry **entry)
void Curl_resolv_unlock (struct SessionHandle *data, struct Curl_dns_entry *dns)
struct curl_hashCurl_mk_dnscache (void)
Curl_addrinfoCurl_addrinfo_copy (const void *org, int port)
void Curl_freeaddrinfo (Curl_addrinfo *ai)
Curl_addrinfoCurl_ip2addr (in_addr_t num, const char *hostname, int port)

Variables

static struct curl_hash hostname_cache
static int host_cache_initialized


Define Documentation

#define _MPRINTF_REPLACE

Definition at line 72 of file hostip.c.

#define MEMALIGN (  )     ((x)+(8-(((unsigned long)(x))&0x7)))

Definition at line 547 of file hostip.c.


Function Documentation

static char* create_hostcache_id ( const char *  server,
int  port 
) [static]

Definition at line 196 of file hostip.c.

Referenced by Curl_cache_addr(), and Curl_resolv().

Curl_addrinfo* Curl_addrinfo_copy ( const void *  org,
int  port 
)

Definition at line 554 of file hostip.c.

References Curl_he2ai().

struct Curl_dns_entry* Curl_cache_addr ( struct SessionHandle data,
Curl_addrinfo addr,
const char *  hostname,
int  port 
) [read]

void Curl_freeaddrinfo ( Curl_addrinfo ai  ) 

Definition at line 571 of file hostip.c.

References Curl_addrinfo::ai_canonname, Curl_addrinfo::ai_next, and free.

Referenced by Curl_resolv(), freednsentry(), and ftp_state_use_port().

void Curl_global_host_cache_dtor ( void   ) 

Definition at line 151 of file hostip.c.

References Curl_hash_clean(), host_cache_initialized, and hostname_cache.

Referenced by curl_global_cleanup().

struct curl_hash* Curl_global_host_cache_get ( void   )  [read]

Definition at line 143 of file hostip.c.

References hostname_cache.

Referenced by curl_easy_perform().

void Curl_global_host_cache_init ( void   ) 

void Curl_hostcache_prune ( struct SessionHandle data  ) 

Curl_addrinfo* Curl_ip2addr ( in_addr_t  num,
const char *  hostname,
int  port 
)

struct curl_hash* Curl_mk_dnscache ( void   )  [read]

int Curl_num_addresses ( const Curl_addrinfo addr  ) 

Definition at line 162 of file hostip.c.

References Curl_addrinfo::ai_next.

Referenced by Curl_connecthost().

const char* Curl_printable_address ( const Curl_addrinfo ip,
char *  buf,
size_t  bufsize 
)

int Curl_resolv ( struct connectdata conn,
const char *  hostname,
int  port,
struct Curl_dns_entry **  entry 
)

void Curl_resolv_unlock ( struct SessionHandle data,
struct Curl_dns_entry dns 
)

static void freednsentry ( void *  freethis  )  [static]

Definition at line 527 of file hostip.c.

References Curl_dns_entry::addr, Curl_freeaddrinfo(), and free.

Referenced by Curl_global_host_cache_init(), and Curl_mk_dnscache().

static void hostcache_prune ( struct curl_hash hostcache,
int  cache_timeout,
time_t  now 
) [static]

static int hostcache_timestamp_remove ( void *  datap,
void *  hc 
) [static]

static int remove_entry_if_stale ( struct SessionHandle data,
struct Curl_dns_entry dns 
) [static]


Variable Documentation

int host_cache_initialized [static]

Definition at line 122 of file hostip.c.

Referenced by Curl_global_host_cache_dtor(), and Curl_global_host_cache_init().

struct curl_hash hostname_cache [static]


Generated on Sun May 25 00:20:06 2008 by  doxygen 1.5.6