-retry: CtdlLogPrintf(CTDL_NOTICE, "Connecting to <%s>\n", rsshost);
- sprintf(buf, "%d", rssport);
- sock = sock_connect(rsshost, buf, "tcp");
- if (sock >= 0) {
- CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- snprintf(buf, sizeof buf, "GET %s HTTP/1.0", rssurl);
- CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);
- sock_puts(sock, buf);
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- snprintf(buf, sizeof buf, "Host: %s", rsshost);
- CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);
- sock_puts(sock, buf);
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- snprintf(buf, sizeof buf, "User-Agent: %s", CITADEL);
- CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);
- sock_puts(sock, buf);
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- snprintf(buf, sizeof buf, "Accept: */*");
- CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);
- sock_puts(sock, buf);
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- sock_puts(sock, "");
-
- if (CtdlThreadCheckStop())
- goto shutdown ;
-
- if (sock_getln(sock, buf, sizeof buf) >= 0) {
- CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
- remove_token(buf, 0, ' ');
-
- /* 200 OK */
- if (buf[0] == '2') {
-
- while (got_bytes = sock_getln(sock, buf, sizeof buf),
- (got_bytes >= 0 && (strcmp(buf, "")) && (strcmp(buf, "\r"))) ) {
- if (CtdlThreadCheckStop())
- goto shutdown ;
- /* discard headers */
- }