mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
fe21bf186f
commit
7eadf1c5c1
@ -75,7 +75,7 @@ MD5_SESS = "MD5-sess"
|
|||||||
AUTH = "auth"
|
AUTH = "auth"
|
||||||
AUTH_INT = "auth-int"
|
AUTH_INT = "auth-int"
|
||||||
|
|
||||||
SUPPORTED_ALGORITHM = ('md5', MD5, MD5_SESS)
|
SUPPORTED_ALGORITHM = ('md5', MD5, MD5_SESS) # Changed by Kovid
|
||||||
SUPPORTED_QOP = (AUTH, AUTH_INT)
|
SUPPORTED_QOP = (AUTH, AUTH_INT)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -83,7 +83,7 @@ SUPPORTED_QOP = (AUTH, AUTH_INT)
|
|||||||
#
|
#
|
||||||
DIGEST_AUTH_ENCODERS = {
|
DIGEST_AUTH_ENCODERS = {
|
||||||
MD5: lambda val: md5(val).hexdigest(),
|
MD5: lambda val: md5(val).hexdigest(),
|
||||||
'md5': lambda val:md5(val).hexdigest(),
|
'md5': lambda val:md5(val).hexdigest(), # Added by Kovid
|
||||||
MD5_SESS: lambda val: md5(val).hexdigest(),
|
MD5_SESS: lambda val: md5(val).hexdigest(),
|
||||||
# SHA: lambda val: sha(val).hexdigest(),
|
# SHA: lambda val: sha(val).hexdigest(),
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ def _A1(params, password):
|
|||||||
algorithm = params.get ("algorithm", MD5)
|
algorithm = params.get ("algorithm", MD5)
|
||||||
H = DIGEST_AUTH_ENCODERS[algorithm]
|
H = DIGEST_AUTH_ENCODERS[algorithm]
|
||||||
|
|
||||||
if algorithm in (MD5, 'md5'):
|
if algorithm in (MD5, 'md5'): # Changed by Kovid
|
||||||
# If the "algorithm" directive's value is "MD5" or is
|
# If the "algorithm" directive's value is "MD5" or is
|
||||||
# unspecified, then A1 is:
|
# unspecified, then A1 is:
|
||||||
# A1 = unq(username-value) ":" unq(realm-value) ":" passwd
|
# A1 = unq(username-value) ":" unq(realm-value) ":" passwd
|
||||||
|
@ -241,10 +241,10 @@ def wait_for_free_port(host, port):
|
|||||||
for trial in xrange(50):
|
for trial in xrange(50):
|
||||||
try:
|
try:
|
||||||
# we are expecting a free port, so reduce the timeout
|
# we are expecting a free port, so reduce the timeout
|
||||||
check_port(host, port, timeout=0.2)
|
check_port(host, port, timeout=0.2) # Changed by Kovid
|
||||||
except IOError:
|
except IOError:
|
||||||
# Give the old server thread time to free the port.
|
# Give the old server thread time to free the port.
|
||||||
time.sleep(0.2)
|
time.sleep(0.2) # Changed by Kovid
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user