You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ra...@hyperreal.org on 1999/07/29 20:14:01 UTC

cvs commit: apache-1.3/src/main buff.c http_main.c util.c

randy       99/07/29 11:13:58

  Modified:    .        config.layout
               src      CHANGES
               src/include httpd.h
               src/main buff.c http_main.c util.c
  Log:
  BeOS portability changes.
  Submitted by:	David Reid abb37@dial.pipex.com
  Reviewed by:	Randy Terbush
  
  Revision  Changes    Path
  1.10      +21 -0     apache-1.3/config.layout
  
  Index: config.layout
  ===================================================================
  RCS file: /home/cvs/apache-1.3/config.layout,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- config.layout	1999/06/27 04:42:40	1.9
  +++ config.layout	1999/07/29 18:12:43	1.10
  @@ -129,3 +129,24 @@
       logfiledir:    $localstatedir/logs
       proxycachedir: $localstatedir/proxy
   </Layout>
  +
  +#  BeOS layout...
  +<Layout beos>
  +    prefix:        /boot/home/apache
  +    exec_prefix:   $prefix
  +    bindir:        $exec_prefix/bin
  +    sbindir:       $exec_prefix/bin
  +    libexecdir:    $exec_prefix/libexec
  +    mandir:        $prefix/man
  +    sysconfdir:    $prefix/conf
  +    datadir:       $prefix
  +    iconsdir:      $datadir/icons
  +    htdocsdir:     $datadir/htdocs
  +    cgidir:        $datadir/cgi-bin
  +    includedir:    $prefix/include
  +    localstatedir: $prefix
  +    runtimedir:    $localstatedir/logs
  +    logfiledir:    $localstatedir/logs
  +    proxycachedir: $localstatedir/proxy
  +</Layout>
  +
  
  
  
  1.1402    +9 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1401
  retrieving revision 1.1402
  diff -u -r1.1401 -r1.1402
  --- CHANGES	1999/07/29 17:53:45	1.1401
  +++ CHANGES	1999/07/29 18:13:10	1.1402
  @@ -1,5 +1,14 @@
   Changes with Apache 1.3.7
   
  +  *) Portability changes for BeOS. [David Reid abb37@dial.pipex.com]
  +
  +  *) Sanitise "Vary" values by not adding duplicate keywords.  A
  +     separate routine needs to be used to do this, so any module
  +     that frobs "Vary" needs to be changed.  The standard modules
  +     have all been modified.  This solution is somewhat inelegant,
  +     but it does the job for now.  PR#4118 (better fix than before)
  +     [Ken Coar, Roy Fielding]
  +
     *) Link DSO's with "gcc -shared" instead of "ld -Bshareable" at 
        least on Linux and FreeBSD for now.  
        [Rasmus Lerdorf]
  
  
  
  1.286     +2 -0      apache-1.3/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v
  retrieving revision 1.285
  retrieving revision 1.286
  diff -u -r1.285 -r1.286
  --- httpd.h	1999/07/19 09:48:24	1.285
  +++ httpd.h	1999/07/29 18:13:30	1.286
  @@ -85,6 +85,8 @@
   #elif defined(WIN32)
   /* Set default for Windows file system */
   #define HTTPD_ROOT "/apache"
  +#elif defined(BEOS)
  +#define HTTPD_ROOT "/boot/home/apache"
   #else
   #define HTTPD_ROOT "/usr/local/apache"
   #endif
  
  
  
  1.88      +22 -1     apache-1.3/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/buff.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- buff.c	1999/04/27 20:36:30	1.87
  +++ buff.c	1999/07/29 18:13:40	1.88
  @@ -259,6 +259,11 @@
       }
       else
   	rv = ap_read(fb, buf, nbyte);
  +#elif defined (BEOS)
  +    if (fb->flags & B_SOCKET) {
  +    rv = recv(fb->fd_in, buf, nbyte, 0);
  +    } else
  +    rv = ap_read(fb,buf,nbyte);
   #elif defined(TPF)
       fd_set fds;
       struct timeval tv;
  @@ -315,6 +320,11 @@
       }
       else
   	rv = ap_write(fb, buf, nbyte);
  +#elif defined(BEOS)
  +    if(fb->flags & B_SOCKET) {
  +    rv = send(fb->fd, buf, nbyte, 0);
  +    } else 
  +    rv = ap_write(fb, buf,nbyte);
   #else
       rv = ap_write(fb, buf, nbyte);
   #endif /* WIN32 */
  @@ -681,6 +691,7 @@
       return rv;
   }
   
  +
   /*
    * Read up to nbyte bytes into buf.
    * If fewer than byte bytes are currently available, then return those.
  @@ -1436,6 +1447,16 @@
   	    rc3 = 0;
       }
       else {
  +#elif defined(BEOS)
  +    if (fb->flags & B_SOCKET) {
  +	rc2 = ap_pclosesocket(fb->pool, fb->fd);
  +	if (fb->fd_in != fb->fd) {
  +	    rc3 = ap_pclosesocket(fb->pool, fb->fd_in);
  +	}
  +	else {
  +	    rc3 = 0;
  +	}
  +    } else {
   #endif
   	rc2 = ap_pclosef(fb->pool, fb->fd);
   	if (fb->fd_in != fb->fd) {
  @@ -1444,7 +1465,7 @@
   	else {
   	    rc3 = 0;
   	}
  -#ifdef WIN32
  +#if defined(WIN32) || defined (BEOS)
       }
   #endif
   
  
  
  
  1.465     +25 -0     apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.464
  retrieving revision 1.465
  diff -u -r1.464 -r1.465
  --- http_main.c	1999/07/28 18:20:54	1.464
  +++ http_main.c	1999/07/29 18:13:43	1.465
  @@ -3151,7 +3151,9 @@
   #endif
   
   #ifndef WORKAROUND_SOLARIS_BUG
  +#ifndef BEOS /* this won't work for BeOS sockets!! */
       s = ap_slack(s, AP_SLACK_HIGH);
  +#endif
   
       ap_note_cleanups_for_socket(p, s);	/* arrange to close on exec or restart */
   #ifdef TPF
  @@ -3165,7 +3167,11 @@
       if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(int)) < 0) {
   	ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
   		    "make_sock: for %s, setsockopt: (SO_REUSEADDR)", addr);
  +#ifdef BEOS
  +    closesocket(s);
  +#else
   	close(s);
  +#endif
   	ap_unblock_alarms();
   	return -1;
       }
  @@ -3175,7 +3181,12 @@
       if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(int)) < 0) {
   	ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
   		    "make_sock: for %s, setsockopt: (SO_KEEPALIVE)", addr);
  +#ifdef BEOS
  +    closesocket(s);
  +#else
   	close(s);
  +#endif
  +
   	ap_unblock_alarms();
   	return -1;
       }
  @@ -3221,6 +3232,7 @@
       if (ntohs(server->sin_port) < 1024)
   	GETPRIVMODE();
   #endif
  +
       if (bind(s, (struct sockaddr *) server, sizeof(struct sockaddr_in)) == -1) {
   	ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
   	    "make_sock: could not bind to %s", addr);
  @@ -3228,7 +3240,12 @@
   	if (ntohs(server->sin_port) < 1024)
   	    GETUSERMODE();
   #endif
  +
  +#ifdef BEOS
  +    closesocket(s);
  +#else
   	close(s);
  +#endif
   	ap_unblock_alarms();
   	exit(1);
       }
  @@ -3240,7 +3257,11 @@
       if (listen(s, ap_listenbacklog) == -1) {
   	ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
   	    "make_sock: unable to listen for connections on %s", addr);
  +#ifdef BEOS
  +    closesocket(s);
  +#else
   	close(s);
  +#endif
   	ap_unblock_alarms();
   	exit(1);
       }
  @@ -3260,7 +3281,11 @@
   	    "larger than FD_SETSIZE (%u) "
   	    "found, you probably need to rebuild Apache with a "
   	    "larger FD_SETSIZE", addr, s, FD_SETSIZE);
  +#ifdef BEOS
  +    closesocket(s);
  +#else
   	close(s);
  +#endif
   	return -1;
       }
   #endif
  
  
  
  1.167     +4 -0      apache-1.3/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/util.c,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- util.c	1999/07/19 09:48:26	1.166
  +++ util.c	1999/07/29 18:13:45	1.167
  @@ -1938,7 +1938,11 @@
       char *server_hostname;
       struct hostent *p;
   
  +#ifdef BEOS /* BeOS returns zero as an error for gethostname */
  +    if (gethostname(str, sizeof(str) - 1) == 0) {
  +#else    
       if (gethostname(str, sizeof(str) - 1) != 0) {
  +#endif /* BeOS */
   	perror("Unable to gethostname");
   	exit(1);
       }