Now tentacle server errors are more descriptives

This commit is contained in:
fermin831 2018-04-26 13:35:05 +02:00
parent 21f6c7e650
commit 45daae5b64
3 changed files with 15 additions and 15 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}