mirror of git://sourceware.org/git/glibc.git
Update.
2000-02-17 Ulrich Drepper <drepper@redhat.com> * nscd/hstcache.c (cache_addhst): Don't cache name->record entries if more than one IP address is available.
This commit is contained in:
parent
90ab302088
commit
60c4f8eb1e
|
|
@ -1,3 +1,8 @@
|
||||||
|
2000-02-17 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/hstcache.c (cache_addhst): Don't cache name->record entries
|
||||||
|
if more than one IP address is available.
|
||||||
|
|
||||||
2000-02-17 Jakub Jelinek <jakub@redhat.com>
|
2000-02-17 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Sync with kernel.
|
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Sync with kernel.
|
||||||
|
|
|
||||||
|
|
@ -211,15 +211,21 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
|
||||||
/* Now get the lock to safely insert the records. */
|
/* Now get the lock to safely insert the records. */
|
||||||
pthread_rwlock_rdlock (&db->lock);
|
pthread_rwlock_rdlock (&db->lock);
|
||||||
|
|
||||||
/* First add all the aliases. */
|
/* First add all the aliases. If the record contains more than
|
||||||
|
one IP address (used for load balancing etc) don't cache the
|
||||||
|
entry. This is something the current cache handling cannot
|
||||||
|
handle and it is more than questionable whether it is
|
||||||
|
worthwhile complicating the cache handling just for handling
|
||||||
|
such a special case. */
|
||||||
|
if (hst->h_addr_list[1] == NULL)
|
||||||
for (cnt = 0; cnt < h_aliases_cnt; ++cnt)
|
for (cnt = 0; cnt < h_aliases_cnt; ++cnt)
|
||||||
{
|
{
|
||||||
if (addr_list_type == GETHOSTBYADDR)
|
if (addr_list_type == GETHOSTBYADDR)
|
||||||
cache_add (GETHOSTBYNAME, aliases, h_aliases_len[cnt], data, total,
|
cache_add (GETHOSTBYNAME, aliases, h_aliases_len[cnt], data,
|
||||||
data, 0, t, db, owner);
|
total, data, 0, t, db, owner);
|
||||||
|
|
||||||
cache_add (GETHOSTBYNAMEv6, aliases, h_aliases_len[cnt], data, total,
|
cache_add (GETHOSTBYNAMEv6, aliases, h_aliases_len[cnt], data,
|
||||||
data, 0, t, db, owner);
|
total, data, 0, t, db, owner);
|
||||||
|
|
||||||
aliases += h_aliases_len[cnt];
|
aliases += h_aliases_len[cnt];
|
||||||
}
|
}
|
||||||
|
|
@ -241,6 +247,10 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
|
||||||
addresses += IN6ADDRSZ;
|
addresses += IN6ADDRSZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid adding names if more than one address is available. See
|
||||||
|
above for more info. */
|
||||||
|
if (hst->h_addr_list[1] == NULL)
|
||||||
|
{
|
||||||
/* If necessary add the key for this request. */
|
/* If necessary add the key for this request. */
|
||||||
if (req->type == GETHOSTBYNAME || req->type == GETHOSTBYNAMEv6)
|
if (req->type == GETHOSTBYNAME || req->type == GETHOSTBYNAMEv6)
|
||||||
{
|
{
|
||||||
|
|
@ -253,10 +263,11 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
|
||||||
|
|
||||||
/* And finally the name. We mark this as the last entry. */
|
/* And finally the name. We mark this as the last entry. */
|
||||||
if (addr_list_type == GETHOSTBYADDR)
|
if (addr_list_type == GETHOSTBYADDR)
|
||||||
cache_add (GETHOSTBYNAME, data->strdata, h_name_len, data, total, data,
|
cache_add (GETHOSTBYNAME, data->strdata, h_name_len, data, total,
|
||||||
0, t, db, owner);
|
data, 0, t, db, owner);
|
||||||
cache_add (GETHOSTBYNAMEv6, data->strdata, h_name_len, data,
|
cache_add (GETHOSTBYNAMEv6, data->strdata, h_name_len, data,
|
||||||
total, data, 1, t, db, owner);
|
total, data, 1, t, db, owner);
|
||||||
|
}
|
||||||
|
|
||||||
pthread_rwlock_unlock (&db->lock);
|
pthread_rwlock_unlock (&db->lock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue