Skip to content

Commit

Permalink
Merge pull request #168 from kpdyer/dev
Browse files Browse the repository at this point in the history
various fixes for 0.2.19, which resolve issues with the Tor nightly builds
  • Loading branch information
kpdyer committed Oct 8, 2014
2 parents 0eef74a + f8106c7 commit eddc9b7
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 29,720 deletions.
1 change: 0 additions & 1 deletion bin/fteproxy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ else:
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

import fteproxy.requires
import fteproxy.cli

if __name__ == '__main__':
Expand Down
147 changes: 13 additions & 134 deletions fteproxy.spec
Original file line number Diff line number Diff line change
@@ -1,143 +1,22 @@
# -*- mode: python -*-



import glob

excludesPassedToAnalysis = [
'_ssl',
'xml',
'pydoc',
'pywin',
'win32ui',
'bz2',
'doctest',
'os2emxpath',
'servicemanager',
'xml.parsers.expat',
'sitecustomize',
'readline',
'tarflie',
'email',
'urllib',
'urllib2',
'wx.lib.pubsub.autosetuppubsubv1']

excludeEncodings = \
['encodings.base_64_codec',
'encodings.big5',
'encodings.big5hkscs',
'encodings.bz2_codec',
'encodings.cp037',
'encodings.cp1006',
'encodings.cp1026',
'encodings.cp1140',
'encodings.cp1258',
'encodings.cp424',
'encodings.cp437',
'encodings.cp500',
'encodings.cp720',
'encodings.cp737',
'encodings.cp775',
'encodings.cp850',
'encodings.cp852',
'encodings.cp855',
'encodings.cp856',
'encodings.cp857',
'encodings.cp858',
'encodings.cp860',
'encodings.cp861',
'encodings.cp862',
'encodings.cp863',
'encodings.cp864',
'encodings.cp865',
'encodings.cp866',
'encodings.cp869',
'encodings.cp874',
'encodings.cp875',
'encodings.cp932',
'encodings.cp949',
'encodings.cp950',
'encodings.euc_jis_2004',
'encodings.euc_jisx0213',
'encodings.euc_jp',
'encodings.euc_kr',
'encodings.gb18030',
'encodings.gb2312',
'encodings.gbk',
'encodings.hp_roman8',
'encodings.hz',
'encodings.iso2022_jp',
'encodings.iso2022_jp_1',
'encodings.iso2022_jp_2',
'encodings.iso2022_jp_2004',
'encodings.iso2022_jp_3',
'encodings.iso2022_jp_ext',
'encodings.iso2022_kr',
'encodings.iso8859_10',
'encodings.iso8859_11',
'encodings.iso8859_13',
'encodings.iso8859_14',
'encodings.iso8859_15',
'encodings.iso8859_16',
'encodings.iso8859_2',
'encodings.iso8859_3',
'encodings.iso8859_4',
'encodings.iso8859_5',
'encodings.iso8859_6',
'encodings.iso8859_7',
'encodings.iso8859_8',
'encodings.iso8859_9',
'encodings.johab',
'encodings.koi8_r',
'encodings.koi8_u',
'encodings.mac_arabic',
'encodings.mac_centeuro',
'encodings.mac_croatian',
'encodings.mac_cyrillic',
'encodings.mac_farsi',
'encodings.mac_greek',
'encodings.mac_iceland',
'encodings.mac_latin2',
'encodings.mac_roman',
'encodings.mac_romanian',
'encodings.mac_turkish',
'encodings.mbcs',
'encodings.palmos',
'encodings.ptcp154',
'encodings.quopri_codec',
'encodings.raw_unicode_escape',
'encodings.rot_13',
'encodings.shift_jis',
'encodings.shift_jis_2004',
'encodings.shift_jisx0213',
'encodings.string_escape',
'encodings.tis_620',
'encodings.undefined',
'encodings.utf_32',
'encodings.utf_32_be',
'encodings.utf_32_le',
'encodings.utf_7',
'encodings.uu_codec',
'encodings.zlib_codec',
'unicodedata',]

a = Analysis(['./bin/fteproxy'],
pathex=['.'],
pathex=['/Users/kpdyer/sandbox/kpdyer/fteproxy'],
hiddenimports=[],
hookspath=None,
excludes=excludesPassedToAnalysis+excludeEncodings,
runtime_hooks=None,
)
pyz = PYZ(a.pure,
level=9)
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
exclude_binaries=True,
name='fteproxy',
debug=False,
strip=True,
strip=None,
upx=True,
console=True)
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='fteproxy')
1 change: 0 additions & 1 deletion fteproxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class NegotiateTimeoutException(Exception):
def fatal_error(msg):
if fteproxy.conf.getValue('runtime.loglevel') in [1,2,3]:
print 'ERROR:', msg
traceback.print_stack()
sys.exit(1)


Expand Down
12 changes: 10 additions & 2 deletions fteproxy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,19 @@ def run(self):
fteproxy.warn('Failed to write PID file to disk: '+pid_file)

if fteproxy.conf.getValue('runtime.mode') == 'client':
incoming_regex = fteproxy.defs.getRegex(self._args.downstream_format)
try:
incoming_regex = fteproxy.defs.getRegex(self._args.downstream_format)
except fteproxy.defs.InvalidRegexName:
fteproxy.fatal_error('Invalid format name '+self._args.downstream_format)

incoming_fixed_slice = fteproxy.defs.getFixedSlice(
self._args.downstream_format)
fte.encoder.DfaEncoder(fteproxy.regex2dfa.regex2dfa(incoming_regex), incoming_fixed_slice)
outgoing_regex = fteproxy.defs.getRegex(self._args.upstream_format)
try:
outgoing_regex = fteproxy.defs.getRegex(self._args.upstream_format)
except InvalidRegexName:
fteproxy.fatal_error('Invalid format name '+self._args.upstream_format)

outgoing_fixed_slice = fteproxy.defs.getFixedSlice(
self._args.upstream_format)
fte.encoder.DfaEncoder(fteproxy.regex2dfa.regex2dfa(outgoing_regex), outgoing_fixed_slice)
Expand Down
94 changes: 0 additions & 94 deletions fteproxy/defs/20131023.json

This file was deleted.

22 changes: 0 additions & 22 deletions fteproxy/defs/20131110.json

This file was deleted.

17 changes: 9 additions & 8 deletions fteproxy/defs/20131224.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"manual-http-response": {
"regex": "^HTTP/1\\.1\\ 200 OK\\r\\nContent-Type:\\ ([a-zA-Z0-9]+)\\r\\n\\r\\n\\C*$"
},
"manual-smb-request": {
"regex": "^\\x00\\x00\\x00\\x7c\\xFF\\x53\\x4d\\x42[\\x25\\x72]\\x00\\x00\\x00\\x00\\C{115}$",
"fixed_slice": 128
},
"manual-smb-response": {
"regex": "^\\x00\\x00\\x00\\x7c\\xFF\\x53\\x4d\\x42[\\x25\\x72]\\x00\\x00\\x00\\x00\\C{115}$",
"fixed_slice": 128
},
# Temporarily disabled, due to Issue #165
# "manual-smb-request": {
# "regex": "^\\x00\\x00\\x00\\x7c\\xFF\\x53\\x4d\\x42[\\x25\\x72]\\x00\\x00\\x00\\x00\\C{115}$",
# "fixed_slice": 128
# },
# "manual-smb-response": {
# "regex": "^\\x00\\x00\\x00\\x7c\\xFF\\x53\\x4d\\x42[\\x25\\x72]\\x00\\x00\\x00\\x00\\C{115}$",
# "fixed_slice": 128
# },
"manual-ssh-request": {
"regex": "^SSH\\-2\\.0\\C*$"
},
Expand Down
Loading

0 comments on commit eddc9b7

Please sign in to comment.