summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rick Mark2020-05-07 09:06:40 -0700
committerGravatar Rick Mark2020-05-07 09:06:40 -0700
commit68d4d1c89d462ebbeb3cf51120fe96813377a0f6 (patch)
tree64975bb208824759e239c749fb8876de1157d6e1
parentb6471b7343217a001e1bc1d63eb6fd8550577799 (diff)
downloadusbmuxd-68d4d1c89d462ebbeb3cf51120fe96813377a0f6.tar.gz
usbmuxd-68d4d1c89d462ebbeb3cf51120fe96813377a0f6.tar.bz2
Show debug message upon successful connection
-rw-r--r--src/device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index 5e32ce2..6858cf5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -224,7 +224,7 @@ static int send_packet(struct mux_device *dev, enum mux_protocol proto, void *he
mhdr->tx_seq = htons(dev->tx_seq);
mhdr->rx_seq = htons(dev->rx_seq);
dev->tx_seq++;
- }
+ }
memcpy(buffer + mux_header_size, header, hdrlen);
if(data && length)
memcpy(buffer + mux_header_size + hdrlen, data, length);
@@ -690,6 +690,7 @@ static void device_tcp_input(struct mux_device *dev, struct tcphdr *th, unsigned
return;
}
conn->state = CONN_CONNECTED;
+ usbmuxd_log(LL_DEBUG, "Client connected to device %d (%d->%d)", dev->id, sport, dport);
if(client_notify_connect(conn->client, RESULT_OK) < 0) {
conn->client = NULL;
connection_teardown(conn);
@@ -978,8 +979,8 @@ void device_check_timeouts(void)
FOREACH(struct mux_device *dev, &device_list) {
if(dev->state == MUXDEV_ACTIVE) {
FOREACH(struct mux_connection *conn, &dev->connections) {
- if((conn->state == CONN_CONNECTED) &&
- (conn->flags & CONN_ACK_PENDING) &&
+ if((conn->state == CONN_CONNECTED) &&
+ (conn->flags & CONN_ACK_PENDING) &&
(ct - conn->last_ack_time) > ACK_TIMEOUT) {
usbmuxd_log(LL_DEBUG, "Sending ACK due to expired timeout (%" PRIu64 " -> %" PRIu64 ")", conn->last_ack_time, ct);
send_tcp_ack(conn);