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 +4 -4
- data/NEWS +9 -0
- data/ext/oci8/extconf.rb +2 -2
- data/ext/oci8/hook_funcs.c +37 -16
- data/lib/oci8/check_load_error.rb +1 -1
- data/lib/oci8/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fedff79278c31d88dee698417671fb84c334ad61d08595662fcef4c792742eb
|
4
|
+
data.tar.gz: 8af51646f9e6c4f96be8baaf15582b1e510f8655ed4c4f06cc45f0ab2599e8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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|
|
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|
|
151
|
+
when /mswin32|cygwin|mingw/
|
152
152
|
plthook_src = "plthook_win32.c"
|
153
153
|
when /darwin/
|
154
154
|
plthook_src = "plthook_osx.c"
|
data/ext/oci8/hook_funcs.c
CHANGED
@@ -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
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
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));
|
data/lib/oci8/version.rb
CHANGED
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.
|
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-
|
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.
|