projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
I think I found a very small bug in rrd graph PDF output : the is_stream member of
[rrdtool.git]
/
src
/
rrd_cgi.c
diff --git
a/src/rrd_cgi.c
b/src/rrd_cgi.c
index
f6a5908
..
53c104f
100644
(file)
--- a/
src/rrd_cgi.c
+++ b/
src/rrd_cgi.c
@@
-128,9
+128,9
@@
int main(int argc, char *argv[]) {
server_url = getenv("SERVER_URL");
}
server_url = getenv("SERVER_URL");
}
- if (
optind != argc-1) {
-
fprintf(stderr, "ERROR: expected a filename\n");
-
exit(1);
+ if (
(optind != argc-2 && strstr(getenv("SERVER_SOFTWARE"),"Apache/2") != NULL) && optind != argc-1) {
+ fprintf(stderr, "ERROR: expected a filename\n");
+ exit(1);
} else {
length = readfile(argv[optind], &buffer, 1);
}
} else {
length = readfile(argv[optind], &buffer, 1);
}
@@
-253,6
+253,7
@@
char* includefile(long argc, char **args){
}
}
}
}
+static
char* rrdstrip(char *buf){
char *start;
if (buf == NULL) return NULL;
char* rrdstrip(char *buf){
char *start;
if (buf == NULL) return NULL;
@@
-412,7
+413,7
@@
char* printtimelast(long argc, char **args) {
rrd_clear_error();
return err;
}
rrd_clear_error();
return err;
}
-
tm_last = *localtime(&
last);
+
localtime_r(&last, &tm_
last);
strftime(buf,254,args[1],&tm_last);
return buf;
}
strftime(buf,254,args[1],&tm_last);
return buf;
}
@@
-431,7
+432,7
@@
char* printtimenow(long argc, char **args) {
if (buf == NULL){
return stralloc("[ERROR: allocating strftime buffer]");
};
if (buf == NULL){
return stralloc("[ERROR: allocating strftime buffer]");
};
-
tm_now = *localtime(&
now);
+
localtime_r(&now, &tm_
now);
strftime(buf,254,args[0],&tm_now);
return buf;
}
strftime(buf,254,args[0],&tm_now);
return buf;
}
@@
-442,6
+443,7
@@
char* printtimenow(long argc, char **args) {
}
/* scan aLine until an unescaped '>' arives */
}
/* scan aLine until an unescaped '>' arives */
+static
char* scanargs(char *aLine, long *argc, char ***args)
{
char *getP, *putP;
char* scanargs(char *aLine, long *argc, char ***args)
{
char *getP, *putP;
@@
-576,10
+578,10
@@
int parse(char **buf, long i, char *tag,
char *
http_time(time_t *now) {
char *
http_time(time_t *now) {
- struct tm
*
tmptime;
+ struct tm tmptime;
static char buf[60];
static char buf[60];
-
tmptime=gmtime(now
);
- strftime(buf,sizeof(buf),"%a, %d %b %Y %H:%M:%S GMT",tmptime);
+
gmtime_r(now, &tmptime
);
+ strftime(buf,sizeof(buf),"%a, %d %b %Y %H:%M:%S GMT",
&
tmptime);
return(buf);
}
return(buf);
}