From c0560fa698b0a8ff34da97199b383ddc6e400915 Mon Sep 17 00:00:00 2001 From: orn1983 Date: Wed, 8 Aug 2018 12:48:28 +0000 Subject: [PATCH] Fix indentation in gen_request so count works Specifying count was ignored and everything ran once due to wrong indentation. Sometimes if you didn't specify count, everything would just hang. This fixes that as well. --- sipping.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sipping.py b/sipping.py index bde9432..deed07c 100755 --- a/sipping.py +++ b/sipping.py @@ -225,15 +225,15 @@ def gen_request(template_vars, options): except Exception, e: sys.stderr.write("ERROR: cannot open file %s. %s\n" % (options.request_template, e)) sys.exit(-1) - try: - req = Request(request) - except SipUnpackError, e: - sys.stderr.write("ERROR: malformed SIP Request. %s\n" % e) - sys.exit(-1) - - if "cseq" not in req.headers: - req.headers["cseq"] = "%d %s" % (i, req.method) - yield str(req) + try: + req = Request(request) + except SipUnpackError, e: + sys.stderr.write("ERROR: malformed SIP Request. %s\n" % e) + sys.exit(-1) + + if "cseq" not in req.headers: + req.headers["cseq"] = "%d %s" % (i, req.method) + yield str(req) def open_sock(options):