Added the User-Agent: and Accept: headers to our
authorArt Cancro <ajc@citadel.org>
Thu, 8 Nov 2007 15:22:01 +0000 (15:22 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 8 Nov 2007 15:22:01 +0000 (15:22 +0000)
HTTP client requests.  Some HTTP servers (such as www.digg.com)
simply disconnect without any response if they are not present.

citadel/modules/rssclient/serv_rssclient.c

index 8ba42762c249f75599f9552b367241d47ca566b9..0b32fda89f4c8b3e15eec509d293a833bdc1ec12 100644 (file)
@@ -426,6 +426,14 @@ retry:     lprintf(CTDL_NOTICE, "Connecting to <%s>\n", rsshost);
                lprintf(CTDL_DEBUG, "<%s\n", buf);
                sock_puts(sock, buf);
 
+               snprintf(buf, sizeof buf, "User-Agent: %s", CITADEL);
+               lprintf(CTDL_DEBUG, "<%s\n", buf);
+               sock_puts(sock, buf);
+
+               snprintf(buf, sizeof buf, "Accept: */*");
+               lprintf(CTDL_DEBUG, "<%s\n", buf);
+               sock_puts(sock, buf);
+
                sock_puts(sock, "");
 
                if (sock_getln(sock, buf, sizeof buf) >= 0) {