summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
73b0bc6)
In case the config file contains errors, the old code caused
para_client to exit without printing an error message.
We need print_errors == 0 in client_open() because this function
is also used by para_audiod which might not have a controlling
terminal. So use gengetopt's --no-handle-error option that instructs
the command line parser not to exit on errors. This wy we can use
PARA_ERROR_LOG() to log an appropriate error message.
used by the amp filter to pre-amplify the audio stream.
- fix a close-without-open bug in para_write.
- fix a bug in com_init() which was introduced in 0.3.2.
used by the amp filter to pre-amplify the audio stream.
- fix a close-without-open bug in para_write.
- fix a bug in com_init() which was introduced in 0.3.2.
+ - better error diagnostics for para_client.
-----------------------------------------
0.3.2 (2008-04-11) "probabilistic parity"
-----------------------------------------
0.3.2 (2008-04-11) "probabilistic parity"
s.default_timeout.tv_sec = 1;
s.default_timeout.tv_usec = 0;
ret = client_open(argc, argv, &ct);
s.default_timeout.tv_sec = 1;
s.default_timeout.tv_usec = 0;
ret = client_open(argc, argv, &ct);
- if (ret < 0) /* can not use PARA_LOG here */
+ if (ret < 0) /* can not use PARA_LOG here because ct is NULL */
exit(EXIT_FAILURE);
register_task(&svt);
ret = schedule(&s);
exit(EXIT_FAILURE);
register_task(&svt);
ret = schedule(&s);
+args "--no-handle-error"
option "hostname" i "ip or host to connect" string typestr="host" default="localhost" optional
option "user" u "paraslash username" string typestr="username" default="<current user>" optional
option "server_port" p "port to connect" int typestr="port" default="2990" optional
option "hostname" i "ip or host to connect" string typestr="host" default="localhost" optional
option "user" u "paraslash username" string typestr="username" default="<current user>" optional
option "server_port" p "port to connect" int typestr="port" default="2990" optional
*ct_ptr = ct;
ct->fd = -1;
*ct_ptr = ct;
ct->fd = -1;
- ret = client_cmdline_parser(argc, argv, &ct->conf);
+ ret = -E_CLIENT_SYNTAX;
+ if (client_cmdline_parser(argc, argv, &ct->conf))
+ goto out;
HANDLE_VERSION_FLAG("client", ct->conf);
ret = -E_CLIENT_SYNTAX;
if (!ct->conf.inputs_num)
HANDLE_VERSION_FLAG("client", ct->conf);
ret = -E_CLIENT_SYNTAX;
if (!ct->conf.inputs_num)
.override = 0,
.initialize = 0,
.check_required = 0,
.override = 0,
.initialize = 0,
.check_required = 0,
+ .check_ambiguity = 0,
+ .print_errors = 0
- client_cmdline_parser_config_file(ct->config_file,
- &ct->conf, ¶ms);
+ ret = -E_BAD_CONFIG;
+ if (client_cmdline_parser_config_file(ct->config_file,
+ &ct->conf, ¶ms))
+ goto out;
}
ret = 1;
PARA_INFO_LOG("loglevel: %d\n", ct->conf.loglevel_arg);
}
ret = 1;
PARA_INFO_LOG("loglevel: %d\n", ct->conf.loglevel_arg);
PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
PARA_ERROR(INVALID_CHALLENGE, "did not receive valid challenge"), \
PARA_ERROR(NO_CONFIG, "config file not found"), \
PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
PARA_ERROR(INVALID_CHALLENGE, "did not receive valid challenge"), \
PARA_ERROR(NO_CONFIG, "config file not found"), \
+ PARA_ERROR(BAD_CONFIG, "syntax error in config file"), \
PARA_ERROR(CLIENT_AUTH, "authentication failed"), \
PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \
PARA_ERROR(CLIENT_AUTH, "authentication failed"), \
PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \