Skip to content

Commit 5342a4c

Browse files
committed
core: remove useless Env.PORT var (closes #71)
1 parent b4d4635 commit 5342a4c

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/core/session/compat_session.py

-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def set_env(self, old_session):
148148
result["PATH_SEP"] = old_session["SERVER"]["separator"]
149149
result["HTTP_SOFTWARE"] = old_session["SERVER"]["soft"]
150150
result["USER"] = old_session["SERVER"]["user"]
151-
result["PORT"] = old_session["SERVER"]["port"]
152151
result["CLIENT_ADDR"] = old_session["SERVER"]["client_addr"]
153152

154153
# $PLATFORM
@@ -214,7 +213,6 @@ def set_env(self, old_session):
214213
result["HTTP_SOFTWARE"] = old_session["SRV"]["soft"]
215214
result["USER"] = old_session["SRV"]["user"]
216215
result["WEB_ROOT"] = old_session["SRV"]["webroot"]
217-
result["PORT"] = old_session["SRV"]["port"]
218216
result["CLIENT_ADDR"] = old_session["SRV"]["client_addr"]
219217

220218
# $PLATFORM

src/core/tunnel/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ def open(self):
6060
session.Env.update(socket.environ)
6161
self.socket = socket
6262
self.hostname = socket.socket.hostname
63-
print("[*] Shell obtained by PHP (%s -> %s:%s)\n"
63+
print("[*] Shell obtained by PHP (%s -> %s)\n"
6464
% (session.Env.CLIENT_ADDR,
65-
session.Env.ADDR,
66-
session.Env.PORT))
65+
session.Env.ADDR))
6766
print("Connected to %s server (%s)"
6867
% (session.Env.PLATFORM.capitalize(),
6968
session.Env.HOST))

src/core/tunnel/connector.py

-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def choose(options, default=''):
7474
env['HOST'] = choose(['SERVER_NAME', 'HTTP_HOST'],
7575
self.socket.hostname)
7676

77-
env['PORT'] = choose(['SERVER_PORT'], self.socket.port)
78-
7977
env['ADDR'] = choose(['SERVER_ADDR', 'LOCAL_ADDR'], env['HOST'])
8078
if ":" in env['ADDR']: # enclose with brackets if ipv6
8179
env["ADDR"] = "[%s]" % env["ADDR"]

0 commit comments

Comments
 (0)