summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-10-23 14:47:49 +0100
committerGitHub <noreply@github.com>2017-10-23 14:47:49 +0100
commitecf198aab8c92be436051fe791e0a7501e51e767 (patch)
tree82f4048e673a3de4c26a2632a69aba90adcfecd0 /synapse
parentMerge pull request #2561 from matrix-org/rav/id_checking (diff)
parentFix a logcontext leak in the media repo (diff)
downloadsynapse-ecf198aab8c92be436051fe791e0a7501e51e767.tar.xz
Merge pull request #2566 from matrix-org/rav/media_logcontext_leak
Fix a logcontext leak in the media repo
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/media/v1/_base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/_base.py b/synapse/rest/media/v1/_base.py
index b9600f2167..bce077becf 100644
--- a/synapse/rest/media/v1/_base.py
+++ b/synapse/rest/media/v1/_base.py
@@ -17,6 +17,7 @@ from synapse.http.server import respond_with_json, finish_request
 from synapse.api.errors import (
     cs_error, Codes, SynapseError
 )
+from synapse.util import logcontext
 
 from twisted.internet import defer
 from twisted.protocols.basic import FileSender
@@ -103,7 +104,9 @@ def respond_with_file(request, media_type, file_path,
         )
 
         with open(file_path, "rb") as f:
-            yield FileSender().beginFileTransfer(f, request)
+            yield logcontext.make_deferred_yieldable(
+                FileSender().beginFileTransfer(f, request)
+            )
 
         finish_request(request)
     else: