]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/rssclient/serv_rssclient.c
Moved parse_url() into libcitadel; I will need it for
[citadel.git] / citadel / modules / rssclient / serv_rssclient.c
index 605b0772d70524977cae7784f783954ecf8784ea..2aaa140efaa0314a55bfc36e8edf1e71c8efab41 100644 (file)
@@ -97,10 +97,10 @@ void rss_save_item(struct rss_item *ri) {
        else {
                MD5Init(&md5context);
                if (ri->title != NULL) {
-                       MD5Update(&md5context, ri->title, strlen(ri->title));
+                       MD5Update(&md5context, (unsigned char*)ri->title, strlen(ri->title));
                }
                if (ri->link != NULL) {
-                       MD5Update(&md5context, ri->link, strlen(ri->link));
+                       MD5Update(&md5context, (unsigned char*)ri->link, strlen(ri->link));
                }
                MD5Final(rawdigest, &md5context);
                for (i=0; i<MD5_DIGEST_LEN; i++) {
@@ -331,61 +331,6 @@ void rss_xml_chardata(void *data, const XML_Char *s, int len) {
 
 
 
-/* 
- * Parse a URL into host, port number, and resource identifier.
- */
-int parse_url(char *url, char *hostname, int *port, char *identifier)
-{
-       char protocol[1024];
-       char scratch[1024];
-       char *ptr = NULL;
-       char *nptr = NULL;
-       
-       strcpy(scratch, url);
-       ptr = (char *)strchr(scratch, ':');
-       if (!ptr) {
-               return(1);      /* no protocol specified */
-       }
-
-       strcpy(ptr, "");
-       strcpy(protocol, scratch);
-       if (strcmp(protocol, "http")) {
-               return(2);      /* not HTTP */
-       }
-
-       strcpy(scratch, url);
-       ptr = (char *) strstr(scratch, "//");
-       if (!ptr) {
-               return(3);      /* no server specified */
-       }
-       ptr += 2;
-
-       strcpy(hostname, ptr);
-       nptr = (char *)strchr(ptr, ':');
-       if (!nptr) {
-               *port = 80;     /* default */
-               nptr = (char *)strchr(hostname, '/');
-       }
-       else {
-               sscanf(nptr, ":%d", port);
-               nptr = (char *)strchr(hostname, ':');
-       }
-
-       if (nptr) {
-               *nptr = '\0';
-       }
-
-       nptr = (char *)strchr(ptr, '/');
-       
-       if (!nptr) {
-               return(4);      /* no url specified */
-       }
-       
-       strcpy(identifier, nptr);
-       return(0);
-}
-
-
 /*
  * Begin a feed parse
  */