You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/05/20 21:51:37 UTC
[1/2] trafficserver git commit: TS-3444 Eliminate unecessary stat()
call, CID 1200031
Repository: trafficserver
Updated Branches:
refs/heads/master 88056df2a -> 1dfd8c240
TS-3444 Eliminate unecessary stat() call, CID 1200031
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ac785337
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ac785337
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ac785337
Branch: refs/heads/master
Commit: ac785337bed674fa85932fd769db8e7c2ced63d5
Parents: 88056df
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon May 18 08:49:01 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed May 20 13:44:46 2015 -0600
----------------------------------------------------------------------
plugins/experimental/healthchecks/healthchecks.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ac785337/plugins/experimental/healthchecks/healthchecks.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/healthchecks.c b/plugins/experimental/healthchecks/healthchecks.c
index b811ba5..60398ca 100644
--- a/plugins/experimental/healthchecks/healthchecks.c
+++ b/plugins/experimental/healthchecks/healthchecks.c
@@ -108,19 +108,15 @@ typedef struct HCState_t {
static void
reload_status_file(HCFileInfo *info, HCFileData *data)
{
- struct stat buf;
+ FILE *fd;
memset(data, 0, sizeof(HCFileData));
- if (!stat(info->fname, &buf)) {
- FILE *fd;
-
- if (NULL != (fd = fopen(info->fname, "r"))) {
- data->exists = 1;
- do {
- data->b_len = fread(data->body, 1, MAX_BODY_LEN, fd);
- } while (!feof(fd)); /* Only save the last 16KB of the file ... */
- fclose(fd);
- }
+ if (NULL != (fd = fopen(info->fname, "r"))) {
+ data->exists = 1;
+ do {
+ data->b_len = fread(data->body, 1, MAX_BODY_LEN, fd);
+ } while (!feof(fd)); /* Only save the last 16KB of the file ... */
+ fclose(fd);
}
}
[2/2] trafficserver git commit: TS-3444 Make sure memory allocation
succeeded, CID 1200026
Posted by zw...@apache.org.
TS-3444 Make sure memory allocation succeeded, CID 1200026
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1dfd8c24
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1dfd8c24
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1dfd8c24
Branch: refs/heads/master
Commit: 1dfd8c2400672d2f22ec3d04888f0cce11ee119d
Parents: ac78533
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon May 18 08:57:19 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed May 20 13:44:53 2015 -0600
----------------------------------------------------------------------
plugins/regex_remap/regex_remap.cc | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1dfd8c24/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index cdae44a..113cefe 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -354,6 +354,7 @@ RemapRegex::initialize(const std::string ®, const std::string &sub, const std
if (TS_SUCCESS == TSHttpTxnConfigFind(opt_name.c_str(), opt_name.length(), &key, &type)) {
Override *cur = new Override;
+ TSReleaseAssert(cur);
switch (type) {
case TS_RECORDDATATYPE_INT:
cur->data.rec_int = strtoll(opt_val.c_str(), NULL, 10);
@@ -1077,19 +1078,3 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
return retval;
}
-
-
-/*
- local variables:
- mode: C++
- indent-tabs-mode: nil
- c-basic-offset: 2
- c-comment-only-line-offset: 0
- c-file-offsets: ((statement-block-intro . +)
- (label . 0)
- (statement-cont . +)
- (innamespace . 0))
- end:
-
- Indent with: /usr/bin/indent -ncs -nut -npcs -l 120 logstats.cc
-*/