Changeset 5113:48625b8141d7
- Timestamp:
- 2007-04-10 16:22:08 (21 months ago)
- Author:
- Brendan Cully <brendan@…>
- Branch:
- HEAD
- Message:
-
Simplify body cache path creation
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5034
|
r5113
|
|
| 58 | 58 | */ |
| 59 | 59 | url.path = NULL; |
| 60 | | if (url_ciss_tostring (&url, host, sizeof (host), 0) < 0) |
| | 60 | if (url_ciss_tostring (&url, host, sizeof (host), U_PATH) < 0) |
| 61 | 61 | { |
| 62 | 62 | dprint (1, (debugfile, "bcache_path: URL to string failed\n")); |
| … |
… |
|
| 65 | 65 | |
| 66 | 66 | dprint (3, (debugfile, "bcache_path: URL: '%s'\n", host)); |
| 67 | | |
| 68 | | /* transform URL scheme:// to scheme: */ |
| 69 | | for (s = p = host; *s; s++) |
| 70 | | /* keep trailing slash */ |
| 71 | | if (*s != '/' || *(s + 1) == '\0') |
| 72 | | *p++ = *s; |
| 73 | | *p = '\0'; |
| 74 | 67 | |
| 75 | 68 | len = snprintf (dst, dstlen-1, "%s/%s%s%s", MessageCachedir, |
-
|
r4919
|
r5113
|
|
| 185 | 185 | if (ciss->host) |
| 186 | 186 | { |
| 187 | | safe_strcat (dest, len, "//"); |
| | 187 | if (!(flags & U_PATH)) |
| | 188 | safe_strcat (dest, len, "//"); |
| 188 | 189 | len -= (l = strlen (dest)); dest += l; |
| 189 | 190 | |
-
|
r4919
|
r5113
|
|
| 17 | 17 | |
| 18 | 18 | #define U_DECODE_PASSWD (1) |
| | 19 | #define U_PATH (1 << 1) |
| 19 | 20 | |
| 20 | 21 | typedef struct ciss_url |