#ifndef SQUID_RELEASE_TIME
#define SQUID_RELEASE_TIME squid_curtime
#endif
+
+#ifndef APP_SHORTNAME
+#define APP_SHORTNAME "squid"
+#endif
+#ifndef APP_FULLNAME
+#define APP_FULLNAME PACKAGE "/" VERSION
+#endif
-
/*
* $Id: AuthUser.cc,v 1.10 2007/12/14 23:11:45 amosjeffries Exp $
*
HttpVersion ver(1,0);
httpStatusLineSet(&sline, ver, status, httpStatusString(status));
hdr = &header;
- hdr->putStr(HDR_SERVER, full_appname_string);
+ hdr->putStr(HDR_SERVER, APP_FULLNAME);
hdr->putTime(HDR_DATE, squid_curtime);
hdr->putInt64(HDR_CONTENT_LENGTH, 0);
hdr->putStr(HDR_LOCATION, loc);
fdwAccess); /* specify access */
if (schService == NULL) {
- fprintf(stderr, "%s: ERROR: Could not open Service %s\n", appname,
+ fprintf(stderr, "%s: ERROR: Could not open Service %s\n", APP_SHORTNAME,
WIN32_Service_name);
exit(1);
} else {
fdwControl, /* control value to send */
&ssStatus)) { /* address of status info */
fprintf(stderr, "%s: ERROR: Could not Control Service %s\n",
- appname, WIN32_Service_name);
+ APP_SHORTNAME, WIN32_Service_name);
exit(1);
} else {
/* Print the service status. */
if (Config.onoff.httpd_suppress_version_string)
visible_appname_string = (char *)appname_string;
else
- visible_appname_string = (char *)full_appname_string;
+ visible_appname_string = (char const *)APP_FULLNAME;
#if USE_DNSSERVERS
{
assert(this);
const char *key;
- String b (full_appname_string);
- b.append (":",1);
+ String b(APP_FULLNAME);
+ b.append(":",1);
key = storeEntry()->getMD5Text();
b.append(key, strlen(key));
return b;
#if HAVE_SYSLOG && defined(LOG_LOCAL4)
if (opt_syslog_enable)
- openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility);
+ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility);
#endif /* HAVE_SYSLOG */
extern char config_input_line[BUFSIZ];
extern const char *DefaultConfigFile; /* DEFAULT_CONFIG_FILE */
extern const char *cfg_filename; /* NULL */
- extern const char *const appname; /* "squid" */
+//MOVED:version.h:APP_SHORTNAME extern const char *const appname; /* "squid" */
extern const char *const dash_str; /* "-" */
extern const char *const null_string; /* "" */
extern const char *const version_string; /* VERSION */
- extern const char *const full_appname_string; /* PACKAGE "/" VERSION */
+//MOVED:versions.h:APP_FULLNAME extern const char *const full_appname_string; /* PACKAGE "/" VERSION */
extern const char *const appname_string; /* PACKAGE */
- extern char * visible_appname_string;
extern const char *const w_space; /* " \t\n\r" */
+ extern char const * visible_appname_string; /* NULL */
extern const char *fdTypeStr[];
extern const char *hier_strings[];
extern const char *memStatusStr[];
" -V Virtual host httpd-accelerator.\n"
" -X Force full debugging.\n"
" -Y Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload.\n",
- appname, CACHE_HTTP_PORT, DefaultConfigFile, CACHE_ICP_PORT);
+ APP_SHORTNAME, CACHE_HTTP_PORT, DefaultConfigFile, CACHE_ICP_PORT);
exit(1);
}
} else
#ifdef _SQUID_MSWIN_
{
- fprintf(stderr, "%s: ERROR: Could not send ", appname);
+ fprintf(stderr, "%s: ERROR: Could not send ", APP_SHORTNAME);
fprintf(stderr, "signal to Squid Service:\n");
fprintf(stderr, "missing -n command line switch.\n");
exit(1);
if (kill(pid, opt_send_signal) &&
/* ignore permissions if just running check */
!(opt_send_signal == 0 && errno == EPERM)) {
- fprintf(stderr, "%s: ERROR: Could not send ", appname);
+ fprintf(stderr, "%s: ERROR: Could not send ", APP_SHORTNAME);
fprintf(stderr, "signal %d to process %d: %s\n",
opt_send_signal, (int) pid, xstrerror());
exit(1);
}
} else {
- fprintf(stderr, "%s: ERROR: No running copy\n", appname);
+ fprintf(stderr, "%s: ERROR: No running copy\n", APP_SHORTNAME);
exit(1);
}
if (*(argv[0]) == '(')
return;
- openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
+ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
if ((pid = fork()) < 0)
syslog(LOG_ALERT, "fork failed: %s", xstrerror());
if ((pid = fork()) == 0) {
/* child */
- openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
+ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
prog = xstrdup(argv[0]);
argv[0] = xstrdup("(squid)");
execvp(prog, argv);
}
/* parent */
- openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
+ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
syslog(LOG_NOTICE, "Squid Parent: child process %d started", pid);
case CONF_VERSION:
Answer = snmp_var_new(Var->name, Var->name_length);
Answer->type = ASN_OCTET_STR;
- Answer->val_len = strlen(appname);
- Answer->val.string = (u_char *) xstrdup(appname);
+ Answer->val_len = strlen(APP_SHORTNAME);
+ Answer->val.string = (u_char *) xstrdup(APP_SHORTNAME);
break;
case CONF_VERSION_ID:
storeAppendPrintf(sentry, "Current Time:\t%s\n",
mkrfc1123(current_time.tv_sec));
- storeAppendPrintf(sentry, "Connection information for %s:\n",
- appname);
+ storeAppendPrintf(sentry, "Connection information for %s:\n",APP_SHORTNAME);
storeAppendPrintf(sentry, "\tNumber of clients accessing cache:\t%u\n",
statCounter.client_http.clients);
storeAppendPrintf(sentry, "\tSelect loop called: %d times, %0.3f ms avg\n",
statCounter.select_loops, 1000.0 * runtime / statCounter.select_loops);
- storeAppendPrintf(sentry, "Cache information for %s:\n",
- appname);
+ storeAppendPrintf(sentry, "Cache information for %s:\n",APP_SHORTNAME);
storeAppendPrintf(sentry, "\tHits as %% of all requests:\t5min: %3.1f%%, 60min: %3.1f%%\n",
statRequestHitRatio(5),
cputime = rusage_cputime(&rusage);
- storeAppendPrintf(sentry, "Resource usage for %s:\n", appname);
+ storeAppendPrintf(sentry, "Resource usage for %s:\n", APP_SHORTNAME);
storeAppendPrintf(sentry, "\tUP Time:\t%.3f seconds\n", runtime);
ms = mstats();
- storeAppendPrintf(sentry, "Memory usage for %s via mstats():\n",
- appname);
+ storeAppendPrintf(sentry, "Memory usage for %s via mstats():\n",APP_SHORTNAME);
storeAppendPrintf(sentry, "\tTotal space in arena: %6d KB\n",
ms.bytes_total >> 10);
mp = mallinfo();
- storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n",
- appname);
+ storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n",APP_SHORTNAME);
storeAppendPrintf(sentry, "\tTotal space in arena: %6ld KB\n",
(long)mp.arena >> 10);
mp_stats.TheMeter->gb_freed.count);
}
- storeAppendPrintf(sentry, "File descriptor usage for %s:\n", appname);
+ storeAppendPrintf(sentry, "File descriptor usage for %s:\n", APP_SHORTNAME);
storeAppendPrintf(sentry, "\tMaximum number of file descriptors: %4d\n",
Squid_MaxFD);
storeAppendPrintf(sentry, "\tLargest file desc currently in use: %4d\n",
/* garh garh */
storeReplAdd("lru", createRemovalPolicy_lru);
- visible_appname_string = xstrdup(PACKAGE "/" VERSION);
+ visible_appname_string = xstrdup(APP_FULLNAME);
Mem::Init();
/* garh garh */
storeReplAdd("lru", createRemovalPolicy_lru);
- visible_appname_string = xstrdup(PACKAGE "/" VERSION);
+ visible_appname_string = xstrdup(APP_FULLNAME);
Mem::Init();
char *filename;
- if ((filename = tempnam(NULL, appname)) == NULL)
+ if ((filename = tempnam(NULL, APP_SHORTNAME)) == NULL)
return;
if ((fp = fopen(filename, "w")) == NULL)
if (Config.EmailFrom)
fprintf(fp, "From: %s\n", Config.EmailFrom);
else
- fprintf(fp, "From: %s@%s\n", appname, uniqueHostname());
+ fprintf(fp, "From: %s@%s\n", APP_SHORTNAME, uniqueHostname());
fprintf(fp, "To: %s\n", Config.adminEmail);
mp = mallinfo();
- fprintf(debug_log, "Memory usage for %s via mallinfo():\n", appname);
+ fprintf(debug_log, "Memory usage for "APP_SHORTNAME" via mallinfo():\n");
fprintf(debug_log, "\ttotal space in arena: %6ld KB\n",
(long)mp.arena >> 10);
int i;
if (f == NULL || !strcmp(Config.pidFilename, "none")) {
- fprintf(stderr, "%s: ERROR: No pid file name defined\n", appname);
+ fprintf(stderr, APP_SHORTNAME ": ERROR: No pid file name defined\n");
exit(1);
}
fclose(pid_fp);
} else {
if (errno != ENOENT) {
- fprintf(stderr, "%s: ERROR: Could not read pid file\n", appname);
+ fprintf(stderr, APP_SHORTNAME ": ERROR: Could not read pid file\n");
fprintf(stderr, "\t%s: %s\n", f, xstrerror());
exit(1);
}
"<ADDRESS>\n"
"Generated by %s@%s\n"
"</ADDRESS>\n",
- full_appname_string, getMyHostname());
+ APP_FULLNAME, getMyHostname());
rep = new HttpReply;
rep->setHeaders(version, HTTP_MOVED_TEMPORARILY, NULL,
"text/html", mb->contentSize(), 0, squid_curtime);