According to Joe R. Jah:
> On Wed, 21 Nov 2001, Gilles Detillieux wrote:
> > > All digs are run on the webserver.  If they were run remotely, I'd expect 
> > > a much bigger different between example 2 and example 3.
> > 
> > Don't you mean the other way around?  If they were run remotely, the
> > local_urls wouldn't have much effect.  Even locally, though, it may
> > be that it's falling back to HTTP an awful lot.  Note that only a very
> > small set of file suffixes is handled by local_urls (see the attrs.html
> > documentation for local_urls).  Files without suffixes (or extensions)
> > don't get handled locally, because htdig can't be sure what content-type
> > they are.
> 
> Is it possible/practical to add file suffixes to be handled by local_urls?
> I am referring to hacking htdig/Document.cc; like for instance to add
> .shtml file suffix:
> 
> --- htdig-3.1.6-111101/htdig/Document.cc        Sun Nov 11 13:56:47 2001
> +++ htdig-3.1.6-111101.0/htdig/Document.cc      Sun Sep 10 01:17:35 2001
> @@ -614,7 +614,7 @@
>      char *ext = strrchr(*filename, '.');
>      if (ext == NULL)
>         return Document_not_local;
> -    if ((mystrcasecmp(ext, ".html") == 0) || (mystrcasecmp(ext, ".htm") == 0))
> +    if ((mystrcasecmp(ext, ".html") == 0) || (mystrcasecmp(ext, ".htm") == 0) || 
>(mystrcasecmp(ext, ".shtml") == 0))
>          contentType = "text/html";
>      else if ((mystrcasecmp(ext, ".txt") == 0) || (mystrcasecmp(ext, ".asc") == 0))
>          contentType = "text/plain";
> 
> I have applied the above patch, but did not find any difference in digging
> time;( Is there some other file(s) that have to be patched to cause a file
> suffix to be handled by local_urls?  Or better yet, is it possible and/or
> worthwhile to make local file suffixes configurable in htdig.conf file?

If you didn't find any difference, it would likely be because very few of
the files you're digging have a ".shtml" suffix.  Either that, or you're
indexing a very fast HTTP server so the request time is negligeable.
The only way to be sure the change is having any effect is to run htdig
with -vv and look at the debugging output to see whether it tries and
finds a local file.  htdig/Document.cc is the only file that needs to be
patched.

Of course it would be possible to make htdig configurable as far as
what suffixes it allows for local_urls, but that just reopens the whole
issue of how is the best way to do this.  Probably using a mime.types
file is the way to go, but someone would have to add this capability
to the code.  It's not enough to just give htdig a list of suffxes to
allow - you need to tell it what content-type is associated with each
suffix.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to