*
* Email: crh@ubiqx.mn.org
*
- * $Id: PrequelD.c 2012-10-05 17:19:08 -0500 crh$
+ * $Id: PrequelD.c 2013-04-29 15:27:46 -0500 crh$
*
* -------------------------------------------------------------------------- **
*
* logs.
*
* RECV_TIMEOUT - Number of seconds and microseconds to listen on
- * an input socket while receiving data. Format as
- * an initialization pair: { <sec>, <usec> }.
+ * an input socket while receiving data. Formated
+ * as an initialization pair: { <sec>, <usec> }.
* 1usec = 1/1000000sec (10^-6, or 1/1000msec)
*
* POLL_TIMEOUT - Number of milliseconds to wait when poll(2)ing
static const char *Revision =
"$Revision$";
static const char *Id =
- "$Id: PrequelD.c 2012-10-05 17:19:08 -0500 crh$";
+ "$Id: PrequelD.c 2013-04-29 15:27:46 -0500 crh$";
static const char *HelpMsg[] =
{
static RecvErrs QueryPath( int outSock,
const int vMajor,
+ const int vMinor,
char const *pathname )
/* ------------------------------------------------------------------------ **
* Map a source file pathname to the matching cachefile name.
* Input: outSock - Output socket, so we can communicate the results
* to the client.
* vMajor - Requested PeerDist major version.
+ * vMinor - Requested PeerDist minor version.
* pathname - The pathname to be added to the queue.
*
* Output: A <RecvErrs> error code.
*
- * Notes: This function, as written, does not accept a PeerDist minor
+ * Notes: This function, as written, does not handle the PeerDist minor
* version number. At the time of writing, the only PeerDist
* defined PeerDist versions are 1.0 and 2.0. It is not clear
* how we would use the minor number.
*
+ * FIX: We should return the pathname with a version number less than
+ * or equal to the requested [<vMajor>.<vMinor>]. This should
+ * not be an exact match.
+ *
+ * Also, if a requested version of the file is not available
+ * (whether or not *any* acceptable version is available), we
+ * should queue hashing.
+ *
+ * For instance, if the request is for a 2.0 hash for file foo,
+ * and the 1.0 hash is available, then we would return the path
+ * for the 1.0 hash file. If our configuation also indicates
+ * that there should be a 2.0 hash file, then we should queue
+ * creation of the 2.0 hash file.
+ *
* ------------------------------------------------------------------------ **
*/
{
*
* The version number should be passed as:'
* '[' <int> [ '.' <int> ] ']'
- * For example, "[2]" or "[1,0]".
+ * For example, "[2]" or "[1.0]".
*
* ------------------------------------------------------------------------ **
*/
if( 0 == strncasecmp( "QUERY ", s, 6 ) )
{
s = extractVersion( vNum, &s[6] );
- result = QueryPath( Rb->sock, vNum[0], s );
+ result = QueryPath( Rb->sock, vNum[0], vNum[1], s );
}
else
{