~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to lib/hostip.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-02-12 08:54:32 UTC
  • mfrom: (3.4.34 sid)
  • Revision ID: package-import@ubuntu.com-20130212085432-r1fyi0b37enr93pp
Tags: 7.29.0-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Drop dependencies not in main:
    + Build-Depends: Drop stunnel4 and libssh2-1-dev.
    + Drop libssh2-1-dev from binary package Depends.
  - Add new libcurl3-udeb package.
  - Add new curl-udeb package.
* Add warning to debian/patches/series.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
20
20
 *
21
21
 ***************************************************************************/
22
22
 
23
 
#include "setup.h"
 
23
#include "curl_setup.h"
24
24
 
25
 
#ifdef HAVE_SYS_SOCKET_H
26
 
#include <sys/socket.h>
27
 
#endif
28
25
#ifdef HAVE_NETINET_IN_H
29
26
#include <netinet/in.h>
30
27
#endif
34
31
#ifdef HAVE_ARPA_INET_H
35
32
#include <arpa/inet.h>
36
33
#endif
37
 
#ifdef HAVE_UNISTD_H
38
 
#include <unistd.h>     /* for the close() proto */
39
 
#endif
40
34
#ifdef __VMS
41
35
#include <in.h>
42
36
#include <inet.h>
112
106
 * asyn-thread.c - functions for threaded name resolves
113
107
 
114
108
 * The hostip.h is the united header file for all this. It defines the
115
 
 * CURLRES_* defines based on the config*.h and setup.h defines.
 
109
 * CURLRES_* defines based on the config*.h and curl_setup.h defines.
116
110
 */
117
111
 
118
112
/* These two symbols are for the global DNS cache */
740
734
  return 1; /* free all entries */
741
735
}
742
736
 
743
 
void Curl_hostcache_destroy(struct SessionHandle *data)
 
737
void Curl_hostcache_clean(struct SessionHandle *data)
744
738
{
745
739
  /* Entries added to the hostcache with the CURLOPT_RESOLVE function are
746
740
   * still present in the cache with the inuse counter set to 1. Detect them
747
741
   * and cleanup!
748
742
   */
749
743
  Curl_hash_clean_with_criterium(data->dns.hostcache, data, hostcache_inuse);
 
744
}
750
745
 
 
746
void Curl_hostcache_destroy(struct SessionHandle *data)
 
747
{
 
748
  Curl_hostcache_clean(data);
751
749
  Curl_hash_destroy(data->dns.hostcache);
752
750
  data->dns.hostcachetype = HCACHE_NONE;
753
751
  data->dns.hostcache = NULL;