summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-08-25 13:20:33 +0200
committerGravatar Nikias Bassen2009-08-25 13:20:33 +0200
commita9712a41ca2324cfa4e275453299772bee662726 (patch)
tree9a2d6f012e84ab1656ecf096ae93663096496fd1
parent4711a2b493f76561e9803bf7e8be77186f3e7798 (diff)
downloadusbmuxd-a9712a41ca2324cfa4e275453299772bee662726.tar.gz
usbmuxd-a9712a41ca2324cfa4e275453299772bee662726.tar.bz2
Make usbmuxd_connect work again, MESSAGE_CONNECT processing was broken.
-rw-r--r--daemon/client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/client.c b/daemon/client.c
index 0e47e84..0ba1c24 100644
--- a/daemon/client.c
+++ b/daemon/client.c
@@ -242,7 +242,7 @@ static int start_listen(struct mux_client *client)
return count;
}
-static int client_command(struct mux_client *client, struct usbmuxd_header *hdr, const char *payload)
+static int client_command(struct mux_client *client, struct usbmuxd_header *hdr)
{
int res;
usbmuxd_log(LL_DEBUG, "Client command in fd %d len %d ver %d msg %d tag %d", client->fd, hdr->length, hdr->version, hdr->message, hdr->tag);
@@ -263,7 +263,7 @@ static int client_command(struct mux_client *client, struct usbmuxd_header *hdr,
usbmuxd_log(LL_DEBUG, "Client %d now LISTENING", client->fd);
return start_listen(client);
case MESSAGE_CONNECT:
- ch = (void*)payload;
+ ch = (void*)hdr;
usbmuxd_log(LL_DEBUG, "Client %d connection request to device %d port %d", client->fd, ch->device_id, ntohs(ch->port));
res = device_start_connect(ch->device_id, ntohs(ch->port), client);
if(res < 0) {
@@ -363,7 +363,7 @@ static void process_recv(struct mux_client *client)
if(client->ib_size < hdr->length)
return;
}
- client_command(client, hdr, (char *)(hdr+1));
+ client_command(client, hdr);
client->ib_size = 0;
}