[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boa-devel
Subject:    [Boa-devel] interim patch
From:       Jon Nelson <jnelson () jamponi ! net>
Date:       2003-07-03 2:33:58
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


This is the small patch I've been using since 0.94.14rc17 came out.
It's really quite small, fixes no bugs, and is only really useful to a
handful of people.

Questions, comments?



--
No more monkey ducks, jumping on the bed!

Jon Nelson <jnelson@jamponi.net>
C and Python Code Gardener
["d.diff" (text/plain)]

Index: src/boa.h
===================================================================
RCS file: /home/jnelson/cvs/boa/src/boa.h,v
retrieving revision 1.63.2.19
retrieving revision 1.63.2.20
diff -u -r1.63.2.19 -r1.63.2.20
--- src/boa.h	19 Feb 2003 03:03:31 -0000	1.63.2.19
+++ src/boa.h	9 May 2003 16:52:10 -0000	1.63.2.20
@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: boa.h,v 1.63.2.19 2003/02/19 03:03:31 jnelson Exp $*/
+/* $Id: boa.h,v 1.63.2.20 2003/05/09 16:52:10 jnelson Exp $*/
 
 #ifndef _BOA_H
 #define _BOA_H
@@ -83,8 +83,10 @@
 void log_error(const char *mesg);
 #ifdef HAVE_FUNC
 void log_error_mesg(const char *file, int line, const char *func, const char *mesg);
+void log_error_mesg_fatal(const char *file, int line, const char *func, const char *mesg);
 #else
 void log_error_mesg(const char *file, int line, const char *mesg);
+void log_error_mesg_fatal(const char *file, int line, const char *mesg);
 #endif
 
 /* queue */
Index: src/defines.h
===================================================================
RCS file: /home/jnelson/cvs/boa/src/defines.h,v
retrieving revision 1.107.2.31
retrieving revision 1.107.2.33
diff -u -r1.107.2.31 -r1.107.2.33
--- src/defines.h	7 Mar 2003 03:06:21 -0000	1.107.2.31
+++ src/defines.h	9 May 2003 16:52:10 -0000	1.107.2.33
@@ -19,7 +19,7 @@
  *
  */
 
-/* $Id: defines.h,v 1.107.2.31 2003/03/07 03:06:21 jnelson Exp $*/
+/* $Id: defines.h,v 1.107.2.33 2003/05/09 16:52:10 jnelson Exp $*/
 
 #ifndef _DEFINES_H
 #define _DEFINES_H
@@ -76,7 +76,7 @@
 #endif
 
 #ifndef SERVER_VERSION
-#define SERVER_VERSION 				"Boa/0.94.14rc17"
+#define SERVER_VERSION 				"Boa/0.94.14rc18"
 #endif
 
 #define CGI_VERSION				"CGI/1.1"
@@ -132,9 +132,10 @@
 
 #ifdef HAVE_FUNC
 #define WARN(mesg) log_error_mesg(__FILE__, __LINE__, __func__, mesg)
+#define DIE(mesg) log_error_mesg_fatal(__FILE__, __LINE__, __func__, mesg)
 #else
 #define WARN(mesg) log_error_mesg(__FILE__, __LINE__, mesg)
+#define DIE(mesg) log_error_mesg_fatal(__FILE__, __LINE__, mesg)
 #endif
-#define DIE(mesg) WARN(mesg), exit(1)
 
 #endif
Index: src/get.c
===================================================================
RCS file: /home/jnelson/cvs/boa/src/get.c,v
retrieving revision 1.76.2.28
retrieving revision 1.76.2.29
diff -u -r1.76.2.28 -r1.76.2.29
--- src/get.c	6 Mar 2003 02:57:58 -0000	1.76.2.28
+++ src/get.c	4 Apr 2003 16:14:44 -0000	1.76.2.29
@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: get.c,v 1.76.2.28 2003/03/06 02:57:58 jnelson Exp $*/
+/* $Id: get.c,v 1.76.2.29 2003/04/04 16:14:44 jnelson Exp $*/
 
 #include "boa.h"
 #include "access.h"
@@ -309,7 +309,7 @@
     if (!req->ranges) {
         req->ranges = range_pool_pop();
         req->ranges->start = 0;
-        req->ranges->stop = -1;
+        req->ranges->stop = ULONG_MAX;
         if (!ranges_fixup(req)) {
             return 0;
         }
@@ -328,7 +328,7 @@
             ranges_reset(req);
             req->ranges = range_pool_pop();
             req->ranges->start = 0;
-            req->ranges->stop = -1;
+            req->ranges->stop = ULONG_MAX;
             if (!ranges_fixup(req)) {
                 return 0;
             }
Index: src/log.c
===================================================================
RCS file: /home/jnelson/cvs/boa/src/log.c,v
retrieving revision 1.36.2.20
retrieving revision 1.36.2.22
diff -u -r1.36.2.20 -r1.36.2.22
--- src/log.c	19 Feb 2003 00:45:38 -0000	1.36.2.20
+++ src/log.c	9 May 2003 16:52:10 -0000	1.36.2.22
@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: log.c,v 1.36.2.20 2003/02/19 00:45:38 jnelson Exp $*/
+/* $Id: log.c,v 1.36.2.22 2003/05/09 16:52:10 jnelson Exp $*/
 
 #include "boa.h"
 
@@ -157,7 +157,7 @@
     printf("%s - - %s\"%s\" %d %ld \"%s\" \"%s\"\n",
            req->remote_ip_addr,
            get_commonlog_time(),
-           req->logline,
+           req->logline ? req->logline : "-",
            req->response_status,
            req->bytes_written,
            (req->header_referer ? req->header_referer : "-"),
@@ -261,6 +261,18 @@
     perror(mesg);
     errno = errno_save;
 }
+
+void log_error_mesg_fatal(const char *file, int line, const char *func, const char *mesg)
+{
+    int errno_save = errno;
+    fprintf(stderr, "%s%s:%d (%s) - ", get_commonlog_time(), file, line, func);
+    errno = errno_save;
+    perror(mesg);
+    errno = errno_save;
+    exit(errno);
+}
+
+
 #else
 void log_error_mesg(const char *file, int line, const char *mesg)
 {
@@ -269,5 +281,15 @@
     errno = errno_save;
     perror(mesg);
     errno = errno_save;
+}
+
+void log_error_mesg_fatal(const char *file, int line, const char *mesg)
+{
+    int errno_save = errno;
+    fprintf(stderr, "%s%s:%d - ", get_commonlog_time(), file, line);
+    errno = errno_save;
+    perror(mesg);
+    errno = errno_save;
+    exit(errno);
 }
 #endif
Index: src/pipe.c
===================================================================
RCS file: /home/jnelson/cvs/boa/src/pipe.c,v
retrieving revision 1.39.2.12
retrieving revision 1.39.2.13
diff -u -r1.39.2.12 -r1.39.2.13
--- src/pipe.c	6 Mar 2003 02:58:17 -0000	1.39.2.12
+++ src/pipe.c	4 Apr 2003 16:13:36 -0000	1.39.2.13
@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: pipe.c,v 1.39.2.12 2003/03/06 02:58:17 jnelson Exp $*/
+/* $Id: pipe.c,v 1.39.2.13 2003/04/04 16:13:36 jnelson Exp $*/
 
 #include "boa.h"
 
@@ -148,7 +148,6 @@
             return 1;
         else {
             req->status = DEAD;
-            send_r_error(req);  /* maybe superfluous */
             log_error_doc(req);
             perror("pipe write");
             return 0;
@@ -202,7 +201,6 @@
                 if (errno != EPIPE && errno != ECONNRESET)
 #endif
                 {
-                    send_r_error(req);  /* maybe superfluous */
                     log_error_doc(req);
                     perror("sendfile write");
                 }
@@ -317,7 +315,6 @@
             goto restartwrite;
         else {
             req->status = DEAD;
-            send_r_error(req);  /* maybe superfluous */
             log_error_doc(req);
             perror("ioshuffle write");
             return 0;
Index: src/request.c
===================================================================
RCS file: /home/jnelson/cvs/boa/src/request.c,v
retrieving revision 1.112.2.39
retrieving revision 1.112.2.40
diff -u -r1.112.2.39 -r1.112.2.40
--- src/request.c	10 Mar 2003 03:18:54 -0000	1.112.2.39
+++ src/request.c	4 Apr 2003 16:14:03 -0000	1.112.2.40
@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: request.c,v 1.112.2.39 2003/03/10 03:18:54 jnelson Exp $*/
+/* $Id: request.c,v 1.112.2.40 2003/04/04 16:14:03 jnelson Exp $*/
 
 #include "boa.h"
 #include <stddef.h>             /* for offsetof */
@@ -245,19 +245,19 @@
     }
 #endif
 
-#ifndef NO_RATE_LIMIT
-    if (total_connections + 1 > max_connections) {
-        send_r_service_unavailable(conn);
-        conn->status = DONE;
-        pending_requests = 0;
-    }
-#endif                          /* NO_RATE_LIMIT */
-
     total_connections++;
     /* gotta have some breathing room */
     if (total_connections > max_connections) {
         pending_requests = 0;
+#ifndef NO_RATE_LIMIT
+        /* have to fake an http version */
+        conn->http_version = HTTP10;
+        conn->method = M_GET;
+        send_r_service_unavailable(conn);
+        conn->status = DONE;
+#endif                          /* NO_RATE_LIMIT */
     }
+
     enqueue(&request_ready, conn);
 }
 
@@ -333,8 +333,11 @@
     /* put request on the free list */
     dequeue(&request_ready, req); /* dequeue from ready or block list */
 
-    if (req->logline)           /* access log */
-        log_access(req);
+    /* always log */
+    /*
+     if (req->logline)
+     */
+    log_access(req);
 
     if (req->mmap_entry_var)
         release_mmap(req->mmap_entry_var);

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Boa-devel mailing list
Boa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/boa-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic