Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
34ea1413
Commit
34ea1413
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fixup docstrings for matrixfederationclient
parent
d91b99ab
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/matrixfederationclient.py
+73
-68
73 additions, 68 deletions
synapse/http/matrixfederationclient.py
with
73 additions
and
68 deletions
synapse/http/matrixfederationclient.py
+
73
−
68
View file @
34ea1413
...
@@ -229,19 +229,18 @@ class MatrixFederationHttpClient(object):
...
@@ -229,19 +229,18 @@ class MatrixFederationHttpClient(object):
backoff_on_404 (bool): Back off if we get a 404
backoff_on_404 (bool): Back off if we get a 404
Returns:
Returns:
Deferred: resolves with the http response object on success.
Deferred[twisted.web.client.Response]: resolves with the HTTP
response object on success.
Fails with ``HttpResponseException``: if we get an HTTP response
code >= 300 (except 429).
Raises:
HttpResponseException: If we get an HTTP response code >= 300
Fails with ``NotRetryingDestination`` if we are not yet ready
(except 429).
to retry this server.
NotRetryingDestination: If we are not yet ready to retry this
server.
Fails with ``FederationDeniedError`` if this destination
FederationDeniedError: If this destination is not on our
is not on our federation whitelist
federation whitelist
RequestSendFailed: If there were problems connecting to the
Fails with ``RequestSendFailed`` if there were problems connecting to
remote, due to e.g. DNS failures, connection timeouts etc.
the remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
if
timeout
:
if
timeout
:
_sec_timeout
=
timeout
/
1000
_sec_timeout
=
timeout
/
1000
...
@@ -516,17 +515,18 @@ class MatrixFederationHttpClient(object):
...
@@ -516,17 +515,18 @@ class MatrixFederationHttpClient(object):
requests)
requests)
Returns:
Returns:
Deferred: Succeeds when we get a 2xx HTTP response. The result
Deferred[dict|list]: Succeeds when we get a 2xx HTTP response. The
will be the decoded JSON body.
result will be the decoded JSON body.
Fails with ``HttpResponseException`` if we get an HTTP response
Raises:
code >= 300.
HttpResponseException: If we get an HTTP response code >= 300
(except 429).
Fails with ``NotRetryingDestination`` if we are not yet ready
NotRetryingDestination: If we are not yet ready to retry this
to retry this server.
server.
FederationDeniedError: If this destination is not on our
Fails with ``FederationDeniedError`` if this destination
federation whitelist
is not on our federation whitelist
RequestSendFailed: If there were problems connecting to the
remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
request
=
MatrixFederationRequest
(
request
=
MatrixFederationRequest
(
...
@@ -570,17 +570,18 @@ class MatrixFederationHttpClient(object):
...
@@ -570,17 +570,18 @@ class MatrixFederationHttpClient(object):
try the request anyway.
try the request anyway.
args (dict): query params
args (dict): query params
Returns:
Returns:
Deferred: Succeeds when we get a 2xx HTTP response. The result
Deferred[dict|list]: Succeeds when we get a 2xx HTTP response. The
will be the decoded JSON body.
result will be the decoded JSON body.
Fails with ``HttpResponseException`` if we get an HTTP response
Raises:
code >= 300.
HttpResponseException: If we get an HTTP response code >= 300
(except 429).
Fails with ``NotRetryingDestination`` if we are not yet ready
NotRetryingDestination: If we are not yet ready to retry this
to retry this server.
server.
FederationDeniedError: If this destination is not on our
Fails with ``FederationDeniedError`` if this destination
federation whitelist
is not on our federation whitelist
RequestSendFailed: If there were problems connecting to the
remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
request
=
MatrixFederationRequest
(
request
=
MatrixFederationRequest
(
...
@@ -625,17 +626,18 @@ class MatrixFederationHttpClient(object):
...
@@ -625,17 +626,18 @@ class MatrixFederationHttpClient(object):
ignore_backoff (bool): true to ignore the historical backoff data
ignore_backoff (bool): true to ignore the historical backoff data
and try the request anyway.
and try the request anyway.
Returns:
Returns:
Deferred: Succeeds when we get a 2xx HTTP response. The result
Deferred[dict|list]: Succeeds when we get a 2xx HTTP response. The
will be the decoded JSON body.
result will be the decoded JSON body.
Fails with ``HttpResponseException`` if we get an HTTP response
Raises:
code >= 300.
HttpResponseException: If we get an HTTP response code >= 300
(except 429).
Fails with ``NotRetryingDestination`` if we are not yet ready
NotRetryingDestination: If we are not yet ready to retry this
to retry this server.
server.
FederationDeniedError: If this destination is not on our
Fails with ``FederationDeniedError`` if this destination
federation whitelist
is not on our federation whitelist
RequestSendFailed: If there were problems connecting to the
remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
logger
.
debug
(
"
get_json args: %s
"
,
args
)
logger
.
debug
(
"
get_json args: %s
"
,
args
)
...
@@ -676,17 +678,18 @@ class MatrixFederationHttpClient(object):
...
@@ -676,17 +678,18 @@ class MatrixFederationHttpClient(object):
ignore_backoff (bool): true to ignore the historical backoff data and
ignore_backoff (bool): true to ignore the historical backoff data and
try the request anyway.
try the request anyway.
Returns:
Returns:
Deferred: Succeeds when we get a 2xx HTTP response. The result
Deferred[dict|list]: Succeeds when we get a 2xx HTTP response. The
will be the decoded JSON body.
result will be the decoded JSON body.
Fails with ``HttpResponseException`` if we get an HTTP response
Raises:
code >= 300.
HttpResponseException: If we get an HTTP response code >= 300
(except 429).
Fails with ``NotRetryingDestination`` if we are not yet ready
NotRetryingDestination: If we are not yet ready to retry this
to retry this server.
server.
FederationDeniedError: If this destination is not on our
Fails with ``FederationDeniedError`` if this destination
federation whitelist
is not on our federation whitelist
RequestSendFailed: If there were problems connecting to the
remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
request
=
MatrixFederationRequest
(
request
=
MatrixFederationRequest
(
method
=
"
DELETE
"
,
method
=
"
DELETE
"
,
...
@@ -719,18 +722,20 @@ class MatrixFederationHttpClient(object):
...
@@ -719,18 +722,20 @@ class MatrixFederationHttpClient(object):
args (dict): Optional dictionary used to create the query string.
args (dict): Optional dictionary used to create the query string.
ignore_backoff (bool): true to ignore the historical backoff data
ignore_backoff (bool): true to ignore the historical backoff data
and try the request anyway.
and try the request anyway.
Returns:
Deferred: resolves with an (int,dict) tuple of the file length and
a dict of the response headers.
Fails with ``HttpResponseException`` if we get an HTTP response code
>= 300
Fails with ``NotRetryingDestination`` if we are not yet ready
Returns:
to retry this server.
Deferred[tuple[int, dict]]: Resolves with an (int,dict) tuple of
the file length and a dict of the response headers.
Fails with ``FederationDeniedError`` if this destination
is not on our federation whitelist
Raises:
HttpResponseException: If we get an HTTP response code >= 300
(except 429).
NotRetryingDestination: If we are not yet ready to retry this
server.
FederationDeniedError: If this destination is not on our
federation whitelist
RequestSendFailed: If there were problems connecting to the
remote, due to e.g. DNS failures, connection timeouts etc.
"""
"""
request
=
MatrixFederationRequest
(
request
=
MatrixFederationRequest
(
method
=
"
GET
"
,
method
=
"
GET
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment