diff options
| author | 2009-08-19 01:39:16 +0200 | |
|---|---|---|
| committer | 2009-08-19 03:56:09 +0200 | |
| commit | acfba6464bd57bdd0549f083f83b12ff9909337f (patch) | |
| tree | 824f942e9ffef08d241d268f407c9b4ccd19f785 /usbmuxd/client.c | |
| parent | 3a6f72edfb352ab57f58fb4fe4b6314daaddb362 (diff) | |
| download | usbmuxd-acfba6464bd57bdd0549f083f83b12ff9909337f.tar.gz usbmuxd-acfba6464bd57bdd0549f083f83b12ff9909337f.tar.bz2 | |
Remove trailing whitespace errors
Diffstat (limited to 'usbmuxd/client.c')
| -rw-r--r-- | usbmuxd/client.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usbmuxd/client.c b/usbmuxd/client.c index b33d892..7a3160f 100644 --- a/usbmuxd/client.c +++ b/usbmuxd/client.c | |||
| @@ -105,11 +105,11 @@ int client_accept(int listenfd) | |||
| 105 | usbmuxd_log(LL_ERROR, "accept() failed (%s)", strerror(errno)); | 105 | usbmuxd_log(LL_ERROR, "accept() failed (%s)", strerror(errno)); |
| 106 | return cfd; | 106 | return cfd; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | struct mux_client *client; | 109 | struct mux_client *client; |
| 110 | client = malloc(sizeof(struct mux_client)); | 110 | client = malloc(sizeof(struct mux_client)); |
| 111 | memset(client, 0, sizeof(struct mux_client)); | 111 | memset(client, 0, sizeof(struct mux_client)); |
| 112 | 112 | ||
| 113 | client->fd = cfd; | 113 | client->fd = cfd; |
| 114 | client->ob_buf = malloc(REPLY_BUF_SIZE); | 114 | client->ob_buf = malloc(REPLY_BUF_SIZE); |
| 115 | client->ob_size = 0; | 115 | client->ob_size = 0; |
| @@ -119,9 +119,9 @@ int client_accept(int listenfd) | |||
| 119 | client->ib_capacity = CMD_BUF_SIZE; | 119 | client->ib_capacity = CMD_BUF_SIZE; |
| 120 | client->state = CLIENT_COMMAND; | 120 | client->state = CLIENT_COMMAND; |
| 121 | client->events = POLLIN; | 121 | client->events = POLLIN; |
| 122 | 122 | ||
| 123 | collection_add(&client_list, client); | 123 | collection_add(&client_list, client); |
| 124 | 124 | ||
| 125 | usbmuxd_log(LL_INFO, "New client on fd %d", client->fd); | 125 | usbmuxd_log(LL_INFO, "New client on fd %d", client->fd); |
| 126 | return client->fd; | 126 | return client->fd; |
| 127 | } | 127 | } |
| @@ -216,14 +216,14 @@ static int start_listen(struct mux_client *client) | |||
| 216 | struct device_info *devs; | 216 | struct device_info *devs; |
| 217 | struct device_info *dev; | 217 | struct device_info *dev; |
| 218 | int count, i; | 218 | int count, i; |
| 219 | 219 | ||
| 220 | client->state = CLIENT_LISTEN; | 220 | client->state = CLIENT_LISTEN; |
| 221 | count = device_get_count(); | 221 | count = device_get_count(); |
| 222 | if(!count) | 222 | if(!count) |
| 223 | return 0; | 223 | return 0; |
| 224 | devs = malloc(sizeof(struct device_info) * count); | 224 | devs = malloc(sizeof(struct device_info) * count); |
| 225 | count = device_get_list(devs); | 225 | count = device_get_list(devs); |
| 226 | 226 | ||
| 227 | // going to need a larger buffer for many devices | 227 | // going to need a larger buffer for many devices |
| 228 | int needed_buffer = count * (sizeof(struct client_msg_dev) + sizeof(struct client_header)) + REPLY_BUF_SIZE; | 228 | int needed_buffer = count * (sizeof(struct client_msg_dev) + sizeof(struct client_header)) + REPLY_BUF_SIZE; |
| 229 | if(client->ob_capacity < needed_buffer) { | 229 | if(client->ob_capacity < needed_buffer) { |
| @@ -246,7 +246,7 @@ static int client_command(struct mux_client *client, struct client_header *hdr, | |||
| 246 | { | 246 | { |
| 247 | int res; | 247 | int res; |
| 248 | 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); | 248 | 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); |
| 249 | 249 | ||
| 250 | if(client->state != CLIENT_COMMAND) { | 250 | if(client->state != CLIENT_COMMAND) { |
| 251 | usbmuxd_log(LL_ERROR, "Client %d command received in the wrong state", client->fd); | 251 | usbmuxd_log(LL_ERROR, "Client %d command received in the wrong state", client->fd); |
| 252 | if(send_result(client, hdr->tag, RESULT_BADCOMMAND) < 0) | 252 | if(send_result(client, hdr->tag, RESULT_BADCOMMAND) < 0) |
| @@ -254,7 +254,7 @@ static int client_command(struct mux_client *client, struct client_header *hdr, | |||
| 254 | client_close(client); | 254 | client_close(client); |
| 255 | return -1; | 255 | return -1; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | struct client_msg_connect *ch; | 258 | struct client_msg_connect *ch; |
| 259 | switch(hdr->message) { | 259 | switch(hdr->message) { |
| 260 | case MESSAGE_LISTEN: | 260 | case MESSAGE_LISTEN: |
| @@ -392,7 +392,7 @@ void client_process(int fd, short events) | |||
| 392 | process_send(client); | 392 | process_send(client); |
| 393 | } | 393 | } |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | void client_device_add(struct device_info *dev) | 398 | void client_device_add(struct device_info *dev) |
| @@ -401,7 +401,7 @@ void client_device_add(struct device_info *dev) | |||
| 401 | FOREACH(struct mux_client *client, &client_list) { | 401 | FOREACH(struct mux_client *client, &client_list) { |
| 402 | if(client->state == CLIENT_LISTEN) | 402 | if(client->state == CLIENT_LISTEN) |
| 403 | notify_device(client, dev); | 403 | notify_device(client, dev); |
| 404 | } ENDFOREACH | 404 | } ENDFOREACH |
| 405 | } | 405 | } |
| 406 | void client_device_remove(int device_id) | 406 | void client_device_remove(int device_id) |
| 407 | { | 407 | { |
