From 85569f114b8cd6019aa618c5f88e783b06ab0637 Mon Sep 17 00:00:00 2001 From: David Schmidt Date: Mon, 22 Oct 2001 15:33:56 +0000 Subject: [PATCH] Special-cased OS/2 out of the Netscape-abort-on-404-in-js problem in filters.c. Added a FIXME in front of the offending code. I'll gladly put in a better/more robust fix for all parties if one is presented... It seems that just returning 200 instead of 404 would pretty much fix it for everyone, but I don't know all the history of the problem. --- filters.c | 21 ++++++++++++++++++--- miscutil.c | 8 ++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/filters.c b/filters.c index e30a24c8..a30a7939 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.35 2001/10/07 15:41:23 oes Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.36 2001/10/10 16:44:16 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -38,6 +38,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.35 2001/10/07 15:41:23 oes Exp $" * * Revisions : * $Log: filters.c,v $ + * Revision 1.36 2001/10/10 16:44:16 oes + * Added match_portlist function + * * Revision 1.35 2001/10/07 15:41:23 oes * Replaced 6 boolean members of csp with one bitmap (csp->flags) * @@ -647,7 +650,19 @@ struct http_response *block_url(struct client_state *csp) rsp->body = template_load(csp, "blocked"); template_fill(&rsp->body, exports); free_map(exports); - + + /* FIXME */ +#ifdef __EMX__ + /* + * The entire OS/2 community will hit the stupid Netscape bug + * (all three of us! :-) so we'll just keep ourselves out + * of this contentious debate and special-case ourselves. + * The problem is... a this point in parsing, we don't know + * what the csp->http->user_agent is (yet). So we can't use + * it to decide if we should work around the NS bug or not. + */ + rsp->status = strdup("200 Request for blocked URL"); +#else /* * Workaround for stupid Netscape bug which prevents * pages from being displayed if loading a referenced @@ -665,7 +680,7 @@ struct http_response *block_url(struct client_state *csp) { rsp->status = strdup("404 Request for blocked URL"); } - +#endif /* __EMX__ */ } return(finish_http_response(rsp)); diff --git a/miscutil.c b/miscutil.c index 49e19b0b..59899124 100644 --- a/miscutil.c +++ b/miscutil.c @@ -1,4 +1,4 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.18 2001/09/20 13:33:43 steudten Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.19 2001/10/14 22:02:57 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ @@ -36,6 +36,10 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.18 2001/09/20 13:33:43 steudten * * Revisions : * $Log: miscutil.c,v $ + * Revision 1.19 2001/10/14 22:02:57 jongfoster + * New function string_append() which is like strsav(), but running + * out of memory isn't automatically FATAL. + * * Revision 1.18 2001/09/20 13:33:43 steudten * * change long to int as return value in hash_string(). Remember the wraparound @@ -410,7 +414,7 @@ char *chomp(char *string) *********************************************************************/ char *strsav(char *old, const char *text_to_append) { - int old_len, new_len; + int old_len, new_len = 0; char *p; if (( text_to_append == NULL) || (*text_to_append == '\0')) -- 2.39.2