mirror of
https://github.com/nestriness/cdc-file-transfer.git
synced 2026-05-01 17:03:07 +03:00
[cdc_stream] Append errors from netstart to status (#9)
So far, errors from the remote netstat process would only be logged in the asset stream service, for instance when SSH auth failed. However, the errors were not shown to the client, and that's the most important thing. Also adds some feedback to cdc_stream in case of success.
This commit is contained in:
@@ -135,6 +135,10 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
status = client.StartSession(src_dir, user_host, ssh_port, mount_dir,
|
||||
ssh_command, scp_command);
|
||||
if (status.ok()) {
|
||||
LOG_INFO("Started streaming directory '%s' to '%s:%s'", src_dir,
|
||||
user_host, mount_dir);
|
||||
}
|
||||
} else /* if (command == "stop") */ {
|
||||
if (args.size() < 3) {
|
||||
LOG_ERROR(
|
||||
@@ -147,6 +151,9 @@ int main(int argc, char* argv[]) {
|
||||
if (!ParseUserHostDir(args[2], &user_host, &mount_dir)) return 1;
|
||||
|
||||
status = client.StopSession(user_host, mount_dir);
|
||||
if (status.ok()) {
|
||||
LOG_INFO("Stopped streaming session to '%s:%s'", user_host, mount_dir);
|
||||
}
|
||||
}
|
||||
|
||||
if (!status.ok()) {
|
||||
|
||||
Reference in New Issue
Block a user