Skip to content

Commit 4442f5b

Browse files
committed
chore: remove debug log
1 parent 2d6ce9d commit 4442f5b

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

crates/interledger-btp/src/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ where
100100
.to_bytes(),
101101
);
102102

103-
// TODO check that the response is a success before proceeding
104103
// (right now we just assume they'll close the connection if the auth didn't work)
105104
let result = connection // this just a stream
106105
.send(auth_packet)

crates/interledger-btp/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ mod client_server {
287287
.build(),
288288
})
289289
.await;
290-
dbg!(&res);
291290
assert!(res.is_ok());
292291
btp_service.close();
293292
}

crates/interledger-btp/src/service.rs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ where
163163

164164
// tx -> rx -> write -> our peer
165165
// Responsible mainly for responding to Pings
166-
// TODO: We must somehow figure out how to merge this stream with the incoming one
167166
let write_to_ws = client_rx.map(Ok).forward(write).then(move |_| {
168167
async move {
169168
debug!(
170169
"Finished forwarding to WebSocket stream for account: {}",
171170
account_id
172171
);
172+
// When this is dropped, the read valve will close
173173
drop(close_connection);
174174
Ok::<(), ()>(())
175175
}
@@ -190,8 +190,8 @@ where
190190
)
191191
};
192192

193-
// Close connections triggers
194-
let read = valve.wrap(read);
193+
// Close connections trigger
194+
let read = valve.wrap(read); // close when `write_to_ws` calls `drop(connection)`
195195
let read = self.stream_valve.wrap(read);
196196
let read_from_ws = read.for_each(handle_message_fn).then(move |_| {
197197
async move {
@@ -202,22 +202,6 @@ where
202202
Ok::<(), ()>(())
203203
}
204204
});
205-
206-
// TODO: How can we drop the trigger when both the read and write spawn'ed futures
207-
// have completed?
208-
// let connections = self.connections.clone();
209-
// let keep_connections_open = self.close_all_connections.clone();
210-
// .then(move |_| {
211-
// let _ = keep_connections_open;
212-
// let mut connections = connections.write();
213-
// connections.remove(&account_id);
214-
// debug!(
215-
// "WebSocket connection closed for account {} ({} connections still open)",
216-
// account_id,
217-
// connections.len()
218-
// );
219-
// future::ready(())
220-
// });
221205
tokio::spawn(read_from_ws);
222206

223207
// Send pings every PING_INTERVAL until the connection closes (when `drop(close_connection)` is called)
@@ -277,7 +261,6 @@ where
277261
Err(reject) => Packet::Reject(reject),
278262
};
279263

280-
// TODO: Is it OK to remove the results from here?
281264
if let Some(connection) = connections_clone.clone().read().get(&account_id) {
282265
let message = ilp_packet_to_ws_message(request_id, packet);
283266
let _ = connection.unbounded_send(message).map_err(move |err| {

0 commit comments

Comments
 (0)