- Re-enable OS/2 building after new parms were added
authorDavid Schmidt <david__schmidt@users.sourceforge.net>
Tue, 5 Mar 2002 21:33:45 +0000 (21:33 +0000)
committerDavid Schmidt <david__schmidt@users.sourceforge.net>
Tue, 5 Mar 2002 21:33:45 +0000 (21:33 +0000)
- Fix false out of memory report when resolving CGI templates when no IP
  address is available of failed attempt (a la no such domain)

cgi.c
jcc.c

diff --git a/cgi.c b/cgi.c
index eb099fd..7f99e74 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.41 2002/01/17 20:56:22 jongfoster Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.42 2002/01/21 00:33:20 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -38,6 +38,12 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.41 2002/01/17 20:56:22 jongfoster Exp $";
  *
  * Revisions   :
  *    $Log: cgi.c,v $
+ *    Revision 1.42  2002/01/21 00:33:20  jongfoster
+ *    Replacing strsav() with the safer string_append() or string_join().
+ *    Adding map_block_keep() to save a few bytes in the edit-actions-list HTML.
+ *    Adding missing html_encode() to error message generators.
+ *    Adding edit-actions-section-swap and many "shortcuts" to the list of CGIs.
+ *
  *    Revision 1.41  2002/01/17 20:56:22  jongfoster
  *    Replacing hard references to the URL of the config interface
  *    with #defines from project.h
@@ -682,7 +688,16 @@ struct http_response *error_response(struct client_state *csp,
    if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0);
    if (!err) err = map(exports, "path", 1, html_encode(csp->http->path), 0);
    if (!err) err = map(exports, "error", 1, html_encode_and_free_original(safe_strerror(sys_err)), 0);
-   if (!err) err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0);
+   if (!err)
+   {
+     err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0);
+     if (err)
+     {
+       // Some failures, like "404 no such domain", don't have an IP address.
+       err = map(exports, "host-ip", 1, html_encode(csp->http->host), 0);
+     }
+   }
+
 
    if (err)
    {
@@ -747,7 +762,7 @@ void cgi_init_error_messages(void)
       "<head><title>500 Internal JunkBuster Proxy Error</title></head>\r\n"
       "<body>\r\n"
       "<h1>500 Internal JunkBuster Proxy Error</h1>\r\n"
-      "<p>JunkBuster <b>ran out of memory</b> whilst processing your request.</p>\r\n"
+      "<p>JunkBuster <b>ran out of memory</b> while processing your request.</p>\r\n"
       "<p>Please contact your proxy administrator, or try again later</p>\r\n"
       "</body>\r\n"
       "</html>\r\n";
@@ -815,7 +830,7 @@ jb_err cgi_error_no_template(struct client_state *csp,
       "<head><title>500 Internal JunkBuster Proxy Error</title></head>\r\n"
       "<body>\r\n"
       "<h1>500 Internal JunkBuster Proxy Error</h1>\r\n"
-      "<p>JunkBuster encountered an error whilst processing your request:</p>\r\n"
+      "<p>JunkBuster encountered an error while processing your request:</p>\r\n"
       "<p><b>Could not load template file <code>";
    static const char body_suffix[] =
       "</code></b></p>\r\n"
diff --git a/jcc.c b/jcc.c
index 622feca..e64a979 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.70 2002/03/05 04:52:42 oes Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.71 2002/03/05 18:13:56 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.70 2002/03/05 04:52:42 oes Exp $";
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.71  2002/03/05 18:13:56  oes
+ *    Added --user option
+ *
  *    Revision 1.70  2002/03/05 04:52:42  oes
  *    Deleted non-errlog debugging code
  *
@@ -1595,7 +1598,7 @@ int main(int argc, const char *argv[])
       {
          no_daemon = 1;
       }
-
+#if !defined(__OS2__)
       else if (strcmp(argv[argc_pos], "--pidfile" ) == 0)
       {
          if (++argc_pos == argc) usage(argv[0]);
@@ -1606,12 +1609,13 @@ int main(int argc, const char *argv[])
       {
          if (++argc_pos == argc) usage(argv[0]);
          pw = getpwnam(argv[argc_pos]);
-
+                   s
          if (pw == NULL)
          {
             log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]);
          }
       }
+#endif /* !defined(__OS2__) */
       else
 #endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
       {