dgaudet     97/03/15 12:49:10

  Modified:    src       CHANGES http_main.c
  Log:
  Possible workaround to a compiler bug that causes SunOS 4.1.x to panic.
  
  Submitted by: Roy Fielding
  
  Revision  Changes    Path
  1.198     +3 -0      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.197
  retrieving revision 1.198
  diff -C3 -r1.197 -r1.198
  *** CHANGES   1997/03/14 03:27:31     1.197
  --- CHANGES   1997/03/15 20:49:08     1.198
  ***************
  *** 1,5 ****
  --- 1,8 ----
    Changes with Apache 1.2b8
    
  +   *) Workaround to a compiler bug that causes SunOS 4.1.x to panic.
  +      [Roy Fielding]
  + 
      *) Negotiation changes: Don't output empty content-type in variant list;
         Output charset in variant list; Return sooner from handle_multi() if
         no variants found; Add handling of '*' wildcard in Accept-Charset.
  
  
  
  1.129     +12 -13    apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -C3 -r1.128 -r1.129
  *** http_main.c       1997/03/11 06:04:39     1.128
  --- http_main.c       1997/03/15 20:49:09     1.129
  ***************
  *** 1552,1567 ****
        /* The Nagle algorithm says that we should delay sending partial
         * packets in hopes of getting more data.  We don't want to do
         * this; we are not telnet.  There are bad interactions between
  !      * P-HTTP and Nagle's algorithm that have very severe performance
  !      * penalties.  (Failing to do disable Nagle is not much of a
         * problem with simple HTTP.)
         *
         * In spite of these problems, failure here is not a shooting offense.
         */
  !     const int just_say_no = 1;
    
  !     if (0 != setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char*)&just_say_no,
  !                     sizeof just_say_no))
        fprintf(stderr, "httpd: could not set socket option TCP_NODELAY\n");
    }
    #else
  --- 1552,1567 ----
        /* The Nagle algorithm says that we should delay sending partial
         * packets in hopes of getting more data.  We don't want to do
         * this; we are not telnet.  There are bad interactions between
  !      * persistent connections and Nagle's algorithm that have very severe
  !      * performance penalties.  (Failing to disable Nagle is not much of a
         * problem with simple HTTP.)
         *
         * In spite of these problems, failure here is not a shooting offense.
         */
  !     int just_say_no = 1;
    
  !     if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char*)&just_say_no,
  !                    sizeof(int)) < 0)
        fprintf(stderr, "httpd: could not set socket option TCP_NODELAY\n");
    }
    #else
  ***************
  *** 1842,1849 ****
    make_sock(pool *pconf, const struct sockaddr_in *server)
    {
        int s;
  !     const int one = 1;
  !     const int keepalive_value = 1;  
    
        if ((s = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) == -1) {
            perror("socket");
  --- 1842,1848 ----
    make_sock(pool *pconf, const struct sockaddr_in *server)
    {
        int s;
  !     int one = 1;
    
        if ((s = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) == -1) {
            perror("socket");
  ***************
  *** 1855,1868 ****
        
    #ifndef MPE
    /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */
  !     if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one)))
  !        == -1) {
        perror("setsockopt(SO_REUSEADDR)");
        fprintf(stderr,"httpd: could not set socket option SO_REUSEADDR\n");
            exit(1);
        }
  !     if((setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(char *)&keepalive_value,
  !         sizeof(keepalive_value))) == -1) {
        perror("setsockopt(SO_KEEPALIVE)"); 
            fprintf(stderr,"httpd: could not set socket option 
SO_KEEPALIVE\n"); 
            exit(1); 
  --- 1854,1866 ----
        
    #ifndef MPE
    /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */
  !     if (setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(int)) < 
0) {
        perror("setsockopt(SO_REUSEADDR)");
        fprintf(stderr,"httpd: could not set socket option SO_REUSEADDR\n");
            exit(1);
        }
  !     one = 1;
  !     if (setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(int)) < 
0) {
        perror("setsockopt(SO_KEEPALIVE)"); 
            fprintf(stderr,"httpd: could not set socket option 
SO_KEEPALIVE\n"); 
            exit(1); 
  ***************
  *** 1883,1889 ****
        li.l_linger = 900;
    
        if (setsockopt(s, SOL_SOCKET, SO_LINGER,
  !         (char *)&li, sizeof(struct linger)) < 0) {
            perror("setsockopt(SO_LINGER)");
            fprintf(stderr,"httpd: could not set socket option SO_LINGER\n");
            exit(1);
  --- 1881,1887 ----
        li.l_linger = 900;
    
        if (setsockopt(s, SOL_SOCKET, SO_LINGER,
  !                    (char *)&li, sizeof(struct linger)) < 0) {
            perror("setsockopt(SO_LINGER)");
            fprintf(stderr,"httpd: could not set socket option SO_LINGER\n");
            exit(1);
  ***************
  *** 1912,1918 ****
         * If no size is specified, use the kernel default.
         */
        if (server_conf->send_buffer_size) {
  !         if((setsockopt(s, SOL_SOCKET, SO_SNDBUF, 
(char*)&server_conf->send_buffer_size, sizeof(int))) < 0) {
            perror("setsockopt(SO_SNDBUF), using default buffer size"); 
            /* Fail soft. */
        }
  --- 1910,1917 ----
         * If no size is specified, use the kernel default.
         */
        if (server_conf->send_buffer_size) {
  !         if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
  !               (char *)&server_conf->send_buffer_size, sizeof(int)) < 0) {
            perror("setsockopt(SO_SNDBUF), using default buffer size"); 
            /* Fail soft. */
        }
  
  
  

Reply via email to