[Pkg-privacy-commits] [obfsproxy] 41/353: Fixed validation errors
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository obfsproxy.
commit fd3fe0f425cc0ed3c1fc02f42f2e4fefd5f426e2
Author: Brandon Wiley <brandon at blanu.net>
Date: Mon Aug 27 19:29:17 2012 -0500
Fixed validation errors
---
src/obfsproxy/framework/pump.py | 2 ++
src/obfsproxy/manager/clientManager.py | 15 +++++++++------
src/obfsproxy/manager/serverManager.py | 9 ++++++---
src/obfsproxy/transports/base.py | 9 ---------
src/obfsproxy/transports/dummy.py | 22 ++--------------------
5 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/src/obfsproxy/framework/pump.py b/src/obfsproxy/framework/pump.py
index af4e463..2e82904 100644
--- a/src/obfsproxy/framework/pump.py
+++ b/src/obfsproxy/framework/pump.py
@@ -80,6 +80,8 @@ class Pump(object):
logging.error('Pump read '+str(len(data))+' from tunnel')
try:
yield output.write(data)
+ except:
+ logging.error('Error pumping out')
@_o
def pumpUpstream(self):
diff --git a/src/obfsproxy/manager/clientManager.py b/src/obfsproxy/manager/clientManager.py
index 32c29dd..bec2670 100644
--- a/src/obfsproxy/manager/clientManager.py
+++ b/src/obfsproxy/manager/clientManager.py
@@ -30,9 +30,12 @@ class ClientManager(Manager):
if __name__ == '__main__':
- try:
- transport = sys.argv[1]
- manager = ClientManager(transport)
- manager.launch()
- except Exception as e:
- print('Exception: '+str(e))
+ if len(sys.argv)<2:
+ print('clientManager [transport]')
+ else:
+ try:
+ transport = sys.argv[1]
+ manager = ClientManager(transport)
+ manager.launch()
+ except Exception as e:
+ print('Exception: '+str(e))
diff --git a/src/obfsproxy/manager/serverManager.py b/src/obfsproxy/manager/serverManager.py
index cb522bc..b262775 100644
--- a/src/obfsproxy/manager/serverManager.py
+++ b/src/obfsproxy/manager/serverManager.py
@@ -34,6 +34,9 @@ class ServerManager(Manager):
if __name__ == '__main__':
- transport = sys.argv[1]
- manager = ServerManager(transport)
- manager.launch()
+ if len(sys.argv)<2:
+ print('serverManager [transport]')
+ else:
+ transport = sys.argv[1]
+ manager = ServerManager(transport)
+ manager.launch()
diff --git a/src/obfsproxy/transports/base.py b/src/obfsproxy/transports/base.py
index 82c798e..9503675 100644
--- a/src/obfsproxy/transports/base.py
+++ b/src/obfsproxy/transports/base.py
@@ -9,12 +9,6 @@ However, BaseDaemon provides utility methods that are useful for a variety of co
class BaseDaemon:
-
-<<<<<<< HEAD
- def __init__(self, tunnel):
- self.decodedSocket = tunnel.local
- self.encodedSocket = tunnel.remote
-=======
"""
The BaseDaemon class is a base class for implementing pluggable transport clients and server.
"""
@@ -24,7 +18,6 @@ class BaseDaemon:
self.downstreamConnection = downstreamConnection
self.upstreamConnection = upstreamConnection
->>>>>>> aaa6decd2a9f03db165cf03e0d369113bc5818c1
def read(
self,
@@ -95,5 +88,3 @@ class BaseDaemon:
"""
pass
-
-
diff --git a/src/obfsproxy/transports/dummy.py b/src/obfsproxy/transports/dummy.py
index dc1c695..908c529 100644
--- a/src/obfsproxy/transports/dummy.py
+++ b/src/obfsproxy/transports/dummy.py
@@ -1,29 +1,14 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-<<<<<<< HEAD
-import logging
-=======
""" This module contains an implementation of the 'dummy' transport. """
->>>>>>> aaa6decd2a9f03db165cf03e0d369113bc5818c1
+
+import logging
from obfsproxy.transports.base import BaseDaemon
class DummyDaemon(BaseDaemon):
-
-<<<<<<< HEAD
- def decodedReceived(self):
- logging.error('dummy decoded received')
- data = self.decodedSocket.read_some()
- self.encodedSocket.write(data)
- logging.error('wrote '+str(len(data))+' encoded')
-
- def encodedReceived(self):
- logging.error('dummy encoded received')
- data = self.encodedSocket.read_some()
- self.decodedSocket.write(data)
-=======
"""
DummyDaemon is the base class for DummyClient and DummyServer.
Since the protocol is so simple, DummyDaemon provides all of the functionality for the dummy protocol implementation.
@@ -46,11 +31,8 @@ class DummyDaemon(BaseDaemon):
data = self.upstreamConnection.readAll()
self.downstreamConnection.write(data)
->>>>>>> aaa6decd2a9f03db165cf03e0d369113bc5818c1
-
class DummyClient(DummyDaemon):
-
"""
DummyClient is a client for the 'dummy' protocol.
Since this protocol is so simple, the client and the server are identical and both just trivially subclass DummyDaemon.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git
More information about the Pkg-privacy-commits
mailing list