Ejemplo n.º 1
0
 def write(self, data):
     #if self.method.upper() == 'HEAD':
         #print 'debug TunnelProxyRequest.write',self.responseHeaders
     ProxyRequest.write(self,data)
     if self.method.upper() == 'HEAD' and self.isReplace() and self.responseHeaders.hasHeader('content-length'):
         #print self.responseHeaders.getRawHeaders('content-length')
         pkgsize = int(self.responseHeaders.getRawHeaders('content-length')[-1])
         if pkgsize < common.minsize:
             if not self.uri in common.ignorelist:
                 common.ignorelist.append(self.uri)
                 print 'Psn.proxy : this pkg is too small, ignore'
 def write(self, content):
     log.msg("reply:", content)
     if self.mode == self.INTERRUPT_AFTER_RECEIVE:
         # TODO: suppress original headers
         # Original headers already sent to proxy client, but we
         # can still suppress the actual data and close the
         # connection to simulate a failure.
         log.msg("interrupt after receive")
         ProxyRequest.write(self, "")
         self.transport.loseConnection()
     else:
         ProxyRequest.write(self, content)
 def write(self, content):
     log.msg("reply:", content)
     if self.mode == self.INTERRUPT_AFTER_RECEIVE:
         # TODO: suppress original headers
         # Original headers already sent to proxy client, but we
         # can still suppress the actual data and close the
         # connection to simulate a failure.
         log.msg("interrupt after receive")
         ProxyRequest.write(self, "")
         self.transport.loseConnection()
     else:
         ProxyRequest.write(self, content)
Ejemplo n.º 4
0
 def write(self, data):
     #if self.method.upper() == 'HEAD':
     #print 'debug TunnelProxyRequest.write',self.responseHeaders
     ProxyRequest.write(self, data)
     if self.method.upper() == 'HEAD' and self.isReplace(
     ) and self.responseHeaders.hasHeader('content-length'):
         #print self.responseHeaders.getRawHeaders('content-length')
         pkgsize = int(
             self.responseHeaders.getRawHeaders('content-length')[-1])
         if pkgsize < common.minsize:
             if not self.uri in common.ignorelist:
                 common.ignorelist.append(self.uri)
                 print 'Psn.proxy : this pkg is too small, ignore'