Download:
child 6:9643b3224fb5
parent 4:33d49b3bcab5
5:da6e34b39574
Anton Shestakov <av6@dwimlabs.net>, Thu, 08 Sep 2016 14:39:52 +0800
hglib: ignore data from unexpected channels in Client.getencoding()

1 файлов изменено, 7 вставок(+), 5 удалений(-) [+]
hglib.lua file | annotate | diff | comparison | revisions
--- a/hglib.lua Thu Sep 08 13:42:51 2016 +0800
+++ b/hglib.lua Thu Sep 08 14:39:52 2016 +0800
@@ -89,11 +89,13 @@
end
self.wh:write('getencoding\n')
self.wh:flush()
- local channel, message = read_channel(self.rh)
- if channel == 'r' then
- return message
- elseif channel == 'e' then
- return nil, message
+ while true do
+ local channel, message = read_channel(self.rh)
+ if channel == 'r' then
+ return message
+ elseif channel == 'e' or channel:lower() ~= channel then
+ return nil, message
+ end
end
end