fielding 97/05/28 21:50:29
Modified: src CHANGES conf.h http_main.c rfc1413.c
Log:
Fixed problem on Irix with servers hanging in IdentityCheck,
apparently due to a mismatch between sigaction and setjmp.
Submitted by: Roy Fielding, PR#502
Reviewed by: Jim Jagielski, Randy Terbush, Dean Gaudet
Revision Changes Path
1.283 +4 -0 apache/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache/src/CHANGES,v
retrieving revision 1.282
retrieving revision 1.283
diff -C3 -r1.282 -r1.283
*** CHANGES 1997/05/29 04:23:11 1.282
--- CHANGES 1997/05/29 04:50:25 1.283
***************
*** 3,8 ****
--- 3,12 ----
*) Added undocumented perl SSI mechanism for -DUSE_PERL_SSI and mod_perl.
[Rob Hartill]
+ *) Fixed problem on Irix with servers hanging in IdentityCheck,
+ apparently due to a mismatch between sigaction and setjmp.
+ [Roy Fielding] PR#502
+
*) Log correct status code if we timeout before receiving a request (408)
or if we received a request-line that was too long to process (414).
[Ed Korthof and Roy Fielding] PR#601
1.98 +10 -1 apache/src/conf.h
Index: conf.h
===================================================================
RCS file: /export/home/cvs/apache/src/conf.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -C3 -r1.97 -r1.98
*** conf.h 1997/05/01 17:36:24 1.97
--- conf.h 1997/05/29 04:50:26 1.98
***************
*** 61,67 ****
/* Define one of these according to your system. */
#if defined(MPE)
- #include <setjmp.h>
#include <sys/times.h>
#define JMP_BUF sigjmp_buf
#define NO_SETSID
--- 61,66 ----
***************
*** 650,655 ****
--- 649,664 ----
#endif
#define signal(s,f) ap_signal(s,f)
Sigfunc *signal(int signo, Sigfunc *func);
+ #endif
+
+ #include <setjmp.h>
+
+ #if defined(USE_LONGJMP)
+ #define ap_longjmp(x, y) longjmp((x), (y))
+ #define ap_setjmp(x) setjmp(x)
+ #else
+ #define ap_longjmp(x, y) siglongjmp((x), (y))
+ #define ap_setjmp(x) sigsetjmp((x), 1)
#endif
/* Finding offsets of elements within structures.
1.149 +0 -9 apache/src/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -C3 -r1.148 -r1.149
*** http_main.c 1997/05/29 03:10:52 1.148
--- http_main.c 1997/05/29 04:50:27 1.149
***************
*** 84,90 ****
#include "http_conf_globals.h"
#include "http_core.h" /* for get_remote_host */
#include "scoreboard.h"
- #include <setjmp.h>
#include <assert.h>
#include <sys/stat.h>
#ifdef HAVE_SHMGET
--- 84,89 ----
***************
*** 180,193 ****
#define ap_killpg(x, y) (kill (-(x), (y)))
#else
#define ap_killpg(x, y) (killpg ((x), (y)))
- #endif
-
- #if defined(USE_LONGJMP)
- #define ap_longjmp(x, y) (longjmp ((x), (y)))
- #define ap_setjmp(x) (setjmp (x))
- #else
- #define ap_longjmp(x, y) (siglongjmp ((x), (y)))
- #define ap_setjmp(x) (sigsetjmp ((x), 1))
#endif
#if defined(USE_FCNTL_SERIALIZED_ACCEPT)
--- 179,184 ----
1.10 +10 -14 apache/src/rfc1413.c
Index: rfc1413.c
===================================================================
RCS file: /export/home/cvs/apache/src/rfc1413.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C3 -r1.9 -r1.10
*** rfc1413.c 1997/03/07 17:43:36 1.9
--- rfc1413.c 1997/05/29 04:50:27 1.10
***************
*** 72,85 ****
/* Rewritten by David Robinson */
! #include "httpd.h" /* for server_rec, conn_rec */
#include "http_log.h" /* for log_unixerr */
#include "rfc1413.h"
- /* System libraries. */
-
- #include <setjmp.h>
-
#ifndef SCO
extern char *strchr();
extern char *inet_ntoa();
--- 72,81 ----
/* Rewritten by David Robinson */
! #include "httpd.h" /* for server_rec, conn_rec, ap_longjmp, etc. */
#include "http_log.h" /* for log_unixerr */
#include "rfc1413.h"
#ifndef SCO
extern char *strchr();
extern char *inet_ntoa();
***************
*** 93,105 ****
/* rough limit on the amount of data we accept. */
#define RFC1413_MAXDATA 1000
#define RFC1413_TIMEOUT 30
#define ANY_PORT 0 /* Any old port will do */
#define FROM_UNKNOWN "unknown"
! int rfc1413_timeout = RFC1413_TIMEOUT;/* Global so it can be changed */
!
! static jmp_buf timebuf;
/* bind_connect - bind both ends of a socket */
--- 89,101 ----
/* rough limit on the amount of data we accept. */
#define RFC1413_MAXDATA 1000
+ #ifndef RFC1413_TIMEOUT
#define RFC1413_TIMEOUT 30
+ #endif
#define ANY_PORT 0 /* Any old port will do */
#define FROM_UNKNOWN "unknown"
! JMP_BUF timebuf;
/* bind_connect - bind both ends of a socket */
***************
*** 182,192 ****
return 0;
}
! /* timeout - handle timeouts */
static void
! timeout(int sig)
{
! longjmp(timebuf, sig);
}
/* rfc1413 - return remote user name, given socket structures */
--- 178,188 ----
return 0;
}
! /* ident_timeout - handle timeouts */
static void
! ident_timeout(int sig)
{
! ap_longjmp(timebuf, sig);
}
/* rfc1413 - return remote user name, given socket structures */
***************
*** 209,218 ****
/*
* Set up a timer so we won't get stuck while waiting for the server.
*/
! if (setjmp(timebuf) == 0)
{
! signal(SIGALRM, timeout);
! alarm(rfc1413_timeout);
if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user,
srv)
--- 205,214 ----
/*
* Set up a timer so we won't get stuck while waiting for the server.
*/
! if (ap_setjmp(timebuf) == 0)
{
! signal(SIGALRM, ident_timeout);
! alarm(RFC1413_TIMEOUT);
if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user,
srv)