dgaudet     99/06/09 15:03:44

  Modified:    pthreads/src/include buff.h
               pthreads/src/main alloc.c buff.c http_main.c
               pthreads/src/modules/proxy proxy_cache.c proxy_ftp.c
                        proxy_http.c
               pthreads/src/test/rename apapi.h
  Log:
  get rid of "fd_in", it's not needed by anything anymore
  
  Revision  Changes    Path
  1.6       +1 -2      apache-apr/pthreads/src/include/buff.h
  
  Index: buff.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/buff.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- buff.h    1999/06/03 23:46:21     1.5
  +++ buff.h    1999/06/09 22:03:38     1.6
  @@ -116,7 +116,6 @@
   
   /* could also put pointers to the basic I/O routines here */
       int fd;                  /* the file descriptor */
  -    int fd_in;                       /* input file descriptor, if different 
*/
   #ifdef WIN32
       HANDLE hFH;                      /* Windows filehandle */
   #endif
  @@ -145,7 +144,7 @@
   
   /* Stream creation and modification */
   API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags);
  -API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd_in, int fd_out);
  +API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd);
   
   /* XXX - unused right now - mvsk */
   API_EXPORT(BUFF *) ap_bopenf(pool *a, const char *name, int flg, int mode);
  
  
  
  1.7       +3 -3      apache-apr/pthreads/src/main/alloc.c
  
  Index: alloc.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/alloc.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- alloc.c   1999/05/30 23:48:58     1.6
  +++ alloc.c   1999/06/09 22:03:39     1.7
  @@ -2452,19 +2452,19 @@
       if (pipe_out) {
        *pipe_out = ap_bcreate(p, B_RD);
        ap_note_cleanups_for_fd(p, fd_out);
  -     ap_bpushfd(*pipe_out, fd_out, fd_out);
  +     ap_bpushfd(*pipe_out, fd_out);
       }
   
       if (pipe_in) {
        *pipe_in = ap_bcreate(p, B_WR);
        ap_note_cleanups_for_fd(p, fd_in);
  -     ap_bpushfd(*pipe_in, fd_in, fd_in);
  +     ap_bpushfd(*pipe_in, fd_in);
       }
   
       if (pipe_err) {
        *pipe_err = ap_bcreate(p, B_RD);
        ap_note_cleanups_for_fd(p, fd_err);
  -     ap_bpushfd(*pipe_err, fd_err, fd_err);
  +     ap_bpushfd(*pipe_err, fd_err);
       }
   #endif
   
  
  
  
  1.12      +10 -22    apache-apr/pthreads/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/buff.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- buff.c    1999/06/03 23:46:22     1.11
  +++ buff.c    1999/06/09 22:03:39     1.12
  @@ -239,7 +239,6 @@
       fb->bytes_sent = 0;
   
       fb->fd = -1;
  -    fb->fd_in = -1;
       fb->timeout = -1;
   
   #ifdef B_SFIO
  @@ -257,10 +256,9 @@
   /*
    * Push some I/O file descriptors onto the stream
    */
  -API_EXPORT(void) ap_bpushfd(BUFF *fb, APRFile fd_in, APRFile fd_out)
  +API_EXPORT(void) ap_bpushfd(BUFF *fb, APRFile fd)
   {
  -    fb->fd = fd_out;
  -    fb->fd_in = fd_in;
  +    fb->fd = fd;
   }
   
   API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval)
  @@ -445,7 +443,7 @@
   
   API_EXPORT(int) ap_bfileno(BUFF *fb, int direction)
   {
  -    return (direction == B_RD) ? fb->fd_in : fb->fd;
  +    return fb->fd;
   }
   
   /*
  @@ -469,7 +467,7 @@
   /* Test the descriptor and flush the output buffer if it looks like
    * we will block on the next read.
    *
  - * Note we assume the caller has ensured that fb->fd_in <= FD_SETSIZE
  + * Note we assume the caller has ensured that fb->fd <= FD_SETSIZE
    */
   API_EXPORT(void) ap_bhalfduplex(BUFF *fb)
   {
  @@ -481,16 +479,16 @@
        * or there is something readable in the incoming buffer
        * or there is nothing flushable in the output buffer.
        */
  -    if (fb == NULL || fb->fd_in < 0 || fb->incnt > 0 || fb->outcnt == 0) {
  +    if (fb == NULL || fb->fd < 0 || fb->incnt > 0 || fb->outcnt == 0) {
        return;
       }
       /* test for a block */
       do {
        FD_ZERO(&fds);
  -     FD_SET(fb->fd_in, &fds);
  +     FD_SET(fb->fd, &fds);
        tv.tv_sec = 0;
        tv.tv_usec = 0;
  -     rv = ap_select(fb->fd_in + 1, &fds, NULL, NULL, &tv);
  +     rv = ap_select(fb->fd + 1, &fds, NULL, NULL, &tv);
       } while (rv < 0 && errno == EINTR && !(fb->flags & B_EOUT));
   
       /* treat any error as if it would block as well */
  @@ -507,7 +505,7 @@
        ap_bhalfduplex(fb);
       }
       do {
  -     rv = recvwithtimeout(fb->fd_in, buf, nbyte, fb->timeout);
  +     rv = recvwithtimeout(fb->fd, buf, nbyte, fb->timeout);
       } while (rv == -1 && errno == EINTR && !(fb->flags & B_EOUT));
       return (rv);
   }
  @@ -1309,12 +1307,6 @@
       else
       rc1 = 0;
       rc2 = ap_pclosef(fb->pool, fb->fd);
  -    if (fb->fd_in != fb->fd) {
  -        rc3 = ap_pclosef(fb->pool, fb->fd_in);
  -    }
  -    else {
  -        rc3 = 0;
  -    }
   
       fb->inptr = fb->inbase;
       fb->incnt = 0;
  @@ -1322,7 +1314,6 @@
   
       fb->flags |= B_EOF | B_EOUT;
       fb->fd = -1;
  -    fb->fd_in = -1;
   
   #ifdef B_SFIO
       sfclose(fb->sf_in);
  @@ -1331,10 +1322,7 @@
   
       if (rc1 != 0)
        return rc1;
  -    else if (rc2 != 0)
  -     return rc2;
  -    else
  -     return rc3;
  +    return rc2;
   }
   
   /*
  @@ -1476,6 +1464,6 @@
           return NULL;
       }fb = ap_bcreate(a, ((flg &(B_RD|B_RDWR)) ? B_RD : 0)
                     | ((flg & (B_WR|B_RDWR)) ? B_WR : 0));
  -    ap_bpushfd(fb, fd, fd);
  +    ap_bpushfd(fb, fd);
       return fb;
   }
  
  
  
  1.91      +1 -1      apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- http_main.c       1999/06/09 03:14:58     1.90
  +++ http_main.c       1999/06/09 22:03:40     1.91
  @@ -1592,7 +1592,7 @@
       (void) ap_update_child_status(my_child_num, my_thread_num,  
                                  SERVER_BUSY_READ, (request_rec *) NULL);
       conn_io = ap_bcreate(p, B_RDWR | B_SOCKET);
  -    ap_bpushfd(conn_io, csd, csd);
  +    ap_bpushfd(conn_io, csd);
   
       current_conn = new_connection(p, server_conf, conn_io,
                                     (const struct sockaddr_in *) sa_client, 
  
  
  
  1.9       +2 -2      apache-apr/pthreads/src/modules/proxy/proxy_cache.c
  
  Index: proxy_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_cache.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- proxy_cache.c     1999/06/03 23:46:25     1.8
  +++ proxy_cache.c     1999/06/09 22:03:42     1.9
  @@ -657,7 +657,7 @@
        if (cfd != -1) {
            ap_note_cleanups_for_fd(r->pool, cfd);
            cachefp = ap_bcreate(r->pool, B_RD | B_WR);
  -         ap_bpushfd(cachefp, cfd, cfd);
  +         ap_bpushfd(cachefp, cfd);
        }
        else if (errno != ENOENT)
            ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  @@ -1000,7 +1000,7 @@
       }
       ap_note_cleanups_for_fd(r->pool, i);
       c->fp = ap_bcreate(r->pool, B_WR);
  -    ap_bpushfd(c->fp, -1, i);
  +    ap_bpushfd(c->fp, i);
   
       if (ap_bvputs(c->fp, buff, "X-URL: ", c->url, "\n", NULL) == -1) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  
  
  
  1.8       +3 -3      apache-apr/pthreads/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- proxy_ftp.c       1999/06/03 23:46:25     1.7
  +++ proxy_ftp.c       1999/06/09 22:03:42     1.8
  @@ -604,7 +604,7 @@
       }
   
       f = ap_bcreate(p, B_RDWR | B_SOCKET);
  -    ap_bpushfd(f, sock, sock);
  +    ap_bpushfd(f, sock);
   /* shouldn't we implement telnet control options here? */
   
   #ifdef CHARSET_EBCDIC
  @@ -1135,11 +1135,11 @@
        }
        ap_note_cleanups_for_socket(p, csd);
        data = ap_bcreate(p, B_RDWR | B_SOCKET);
  -     ap_bpushfd(data, csd, -1);
  +     ap_bpushfd(data, csd);
       }
       else {
        data = ap_bcreate(p, B_RDWR | B_SOCKET);
  -     ap_bpushfd(data, dsock, dsock);
  +     ap_bpushfd(data, dsock);
       }
   
   #ifdef CHARSET_EBCDIC
  
  
  
  1.6       +1 -1      apache-apr/pthreads/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- proxy_http.c      1999/06/03 23:46:25     1.5
  +++ proxy_http.c      1999/06/09 22:03:42     1.6
  @@ -300,7 +300,7 @@
       clear_connection(r->pool, r->headers_in);        /* Strip 
connection-based headers */
   
       f = ap_bcreate(p, B_RDWR | B_SOCKET);
  -    ap_bpushfd(f, sock, sock);
  +    ap_bpushfd(f, sock);
   
       ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF,
           NULL);
  
  
  
  1.2       +1 -1      apache-apr/pthreads/src/test/rename/apapi.h
  
  Index: apapi.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/test/rename/apapi.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apapi.h   1999/01/21 23:08:45     1.1
  +++ apapi.h   1999/06/09 22:03:43     1.2
  @@ -38,7 +38,7 @@
   extern int                  ap_blookc(char *buff, BUFF *fb);
   extern int                  ap_bnonblock(BUFF *fb, int direction);
   extern void                 ap_bonerror(BUFF *fb, void (*error) (BUFF *, 
int, void *), void *data);
  -extern void                 ap_bpushfd(BUFF *fb, int fd_in, int fd_out);
  +extern void                 ap_bpushfd(BUFF *fb, int fd);
   extern int                  ap_bputs(const char *x, BUFF *fb);
   extern int                  ap_bprintf(BUFF *fb, const char *fmt,...) 
__attribute__((format(printf,2,3)));
   extern int                  ap_bread(BUFF *fb, void *buf, int nbyte);
  
  
  

Reply via email to