Made payment process loop

This commit is contained in:
James Kasten 2012-11-18 22:52:47 -05:00
parent 946c6e584c
commit 51d108f648

View file

@ -541,7 +541,7 @@ def authenticate():
# This should be invoked if a payment is necessary
# This is being tested and will have to be cleaned and organized
# once the protocol is finalized.
if r.challenge and all_payment_challenge(r):
while r.challenge and all_payment_challenge(r):
# dont need to change domain names here
paymentChallenges, temp = challenge_factory(r, os.path.abspath(req_file), os.path.abspath(key_file), config)
for chall in paymentChallenges:
@ -556,7 +556,7 @@ def authenticate():
# Send the proceed message
r = decode(do(upstream, k))
while r.proceed.IsInitialized() or r.challenge:
while r.proceed.IsInitialized():
if r.proceed.IsInitialized():
delay = min(r.proceed.polldelay, 60)
logger.debug("waiting %d" % delay)