Clean up a little CRLF unpleasantness that suddenly appeared
[privoxy.git] / jcc.c
diff --git a/jcc.c b/jcc.c
index e9df2f3..46c6db4 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.61 2002/01/17 21:01:52 jongfoster Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.62 2002/02/20 23:17:23 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.61 2002/01/17 21:01:52 jongfoster Exp $";
  *
  * Revisions   :
  *    $Log: jcc.c,v $
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.62  2002/02/20 23:17:23  jongfoster
+ *    Detecting some out-of memory conditions and exiting with a log message.
+ *
  *    Revision 1.61  2002/01/17 21:01:52  jongfoster
  *    Moving all our URL and URL pattern parsing code to urlmatch.c.
  *
  *    Revision 1.61  2002/01/17 21:01:52  jongfoster
  *    Moving all our URL and URL pattern parsing code to urlmatch.c.
  *
@@ -955,12 +958,12 @@ static void chat(struct client_state *csp)
    log_error(LOG_LEVEL_CONNECT, "OK");
 
    hdr = sed(client_patterns, add_client_headers, csp);
    log_error(LOG_LEVEL_CONNECT, "OK");
 
    hdr = sed(client_patterns, add_client_headers, csp);
-   if (hdr == NULL)\r
-   {\r
-      /* FIXME Should handle error properly */\r
-      log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header");\r
-   }\r
-\r
+   if (hdr == NULL)
+   {
+      /* FIXME Should handle error properly */
+      log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header");
+   }
+
    list_remove_all(csp->headers);
 
    if (fwd->forward_host || (http->ssl == 0))
    list_remove_all(csp->headers);
 
    if (fwd->forward_host || (http->ssl == 0))
@@ -1149,12 +1152,12 @@ static void chat(struct client_state *csp)
                   }
 
                   hdr = sed(server_patterns, add_server_headers, csp);
                   }
 
                   hdr = sed(server_patterns, add_server_headers, csp);
-                  if (hdr == NULL)\r
-                  {\r
-                     /* FIXME Should handle error properly */\r
-                     log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");\r
-                  }\r
-\r
+                  if (hdr == NULL)
+                  {
+                     /* FIXME Should handle error properly */
+                     log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");
+                  }
+
                   n = strlen(hdr);
 
                   if ((write_socket(csp->cfd, hdr, n) != n)
                   n = strlen(hdr);
 
                   if ((write_socket(csp->cfd, hdr, n) != n)
@@ -1209,12 +1212,12 @@ static void chat(struct client_state *csp)
                   log_error(LOG_LEVEL_ERROR, "Buffer size limit reached! Flushing and stepping back.");
 
                   hdr = sed(server_patterns, add_server_headers, csp);
                   log_error(LOG_LEVEL_ERROR, "Buffer size limit reached! Flushing and stepping back.");
 
                   hdr = sed(server_patterns, add_server_headers, csp);
-                  if (hdr == NULL)\r
-                  {\r
-                     /* FIXME Should handle error properly */\r
-                     log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");\r
-                  }\r
-\r
+                  if (hdr == NULL)
+                  {
+                     /* FIXME Should handle error properly */
+                     log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");
+                  }
+
                   n   = strlen(hdr);
                   byte_count += n;
 
                   n   = strlen(hdr);
                   byte_count += n;
 
@@ -1303,12 +1306,12 @@ static void chat(struct client_state *csp)
              */
 
             hdr = sed(server_patterns, add_server_headers, csp);
              */
 
             hdr = sed(server_patterns, add_server_headers, csp);
-            if (hdr == NULL)\r
-            {\r
-               /* FIXME Should handle error properly */\r
-               log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");\r
-            }\r
-\r
+            if (hdr == NULL)
+            {
+               /* FIXME Should handle error properly */
+               log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");
+            }
+
             n   = strlen(hdr);
 
             /* write the server's (modified) header to
             n   = strlen(hdr);
 
             /* write the server's (modified) header to