summaryrefslogtreecommitdiff
path: root/nis/nis_call.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-01-24 13:45:44 +0000
committerUlrich Drepper <drepper@redhat.com>1998-01-24 13:45:44 +0000
commitac9f45cfd18eeffd6a9fbbcc86e68657c95658a6 (patch)
treea36c5eed9258c2324f4f1b68f77217f83f2b4cf9 /nis/nis_call.c
parentecb9d3e182343fb4a89e4446e41037c6971b1657 (diff)
downloadglibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.tar.gz
Update NIS+.
1998-01-24 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/Makefile: Distribute nis_cache2.h, add nis cache functions to routines. * nis/nis_cache.c: New. * nis/nis_cache2.h: New. * nis/nis_cache2_xdr.c: New. * nis/nis_call.c: Changes for cache2_info parameter. * nis/nis_checkpoint.c: Likewise. * nis/nis_intern.h: Likewise. * nis/nis_mkdir.c: Likewise. * nis/nis_ping.c: Likewise. * nis/nis_rmdir.c: Likewise. * nis/nis_server.c: Likewise. * nis/nis_util.c: Likewise. 1997-12-30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nss_nisplus/nisplus-alias.c: Fix bogus if case and return/errnop codes. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. 1997-12-28 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nss_nis/nis-alias.c: Use errnop, not __set_errno(). * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-publickey.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise.
Diffstat (limited to 'nis/nis_call.c')
-rw-r--r--nis/nis_call.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/nis/nis_call.c b/nis/nis_call.c
index cea508e5b6..196f6b36f1 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -186,7 +186,8 @@ __bind_connect (dir_binding *dbp)
}
static dir_binding *
-__bind_create (const nis_server *serv_val, u_int serv_len, u_long flags)
+__bind_create (const nis_server *serv_val, u_int serv_len, u_long flags,
+ cache2_info *cinfo)
{
dir_binding *dbp;
u_int i;
@@ -268,7 +269,14 @@ __bind_create (const nis_server *serv_val, u_int serv_len, u_long flags)
dbp->server_val[i].pkey.n_bytes = NULL;
}
- if (__nis_findfastest (dbp) < 1)
+ dbp->class = -1;
+ if (cinfo != NULL && cinfo->server_used >= 0)
+ {
+ dbp->server_used = cinfo->server_used;
+ dbp->current_ep = cinfo->current_ep;
+ dbp->class = cinfo->class;
+ }
+ else if (__nis_findfastest (dbp) < 1)
{
__bind_destroy (dbp);
return NULL;
@@ -280,7 +288,7 @@ __bind_create (const nis_server *serv_val, u_int serv_len, u_long flags)
nis_error
__do_niscall2 (const nis_server *server, u_int server_len, u_long prog,
xdrproc_t xargs, caddr_t req, xdrproc_t xres, caddr_t resp,
- u_long flags, nis_cb *cb)
+ u_long flags, nis_cb *cb, cache2_info *cinfo)
{
enum clnt_stat result;
nis_error retcode;
@@ -289,7 +297,8 @@ __do_niscall2 (const nis_server *server, u_int server_len, u_long prog,
if (flags & MASTER_ONLY)
server_len = 1;
- if ((dbp = __bind_create (server, server_len, flags)) == NULL)
+ dbp = __bind_create (server, server_len, flags, cinfo);
+ if (dbp == NULL)
return NIS_NAMEUNREACHABLE;
while (__bind_connect (dbp) != NIS_SUCCESS)
{
@@ -549,10 +558,15 @@ __do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
directory_obj *dir = NULL;
nis_server *server;
u_int server_len;
+ cache2_info cinfo = {-1, -1, -1};
if (name == NULL)
return NIS_BADNAME;
+ /* Search in local cache. In the moment, we ignore the fastest server */
+ if (!(flags & NO_CACHE))
+ dir = __nis_cache_search (name, flags, &cinfo);
+
if (dir == NULL)
{
nis_error status;
@@ -578,7 +592,7 @@ __do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
retcode = __do_niscall2 (server, server_len, prog, xargs, req, xres, resp,
- flags, cb);
+ flags, cb, &cinfo);
nis_free_directory (dir);