You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2016/01/19 07:33:05 UTC
svn commit: r1725445 -
/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
Author: jailletc36
Date: Tue Jan 19 06:33:04 2016
New Revision: 1725445
URL: http://svn.apache.org/viewvc?rev=1725445&view=rev
Log:
No need to search twice for the same value.
Modified:
httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c?rev=1725445&r1=1725444&r2=1725445&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c Tue Jan 19 06:33:04 2016
@@ -127,7 +127,7 @@ static apr_status_t readfile_heartbeats(
hb_server_t *server;
char buf[4096];
apr_size_t bsize = sizeof(buf);
- const char *ip;
+ const char *ip, *val;
apr_brigade_cleanup(tmpbb);
@@ -180,20 +180,20 @@ static apr_status_t readfile_heartbeats(
argstr_to_table(pool, apr_pstrdup(pool, t), hbt);
- if (apr_table_get(hbt, "busy")) {
- server->busy = atoi(apr_table_get(hbt, "busy"));
+ if ((val = apr_table_get(hbt, "busy"))) {
+ server->busy = atoi(val);
}
- if (apr_table_get(hbt, "ready")) {
- server->ready = atoi(apr_table_get(hbt, "ready"));
+ if ((val = apr_table_get(hbt, "ready"))) {
+ server->ready = atoi(val);
}
- if (apr_table_get(hbt, "lastseen")) {
- server->seen = atoi(apr_table_get(hbt, "lastseen"));
+ if ((val = apr_table_get(hbt, "lastseen"))) {
+ server->seen = atoi(val);
}
- if (apr_table_get(hbt, "port")) {
- server->port = atoi(apr_table_get(hbt, "port"));
+ if ((val = apr_table_get(hbt, "port"))) {
+ server->port = atoi(val);
}
if (server->busy == 0 && server->ready != 0) {