/*
- * $Id: authenticate.cc,v 1.30 2001/10/03 20:12:47 hno Exp $
+ * $Id: authenticate.cc,v 1.31 2001/10/17 20:25:01 hno Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
* called to add another auth scheme module
*/
void
-authSchemeAdd(char *type, AUTHSSETUP * setup)
+authSchemeAdd(const char *type, AUTHSSETUP * setup)
{
int i;
debug(29, 4) ("authSchemeAdd: adding %s\n", type);
/*
- * $Id: cachemgr.cc,v 1.89 2001/08/31 11:19:12 robertc Exp $
+ * $Id: cachemgr.cc,v 1.90 2001/10/17 20:25:01 hno Exp $
*
* DEBUG: section 0 CGI Cache Manager
* AUTHOR: Duane Wessels
*/
#define safe_free(str) { if (str) { xfree(str); (str) = NULL; } }
static const char *safe_str(const char *str);
-static char *xstrtok(char **str, char del);
+static const char *xstrtok(char **str, char del);
static void print_trailer(void);
-static void auth_html(char *host, int port, const char *user_name);
+static void auth_html(const char *host, int port, const char *user_name);
static void error_html(const char *msg);
static char *menu_url(cachemgr_request * req, const char *action);
static int parse_status_line(const char *sline, const char **statusStr);
return strspn(str, "\t -+01234567890./\n") == strlen(str);
}
-static char *
+static const char *
xstrtok(char **str, char del)
{
if (*str) {
}
static void
-auth_html(char *host, int port, const char *user_name)
+auth_html(const char *host, int port, const char *user_name)
{
if (!user_name)
user_name = "";
/*
- * $Id: client.cc,v 1.93 2001/02/23 20:59:50 hno Exp $
+ * $Id: client.cc,v 1.94 2001/10/17 20:25:01 hno Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
#endif
/* Local functions */
-static int client_comm_bind(int, char *);
-static int client_comm_connect(int, char *, u_short, struct timeval *);
+static int client_comm_bind(int, const char *);
+static int client_comm_connect(int, const char *, u_short, struct timeval *);
static void usage(const char *progname);
static int Now(struct timeval *);
static SIGHDLR catch;
int keep_alive = 0;
int opt_noaccept = 0;
int opt_verbose = 0;
- char *hostname, *localhost;
+ const char *hostname, *localhost;
char url[BUFSIZ], msg[BUFSIZ], buf[BUFSIZ];
char extra_hdrs[BUFSIZ];
const char *method = "GET";
}
static int
-client_comm_bind(int sock, char *local_host)
+client_comm_bind(int sock, const char *local_host)
{
static const struct hostent *hp = NULL;
static struct sockaddr_in from_addr;
}
static int
-client_comm_connect(int sock, char *dest_host, u_short dest_port, struct timeval *tvp)
+client_comm_connect(int sock, const char *dest_host, u_short dest_port, struct timeval *tvp)
{
static const struct hostent *hp = NULL;
static struct sockaddr_in to_addr;
/*
- * $Id: client_side.cc,v 1.547 2001/10/12 23:33:01 hno Exp $
+ * $Id: client_side.cc,v 1.548 2001/10/17 20:25:01 hno Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
if (opt_accel_uses_host && (t = mime_get_header(req_hdr, "Host"))) {
int vport;
char *q;
- char *protocol_name = "http";
+ const char *protocol_name = "http";
if (vport_mode)
vport = (int) ntohs(http->conn->me.sin_port);
else
/*
- * $Id: comm.cc,v 1.321 2001/10/10 15:17:40 adrian Exp $
+ * $Id: comm.cc,v 1.322 2001/10/17 20:25:01 hno Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
/* Select for Writing on FD, until SIZE bytes are sent. Call
* *HANDLER when complete. */
void
-comm_write(int fd, char *buf, int size, CWCB * handler, void *handler_data, FREE * free_func)
+comm_write(int fd, const char *buf, int size, CWCB * handler, void *handler_data, FREE * free_func)
{
CommWriteStateData *state = fd_table[fd].rwstate;
debug(5, 5) ("comm_write: FD %d: sz %d: hndl %p: data %p.\n",
fd_table[fd].rwstate = NULL;
}
fd_table[fd].rwstate = state = memPoolAlloc(comm_write_pool);
- state->buf = buf;
+ state->buf = (char *) buf;
state->size = size;
state->offset = 0;
state->handler = handler;
/*
- * $Id: ftp.cc,v 1.312 2001/10/10 15:17:41 adrian Exp $
+ * $Id: ftp.cc,v 1.313 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
static void ftpUnhack(FtpStateData * ftpState);
static void ftpScheduleReadControlReply(FtpStateData *, int);
static void ftpHandleControlReply(FtpStateData *);
-static char *ftpHtmlifyListEntry(char *line, FtpStateData * ftpState);
+static char *ftpHtmlifyListEntry(const char *line, FtpStateData * ftpState);
static void ftpFailed(FtpStateData *, err_type);
static void ftpFailedErrorMessage(FtpStateData *, err_type);
}
static char *
-ftpHtmlifyListEntry(char *line, FtpStateData * ftpState)
+ftpHtmlifyListEntry(const char *line, FtpStateData * ftpState)
{
LOCAL_ARRAY(char, icon, 2048);
LOCAL_ARRAY(char, href, 2048 + 40);
return html;
}
if ((parts = ftpListParseParts(line, ftpState->flags)) == NULL) {
- char *p;
+ const char *p;
snprintf(html, 8192, "%s\n", line);
for (p = line; *p && xisspace(*p); p++);
if (*p && !xisspace(*p))
ftpFailedErrorMessage(FtpStateData * ftpState, err_type error)
{
ErrorState *err;
- char *command, *reply;
+ const char *command, *reply;
/* Translate FTP errors into HTTP errors */
err = NULL;
switch (error) {
static void
ftpAppendSuccessHeader(FtpStateData * ftpState)
{
- char *mime_type = NULL;
- char *mime_enc = NULL;
+ const char *mime_type = NULL;
+ const char *mime_enc = NULL;
String urlpath = ftpState->request->urlpath;
const char *filename = NULL;
const char *t = NULL;
/*
- * $Id: globals.h,v 1.107 2001/10/08 16:18:32 hno Exp $
+ * $Id: globals.h,v 1.108 2001/10/17 20:25:02 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern SquidConfig2 Config2;
extern char *ConfigFile; /* NULL */
extern char *IcpOpcodeStr[];
-extern char *dns_error_message; /* NULL */
+extern const char *dns_error_message; /* NULL */
extern const char *log_tags[];
extern char tmp_error_buf[ERROR_BUF_SZ];
extern char *volatile debug_options; /* NULL */
/*
- * $Id: helper.cc,v 1.30 2001/08/29 14:57:35 robertc Exp $
+ * $Id: helper.cc,v 1.31 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 29 Helper process maintenance
* AUTHOR: Harvest Derived?
char *progname;
char *shortname;
char *procname;
- char *args[HELPER_MAX_ARGS];
+ const char *args[HELPER_MAX_ARGS];
char fd_note_buf[FD_DESC_SZ];
helper_server *srv;
int nargs = 0;
char *progname;
char *shortname;
char *procname;
- char *args[HELPER_MAX_ARGS];
+ const char *args[HELPER_MAX_ARGS];
char fd_note_buf[FD_DESC_SZ];
helper_stateful_server *srv;
int nargs = 0;
/*
- * $Id: http.cc,v 1.382 2001/09/18 19:04:28 hno Exp $
+ * $Id: http.cc,v 1.383 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
if (*orig_request->peer_login == '*') {
/* Special mode, to pass the username to the upstream cache */
char loginbuf[256];
- char *username = "-";
+ const char *username = "-";
if (orig_request->auth_user_request)
username = authenticateUserRequestUsername(orig_request->auth_user_request);
snprintf(loginbuf, sizeof(loginbuf), "%s%s", username, orig_request->peer_login + 1);
/*
- * $Id: ipc.cc,v 1.25 2001/10/17 19:43:39 hno Exp $
+ * $Id: ipc.cc,v 1.26 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 54 Interprocess Communication
* AUTHOR: Duane Wessels
#if HAVE_SETSID
setsid();
#endif
- execvp(prog, args);
+ execvp(prog, (char *const *) args);
debug_log = fdopen(2, "a+");
debug(50, 0) ("ipcCreate: %s: %s\n", prog, xstrerror());
_exit(1);
/*
- * $Id: neighbors.cc,v 1.298 2001/10/10 15:17:41 adrian Exp $
+ * $Id: neighbors.cc,v 1.299 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
static int NLateReplies = 0;
static peer *first_ping = NULL;
-char *
+const char *
neighborTypeStr(const peer * p)
{
if (p->type == PEER_NONE)
/*
- * $Id: peer_select.cc,v 1.115 2001/04/14 00:25:18 hno Exp $
+ * $Id: peer_select.cc,v 1.116 2001/10/17 20:25:02 hno Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
int timeouts;
} PeerStats;
-static char *DirectStr[] =
+static const char *DirectStr[] =
{
"DIRECT_UNKNOWN",
"DIRECT_NO",
/*
- * $Id: protos.h,v 1.417 2001/10/17 19:43:39 hno Exp $
+ * $Id: protos.h,v 1.418 2001/10/17 20:25:03 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern void comm_remove_close_handler(int fd, PF *, void *);
extern int comm_udp_sendto(int, const struct sockaddr_in *, int, const void *, int);
extern void comm_write(int fd,
- char *buf,
+ const char *buf,
int size,
CWCB * handler,
void *handler_data,
extern void peerNoteDigestGone(peer * p);
extern int neighborUp(const peer * e);
extern CBDUNL peerDestroy;
-extern char *neighborTypeStr(const peer * e);
+extern const char *neighborTypeStr(const peer * e);
extern peer_t neighborType(const peer *, const request_t *);
extern void peerConnectFailed(peer *);
extern void peerConnectSucceded(peer *);
extern char *authenticateUserRequestUsername(auth_user_request_t *);
extern int authenticateValidateUser(auth_user_request_t *);
extern void authenticateOnCloseConnection(ConnStateData * conn);
-extern void authSchemeAdd(char *type, AUTHSSETUP * setup);
+extern void authSchemeAdd(const char *type, AUTHSSETUP * setup);
extern void refreshAddToList(const char *, int, time_t, int, time_t);
extern int refreshIsCachable(const StoreEntry *);
extern void storeSwapFileNumberSet(StoreEntry * e, sfileno filn);
extern void storeFsInit(void);
extern void storeFsDone(void);
-extern void storeFsAdd(char *, STSETUP *);
-extern void storeReplAdd(char *, REMOVALPOLICYCREATE *);
+extern void storeFsAdd(const char *, STSETUP *);
+extern void storeReplAdd(const char *, REMOVALPOLICYCREATE *);
/* store_modules.c */
extern void storeFsSetup(void);
extern double doubleAverage(double, double, int, int);
extern void debug_trap(const char *);
extern void logsFlush(void);
-extern char *checkNullString(char *p);
+extern const char *checkNullString(const char *p);
extern void squid_getrusage(struct rusage *r);
extern double rusage_cputime(struct rusage *r);
extern int rusage_maxrss(struct rusage *r);
/*
- * $Id: snmp_agent.cc,v 1.81 2001/08/31 11:19:12 robertc Exp $
+ * $Id: snmp_agent.cc,v 1.82 2001/10/17 20:25:03 hno Exp $
*
* DEBUG: section 49 SNMP Interface
* AUTHOR: Kostas Anagnostakis
snmp_confFn(variable_list * Var, snint * ErrP)
{
variable_list *Answer = NULL;
- char *cp = NULL;
+ const char *cp = NULL;
debug(49, 5) ("snmp_confFn: Processing request with magic %d!\n", Var->name[8]);
*ErrP = SNMP_ERR_NOERROR;
switch (Var->name[LEN_SQ_CONF]) {
/*
- * $Id: store.cc,v 1.541 2001/09/07 18:02:46 adrian Exp $
+ * $Id: store.cc,v 1.542 2001/10/17 20:25:03 hno Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
* called to add another store fs module
*/
void
-storeFsAdd(char *type, STSETUP * setup)
+storeFsAdd(const char *type, STSETUP * setup)
{
int i;
/* find the number of currently known storefs types */
* called to add another store removal policy module
*/
void
-storeReplAdd(char *type, REMOVALPOLICYCREATE * create)
+storeReplAdd(const char *type, REMOVALPOLICYCREATE * create)
{
int i;
/* find the number of currently known repl types */
/*
- * $Id: store_log.cc,v 1.22 2001/02/17 07:28:50 hno Exp $
+ * $Id: store_log.cc,v 1.23 2001/10/17 20:25:03 hno Exp $
*
* DEBUG: section 20 Storage Manager Logging Functions
* AUTHOR: Duane Wessels
#include "squid.h"
-static char *storeLogTags[] =
+static const char *storeLogTags[] =
{
"CREATE",
"SWAPIN",
/*
- * $Id: structs.h,v 1.404 2001/10/17 19:43:39 hno Exp $
+ * $Id: structs.h,v 1.405 2001/10/17 20:25:03 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
*/
struct _authscheme_entry {
- char *typestr;
+ const char *typestr;
AUTHSACTIVE *Active;
AUTHSADDHEADER *AddHeader;
AUTHSADDTRAILER *AddTrailer;
/* private data types */
struct _authScheme {
/* pointer to the authscheme_list's string entry */
- char *typestr;
+ const char *typestr;
/* the scheme id in the authscheme_list */
int Id;
/* the scheme's configuration details. */
};
struct _SwapDir {
- char *type;
+ const char *type;
int cur_size;
int low_size;
int max_size;
};
struct _refresh_t {
- char *pattern;
+ const char *pattern;
regex_t compiled_pattern;
time_t min;
double pct;
*/
struct _storefs_entry {
- char *typestr;
+ const char *typestr;
STFSPARSE *parsefunc;
STFSRECONFIGURE *reconfigurefunc;
STFSSHUTDOWN *donefunc;
*/
struct _storerepl_entry {
- char *typestr;
+ const char *typestr;
REMOVALPOLICYCREATE *create;
};
/*
- * $Id: tools.cc,v 1.209 2001/08/16 00:16:19 hno Exp $
+ * $Id: tools.cc,v 1.210 2001/10/17 20:25:03 hno Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
fflush(debug_log);
}
-char *
-checkNullString(char *p)
+const char *
+checkNullString(const char *p)
{
return p ? p : "(NULL)";
}
/*
- * $Id: unlinkd.cc,v 1.43 2001/02/23 20:59:51 hno Exp $
+ * $Id: unlinkd.cc,v 1.44 2001/10/17 20:25:03 hno Exp $
*
* DEBUG: section 12 Unlink Daemon
* AUTHOR: Duane Wessels
unlinkdInit(void)
{
int x;
- char *args[2];
+ const char *args[2];
struct timeval slp;
args[0] = "(unlinkd)";
args[1] = NULL;