manoj 99/08/31 21:21:17
Modified: src/main rfc1413.c
Log:
Add TPF processing support for the socket read. This allows RFC 1413
support to work properly on TPF.
Submitted by: David McCreedy <[EMAIL PROTECTED]> and others at IBM
Revision Changes Path
1.30 +21 -6 apache-1.3/src/main/rfc1413.c
Index: rfc1413.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/rfc1413.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -u -r1.29 -r1.30
--- rfc1413.c 1999/07/30 14:06:56 1.29
+++ rfc1413.c 1999/09/01 04:21:17 1.30
@@ -100,6 +100,12 @@
static JMP_BUF timebuf;
+/* ident_timeout - handle timeouts */
+static void ident_timeout(int sig)
+{
+ ap_longjmp(timebuf, sig);
+}
+
/* bind_connect - bind both ends of a socket */
/* Ambarish fix this. Very broken */
static int get_rfc1413(int sock, const struct sockaddr_in *our_sin,
@@ -178,6 +184,21 @@
*/
while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
int j;
+
+#ifdef TPF
+ /*
+ * socket read on TPF doesn't get interrupted by
+ * signals so additional processing is needed
+ */
+ j = ap_set_callback_and_alarm(NULL, 0);
+ ap_set_callback_and_alarm(ident_timeout, j);
+ j = select(&sock, 1, 0, 0, j * 1000);
+ if (j < 1) {
+ ap_set_callback_and_alarm(NULL, 0);
+ ap_check_signals();
+ return -1;
+ }
+#endif /* TPF */
j = read(sock, buffer+i, (sizeof(buffer) - 1) - i);
if (j < 0 && errno != EINTR) {
ap_log_error(APLOG_MARK, APLOG_CRIT, srv,
@@ -207,12 +228,6 @@
*cp = '\0';
return 0;
-}
-
-/* ident_timeout - handle timeouts */
-static void ident_timeout(int sig)
-{
- ap_longjmp(timebuf, sig);
}
/* rfc1413 - return remote user name, given socket structures */