-const char actions_rcs[] = "$Id: actions.c,v 1.53 2008/05/26 16:04:04 fabiankeil Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.54 2008/09/20 10:04:33 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
*
* Revisions :
* $Log: actions.c,v $
+ * Revision 1.54 2008/09/20 10:04:33 fabiankeil
+ * Remove hide-forwarded-for-headers action which has
+ * been obsoleted by change-x-forwarded-for{block}.
+ *
* Revision 1.53 2008/05/26 16:04:04 fabiankeil
* s@memorey@memory@
*
"vanilla-wafer",
"wafer"
};
- int i;
+ unsigned int i;
for (i = 0; i < SZ(formerly_valid_actions); i++)
{
/* Found it */
merge_actions(cur_action, alias->action);
}
- else if ((2 < strlen(option)) && action_used_to_be_valid(option+1))
+ else if (((size_t)2 < strlen(option)) && action_used_to_be_valid(option+1))
{
log_error(LOG_LEVEL_ERROR, "Action '%s' is no longer valid "
"in this Privoxy release. Ignored.", option+1);
}
- else if ((2 < strlen(option)) && 0 == strcmpic(option+1, "hide-forwarded-for-headers"))
+ else if (((size_t)2 < strlen(option)) && 0 == strcmpic(option+1, "hide-forwarded-for-headers"))
{
log_error(LOG_LEVEL_FATAL, "The action 'hide-forwarded-for-headers' "
"is no longer valid in this Privoxy release. "
size_t len = strlen(buf);
char * start = buf + 2;
char * end = buf + len - 1;
- if ((len < 5) || (*end-- != '}') || (*end-- != '}'))
+ if ((len < (size_t)5) || (*end-- != '}') || (*end-- != '}'))
{
/* too short */
fclose(fp);
-const char cgi_rcs[] = "$Id: cgi.c,v 1.112 2008/08/31 16:08:12 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.113 2008/09/04 08:13:58 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.113 2008/09/04 08:13:58 fabiankeil
+ * Prepare for critical sections on Windows by adding a
+ * layer of indirection before the pthread mutex functions.
+ *
* Revision 1.112 2008/08/31 16:08:12 fabiankeil
* "View the request headers" isn't more equal than the other
* menu items and thus doesn't need a trailing dot either.
#endif
assert(buf);
- assert(buffer_size > 29);
+ assert(buffer_size > (size_t)29);
time(¤t_time);
#endif
assert(buf);
- assert(buffer_size > 29);
+ assert(buffer_size > (size_t)29);
time(¤t_time);
assert(exports);
assert(name);
- assert(strlen(name) < 490);
+ assert(strlen(name) < (size_t)490);
snprintf(buf, sizeof(buf), "if-%s-start.*if-%s-end", name, name);
return map(exports, buf, 1, "", 1);
assert(exports);
assert(name);
- assert(strlen(name) < 490);
+ assert(strlen(name) < (size_t)490);
snprintf(buf, sizeof(buf), "if-%s-start", name);
err = map(exports, buf, 1, "", 1);
assert(exports);
assert(name);
- assert(strlen(name) < 480);
+ assert(strlen(name) < (size_t)480);
snprintf(buf, sizeof(buf), (choose_first
? "else-not-%s@.*@endif-%s"
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.61 2008/03/24 18:12:52 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.62 2008/08/31 15:59:02 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
*
* Revisions :
* $Log: cgiedit.c,v $
+ * Revision 1.62 2008/08/31 15:59:02 fabiankeil
+ * There's no reason to let remote toggling support depend
+ * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't.
+ *
* Revision 1.61 2008/03/24 18:12:52 fabiankeil
* Use sizeof() more often.
*
if ( (cur_line == NULL)
|| (line_number != patternid)
- || (patternid < 1)
+ || (patternid < 1U)
|| (cur_line->type != FILE_LINE_URL))
{
/* Invalid "patternid" parameter */
if ( (cur_line == NULL)
|| (line_number != patternid)
- || (patternid < 1)
+ || (patternid < 1U)
|| (cur_line->type != FILE_LINE_URL))
{
/* Invalid "patternid" parameter */
text++;
len--;
}
- while ( (len > 0)
+ while ( (len > (size_t)0)
&& ( (text[len - 1] == ' ')
|| (text[len - 1] == '\t') ) )
{
-const char errlog_rcs[] = "$Id: errlog.c,v 1.81 2008/11/23 15:59:27 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.82 2008/11/23 16:06:58 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.82 2008/11/23 16:06:58 fabiankeil
+ * Update a log message I missed in 1.80.
+ *
* Revision 1.81 2008/11/23 15:59:27 fabiankeil
* - Update copyright range.
* - Remove stray line breaks in a log message
#endif
length = strftime(buffer, buffer_size, "%b %d %H:%M:%S", &tm_now);
- if (length > 0)
+ if (length > (size_t)0)
{
msecs_length = snprintf(buffer+length, buffer_size - length, ".%.3ld", msecs);
}
length = strftime(buffer, buffer_size, "%d/%b/%Y:%H:%M:%S ", tm_now);
- if (length > 0)
+ if (length > (size_t)0)
{
tz_length = snprintf(buffer+length, buffer_size-length,
"%+03d%02d", mins / 60, abs(mins) % 60);
format_string = "[counted string lenght < 0]";
}
}
- else if (ival >= sizeof(tempbuf))
+ else if ((size_t)ival >= sizeof(tempbuf))
{
/*
* String is too long, copy as much as possible.
-const char gateway_rcs[] = "$Id: gateway.c,v 1.43 2008/11/13 09:15:51 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.44 2008/11/22 11:54:04 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
*
* Revisions :
* $Log: gateway.c,v $
+ * Revision 1.44 2008/11/22 11:54:04 fabiankeil
+ * Move log message around to include the socket number.
+ *
* Revision 1.43 2008/11/13 09:15:51 fabiankeil
* Make keep_alive_timeout static.
*
{
case SOCKS_REQUEST_GRANTED:
return(sfd);
- break;
case SOCKS_REQUEST_REJECT:
errstr = "SOCKS request rejected or failed.";
errno = EINVAL;
}
hostlen = strlen(target_host);
- if (hostlen > 255)
+ if (hostlen > (size_t)255)
{
errstr = "target host name is longer than 255 characters";
err = 1;
cbuf[client_pos++] = '\x00'; /* Reserved, must be 0x00 */
cbuf[client_pos++] = '\x03'; /* Address is domain name */
cbuf[client_pos++] = (char)(hostlen & 0xffu);
- assert(sizeof(cbuf) - client_pos > 255);
+ assert(sizeof(cbuf) - client_pos > (size_t)255);
/* Using strncpy because we really want the nul byte padding. */
strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos);
client_pos += (hostlen & 0xffu);
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.60 2008/09/07 12:35:05 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.61 2008/10/18 11:09:23 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
*
* Revisions :
* $Log: miscutil.c,v $
+ * Revision 1.61 2008/10/18 11:09:23 fabiankeil
+ * Improve seed used by pick_from_range() on mingw32.
+ *
* Revision 1.60 2008/09/07 12:35:05 fabiankeil
* Add mutex lock support for _WIN32.
*
*********************************************************************/
int strncmpic(const char *s1, const char *s2, size_t n)
{
- if (n <= 0) return(0);
+ if (n <= (size_t)0) return(0);
if (!s1) s1 = "";
if (!s2) s2 = "";
break;
}
- if (--n <= 0) break;
+ if (--n <= (size_t)0) break;
s1++, s2++;
}
err = string_append(target_string, text_to_append);
- free(text_to_append);
+ freez(text_to_append);
return err;
}