[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-cvs
Subject:    async-calls squid3/src ftp.cc,1.89.4.7,1.89.4.8 http.cc,1.122.4.5,1.122.4.6 http.h,1.28.4.1,1.28.4.2
From:       chtsanti <chtsanti () users ! sourceforge ! net>
Date:       2007-12-28 14:29:26
Message-ID: 20071228142929.31278.qmail () squid-cache ! org
[Download RAW message or body]

Update of cvs.devel.squid-cache.org:/cvsroot/squid/squid3/src

Modified Files:
      Tag: async-calls
	ftp.cc http.cc http.h 
Log Message:
-converting comm_close handlers to use new CommCalls design


Index: ftp.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/ftp.cc,v
retrieving revision 1.89.4.7
retrieving revision 1.89.4.8
diff -C2 -d -r1.89.4.7 -r1.89.4.8
*** ftp.cc	21 Dec 2007 15:01:15 -0000	1.89.4.7
--- ftp.cc	28 Dec 2007 14:29:24 -0000	1.89.4.8
***************
*** 170,173 ****
--- 170,174 ----
  
  private:
+     AsyncCall::Pointer closeHandler;
      CBDATA_CLASS(FtpStateData);
  
***************
*** 205,212 ****
      void writeCommand(const char *buf);
  
-     static PF ftpSocketClosed;
      static CNCB ftpPasvCallback;
      static PF ftpDataWrite;
      static PF ftpTimeout;
      void ftpReadControlReply(const CommIoCbParams &io);
      void ftpWriteCommandCallback(const CommIoCbParams &io);
--- 206,213 ----
      void writeCommand(const char *buf);
  
      static CNCB ftpPasvCallback;
      static PF ftpDataWrite;
      static PF ftpTimeout;
+     void ftpSocketClosed(const CommCloseCbParams &io);
      void ftpReadControlReply(const CommIoCbParams &io);
      void ftpWriteCommandCallback(const CommIoCbParams &io);
***************
*** 355,364 ****
      };
  
! void
! FtpStateData::ftpSocketClosed(int fdnotused, void *data)
  {
!     FtpStateData *ftpState = (FtpStateData *)data;
!     ftpState->ctrl.fd = -1;
!     delete ftpState;
  }
  
--- 356,364 ----
      };
  
! void 
! FtpStateData::ftpSocketClosed(const CommCloseCbParams &io)
  {
!     ctrl.fd = -1;
!     deleteThis("FtpStateData::ftpSocketClosed");
  }
  
***************
*** 379,383 ****
      flags.rest_supported = 1;
  
!     comm_add_close_handler(ctrl.fd, ftpSocketClosed, this);
  
      if (request->method == METHOD_PUT)
--- 379,386 ----
      flags.rest_supported = 1;
  
!     typedef CommCbMemFunT<FtpStateData, CommCloseCbParams> Dialer;
!     closeHandler = asyncCall(9, 5, "FtpStateData::ftpSocketClosed",
! 				 Dialer(this,&FtpStateData::ftpSocketClosed));
!     comm_add_close_handler(ctrl.fd, closeHandler);
  
      if (request->method == METHOD_PUT)
***************
*** 3383,3387 ****
      if (ctrl.fd > -1) {
          fwd->unregister(ctrl.fd);
!         comm_remove_close_handler(ctrl.fd, ftpSocketClosed, this);
          comm_close(ctrl.fd);
          ctrl.fd = -1;
--- 3386,3391 ----
      if (ctrl.fd > -1) {
          fwd->unregister(ctrl.fd);
! 	comm_remove_close_handler(ctrl.fd, closeHandler);
!         closeHandler = NULL;
          comm_close(ctrl.fd);
          ctrl.fd = -1;

Index: http.h
===================================================================
RCS file: /cvsroot/squid/squid3/src/http.h,v
retrieving revision 1.28.4.1
retrieving revision 1.28.4.2
diff -C2 -d -r1.28.4.1 -r1.28.4.2
*** http.h	16 Dec 2007 22:00:35 -0000	1.28.4.1
--- http.h	28 Dec 2007 14:29:24 -0000	1.28.4.2
***************
*** 80,83 ****
--- 80,84 ----
  
  private:
+     AsyncCall::Pointer closeHandler;
      enum ConnectionStatus {
          INCOMPLETE_MSG,
***************
*** 106,109 ****
--- 107,112 ----
      virtual void sentRequestBody(const CommIoCbParams &io);
      void sendComplete(const CommIoCbParams &io);
+     void httpStateConnClosed(const CommCloseCbParams &params);
+ 
      mb_size_t buildRequestPrefix(HttpRequest * request,
                                   HttpRequest * orig_request,

Index: http.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/http.cc,v
retrieving revision 1.122.4.5
retrieving revision 1.122.4.6
diff -C2 -d -r1.122.4.5 -r1.122.4.6
*** http.cc	21 Dec 2007 15:01:15 -0000	1.122.4.5
--- http.cc	28 Dec 2007 14:29:24 -0000	1.122.4.6
***************
*** 62,66 ****
  static const char *const crlf = "\r\n";
  
! static PF httpStateFree;
  static PF httpTimeout;
  static void httpMaybeRemovePublic(StoreEntry *, http_status);
--- 62,66 ----
  static const char *const crlf = "\r\n";
  
! //static PF httpStateFree;
  static PF httpTimeout;
  static void httpMaybeRemovePublic(StoreEntry *, http_status);
***************
*** 126,130 ****
       * register the handler to free HTTP state data when the FD closes
       */
!     comm_add_close_handler(fd, httpStateFree, this);
  }
  
--- 126,133 ----
       * register the handler to free HTTP state data when the FD closes
       */
!     typedef CommCbMemFunT<HttpStateData, CommCloseCbParams> Dialer;
!     closeHandler = asyncCall(9, 5, "httpStateData::httpStateConnClosed",
!                                  Dialer(this,&HttpStateData::httpStateConnClosed));
!     comm_add_close_handler(fd, closeHandler);
  }
  
***************
*** 150,154 ****
      return fd;
  }
! 
  static void
  httpStateFree(int fd, void *data)
--- 153,157 ----
      return fd;
  }
! /*
  static void
  httpStateFree(int fd, void *data)
***************
*** 157,160 ****
--- 160,170 ----
      debugs(11, 5, "httpStateFree: FD " << fd << ", httpState=" << data);
      delete httpState;
+ }*/
+ 
+ void 
+ HttpStateData::httpStateConnClosed(const CommCloseCbParams &params)
+ {
+     debugs(11, 5, "httpStateFree: FD " << params.fd << ", httpState=" << params.data);
+     deleteThis("HttpStateData::httpStateConnClosed");
  }
  
***************
*** 1171,1175 ****
              flags.do_next_read = 0;
  
!             comm_remove_close_handler(fd, httpStateFree, this);
              fwd->unregister(fd);
  #if LINUX_TPROXY
--- 1181,1186 ----
              flags.do_next_read = 0;
  
! 	    comm_remove_close_handler(fd, closeHandler);
!             closeHandler = NULL;
              fwd->unregister(fd);
  #if LINUX_TPROXY
***************
*** 1283,1287 ****
      if (fd >= 0) {
          fwd->unregister(fd);
!         comm_remove_close_handler(fd, httpStateFree, this);
          comm_close(fd);
          fd = -1;
--- 1294,1299 ----
      if (fd >= 0) {
          fwd->unregister(fd);
! 	comm_remove_close_handler(fd, closeHandler);
!         closeHandler = NULL;
          comm_close(fd);
          fd = -1;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic