diff -r a50076297212 src/IO/dpi.c
--- a/src/IO/dpi.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/IO/dpi.c Fri Apr 26 22:17:38 2013 +0000
@@ -356,9 +356,9 @@
if (execl(path1, "dpid", (char*)NULL) == -1) {
dFree(path1);
if (execlp("dpid", "dpid", (char*)NULL) == -1) {
- MSG("Dpi_start_dpid (child): %s\n", dStrerror(errno));
+ MSG_WARN("Dpi_start_dpid (child): %s\n", dStrerror(errno));
if (Dpi_blocking_write(st_pipe[1], "ERROR", 5) == -1) {
- MSG("Dpi_start_dpid (child): can't write to pipe.\n");
+ MSG_WARN("Dpi_start_dpid (child): can't write to pipe.\n");
}
dClose(st_pipe[1]);
_exit (EXIT_FAILURE);
@@ -367,7 +367,7 @@
}
} else if (pid < 0) {
/* The fork failed. Report failure. */
- MSG("Dpi_start_dpid: %s\n", dStrerror(errno));
+ MSG_WARN("Dpi_start_dpid: %s\n", dStrerror(errno));
/* close the unused pipe */
dClose(st_pipe[0]);
dClose(st_pipe[1]);
@@ -375,7 +375,7 @@
/* This is the parent process, check our child status... */
dClose(st_pipe[1]);
if ((answer = Dpi_blocking_read(st_pipe[0])) != NULL) {
- MSG("Dpi_start_dpid: can't start dpid\n");
+ MSG_WARN("Dpi_start_dpid: can't start dpid\n");
dFree(answer);
} else {
ret = 0;
@@ -449,9 +449,10 @@
if (Dpi_read_comm_keys(&dpid_port) != -1) {
sin.sin_port = htons(dpid_port);
if ((sock_fd = Dpi_make_socket_fd()) == -1) {
- MSG("Dpi_check_dpid_ids: sock_fd=%d %s\n", sock_fd, dStrerror(errno));
+ MSG_INFO("Dpi_check_dpid_ids: sock_fd=%d %s\n", sock_fd,
+ dStrerror(errno));
} else if (connect(sock_fd, (struct sockaddr *)&sin, sin_sz) == -1) {
- MSG("Dpi_check_dpid_ids: %s\n", dStrerror(errno));
+ MSG_INFO("Dpi_check_dpid_ids: %s\n", dStrerror(errno));
} else {
dClose(sock_fd);
ret = 1;
@@ -547,7 +548,7 @@
sin.sin_port = htons(dpid_port);
if ((sock_fd = Dpi_make_socket_fd()) == -1 ||
connect(sock_fd, (struct sockaddr *)&sin, sin_sz) == -1) {
- MSG("Dpi_get_server_port: %s\n", dStrerror(errno));
+ MSG_WARN("Dpi_get_server_port: %s\n", dStrerror(errno));
} else {
ok = 1;
}
@@ -559,7 +560,7 @@
_MSG("[%s]\n", request);
if (Dpi_blocking_write(sock_fd, request, strlen(request)) == -1) {
- MSG("Dpi_get_server_port: %s\n", dStrerror(errno));
+ MSG_WARN("Dpi_get_server_port: %s\n", dStrerror(errno));
} else {
ok = 1;
}
@@ -569,7 +570,7 @@
/* Get the reply */
ok = 0;
if ((rply = Dpi_blocking_read(sock_fd)) == NULL) {
- MSG("Dpi_get_server_port: can't read server port from dpid.\n");
+ MSG_WARN("Dpi_get_server_port: can't read server port from dpid.\n");
} else {
ok = 1;
}
@@ -622,7 +623,7 @@
if ((sock_fd = Dpi_make_socket_fd()) == -1) {
perror("[dpi::socket]");
} else if (connect(sock_fd, (void*)&sin, sizeof(sin)) == -1) {
- MSG("[dpi::connect] errno:%d %s\n", errno, dStrerror(errno));
+ MSG_WARN("[dpi::connect] errno:%d %s\n", errno, dStrerror(errno));
/* send authentication Key (the server closes sock_fd on auth error) */
} else if (!(cmd = a_Dpip_build_cmd("cmd=%s msg=%s", "auth", SharedKey))) {
diff -r a50076297212 src/IO/http.c
--- a/src/IO/http.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/IO/http.c Fri Apr 26 22:17:38 2013 +0000
@@ -393,7 +393,7 @@
for (i = 0; (dh = dList_nth_data(S->addr_list, i)); ++i) {
if ((S->SockFD = socket(dh->af, SOCK_STREAM, IPPROTO_TCP)) < 0) {
S->Err = errno;
- MSG("Http_connect_socket ERROR: %s\n", dStrerror(errno));
+ MSG_WARN("Http_connect_socket ERROR: %s\n", dStrerror(errno));
continue;
}
/* set NONBLOCKING and close on exec. */
@@ -438,7 +438,7 @@
if (status == -1 && errno != EINPROGRESS) {
S->Err = errno;
dClose(S->SockFD);
- MSG("Http_connect_socket ERROR: %s\n", dStrerror(S->Err));
+ MSG_WARN("Http_connect_socket ERROR: %s\n", dStrerror(S->Err));
} else {
a_Chain_bcb(OpSend, Info, &S->SockFD, "FD");
a_Chain_fcb(OpSend, Info, &S->SockFD, "FD");
diff -r a50076297212 src/auth.c
--- a/src/auth.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/auth.c Fri Apr 26 22:17:38 2013 +0000
@@ -180,7 +180,7 @@
token_size++;
}
if (token_size == 0) {
- MSG("Auth_parse_token_value: missing auth token\n");
+ MSG_WARN("Auth_parse_token_value: missing auth token\n");
return 0;
}
beyond_token = *auth;
@@ -195,11 +195,11 @@
break;
case '\0':
case ',':
- MSG("Auth_parse_token_value: missing auth token value\n");
+ MSG_WARN("Auth_parse_token_value: missing auth token value\n");
return 0;
break;
default:
- MSG("Auth_parse_token_value: garbage after auth token\n");
+ MSG_WARN("Auth_parse_token_value: garbage after auth token\n");
return 0;
break;
}
@@ -233,8 +233,8 @@
auth_parse->realm = strdup(value);
return 0; /* end parsing */
} else
- MSG("Auth_parse_basic_challenge_cb: Ignoring unknown parameter: %s = "
- "'%s'\n", token, value);
+ MSG_WARN("Auth_parse_basic_challenge_cb: Ignoring unknown parameter: "
+ "%s = '%s'\n", token, value);
return 1;
}
@@ -257,7 +257,7 @@
else if (dStrAsciiCasecmp("false", value) == 0)
auth_parse->stale = 0;
else {
- MSG("%s: Invalid stale value: %s\n", fn, value);
+ MSG_WARN("%s: Invalid stale value: %s\n", fn, value);
return 0;
}
} else if (strcmp("algorithm", token) == 0) {
@@ -265,11 +265,11 @@
auth_parse->algorithm = MD5;
else if (strcmp("MD5-sess", value) == 0) {
/* auth_parse->algorithm = MD5SESS; */
- MSG("%s: MD5-sess algorithm disabled (not tested because 'not "
- "correctly implemented yet' in Apache 2.2)\n", fn);
+ MSG_WARN("%s: MD5-sess algorithm disabled (not tested because 'not "
+ "correctly implemented yet' in Apache 2.2)\n", fn);
return 0;
} else {
- MSG("%s: Unknown algorithm: %s\n", fn, value);
+ MSG_WARN("%s: Unknown algorithm: %s\n", fn, value);
return 0;
}
} else if (strcmp("qop", token) == 0) {
@@ -282,10 +282,10 @@
if (len == 8 && strncmp("auth-int", value, 8) == 0) {
/* auth_parse->qop = AUTHINT; */
/* Keep searching; maybe we'll find an "auth" yet. */
- MSG("%s: auth-int qop disabled (not tested because 'not "
- "implemented yet' in Apache 2.2)\n", fn);
+ MSG_WARN("%s: auth-int qop disabled (not tested because 'not "
+ "implemented yet' in Apache 2.2)\n", fn);
} else {
- MSG("%s: Unknown qop value in %s\n", fn, value);
+ MSG_WARN("%s: Unknown qop value in %s\n", fn, value);
}
value += len;
while (*value == ' ' || *value == '\t')
@@ -296,7 +296,7 @@
value++;
}
} else {
- MSG("%s: Ignoring unknown parameter: %s = '%s'\n", fn, token, value);
+ MSG_WARN("%s: Ignoring unknown parameter: %s = '%s'\n", fn, token,value);
}
return 1;
}
@@ -322,14 +322,14 @@
if (auth_parse->realm) {
auth_parse->ok = 1;
} else {
- MSG("Auth_parse_challenge_args: missing Basic auth realm\n");
+ MSG_WARN("Auth_parse_challenge_args: missing Basic auth realm\n");
return;
}
} else if (auth_parse->type == DIGEST) {
if (auth_parse->realm && auth_parse->nonce) {
auth_parse->ok = 1;
} else {
- MSG("Auth_parse_challenge_args: Digest challenge incomplete\n");
+ MSG_WARN("Auth_parse_challenge_args: Digest challenge incomplete\n");
return;
}
}
@@ -481,7 +481,7 @@
else if (realm->type == DIGEST)
ret = a_Digest_authorization_hdr(realm, url, request_uri);
else
- MSG("a_Auth_get_auth_str() got an unknown realm type: %i.\n",
+ MSG_WARN("a_Auth_get_auth_str() got an unknown realm type: %i.\n",
realm->type);
}
return ret;
@@ -600,12 +600,12 @@
if (realm->qop != QOPNOTSET)
realm->cnonce = a_Digest_create_cnonce();
if (!a_Digest_compute_digest(realm, user, password)) {
- MSG("Auth_do_auth_dialog_cb: a_Digest_compute_digest failed.\n");
+ MSG_WARN("Auth_do_auth_dialog_cb: a_Digest_compute_digest failed.\n");
dList_remove_fast(host->realms, realm);
Auth_realm_delete(realm);
}
} else {
- MSG("Auth_do_auth_dialog_cb: Unknown auth type: %i\n",
+ MSG_WARN("Auth_do_auth_dialog_cb: Unknown auth type: %i\n",
realm->type);
}
dStrshred((char *)password);
diff -r a50076297212 src/bw.c
--- a/src/bw.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/bw.c Fri Apr 26 22:17:38 2013 +0000
@@ -231,7 +231,7 @@
if (len == 1)
doc = dList_nth_data(bw->Docs, 0);
else if (len > 1)
- MSG("a_Bw_get_current_doc() multiple docs not implemented\n");
+ MSG_WARN("a_Bw_get_current_doc() multiple docs not implemented\n");
return doc;
}
diff -r a50076297212 src/cache.c
--- a/src/cache.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/cache.c Fri Apr 26 22:17:38 2013 +0000
@@ -678,8 +678,8 @@
if (!a_Domain_permit(entry->Url, location_url)) {
/* don't redirect; just show body like usual (if any) */
- MSG("Redirection not followed from %s to %s\n",
- URL_HOST(entry->Url), URL_STR(location_url));
+ MSG_INFO("Redirection not followed from %s to %s\n",
+ URL_HOST(entry->Url), URL_STR(location_url));
a_Url_free(location_url);
} else {
entry->Flags |= CA_Redirect;
@@ -692,8 +692,8 @@
dStrAsciiCasecmp(URL_SCHEME(location_url), "dpi") == 0 &&
dStrAsciiCasecmp(URL_SCHEME(entry->Url), "dpi") != 0) {
/* Forbid dpi GET and POST from non dpi-generated urls */
- MSG("Redirection Denied! '%s' -> '%s'\n",
- URL_STR(entry->Url), URL_STR(location_url));
+ MSG_INFO("Redirection Denied! '%s' -> '%s'\n",
+ URL_STR(entry->Url), URL_STR(location_url));
a_Url_free(location_url);
} else {
entry->Location = location_url;
@@ -760,7 +760,8 @@
}
}
if (i >= dList_length(ClientQueue)) {
- MSG("Cache: cookies not accepted from '%s'\n", URL_STR(entry->Url));
+ MSG_INFO("Cache: cookies not accepted from '%s'\n",
+ URL_STR(entry->Url));
}
for (i = 0; (data = dList_nth_data(Cookies, i)); ++i)
@@ -907,8 +908,8 @@
(entry->ExpectedSize != entry->TransferSize)) {
MSG_HTTP("Content-Length does NOT match message body at\n"
"%s\n", URL_STR_(entry->Url));
- MSG("Expected size: %d, Transfer size: %d\n",
- entry->ExpectedSize, entry->TransferSize);
+ MSG_WARN("Expected size: %d, Transfer size: %d\n",
+ entry->ExpectedSize, entry->TransferSize);
}
if (!entry->TransferSize && !(entry->Flags & CA_Redirect) &&
(entry->Flags & WEB_RootUrl)) {
@@ -939,7 +940,7 @@
}
} else if (Op == IOAbort) {
/* unused */
- MSG("a_Cache_process_dbuf Op = IOAbort; not implemented!\n");
+ MSG_WARN("a_Cache_process_dbuf Op = IOAbort; not implemented!\n");
}
}
@@ -1181,7 +1182,7 @@
if (st == -1) {
/* MIME type is not viewable */
if (ClientWeb->flags & WEB_RootUrl) {
- MSG("Content-Type '%s' not viewable.\n", curr_type);
+ MSG_WARN("Content-Type '%s' not viewable.\n", curr_type);
/* prepare a download offer... */
AbortEntry = OfferDownload = TRUE;
} else {
diff -r a50076297212 src/capi.c
--- a/src/capi.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/capi.c Fri Apr 26 22:17:38 2013 +0000
@@ -250,10 +250,10 @@
}
if (!allow) {
- MSG("a_Capi_dpi_verify_request: Permission Denied!\n");
- MSG(" URL_STR : %s\n", URL_STR(url));
+ MSG_INFO("a_Capi_dpi_verify_request: Permission Denied!\n");
+ MSG_INFO(" URL_STR : %s\n", URL_STR(url));
if (URL_FLAGS(url) & URL_Post) {
- MSG(" URL_DATA: %s\n", dStr_printable(URL_DATA(url), 1024));
+ MSG_INFO(" URL_DATA: %s\n", dStr_printable(URL_DATA(url), 1024));
}
}
return allow;
@@ -576,7 +576,7 @@
a_Capi_ccc(OpSend, 1, BCK, conn->InfoSend, dbuf, NULL);
dFree(dbuf);
} else {
- MSG(" ERROR: [a_Capi_dpi_send_data] No open connection found\n");
+ MSG_ERR("[a_Capi_dpi_send_data] No open connection found\n");
}
}
diff -r a50076297212 src/cookies.c
--- a/src/cookies.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/cookies.c Fri Apr 26 22:17:38 2013 +0000
@@ -86,16 +86,16 @@
if (init_str) {
rc = write(fd, init_str, strlen(init_str));
if (rc == -1) {
- MSG("Cookies: Could not write initial string to file %s: %s\n",
- filename, dStrerror(errno));
+ MSG_WARN("Cookies: Could not write initial string to file %s: "
+ "%s\n", filename, dStrerror(errno));
}
}
dClose(fd);
- MSG("Cookies: Created file: %s\n", filename);
+ MSG_INFO("Cookies: Created file: %s\n", filename);
F_in = fopen(filename, "r");
} else {
- MSG("Cookies: Could not create file: %s!\n", filename);
+ MSG_WARN("Cookies: Could not create file: %s!\n", filename);
}
}
@@ -258,8 +258,8 @@
line[0] = '\0';
rc = fgets(line, LINE_MAXLEN, stream);
if (!rc && ferror(stream)) {
- MSG("Cookies1: Error while reading rule from cookiesrc: %s\n",
- dStrerror(errno));
+ MSG_WARN("Cookies1: Error while reading rule from cookiesrc: %s\n",
+ dStrerror(errno));
fclose(stream);
return 2; /* bail out */
}
@@ -292,8 +292,8 @@
else if (dStrAsciiCasecmp(rule, "DENY") == 0)
cc.action = COOKIE_DENY;
else {
- MSG("Cookies: rule '%s' for domain '%s' is not recognised.\n",
- rule, domain);
+ MSG_WARN("Cookies: rule '%s' for domain '%s' is not recognised.\n",
+ rule, domain);
continue;
}
diff -r a50076297212 src/css.cc
--- a/src/css.cc Fri Apr 26 16:42:23 2013 +0000
+++ b/src/css.cc Fri Apr 26 22:17:38 2013 +0000
@@ -539,7 +539,8 @@
if ((order == CSS_PRIMARY_AUTHOR ||
order == CSS_PRIMARY_AUTHOR_IMPORTANT) &&
!rule->isSafe ()) {
- MSG_WARN ("Ignoring unsafe author style that might reveal browsing history\n");
+ MSG_INFO("Ignoring unsafe author style that might reveal browsing "
+ "history\n");
delete rule;
} else {
sheet[order].addRule (rule);
diff -r a50076297212 src/cssparser.cc
--- a/src/cssparser.cc Fri Apr 26 16:42:23 2013 +0000
+++ b/src/cssparser.cc Fri Apr 26 22:17:38 2013 +0000
@@ -28,7 +28,7 @@
using namespace dw::core::style;
#define DEBUG_MSG(A, B, ...) _MSG(B, __VA_ARGS__)
-#define MSG_CSS(A, ...) MSG(A, __VA_ARGS__)
+#define MSG_CSS(A, ...) MSG_WARN(A, __VA_ARGS__)
#define DEBUG_TOKEN_LEVEL 0
#define DEBUG_PARSE_LEVEL 0
#define DEBUG_CREATE_LEVEL 0
diff -r a50076297212 src/decode.c
--- a/src/decode.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/decode.c Fri Apr 26 22:17:38 2013 +0000
@@ -116,7 +116,7 @@
zs->total_out = 0;
zs->total_in = 0;
} else if (rc == Z_DATA_ERROR) {
- MSG_ERR("gzip decompression error\n");
+ MSG_WARN("gzip decompression error\n");
}
}
return output;
@@ -235,7 +235,7 @@
dc->free = Decode_gzip_free;
dc->leftover = NULL; /* not used */
} else {
- MSG("Content-Encoding '%s' not recognized.\n", format);
+ MSG_WARN("Content-Encoding '%s' not recognized.\n", format);
}
}
return dc;
diff -r a50076297212 src/dicache.c
--- a/src/dicache.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/dicache.c Fri Apr 26 22:17:38 2013 +0000
@@ -323,7 +323,7 @@
DicEntry = a_Dicache_get_entry(url, version);
dReturn_if_fail ( DicEntry != NULL );
if (DicEntry->State < DIC_SetParms) {
- MSG("a_Dicache_new_scan before DIC_SetParms\n");
+ MSG_ERR("a_Dicache_new_scan before DIC_SetParms\n");
exit(1);
}
a_Bitvec_clear(DicEntry->BitVec);
diff -r a50076297212 src/digest.c
--- a/src/digest.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/digest.c Fri Apr 26 22:17:38 2013 +0000
@@ -74,7 +74,7 @@
dStr_free(a0, 1);
dStr_free(ha0, 1);
} else {
- MSG("a_Digest_create_auth: Unknown algorithm.\n");
+ MSG_WARN("a_Digest_create_auth: Unknown algorithm.\n");
return 0;
}
@@ -111,7 +111,7 @@
dStr_free(hentity, 1);
dStr_free(a2, 1);
} else {
- MSG("a_Digest_create_auth: Unknown qop value.\n");
+ MSG_WARN("a_Digest_create_auth: Unknown qop value.\n");
return NULL;
}
result = dStr_new(NULL);
diff -r a50076297212 src/dns.c
--- a/src/dns.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/dns.c Fri Apr 26 22:17:38 2013 +0000
@@ -300,16 +300,16 @@
if (error != 0) {
dns_server[channel].status = error;
if (error == EAI_NONAME)
- MSG("DNS error: HOST_NOT_FOUND\n");
+ MSG_INFO("DNS error: HOST_NOT_FOUND\n");
else if (error == EAI_AGAIN)
- MSG("DNS error: TRY_AGAIN\n");
+ MSG_INFO("DNS error: TRY_AGAIN\n");
#ifdef EAI_NODATA
/* Some FreeBSD don't have this anymore */
else if (error == EAI_NODATA)
- MSG("DNS error: NO_ADDRESS\n");
+ MSG_INFO("DNS error: NO_ADDRESS\n");
#endif
else if (h_errno == EAI_FAIL)
- MSG("DNS error: NO_RECOVERY\n");
+ MSG_WARN("DNS error: NO_RECOVERY\n");
} else {
Dns_note_hosts(hosts, res0);
dns_server[channel].status = 0;
diff -r a50076297212 src/domain.c
--- a/src/domain.c Fri Apr 26 16:42:23 2013 +0000
+++ b/src/domain.c Fri Apr 26 22:17:38 2013 +0000
@@ -47,11 +47,11 @@
char *tok2 = strtok(NULL, delim);
if (strtok(NULL, delim) != NULL) {
- MSG("Domain: Ignoring extraneous text at end of line %u.\n",
+ MSG_WARN("Domain: Ignoring extraneous text at end of line %u.\n",
lineno);
}
if (!tok2) {
- MSG("Domain: Not enough fields in line %u.\n", lineno);
+ MSG_WARN("Domain: Not enough fields in line %u.\n", lineno);
} else {
if (dStrAsciiCasecmp(tok1, "default") == 0) {
if (dStrAsciiCasecmp(tok2, "deny") == 0) {
@@ -61,7 +61,8 @@
default_deny = FALSE;
MSG("Domain: Default accept.\n");
} else {
- MSG("Domain: Default action \"%s\" not recognised.\n", tok2);
+ MSG_WARN("Domain: Default action \"%s\" not recognised.\n",
+ tok2);
}
} else {
a_List_add(exceptions, num_exceptions, num_exceptions_max);
@@ -145,7 +146,7 @@
}
if (ret == FALSE)
- MSG("Domain: DENIED from %s to %s.\n", source_host, dest_host);
+ MSG_INFO("Domain: DENIED from %s to %s.\n", source_host, dest_host);
return ret;
}
diff -r a50076297212 src/form.cc
--- a/src/form.cc Fri Apr 26 16:42:23 2013 +0000
+++ b/src/form.cc Fri Apr 26 22:17:38 2013 +0000
@@ -507,13 +507,14 @@
if (form->method != DILLO_HTML_METHOD_POST) {
valid = false;
BUG_MSG("Forms with file input MUST use HTTP POST method\n");
- MSG("File input ignored in form not using HTTP POST method\n");
+ MSG_INFO("File input ignored in form not using HTTP POST "
+ "method\n");
} else if (form->content_type != DILLO_HTML_ENC_MULTIPART) {
valid = false;
BUG_MSG("Forms with file input MUST use multipart/form-data"
" encoding\n");
- MSG("File input ignored in form not using multipart/form-data"
- " encoding\n");
+ MSG_INFO("File input ignored in form not using multipart/form-data"
+ " encoding\n");
}
}
if (valid) {
@@ -588,7 +589,7 @@
const char *attrbuf;
if (html->InFlags & IN_FORM) {
- MSG("