From 45daae5b64ca849fc474637d9501e04bf2c92573 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 26 Apr 2018 13:35:05 +0200 Subject: [PATCH] Now tentacle server errors are more descriptives --- pandora_agents/pc/tentacle_server | 10 +++++----- pandora_agents/unix/tentacle_server | 10 +++++----- pandora_server/bin/tentacle_server | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pandora_agents/pc/tentacle_server b/pandora_agents/pc/tentacle_server index 283324b5ff..70af419f13 100755 --- a/pandora_agents/pc/tentacle_server +++ b/pandora_agents/pc/tentacle_server @@ -929,14 +929,14 @@ sub recv_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (invalid file name)\n"); return; } # Check file size, empty files are not allowed if ($size < 1 || $size > $t_max_size) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file is too big)\n"); return; } @@ -946,7 +946,7 @@ sub recv_file { # Check if file exists if (-f $file && $t_overwrite == 0) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file already exists)\n"); return; } @@ -979,7 +979,7 @@ sub send_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file has an invalid file name)\n"); return; } @@ -989,7 +989,7 @@ sub send_file { # Check if file exists if (! -f $file) { print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file does not exist)\n"); return; } diff --git a/pandora_agents/unix/tentacle_server b/pandora_agents/unix/tentacle_server index 283324b5ff..70af419f13 100755 --- a/pandora_agents/unix/tentacle_server +++ b/pandora_agents/unix/tentacle_server @@ -929,14 +929,14 @@ sub recv_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (invalid file name)\n"); return; } # Check file size, empty files are not allowed if ($size < 1 || $size > $t_max_size) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file is too big)\n"); return; } @@ -946,7 +946,7 @@ sub recv_file { # Check if file exists if (-f $file && $t_overwrite == 0) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file already exists)\n"); return; } @@ -979,7 +979,7 @@ sub send_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file has an invalid file name)\n"); return; } @@ -989,7 +989,7 @@ sub send_file { # Check if file exists if (! -f $file) { print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file does not exist)\n"); return; } diff --git a/pandora_server/bin/tentacle_server b/pandora_server/bin/tentacle_server index 283324b5ff..70af419f13 100755 --- a/pandora_server/bin/tentacle_server +++ b/pandora_server/bin/tentacle_server @@ -929,14 +929,14 @@ sub recv_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (invalid file name)\n"); return; } # Check file size, empty files are not allowed if ($size < 1 || $size > $t_max_size) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file is too big)\n"); return; } @@ -946,7 +946,7 @@ sub recv_file { # Check if file exists if (-f $file && $t_overwrite == 0) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file already exists)\n"); return; } @@ -979,7 +979,7 @@ sub send_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file has an invalid file name)\n"); return; } @@ -989,7 +989,7 @@ sub send_file { # Check if file exists if (! -f $file) { print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file does not exist)\n"); return; }