httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@hyperreal.org
Subject cvs commit: apache-2.0/src/support ab.c htdigest.c logresolve.c
Date Mon, 11 Oct 1999 20:25:09 GMT
dreid       99/10/11 13:25:09

  Modified:    src/support ab.c htdigest.c logresolve.c
  Log:
  These changes allow the support programs to compile on BeOS.
  
  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.
  
  Revision  Changes    Path
  1.4       +21 -6     apache-2.0/src/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/ab.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ab.c	1999/10/07 21:53:46	1.3
  +++ ab.c	1999/10/11 20:25:07	1.4
  @@ -224,6 +224,16 @@
   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 @@
       }
       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 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 @@
   	    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 @@
   	}
       }
   
  -    close(c->fd);
  +    ab_close(c->fd);
       FD_CLR(c->fd, &readbits);
       FD_CLR(c->fd, &writebits);
   
  @@ -588,8 +602,9 @@
       int r;
       char *part;
       char respcode[4];		/* 3 digits and null */
  +
  +    r = ab_read(c->fd, buffer, sizeof(buffer));
   
  -    r = read(c->fd, buffer, sizeof(buffer));
       if (r == 0 || (r < 0 && errno != EAGAIN)) {
   	good++;
   	close_connection(c);
  @@ -635,7 +650,7 @@
   		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");
   		}
  
  
  
  1.2       +1 -1      apache-2.0/src/support/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/htdigest.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- htdigest.c	1999/08/24 06:45:54	1.1
  +++ htdigest.c	1999/10/11 20:25:08	1.2
  @@ -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>
  
  
  
  1.3       +6 -1      apache-2.0/src/support/logresolve.c
  
  Index: logresolve.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/logresolve.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- logresolve.c	1999/08/31 05:35:40	1.2
  +++ logresolve.c	1999/10/11 20:25:08	1.3
  @@ -52,6 +52,10 @@
   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
  @@ -98,8 +102,9 @@
   #ifndef h_errno
   extern int h_errno; /* some machines don't have this in their headers */
   #endif
  +
  +/* largest value for h_errno */
   
  -/* largeste value for h_errno */
   #define MAX_ERR (NO_ADDRESS)
   #define UNKNOWN_ERR (MAX_ERR+1)
   #define NO_REVERSE  (MAX_ERR+2)
  
  
  

Mime
View raw message