Go to the previous, next section.
@everyfooting Author: henry // Editor: henry // Texinfo Debugging: ensley@| @| 3 December 1994
When doing an archie search, first we should do a human-computer interface, put
in the commands. The queuer will then decide your queue position, and let you
in at appropriate time. When the searcher is doing the search for you, what it
actually does is going to the data base which contains a whole bunch of ftp site
list and does the specific search which you specified. If it finds a match, it
will then give you the ftp sites list so that you can find what you want at
those sites.
The site-list-builder is a database which contains the anonymous ftp sites. It
can also perform "addnewsite", "delsite", etc.
It is very important to understand how the site list and the site list builder
work. The site list contains all the ftp sites that the "master archie
server" knows. The site list builder is used to add new ftp sites to
the site list. When the server gets some message (say, e-mail interface)
which asks the server to add a new ftp site to the site list. What the
site list builder does is first to find where the new ftp site is in the
email message. In the email message you will find some commands like
"addnewsite new-ftp-site". After finding the new ftp site, the second
thing you want to do is to get the primary ip address and primary domain
name for the site. Then you need to do is to check whether the ip
address is already in the ftp site list. If the list already has the ftp
site, it will just ignore the e-mail interface's request or give some
kind of error message. If it doesn't have the ip address in its site
list, it will anonymously ftp to that site and obtain an "ls -lR" and
check the "ls -lR" for errors which would make it incompatible with the
archie system. If it is a valid one, then the site list builder will
add the new ftp site to its ftp site list.
To implement the site-list-builder, I have decided to use an array to store the
site list information as the data structure. It is ideally feasible. For the
whole algorithm, it will have something like the following:
getword(word); /* get word from the email interface */
if (word="addnewsite")
getword (new-site);
go to site-list;
strcmp (new-site, site-list);
/* check if the new-site is already there */
if (already-there is true)
output ("it's already there"); /* email back an error message */
else
add (new-site, site-list); /* add new-site to site-list */
if (word="delsite")
getword (old-site);
go to site-list;
strcmp (old-site, site-list);
/* check if the old-site is there */
if (already-there=true)
delete (old-site, site-list); /* delete old-site from */
/* the site-list */
else
output ("the site doesn't exist");
else
getword (word);
By the former sections, hopefully readers have already got the idea how the
ftp site list and the site list builder do to fulfill the task they are supposed
to do. In the following, I will divide it into a few major parts to
discuss how to implement the site-builder.
1. Email Interface. In this part, what the site-builder should
do is to get the email message, tell if it contains any commands, like
"addnewsite" or "delsite" and decide what it should do. Readers should
be able to figure out the detailed procedures from the algorithm
section.
2. Anonymous ftp Site Builder. In this part, we actually build
the site list alphabetically(the domain name), in other words, it's a
sorted list, makes it easier to find the ftp site quickly. If it gets an
"addnewsite", the site builder needs to make an anonymous ftp connection
to obtain an "ls -lR" to see whether it's compatible to our archie
search system. The detailed anonymous ftp connection can be found in the
user manual. Then if everything is OK, we just go ahead to add the
new-site to the site list into an appropriate position.
Go to the previous, next section.