fix ListFileHandles return empty list. (#4617)

This commit is contained in:
microzchang 2023-05-08 13:11:05 +08:00 коммит произвёл GitHub
Родитель 72b87b58ec
Коммит 9ada66c3e6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 26 добавлений и 24 удалений

Просмотреть файл

@ -2433,7 +2433,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
kUnknown,
kEnumerationResults,
kHandleList,
kEntries,
kHandle,
kHandleId,
kPath,
@ -2447,7 +2447,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
};
const std::unordered_map<std::string, XmlTagEnum> XmlTagEnumMap{
{"EnumerationResults", XmlTagEnum::kEnumerationResults},
{"HandleList", XmlTagEnum::kHandleList},
{"Entries", XmlTagEnum::kEntries},
{"Handle", XmlTagEnum::kHandle},
{"HandleId", XmlTagEnum::kHandleId},
{"Path", XmlTagEnum::kPath},
@ -2476,49 +2476,49 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::Text)
{
if (xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kHandleId)
{
vectorElement1.HandleId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kPath)
{
vectorElement1.Path.Content = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kFileId)
{
vectorElement1.FileId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kParentId)
{
vectorElement1.ParentId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kSessionId)
{
vectorElement1.SessionId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kClientIp)
{
vectorElement1.ClientIp = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kOpenTime)
{
vectorElement1.OpenedOn
@ -2526,7 +2526,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kLastReconnectTime)
{
vectorElement1.LastReconnectedOn
@ -2542,7 +2542,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::Attribute)
{
if (xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kPath && node.Name == "Encoded")
{
vectorElement1.Path.Encoded = node.Value == std::string("true");
@ -2551,7 +2551,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::EndTag)
{
if (xmlPath.size() == 3 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle)
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle)
{
response.HandleList.push_back(std::move(vectorElement1));
vectorElement1 = Models::_detail::HandleItem();
@ -3990,7 +3990,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
kUnknown,
kEnumerationResults,
kHandleList,
kEntries,
kHandle,
kHandleId,
kPath,
@ -4004,7 +4004,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
};
const std::unordered_map<std::string, XmlTagEnum> XmlTagEnumMap{
{"EnumerationResults", XmlTagEnum::kEnumerationResults},
{"HandleList", XmlTagEnum::kHandleList},
{"Entries", XmlTagEnum::kEntries},
{"Handle", XmlTagEnum::kHandle},
{"HandleId", XmlTagEnum::kHandleId},
{"Path", XmlTagEnum::kPath},
@ -4033,49 +4033,49 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::Text)
{
if (xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kHandleId)
{
vectorElement1.HandleId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kPath)
{
vectorElement1.Path.Content = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kFileId)
{
vectorElement1.FileId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kParentId)
{
vectorElement1.ParentId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kSessionId)
{
vectorElement1.SessionId = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kClientIp)
{
vectorElement1.ClientIp = node.Value;
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kOpenTime)
{
vectorElement1.OpenedOn
@ -4083,7 +4083,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (
xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kLastReconnectTime)
{
vectorElement1.LastReconnectedOn
@ -4099,7 +4099,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::Attribute)
{
if (xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle
&& xmlPath[3] == XmlTagEnum::kPath && node.Name == "Encoded")
{
vectorElement1.Path.Encoded = node.Value == std::string("true");
@ -4108,7 +4108,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (node.Type == _internal::XmlNodeType::EndTag)
{
if (xmlPath.size() == 3 && xmlPath[0] == XmlTagEnum::kEnumerationResults
&& xmlPath[1] == XmlTagEnum::kHandleList && xmlPath[2] == XmlTagEnum::kHandle)
&& xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kHandle)
{
response.HandleList.push_back(std::move(vectorElement1));
vectorElement1 = Models::_detail::HandleItem();

Просмотреть файл

@ -590,6 +590,8 @@ directive:
$.HandleItem.properties["LastReconnectTime"]["x-ms-client-name"] = "LastReconnectedOn";
$.HandleItem.properties["Path"]["description"] = "File or directory name including full path starting from share root.";
$.HandleItem["x-namespace"] = "_detail";
delete $.ListHandlesResponse.properties.HandleList["xml"];
$.ListHandlesResponse.properties.HandleList["x-ms-xml"] = {"name": "Entries", "wrapped": true};
```
### ForceCloseFileHandles