]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
These changes allow the support programs to compile on BeOS.
authorDavid Reid <dreid@apache.org>
Mon, 11 Oct 1999 20:25:08 +0000 (20:25 +0000)
committerDavid Reid <dreid@apache.org>
Mon, 11 Oct 1999 20:25:08 +0000 (20:25 +0000)
The biggest change is in ab.c where the functions that BeOS needs that
aren't the standard format are hidden behind a new ab_* define.  Tested
on FreeBSD and BeOS.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83964 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c
support/htdigest.c
support/logresolve.c

index 59cbc12cc8b4f5dee35b23ea06295fc34f9c27bd..1f92ba18cd275bc46c48a211b4bcd4e7f2f31330 100644 (file)
@@ -224,6 +224,16 @@ struct data *stats;                /* date for each request */
 fd_set readbits, writebits;    /* bits for select */
 struct sockaddr_in server;     /* server addr structure */
 
+#ifndef BEOS
+#define ab_close(s) close(s)
+#define ab_read(a,b,c) read(a,b,c)
+#define ab_write(a,b,c) write(a,b,c)
+#else
+#define ab_close(s) closesocket(s)
+#define ab_read(a,b,c) recv(a,b,c,0)
+#define ab_write(a,b,c) send(a,b,c,0)
+#endif
+
 /* --------------------------------------------------------- */
 
 /* simple little function to perror and exit */
@@ -262,9 +272,9 @@ static void write_request(struct connection * c)
     }
     writev(c->fd,out, outcnt);
 #else
-    write(c->fd,request,reqlen);
+    ab_write(c->fd,request,reqlen);
     if (posting>0) {
-        write(c->fd,postdata,postlen);
+        ab_write(c->fd,postdata,postlen);
         totalposted += (reqlen + postlen);
     }
 #endif
@@ -281,7 +291,11 @@ static void write_request(struct connection * c)
 static void nonblock(int fd)
 {
     int i = 1;
+#ifdef BEOS
+    setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, &i, sizeof(i));
+#else
     ioctl(fd, FIONBIO, &i);
+#endif
 }
 
 /* --------------------------------------------------------- */
@@ -526,7 +540,7 @@ static void start_connect(struct connection * c)
            return;
        }
        else {
-           close(c->fd);
+           ab_close(c->fd);
            err_conn++;
            if (bad++ > 10) {
                err("\nTest aborted after 10 failures\n\n");
@@ -570,7 +584,7 @@ static void close_connection(struct connection * c)
        }
     }
 
-    close(c->fd);
+    ab_close(c->fd);
     FD_CLR(c->fd, &readbits);
     FD_CLR(c->fd, &writebits);
 
@@ -589,7 +603,8 @@ static void read_connection(struct connection * c)
     char *part;
     char respcode[4];          /* 3 digits and null */
 
-    r = read(c->fd, buffer, sizeof(buffer));
+    r = ab_read(c->fd, buffer, sizeof(buffer));
+
     if (r == 0 || (r < 0 && errno != EAGAIN)) {
        good++;
        close_connection(c);
@@ -635,7 +650,7 @@ static void read_connection(struct connection * c)
                return;
            else {
                /* header is in invalid or too big - close connection */
-               close(c->fd);
+               ab_close(c->fd);
                if (bad++ > 10) {
                    err("\nTest aborted after 10 failures\n\n");
                }
index d1fc41800fd35810ed06568de301477f1b4b5e6b..eb2818852f3fe9c44d87bcc8fc7f65cd414bc3d1 100644 (file)
@@ -70,7 +70,7 @@
 #include <sys/types.h>
 #include "ap.h"
 #include "ap_md5.h"
-#if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM)
+#if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) || defined(BEOS)
 #include <signal.h>
 #else
 #include <sys/signal.h>
index f6436c5799426dcef324a63d1975a0c40e073cfe..914c2ed2a44769c60bdf2c3efa5c11940c1b9e98 100644 (file)
@@ -52,6 +52,10 @@ static void cgethost(struct in_addr ipnum, char *string, int check);
 static int getline(char *s, int n);
 static void stats(FILE *output);
 
+#ifdef BEOS
+#define NO_ADDRESS NO_DATA
+#endif
+
 
 /* maximum line length */
 #define MAXLINE 1024
@@ -99,7 +103,8 @@ struct nsrec {
 extern int h_errno; /* some machines don't have this in their headers */
 #endif
 
-/* largeste value for h_errno */
+/* largest value for h_errno */
+
 #define MAX_ERR (NO_ADDRESS)
 #define UNKNOWN_ERR (MAX_ERR+1)
 #define NO_REVERSE  (MAX_ERR+2)