Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/nameserver/nameserver_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,6 @@ void NameServerImpl::DiskUsage(::google::protobuf::RpcController* controller,
}
response->set_sequence_id(request->sequence_id());
std::string path = NameSpace::NormalizePath(request->path());
if (path.empty() || path[0] != '/') {
response->set_status(kBadParameter);
done->Run();
return;
}
uint64_t du_size = 0;
StatusCode ret_status = namespace_->DiskUsage(path, &du_size);
response->set_status(ret_status);
Expand All @@ -860,13 +855,13 @@ void NameServerImpl::DeleteDirectory(::google::protobuf::RpcController* controll
return;
}
response->set_sequence_id(request->sequence_id());
std::string path = NameSpace::NormalizePath(request->path());
bool recursive = request->recursive();
if (path.empty() || path[0] != '/') {
if (request->path().empty()) {
response->set_status(kBadParameter);
done->Run();
return;
}
std::string path = NameSpace::NormalizePath(request->path());
bool recursive = request->recursive();
std::vector<FileInfo>* removed = new std::vector<FileInfo>;
NameServerLog log;
StatusCode ret_status = namespace_->DeleteDirectory(path, recursive, removed, &log);
Expand Down