You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2014/07/14 22:43:24 UTC
[04/11] git commit: TS-1475: fix clang warnings - remove defaults
TS-1475: fix clang warnings - remove defaults
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/92f8a885
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/92f8a885
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/92f8a885
Branch: refs/heads/master
Commit: 92f8a88538468f1c97c3c9f0ed978da3208a1aed
Parents: 6c95b89
Author: JvD <ja...@cable.comcast.com>
Authored: Mon Jul 14 13:35:22 2014 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Mon Jul 14 14:43:08 2014 -0600
----------------------------------------------------------------------
example/secure-link/secure-link.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/92f8a885/example/secure-link/secure-link.c
----------------------------------------------------------------------
diff --git a/example/secure-link/secure-link.c b/example/secure-link/secure-link.c
index 6af254d..54b6e4b 100644
--- a/example/secure-link/secure-link.c
+++ b/example/secure-link/secure-link.c
@@ -78,16 +78,10 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo* rri)
} while((ptr = strtok(NULL, "&")) != NULL);
} else {
TSError("strtok didn't find a & in the query string");
- /* this is just example, so set fake params to prevent plugin crash */
- token = TSstrdup("d41d8cd98f00b204e9800998ecf8427e");
- expire = TSstrdup("00000000");
}
TSfree(s);
} else {
TSError("TSUrlHttpQueryGet returns empty value");
- /* this is just example, so set fake params to prevent plugin crash */
- token = TSstrdup("d41d8cd98f00b204e9800998ecf8427e");
- expire = TSstrdup("00000000");
}
ph = TSUrlPathGet(rri->requestBufp, rri->requestUrl, &len);
@@ -106,8 +100,10 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo* rri)
MD5_Init(&ctx);
MD5_Update(&ctx, sli->secret, strlen(sli->secret));
MD5_Update(&ctx, ip, strlen(ip));
- MD5_Update(&ctx, path, strlen(path));
- MD5_Update(&ctx, expire, strlen(expire));
+ if (path)
+ MD5_Update(&ctx, path, strlen(path));
+ if (expire)
+ MD5_Update(&ctx, expire, strlen(expire));
MD5_Final(md, &ctx);
for(i = 0; i < MD5_DIGEST_LENGTH; i++) {
sprintf(&hash[i * 2], "%02x", md[i]);