[Prev][Next][Index][Thread]
BUG: HTLoadToFile sometimes saves headers
[Using libwww version 5.0a]
When HTLoadToFile is invoked on a url, it normally saves just the
contents of the document. However, if HTHeadAbsolute is first invoked
on this url, then HTLoadToFile also saves headers. The program below
illustrates the behavior (compile with -DASKFORHEAD to observe the
problem): invoke with a url as argument, then look at /tmp/BUG where
the contents are saved. (I don't think this one is due to a transient
solaris weirdness like my previous problem - I have observed the same
behavior on different machines).
#include "WWWLib.h"
#include "WWWInit.h"
int
main(int argc,char**argv)
{
HTProfile_newPreemptiveClient("Test", "1.0");
#ifdef ASKFORHEAD
{
HTRequest * req = HTRequest_new();
HTHeadAbsolute(argv[1],req);
HTRequest_delete(req);
}
#endif
{
HTRequest * req = HTRequest_new();
HTLoadToFile(argv[1],req,"/tmp/BUG");
HTRequest_delete(req);
}
HTProfile_delete();
return 0;
}
--Denys
Dr. Denys Duchier Denys.Duchier@ps.uni-sb.de
Forschungsbereich Programmiersysteme (Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45 http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50 Phone: +49 681 302 5618
66041 Saarbruecken, Germany Fax: +49 681 302 5615