mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 03:44:52 -04:00
add a persistent cache of URL lookups, and fix up the in-memory one to work
This commit is contained in:
parent
d1b154a10f
commit
7426c86eb8
4 changed files with 137 additions and 14 deletions
|
@ -251,8 +251,8 @@ class SimpleHttpClient(object):
|
|||
url (str): The URL to GET
|
||||
output_stream (file): File to write the response body to.
|
||||
Returns:
|
||||
A (int,dict) tuple of the file length and a dict of the response
|
||||
headers.
|
||||
A (int,dict,string,int) tuple of the file length, dict of the response
|
||||
headers, absolute URI of the response and HTTP response code.
|
||||
"""
|
||||
|
||||
response = yield self.request(
|
||||
|
@ -287,7 +287,7 @@ class SimpleHttpClient(object):
|
|||
logger.exception("Failed to download body")
|
||||
raise
|
||||
|
||||
defer.returnValue((length, headers, response.request.absoluteURI))
|
||||
defer.returnValue((length, headers, response.request.absoluteURI, response.code))
|
||||
|
||||
|
||||
# XXX: FIXME: This is horribly copy-pasted from matrixfederationclient.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue