ruby-oci8 2.2.10 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ca16dcc5691bc79740b2b6e308315d013c3f482f991325f70a129a7cf34de0c
4
- data.tar.gz: c953f017dab68ed7c2a3934ec29b7312c401516a04b44d32f53c83b0015988b9
3
+ metadata.gz: 1fedff79278c31d88dee698417671fb84c334ad61d08595662fcef4c792742eb
4
+ data.tar.gz: 8af51646f9e6c4f96be8baaf15582b1e510f8655ed4c4f06cc45f0ab2599e8ea
5
5
  SHA512:
6
- metadata.gz: 3c54d89e2b858e9dcd874d3f9351c707443d1171154c1d9145f3ddd0931e3168809fc3e91ef1cbc1dca2e6b4e699e5eb2e5d05a7e320cfb0926359a71ff9b3d9
7
- data.tar.gz: 611469d0047283c54b7110090bcd9e45a677c3afaba9f6b1c6c4efbaca8afd3092ee1b871d28149459fa82f52f12e36d71bae6cb99e37be0c5ecb148ae300ead
6
+ metadata.gz: f3efe23976439e355436b273d28778a1658d01c1d0c57809e3d992600efc98d0455f44936b711026d7eb4dc9599dda6477367edb49823d125a4cc6d2ef3f2349
7
+ data.tar.gz: 9ff212eccdc0e737f648aaab32f4958e47f5c551823d6d9613b89cf8f5195561980f5cc5c0d34c7a88e591c045b601ff779cb5a7b562ca26c0efbaa532e198f2
data/NEWS CHANGED
@@ -1,5 +1,14 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.2.11 (2022-02-22)
4
+ ===================
5
+
6
+ - Fix "No DLL is not foud to hook" when `OCI8.properties[:tcp_keepalive_time]` is set and Oracle client is 21c on Windows.
7
+
8
+ (reported at rsim/oracle-enhanced#2262)
9
+
10
+ - Fix "OCI8.properties[:tcp_keepalive_time] isn't available" error when ruby version is 3.1 on Windows.
11
+
3
12
  2.2.10 (2022-01-12)
4
13
  ===================
5
14
 
data/ext/oci8/extconf.rb CHANGED
@@ -72,7 +72,7 @@ $objs = ["oci8lib.o", "env.o", "error.o", "oci8.o", "ocihandle.o",
72
72
  "ocinumber.o", "ocidatetime.o", "object.o", "apiwrap.o",
73
73
  "encoding.o", "oranumber_util.o", "thread_util.o", "util.o"]
74
74
 
75
- if RUBY_PLATFORM =~ /mswin32|cygwin|mingw32|bccwin32/
75
+ if RUBY_PLATFORM =~ /mswin32|cygwin|mingw/
76
76
  $defs << "-DUSE_WIN32_C"
77
77
  $objs << "win32.o"
78
78
  end
@@ -148,7 +148,7 @@ end
148
148
  print "checking for plthook... "
149
149
  STDOUT.flush
150
150
  case RUBY_PLATFORM
151
- when /mswin32|cygwin|mingw32|bccwin32/
151
+ when /mswin32|cygwin|mingw/
152
152
  plthook_src = "plthook_win32.c"
153
153
  when /darwin/
154
154
  plthook_src = "plthook_osx.c"
@@ -170,6 +170,38 @@ static int WSAAPI hook_WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount
170
170
  return rv;
171
171
  }
172
172
 
173
+ static int is_target_dll(MODULEENTRY32 *me)
174
+ {
175
+ static const char *basenames[] = {
176
+ "orantcp", // ORACLE_HOME-based client
177
+ "oraociei", // instant client basic
178
+ "oraociicus", // instant client basic lite
179
+ NULL,
180
+ };
181
+ const char **basename = basenames;
182
+ while (*basename != NULL) {
183
+ if (strnicmp(me->szModule, *basename, strlen(*basename)) == 0) {
184
+ break;
185
+ }
186
+ basename++;
187
+ }
188
+ if (*basename == NULL) {
189
+ return 0;
190
+ }
191
+ // basename{zero_or_more_digits}.dll
192
+ const char *p = me->szModule + strlen(*basename);
193
+ while ('0' <= *p && *p <= '9') {
194
+ p++;
195
+ }
196
+ if (stricmp(p, ".dll") != 0) {
197
+ return 0;
198
+ }
199
+ if (GetProcAddress((HMODULE)me->modBaseAddr, "nttini") == NULL) {
200
+ return 0;
201
+ }
202
+ return 1;
203
+ }
204
+
173
205
  void oci8_install_hook_functions()
174
206
  {
175
207
  static int hook_functions_installed = 0;
@@ -217,22 +249,11 @@ void oci8_install_hook_functions()
217
249
  me.dwSize = sizeof(me);
218
250
  if (Module32First(hSnapshot, &me)) {
219
251
  do {
220
- const char *p = NULL;
221
- if (strnicmp(me.szModule, "orantcp", 7) == 0) { // ORACLE_HOME-based client
222
- p = me.szModule + 7;
223
- } else if (strnicmp(me.szModule, "oraociei", 8) == 0) { // instant client basic
224
- p = me.szModule + 8;
225
- } else if (strnicmp(me.szModule, "oraociicus", 10) == 0) { // instant client basic lite
226
- p = me.szModule + 10;
227
- }
228
- if (p != NULL && ('1' <= *p && *p <= '9') && ('0' <= *(p + 1) && *(p + 1) <= '9')
229
- && stricmp(p + 2, ".dll") == 0) {
230
- if (GetProcAddress((HMODULE)me.modBaseAddr, "nttini") != NULL) {
231
- module_found = TRUE;
232
- if (replace_functions(me.modBaseAddr, me.szExePath, tcp_functions) != 0) {
233
- CloseHandle(hSnapshot);
234
- rb_raise(rb_eRuntimeError, "Hook error: %s", hook_errmsg);
235
- }
252
+ if (is_target_dll(&me)) {
253
+ module_found = TRUE;
254
+ if (replace_functions(me.modBaseAddr, me.szExePath, tcp_functions) != 0) {
255
+ CloseHandle(hSnapshot);
256
+ rb_raise(rb_eRuntimeError, "Hook error: %s", hook_errmsg);
236
257
  }
237
258
  }
238
259
  } while (Module32Next(hSnapshot, &me));
@@ -4,7 +4,7 @@ class OCI8
4
4
  module Util
5
5
 
6
6
  case RUBY_PLATFORM
7
- when /mswin32|cygwin|mingw32|bccwin32/
7
+ when /mswin32|cygwin|mingw/
8
8
 
9
9
  require 'fiddle/import'
10
10
  require 'fiddle/types'
data/lib/oci8/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class OCI8
2
- VERSION = "2.2.10"
2
+ VERSION = "2.2.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oci8
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.10
4
+ version: 2.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kubo Takehiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-12 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'ruby-oci8 is a ruby interface for Oracle using OCI8 API. It is available
14
14
  with Oracle 10g or later including Oracle Instant Client.