removed trailing whitespace
This commit is contained in:
parent
9f92657f76
commit
8d76d4016d
40
lib/hostip.c
40
lib/hostip.c
@ -1,8 +1,8 @@
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* _ _ ____ _
|
* _ _ ____ _
|
||||||
* Project ___| | | | _ \| |
|
* Project ___| | | | _ \| |
|
||||||
* / __| | | | |_) | |
|
* / __| | | | |_) | |
|
||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||||
*
|
*
|
||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
* 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
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
* furnished to do so, under the terms of the COPYING file.
|
* furnished to do so, under the terms of the COPYING file.
|
||||||
@ -213,11 +213,11 @@ static int _num_chars(int i)
|
|||||||
{
|
{
|
||||||
int chars = 0;
|
int chars = 0;
|
||||||
|
|
||||||
/* While the number divided by 10 is greater than one,
|
/* While the number divided by 10 is greater than one,
|
||||||
* re-divide the number by 10, and increment the number of
|
* re-divide the number by 10, and increment the number of
|
||||||
* characters by 1.
|
* characters by 1.
|
||||||
*
|
*
|
||||||
* this relies on the fact that for every multiple of 10,
|
* this relies on the fact that for every multiple of 10,
|
||||||
* a new digit is added onto every number
|
* a new digit is added onto every number
|
||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
@ -242,7 +242,7 @@ create_hostcache_id(char *server, int port, size_t *entry_len)
|
|||||||
*entry_len = strlen(server) + /* Hostname length */
|
*entry_len = strlen(server) + /* Hostname length */
|
||||||
1 + /* ':' seperator */
|
1 + /* ':' seperator */
|
||||||
_num_chars(port); /* number of characters the port will take up */
|
_num_chars(port); /* number of characters the port will take up */
|
||||||
|
|
||||||
/* Allocate the new entry id */
|
/* Allocate the new entry id */
|
||||||
id = malloc(*entry_len + 1); /* 1 extra for the zero terminator */
|
id = malloc(*entry_len + 1); /* 1 extra for the zero terminator */
|
||||||
if (!id)
|
if (!id)
|
||||||
@ -269,16 +269,16 @@ struct hostcache_prune_data {
|
|||||||
static int
|
static int
|
||||||
hostcache_timestamp_remove(void *datap, void *hc)
|
hostcache_timestamp_remove(void *datap, void *hc)
|
||||||
{
|
{
|
||||||
struct hostcache_prune_data *data =
|
struct hostcache_prune_data *data =
|
||||||
(struct hostcache_prune_data *) datap;
|
(struct hostcache_prune_data *) datap;
|
||||||
struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc;
|
struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc;
|
||||||
|
|
||||||
if ((data->now - c->timestamp < data->cache_timeout) ||
|
if ((data->now - c->timestamp < data->cache_timeout) ||
|
||||||
c->inuse) {
|
c->inuse) {
|
||||||
/* please don't remove */
|
/* please don't remove */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fine, remove */
|
/* fine, remove */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -294,8 +294,8 @@ hostcache_prune(curl_hash *hostcache, int cache_timeout, time_t now)
|
|||||||
user.cache_timeout = cache_timeout;
|
user.cache_timeout = cache_timeout;
|
||||||
user.now = now;
|
user.now = now;
|
||||||
|
|
||||||
Curl_hash_clean_with_criterium(hostcache,
|
Curl_hash_clean_with_criterium(hostcache,
|
||||||
(void *) &user,
|
(void *) &user,
|
||||||
hostcache_timestamp_remove);
|
hostcache_timestamp_remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
/* See if its already in our dns cache */
|
/* See if its already in our dns cache */
|
||||||
dns = Curl_hash_pick(data->hostcache, entry_id, entry_len+1);
|
dns = Curl_hash_pick(data->hostcache, entry_id, entry_len+1);
|
||||||
|
|
||||||
if(data->share)
|
if(data->share)
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
|
|
||||||
@ -467,10 +467,10 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
value indicating that we need to wait for the response to the resolve
|
value indicating that we need to wait for the response to the resolve
|
||||||
call */
|
call */
|
||||||
addr = Curl_getaddrinfo(conn, hostname, port, &wait);
|
addr = Curl_getaddrinfo(conn, hostname, port, &wait);
|
||||||
|
|
||||||
if (!addr) {
|
if (!addr) {
|
||||||
if(wait) {
|
if(wait) {
|
||||||
/* the response to our resolve call will come asynchronously at
|
/* the response to our resolve call will come asynchronously at
|
||||||
a later time, good or bad */
|
a later time, good or bad */
|
||||||
/* First, check that we haven't received the info by now */
|
/* First, check that we haven't received the info by now */
|
||||||
result = Curl_is_resolved(conn, &dns);
|
result = Curl_is_resolved(conn, &dns);
|
||||||
@ -488,7 +488,7 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
/* we got a response, store it in the cache */
|
/* we got a response, store it in the cache */
|
||||||
dns = Curl_cache_addr(data, addr, hostname, port);
|
dns = Curl_cache_addr(data, addr, hostname, port);
|
||||||
|
|
||||||
if(data->share)
|
if(data->share)
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
|
|
||||||
@ -609,7 +609,7 @@ Curl_addrinfo *Curl_addrinfo_copy(Curl_addrinfo *orig)
|
|||||||
|
|
||||||
/* This must be aligned properly to work on many CPU architectures! */
|
/* This must be aligned properly to work on many CPU architectures! */
|
||||||
bufptr = MEMALIGN(bufptr);
|
bufptr = MEMALIGN(bufptr);
|
||||||
|
|
||||||
copy->h_aliases = (char**)bufptr;
|
copy->h_aliases = (char**)bufptr;
|
||||||
|
|
||||||
/* Figure out how many aliases there are */
|
/* Figure out how many aliases there are */
|
||||||
@ -634,7 +634,7 @@ Curl_addrinfo *Curl_addrinfo_copy(Curl_addrinfo *orig)
|
|||||||
|
|
||||||
copy->h_addrtype = orig->h_addrtype;
|
copy->h_addrtype = orig->h_addrtype;
|
||||||
copy->h_length = orig->h_length;
|
copy->h_length = orig->h_length;
|
||||||
|
|
||||||
/* align it for (at least) 32bit accesses */
|
/* align it for (at least) 32bit accesses */
|
||||||
bufptr = MEMALIGN(bufptr);
|
bufptr = MEMALIGN(bufptr);
|
||||||
|
|
||||||
|
10
lib/hostip.h
10
lib/hostip.h
@ -1,10 +1,10 @@
|
|||||||
#ifndef __HOSTIP_H
|
#ifndef __HOSTIP_H
|
||||||
#define __HOSTIP_H
|
#define __HOSTIP_H
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* _ _ ____ _
|
* _ _ ____ _
|
||||||
* Project ___| | | | _ \| |
|
* Project ___| | | | _ \| |
|
||||||
* / __| | | | |_) | |
|
* / __| | | | |_) | |
|
||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
@ -12,7 +12,7 @@
|
|||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||||
*
|
*
|
||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
* 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
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
* furnished to do so, under the terms of the COPYING file.
|
* furnished to do so, under the terms of the COPYING file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user