mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 14:49:29 +00:00
Cleaning code for pull request
This commit is contained in:
parent
f1fafa506d
commit
1e607c6445
6 changed files with 27 additions and 40 deletions
|
@ -570,8 +570,8 @@ parse_serve_args(const char *optarg, char **s_protocol, uint32_t *s_ip, uint16_t
|
|||
char *ip = NULL;
|
||||
uint32_t ip_value;
|
||||
char *port = NULL;
|
||||
|
||||
char **values;
|
||||
|
||||
values = str_split(optarg, ':');
|
||||
|
||||
if (values) {
|
||||
|
@ -755,8 +755,7 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
|||
case OPT_SERVE:
|
||||
if (!parse_serve_args(optarg, &opts->serve_protocol, &opts->serve_ip, &opts->serve_port)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
opts->serve = true;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -309,7 +309,7 @@ scrcpy(const struct scrcpy_options *options) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!server_start(&server, options->serial, ¶ms, serv)) {
|
||||
if (!server_start(&server, options->serial, ¶ms)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ run_wait_server(void *data) {
|
|||
|
||||
bool
|
||||
server_start(struct server *server, const char *serial,
|
||||
const struct server_params *params, struct serve* serve) {
|
||||
const struct server_params *params) {
|
||||
server->port_range = params->port_range;
|
||||
|
||||
if (serial) {
|
||||
|
@ -368,22 +368,10 @@ server_start(struct server *server, const char *serial,
|
|||
goto error1;
|
||||
}
|
||||
|
||||
/*server->serve = serve;
|
||||
if (server->serve) {
|
||||
if (server->serve->isServeReady == true) {
|
||||
server->process = execute_server(server, params);
|
||||
if (server->process == PROCESS_NONE) {
|
||||
goto error2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {*/
|
||||
// server will connect to our server socket
|
||||
server->process = execute_server(server, params);
|
||||
if (server->process == PROCESS_NONE) {
|
||||
goto error2;
|
||||
}
|
||||
//}
|
||||
|
||||
// If the server process dies before connecting to the server socket, then
|
||||
// the client will be stuck forever on accept(). To avoid the problem, we
|
||||
|
|
|
@ -61,7 +61,7 @@ server_init(struct server *server);
|
|||
// push, enable tunnel et start the server
|
||||
bool
|
||||
server_start(struct server *server, const char *serial,
|
||||
const struct server_params *params, struct serve* serve);
|
||||
const struct server_params *params);
|
||||
|
||||
// block until the communication with the server is established
|
||||
bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue