Intial commit
This commit is contained in:
492
prospero/patches/LOG
Normal file
492
prospero/patches/LOG
Normal file
@@ -0,0 +1,492 @@
|
||||
1 April, 1994 -- swa merging in mitra patches.
|
||||
|
||||
10Mar93-18Nov93T+.patch -- ignored; generated by mitra but not in the
|
||||
important list. I reviewed it just to remind
|
||||
myself what had changed and to set a context for
|
||||
this work.
|
||||
|
||||
Mitra wasn't kidding -- it really was 20,000 lines of difference. A
|
||||
lot of that was .PS files though, thank goodness.
|
||||
|
||||
Note: BCN has checked out a few source files; may be future problems.
|
||||
|
||||
|
||||
Returned to work on April 5, at 8:45 pm.
|
||||
|
||||
10Mar94.newpsite.patch: an existing ISI patch. Ignored.
|
||||
|
||||
10Mar94.bug.patch:
|
||||
|
||||
flushed include/p_open_tcp.h (gone from FILES).
|
||||
|
||||
reordered include/ardp.h; all included
|
||||
[done]
|
||||
|
||||
fixed mitra's concerns about dirsrv_v1.c.
|
||||
|
||||
bug1.patch:
|
||||
|
||||
p_initialize() change makes sense.
|
||||
regex bug makes sense.
|
||||
merging it in.
|
||||
|
||||
debug.patch:
|
||||
debugging code looks ok.
|
||||
getting rid of some weird debugging code was fine.
|
||||
|
||||
purify.patch: done
|
||||
|
||||
purify1.patch: done
|
||||
|
||||
pfailure.patch:
|
||||
maybe pointless, as mitra said. Added it with one minor
|
||||
change: now active only when DEBUG_PFAILURE is defined, not when
|
||||
NDEBUG is not defined.
|
||||
[done]
|
||||
|
||||
pfailure1.patch: [done]
|
||||
|
||||
debugNwarn.patch:
|
||||
|
||||
I solved the ctype.h problem with isascii() in a
|
||||
different way, since isascii() isn't a part of the POSIX
|
||||
standard. I just wrote an isascii() macro for the three
|
||||
places Prospero uses it. So mitra's revised ctype.h didn't
|
||||
get included.
|
||||
|
||||
|
||||
lib/pfs/strtok.c is vestigial; the only place it's used is in
|
||||
the WAIS code, which should use the standard library version
|
||||
of strtok(). I'm removing lib/pfs/strtok.c from the
|
||||
distribution.
|
||||
|
||||
other such functions that are now standardly available on new
|
||||
UNIX releases should be removed from the Prospero distribution
|
||||
as well, or at least moved to the misc directory.
|
||||
lib/pfs/strspn.c and others.
|
||||
|
||||
I'd already fixed the -Wshadow `warnings with prototypes in
|
||||
include/ardp.h and include/pfs.h, but in a slightly different
|
||||
way than you did; six of one, half a dozen of the other. I
|
||||
left it my way out of inertia; your solution was good too.
|
||||
|
||||
mitraopt.patch:
|
||||
my addition of support for GENERATION will change a bit of this.
|
||||
See the top level Makefile. Note that I haven't tested this
|
||||
GENERATION macro.
|
||||
|
||||
can you explain to me some time what you use the 'echobinfiles' to
|
||||
actually do?
|
||||
|
||||
I modified .gdbinit to include most of your stuff.
|
||||
|
||||
I added your definitions of 'tags' to the master makefile.
|
||||
|
||||
` rest I did not include.
|
||||
|
||||
mitraopt1.patch:
|
||||
fixed the installdirs: target in the top-level Makefile that this fixes.
|
||||
see above comment about 'generation'
|
||||
Rest I did not include.
|
||||
|
||||
mitraopt2.patch:
|
||||
did not include.
|
||||
|
||||
thread.patch:
|
||||
I fixed the bogus code you pointed out in dsrobject_v6.c and dsdir.c
|
||||
I did not include your program user/pfsinit, since I felt that
|
||||
it was not of widely general utility, except as an example.
|
||||
|
||||
|
||||
---went to sleep at 4:15 am, 4/6/94---
|
||||
12:23 pm, 4/6/94 -- back on
|
||||
|
||||
finishing threads.patch:
|
||||
|
||||
the patch includes modifications that I already made to my
|
||||
sources and later applied to yours, but this doesn't affect you since
|
||||
those patches are present in my source in any case.
|
||||
(lib/psrv/dsdir.c, lib/psrv/dsrfinfo.c, a couple of others).
|
||||
|
||||
thread1.patch:
|
||||
|
||||
a nice series of patches. many thanks.
|
||||
Adding the close() operations in case of error return was great.
|
||||
|
||||
I am not entirely convinced of the validity of the changes to
|
||||
the dispatching loop in dirsrv(). I have been looking over the
|
||||
solaris manual pages for select() and friends; it's not clear to me
|
||||
that select() is guaranteed not to block. I hope to be able to discuss
|
||||
this with you.
|
||||
|
||||
[done]
|
||||
|
||||
doc.patch:
|
||||
|
||||
I did not include pandora.todolist in the prealpha, because that is an
|
||||
internal document for Pandora and ISI to use, not a general part of
|
||||
the release. It's in my sources though and I'm being mindful of it.
|
||||
|
||||
I added documentation to the doc/system_calls file so that it woudln't
|
||||
confuse a new user.
|
||||
|
||||
[done]
|
||||
|
||||
aolwait.patch:
|
||||
did not include change to ARDP_DEFAULT_TIMEOUT from 4 to 6 in
|
||||
include/ardp.h; this should be a special change you make in mitraopts,
|
||||
I think.
|
||||
|
||||
I similarly did not include your changes to include/plog.h to
|
||||
change the L_WTTIME_THRESHOLD, L_SYSTIME_THRESHOLD, and
|
||||
L_COMP_SVC_THRESHOLD, and others that can be configured in
|
||||
<pserver.h>. I added documentation to include/pserver.h and
|
||||
include/plog.h to make it clearer to the users that these defaults
|
||||
can be overridden more elegantly by editing pserver.h.
|
||||
|
||||
Please let me know if you think we should change any of the defaults
|
||||
in include/ardp.h or include/plog.h for general purpose use; I'm open
|
||||
to suggestions.
|
||||
|
||||
|
||||
I did not make the changes in this patch to ardp_pr_actv.c or
|
||||
ardp_send.c, because the comment in ardp_pr_actv.c file indicated that
|
||||
it was a temporary change to test a particular theory. Please let me
|
||||
know if you want them to be a permanent part of the distribution.
|
||||
|
||||
After reading through this patch and thinking about it, I did
|
||||
not merge any of it into our sources. We may want to discuss it if
|
||||
there are things you feel are of general use. I was uncomfortable
|
||||
adding ARDP_WAIT_TOO_LONG to the standard ARDP library error codes
|
||||
without further discussion with you.
|
||||
|
||||
|
||||
|
||||
solaris.patch:
|
||||
I changed ARDP_MY_WINDOW_SZ for Solaris from 9 to 6 in the
|
||||
master sources; please let me know if this was correct.
|
||||
I am wondering if -lmalloc (which I see in the compilation
|
||||
arguments in server/Makefile) is always necessary on SOLARIS, or
|
||||
whether it's just a special-purpose thing that you're doing. Please
|
||||
let me know.
|
||||
None of the rest of this patch seemed like something that
|
||||
should go into the master sources.
|
||||
|
||||
pand05.patch:
|
||||
unused.
|
||||
|
||||
|
||||
6:46 pm: done
|
||||
|
||||
|
||||
4/11/94,
|
||||
|
||||
4:45 pm: Done with pfs_threads.h. All patches complete.
|
||||
|
||||
Summary of work:
|
||||
/nfs/gost/build/10Mar94.patched/patches/done:
|
||||
10Mar94.bug.patch 10Mar94.doc.patch 10Mar94.purify1.patch
|
||||
10Mar94.bug1.patch 10Mar94.pfailure.patch 10Mar94.thread.patch
|
||||
10Mar94.debug.patch 10Mar94.pfailure1.patch 10Mar94.thread1.patch
|
||||
10Mar94.debugNwarn.patch 10Mar94.purify.patch pfs_threads.h
|
||||
|
||||
/nfs/gost/build/10Mar94.patched/patches/half-done:
|
||||
10Mar94.mitraopt.patch
|
||||
|
||||
/nfs/gost/build/10Mar94.patched/patches/ignored:
|
||||
10Mar93-18Nov93T+.patch 10Mar94.mitraopt2.patch
|
||||
10Mar93-18Nov93T+.patch.~1~ 10Mar94.newpsite.patch
|
||||
10Mar94.aolwait.patch 10Mar94.pand05.patch
|
||||
10Mar94.mitraopt1.patch 10Mar94.solaris.patch
|
||||
|
||||
|
||||
Issue: Our overriding stdlib.h has the difficulty that 'putenv'
|
||||
doesn't appear in the include files. Neither POSIX nor ANSI C have a
|
||||
standard environment setting function.
|
||||
|
||||
Later cleanup:
|
||||
|
||||
ctype.h: see above.
|
||||
stdlib.h:
|
||||
I #ifdef'd this with SOLARIS, renamed it solaris_stdlib.h
|
||||
|
||||
renamed fout_of_memory to p__fout_of_memory. Renamed is_out_of_memory
|
||||
to p__is_out_of_memory. Renamed finternal_error() to p__finternal_error().
|
||||
|
||||
|
||||
Moved re_comp_exec to lib/pfs/re_comp_exec.c. Renamed it to p__re_comp_exec.c.
|
||||
|
||||
changed dirsrv_internal_error_handler() back, since the test against
|
||||
the out_of_memory variable seemed incorrect to me. Please talk to me
|
||||
if you think this change should go into the release.
|
||||
|
||||
Fixed problems with fprintf() in lib/psrv/plog.c
|
||||
|
||||
Looked at the pcompat library again, significant restructuring:
|
||||
app/Makefile.pcompat and app/Makefile.nopcompat are now both just
|
||||
app/Makefile.
|
||||
|
||||
lib/pcompat/Makefile.pcompat and
|
||||
lib/pcompat/Makefile.nopcompat are now both just
|
||||
lib/pcompat/Makefile.
|
||||
|
||||
|
||||
in list_macros.h, please explain this comment:
|
||||
|
||||
/* someone else uses the above code, they just don't have it in a macro!*/
|
||||
|
||||
---
|
||||
ietftypes is now installed just in P_BINARIES by default, not in /usr/local/lib
|
||||
---
|
||||
|
||||
April 29, 1994:
|
||||
|
||||
Started installing a new batch of MITRA patches, completed on 27 April 1994.
|
||||
|
||||
purify2.patch -- done
|
||||
|
||||
thread.patch:
|
||||
|
||||
this was modified from the first time I applied thread.patch. This
|
||||
time, pfsinit and pfsinit+ were no longer in the patch file. That
|
||||
seemed appropriate to me. IGNORED
|
||||
|
||||
thread2.patch:
|
||||
|
||||
internal_err.c has changed in such a way that the changes this patch made to
|
||||
internal_err.c are no longer useful..
|
||||
|
||||
|
||||
I had already made some of the changes to lib/psrv/dsrfinfo.c, but in
|
||||
a slightly different way.
|
||||
|
||||
thread3.patch: done
|
||||
|
||||
May 1, 1994
|
||||
|
||||
thread4.patch: stuff for vcache. looks good. Some of the function
|
||||
argument renaming things (done for the sake of -Wshadow) were things
|
||||
I'd also done in a different way. DONE.
|
||||
|
||||
|
||||
doc1.patch: DONE.
|
||||
|
||||
aolwait.patch:
|
||||
|
||||
I had to be careful with this one. I assume you did not intend to put the changes to plog.h into general distribution.
|
||||
|
||||
I also did not understand the changes you made to ardp_pr_actv.c and
|
||||
therefore I did not apply them.
|
||||
|
||||
I also did not understand why you turned off the retry count.
|
||||
|
||||
In general, I do not understand the ARDP_WAIT_TOO_LONG error and how
|
||||
it fits into our general interface. As it stands, it seems
|
||||
AOL-specific enough that I'm uncomfortable incorporating it as it
|
||||
stands into our sources; I would be glad to discuss some general
|
||||
mechanism we could use to accomplish the same end. One is clearly
|
||||
needed to solve this problem (swa: Discuss with BCN)
|
||||
|
||||
I think the change (to call ardp_rwait when there's a queue) is good.
|
||||
I think we need a general hook in the ARDP code so that you can set
|
||||
such a function from a higher level; that section of the ARDP code is
|
||||
not general enough (for instance, it currently contains archie-specific code.)
|
||||
|
||||
(NOT APPLIED)
|
||||
|
||||
dnscache.patch:
|
||||
|
||||
I am not comfortable with configuring the behavior of ARDP library
|
||||
stuff in <pserver.h>.
|
||||
|
||||
a) sometimes people compile just the Prospero clients, not the server.
|
||||
This makes the whole ARDP library dependent upon <PSERVER.H>
|
||||
|
||||
b) ARDP.H needs its own separate configuration file so that it can be
|
||||
separated from the rest of Prospero.
|
||||
|
||||
This change has been incorporated into the sources; we should change
|
||||
the configuration in the future.
|
||||
|
||||
c) your change to lib/pfs/myhost.c was one I'd made in a
|
||||
slightly different way.
|
||||
|
||||
DONE
|
||||
|
||||
dnscache1.patch: DONE. Good patch.
|
||||
|
||||
dircache.patch:
|
||||
|
||||
This is a note to myself to reconcile include/pserver.h with the
|
||||
master include/pserver.h.dist. This patch changed pserver.h. In the
|
||||
future, changes to the distribution pserver.h should be made to
|
||||
include/pserver.h.dist. I will have to implement this change to our
|
||||
configuration proceedings.
|
||||
|
||||
PATCH DONE
|
||||
|
||||
memleaks.patch: GOOD PATCH. DONE
|
||||
|
||||
ackall.patch: This is not listed in apply.patches. I assume that it
|
||||
should not be applied. In any case, the change to lib/ardp/ardp_accept.c should not be inside an #ifdef PFS_THREADS.
|
||||
|
||||
NOT APPLIED.
|
||||
|
||||
solaris.patch:
|
||||
|
||||
This patch has configuration changes that should only be configured
|
||||
under solaris interleaved with things that should be in the general
|
||||
distribution (e.g., the comments on what you need to configure to use
|
||||
SOLARIS). I have used judgement to make the changes that seemed to me
|
||||
to be general.
|
||||
|
||||
We need a more general way of modifying <ardp.h>
|
||||
|
||||
PARTLY APPLIED
|
||||
|
||||
|
||||
solaris1.patch, solaris2.patch:
|
||||
pfsinit doesn't striike me as generally useful.
|
||||
|
||||
NOT APPLIED
|
||||
|
||||
|
||||
All patches through April 27th now applied.
|
||||
|
||||
Now to compile (without PFS_THREADS):
|
||||
|
||||
Prospero wouldn't compile with PFS_THREADS turned off until I #if 0'd out
|
||||
the special code in <pfs_threads.h> that redefined locked_fopen()
|
||||
in case of threadless compilation.
|
||||
|
||||
That code should be reinstated, for efficiency, but only when we add
|
||||
appropriate #ifdefs to comment out the whole file locking set of code
|
||||
when not multi-threaded.
|
||||
|
||||
|
||||
|
||||
I have a new version of include/pfs_threads.h that is compatible with yours.
|
||||
|
||||
--
|
||||
|
||||
I made a significant change to lib/pfs/pmap_cache.c: instead of
|
||||
EXECVCACHE being the special option, the special option is now called
|
||||
INCREASE_CLIENT_EXECUTABLE_SIZE_DO_NOT_EXEC_VCACHE. It is heavily
|
||||
commented in include/psite.h, with an explanation of the circumstances
|
||||
under which one might enable it. The default is to definitely not
|
||||
have it enabled.
|
||||
|
||||
If you would like the vcache library to stay a part of the release,
|
||||
then that libpvcache code will need a great deal of work, work that we
|
||||
don't have the time to put into it. All of the external identifiers
|
||||
in libpvache() will have to start with a p__vcache, except for a few
|
||||
strictly defined interfaces. Otherwise, anybody in the outside
|
||||
linking with that library will encounter problems.
|
||||
|
||||
Also, the interface to that library should be documented somewhere
|
||||
(just a half-page explaining how you interact with it and how you link
|
||||
with it). Also, the dependencies problems will need to be fixed.
|
||||
Right now, it's really awkward to use and to explain to others how to
|
||||
use it; thus my reluctance to include it as a regular part of the
|
||||
distribution.
|
||||
|
||||
Also, it's not clear to me that that code doesn't memory leak; if it
|
||||
doesn't, please change the comment at the head of vcache.c to explain
|
||||
that we've been using it commercially and have avoided leaks by that
|
||||
means.
|
||||
|
||||
I am leaving the code in right now, but in an unsupported status,
|
||||
because of the above-mentioned problems with it.
|
||||
|
||||
|
||||
--
|
||||
The client-side caching in the VCACHE library is not something I'm
|
||||
comfortable putting into the release right now. The
|
||||
Also, the caching strategy needs to be
|
||||
documented in the library manual. Also, a policy for cleaning old
|
||||
objects out of the cache and keeping it from taking over the disk
|
||||
space needs to appear.
|
||||
|
||||
|
||||
--
|
||||
|
||||
Another issue is that comments in our code should be appropriately
|
||||
spelled. It's full of "dont" and "doesnt" and "wont" and "couldnt"
|
||||
---
|
||||
I made many changes to the configuration stuff.
|
||||
|
||||
I have cut out your 'bintar' and 'echobinfiles' dependencies; if you need
|
||||
them back we can talk about it.
|
||||
--
|
||||
|
||||
I have gotten rid of your test dependencies in user/vcache/Makefile.
|
||||
---
|
||||
I got rid of the 'pure' dependency in the top-level and server makefiles. The code is here if you want to use it for yourself:
|
||||
|
||||
in top Makefile:
|
||||
|
||||
##
|
||||
## This target is used only when using PURIFY.
|
||||
## Ignore it for normal work.
|
||||
## This only debugs the server for now. Needs to be modified for your needs.
|
||||
## Mitraism.
|
||||
|
||||
pure:
|
||||
for i in server ; do \
|
||||
( cd $$i; \
|
||||
echo "Making in $$i"; \
|
||||
$(MAKE) $(PASTHRU) pure 2>&1 | $(SED-SCRIPT) ) ;\
|
||||
done
|
||||
|
||||
in Makefile.config:
|
||||
##
|
||||
## PURIFY
|
||||
##
|
||||
## Purify is a developer's tool used to check for memory leaks and other error
|
||||
## conditions.
|
||||
## If you have never heard of it or if you don't use it, just don't worry
|
||||
## about it.
|
||||
|
||||
# If you use Purify, you can specify a command syntax for it
|
||||
# Make a purified dirsrv with 'make pure'.
|
||||
PURIFY = purify
|
||||
|
||||
|
||||
# PURE_LIBS is usually LIBS , except on Solaris when it excludes thread
|
||||
# No idea why Mitra needed -lmalloc.
|
||||
# PURE_LIBS = -lsocket -lnsl
|
||||
PURE_LIBS = $(LIBS) -lmalloc
|
||||
|
||||
# This is for PURIFY
|
||||
# Note that problems with threads may have to be debugged with -g, not
|
||||
# with -ggdb3.
|
||||
|
||||
PURE_CFLAGS = -g $(GCCWARN) $(GCCTRY)
|
||||
|
||||
|
||||
in server/MAkefile:
|
||||
## Used when using the special PURIFY package.
|
||||
## It is not clear to me why this target is needed, but mitra uses it.
|
||||
## It may be yanked out of the full release.
|
||||
|
||||
pure: pure_dirsrv
|
||||
|
||||
pure_dirsrv: $(DIRSRV_OBJECTS) ${SRV_LIBS_DEPENDENCIES}
|
||||
${PURIFY} ${CC} ${F_CCL} -o $@ $(DIRSRV_OBJECTS) \
|
||||
$(SRV_LIBS) $(PURE_LIBS)
|
||||
|
||||
---
|
||||
gopher_gw_diag_mutexes() and gopher_gw_init_mutexes now called
|
||||
from DIRSRV,, not lib/psrv/psrv_mutexes.c. This eliminates
|
||||
ordering/dependency problems.
|
||||
|
||||
--
|
||||
another practice that should be eliminated is that of declaring
|
||||
subfunctions inside master files; they should always be in include files.
|
||||
|
||||
--
|
||||
|
||||
It is not clear to me why VLDEBUGBEGIN and VLDEBUGEND should be left
|
||||
in the sources. Ditto CHECK_MEM(). Is there any reason why they are
|
||||
still useful? If not generally useful, they should be removed before
|
||||
the release.
|
||||
50
prospero/patches/apply.patches
Normal file
50
prospero/patches/apply.patches
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
# Define some common functions: getsysteminformation applyallpatches cleanitup
|
||||
Parm=$1
|
||||
. apply.patches.common
|
||||
Version=10Mar94
|
||||
ApplVersion=$Version
|
||||
# Get system dependent variables, esp Sys and Loc, can be overridden below
|
||||
getsysteminformation
|
||||
UntarsInto=prealpha.5.3.10Mar93
|
||||
TarFile=10Mar94.tar.Z
|
||||
ExternalPatches="newpsite"
|
||||
PublicPatches="bug debug purify pfailure debugNwarn"
|
||||
PrivatePatches="mitraopt"
|
||||
NewPatches="thread doc aolwait dnscache dircache memleaks"
|
||||
LocalPatches="${Sys} ${Loc}"
|
||||
Patches="$ExternalPatches $PublicPatches $PrivatePatches $NewPatches
|
||||
$LocalPatches"
|
||||
betweentarandpatches() {
|
||||
mv ${UntarsInto} ${ApplVersion}
|
||||
[ -f $ApplVersion/include/usc-license.h ] ||
|
||||
echo "/*No licence in distribution*/" >$ApplVersion/include/usc-license.h
|
||||
}
|
||||
afterpatches() {
|
||||
#echo after.patches in patched version
|
||||
ln -s /src/prospero/rmg user/rmg
|
||||
}
|
||||
case "$Parm" in
|
||||
mk) untarandapplyallpatchesandmkpatch ;;
|
||||
*) untarandapplyallpatches ;;
|
||||
esac
|
||||
|
||||
exit
|
||||
|
||||
######## The patches .....
|
||||
|
||||
newpsite The ISI patch to add sites
|
||||
bug Various bug fixes
|
||||
debug Stuff to help debugging
|
||||
purify Support for Purify
|
||||
pfailure probably pointless patch to help track PFAILURE problems
|
||||
debugNwarn more debugging, and fixes for compiler warnings
|
||||
mitraopt Mitra's preferences for all his sites
|
||||
thread Fixes to enable it to work multi-threaded
|
||||
doc Some documentation
|
||||
aolwait Support for backing off aol clients, and distinguishing
|
||||
dead servers from slow ones
|
||||
solaris Support for solaris
|
||||
|
||||
***NOTE *** pfs_threads is not patched by any of these, the release
|
||||
version is really bad and should probably be replaced by my copy.
|
||||
130
prospero/patches/done/10Mar94.dircache.patch
Normal file
130
prospero/patches/done/10Mar94.dircache.patch
Normal file
@@ -0,0 +1,130 @@
|
||||
This patch was created on pand05 at Tue Apr 26 20:36:09 EDT 1994
|
||||
The command used to create it was: gnudiff -b -r -c 10Mar94.all 10Mar94+
|
||||
|
||||
It is made available on an as-is basis, and carries no guarrantee that
|
||||
it even works, much less that it is fit for its purpose.
|
||||
|
||||
If you find any problems with it, please report to mitra@pand05
|
||||
You may use it as you wish, but if you make it pulicly available anywhere
|
||||
please notify me.
|
||||
|
||||
To apply the patch cd to the directory with the source in it, and run
|
||||
|
||||
patch -l -p1 <patchfile
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/include/pserver.h 10Mar94+/include/pserver.h
|
||||
*** 10Mar94.all/include/pserver.h Tue Apr 26 20:36:04 1994
|
||||
--- 10Mar94+/include/pserver.h Tue Apr 26 20:09:36 1994
|
||||
***************
|
||||
*** 523,528 ****
|
||||
--- 523,535 ----
|
||||
*/
|
||||
|
||||
#define DNSCACHE_MAX 300
|
||||
+
|
||||
+ /*
|
||||
+ * If DIRECTORYCACHING is defined, then dirsrv will cache directories
|
||||
+ * on disk under /usr/pfs/shadow/{GOPHER-GW,WAIS-GW}
|
||||
+ */
|
||||
+ #define DIRECTORYCACHING
|
||||
+
|
||||
|
||||
/*
|
||||
* If ACKOWLEDGE_ALL_PACKETS is defined, then ardp_accept will acknowledge
|
||||
diff -b -r -c -N 10Mar94.all/lib/psrv/dsrobject.c 10Mar94+/lib/psrv/dsrobject.c
|
||||
*** 10Mar94.all/lib/psrv/dsrobject.c Tue Apr 26 15:37:10 1994
|
||||
--- 10Mar94+/lib/psrv/dsrobject.c Tue Apr 26 19:50:22 1994
|
||||
***************
|
||||
*** 19,35 ****
|
||||
#include <perrno.h>
|
||||
#include <psrv.h>
|
||||
#include <plog.h>
|
||||
|
||||
- #define DIRECTORYCACHING
|
||||
static PATTRIB newamat(void);
|
||||
|
||||
#ifdef DIRECTORYCACHING
|
||||
|
||||
/* Just under one day - so cron tasks will renew them */
|
||||
#define SECONDSPERDAY (60*60*24)
|
||||
#define MAXDIRCACHEAGE (1*SECONDSPERDAY - 60*30)
|
||||
int cache_attempt = 0; int cache_can = 0; int cache_yes = 0;
|
||||
- int dsrobject_fail = 0;
|
||||
|
||||
int
|
||||
vdir_outofdate(VDIR dir, char *hsoname)
|
||||
--- 19,36 ----
|
||||
#include <perrno.h>
|
||||
#include <psrv.h>
|
||||
#include <plog.h>
|
||||
+ #include <pserver.h> /* For DIRECTORYCACHING */
|
||||
|
||||
static PATTRIB newamat(void);
|
||||
|
||||
+ int dsrobject_fail = 0;
|
||||
+
|
||||
#ifdef DIRECTORYCACHING
|
||||
|
||||
/* Just under one day - so cron tasks will renew them */
|
||||
#define SECONDSPERDAY (60*60*24)
|
||||
#define MAXDIRCACHEAGE (1*SECONDSPERDAY - 60*30)
|
||||
int cache_attempt = 0; int cache_can = 0; int cache_yes = 0;
|
||||
|
||||
int
|
||||
vdir_outofdate(VDIR dir, char *hsoname)
|
||||
***************
|
||||
*** 134,140 ****
|
||||
}
|
||||
|
||||
#endif
|
||||
! if (dirretval != PSUCCESS || vdir_outofdate(dir,hsoname)
|
||||
|| !(dir->links) ) {
|
||||
for (i = 0; i < db_num_ents; i++) {
|
||||
if (strnequal(hsoname, db_prefixes[i].prefix,
|
||||
--- 135,144 ----
|
||||
}
|
||||
|
||||
#endif
|
||||
! if (dirretval != PSUCCESS
|
||||
! #ifdef DIRECTORYCACHING
|
||||
! || vdir_outofdate(dir,hsoname)
|
||||
! #endif
|
||||
|| !(dir->links) ) {
|
||||
for (i = 0; i < db_num_ents; i++) {
|
||||
if (strnequal(hsoname, db_prefixes[i].prefix,
|
||||
diff -b -r -c -N 10Mar94.all/server/dirsrv.c 10Mar94+/server/dirsrv.c
|
||||
*** 10Mar94.all/server/dirsrv.c Tue Apr 26 16:49:13 1994
|
||||
--- 10Mar94+/server/dirsrv.c Tue Apr 26 19:28:25 1994
|
||||
***************
|
||||
*** 70,77 ****
|
||||
extern int vlink_count, pattrib_count, acl_count, pfile_count;
|
||||
extern int rreq_count, ptext_count, string_count, token_count;
|
||||
extern int pauth_count, opt_count, filter_count, p_object_count;
|
||||
!
|
||||
extern int cache_attempt, cache_can, cache_yes, dsrobject_fail;
|
||||
extern int vlink_max, pattrib_max, acl_max, pfile_max;
|
||||
extern int rreq_max, ptext_max, string_max, token_max;
|
||||
extern int pauth_max, opt_max, filter_max, p_object_max;
|
||||
--- 70,78 ----
|
||||
extern int vlink_count, pattrib_count, acl_count, pfile_count;
|
||||
extern int rreq_count, ptext_count, string_count, token_count;
|
||||
extern int pauth_count, opt_count, filter_count, p_object_count;
|
||||
! #ifdef DIRECTORYCACHING
|
||||
extern int cache_attempt, cache_can, cache_yes, dsrobject_fail;
|
||||
+ #endif
|
||||
extern int vlink_max, pattrib_max, acl_max, pfile_max;
|
||||
extern int rreq_max, ptext_max, string_max, token_max;
|
||||
extern int pauth_max, opt_max, filter_max, p_object_max;
|
||||
***************
|
||||
*** 1086,1093 ****
|
||||
--- 1085,1094 ----
|
||||
string_count,string_max, token_count, token_max,
|
||||
pauth_count, pauth_max, /* opt_count, opt_max, */
|
||||
filter_count, filter_max, p_object_count, p_object_max);
|
||||
+ #ifdef DIRECTORYCACHING
|
||||
replyf(req, "Caching: %d attempts, %d can, %d yes, %d fail\n",
|
||||
cache_attempt, cache_can, cache_yes, dsrobject_fail);
|
||||
+ #endif
|
||||
#ifdef PSRV_GOPHER_GW
|
||||
replyf(req, " Memory: %d(%d)glink\n", glink_count, glink_max);
|
||||
#endif
|
||||
392
prospero/patches/done/10Mar94.dnscache.patch
Normal file
392
prospero/patches/done/10Mar94.dnscache.patch
Normal file
@@ -0,0 +1,392 @@
|
||||
diff -b -r -c -N 10Mar94.all/include/pserver.h 10Mar94+/include/pserver.h
|
||||
*** 10Mar94.all/include/pserver.h Tue Apr 26 15:38:11 1994
|
||||
--- 10Mar94+/include/pserver.h Sun Apr 24 17:14:56 1994
|
||||
***************
|
||||
*** 515,518 ****
|
||||
--- 515,526 ----
|
||||
* #define PSRV_CACHE_NATIVE
|
||||
*/
|
||||
|
||||
+
|
||||
+ /*
|
||||
+ * If DNSCACHE_MAX is defined, then dirsrv will cache up to that many
|
||||
+ * DNS addresses. "undef" this for no caching at all.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+ #define DNSCACHE_MAX 300
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/ardp_mutexes.c 10Mar94+/lib/ardp/ardp_mutexes.c
|
||||
*** 10Mar94.all/lib/ardp/ardp_mutexes.c Tue Apr 26 15:36:22 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_mutexes.c Tue Apr 26 01:51:17 1994
|
||||
***************
|
||||
*** 18,23 ****
|
||||
--- 18,24 ----
|
||||
p_th_mutex p_th_mutexGETHOSTBYNAME; /* declared in pfs_mutexes.c */
|
||||
p_th_mutex p_th_mutexARDP_SELFNUM; /* declared in pfs_mutexes.c */
|
||||
p_th_mutex p_th_mutexDNSCACHE; /* declared in pfs_mutexes.c */
|
||||
+ p_th_mutex p_th_mutexALLDNSCACHE; /* declared in pfs_mutexes.c */
|
||||
p_th_mutex p_th_mutexFILES; /* declared on p__self_num.c */
|
||||
p_th_mutex p_th_mutexFILELOCK; /* declared in flock.c */
|
||||
#endif
|
||||
***************
|
||||
*** 35,40 ****
|
||||
--- 36,42 ----
|
||||
p_th_mutex_init(p_th_mutexARDP_RQALLOC);
|
||||
p_th_mutex_init(p_th_mutexARDP_SELFNUM);
|
||||
p_th_mutex_init(p_th_mutexDNSCACHE);
|
||||
+ p_th_mutex_init(p_th_mutexALLDNSCACHE);
|
||||
p_th_mutex_init(p_th_mutexFILES);
|
||||
p_th_mutex_init(p_th_mutexFILELOCK);
|
||||
#endif
|
||||
***************
|
||||
*** 54,59 ****
|
||||
--- 56,62 ----
|
||||
DIAGMUTEX(ARDP_RQALLOC,"ARDP_RQALLOC");
|
||||
DIAGMUTEX(ARDP_SELFNUM,"ARDP_SELFNUM");
|
||||
DIAGMUTEX(DNSCACHE,"DNSCACHE");
|
||||
+ DIAGMUTEX(ALLDNSCACHE,"ALLDNSCACHE");
|
||||
DIAGMUTEX(FILES,"FILES");
|
||||
DIAGMUTEX(FILELOCK,"FILELOCK");
|
||||
#endif
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/dnscache_alloc.c 10Mar94+/lib/ardp/dnscache_alloc.c
|
||||
*** 10Mar94.all/lib/ardp/dnscache_alloc.c Fri Mar 11 05:30:24 1994
|
||||
--- 10Mar94+/lib/ardp/dnscache_alloc.c Thu Apr 21 21:39:41 1994
|
||||
***************
|
||||
*** 32,37 ****
|
||||
--- 32,38 ----
|
||||
|
||||
TH_STRUC_ALLOC(dnscache,DNSCACHE,acache);
|
||||
acache->name = NULL;
|
||||
+ acache->usecount = 0;
|
||||
bzero(&acache->sockad,sizeof(acache->sockad));
|
||||
return(acache);
|
||||
}
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/dnscache_alloc.h 10Mar94+/lib/ardp/dnscache_alloc.h
|
||||
*** 10Mar94.all/lib/ardp/dnscache_alloc.h Fri Mar 11 05:30:25 1994
|
||||
--- 10Mar94+/lib/ardp/dnscache_alloc.h Tue Apr 26 01:51:18 1994
|
||||
***************
|
||||
*** 11,17 ****
|
||||
#endif
|
||||
char *name;
|
||||
struct sockaddr_in sockad;
|
||||
!
|
||||
struct dnscache *next;
|
||||
struct dnscache *previous;
|
||||
};
|
||||
--- 11,17 ----
|
||||
#endif
|
||||
char *name;
|
||||
struct sockaddr_in sockad;
|
||||
! int usecount; /* For determining size of cache */
|
||||
struct dnscache *next;
|
||||
struct dnscache *previous;
|
||||
};
|
||||
***************
|
||||
*** 26,31 ****
|
||||
--- 26,32 ----
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
extern p_th_mutex p_th_mutexDNSCACHE;
|
||||
+ extern p_th_mutex p_th_mutexALLDNSCACHE;
|
||||
#endif
|
||||
|
||||
#endif /*dnscache_alloc_h*/
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/hostname2adr.c 10Mar94+/lib/ardp/hostname2adr.c
|
||||
*** 10Mar94.all/lib/ardp/hostname2adr.c Tue Apr 26 15:36:31 1994
|
||||
--- 10Mar94+/lib/ardp/hostname2adr.c Tue Apr 26 01:51:21 1994
|
||||
***************
|
||||
*** 15,21 ****
|
||||
#include <netinet/in.h> /* for struct sockaddr_in */
|
||||
#include <pmachine.h> /* for bzero */
|
||||
#include <string.h> /* for strcasecmp */
|
||||
!
|
||||
#ifdef PROSPERO
|
||||
#include <pcompat.h>
|
||||
#else /* not PROSPERO */
|
||||
--- 15,24 ----
|
||||
#include <netinet/in.h> /* for struct sockaddr_in */
|
||||
#include <pmachine.h> /* for bzero */
|
||||
#include <string.h> /* for strcasecmp */
|
||||
! #include <pserver.h> /* For DNSCACHE_MAX */
|
||||
! #ifdef DNSCACHE_MAX
|
||||
! #include "dnscache_alloc.h"
|
||||
! #endif
|
||||
#ifdef PROSPERO
|
||||
#include <pcompat.h>
|
||||
#else /* not PROSPERO */
|
||||
***************
|
||||
*** 49,63 ****
|
||||
* It also converts numeric addresses appropriately.
|
||||
*/
|
||||
/* If change this - uncomment/comment initialization in server/dirsrv.c */
|
||||
- #define CACHE_ARDP_HOSTNAME2ADDR
|
||||
|
||||
! #ifdef CACHE_ARDP_HOSTNAME2ADDR
|
||||
#include "dnscache_alloc.h"
|
||||
#include <mitra_macros.h> /* FIND_FNCTN_LIST */
|
||||
#include <string.h> /* For strcmp */
|
||||
|
||||
- DNSCACHE last_dnscache = NULL;
|
||||
DNSCACHE alldnscaches = NULL;
|
||||
|
||||
void
|
||||
sockaddr_copy(struct sockaddr_in *src, struct sockaddr_in *destn)
|
||||
--- 52,65 ----
|
||||
* It also converts numeric addresses appropriately.
|
||||
*/
|
||||
/* If change this - uncomment/comment initialization in server/dirsrv.c */
|
||||
|
||||
! #ifdef DNSCACHE_MAX
|
||||
#include "dnscache_alloc.h"
|
||||
#include <mitra_macros.h> /* FIND_FNCTN_LIST */
|
||||
#include <string.h> /* For strcmp */
|
||||
|
||||
DNSCACHE alldnscaches = NULL;
|
||||
+ int alldnscache_count = 0;
|
||||
|
||||
void
|
||||
sockaddr_copy(struct sockaddr_in *src, struct sockaddr_in *destn)
|
||||
***************
|
||||
*** 65,71 ****
|
||||
/* Nothing in a sockaddr_in is a pointer */
|
||||
memcpy(destn, src, sizeof(struct sockaddr_in));
|
||||
}
|
||||
! #endif /*CACHE_ARDP_HOSTNAME2ADDR*/
|
||||
|
||||
/* Caching has been added, to this - take care that it does what you
|
||||
want, I'm certainly open to changes if this isnt what we need.
|
||||
--- 67,73 ----
|
||||
/* Nothing in a sockaddr_in is a pointer */
|
||||
memcpy(destn, src, sizeof(struct sockaddr_in));
|
||||
}
|
||||
! #endif /*DNSCACHE_MAX*/
|
||||
|
||||
/* Caching has been added, to this - take care that it does what you
|
||||
want, I'm certainly open to changes if this isnt what we need.
|
||||
***************
|
||||
*** 89,132 ****
|
||||
void
|
||||
ardp_hostname2addr_initcache()
|
||||
{
|
||||
! if (!alldnscaches) {
|
||||
! last_dnscache = dnscache_alloc();
|
||||
! last_dnscache->name=stcopy("NoThInG.CoM---");
|
||||
! APPEND_ITEM(last_dnscache,alldnscaches);
|
||||
}
|
||||
}
|
||||
int
|
||||
ardp_hostname2addr(const char *hostname, struct sockaddr_in *hostaddr)
|
||||
{
|
||||
struct hostent *hp; /* Remote host we're connecting to. */
|
||||
!
|
||||
#ifdef PROSPERO
|
||||
int DpfStmp; /* for DISABLE_PFS_START() */
|
||||
#endif
|
||||
! #ifdef CACHE_ARDP_HOSTNAME2ADDR
|
||||
! DNSCACHE acache;
|
||||
|
||||
acache = alldnscaches;
|
||||
|
||||
! p_th_mutex_lock(p_th_mutexDNSCACHE);
|
||||
/* Cant use TH_FIND_FNCTN_LIST because must retain lock */
|
||||
FIND_FNCTN_LIST(acache, name, hostname, stcaseequal);
|
||||
if(acache) {
|
||||
if (hostaddr) {
|
||||
/* Note is is pointless, but not harmfull to call again
|
||||
for same hostaddr - may just want to rerun*/
|
||||
sockaddr_copy(&(acache->sockad),hostaddr);
|
||||
}
|
||||
! p_th_mutex_unlock(p_th_mutexDNSCACHE); /* Also released below*/
|
||||
! return ARDP_SUCCESS;
|
||||
}
|
||||
! p_th_mutex_unlock(p_th_mutexDNSCACHE); /* Note also released above*/
|
||||
! if (!hostaddr){ /* Initializing cache */
|
||||
acache = dnscache_alloc(); /*locks DNSCACHE temporarily*/
|
||||
acache->name = stcopy(hostname);
|
||||
! hostaddr = &(acache->sockad);
|
||||
! }
|
||||
! #endif /*CACHE_ARDP_HOSTNAME2ADDR*/
|
||||
|
||||
DISABLE_PFS_START(); /* Turn off compatibility library if on */
|
||||
p_th_mutex_lock(p_th_mutexGETHOSTBYNAME);
|
||||
--- 91,148 ----
|
||||
void
|
||||
ardp_hostname2addr_initcache()
|
||||
{
|
||||
! }
|
||||
!
|
||||
! static void
|
||||
! dnscache_clean()
|
||||
! {
|
||||
! DNSCACHE dc, nextdc;
|
||||
! if (alldnscache_count > DNSCACHE_MAX) {
|
||||
! p_th_mutex_lock(p_th_mutexALLDNSCACHE);
|
||||
! for (dc = alldnscaches; dc ; dc = nextdc) {
|
||||
! nextdc = dc->next;
|
||||
! if (!(--dc->usecount)) {
|
||||
! EXTRACT_ITEM(dc,alldnscaches);
|
||||
! dnscache_free(dc);
|
||||
! alldnscache_count--;
|
||||
! }
|
||||
! }
|
||||
! p_th_mutex_unlock(p_th_mutexALLDNSCACHE);
|
||||
}
|
||||
}
|
||||
+
|
||||
int
|
||||
ardp_hostname2addr(const char *hostname, struct sockaddr_in *hostaddr)
|
||||
{
|
||||
struct hostent *hp; /* Remote host we're connecting to. */
|
||||
! int retval; /* Value to return */
|
||||
! #define RETURN(rv) { retval = (rv); goto cleanup; }
|
||||
#ifdef PROSPERO
|
||||
int DpfStmp; /* for DISABLE_PFS_START() */
|
||||
#endif
|
||||
! #ifdef DNSCACHE_MAX
|
||||
! DNSCACHE acache = NULL;
|
||||
|
||||
acache = alldnscaches;
|
||||
|
||||
! p_th_mutex_lock(p_th_mutexALLDNSCACHE);
|
||||
/* Cant use TH_FIND_FNCTN_LIST because must retain lock */
|
||||
FIND_FNCTN_LIST(acache, name, hostname, stcaseequal);
|
||||
if(acache) {
|
||||
+ acache->usecount++;
|
||||
if (hostaddr) {
|
||||
/* Note is is pointless, but not harmfull to call again
|
||||
for same hostaddr - may just want to rerun*/
|
||||
sockaddr_copy(&(acache->sockad),hostaddr);
|
||||
}
|
||||
! p_th_mutex_unlock(p_th_mutexALLDNSCACHE); /* Also released below*/
|
||||
! return(ARDP_SUCCESS); /* Dont free acache */
|
||||
}
|
||||
! p_th_mutex_unlock(p_th_mutexALLDNSCACHE); /* Note also released above*/
|
||||
acache = dnscache_alloc(); /*locks DNSCACHE temporarily*/
|
||||
acache->name = stcopy(hostname);
|
||||
! if (!hostaddr) { hostaddr = &(acache->sockad); }
|
||||
! #endif /*DNSCACHE_MAX*/
|
||||
|
||||
DISABLE_PFS_START(); /* Turn off compatibility library if on */
|
||||
p_th_mutex_lock(p_th_mutexGETHOSTBYNAME);
|
||||
***************
|
||||
*** 141,148 ****
|
||||
hostaddr->sin_addr.s_addr = inet_addr(hostname);
|
||||
if(hostaddr->sin_addr.s_addr == -1) {
|
||||
p_clear_errors(); /* clear p_err_string if set. */
|
||||
! return(perrno = ARDP_BAD_HOSTNAME);
|
||||
}
|
||||
}
|
||||
bzero((char *) hostaddr, sizeof *hostaddr);
|
||||
memcpy((char *)&hostaddr->sin_addr, hp->h_addr, hp->h_length);
|
||||
--- 157,165 ----
|
||||
hostaddr->sin_addr.s_addr = inet_addr(hostname);
|
||||
if(hostaddr->sin_addr.s_addr == -1) {
|
||||
p_clear_errors(); /* clear p_err_string if set. */
|
||||
! RETURN(perrno = ARDP_BAD_HOSTNAME);
|
||||
}
|
||||
+ RETURN(ARDP_SUCCESS);
|
||||
}
|
||||
bzero((char *) hostaddr, sizeof *hostaddr);
|
||||
memcpy((char *)&hostaddr->sin_addr, hp->h_addr, hp->h_length);
|
||||
***************
|
||||
*** 150,164 ****
|
||||
/* Don't unlock the mutex until we're no longer reading from hp. */
|
||||
p_th_mutex_unlock(p_th_mutexGETHOSTBYNAME); /* Note can be unlocked above*/
|
||||
/* Copy last result into cache */
|
||||
! #ifdef CACHE_ARDP_HOSTNAME2ADDR
|
||||
if (alldnscaches == NULL)
|
||||
ardp_hostname2addr_initcache();
|
||||
! p_th_mutex_lock(p_th_mutexDNSCACHE);
|
||||
! last_dnscache->name = stcopyr(hostname, last_dnscache->name);
|
||||
! sockaddr_copy(hostaddr,&(last_dnscache->sockad));
|
||||
! p_th_mutex_unlock(p_th_mutexDNSCACHE);
|
||||
! #endif /*CACHE_ARDP_HOSTNAME2ADDR*/
|
||||
! return(ARDP_SUCCESS);
|
||||
}
|
||||
|
||||
/* Prototype needs to go into here, not just in pfs.h. */
|
||||
--- 167,191 ----
|
||||
/* Don't unlock the mutex until we're no longer reading from hp. */
|
||||
p_th_mutex_unlock(p_th_mutexGETHOSTBYNAME); /* Note can be unlocked above*/
|
||||
/* Copy last result into cache */
|
||||
! #ifdef DNSCACHE_MAX
|
||||
if (alldnscaches == NULL)
|
||||
ardp_hostname2addr_initcache();
|
||||
! sockaddr_copy(hostaddr,&(acache->sockad));
|
||||
! /* Boost initially, to bias towards keeping recent*/
|
||||
! acache->usecount = 5;
|
||||
! p_th_mutex_lock(p_th_mutexALLDNSCACHE);
|
||||
! APPEND_ITEM(acache,alldnscaches);
|
||||
! alldnscache_count++;
|
||||
! p_th_mutex_unlock(p_th_mutexALLDNSCACHE);
|
||||
! dnscache_clean(); /* Only does anything if cache too big */
|
||||
! #endif /*DNSCACHE_MAX*/
|
||||
! return(ARDP_SUCCESS); /* Dont free acache */
|
||||
!
|
||||
! cleanup:
|
||||
! #ifdef DNSCACHE_MAX
|
||||
! if (acache) dnscache_free(acache);
|
||||
! #endif
|
||||
! return(retval);
|
||||
}
|
||||
|
||||
/* Prototype needs to go into here, not just in pfs.h. */
|
||||
diff -b -r -c -N 10Mar94.all/lib/pfs/myhost.c 10Mar94+/lib/pfs/myhost.c
|
||||
*** 10Mar94.all/lib/pfs/myhost.c Tue Apr 26 15:37:03 1994
|
||||
--- 10Mar94+/lib/pfs/myhost.c Tue Apr 19 14:35:31 1994
|
||||
***************
|
||||
*** 94,105 ****
|
||||
/* gethostbyname reads files, so we must disable pfs */
|
||||
p_th_mutex_lock(p_th_mutexGETHOSTBYNAME);
|
||||
DISABLE_PFS(current_host = gethostbyname(myhname));
|
||||
- p_th_mutex_unlock(p_th_mutexGETHOSTBYNAME);
|
||||
strcpy(myhname,current_host->h_name);
|
||||
ucase(myhname);
|
||||
|
||||
/* Save the address too */
|
||||
! bcopy1(current_host->h_addr,&myhaddr);
|
||||
++initialized;
|
||||
#ifdef P__MYHOST_MUTEX_AUTOINITIALIZATION
|
||||
#ifdef PFS_THREADS
|
||||
--- 94,107 ----
|
||||
/* gethostbyname reads files, so we must disable pfs */
|
||||
p_th_mutex_lock(p_th_mutexGETHOSTBYNAME);
|
||||
DISABLE_PFS(current_host = gethostbyname(myhname));
|
||||
strcpy(myhname,current_host->h_name);
|
||||
ucase(myhname);
|
||||
|
||||
/* Save the address too */
|
||||
! /* Huh - since when is the address 1 byte!! XXX */
|
||||
! bcopy(current_host->h_addr,&myhaddr,4);
|
||||
! /* Dont unlock GETHOSTBYNAME till data safely copied */
|
||||
! p_th_mutex_unlock(p_th_mutexGETHOSTBYNAME);
|
||||
++initialized;
|
||||
#ifdef P__MYHOST_MUTEX_AUTOINITIALIZATION
|
||||
#ifdef PFS_THREADS
|
||||
diff -b -r -c -N 10Mar94.all/server/dirsrv.c 10Mar94+/server/dirsrv.c
|
||||
*** 10Mar94.all/server/dirsrv.c Tue Apr 26 15:37:57 1994
|
||||
--- 10Mar94+/server/dirsrv.c Sun Apr 24 17:19:53 1994
|
||||
***************
|
||||
*** 79,81 ****
|
||||
#ifdef PSRV_GOPHER_GW
|
||||
extern int glink_count, glink_max;
|
||||
#endif
|
||||
--- 80,83 ----
|
||||
+ extern int dnscache_count, dnscache_max, alldnscache_count;
|
||||
#ifdef PSRV_GOPHER_GW
|
||||
extern int glink_count, glink_max;
|
||||
#endif
|
||||
***************
|
||||
*** 1069,1071 ****
|
||||
replyf(req," Memory: %d(%d)vlink %d(%d)pattrib %d(%d)acl \
|
||||
%d(%d)pfile %d(%d)rreq %d(%d)ptext\n",
|
||||
vlink_count,vlink_max,pattrib_count,pattrib_max,
|
||||
--- 1070,1076 ----
|
||||
+ #ifdef DNSCACHE_MAX
|
||||
+ replyf(req," DNS: %d(%d) caching %d(%d)\n",
|
||||
+ dnscache_count,dnscache_max,alldnscache_count,DNSCACHE_MAX);
|
||||
+ #endif
|
||||
replyf(req," Memory: %d(%d)vlink %d(%d)pattrib %d(%d)acl \
|
||||
%d(%d)pfile %d(%d)rreq %d(%d)ptext\n",
|
||||
vlink_count,vlink_max,pattrib_count,pattrib_max,
|
||||
31
prospero/patches/done/10Mar94.dnscache1.patch
Normal file
31
prospero/patches/done/10Mar94.dnscache1.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/hostname2adr.c 10Mar94+/lib/ardp/hostname2adr.c
|
||||
*** 10Mar94.all/lib/ardp/hostname2adr.c Tue Apr 26 16:33:30 1994
|
||||
--- 10Mar94+/lib/ardp/hostname2adr.c Wed Apr 27 01:07:43 1994
|
||||
***************
|
||||
*** 98,104 ****
|
||||
{
|
||||
DNSCACHE dc, nextdc;
|
||||
if (alldnscache_count > DNSCACHE_MAX) {
|
||||
! p_th_mutex_lock(p_th_mutexALLDNSCACHE);
|
||||
for (dc = alldnscaches; dc ; dc = nextdc) {
|
||||
nextdc = dc->next;
|
||||
if (!(--dc->usecount)) {
|
||||
--- 98,105 ----
|
||||
{
|
||||
DNSCACHE dc, nextdc;
|
||||
if (alldnscache_count > DNSCACHE_MAX) {
|
||||
! if (! p_th_mutex_trylock(p_th_mutexALLDNSCACHE)) {
|
||||
! /* Since this is only optimisation, skip if its locked already */
|
||||
for (dc = alldnscaches; dc ; dc = nextdc) {
|
||||
nextdc = dc->next;
|
||||
if (!(--dc->usecount)) {
|
||||
***************
|
||||
*** 109,114 ****
|
||||
--- 110,116 ----
|
||||
}
|
||||
p_th_mutex_unlock(p_th_mutexALLDNSCACHE);
|
||||
}
|
||||
+ }
|
||||
}
|
||||
|
||||
int
|
||||
46
prospero/patches/done/10Mar94.doc1.patch
Normal file
46
prospero/patches/done/10Mar94.doc1.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
This patch was created on pand05 at Tue Apr 26 17:02:31 EDT 1994
|
||||
The command used to create it was: gnudiff -b -r -c 10Mar94.all 10Mar94+
|
||||
|
||||
It is made available on an as-is basis, and carries no guarrantee that
|
||||
it even works, much less that it is fit for its purpose.
|
||||
|
||||
If you find any problems with it, please report to mitra@pand05
|
||||
You may use it as you wish, but if you make it pulicly available anywhere
|
||||
please notify me.
|
||||
|
||||
To apply the patch cd to the directory with the source in it, and run
|
||||
|
||||
patch -l -p1 <patchfile
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/doc/pandora.todolist 10Mar94+/doc/pandora.todolist
|
||||
*** 10Mar94.all/doc/pandora.todolist Tue Apr 26 15:37:58 1994
|
||||
--- 10Mar94+/doc/pandora.todolist Wed Apr 20 19:52:33 1994
|
||||
***************
|
||||
*** 1,5 ****
|
||||
--- 1,6 ----
|
||||
# This is the to do list I have as discussed with BCN @ ietf-Seattle
|
||||
# - Mitra Mar 28, 94
|
||||
+ # - Mitra Apr 20, 94
|
||||
|
||||
IMPORT SIZE Task
|
||||
1 1 Standardisation of URL's - bcn agreed to return URL's
|
||||
***************
|
||||
*** 10,18 ****
|
||||
working group making a decision
|
||||
1 3 Ftp directory retrieval
|
||||
2 3 Multi-threaded client libraries
|
||||
- 3 2 Fix crashes with multi-threaded servers
|
||||
1 2 Gopher+ gateway
|
||||
- 3 2 Fix server not restarting
|
||||
1 1 getdomainname efficiency hack
|
||||
2 2 Ability to make a ulink optional (i.e. dont fail if ulink fails
|
||||
2 1 Define interface for replica's
|
||||
--- 11,17 ----
|
||||
***************
|
||||
*** 24,28 ****
|
||||
2 2 hsonames and gateways GATEWAY GOPHER ASCII path.net(70)/aaa
|
||||
2 2 Seperation of libraries and removal of dependancies
|
||||
1 3 Charging mechanisms
|
||||
- 1 1 Total number of queries not being incremented.
|
||||
-
|
||||
--- 23,25 ----
|
||||
63
prospero/patches/done/10Mar94.memleaks.patch
Normal file
63
prospero/patches/done/10Mar94.memleaks.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
diff -b -r -c -N 10Mar94.all/lib/psrv/wais_gw/inface.c 10Mar94+/lib/psrv/wais_gw/inface.c
|
||||
*** 10Mar94.all/lib/psrv/wais_gw/inface.c Tue Apr 26 15:37:17 1994
|
||||
--- 10Mar94+/lib/psrv/wais_gw/inface.c Tue Apr 26 18:21:42 1994
|
||||
***************
|
||||
*** 861,866 ****
|
||||
--- 861,867 ----
|
||||
int
|
||||
waisRetrieveFileByHsoname(char *local,char *hsoname)
|
||||
{
|
||||
+ any *DocumentId = NULL;
|
||||
char *host = NULL;
|
||||
char *port = NULL;
|
||||
char *type = NULL;
|
||||
***************
|
||||
*** 875,884 ****
|
||||
"Invalid WAIS hsoname: %s", hsoname);
|
||||
RETURN(-1);
|
||||
}
|
||||
RETURN(waisRetrieveFile(host,port,database,
|
||||
! un_urlascii(query),type,0,local));
|
||||
|
||||
cleanup:
|
||||
stfree(host);
|
||||
stfree(port);
|
||||
stfree(type);
|
||||
--- 876,890 ----
|
||||
"Invalid WAIS hsoname: %s", hsoname);
|
||||
RETURN(-1);
|
||||
}
|
||||
+ DocumentId = un_urlascii(query);
|
||||
RETURN(waisRetrieveFile(host,port,database,
|
||||
! DocumentId,type,0,local));
|
||||
|
||||
cleanup:
|
||||
+ if (DocumentId) {
|
||||
+ stfree(DocumentId->bytes);
|
||||
+ free(DocumentId);
|
||||
+ }
|
||||
stfree(host);
|
||||
stfree(port);
|
||||
stfree(type);
|
||||
diff -b -r -c -N 10Mar94.all/lib/psrv/wais_gw/wais_gw_dsdb.c 10Mar94+/lib/psrv/wais_gw/wais_gw_dsdb.c
|
||||
*** 10Mar94.all/lib/psrv/wais_gw/wais_gw_dsdb.c Fri Mar 11 05:31:43 1994
|
||||
--- 10Mar94+/lib/psrv/wais_gw/wais_gw_dsdb.c Tue Apr 26 18:30:59 1994
|
||||
***************
|
||||
*** 298,305 ****
|
||||
} else {
|
||||
APPEND_ITEM(vl,head);
|
||||
}
|
||||
- }
|
||||
stfree(str);
|
||||
return(head);
|
||||
}
|
||||
|
||||
--- 298,305 ----
|
||||
} else {
|
||||
APPEND_ITEM(vl,head);
|
||||
}
|
||||
stfree(str);
|
||||
+ } /*for*/
|
||||
return(head);
|
||||
}
|
||||
|
||||
7
prospero/patches/done/10Mar94.purify2.patch
Normal file
7
prospero/patches/done/10Mar94.purify2.patch
Normal file
@@ -0,0 +1,7 @@
|
||||
diff -b -r -c -N 10Mar94.all/server/.purify 10Mar94+/server/.purify
|
||||
*** 10Mar94.all/server/.purify Wed Dec 31 19:00:00 1969
|
||||
--- 10Mar94+/server/.purify Fri Mar 25 14:36:27 1994
|
||||
***************
|
||||
*** 0 ****
|
||||
--- 1 ----
|
||||
+ suppress umr _s_alloc_bugs
|
||||
1784
prospero/patches/done/10Mar94.thread.patch
Normal file
1784
prospero/patches/done/10Mar94.thread.patch
Normal file
File diff suppressed because it is too large
Load Diff
1457
prospero/patches/done/10Mar94.thread2.patch
Normal file
1457
prospero/patches/done/10Mar94.thread2.patch
Normal file
File diff suppressed because it is too large
Load Diff
121
prospero/patches/done/10Mar94.thread3.patch
Normal file
121
prospero/patches/done/10Mar94.thread3.patch
Normal file
@@ -0,0 +1,121 @@
|
||||
diff -b -r -c -N 10Mar94.all/include/ardp.h 10Mar94+/include/ardp.h
|
||||
*** 10Mar94.all/include/ardp.h Tue Apr 26 15:38:02 1994
|
||||
--- 10Mar94+/include/ardp.h Mon Apr 18 21:36:31 1994
|
||||
***************
|
||||
*** 342,347 ****
|
||||
--- 342,358 ----
|
||||
int ardp_acknowledge(RREQ req);
|
||||
extern char *unixerrstr(void);
|
||||
|
||||
+ #include <../lib/ardp/flocks.h>
|
||||
+ FILELOCK filelock_alloc(void);
|
||||
+ void filelock_free(FILELOCK fl);
|
||||
+ void filelock_lfree(FILELOCK fl);
|
||||
+ void filelock_freespares(void);
|
||||
+ void filelock_release(const char *filename, int readonly);
|
||||
+ int locked_fclose_A(FILE *afle, const char *filename, int readonly);
|
||||
+ void filelock_obtain(const char *filename, int readonly);
|
||||
+ FILE *locked_fopen(const char *filename, const char *mode);
|
||||
+ int locked_fclose_and_rename(FILE *afile, const char *tmpfilename, const char *filename, int retval);
|
||||
+
|
||||
extern int ardp_priority;
|
||||
/* Check for case-blind string equality, where s1 or s2 may be null
|
||||
pointer. */
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/flocks.c 10Mar94+/lib/ardp/flocks.c
|
||||
*** 10Mar94.all/lib/ardp/flocks.c Tue Apr 26 15:37:42 1994
|
||||
--- 10Mar94+/lib/ardp/flocks.c Mon Apr 18 21:08:38 1994
|
||||
***************
|
||||
*** 18,23 ****
|
||||
--- 18,25 ----
|
||||
int filelock_max = 0;
|
||||
int filelock_open = 0;
|
||||
int filelock_open_max = 0;
|
||||
+ int filelock_sepwaits = 0;
|
||||
+ int filelock_secwaits = 0;
|
||||
FILELOCK filelock_locked = NULL;
|
||||
|
||||
/************* Standard routines to alloc, free and copy *************/
|
||||
***************
|
||||
*** 69,75 ****
|
||||
TH_STRUC_LFREE(FILELOCK,fl,filelock_free);
|
||||
}
|
||||
|
||||
! void
|
||||
filelock_unreaders(FILELOCK flock)
|
||||
{
|
||||
/* Assumes p_th_mutexFILES is locked already */
|
||||
--- 71,77 ----
|
||||
TH_STRUC_LFREE(FILELOCK,fl,filelock_free);
|
||||
}
|
||||
|
||||
! static void
|
||||
filelock_unreaders(FILELOCK flock)
|
||||
{
|
||||
/* Assumes p_th_mutexFILES is locked already */
|
||||
***************
|
||||
*** 80,86 ****
|
||||
}
|
||||
}
|
||||
|
||||
! void
|
||||
filelock_unwriters(FILELOCK flock)
|
||||
{
|
||||
/* Assumes p_th_mutexFILES is locked already */
|
||||
--- 82,88 ----
|
||||
}
|
||||
}
|
||||
|
||||
! static void
|
||||
filelock_unwriters(FILELOCK flock)
|
||||
{
|
||||
/* Assumes p_th_mutexFILES is locked already */
|
||||
***************
|
||||
*** 131,136 ****
|
||||
--- 133,139 ----
|
||||
filelock_obtain(const char *filename, int readonly)
|
||||
{
|
||||
FILELOCK(flock);
|
||||
+ int haswaited = 0;
|
||||
for (;;) {
|
||||
p_th_mutex_lock(p_th_mutexFILES);
|
||||
flock = filelock_locked;
|
||||
***************
|
||||
*** 159,164 ****
|
||||
--- 162,169 ----
|
||||
/* At this point we cant lock it, so unlock mutex, wait, and try again*/
|
||||
p_th_mutex_unlock(p_th_mutexFILES);
|
||||
plog(L_QUEUE_INFO,NOREQ, "Waiting for filelock for %s", filename, 0);
|
||||
+ if (!haswaited) filelock_sepwaits++;
|
||||
+ filelock_secwaits++;
|
||||
sleep(1); /* Maybe too long */
|
||||
} /*for*/
|
||||
if (++filelock_open > filelock_open_max) {
|
||||
diff -b -r -c -N 10Mar94.all/server/dirsrv.c 10Mar94+/server/dirsrv.c
|
||||
*** 10Mar94.all/server/dirsrv.c Tue Apr 26 16:33:30 1994
|
||||
--- 10Mar94+/server/dirsrv.c Sun Apr 24 17:19:53 1994
|
||||
***************
|
||||
*** 75,78 ****
|
||||
extern int vlink_max, pattrib_max, acl_max, pfile_max;
|
||||
extern int rreq_max, ptext_max, string_max, token_max;
|
||||
extern int pauth_max, opt_max, filter_max, p_object_max;
|
||||
! extern int filelock_open, filelock_open_max;
|
||||
--- 75,79 ----
|
||||
extern int vlink_max, pattrib_max, acl_max, pfile_max;
|
||||
extern int rreq_max, ptext_max, string_max, token_max;
|
||||
extern int pauth_max, opt_max, filter_max, p_object_max;
|
||||
! extern int filelock_open, filelock_open_max, filelock_sepwaits;
|
||||
! extern int filelock_secwaits;
|
||||
***************
|
||||
*** 1065,1069 ****
|
||||
subthread_count + free_subthread_count, subthread_count,
|
||||
subthread_max, free_subthread_count);
|
||||
#endif
|
||||
! replyf(req," Files: %d(%d)open\n",
|
||||
! filelock_open,filelock_open_max);
|
||||
--- 1066,1071 ----
|
||||
subthread_count + free_subthread_count, subthread_count,
|
||||
subthread_max, free_subthread_count);
|
||||
#endif
|
||||
! replyf(req," Files: %d(%d)open, %d waits, %d secs\n",
|
||||
! filelock_open,filelock_open_max, filelock_sepwaits,
|
||||
! filelock_secwaits);
|
||||
979
prospero/patches/done/10Mar94.thread4.patch
Normal file
979
prospero/patches/done/10Mar94.thread4.patch
Normal file
@@ -0,0 +1,979 @@
|
||||
diff -b -r -c -N 10Mar94.all/include/pfs.h 10Mar94+/include/pfs.h
|
||||
*** 10Mar94.all/include/pfs.h Tue Apr 26 15:36:21 1994
|
||||
--- 10Mar94+/include/pfs.h Mon Apr 18 21:40:49 1994
|
||||
***************
|
||||
*** 1052,1058 ****
|
||||
--- 1052,1061 ----
|
||||
extern int lookup_precedence_by_precedencename(const char t_precedence[]);
|
||||
extern char *lookup_precedencename_by_precedence(int precedence);
|
||||
extern void p__set_username(char *un);
|
||||
+ #include <sys/socket.h>
|
||||
extern int quick_connect(int s, struct sockaddr *name, int namelen, int timeout);
|
||||
+ extern int quick_fgetc(FILE *stream, int timeout);
|
||||
+ extern int quick_read(int fd, char *nptr, int nbytes, int timeout);
|
||||
extern char *p_timetoasn_stcopyr(time_t ourtime, char *target);
|
||||
extern int vcache2(char *host, char *remote, char *local, char *method,
|
||||
int argc, char *argv[]);
|
||||
diff -b -r -c -N 10Mar94.all/include/vcache.h 10Mar94+/include/vcache.h
|
||||
*** 10Mar94.all/include/vcache.h Tue Apr 26 15:36:22 1994
|
||||
--- 10Mar94+/include/vcache.h Mon Apr 18 21:30:57 1994
|
||||
***************
|
||||
*** 1,5 ****
|
||||
/* Internal commands used in user/vcache */
|
||||
void setpeer(char *hostn);
|
||||
void set_type(char *t);
|
||||
! int recvrequest(char *cmd, char *local, char *remote, char *mode);
|
||||
|
||||
--- 1,10 ----
|
||||
/* Internal commands used in user/vcache */
|
||||
void setpeer(char *hostn);
|
||||
void set_type(char *t);
|
||||
! int recvrequest(char *cmd, char *local, char *remote, char *amode);
|
||||
! int ruserpass(char *host, char **aname, char **apass, char **aacct);
|
||||
! void lostpeer(void);
|
||||
! int login(char *host);
|
||||
! /* Dont define command - it should use vargs, but doesnt */
|
||||
! void pswitch(int flag);
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/lib/pcompat/scandir.c 10Mar94+/lib/pcompat/scandir.c
|
||||
*** 10Mar94.all/lib/pcompat/scandir.c Tue Apr 26 15:37:29 1994
|
||||
--- 10Mar94+/lib/pcompat/scandir.c Fri Apr 15 19:48:00 1994
|
||||
***************
|
||||
*** 40,45 ****
|
||||
--- 40,46 ----
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
+ #include <pfs_threads.h> /* For PFS_THREADS */
|
||||
/*
|
||||
* The DIRSIZ macro gives the minimum record length which will hold
|
||||
* the directory entry. This requires the amount of space in struct dirent
|
||||
diff -b -r -c -N 10Mar94.all/lib/pfs/socket.c 10Mar94+/lib/pfs/socket.c
|
||||
*** 10Mar94.all/lib/pfs/socket.c Tue Apr 26 15:36:32 1994
|
||||
--- 10Mar94+/lib/pfs/socket.c Tue Apr 19 00:49:21 1994
|
||||
***************
|
||||
*** 22,31 ****
|
||||
#include <pfs_threads.h>
|
||||
#include <sockettime.h>
|
||||
|
||||
- /* How long do we want to wait before returning an error */
|
||||
- #define CONNECT_TIMEOUT 5
|
||||
- #define READ_TIMEOUT 5
|
||||
-
|
||||
#ifdef TIMEOUT_APPROACH
|
||||
EXTERN_TYPEP_DEF(jmp_buf, Jmpenv);
|
||||
#define Jmpenv p_th_arJmpenv[p__th_self_num()]
|
||||
--- 22,27 ----
|
||||
***************
|
||||
*** 53,58 ****
|
||||
--- 49,64 ----
|
||||
|
||||
#endif /*TIMEOUT_APPROACH*/
|
||||
|
||||
+ #ifdef SELECT_APPROACH
|
||||
+ int
|
||||
+ wait_till_stream_readable(FILE *str, int timeout)
|
||||
+ {
|
||||
+ if (str->_cnt > 0) return 1;
|
||||
+ return (wait_till_readable(fileno(str),timeout));
|
||||
+ }
|
||||
+
|
||||
+ #endif /*SELECT_APPROACH*/
|
||||
+
|
||||
/* This is adapted from interruptable_connect in gopher */
|
||||
int
|
||||
quick_connect(int s, struct sockaddr *name, int namelen, int timeout)
|
||||
***************
|
||||
*** 130,136 ****
|
||||
}
|
||||
#endif
|
||||
#ifdef SELECT_APPROACH
|
||||
! switch (wait_till_readable(fileno(stream),timeout)) {
|
||||
case -1: p_err_string = qsprintf_stcopyr(p_err_string,
|
||||
"INTERNAL: read select failed: %s", unixerrstr());
|
||||
return NULL;
|
||||
--- 136,142 ----
|
||||
}
|
||||
#endif
|
||||
#ifdef SELECT_APPROACH
|
||||
! switch (wait_till_stream_readable(stream,timeout)) {
|
||||
case -1: p_err_string = qsprintf_stcopyr(p_err_string,
|
||||
"INTERNAL: read select failed: %s", unixerrstr());
|
||||
return NULL;
|
||||
***************
|
||||
*** 147,153 ****
|
||||
/* fgets can retunr an incomplete line, since it is non-blocking */
|
||||
if (retval) {
|
||||
int buflen = strlen(s);
|
||||
! if (s[buflen -1 ] != '\n') {
|
||||
retval = quick_fgets(s+buflen, n-buflen, stream, timeout);
|
||||
}
|
||||
}
|
||||
--- 153,159 ----
|
||||
/* fgets can retunr an incomplete line, since it is non-blocking */
|
||||
if (retval) {
|
||||
int buflen = strlen(s);
|
||||
! if ((s[buflen -1 ] != '\n') && (n-1 > buflen)) {
|
||||
retval = quick_fgets(s+buflen, n-buflen, stream, timeout);
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 158,160 ****
|
||||
--- 164,223 ----
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
+
|
||||
+ #if 0
|
||||
+
|
||||
+ int
|
||||
+ quick_fgetc(FILE *stream, int timeout)
|
||||
+ {
|
||||
+ int retval;
|
||||
+
|
||||
+ #ifdef TIMEOUT_APPROACH
|
||||
+ syscall_oldalarmtime = alarm(timeout);
|
||||
+ if ((syscall_oldintr = signal(SIGALRM, alarmJmp)) == SIG_ERR)
|
||||
+ perror("signal died:\n"), exit(-1);
|
||||
+ if (setjmp(Jmpenv)) {
|
||||
+ /* Note alarmJmp will reprime alarm*/
|
||||
+ errno = ETIMEDOUT;
|
||||
+ return(EOF);
|
||||
+ }
|
||||
+ #endif
|
||||
+ #ifdef SELECT_APPROACH
|
||||
+ switch (wait_till_stream_readable(stream,timeout)) {
|
||||
+ case -1: p_err_string = qsprintf_stcopyr(p_err_string,
|
||||
+ "INTERNAL: quick_fgetc: select failed: %s", unixerrstr());
|
||||
+ return EOF;
|
||||
+ case 0: p_err_string = qsprintf_stcopyr(p_err_string,
|
||||
+ "waited more than %d secs for a response", timeout);
|
||||
+ errno = ETIMEDOUT;
|
||||
+ return EOF;
|
||||
+ }
|
||||
+ /* Default is going to be 1 - which is success */
|
||||
+
|
||||
+ #endif /*SELECT_APPROACH*/
|
||||
+ retval = getc(stream);
|
||||
+
|
||||
+ #ifdef TIMEOUT_APPROACH
|
||||
+ reprimeAlarm(syscall_oldalarmtime,syscall_oldintr);
|
||||
+ #endif
|
||||
+ return retval;
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+ #endif
|
||||
+
|
||||
+ int quick_fgetc (FILE *stream, int timeout)
|
||||
+ {
|
||||
+ char c[2];
|
||||
+ char *retval;
|
||||
+
|
||||
+ if (!(retval = quick_fgets(c, 2, stream, timeout))) {
|
||||
+ /* errno set in quick_fgets */
|
||||
+ return EOF;
|
||||
+ }
|
||||
+ return c[0];
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -b -r -c -N 10Mar94.all/lib/psrv/wais_gw/irfileio.c 10Mar94+/lib/psrv/wais_gw/irfileio.c
|
||||
*** 10Mar94.all/lib/psrv/wais_gw/irfileio.c Fri Mar 11 05:31:38 1994
|
||||
--- 10Mar94+/lib/psrv/wais_gw/irfileio.c Mon Apr 18 14:53:21 1994
|
||||
***************
|
||||
*** 215,221 ****
|
||||
#define S (4L)
|
||||
#define QUOTE (5L)
|
||||
|
||||
!
|
||||
boolean ReadStartOfList(file)
|
||||
FILE* file;
|
||||
{
|
||||
--- 214,220 ----
|
||||
#define S (4L)
|
||||
#define QUOTE (5L)
|
||||
|
||||
! #if !defined(IN_RMG)
|
||||
boolean ReadStartOfList(file)
|
||||
FILE* file;
|
||||
{
|
||||
***************
|
||||
*** 242,248 ****
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
boolean ReadEndOfList(file)
|
||||
FILE* file;
|
||||
{
|
||||
--- 241,246 ----
|
||||
***************
|
||||
*** 255,260 ****
|
||||
--- 253,259 ----
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
+ #endif /*!IN_RMG*/
|
||||
|
||||
#define STRING_ESC '\\'
|
||||
|
||||
***************
|
||||
*** 487,493 ****
|
||||
|
||||
}
|
||||
}
|
||||
!
|
||||
long ReadEndOfListOrStruct(file)
|
||||
FILE* file;
|
||||
{
|
||||
--- 486,492 ----
|
||||
|
||||
}
|
||||
}
|
||||
! #if !defined(IN_RMG)
|
||||
long ReadEndOfListOrStruct(file)
|
||||
FILE* file;
|
||||
{
|
||||
***************
|
||||
*** 502,508 ****
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
!
|
||||
|
||||
long ReadString(string,file,string_size)
|
||||
char* string;
|
||||
--- 501,507 ----
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
! #endif
|
||||
|
||||
long ReadString(string,file,string_size)
|
||||
char* string;
|
||||
***************
|
||||
*** 544,550 ****
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
long ReadStartOfStruct(name,file)
|
||||
char* name;
|
||||
FILE* file;
|
||||
--- 543,548 ----
|
||||
***************
|
||||
*** 586,592 ****
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
long CheckStartOfStruct(name,file)
|
||||
char* name;
|
||||
FILE* file;
|
||||
--- 584,589 ----
|
||||
***************
|
||||
*** 603,608 ****
|
||||
--- 600,606 ----
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
+ #if !defined(IN_RMG)
|
||||
|
||||
long ReadAny(destination,file)
|
||||
any* destination;
|
||||
***************
|
||||
*** 656,662 ****
|
||||
return(retval);
|
||||
}
|
||||
|
||||
-
|
||||
long Read8BitArray(destination,file,length)
|
||||
char* destination;
|
||||
FILE* file;
|
||||
--- 654,659 ----
|
||||
***************
|
||||
*** 771,773 ****
|
||||
--- 768,771 ----
|
||||
|
||||
return(true);
|
||||
}
|
||||
+ #endif
|
||||
diff -b -r -c -N 10Mar94.all/lib/psrv/wais_gw/irfileio.h 10Mar94+/lib/psrv/wais_gw/irfileio.h
|
||||
*** 10Mar94.all/lib/psrv/wais_gw/irfileio.h Fri Mar 11 05:31:38 1994
|
||||
--- 10Mar94+/lib/psrv/wais_gw/irfileio.h Mon Apr 18 14:56:58 1994
|
||||
***************
|
||||
*** 22,34 ****
|
||||
long ReadString(char* string, FILE* file, long string_size);
|
||||
long CheckStartOfStruct(char* name, FILE* file);
|
||||
long ReadAny(any* destination, FILE* file);
|
||||
! long ReadTM(struct tm* time, FILE* file);
|
||||
! long Read8BitArray(char* destination, FILE* file, long length);
|
||||
long ReadEndOfListOrStruct(FILE* file);
|
||||
long ReadStartOfStruct(char* name, FILE* file);
|
||||
boolean ReadStartOfList(FILE* file);
|
||||
boolean ReadEndOfList(FILE* file);
|
||||
! boolean readAbsoluteTime(struct tm* time,FILE* file);
|
||||
long WriteStartOfStruct(char* name, FILE* file);
|
||||
long WriteEndOfStruct(FILE* file);
|
||||
long WriteSymbol(char* name, FILE* file);
|
||||
--- 22,34 ----
|
||||
long ReadString(char* string, FILE* file, long string_size);
|
||||
long CheckStartOfStruct(char* name, FILE* file);
|
||||
long ReadAny(any* destination, FILE* file);
|
||||
! long ReadTM(struct tm* atime, FILE* file);
|
||||
! long Read8BitArray(char* destination, FILE* file, long len);
|
||||
long ReadEndOfListOrStruct(FILE* file);
|
||||
long ReadStartOfStruct(char* name, FILE* file);
|
||||
boolean ReadStartOfList(FILE* file);
|
||||
boolean ReadEndOfList(FILE* file);
|
||||
! boolean readAbsoluteTime(struct tm* atime,FILE* file);
|
||||
long WriteStartOfStruct(char* name, FILE* file);
|
||||
long WriteEndOfStruct(FILE* file);
|
||||
long WriteSymbol(char* name, FILE* file);
|
||||
***************
|
||||
*** 37,46 ****
|
||||
long WriteLong(long number, FILE* file);
|
||||
long WriteDouble(double number, FILE* file);
|
||||
long WriteAny(any* value, FILE* file);
|
||||
! long Write8BitArray(long length, char* array, FILE* file);
|
||||
! long WriteTM(struct tm* time, FILE* file);
|
||||
long WriteStartOfList(FILE* file);
|
||||
long WriteEndOfList(FILE* file);
|
||||
! boolean writeAbsoluteTime(struct tm* time,FILE* file);
|
||||
|
||||
#endif
|
||||
--- 37,46 ----
|
||||
long WriteLong(long number, FILE* file);
|
||||
long WriteDouble(double number, FILE* file);
|
||||
long WriteAny(any* value, FILE* file);
|
||||
! long Write8BitArray(long len, char* array, FILE* file);
|
||||
! long WriteTM(struct tm* atime, FILE* file);
|
||||
long WriteStartOfList(FILE* file);
|
||||
long WriteEndOfList(FILE* file);
|
||||
! boolean writeAbsoluteTime(struct tm* atime,FILE* file);
|
||||
|
||||
#endif
|
||||
diff -b -r -c -N 10Mar94.all/user/vcache/cmds.c 10Mar94+/user/vcache/cmds.c
|
||||
*** 10Mar94.all/user/vcache/cmds.c Tue Apr 26 15:37:23 1994
|
||||
--- 10Mar94+/user/vcache/cmds.c Mon Apr 18 21:18:42 1994
|
||||
***************
|
||||
*** 38,44 ****
|
||||
#include <pmachine.h> /* after netdb.h */
|
||||
#include <perrno.h>
|
||||
#include "vcache_macros.h"
|
||||
!
|
||||
extern char *home;
|
||||
extern short gflag;
|
||||
extern char *getenv();
|
||||
--- 38,44 ----
|
||||
#include <pmachine.h> /* after netdb.h */
|
||||
#include <perrno.h>
|
||||
#include "vcache_macros.h"
|
||||
! #include <vcache.h>
|
||||
extern char *home;
|
||||
extern short gflag;
|
||||
extern char *getenv();
|
||||
***************
|
||||
*** 46,51 ****
|
||||
--- 46,53 ----
|
||||
extern char *rindex();
|
||||
char *mname;
|
||||
jmp_buf jabort;
|
||||
+ /* Forward declerations */
|
||||
+ static void disconnect(void);
|
||||
|
||||
/*
|
||||
* Connect to peer server and
|
||||
***************
|
||||
*** 143,149 ****
|
||||
/*
|
||||
* Terminate session, but don't exit.
|
||||
*/
|
||||
! void
|
||||
disconnect()
|
||||
{
|
||||
extern FILE *cout;
|
||||
--- 145,151 ----
|
||||
/*
|
||||
* Terminate session, but don't exit.
|
||||
*/
|
||||
! static void
|
||||
disconnect()
|
||||
{
|
||||
extern FILE *cout;
|
||||
diff -b -r -c -N 10Mar94.all/user/vcache/ftp.c 10Mar94+/user/vcache/ftp.c
|
||||
*** 10Mar94.all/user/vcache/ftp.c Tue Apr 26 15:37:39 1994
|
||||
--- 10Mar94+/user/vcache/ftp.c Tue Apr 19 01:02:11 1994
|
||||
***************
|
||||
*** 44,52 ****
|
||||
#include <pmachine.h>
|
||||
#include <perrno.h>
|
||||
#include "vcache_macros.h"
|
||||
!
|
||||
#include <pfs.h> /* For quick_connect */
|
||||
#include <implicit_fixes.h>
|
||||
|
||||
#ifdef SOLARIS
|
||||
/* Should be defined in stdio.h */
|
||||
--- 44,53 ----
|
||||
#include <pmachine.h>
|
||||
#include <perrno.h>
|
||||
#include "vcache_macros.h"
|
||||
! #include <vcache.h>
|
||||
#include <pfs.h> /* For quick_connect */
|
||||
#include <implicit_fixes.h>
|
||||
+ #include <sockettime.h>
|
||||
|
||||
#ifdef SOLARIS
|
||||
/* Should be defined in stdio.h */
|
||||
***************
|
||||
*** 56,61 ****
|
||||
--- 57,66 ----
|
||||
#define F_OPEN_TIMEOUT 5
|
||||
#endif
|
||||
|
||||
+ #ifndef F_READ_TIMEOUT
|
||||
+ #define F_READ_TIMEOUT 60
|
||||
+ #endif
|
||||
+
|
||||
struct sockaddr_in hisctladdr;
|
||||
struct sockaddr_in data_addr;
|
||||
int data = -1;
|
||||
***************
|
||||
*** 81,95 ****
|
||||
static void tvsub(struct timeval *tdiff, struct timeval *t1,
|
||||
struct timeval *t0);
|
||||
static void proxtrans( char *cmd, char *local, char *remote);
|
||||
|
||||
/* Returns hostname, or if fails then returns 0 and closes socket */
|
||||
char *
|
||||
! hookup(host, port)
|
||||
! char *host;
|
||||
! int port;
|
||||
{
|
||||
- register struct hostent *hp = 0;
|
||||
int s,len;
|
||||
static char hostnamebuf[80];
|
||||
|
||||
bzero((char *)&hisctladdr, sizeof (hisctladdr));
|
||||
--- 86,101 ----
|
||||
static void tvsub(struct timeval *tdiff, struct timeval *t1,
|
||||
struct timeval *t0);
|
||||
static void proxtrans( char *cmd, char *local, char *remote);
|
||||
+ static int getreply(int expecteof);
|
||||
+ static int initconn();
|
||||
|
||||
/* Returns hostname, or if fails then returns 0 and closes socket */
|
||||
char *
|
||||
! hookup(char *host, int port)
|
||||
{
|
||||
int s,len;
|
||||
+ #ifndef SELECT_APPROACH
|
||||
+ register struct hostent *hp = 0;
|
||||
static char hostnamebuf[80];
|
||||
|
||||
bzero((char *)&hisctladdr, sizeof (hisctladdr));
|
||||
***************
|
||||
*** 146,151 ****
|
||||
--- 152,164 ----
|
||||
code = -1;
|
||||
goto bad;
|
||||
}
|
||||
+ #else
|
||||
+ if ((s = quick_open_tcp_stream(host,port,F_OPEN_TIMEOUT)) < 0) {
|
||||
+ ERRSYS("ftp: socket:%s %s");
|
||||
+ code = -1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ #endif /*SELECT_APPROACH*/
|
||||
len = sizeof (myctladdr);
|
||||
if (getsockname(s, (char *)&myctladdr, &len) < 0) {
|
||||
ERRSYS("ftp: getsockname:%s %s");
|
||||
***************
|
||||
*** 181,198 ****
|
||||
}
|
||||
#endif SO_OOBINLINE
|
||||
|
||||
return (hostname);
|
||||
bad:
|
||||
(void) close(s);
|
||||
return ((char *)0);
|
||||
}
|
||||
|
||||
int
|
||||
! login(host)
|
||||
! char *host;
|
||||
{
|
||||
char tmp[80];
|
||||
! char *user, *pass, *acct, *getlogin(), *getpass();
|
||||
int n, aflag = 0;
|
||||
|
||||
char *myhstnm, username[120], password[120], account[120];
|
||||
--- 194,214 ----
|
||||
}
|
||||
#endif SO_OOBINLINE
|
||||
|
||||
+ #ifdef SELECT_APPROACH
|
||||
+ return(host);
|
||||
+ #else
|
||||
return (hostname);
|
||||
+ #endif /*SELECT_APPROACH*/
|
||||
bad:
|
||||
(void) close(s);
|
||||
return ((char *)0);
|
||||
}
|
||||
|
||||
int
|
||||
! login(char *host)
|
||||
{
|
||||
char tmp[80];
|
||||
! char *user, *pass, *l_acct, *getlogin(), *getpass();
|
||||
int n, aflag = 0;
|
||||
|
||||
char *myhstnm, username[120], password[120], account[120];
|
||||
***************
|
||||
*** 201,207 ****
|
||||
assert(P_IS_THIS_THREAD_MASTER()); /* getpwuid MT-Unsafe */
|
||||
DISABLE_PFS(whoiampw = getpwuid(getuid()));
|
||||
|
||||
! user = pass = acct = 0;
|
||||
if (anonlogin) {
|
||||
user = "anonymous";
|
||||
|
||||
--- 217,223 ----
|
||||
assert(P_IS_THIS_THREAD_MASTER()); /* getpwuid MT-Unsafe */
|
||||
DISABLE_PFS(whoiampw = getpwuid(getuid()));
|
||||
|
||||
! user = pass = l_acct = 0;
|
||||
if (anonlogin) {
|
||||
user = "anonymous";
|
||||
|
||||
***************
|
||||
*** 221,227 ****
|
||||
if (whoiampw != NULL)
|
||||
myname = whoiampw->pw_name;
|
||||
}
|
||||
! DISABLE_PFS(code = ruserpass(host, &user, &pass, &acct));
|
||||
if (user) {
|
||||
strncpy(username, user, sizeof(username)-1);
|
||||
free(user);
|
||||
--- 237,243 ----
|
||||
if (whoiampw != NULL)
|
||||
myname = whoiampw->pw_name;
|
||||
}
|
||||
! DISABLE_PFS(code = ruserpass(host, &user, &pass, &l_acct));
|
||||
if (user) {
|
||||
strncpy(username, user, sizeof(username)-1);
|
||||
free(user);
|
||||
***************
|
||||
*** 231,243 ****
|
||||
strncpy(password, pass, sizeof(password)-1);
|
||||
free(pass);
|
||||
}
|
||||
! if (acct) {
|
||||
! strncpy(account, acct, sizeof(account)-1);
|
||||
! free(acct);
|
||||
! acct = account;
|
||||
}
|
||||
if (code < 0) {
|
||||
! user = pass = acct = NULL;
|
||||
}
|
||||
if (user) myname = user; /* Use name found in .netrc */
|
||||
if (myname) {
|
||||
--- 247,259 ----
|
||||
strncpy(password, pass, sizeof(password)-1);
|
||||
free(pass);
|
||||
}
|
||||
! if (l_acct) {
|
||||
! strncpy(account, l_acct, sizeof(account)-1);
|
||||
! free(l_acct);
|
||||
! l_acct = account;
|
||||
}
|
||||
if (code < 0) {
|
||||
! user = pass = l_acct = NULL;
|
||||
}
|
||||
if (user) myname = user; /* Use name found in .netrc */
|
||||
if (myname) {
|
||||
***************
|
||||
*** 262,276 ****
|
||||
}
|
||||
if (n == CONTINUE) {
|
||||
aflag++;
|
||||
! acct = getpass("Account:");
|
||||
! n = command("ACCT %s", acct);
|
||||
}
|
||||
if (n != COMPLETE) {
|
||||
ERR("Login failed.");
|
||||
return (0);
|
||||
}
|
||||
! if (!aflag && acct != NULL)
|
||||
! (void) command("ACCT %s", acct);
|
||||
if (proxy)
|
||||
return(1);
|
||||
#ifdef UNDEFINED
|
||||
--- 278,292 ----
|
||||
}
|
||||
if (n == CONTINUE) {
|
||||
aflag++;
|
||||
! l_acct = getpass("Account:");
|
||||
! n = command("ACCT %s", l_acct);
|
||||
}
|
||||
if (n != COMPLETE) {
|
||||
ERR("Login failed.");
|
||||
return (0);
|
||||
}
|
||||
! if (!aflag && l_acct != NULL)
|
||||
! (void) command("ACCT %s", l_acct);
|
||||
if (proxy)
|
||||
return(1);
|
||||
#ifdef UNDEFINED
|
||||
***************
|
||||
*** 333,339 ****
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
! int
|
||||
getreply(int expecteof)
|
||||
{
|
||||
register int c, firstchar;
|
||||
--- 349,355 ----
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
! static int
|
||||
getreply(int expecteof)
|
||||
{
|
||||
register int c, firstchar;
|
||||
***************
|
||||
*** 350,360 ****
|
||||
for (;;) {
|
||||
dig = firstchar = code = 0;
|
||||
cp = reply_string;
|
||||
! while ((c = getc(cin)) != '\n') {
|
||||
if (verbose)
|
||||
fputc(c,stderr);
|
||||
if (c == IAC) { /* handle telnet commands */
|
||||
! switch (c = getc(cin)) {
|
||||
case WILL:
|
||||
case WONT:
|
||||
c = getc(cin);
|
||||
--- 366,376 ----
|
||||
for (;;) {
|
||||
dig = firstchar = code = 0;
|
||||
cp = reply_string;
|
||||
! while ((c = quick_fgetc(cin,F_READ_TIMEOUT)) != '\n') {
|
||||
if (verbose)
|
||||
fputc(c,stderr);
|
||||
if (c == IAC) { /* handle telnet commands */
|
||||
! switch (c = quick_fgetc(cin,F_READ_TIMEOUT)) {
|
||||
case WILL:
|
||||
case WONT:
|
||||
c = getc(cin);
|
||||
***************
|
||||
*** 367,373 ****
|
||||
fprintf(cout, "%c%c%c",IAC,WONT,c);
|
||||
(void) fflush(cout);
|
||||
break;
|
||||
! default:
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
--- 383,389 ----
|
||||
fprintf(cout, "%c%c%c",IAC,WONT,c);
|
||||
(void) fflush(cout);
|
||||
break;
|
||||
! default: /* Including EOF */
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
***************
|
||||
*** 380,386 ****
|
||||
--- 396,407 ----
|
||||
return (0);
|
||||
}
|
||||
lostpeer();
|
||||
+ if (errno == ETIMEDOUT) {
|
||||
+ /* Unfortunately haveto return error this way*/
|
||||
+ ERR("421 Service timed out");
|
||||
+ } else {
|
||||
ERR("421 Service not available, remote server has closed connection");
|
||||
+ }
|
||||
code = 421;
|
||||
return(4);
|
||||
}
|
||||
***************
|
||||
*** 464,470 ****
|
||||
old formula VLINKS uses #defines. */
|
||||
#endif
|
||||
int
|
||||
! recvrequest(char *cmd, char *local, char *remote, char *mode)
|
||||
{
|
||||
FILE *fout, *din = 0, *mypopen();
|
||||
int (*closefunc)(), mypclose(), fclose();
|
||||
--- 485,491 ----
|
||||
old formula VLINKS uses #defines. */
|
||||
#endif
|
||||
int
|
||||
! recvrequest(char *cmd, char *local, char *remote, char *rr_mode)
|
||||
{
|
||||
FILE *fout, *din = 0, *mypopen();
|
||||
int (*closefunc)(), mypclose(), fclose();
|
||||
***************
|
||||
*** 618,624 ****
|
||||
closefunc = mypclose;
|
||||
}
|
||||
else {
|
||||
! fout = fopen(local, mode);
|
||||
if (fout == NULL) {
|
||||
ERRSYS("%s%s: %s",localerrst);
|
||||
goto abort;
|
||||
--- 639,645 ----
|
||||
closefunc = mypclose;
|
||||
}
|
||||
else {
|
||||
! fout = fopen(local, rr_mode);
|
||||
if (fout == NULL) {
|
||||
ERRSYS("%s%s: %s",localerrst);
|
||||
goto abort;
|
||||
***************
|
||||
*** 631,637 ****
|
||||
case TYPE_I:
|
||||
case TYPE_L:
|
||||
errno = d = 0;
|
||||
! while ((c = read(fileno(din), buf, sizeof (buf))) > 0) {
|
||||
if ((d = write(fileno(fout), buf, c)) < 0)
|
||||
break;
|
||||
bytes += c;
|
||||
--- 652,658 ----
|
||||
case TYPE_I:
|
||||
case TYPE_L:
|
||||
errno = d = 0;
|
||||
! while ((c = quick_read(fileno(din), buf, sizeof (buf),F_READ_TIMEOUT)) > 0) {
|
||||
if ((d = write(fileno(fout), buf, c)) < 0)
|
||||
break;
|
||||
bytes += c;
|
||||
***************
|
||||
*** 651,657 ****
|
||||
break;
|
||||
|
||||
case TYPE_A:
|
||||
! while ((c = getc(din)) != EOF) {
|
||||
while (c == '\r') {
|
||||
while (hash && (bytes >= hashbytes)) {
|
||||
(void) putchar('#');
|
||||
--- 672,678 ----
|
||||
break;
|
||||
|
||||
case TYPE_A:
|
||||
! while ((c = quick_fgetc(din,F_READ_TIMEOUT)) != EOF) {
|
||||
while (c == '\r') {
|
||||
while (hash && (bytes >= hashbytes)) {
|
||||
(void) putchar('#');
|
||||
***************
|
||||
*** 659,665 ****
|
||||
hashbytes += sizeof (buf);
|
||||
}
|
||||
bytes++;
|
||||
! if ((c = getc(din)) != '\n' || tcrflag) {
|
||||
if (ferror (fout))
|
||||
break;
|
||||
(void) putc ('\r', fout);
|
||||
--- 680,687 ----
|
||||
hashbytes += sizeof (buf);
|
||||
}
|
||||
bytes++;
|
||||
! if ((c = quick_fgetc(din, F_READ_TIMEOUT))
|
||||
! != '\n' || tcrflag) {
|
||||
if (ferror (fout))
|
||||
break;
|
||||
(void) putc ('\r', fout);
|
||||
***************
|
||||
*** 764,770 ****
|
||||
lostpeer();
|
||||
}
|
||||
if (din && FD_ISSET(fileno(din), &mask)) {
|
||||
! while ((c = read(fileno(din), buf, sizeof (buf))) > 0)
|
||||
;
|
||||
}
|
||||
if ((c = getreply(0)) == ERROR && code == 552) { /* needed for nic style abort */
|
||||
--- 786,792 ----
|
||||
lostpeer();
|
||||
}
|
||||
if (din && FD_ISSET(fileno(din), &mask)) {
|
||||
! while ((c = quick_read(fileno(din), buf, sizeof (buf),F_READ_TIMEOUT)) > 0)
|
||||
;
|
||||
}
|
||||
if ((c = getreply(0)) == ERROR && code == 552) { /* needed for nic style abort */
|
||||
***************
|
||||
*** 798,804 ****
|
||||
int sendport = -1;
|
||||
|
||||
/* Returns: 1 failure to socket !! Can leave socket open on failure */
|
||||
! int
|
||||
initconn()
|
||||
{
|
||||
register char *p, *a;
|
||||
--- 820,826 ----
|
||||
int sendport = -1;
|
||||
|
||||
/* Returns: 1 failure to socket !! Can leave socket open on failure */
|
||||
! static int
|
||||
initconn()
|
||||
{
|
||||
register char *p, *a;
|
||||
***************
|
||||
*** 863,870 ****
|
||||
}
|
||||
|
||||
FILE *
|
||||
! dataconn(mode)
|
||||
! char *mode;
|
||||
{
|
||||
struct sockaddr_in from;
|
||||
int s, fromlen = sizeof (from);
|
||||
--- 885,891 ----
|
||||
}
|
||||
|
||||
FILE *
|
||||
! dataconn(char *dc_mode)
|
||||
{
|
||||
struct sockaddr_in from;
|
||||
int s, fromlen = sizeof (from);
|
||||
***************
|
||||
*** 877,883 ****
|
||||
}
|
||||
(void) close(data);
|
||||
data = s;
|
||||
! return (fdopen(data, mode));
|
||||
}
|
||||
|
||||
void
|
||||
--- 898,904 ----
|
||||
}
|
||||
(void) close(data);
|
||||
data = s;
|
||||
! return (fdopen(data, dc_mode));
|
||||
}
|
||||
|
||||
void
|
||||
***************
|
||||
*** 923,930 ****
|
||||
}
|
||||
|
||||
void
|
||||
! pswitch(flag)
|
||||
! int flag;
|
||||
{
|
||||
extern int proxy, abrtflag;
|
||||
SIGNAL_RET_TYPE (*oldintr)();
|
||||
--- 944,950 ----
|
||||
}
|
||||
|
||||
void
|
||||
! pswitch(int flag)
|
||||
{
|
||||
extern int proxy, abrtflag;
|
||||
SIGNAL_RET_TYPE (*oldintr)();
|
||||
diff -b -r -c -N 10Mar94.all/user/vcache/ruserpass.c 10Mar94+/user/vcache/ruserpass.c
|
||||
*** 10Mar94.all/user/vcache/ruserpass.c Fri Mar 11 05:31:24 1994
|
||||
--- 10Mar94+/user/vcache/ruserpass.c Mon Apr 18 21:18:44 1994
|
||||
***************
|
||||
*** 79,86 ****
|
||||
};
|
||||
|
||||
int
|
||||
! ruserpass(host, aname, apass, aacct)
|
||||
! char *host, **aname, **apass, **aacct;
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char myname[MAXHOSTNAMELEN], *mydomain;
|
||||
--- 79,85 ----
|
||||
};
|
||||
|
||||
int
|
||||
! ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char myname[MAXHOSTNAMELEN], *mydomain;
|
||||
diff -b -r -c -N 10Mar94.all/user/vcache/vcache.c 10Mar94+/user/vcache/vcache.c
|
||||
*** 10Mar94.all/user/vcache/vcache.c Tue Apr 26 15:37:39 1994
|
||||
--- 10Mar94+/user/vcache/vcache.c Mon Apr 25 19:47:25 1994
|
||||
***************
|
||||
*** 213,230 ****
|
||||
}
|
||||
}
|
||||
|
||||
- /* Return PFAILURE or PSUCCESS. Displays a message if cache_verbose is set. */
|
||||
- /* This function deliberately leaks memory. That's ok, since VCACHE will exit
|
||||
- quickly, so it would be a waste of time to explicitly free the memory. */
|
||||
static int
|
||||
prospero_contents_get(VLINK vl, char *local)
|
||||
{
|
||||
! PATTRIB at;
|
||||
FILE *local_file = NULL; /* file pointer for local destination */
|
||||
int retval = PSUCCESS; /* return from function */
|
||||
int need_newline = 0; /* set to 1 if data didn't end with a newline
|
||||
*/
|
||||
-
|
||||
/* Seek multiple instances of the attribute. */
|
||||
|
||||
for (at = pget_at(vl,"CONTENTS"); at; at = at->next) {
|
||||
--- 213,226 ----
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
prospero_contents_get(VLINK vl, char *local)
|
||||
{
|
||||
! PATTRIB at = NULL;
|
||||
FILE *local_file = NULL; /* file pointer for local destination */
|
||||
int retval = PSUCCESS; /* return from function */
|
||||
int need_newline = 0; /* set to 1 if data didn't end with a newline
|
||||
*/
|
||||
/* Seek multiple instances of the attribute. */
|
||||
|
||||
for (at = pget_at(vl,"CONTENTS"); at; at = at->next) {
|
||||
***************
|
||||
*** 240,246 ****
|
||||
if (local_file == NULL) {
|
||||
ERRSYS ( "vcache: Couldn't create the local file %s: %s",
|
||||
local);
|
||||
! return PFAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
--- 236,242 ----
|
||||
if (local_file == NULL) {
|
||||
ERRSYS ( "vcache: Couldn't create the local file %s: %s",
|
||||
local);
|
||||
! RETURN(PFAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 264,272 ****
|
||||
}
|
||||
if (!local_file) {
|
||||
ERR("vcache: Couldn't get remote object's CONTENTS attribute.%s");
|
||||
! return PFAILURE;
|
||||
}
|
||||
if (ferror(local_file)) retval = PFAILURE;
|
||||
! return retval;
|
||||
}
|
||||
|
||||
--- 260,271 ----
|
||||
}
|
||||
if (!local_file) {
|
||||
ERR("vcache: Couldn't get remote object's CONTENTS attribute.%s");
|
||||
! RETURN(PFAILURE);
|
||||
}
|
||||
if (ferror(local_file)) retval = PFAILURE;
|
||||
! cleanup:
|
||||
! if (local_file) { if (fclose(local_file)) { retval = PFAILURE; } }
|
||||
! if (at) atfree(at);
|
||||
! return(retval);
|
||||
}
|
||||
|
||||
424
prospero/patches/done/pfs_threads.h
Normal file
424
prospero/patches/done/pfs_threads.h
Normal file
@@ -0,0 +1,424 @@
|
||||
/*
|
||||
* Copyright (c) 1993-1994 by the University of Southern California
|
||||
*
|
||||
* For copying and distribution information, please see the file
|
||||
* <usc-license.h>.
|
||||
*/
|
||||
|
||||
#include <usc-license.h>
|
||||
|
||||
/* This is the Prospero interface to threads. This threads package
|
||||
is currently used exclusively by the Prospero server when it is operating in
|
||||
multi-threaded mode.
|
||||
|
||||
At the moment, this stuff is experimental. It will only be tested on the
|
||||
server side, not on the client.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The interface to the Prospero server's use of threads is fully defined in
|
||||
* this file. That means that as long as you provide the external interface
|
||||
* herein defined, you're OK. */
|
||||
|
||||
/* This interface does not currently attempt to handle issues of cancelling
|
||||
* threads, although that will be a later extension.
|
||||
*/
|
||||
/* Every thread (on the server) has an active RREQ associated with it. Every
|
||||
* active RREQ has a live thread associated with it. RREQs get moved off of
|
||||
* the queue of items to be processed to the list of items in progress when an
|
||||
* available thread is there for them. When a thread is available,
|
||||
* ardp_accept() is called.
|
||||
*/
|
||||
|
||||
#ifndef PFS_THREADS_H
|
||||
#define PFS_THREADS_H
|
||||
|
||||
|
||||
/* #define P_MAX_NUM_THREADS here if you want any threads, and PFS_THREADS. */
|
||||
#define PFS_THREADS /* Part of the external interface. */
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
#define P_MAX_NUM_THREADS 61 /* enough for now - i.e. threads 0-6*/
|
||||
/* Also change in dirsrv.c */
|
||||
#define PFS_THREADS_HAVE_SAFE_MALLOC /* Version */
|
||||
/* Define which PFS_THREADS package you have, options supported currently
|
||||
include PFS_THREADS_SOLARIS or PFS_THREADS_FLORIDA - note NONE
|
||||
of these must be defined if PFS_THREADS is undefined*/
|
||||
#define PFS_THREADS_SOLARIS
|
||||
#endif
|
||||
|
||||
#include <pfs_utils.h> /* assert */
|
||||
|
||||
/* To port to a new threads package
|
||||
- pick an identifer (e.g. PFS_THREADS_DCE).
|
||||
-- Note PFS_THREADS_POSIX is reservered for post-balloting implementation
|
||||
-- Tell prospero-developers@isi.edu which you are using.
|
||||
- Grep through all of the source for instances of PFS_THREADS_
|
||||
-- Editing these is documented where they apply
|
||||
-- This will include lib/ardp/p_th_self_num server/dirsrv
|
||||
*/
|
||||
|
||||
|
||||
#ifdef PFS_THREADS_FLORIDA
|
||||
/* pthreads/pthread.h is the include file from the PTHREADS distribution.
|
||||
It prototypes all of the functions and interfaces whose names start with
|
||||
pthread_.
|
||||
*/
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#ifdef PFS_THREADS_SOLARIS
|
||||
/* Make sure we get our signal.h with _POSIX_C_SOURCE before thread.h
|
||||
includes sys/signal.h */
|
||||
#include <posix_signal.h>
|
||||
/* Thread.h prototypes most functions starting thr_ */
|
||||
#include <thread.h>
|
||||
#endif
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
/* Yield a unique integer between 0 and P_MAX_NUM_THREADS - 1 for the current
|
||||
thread. Hopefully this function will go away eventually as the server's
|
||||
internal structure changes in a way that a reference to the current thread
|
||||
is passed around to all subfunctions. But maybe not, too.
|
||||
This is implemented using the per-thread key mechanisms. */
|
||||
extern void p_th_allocate_self_num(void); /* external; must be called by thread
|
||||
after startup. */
|
||||
extern void p_th_deallocate_self_num(void); /* external; must be called by
|
||||
thread before exit. */
|
||||
#endif /*PFS_THREADS*/
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
extern int p__th_self_num(void); /* not external interface. */
|
||||
#else
|
||||
#define p__th_self_num() 0
|
||||
#endif
|
||||
|
||||
/* We don't include a trailing ; at the end of our declarations and definitions
|
||||
because a ; by itself in a declarations list is treated by C as a statement,
|
||||
not as an empty declaration. This means that the AUTOSTAT declaration has to
|
||||
be the last one. */
|
||||
|
||||
|
||||
/* This declares an automatic variable name VARNAME of type char **. *VARNAME
|
||||
will be a reference to a persistent per-thread static variable of type char
|
||||
*, with function scope. Note that *varname will be initially NULL, but may
|
||||
expand with time. Part of the external interface.*/
|
||||
#ifdef PFS_THREADS
|
||||
#define AUTOSTAT_CHARPP(VARNAME) \
|
||||
static char *(VARNAME##_target[P_MAX_NUM_THREADS]); /* NULL by default. */\
|
||||
char **VARNAME = (VARNAME##_target + p__th_self_num())
|
||||
#else
|
||||
#define AUTOSTAT_CHARPP(VARNAME) \
|
||||
static char *VARNAME##_target = NULL; \
|
||||
char **VARNAME = &VARNAME##_target
|
||||
#endif
|
||||
|
||||
|
||||
/* ditto, for int* . Part of the external interface. */
|
||||
#ifdef PFS_THREADS
|
||||
#define AUTOSTAT_INTP(VARNAME) \
|
||||
static int (VARNAME##_target[P_MAX_NUM_THREADS]); /* automatically 0 */\
|
||||
int *VARNAME = (VARNAME##_target + p__th_self_num())
|
||||
#else
|
||||
#define AUTOSTAT_INTP(VARNAME) \
|
||||
static int VARNAME##_target = 0; \
|
||||
int *VARNAME = &VARNAME##_target
|
||||
#endif
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
#define AUTOSTATIC_VAR_INITIALIZED(TYPE,VARNAME,INITIALIZER) \
|
||||
static TYPE (VARNAME##_target[P_MAX_NUM_THREADS]); /* automatically 0 */\
|
||||
TYPE *VARNAME = (VARNAME##_target + p__th_self_num())
|
||||
#else
|
||||
#define AUTOSTATIC_VAR_INITIALIZED(VARNAME) \
|
||||
static TYPE VARNAME##_target = 0; \
|
||||
TYPE *VARNAME = &VARNAME##_target
|
||||
#endif
|
||||
|
||||
|
||||
/* Possible alternative interface for a common case. I'm experimenting with
|
||||
it. Experimental part of external interface. */
|
||||
#if 1
|
||||
#define SCRATCHBUF_CHARPP_DEF(VARNAME) AUTOSTAT_CHARPP(VARNAME)
|
||||
/* Set using *VARNAME = or passing VARNAME as a pointer to the target. */
|
||||
#define SCRATCHBUF_CHARPP_CLEANUP(VARNAME)
|
||||
|
||||
#else
|
||||
/* This version of the interface will always allocate a new buffer upon
|
||||
entry. It has the sole advantage that it does not leave static buffers
|
||||
around. It has disadvantages too: presumably the many calls to malloc()
|
||||
will not be an efficient way of using the processor. */
|
||||
/* A good optimizing compiler should clean up the following (I hope). */
|
||||
#define SCRATCHBUF_CHARPP_DEF(VARNAME) \
|
||||
char * VARNAME##_target = NULL; \
|
||||
char **VARNAME = &VARNAME##_target
|
||||
|
||||
/* Set using *VARNAME = or passing VARNAME as a pointer to the target. */
|
||||
#define SCRATCHBUF_CHARPP_CLEANUP(VARNAME) do { \
|
||||
stfree(*VARNAME); \
|
||||
*VARNAME = NULL; \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* The following abstraction is used for statics (per-file externs) and
|
||||
real externs. */
|
||||
|
||||
/* Externs need separate declarations and data definitions. */
|
||||
/* Each extern will need one of these after the declaration, to keep the old
|
||||
stuff working. */
|
||||
#ifdef PFS_THREADS
|
||||
#define EXTERN_LONG_DECL(VARNAME) \
|
||||
extern long p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_LONG_DEF(VARNAME) \
|
||||
long p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define PERFILE_STATIC_LONG_DEF(VARNAME) \
|
||||
static long p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_INT_DECL(VARNAME) \
|
||||
extern int p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_INT_DEF(VARNAME) \
|
||||
int p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define PERFILE_STATIC_INT_DEF(VARNAME) \
|
||||
static int p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_CHARP_DECL(VARNAME) \
|
||||
extern char * p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_CHARP_DEF(VARNAME) \
|
||||
char * p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define PERFILE_STATIC_CHARP_DEF(VARNAME) \
|
||||
static char * p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_TYPEP_DECL(TYPE,VARNAME) \
|
||||
extern TYPE p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#define EXTERN_TYPEP_DEF(TYPE,VARNAME) \
|
||||
TYPE p_th_ar##VARNAME[P_MAX_NUM_THREADS]
|
||||
#else
|
||||
#define EXTERN_LONG_DECL(VARNAME) \
|
||||
extern long p_th_ar##VARNAME[1]
|
||||
#define EXTERN_LONG_DEF(VARNAME) \
|
||||
long p_th_ar##VARNAME[1]
|
||||
#define PERFILE_STATIC_LONG_DEF(VARNAME) \
|
||||
static long p_th_ar##VARNAME[1]
|
||||
#define EXTERN_INT_DECL(VARNAME) \
|
||||
extern int p_th_ar##VARNAME[1]
|
||||
#define EXTERN_INT_DEF(VARNAME) \
|
||||
int p_th_ar##VARNAME[1]
|
||||
#define PERFILE_STATIC_INT_DEF(VARNAME) \
|
||||
static int p_th_ar##VARNAME[1]
|
||||
#define EXTERN_CHARP_DECL(VARNAME) \
|
||||
extern char * p_th_ar##VARNAME[1]
|
||||
#define EXTERN_CHARP_DEF(VARNAME) \
|
||||
char * p_th_ar##VARNAME[1]
|
||||
#define PERFILE_STATIC_CHARP_DEF(VARNAME) \
|
||||
static char * p_th_ar##VARNAME[1]
|
||||
#define EXTERN_TYPEP_DECL(VARNAME) \
|
||||
extern TYPE p_th_ar##VARNAME[1]
|
||||
#define EXTERN_TYPEP_DEF(VARNAME) \
|
||||
TYPE p_th_ar##VARNAME[1]
|
||||
#endif
|
||||
/* In any case, follow definitions with a:
|
||||
#define VARNAME p_th_arVARNAME[p__th_self_num()] */
|
||||
|
||||
|
||||
#if 0 /* first attempt */
|
||||
/* Externs need separate declarations and data definitions. */
|
||||
#define EXTERN_INTP_DECL(VARNAMEP) extern int *VARNAMEP
|
||||
/* Each extern will need one of these after the declaration, to keep the old
|
||||
stuff working. */
|
||||
/* #define VARNAME (*VARNAMEP) */
|
||||
|
||||
/* Definition. */
|
||||
#define EXTERN_INTP_DEF(VARNAMEP) int *VARNAMEP
|
||||
#endif
|
||||
|
||||
/* Mutexes,implemented on top of the pthreads package. */
|
||||
/* p_th_mutex is an exported data type, used when we mutex functions or
|
||||
collections of functions. See lib/ardp/ptalloc.c for an example of this.
|
||||
*/
|
||||
/*
|
||||
Do so in init code, to keep
|
||||
from depending on ONCE implementation. Again, this interface is only
|
||||
called directly by Prospero and ARDP code when a set of functions need to be
|
||||
mutexed; otherwise, the *_MUTEXED_* variable declaration and definition
|
||||
interfaces below are used. */
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define zz(a) assert((a) == 0)
|
||||
#else
|
||||
#define zz(a) a
|
||||
#endif
|
||||
|
||||
#if defined(PFS_THREADS) && !defined(NDEBUG)
|
||||
#define DIAGMUTEX(MX1,MX2) if (p_th_mutex_islocked(&p_th_mutex##MX1 )) { printf(mutex_locked_msg,MX2); }
|
||||
extern char mutex_locked_msg[];
|
||||
#else
|
||||
#define DIAGMUTEX(MX1,MX2) do { } while(0)
|
||||
#endif
|
||||
|
||||
#ifdef PFS_THREADS_FLORIDA
|
||||
#typedef pthread_mutex_t p_th_mutex;
|
||||
#define p_th_mutex_init(MUTEX) \
|
||||
pthread_mutex_init(&(MUTEX), (pthread_mutexattr_t *) NULL)
|
||||
#define p_th_mutex_lock(MUTEX) { pthread_mutex_lock(&(MUTEX)) }
|
||||
#define p_th_mutex_unlock(MUTEX) pthread_mutex_unlock(&(MUTEX))
|
||||
#define p_th_mutex_islocked(MUTEX) (pthread_mutex_trylock(&(MUTEX)) == -1)
|
||||
#define p_th_mutex_trylock(MUTEX) \
|
||||
( (p_th_mutex_trylock(&(MUTEX)) != -1) \
|
||||
? p_th_mutex_lock(MUTEX) \
|
||||
: TRUE )
|
||||
#endif /*PFS_THREADS_FLORIDA*/
|
||||
|
||||
#ifdef PFS_THREADS_SOLARIS
|
||||
typedef mutex_t p_th_mutex;
|
||||
#define p_th_mutex_init(MUTEX) zz(mutex_init(&(MUTEX), USYNC_THREAD, NULL))
|
||||
#define p_th_mutex_lock(MUTEX) zz(mutex_lock(&(MUTEX)))
|
||||
#define p_th_mutex_unlock(MUTEX) zz(mutex_unlock(&(MUTEX)))
|
||||
extern int p_th_mutex_islocked(mutex_t *mp);
|
||||
#define p_th_mutex_trylock(MUTEX) (mutex_trylock(&(MUTEX)))
|
||||
#endif /*PFS_THREADS_SOLARIS*/
|
||||
|
||||
#ifndef PFS_THREADS
|
||||
#define p_th_mutex_init(MUTEX) do { } while(0)
|
||||
#define p_th_mutex_lock(MUTEX) do { } while(0)
|
||||
#define p_th_mutex_unlock(MUTEX) do { } while(0)
|
||||
/* Used only in ardp_accept() */
|
||||
#define p_th_mutex_islocked(MUTEX) 0
|
||||
#define p_th_mutex_trylock(MUTEX) 0
|
||||
#endif /*!PFS_THREADS*/
|
||||
|
||||
|
||||
/* Handling of global shared variables (e.g., ardp_runQ) */
|
||||
/* Mutex initialized in ardp_mutexes.c (ardp_init_mutexes()). */
|
||||
/* Variable defined and declared as mutexed. */
|
||||
#ifdef PFS_THREADS
|
||||
#define EXTERN_MUTEX_DECL(VARNAME) \
|
||||
extern p_th_mutex p_th_mutex##VARNAME
|
||||
#define EXTERN_MUTEX_DEF(VARNAME) \
|
||||
p_th_mutex p_th_mutex##VARNAME
|
||||
|
||||
/* Initialize the mutex (in ardp_init_mutexes(), pfs_init_mutexes(),
|
||||
dirsrv_init_mutexes()) */
|
||||
#define EXTERN_MUTEXED_INIT_MUTEX(VARNAME) \
|
||||
p_th_mutex_init(p_th_mutex##VARNAME)
|
||||
#else
|
||||
/* No-ops if not threaded. */
|
||||
#define EXTERN_MUTEX_DECL(VARNAME)
|
||||
#define EXTERN_MUTEX_DEF(VARNAME)
|
||||
#define EXTERN_MUTEXED_INIT_MUTEX(VARNAME) do {} while(0) /* no-op */
|
||||
#endif
|
||||
|
||||
#define EXTERN_ALLOC_DECL(VARNAME) \
|
||||
EXTERN_MUTEX_DECL(VARNAME)
|
||||
#define EXTERN_MUTEXED_DECL(TYPE,VARNAME) \
|
||||
EXTERN_MUTEX_DECL(VARNAME); \
|
||||
extern TYPE VARNAME
|
||||
#define EXTERN_MUTEXED_DEF(TYPE,VARNAME) \
|
||||
EXTERN_MUTEX_DEF(VARNAME); \
|
||||
TYPE VARNAME
|
||||
#define EXTERN_MUTEXED_DEF_INITIALIZER(TYPE,VARNAME,INITIALIZER) \
|
||||
EXTERN_MUTEX_DEF(VARNAME); \
|
||||
TYPE VARNAME = (INITIALIZER)
|
||||
|
||||
/* Lock and unlock a mutexed external variable. */
|
||||
/* In order to avoid potential deadlock situations, all variables must be
|
||||
locked in alphabetical order. */
|
||||
|
||||
#ifdef PFS_THREADS
|
||||
#define EXTERN_MUTEXED_LOCK(VARNAME) p_th_mutex_lock(p_th_mutex##VARNAME)
|
||||
#define EXTERN_MUTEXED_UNLOCK(VARNAME) p_th_mutex_unlock(p_th_mutex##VARNAME)
|
||||
#else
|
||||
#define EXTERN_MUTEXED_LOCK(VARNAME) do {} while (0)
|
||||
#define EXTERN_MUTEXED_UNLOCK(VARNAME) do {} while (0)
|
||||
#endif
|
||||
|
||||
/* This is found in assertions inside functions that expect to be called only
|
||||
when they are running as the 'master' thread in Prospero. */
|
||||
/* The master thread is the one that is started off. When we're
|
||||
single-threaded, that's the master. */
|
||||
/* This is used entirely in assertions. */
|
||||
#define P_IS_THIS_THREAD_MASTER() (p__th_self_num() == 0)
|
||||
|
||||
|
||||
#ifdef PFS_THREADS_FLORIDA
|
||||
/* Note that under the Draft 7 standard, pthread_detach
|
||||
takes a pthread_t, whereas under Draft 6, it takes a pointer to
|
||||
a pthread_t. This implementation uses Draft 6. */
|
||||
#define p_th_t pthread_t
|
||||
#define p_th_create_detached(NEWTHREAD,FUNC,ARG) ( \
|
||||
pthread_create(&NEWTHREAD, (pthread_attr_t *) NULL, \
|
||||
(pthread_funct_t) FUNC, (any_t) ARG) \
|
||||
: pthread_detach(&NEWTHREAD) \
|
||||
)
|
||||
#define p_th_self pthread_self
|
||||
#define p_th_equal(a,b) pthread_equal(a,b)
|
||||
#endif
|
||||
|
||||
#ifdef PFS_THREADS_SOLARIS
|
||||
#define p_th_t thread_t
|
||||
/* caller needs to check this for errors */
|
||||
#define p_th_create_detached(NEWTHREAD,FUNC,ARG) \
|
||||
thr_create(NULL,0,(void *)FUNC,ARG,THR_DETACHED, &NEWTHREAD)
|
||||
#define p_th_self thr_self
|
||||
/* thread_t is an int so ...*/
|
||||
#define p_th_equal(a,b) (a == b)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mutexed versions of everything that might possibly call malloc() and free().
|
||||
We can yank this out once we have thread-safe libraries, but that might be a
|
||||
few years off. */
|
||||
|
||||
/* Note that we have converted over all of the server code that might be
|
||||
called when multi-threaded to not call any of the printf() family of
|
||||
functions. With a thread_safe malloc() now available from FSU, that
|
||||
means we need none of these special definitions. Hooray! */
|
||||
#ifdef PFS_THREADS /* commented out */
|
||||
#if !defined(PFS_THREADS_SOLARIS) && !defined(PFS_THREADS_FLORIDA)
|
||||
#define free(P) p_th_free((P))
|
||||
#define malloc(P) p_th_malloc((P))
|
||||
extern void *p_th_malloc(unsigned size);
|
||||
#define calloc(A,B) p_th_calloc((A),(B))
|
||||
extern void *p_th_calloc(unsigned nelem, unsigned size);
|
||||
#define _filbuf(p) p_th__filbuf((p))
|
||||
#define _flsbuf(p,q) p_th__flsbuf((p),(q))
|
||||
#define fgets(a,b,c) p_th_fgets((a),(b), (c))
|
||||
extern char *p_th_fgets(char *s, int n, FILE *stream);
|
||||
#define gets(a) p_th_gets((a))
|
||||
extern char *p_th_gets(char *s);
|
||||
#define fputs(a,b) p_th_fputs((a),(b))
|
||||
extern int p_th_fputs(const char *s, FILE *stream);
|
||||
#define puts(a) p_th_puts((a))
|
||||
extern int p_th_puts(const char *s);
|
||||
#define sprintf p_th_sprintf
|
||||
extern char *p_th_sprintf();
|
||||
#define fprintf p_th_fprintf
|
||||
#define printf p_th_printf
|
||||
#define fflush(a) p_th_fflush((a))
|
||||
extern int p_th_fflush(FILE *);
|
||||
#define fgetc(a) p_th_fgetc((a))
|
||||
extern int p_th_fgetc(FILE *);
|
||||
#define fputc(a,b) p_th_fputc((a),(b))
|
||||
extern int p_th_fputc();
|
||||
#define fread(a,b,c,d) p_th_fread((a),(b),(c), (d))
|
||||
extern int p_th_fread(char *ptr, int size, int nitems, FILE*stream);
|
||||
#define fwrite(a,b,c,d) p_th_fwrite((a),(b),(c), (d))
|
||||
extern int p_th_fwrite(const char *ptr, int size, int nitems, FILE *stream);
|
||||
#define fopen(a,b) p_th_fopen((a),(b))
|
||||
extern FILE *p_th_fopen(const char *a, const char *b);
|
||||
#define fclose(a) p_th_fclose((a))
|
||||
extern int p_th_fclose(FILE *a);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h> /* For FILE*/
|
||||
#ifdef PFS_THREADS
|
||||
extern FILE *locked_fopen(const char *a, const char *b);
|
||||
extern int locked_fclose_A(FILE *a, const char *filename, int readonly);
|
||||
#else
|
||||
#define locked_fopen(a,b) fopen((a),(b))
|
||||
#define locked_fclose_A(a,b,c) fclose((a))
|
||||
#endif /*PFS_THREADS*/
|
||||
extern void p__th_set_self_master();
|
||||
#endif /* PFS_THREADS_H */
|
||||
|
||||
|
||||
|
||||
|
||||
224
prospero/patches/half-done/10Mar94.solaris.patch
Normal file
224
prospero/patches/half-done/10Mar94.solaris.patch
Normal file
@@ -0,0 +1,224 @@
|
||||
diff -b -r -c -N 10Mar94/Makefile 10Mar94+/Makefile
|
||||
*** 10Mar94/Makefile Mon Mar 14 20:29:47 1994
|
||||
--- 10Mar94+/Makefile Mon Mar 14 17:26:28 1994
|
||||
***************
|
||||
*** 66,74 ****
|
||||
# Many BSD-derived C compilers prepend C symbols with an _, and require that
|
||||
# the _ be present as an argument to the linker's -u flag.
|
||||
# Under SunOS use this definition:
|
||||
! COMPILER_PREPENDS_C_SYMBOLS_WITH_UNDERSCORE=_
|
||||
# under SOLARIS, use this empty definition:
|
||||
! # COMPILER_PREPENDS_C_SYMBOLS_WITH_UNDERSCORE=
|
||||
|
||||
CC = gcc
|
||||
|
||||
--- 66,74 ----
|
||||
# Many BSD-derived C compilers prepend C symbols with an _, and require that
|
||||
# the _ be present as an argument to the linker's -u flag.
|
||||
# Under SunOS use this definition:
|
||||
! # COMPILER_PREPENDS_C_SYMBOLS_WITH_UNDERSCORE=_
|
||||
# under SOLARIS, use this empty definition:
|
||||
! COMPILER_PREPENDS_C_SYMBOLS_WITH_UNDERSCORE=
|
||||
|
||||
CC = gcc
|
||||
|
||||
***************
|
||||
*** 88,96 ****
|
||||
# This does not work on SunOS 4.1.3., because the include files don't prototype
|
||||
# all the functions. Has been tested under Solaris.
|
||||
# GCCWARN = -Wimplicit
|
||||
! GCCWARN=
|
||||
# Compiling with these will generate lots of warnings
|
||||
GCCTRY = -Wformat -Wshadow -Wreturn-type
|
||||
# -O -Wuninitialized # -Wuninitialized is not supported without -O
|
||||
GCCNO = -Wredundant-decls -Wstrict-prototypes
|
||||
! CFLAGS = -g ${GCCWARN} ${GCCTRY}
|
||||
--- 88,96 ----
|
||||
# This does not work on SunOS 4.1.3., because the include files don't prototype
|
||||
# all the functions. Has been tested under Solaris.
|
||||
# GCCWARN = -Wimplicit
|
||||
! GCCWARN= -Wimplicit
|
||||
# Compiling with these will generate lots of warnings
|
||||
GCCTRY = -Wformat -Wshadow -Wreturn-type
|
||||
# -O -Wuninitialized # -Wuninitialized is not supported without -O
|
||||
GCCNO = -Wredundant-decls -Wstrict-prototypes
|
||||
! CFLAGS = -g -D_REENTRANT ${GCCWARN} ${GCCTRY}
|
||||
***************
|
||||
*** 103,107 ****
|
||||
# SCOUNIX: Need -lsocket, -lcrypt_i, needs -lm if WAIS_GW defined
|
||||
# LIBS = -lsocket -lcrypt_i -lm
|
||||
# Some systems (Solaris???) need -lmalloc
|
||||
! # SOLARIS: Need -lsocket -lnsl
|
||||
! # LIBS = -lsocket -lnsl
|
||||
--- 103,107 ----
|
||||
# SCOUNIX: Need -lsocket, -lcrypt_i, needs -lm if WAIS_GW defined
|
||||
# LIBS = -lsocket -lcrypt_i -lm
|
||||
# Some systems (Solaris???) need -lmalloc
|
||||
! # SOLARIS: Need -lsocket -lnsl -lthread
|
||||
! LIBS = -lsocket -lnsl -lthread
|
||||
***************
|
||||
*** 108,109 ****
|
||||
# All systems need -lm if WAIS_GW is defined.
|
||||
! LIBS = -lm
|
||||
--- 108,109 ----
|
||||
# All systems need -lm if WAIS_GW is defined.
|
||||
! # LIBS = -lm
|
||||
diff -b -r -c -N 10Mar94/include/ardp.h 10Mar94+/include/ardp.h
|
||||
*** 10Mar94/include/ardp.h Mon Mar 14 20:29:23 1994
|
||||
--- 10Mar94+/include/ardp.h Mon Mar 14 17:49:32 1994
|
||||
***************
|
||||
*** 64,73 ****
|
||||
#define ARDP_DEFAULT_PORT 1525 /* Default destination port number */
|
||||
#endif /* PROSPERO */
|
||||
|
||||
! #define ARDP_BACKOFF(x) (2 * x) /* Backoff algorithm */
|
||||
! #define ARDP_DEFAULT_TIMEOUT 4 /* Default time before retry (sec) */
|
||||
#define ARDP_DEFAULT_RETRY 3 /* Default number of times to try */
|
||||
! #define ARDP_DEFAULT_WINDOW_SZ 16 /* Default maximum packets to send at
|
||||
once, unless special request
|
||||
received from client. */
|
||||
#define ARDP_MAX_WINDOW_SZ 256 /* Maximum # of packets we'll send
|
||||
--- 64,73 ----
|
||||
#define ARDP_DEFAULT_PORT 1525 /* Default destination port number */
|
||||
#endif /* PROSPERO */
|
||||
|
||||
! #define ARDP_BACKOFF(x) (1 * x) /* Backoff algorithm */
|
||||
! #define ARDP_DEFAULT_TIMEOUT 6 /* Default time before retry (sec) */
|
||||
#define ARDP_DEFAULT_RETRY 3 /* Default number of times to try */
|
||||
! #define ARDP_DEFAULT_WINDOW_SZ 75 /* Default maximum packets to send at
|
||||
once, unless special request
|
||||
received from client. */
|
||||
#define ARDP_MAX_WINDOW_SZ 256 /* Maximum # of packets we'll send
|
||||
diff -b -r -c -N 10Mar94/include/pmachine.h 10Mar94+/include/pmachine.h
|
||||
*** 10Mar94/include/pmachine.h Fri Mar 11 05:29:52 1994
|
||||
--- 10Mar94+/include/pmachine.h Mon Mar 14 16:22:23 1994
|
||||
***************
|
||||
*** 37,46 ****
|
||||
* Add others as needed.
|
||||
*
|
||||
* Files that check these defintions:
|
||||
* include/pmachine.h, lib/pcompat/opendir.c, lib/pcompat/readdir.c
|
||||
*/
|
||||
! #define P_OS_TYPE "SUNOS"
|
||||
! #define SUNOS
|
||||
|
||||
/*
|
||||
* Miscellaneous definitions
|
||||
--- 37,46 ----
|
||||
* Add others as needed.
|
||||
*
|
||||
* Files that check these defintions:
|
||||
* include/pmachine.h, lib/pcompat/opendir.c, lib/pcompat/readdir.c
|
||||
*/
|
||||
! #define P_OS_TYPE "SOLARIS"
|
||||
! #define SOLARIS
|
||||
|
||||
/*
|
||||
* Miscellaneous definitions
|
||||
***************
|
||||
*** 81,87 ****
|
||||
*/
|
||||
|
||||
#ifdef SOLARIS
|
||||
! #define ARDP_MY_WINDOW_SZ 9
|
||||
#endif
|
||||
|
||||
/* Not sure if we need this as well, we certainly need the definition
|
||||
--- 81,87 ----
|
||||
*/
|
||||
|
||||
#ifdef SOLARIS
|
||||
! #define ARDP_MY_WINDOW_SZ 6
|
||||
#endif
|
||||
|
||||
/* Not sure if we need this as well, we certainly need the definition
|
||||
diff -b -r -c -N 10Mar94/lib/ardp/Makefile 10Mar94+/lib/ardp/Makefile
|
||||
*** 10Mar94/lib/ardp/Makefile Mon Mar 14 20:29:48 1994
|
||||
--- 10Mar94+/lib/ardp/Makefile Mon Mar 14 16:22:30 1994
|
||||
***************
|
||||
*** 9,15 ****
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -g
|
||||
- RANLIB = ranlib
|
||||
F_CC = $(CFLAGS) -c
|
||||
F_CPP = ${INCS} ${MACHDEF}
|
||||
|
||||
--- 9,14 ----
|
||||
diff -b -r -c -N 10Mar94/lib/ardp/ardp_rqalloc.c 10Mar94+/lib/ardp/ardp_rqalloc.c
|
||||
*** 10Mar94/lib/ardp/ardp_rqalloc.c Fri Mar 11 05:30:23 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_rqalloc.c Mon Mar 14 16:22:34 1994
|
||||
***************
|
||||
*** 18,24 ****
|
||||
/* When debugging the ARDP window flow control stuff, use these definitions. */
|
||||
/* Defaults are set here. */
|
||||
#if 0
|
||||
! #define ARDP_MY_WINDOW_SZ 2 /* Our window size;currently only implemented on
|
||||
the client. Here, the client asks for a
|
||||
window size of 2, for testing. */
|
||||
#undef ARDP_DEFAULT_WINDOW_SZ /* Peer window size the server will use for its
|
||||
--- 18,24 ----
|
||||
/* When debugging the ARDP window flow control stuff, use these definitions. */
|
||||
/* Defaults are set here. */
|
||||
#if 0
|
||||
! #define ARDP_MY_WINDOW_SZ 6 /* Our window size;currently only implemented on
|
||||
the client. Here, the client asks for a
|
||||
window size of 2, for testing. */
|
||||
#undef ARDP_DEFAULT_WINDOW_SZ /* Peer window size the server will use for its
|
||||
diff -b -r -c -N 10Mar94/server/Makefile 10Mar94+/server/Makefile
|
||||
*** 10Mar94/server/Makefile Mon Mar 14 20:29:50 1994
|
||||
--- 10Mar94+/server/Makefile Mon Mar 14 18:53:42 1994
|
||||
***************
|
||||
*** 131,136 ****
|
||||
--- 131,137 ----
|
||||
|
||||
dirsrv: $(DIRSRV_OBJECTS) ${SRV_LIB} ${PFS_LIB} ${RDP_LIB} ${DB_LIBS}
|
||||
${CC} ${F_CCL} -o $@ $(DIRSRV_OBJECTS) \
|
||||
+ -lmalloc \
|
||||
${ARDPNEEDSSRV} ${SRV_LIB} \
|
||||
${DB_LIBS} ${SRV_LIB} \
|
||||
${ARDPNEEDPFS} ${PFS_LIB} \
|
||||
diff -b -r -c -N 10Mar94/user/pfsinit 10Mar94+/user/pfsinit
|
||||
*** 10Mar94/user/pfsinit Wed Dec 31 19:00:00 1969
|
||||
--- 10Mar94+/user/pfsinit Sat Mar 12 21:53:33 1994
|
||||
***************
|
||||
*** 0 ****
|
||||
--- 1,38 ----
|
||||
+ #!/bin/sh
|
||||
+ # This scripts job is to start or stop pfs, depending on its argument
|
||||
+ # It is intended to be run by rc.d or whatever the equivalent is on your
|
||||
+ # system.
|
||||
+ # - Mitra 22Dec93
|
||||
+
|
||||
+ # This version was designed for Solaris -
|
||||
+
|
||||
+ # Ideally this should work through the "TOPDIR" variable, but I havent
|
||||
+ # figured out how to do that in a script - easier to link /usr/pfs
|
||||
+ # to the right place :-)
|
||||
+ case "$1" in
|
||||
+
|
||||
+ start)
|
||||
+ #set -x
|
||||
+ if [ -f /etc/hostanddomain ]
|
||||
+ then PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
+ fi
|
||||
+ su pfs -c "setenv PSRV_HOSTNAME $PSRV_HOSTNAME ; /usr/pfs/bin/pstart"
|
||||
+ ;;
|
||||
+
|
||||
+ stop)
|
||||
+ if ps -ef | grep dirsrv
|
||||
+ then
|
||||
+ /usr/pfs/bin/padmin -kill -force
|
||||
+ fi
|
||||
+ ;;
|
||||
+ install)
|
||||
+ if [ -d /etc/init.d ]
|
||||
+ then
|
||||
+ cp pfsinit /etc/init.d/pfsinit
|
||||
+ ln /etc/init.d/pfsinit /etc/rc2.d/S91pfsinit
|
||||
+ ln /etc/init.d/pfsinit /etc/rc1.d/K58pfsinit
|
||||
+ ln /etc/init.d/pfsinit /etc/rc0.d/K58pfsinit
|
||||
+ fi
|
||||
+ ;;
|
||||
+ esac
|
||||
+
|
||||
45
prospero/patches/ignored/10Mar94.ackall.patch
Normal file
45
prospero/patches/ignored/10Mar94.ackall.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
diff -b -r -c -N 10Mar94.all/include/pserver.h 10Mar94+/include/pserver.h
|
||||
*** 10Mar94.all/include/pserver.h Tue Apr 26 16:33:28 1994
|
||||
--- 10Mar94+/include/pserver.h Tue Apr 26 20:09:36 1994
|
||||
***************
|
||||
*** 524,526 ****
|
||||
--- 524,532 ----
|
||||
|
||||
#define DNSCACHE_MAX 300
|
||||
|
||||
+ /*
|
||||
+ * If ACKOWLEDGE_ALL_PACKETS is defined, then ardp_accept will acknowledge
|
||||
+ * all packets, otherwise it just acknowledges ones if the queue is long
|
||||
+ * this may be usefull on really busy servers where response is unpredicatable
|
||||
+ */
|
||||
+ #define ACKNOWLEDGE_ALL_PACKETS
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/ardp_accept.c 10Mar94+/lib/ardp/ardp_accept.c
|
||||
*** 10Mar94.all/lib/ardp/ardp_accept.c Tue Apr 26 15:37:58 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_accept.c Tue Apr 26 20:10:43 1994
|
||||
***************
|
||||
*** 628,639 ****
|
||||
databases may want to have this command defined too. */
|
||||
ardp_rwait(nreq,900,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
#endif
|
||||
-
|
||||
#ifdef PFS_THREADS
|
||||
if((nreq->inf_queue_pos > (P_MAX_NUM_THREADS + 3)) &&
|
||||
! (nreq->inf_queue_pos < 100)) {
|
||||
ardp_rwait(nreq,0,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
- }
|
||||
#endif
|
||||
|
||||
goto check_for_more;
|
||||
--- 628,639 ----
|
||||
databases may want to have this command defined too. */
|
||||
ardp_rwait(nreq,900,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
#endif
|
||||
#ifdef PFS_THREADS
|
||||
+ #ifndef ACKNOWLEDGE_ALL_PACKETS
|
||||
if((nreq->inf_queue_pos > (P_MAX_NUM_THREADS + 3)) &&
|
||||
! (nreq->inf_queue_pos < 100))
|
||||
! #endif
|
||||
ardp_rwait(nreq,0,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
#endif
|
||||
|
||||
goto check_for_more;
|
||||
246
prospero/patches/ignored/10Mar94.aolwait.patch
Normal file
246
prospero/patches/ignored/10Mar94.aolwait.patch
Normal file
@@ -0,0 +1,246 @@
|
||||
This patch was created on pand05 at Fri Apr 1 04:53:41 EST 1994
|
||||
The command used to create it was: gnudiff -b -r -c 10Mar94.all 10Mar94+
|
||||
|
||||
It is made available on an as-is basis, and carries no guarrantee that
|
||||
it even works, much less that it is fit for its purpose.
|
||||
|
||||
If you find any problems with it, please report to mitra@pand05
|
||||
You may use it as you wish, but if you make it pulicly available anywhere
|
||||
please notify me.
|
||||
|
||||
To apply the patch cd to the directory with the source in it, and run
|
||||
|
||||
patch -l -p1 <patchfile
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/include/ardp.h 10Mar94+/include/ardp.h
|
||||
*** 10Mar94.all/include/ardp.h Fri Apr 1 04:37:23 1994
|
||||
--- 10Mar94+/include/ardp.h Wed Mar 30 22:12:12 1994
|
||||
***************
|
||||
*** 221,226 ****
|
||||
--- 221,227 ----
|
||||
#define ARDP_REFUSED 10 /* Connection refused by server */
|
||||
#define ARDP_FAILURE 11 /* Unspecified ARDP failure */
|
||||
#define ARDP_TOOLONG 12 /* Buffer too long for packet */
|
||||
+ #define ARDP_WAIT_TOO_LONG 13 /* AOL user is waiting too long */
|
||||
/* These are the interface used to the ARDP library's error reporting.
|
||||
These are the same as definitions used in the Prospero PFS library. */
|
||||
/* extern int perrno; /* Place where error codes are set. */
|
||||
diff -b -r -c -N 10Mar94.all/include/plog.h 10Mar94+/include/plog.h
|
||||
*** 10Mar94.all/include/plog.h Fri Mar 11 05:29:51 1994
|
||||
--- 10Mar94+/include/plog.h Fri Apr 1 02:51:38 1994
|
||||
***************
|
||||
*** 115,135 ****
|
||||
|
||||
/* If L_FILEDS_STIME selected, then... */
|
||||
#ifndef L_WTTIME_THRESHOLD
|
||||
! #define L_WTTIME_THRESHOLD 1 /* log waiting time if >= seconds */
|
||||
#endif
|
||||
#ifndef L_SYSTIME_THRESHOLD
|
||||
! #define L_SYSTIME_THRESHOLD 1 /* log systime if >= seconds */
|
||||
#endif
|
||||
#ifndef L_SVCTIME_THRESHOLD
|
||||
! #define L_SVCTIME_THRESHOLD 1 /* log svctime if >= seconds */
|
||||
#endif
|
||||
|
||||
/* If L_QUEUE_COMP selected, then the following conditions are ANDed */
|
||||
#ifndef L_COMP_SVC_THRESHOLD
|
||||
! #define L_COMP_SVC_THRESHOLD 30 /* Log L_QUEUE_COMP only if svctime exceeds */
|
||||
#endif
|
||||
#ifndef L_COMP_SYS_THRESHOLD
|
||||
! #define L_COMP_SYS_THRESHOLD 0 /* Log L_QUEUE_COMP only if systime exceeds */
|
||||
#endif
|
||||
|
||||
/*
|
||||
--- 115,135 ----
|
||||
|
||||
/* If L_FILEDS_STIME selected, then... */
|
||||
#ifndef L_WTTIME_THRESHOLD
|
||||
! #define L_WTTIME_THRESHOLD 9999 /* log waiting time if >= seconds */
|
||||
#endif
|
||||
#ifndef L_SYSTIME_THRESHOLD
|
||||
! #define L_SYSTIME_THRESHOLD 30 /* log systime if >= seconds */
|
||||
#endif
|
||||
#ifndef L_SVCTIME_THRESHOLD
|
||||
! #define L_SVCTIME_THRESHOLD 30 /* log svctime if >= seconds */
|
||||
#endif
|
||||
|
||||
/* If L_QUEUE_COMP selected, then the following conditions are ANDed */
|
||||
#ifndef L_COMP_SVC_THRESHOLD
|
||||
! #define L_COMP_SVC_THRESHOLD 0 /* Log L_QUEUE_COMP only if svctime exceeds */
|
||||
#endif
|
||||
#ifndef L_COMP_SYS_THRESHOLD
|
||||
! #define L_COMP_SYS_THRESHOLD 30 /* Log L_QUEUE_COMP only if systime exceeds */
|
||||
#endif
|
||||
|
||||
/*
|
||||
***************
|
||||
*** 152,158 ****
|
||||
*/
|
||||
#ifndef INITIAL_LOG_VECTOR
|
||||
#define INITIAL_LOG_VECTOR { \
|
||||
! L_FIELDS_USER|L_FIELDS_HADDR|L_FIELDS_SW_ID, /* L_FIELDS */ \
|
||||
LOG_PROSPERO|LOG_NOTICE|PLOG_TOFILE, /* L_STATUS */ \
|
||||
LOG_PROSPERO|LOG_CRIT|PLOG_TOFILE, /* L_FAILURE */ \
|
||||
PLOG_TOFILE, /* L_STATS */ \
|
||||
--- 152,158 ----
|
||||
*/
|
||||
#ifndef INITIAL_LOG_VECTOR
|
||||
#define INITIAL_LOG_VECTOR { \
|
||||
! L_FIELDS_USER|L_FIELDS_HADDR|L_FIELDS_SW_ID|L_FIELDS_STIME, /* L_FIELDS */ \
|
||||
LOG_PROSPERO|LOG_NOTICE|PLOG_TOFILE, /* L_STATUS */ \
|
||||
LOG_PROSPERO|LOG_CRIT|PLOG_TOFILE, /* L_FAILURE */ \
|
||||
PLOG_TOFILE, /* L_STATS */ \
|
||||
***************
|
||||
*** 160,166 ****
|
||||
LOG_PROSPERO|LOG_ERR|PLOG_TOFILE, /* L_NET_RDPERR */ \
|
||||
0, /* L_NET_INFO */ \
|
||||
LOG_PROSPERO|LOG_INFO|PLOG_TOFILE, /* L_QUEUE_INFO */ \
|
||||
! 0, /* L_QUEUE_COMP */ \
|
||||
LOG_PROSPERO|LOG_ERR|PLOG_TOFILE, /* L_DIR_PERR */ \
|
||||
LOG_PROSPERO|LOG_WARNING|PLOG_TOFILE, /* L_DIR_PWARN */ \
|
||||
LOG_PROSPERO|LOG_INFO|PLOG_TOFILE, /* L_DIR_PINFO */ \
|
||||
--- 160,166 ----
|
||||
LOG_PROSPERO|LOG_ERR|PLOG_TOFILE, /* L_NET_RDPERR */ \
|
||||
0, /* L_NET_INFO */ \
|
||||
LOG_PROSPERO|LOG_INFO|PLOG_TOFILE, /* L_QUEUE_INFO */ \
|
||||
! LOG_PROSPERO|LOG_INFO|PLOG_TOFILE, /* L_QUEUE_COMP */ \
|
||||
LOG_PROSPERO|LOG_ERR|PLOG_TOFILE, /* L_DIR_PERR */ \
|
||||
LOG_PROSPERO|LOG_WARNING|PLOG_TOFILE, /* L_DIR_PWARN */ \
|
||||
LOG_PROSPERO|LOG_INFO|PLOG_TOFILE, /* L_DIR_PINFO */ \
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/ardp_accept.c 10Mar94+/lib/ardp/ardp_accept.c
|
||||
*** 10Mar94.all/lib/ardp/ardp_accept.c Fri Apr 1 04:53:33 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_accept.c Thu Mar 31 23:28:26 1994
|
||||
***************
|
||||
*** 29,34 ****
|
||||
--- 29,35 ----
|
||||
#include <pmachine.h>
|
||||
#include <pfs.h> /* For assert */
|
||||
#include <pfs_threads.h> /* Mutex stuff */
|
||||
+ #include <implicit_fixes.h>
|
||||
|
||||
#define LOG_PACKET(REQ,QP) \
|
||||
if((REQ)->priority || (pQlen > 4)) \
|
||||
***************
|
||||
*** 626,631 ****
|
||||
--- 627,639 ----
|
||||
/* Archie servers should request a longer wait. Other heavily used
|
||||
databases may want to have this command defined too. */
|
||||
ardp_rwait(nreq,900,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
+ #endif
|
||||
+
|
||||
+ #ifdef PFS_THREADS
|
||||
+ if((nreq->inf_queue_pos > (P_MAX_NUM_THREADS + 3)) &&
|
||||
+ (nreq->inf_queue_pos < 100)) {
|
||||
+ ardp_rwait(nreq,0,nreq->inf_queue_pos,nreq->inf_sys_time);
|
||||
+ }
|
||||
#endif
|
||||
|
||||
goto check_for_more;
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/ardp_pr_actv.c 10Mar94+/lib/ardp/ardp_pr_actv.c
|
||||
*** 10Mar94.all/lib/ardp/ardp_pr_actv.c Fri Apr 1 04:53:33 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_pr_actv.c Thu Mar 31 19:37:59 1994
|
||||
***************
|
||||
*** 27,32 ****
|
||||
--- 27,35 ----
|
||||
extern int pfs_debug; /* Debug level */
|
||||
int ardp_activeQ_len; /* Length of activeQ */
|
||||
|
||||
+ /* temporary to test theory, indicates that rwait received */
|
||||
+ int something_received = 0;
|
||||
+
|
||||
static struct timeval zerotime = {0, 0}; /* Used by select */
|
||||
|
||||
#define max(x,y) (x > y ? x : y)
|
||||
***************
|
||||
*** 100,106 ****
|
||||
--- 103,114 ----
|
||||
ntohs(req->cid) );
|
||||
(void) fflush(stderr);
|
||||
}
|
||||
+ if(something_received) {
|
||||
+ req->status = ARDP_WAIT_TOO_LONG;
|
||||
+ }
|
||||
+ else {
|
||||
req->status = ARDP_TIMEOUT;
|
||||
+ }
|
||||
EXTRACT_ITEM(req,ardp_activeQ);
|
||||
--ardp_activeQ_len;
|
||||
APPEND_ITEM(req,ardp_completeQ);
|
||||
***************
|
||||
*** 120,125 ****
|
||||
--- 128,135 ----
|
||||
return(ardp__pr_ferror(ARDP_SELECT_FAILED));
|
||||
}
|
||||
|
||||
+ something_received = 1;
|
||||
+
|
||||
/* Process incoming packets */
|
||||
pkt = ardp_ptalloc();
|
||||
pkt->start = pkt->dat;
|
||||
***************
|
||||
*** 205,211 ****
|
||||
req->timeout_adj.tv_sec = max(req->timeout.tv_sec,req->svc_rwait);
|
||||
req->wait_till.tv_sec = now + req->timeout_adj.tv_sec;
|
||||
/* Reset the retry count */
|
||||
! req->retries_rem = req->retries;
|
||||
}
|
||||
ctlptr += 2;
|
||||
}
|
||||
--- 215,221 ----
|
||||
req->timeout_adj.tv_sec = max(req->timeout.tv_sec,req->svc_rwait);
|
||||
req->wait_till.tv_sec = now + req->timeout_adj.tv_sec;
|
||||
/* Reset the retry count */
|
||||
! /* req->retries_rem = req->retries; */
|
||||
}
|
||||
ctlptr += 2;
|
||||
}
|
||||
diff -b -r -c -N 10Mar94.all/lib/ardp/ardp_send.c 10Mar94+/lib/ardp/ardp_send.c
|
||||
*** 10Mar94.all/lib/ardp/ardp_send.c Fri Apr 1 04:40:19 1994
|
||||
--- 10Mar94+/lib/ardp/ardp_send.c Thu Mar 31 19:38:52 1994
|
||||
***************
|
||||
*** 36,42 ****
|
||||
int ardp_port = -1; /* Opened UDP port */
|
||||
|
||||
extern int pfs_debug; /* Debug level */
|
||||
!
|
||||
static ardp_init();
|
||||
static short ardp_next_cid();
|
||||
|
||||
--- 36,42 ----
|
||||
int ardp_port = -1; /* Opened UDP port */
|
||||
|
||||
extern int pfs_debug; /* Debug level */
|
||||
! extern int something_received; /* Received response - server up */
|
||||
static ardp_init();
|
||||
static short ardp_next_cid();
|
||||
|
||||
***************
|
||||
*** 114,119 ****
|
||||
--- 114,120 ----
|
||||
int tmp; /* To temporarily hold return values */
|
||||
|
||||
p_clear_errors();
|
||||
+ something_received = 0 ; /* Flag whether anything received */
|
||||
|
||||
if((ardp_port < 0) && (tmp = ardp_init())) return(tmp);
|
||||
|
||||
diff -b -r -c -N 10Mar94.all/lib/pfs/perrmesg.c 10Mar94+/lib/pfs/perrmesg.c
|
||||
*** 10Mar94.all/lib/pfs/perrmesg.c Fri Apr 1 04:37:16 1994
|
||||
--- 10Mar94+/lib/pfs/perrmesg.c Wed Mar 30 23:26:27 1994
|
||||
***************
|
||||
*** 65,71 ****
|
||||
/* 9 */ "Timed out (ardp)",
|
||||
/* 10 */ "Connection refused by server (ardp)",
|
||||
/* 11 */ "Generic failure sending or receiving message (ardp)",
|
||||
! /* 12 */ "Undefined error 12 (prospero)",
|
||||
/* 13 */ "Undefined error 13 (prospero)",
|
||||
/* 14 */ "Undefined error 14 (prospero)",
|
||||
/* 15 */ "Undefined error 15 (prospero)",
|
||||
--- 65,71 ----
|
||||
/* 9 */ "Timed out (ardp)",
|
||||
/* 10 */ "Connection refused by server (ardp)",
|
||||
/* 11 */ "Generic failure sending or receiving message (ardp)",
|
||||
! /* 12 */ "Wait is too long for AOL users (ardp)",
|
||||
/* 13 */ "Undefined error 13 (prospero)",
|
||||
/* 14 */ "Undefined error 14 (prospero)",
|
||||
/* 15 */ "Undefined error 15 (prospero)",
|
||||
108
prospero/patches/ignored/10Mar94.solaris1.patch
Normal file
108
prospero/patches/ignored/10Mar94.solaris1.patch
Normal file
@@ -0,0 +1,108 @@
|
||||
--- 10Mar94+/user/pfsinit Sat Mar 26 18:22:23 1994
|
||||
***************
|
||||
*** 1,4 ****
|
||||
--- 1,5 ----
|
||||
#!/bin/sh
|
||||
+ # set -x
|
||||
# This scripts job is to start or stop pfs, depending on its argument
|
||||
# It is intended to be run by rc.d or whatever the equivalent is on your
|
||||
# system.
|
||||
***************
|
||||
*** 9,29 ****
|
||||
# Ideally this should work through the "TOPDIR" variable, but I havent
|
||||
# figured out how to do that in a script - easier to link /usr/pfs
|
||||
# to the right place :-)
|
||||
case "$1" in
|
||||
|
||||
start)
|
||||
- #set -x
|
||||
if [ -f /etc/hostanddomain ]
|
||||
then PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
fi
|
||||
! su pfs -c "setenv PSRV_HOSTNAME $PSRV_HOSTNAME ; /usr/pfs/bin/pstart"
|
||||
;;
|
||||
|
||||
stop)
|
||||
! if ps -ef | grep dirsrv
|
||||
then
|
||||
/usr/pfs/bin/padmin -kill -force
|
||||
fi
|
||||
;;
|
||||
install)
|
||||
if [ -d /etc/init.d ]
|
||||
--- 10,52 ----
|
||||
# Ideally this should work through the "TOPDIR" variable, but I havent
|
||||
# figured out how to do that in a script - easier to link /usr/pfs
|
||||
# to the right place :-)
|
||||
+ PERL=/usr/local/bin/perl
|
||||
+ GENERATION=/usr/local/bin/generation
|
||||
+ LOGDIR=/var/spool/logs
|
||||
+
|
||||
case "$1" in
|
||||
|
||||
+ aspfs_kill)
|
||||
+ # The weird syntax of the egrep is to avoid it matching itself
|
||||
+ ps -fu pfs | \
|
||||
+ egrep " 1[ ].*dirsrv" | \
|
||||
+ awk '{ print $2 }' | \
|
||||
+ while read line ; do kill -9 $line ; done
|
||||
+ ;;
|
||||
+ kill)
|
||||
+ exec su pfs -c "$0 aspfs_kill" ;;
|
||||
start)
|
||||
if [ -f /etc/hostanddomain ]
|
||||
then PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
fi
|
||||
! su pfs -c "$0 aspfs_kill ; setenv PSRV_HOSTNAME $PSRV_HOSTNAME ; /usr/pfs/bin/pstart ; $0 as_pfs_restart_on_err&"
|
||||
! date >$LOGDIR/rmg.often.log
|
||||
! $GENERATION $LOGDIR/rmg.often.log
|
||||
! if [ -f /usr/local/bin/rmg.often ]
|
||||
! then /usr/local/bin/rmg.often >>$LOGDIR/rmg.often.log &
|
||||
! fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
! if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null
|
||||
then
|
||||
/usr/pfs/bin/padmin -kill -force
|
||||
fi
|
||||
+
|
||||
+ if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null
|
||||
+ then
|
||||
+ exec $0 kill
|
||||
+ fi
|
||||
;;
|
||||
install)
|
||||
if [ -d /etc/init.d ]
|
||||
***************
|
||||
*** 33,38 ****
|
||||
--- 56,84 ----
|
||||
ln /etc/init.d/pfsinit /etc/rc1.d/K58pfsinit
|
||||
ln /etc/init.d/pfsinit /etc/rc0.d/K58pfsinit
|
||||
fi
|
||||
+ ;;
|
||||
+ as_pfs_restart_on_err)
|
||||
+ RMGLOG=$LOGDIR/rmg.log
|
||||
+ PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
+ export PSRV_HOSTNAME
|
||||
+ while :
|
||||
+ do
|
||||
+ sleep 60 # Wait for it to restart
|
||||
+ echo " == ERR == MONITORING RESTART == $Date " >>$RMGLOG
|
||||
+ tail -1f $RMGLOG |
|
||||
+ $PERL -ne '/ERR:.*:Server Down:/ && (exit)'
|
||||
+ Date="`date`"
|
||||
+ echo " == ERR == ATTEMPTING RESTART == $Date " >>$RMGLOG
|
||||
+ $0 aspfs_kill
|
||||
+ PSRV_HOSTNAME="$PSRV_HOSTNAME" /usr/pfs/bin/pstart
|
||||
+ echo " == ERR == DONE RESTART == $Date " >>$RMGLOG
|
||||
+ done
|
||||
+ ;;
|
||||
+ restart_on_err)
|
||||
+ exec su pfs -c "$0 as_pfs_restart_on_err"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ echo "$1" is not a valid command to pfsinit
|
||||
;;
|
||||
esac
|
||||
|
||||
75
prospero/patches/ignored/10Mar94.solaris2.patch
Normal file
75
prospero/patches/ignored/10Mar94.solaris2.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
diff -b -r -c -N 10Mar94.all/user/pfsinit 10Mar94+/user/pfsinit
|
||||
*** 10Mar94.all/user/pfsinit Tue Apr 26 15:38:03 1994
|
||||
--- 10Mar94+/user/pfsinit Wed Apr 20 15:57:44 1994
|
||||
***************
|
||||
*** 14,20 ****
|
||||
--- 14,39 ----
|
||||
GENERATION=/usr/local/bin/generation
|
||||
LOGDIR=/var/spool/logs
|
||||
|
||||
+ generation2() {
|
||||
+ date >${1}+
|
||||
+ $GENERATION ${1}
|
||||
+ }
|
||||
+ start_rmg_often() {
|
||||
+ generation2 $LOGFIR/rmg.often.log
|
||||
+ if [ -f /usr/local/bin/rmg.often ]
|
||||
+ then /usr/local/bin/rmg.often >>$LOGDIR/rmg.often.log &
|
||||
+ fi
|
||||
+ }
|
||||
+ dirsrv_start() {
|
||||
+ if [ -f /etc/hostanddomain ]
|
||||
+ then PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
+ fi
|
||||
+ limit descriptors 1000
|
||||
+ su pfs -c "$0 aspfs_kill ; setenv PSRV_HOSTNAME $PSRV_HOSTNAME ; /usr/pfs/bin/pstart ; $0 as_pfs_restart_on_err&"
|
||||
+ }
|
||||
+
|
||||
case "$1" in
|
||||
+ dirsrv_start) dirsrv_start ;;
|
||||
|
||||
aspfs_kill)
|
||||
# The weird syntax of the egrep is to avoid it matching itself
|
||||
***************
|
||||
*** 23,43 ****
|
||||
awk '{ print $2 }' | \
|
||||
while read line ; do kill -9 $line ; done
|
||||
;;
|
||||
! kill)
|
||||
! exec su pfs -c "$0 aspfs_kill" ;;
|
||||
! start)
|
||||
! if [ -f /etc/hostanddomain ]
|
||||
! then PSRV_HOSTNAME=`line </etc/hostanddomain`
|
||||
! fi
|
||||
! su pfs -c "$0 aspfs_kill ; setenv PSRV_HOSTNAME $PSRV_HOSTNAME ; /usr/pfs/bin/pstart ; $0 as_pfs_restart_on_err&"
|
||||
! date >$LOGDIR/rmg.often.log
|
||||
! $GENERATION $LOGDIR/rmg.often.log
|
||||
! if [ -f /usr/local/bin/rmg.often ]
|
||||
! then /usr/local/bin/rmg.often >>$LOGDIR/rmg.often.log &
|
||||
! fi
|
||||
;;
|
||||
|
||||
! stop)
|
||||
if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null
|
||||
then
|
||||
/usr/pfs/bin/padmin -kill -force
|
||||
--- 42,60 ----
|
||||
awk '{ print $2 }' | \
|
||||
while read line ; do kill -9 $line ; done
|
||||
;;
|
||||
! kill) exec su pfs -c "$0 aspfs_kill" ;;
|
||||
!
|
||||
! start) # This is what it does on system start (reboot)
|
||||
! start_rmg_often
|
||||
! # If the system was down - cant be any rmg processes running
|
||||
! find /usr/pfs/vcache/p -type f -exec rm {} \;
|
||||
! find /usr/pfs/vcache/tmp -type f -exec rm {} \;
|
||||
! generation2 $LOGDIR/pfs.log
|
||||
! generation2 $LOGDIR/rmg.log
|
||||
! dirsrv_start
|
||||
;;
|
||||
|
||||
! stop) # This is what it does on shutdown
|
||||
if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null
|
||||
then
|
||||
/usr/pfs/bin/padmin -kill -force
|
||||
Reference in New Issue
Block a user