summaryrefslogtreecommitdiff
path: root/nscd/connections.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-15 08:25:49 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-15 08:25:49 +0000
commitd19687d6ebc545b633e14c07429f7892a599d0b9 (patch)
tree033b6f123581d67026b2375b77175a93dfdc32dd /nscd/connections.c
parent5d156bb641c71070aab9129fe1dac03287b9938a (diff)
Update.
2004-09-15 Ulrich Drepper <drepper@redhat.com> * nscd/Makefile (rountines): Add nscd_getai. (nscd-modules): Add aicache. * nscd/aicache.c: New file. * nscd/nscd_getai.c: New file. * nscd/cache.c (prune_cache): Handle GETAI request type. * nscd/connections.c: Add GETAI support in request handling. * nscd/nscd-client.h (request_type): Add GETAI. Define ai_response_header and struct nscd_ai_result types. (struct datahead): Add aidata field. Declare __nscd_getai. * nscd/nscd.c: Add getaddrinfo definition to catch problems. * nscd/nscd.h: Declare addhstai and readdhstai. * sysdeps/posix/getaddrinfo.c: Add support for using cached results. * nscd/nscd-client.h (struct datahead): Use uint8_t instead of bool.
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index b95ab05b3a..fe33c76bcf 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -83,7 +83,8 @@ const char *serv2str[LASTREQ] =
[INVALIDATE] = "INVALIDATE",
[GETFDPW] = "GETFDPW",
[GETFDGR] = "GETFDGR",
- [GETFDHST] = "GETFDHST"
+ [GETFDHST] = "GETFDHST",
+ [GETAI] = "GETAI"
};
/* The control data structures for the services. */
@@ -151,6 +152,7 @@ static struct database_dyn *const serv2db[LASTREQ] =
[GETFDPW] = &dbs[pwddb],
[GETFDGR] = &dbs[grpdb],
[GETFDHST] = &dbs[hstdb],
+ [GETAI] = &dbs[hstdb],
};
@@ -592,8 +594,9 @@ cannot handle old request version %d; current version is %d"),
struct database_dyn *db = serv2db[req->type];
- if (__builtin_expect (req->type, GETPWBYNAME) >= GETPWBYNAME
- && __builtin_expect (req->type, LASTDBREQ) <= LASTDBREQ)
+ if ((__builtin_expect (req->type, GETPWBYNAME) >= GETPWBYNAME
+ && __builtin_expect (req->type, LASTDBREQ) <= LASTDBREQ)
+ || req->type == GETAI)
{
if (__builtin_expect (debug_level, 0) > 0)
{
@@ -702,6 +705,10 @@ cannot handle old request version %d; current version is %d"),
addhstbyaddrv6 (db, fd, req, key, uid);
break;
+ case GETAI:
+ addhstai (db, fd, req, key, uid);
+ break;
+
case GETSTAT:
case SHUTDOWN:
case INVALIDATE: