FreeBSD src
Go to file
wpaul 24c42ee823 Big round o changes:
- yp_dblookup.c: Create non-DB specific database access functions.
  Using these allows access to the underlying database functions without
  needing explicit knowledge of Berkeley DB. (These are used only
  when DB_CACHE is #defined. Other programs that use the non-caching
  functions (yp_mkdb, ypxfr, yppush, rpc.yppasswdd) shouldn't notice
  the difference.)

- yp_dnslookup: Implement async DNS lookups. We send our own DNS
  requests using UDP and put the request in a queue. When the response
  arrives, we use the ID in the header to find the corresponsing queue
  entry and then send the response to the client. We can go about our
  business and handle other YP requests in the meantime. This way, we
  can deal with time consuming DNS requests without blocking and without
  forking.

- yp_server.c: Convert to using new non-DB-specific database access
  functions. This simplifies the code a bit and removes the need for
  this module to know anything about Berkeley DB. Also convert the
  ypproc_match_2_svc() function to use the async DNS lookup routines.

- yp_main.c: tweak yp_svc_run() to add the resolver socket to the
  set of descriptors monitored in the select() loop. Also add a
  timeout to select(); we may get stale DNS requests stuck in the
  queue which we want to invalidate after a while. If the timeout
  hits, we decrement the ttl on all pending DNS requests and nuke
  those requests that aren't handled before ttl hits zero.

- yp_extern.h: Add prototypes for new stuff.

- yp_svc_udp.c (new file): The async resolver code needs to be able
  to rummage around inside the RPC UDP transport handle in order to
  work correcty. There's basically one transport handle, and each time
  a request comes in, the transaction ID in the handle is changed.
  This means that if we queue a DNS request, then we handle some other
  unrelated requests, we will be unable to send the DNS response because
  the transaction ID and remote address of the client that made the DNS
  request will have been lost. What we need to do is save the client
  address and transaction ID in the queue entry for the DNS request,
  then put the transaction ID and address back in the transport handle
  when we're ready to reply. (And then we have to undo the change so
  as not to confuse any other part of the server.) The trouble is that
  the transaction ID is hidden in an opaque part of the transport handle,
  and only the code in the svc_udp module in the RPC library knows how
  to handle it. This file contains a couple of functions that let us
  read and set the transaction ID in spite of this. This is really a
  dirty trick and I should be taken out and shot for even thinking about
  it, but there's no other way to get this stuff to work.

- Makefile: add yp_svc_udp.c to SRCS.
1996-12-22 22:30:58 +00:00
bin Make sh(1) a little braver in the face of adversity. sh(1) 1996-12-21 22:09:40 +00:00
contrib Ay, merge from RELENG_2_2. Back out the "moving HEAD" fix. 1996-12-19 08:55:10 +00:00
eBones Fix a cosmetic bug that has bothered me for ages. :-) 1996-12-21 06:21:16 +00:00
etc Add /usr/local/sbin to the rc $PATH. Things like GateD are located there. 1996-12-19 18:06:35 +00:00
games Correct the location of the trek documentation in the 1996-12-14 18:34:56 +00:00
gnu Even more buffer overflow fixes 1996-12-19 10:45:16 +00:00
include string.h defines nonstandard routines when _POSIX_SOURCE is 1996-12-17 19:35:43 +00:00
lib Add __dns_getanswer() hook to allow access to the gethostanswer() 1996-12-22 22:05:43 +00:00
libexec Document the -k, -v and -x options. 1996-12-16 00:01:28 +00:00
lkm Make snake 3.0-CURRENT here. 1996-11-11 14:18:40 +00:00
release Added comments on how to setup syscons to work on older ThinkPads. 1996-12-17 00:53:33 +00:00
sbin FIx coredump with rtquery. 1996-12-21 05:55:55 +00:00
secure Secure telnet is now in eBones. 1996-11-07 14:42:57 +00:00
share Do not use variable PRINTERDEVICE as printer name. 1996-12-22 16:16:13 +00:00
sys Document MAXDSIZ and DFLDSIZ. This is a 2.2 candidate change. 1996-12-22 18:28:50 +00:00
tools Fix the 'info sharedlibextention' output in tclsh which was caused by a 1996-12-17 13:08:08 +00:00
usr.bin Allow mail(1) to look for multiple mail.rc files. 1996-12-21 22:53:58 +00:00
usr.sbin Big round o changes: 1996-12-22 22:30:58 +00:00
COPYRIGHT This is the official 4.4 Lite copyright. 1994-09-11 07:53:28 +00:00
Makefile Add comment on -DALLLANG. 1996-12-20 08:18:47 +00:00