summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-07-05 01:15:03 +0200
committerGitHub <noreply@github.com>2020-07-04 19:15:03 -0400
commite4e80f20c2f85cfb9ea1ae1a499ac24fd206f99b (patch)
tree70a327941a09faa64e54dc86b0a0a5df339cf5de
parentd52e4007c887caaa073e43088fd92c3589a41dd5 (diff)
fix(tools): command line args parsing bug, unused function parameter (#6629)
-rw-r--r--cli/tests/echo_server.ts2
-rwxr-xr-xtools/http_benchmark.py12
2 files changed, 6 insertions, 8 deletions
diff --git a/cli/tests/echo_server.ts b/cli/tests/echo_server.ts
index 48b43aca6..deab17397 100644
--- a/cli/tests/echo_server.ts
+++ b/cli/tests/echo_server.ts
@@ -1,4 +1,4 @@
-const addr = Deno.args[1] || "0.0.0.0:4544";
+const addr = Deno.args[0] || "0.0.0.0:4544";
const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) });
console.log("listening on", addr);
diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py
index a4576695c..b92ce756e 100755
--- a/tools/http_benchmark.py
+++ b/tools/http_benchmark.py
@@ -14,19 +14,17 @@ import third_party
# "deno_http" was once called "deno_net_http"
DURATION = "20s"
-
-LAST_PORT = 4544
+NEXT_PORT = 4544
def server_addr(port):
return "0.0.0.0:%s" % port
-def get_port(port=None):
- global LAST_PORT
- if port is None:
- port = LAST_PORT
- LAST_PORT = LAST_PORT + 1
+def get_port():
+ global NEXT_PORT
+ port = NEXT_PORT
+ NEXT_PORT += 1
# Return port as str because all usages below are as a str and having it an
# integer just adds complexity.
return str(port)