httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-proxy/module-2.0 proxy_connect.c
Date Sun, 08 Apr 2001 12:54:34 GMT
minfrin     01/04/08 05:54:34

  Modified:    .        CHANGES
               module-2.0 proxy_connect.c
  Log:
  CONNECT now works!!! Woohoo!!!
  the poll() loop was overhauled - many of the reads, writes and selects
  were happening on the wrong sockets.
  
  Revision  Changes    Path
  1.18      +3 -0      httpd-proxy/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-proxy/CHANGES,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CHANGES	2001/04/06 10:44:06	1.17
  +++ CHANGES	2001/04/08 12:54:34	1.18
  @@ -1,6 +1,9 @@
   
   mod_proxy changes for 2.0.15 current
   
  +  *) Fixed the poll() loop in proxy_connect.c -> it works now!!!
  +     [Graham Leggett <minfrin@sharp.fm>]
  +
     *) Converted send_dir() to ap_proxy_send_dir_filter() in proxy_ftp.c.
        [Graham Leggett <minfrin@sharp.fm>]
   
  
  
  
  1.30      +10 -9     httpd-proxy/module-2.0/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_connect.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- proxy_connect.c	2001/04/08 11:35:54	1.29
  +++ proxy_connect.c	2001/04/08 12:54:34	1.30
  @@ -283,10 +283,10 @@
   		     "proxy: CONNECT: Returning 200 OK Status");
           nbytes = apr_snprintf(buffer, sizeof(buffer),
   			      "HTTP/1.0 200 Connection Established" CRLF);
  -        apr_send(sock, buffer, &nbytes);
  +        apr_send(r->connection->client_socket, buffer, &nbytes);
           nbytes = apr_snprintf(buffer, sizeof(buffer),
   			      "Proxy-agent: %s" CRLF CRLF, ap_get_server_version());
  -        apr_send(sock, buffer, &nbytes);
  +        apr_send(r->connection->client_socket, buffer, &nbytes);
       }
   
       ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
  @@ -329,22 +329,23 @@
   
       /* Add the server side to the poll */
       apr_poll_socket_add(pollfd, sock, APR_POLLIN);
  +    apr_poll_socket_add(pollfd, r->connection->client_socket, APR_POLLIN);
   
       while (1) { /* Infinite loop until error (one side closes the connection) */
  -        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL, "proxy: CONNECT: going
to sleep (poll)");
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server, "proxy: CONNECT:
going to sleep (poll)");
           if(apr_poll(pollfd, &pollcnt, -1) != APR_SUCCESS)
           {
   	    apr_socket_close(sock);
               ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "proxy: CONNECT: error apr_poll()");
               return HTTP_INTERNAL_SERVER_ERROR;
           }
  -        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                        "proxy: CONNECT: woke from select(), i=%d", pollcnt);
   
           if (pollcnt) {
               apr_poll_revents_get(&pollevent, sock, pollfd);
               if (pollevent & APR_POLLIN) {
  -                ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
  +                ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                                "proxy: CONNECT: sock was set");
                   nbytes = HUGE_STRING_LEN;
                   if(apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
  @@ -356,16 +357,16 @@
                           o += i;
                           nbytes -= i;
                       }
  -                    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
  +                    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
   				 "proxy: CONNECT: wrote %d bytes to client", nbytes);
                   }
                   else
                       break;
               }
   
  -            apr_poll_revents_get(&pollevent, sock, pollfd);
  +            apr_poll_revents_get(&pollevent, r->connection->client_socket, pollfd);
               if (pollevent & APR_POLLIN) {
  -                ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
  +                ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                                "proxy: CONNECT: client was set");
                   nbytes = HUGE_STRING_LEN;
                   if(apr_recv(r->connection->client_socket, buffer, &nbytes) ==
APR_SUCCESS) {
  @@ -378,7 +379,7 @@
                           nbytes -= i;
                       }
                       ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0,
  -                        NULL, "proxy: CONNECT: wrote %d bytes to server", nbytes);
  +                        r->server, "proxy: CONNECT: wrote %d bytes to server", nbytes);
                   }
                   else
                       break;
  
  
  

Mime
View raw message