Revision: 14693
Author: adrian.chadd
Date: Sun May 23 06:02:25 2010
Log: break out urlIsRelative() into libsqurl.


http://code.google.com/p/lusca-cache/source/detail?r=14693

Modified:
 /branches/LUSCA_HEAD/libsqurl/url.c
 /branches/LUSCA_HEAD/libsqurl/url.h
 /branches/LUSCA_HEAD/src/protos.h
 /branches/LUSCA_HEAD/src/url.c

=======================================
--- /branches/LUSCA_HEAD/libsqurl/url.c Sun May 23 00:33:46 2010
+++ /branches/LUSCA_HEAD/libsqurl/url.c Sun May 23 06:02:25 2010
@@ -34,3 +34,28 @@
     return url;
 }

+/*
+ * Test if a URL is relative.
+ *
+ * RFC 2396, Section 5 (Page 17) implies that in a relative URL, a '/' will
+ * appear before a ':'.
+ */
+int
+urlIsRelative(const char *url)
+{
+    const char *p;
+
+    if (url == NULL) {
+        return (0);
+    }
+    if (*url == '\0') {
+        return (0);
+    }
+    for (p = url; *p != '\0' && *p != ':' && *p != '/'; p++);
+
+    if (*p == ':') {
+        return (0);
+    }
+    return (1);
+}
+
=======================================
--- /branches/LUSCA_HEAD/libsqurl/url.h Sun May 23 00:33:46 2010
+++ /branches/LUSCA_HEAD/libsqurl/url.h Sun May 23 06:02:25 2010
@@ -2,5 +2,6 @@
 #define        __LUSCA_LIBSQURL_URL_H__

 extern char * url_convert_hex(char *org_url, int allocate);
+extern int urlIsRelative(const char *url);

 #endif
=======================================
--- /branches/LUSCA_HEAD/src/protos.h   Sun May 23 05:26:34 2010
+++ /branches/LUSCA_HEAD/src/protos.h   Sun May 23 06:02:25 2010
@@ -786,7 +786,6 @@
 extern void urlInitialize(void);
 extern request_t *urlParse(method_t *, char *);
 extern const char *urlCanonical(request_t *);
-extern int urlIsRelative(const char *);
 extern char *urlMakeAbsolute(request_t *, const char *);
extern char *urlRInternal(const char *host, u_short port, const char *dir, const char *name);
 extern char *urlInternal(const char *dir, const char *name);
=======================================
--- /branches/LUSCA_HEAD/src/url.c      Sun May 23 05:26:34 2010
+++ /branches/LUSCA_HEAD/src/url.c      Sun May 23 06:02:25 2010
@@ -289,31 +289,6 @@
     }
     return (request->canonical = xstrdup(urlbuf));
 }
-
-/*
- * Test if a URL is relative.
- *
- * RFC 2396, Section 5 (Page 17) implies that in a relative URL, a '/' will
- * appear before a ':'.
- */
-int
-urlIsRelative(const char *url)
-{
-    const char *p;
-
-    if (url == NULL) {
-       return (0);
-    }
-    if (*url == '\0') {
-       return (0);
-    }
-    for (p = url; *p != '\0' && *p != ':' && *p != '/'; p++);
-
-    if (*p == ':') {
-       return (0);
-    }
-    return (1);
-}

 /*
  * Convert a relative URL to an absolute URL using the context of a given

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to