diff --git a/.travis.yml b/.travis.yml index c77beb8..cfccb62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,9 @@ addons: - docker-ce matrix: include: - - env: ELASTIC_STACK_VERSION=5.6.12 - - env: ELASTIC_STACK_VERSION=6.4.2 - - env: ELASTIC_STACK_VERSION=7.0.0-alpha1 + - env: ELASTIC_STACK_VERSION=5.6.15 + - env: ELASTIC_STACK_VERSION=6.6.1 + - env: ELASTIC_STACK_VERSION=7.0.0-beta1 fast_finish: true install: ci/unit/docker-setup.sh script: ci/unit/docker-run.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 0715143..e3a30eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.1.10 + - Fixed problem in Windows where some paths would fail to return an identifier ("inode"). Make path into a C style String before encoding to UTF-16LE. [#232](https://github.com/logstash-plugins/logstash-input-file/issues/232) + ## 4.1.9 - Fixed issue where logs were being spammed with needless error messages [#224](https://github.com/logstash-plugins/logstash-input-file/pull/224) diff --git a/lib/filewatch/winhelper.rb b/lib/filewatch/winhelper.rb index 0d5e859..31c5279 100644 --- a/lib/filewatch/winhelper.rb +++ b/lib/filewatch/winhelper.rb @@ -177,11 +177,7 @@ def self.identifier_from_handle(handle, close_handle = true) private def self.open_handle_from_path(path) - CreateFileW(in_buffer(path), 0, 7, nil, 3, 128, nil) - end - - def self.in_buffer(string) - utf16le(string) + CreateFileW(utf16le(path), 0, 7, nil, 3, 128, nil) end def self.char_pointer_to_ruby_string(char_pointer, length = 256) @@ -192,7 +188,11 @@ def self.char_pointer_to_ruby_string(char_pointer, length = 256) end def self.utf16le(string) - string.encode("UTF-16LE") + to_cstring(string).encode("UTF-16LE") + end + + def self.to_cstring(rubystring) + rubystring + 0.chr end def self.win1252(string) diff --git a/logstash-input-file.gemspec b/logstash-input-file.gemspec index b04b88c..ad92eab 100644 --- a/logstash-input-file.gemspec +++ b/logstash-input-file.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-input-file' - s.version = '4.1.9' + s.version = '4.1.10' s.licenses = ['Apache-2.0'] s.summary = "Streams events from files" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"