equal
deleted
inserted
replaced
785 'setsockopt', *args, **kwargs |
785 'setsockopt', *args, **kwargs |
786 ) |
786 ) |
787 |
787 |
788 |
788 |
789 class baseproxyobserver(object): |
789 class baseproxyobserver(object): |
|
790 def __init__(self, fh, name, logdata, logdataapis): |
|
791 self.fh = fh |
|
792 self.name = name |
|
793 self.logdata = logdata |
|
794 self.logdataapis = logdataapis |
|
795 |
790 def _writedata(self, data): |
796 def _writedata(self, data): |
791 if not self.logdata: |
797 if not self.logdata: |
792 if self.logdataapis: |
798 if self.logdataapis: |
793 self.fh.write(b'\n') |
799 self.fh.write(b'\n') |
794 self.fh.flush() |
800 self.fh.flush() |
821 """Logs file object activity.""" |
827 """Logs file object activity.""" |
822 |
828 |
823 def __init__( |
829 def __init__( |
824 self, fh, name, reads=True, writes=True, logdata=False, logdataapis=True |
830 self, fh, name, reads=True, writes=True, logdata=False, logdataapis=True |
825 ): |
831 ): |
826 self.fh = fh |
832 super(fileobjectobserver, self).__init__(fh, name, logdata, logdataapis) |
827 self.name = name |
|
828 self.logdata = logdata |
|
829 self.logdataapis = logdataapis |
|
830 self.reads = reads |
833 self.reads = reads |
831 self.writes = writes |
834 self.writes = writes |
832 |
835 |
833 def read(self, res, size=-1): |
836 def read(self, res, size=-1): |
834 if not self.reads: |
837 if not self.reads: |
947 writes=True, |
950 writes=True, |
948 states=True, |
951 states=True, |
949 logdata=False, |
952 logdata=False, |
950 logdataapis=True, |
953 logdataapis=True, |
951 ): |
954 ): |
952 self.fh = fh |
955 super(socketobserver, self).__init__(fh, name, logdata, logdataapis) |
953 self.name = name |
|
954 self.reads = reads |
956 self.reads = reads |
955 self.writes = writes |
957 self.writes = writes |
956 self.states = states |
958 self.states = states |
957 self.logdata = logdata |
|
958 self.logdataapis = logdataapis |
|
959 |
959 |
960 def makefile(self, res, mode=None, bufsize=None): |
960 def makefile(self, res, mode=None, bufsize=None): |
961 if not self.states: |
961 if not self.states: |
962 return |
962 return |
963 |
963 |