summary refs log tree commit diff
path: root/synapse/federation/transport.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/federation/transport.py')
-rw-r--r--synapse/federation/transport.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index 1f864f5fa7..48fc9fbf5e 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -163,27 +163,15 @@ class TransportLayer(object):
         if transaction.destination == self.server_name:
             raise RuntimeError("Transport layer cannot send to itself!")
 
-        if json_data_callback is None:
-            def json_data_callback():
-                return transaction.get_dict()
-
-        # FIXME (erikj): This is a bit of a hack to make the Pdu age
-        # keys work
-        def cb(destination, method, path_bytes, producer):
-            json_data = json_data_callback()
-            del json_data["destination"]
-            del json_data["transaction_id"]
-            producer.reset(json_data)
-
+        # FIXME: This is only used by the tests. The actual json sent is
+        # generated by the json_data_callback.
         json_data = transaction.get_dict()
-        del json_data["destination"]
-        del json_data["transaction_id"]
 
         code, response = yield self.client.put_json(
             transaction.destination,
             path=PREFIX + "/send/%s/" % transaction.transaction_id,
             data=json_data,
-            on_send_callback=cb,
+            json_data_callback=json_data_callback,
         )
 
         logger.debug(