W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1998

Re: Referrer logging

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Sun, 19 Jul 1998 12:59:46 -0400
Message-Id: <3.0.5.32.19980719125946.03499e60@localhost>
To: <pey@multiwire.net>, <www-lib@w3.org>
At 11:05 7/18/98 +0200, Andrea Peyracchia wrote:
>I am trying to send also the "referrer " field for the TCP request. I have
>tried different soluctions and applied yours suggestions but It is not still
>working. The source code is:

The referer field is only generated when you are following links in a web
page. That is, it is not generated when you type "goto address", for
example. It is intended to give information about who linked to the address.

Libwww as such of course doesn't know how you have found an address that
you want to download - it just downloads it. However, you can add the
"traversal" information to the request in which case the libwww generates
the referer header field and includes it in the HTTP request.

You can see how the libwww robot does this: when it finds a new link, it
gets the address of the current web page and adds it as the parent address
for the link that it is about to follow. You can see the code in

	http://www.w3.org/Robot/src/HTRobot.c

where the parent is set using:

	HTRequest_setParent(newreq, referer);

Henrik

>HTProfile_newNoCacheClient ("SMSMail", "beta 0.9");
>
>HTNet_addAfter(fine, NULL, NULL, HT_ALL, HT_FILTER_LAST);
>HTAlert_setInteractive(YES);
>
>richiesta=HTRequest_new();
>
>log_refer=HTLog_open("log.txt", YES, YES);
>HTNet_addAfter(HTRefererFilter, NULL, log_refer, HT_ALL, HT_FILTER_LATE);
>
>status=HTLoadAbsolute("http://localhost/index.html", richiesta);
>HTLog_addReferer(log_refer, richiesta, status);
>......
>The "log.txt" exists but it is always empty and the refferer field of the
>next request is not compiled. Thaks for the support

--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk
Received on Sunday, 19 July 1998 12:59:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT