Pseudocode for "server" mode.
-----------------------------
#This code is not optimized.


NOTE:The data files as represented are necessarily different from
what is written on disk. This is because regular disk reading and
writing of large files is not efficient enough for this application.


:MAIN
* Listen on port 80 and port 443 for incoming requests
* If call taken on port 80, GOTO INCOMING_QUERY
* Else the call was taken on port 443, GOTO INCOMING_DATA


:INCOMING_QUERY
* Make call to caller on port 80, and test for stingyness, if desired
* If a request for the date and time of the last index update, distribute it
* If an index request, distribute the index
* If a request for header hashes from a location file, distribute them
* If a request for core data hashes from a location file, distribute them
* If a request for a specific hashed entry or range, distribute
* If a request for an entire location file, distribute it
* If connection maintained, GOTO INCOMING_QUERY
* Else the call is disconnected, GOTO MAIN


:INCOMING_DATA
* Accept data, whether one line, multiple, or zipped
* If data is zipped, decompress
* For each line, strip hash if present and rehash. If hash is present
in any datafile identifed by the abbreviated location, dispose of line.
* For each line, insert to data file identified by abbreviated location and
current date. Insertion position is based upon entry date, from old to new.
(This is a virtual storage concept, actual live file insertion
rates would be insufficient.)
* GOTO MAIN


Hermann L. Johnson. January 2019. Free for unmodified redistribution and non-commercial use.