Skip to content

Commit 1a2aab3

Browse files
authored
Merge pull request #120 from nakagami/issue118
mask accept_type
2 parents b40674f + 19e8272 commit 1a2aab3

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

firebirdsql/aio/fbcore.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, trans):
7272

7373
def _allocate_stmt(self):
7474
self.trans.connection._op_allocate_statement()
75-
if self.trans.connection.accept_type == ptype_lazy_send:
75+
if (self.trans.connection.accept_type & ptype_MASK) == ptype_lazy_send:
7676
self.trans.connection.lazy_response_count += 1
7777
self.handle = -1
7878
else:
@@ -114,7 +114,7 @@ async def close(self):
114114
DEBUG_OUTPUT("AsyncStatement::close()", self.handle)
115115
if self.stmt_type == isc_info_sql_stmt_select and self._is_open:
116116
self.trans.connection._op_free_statement(self.handle, DSQL_close)
117-
if self.trans.connection.accept_type == ptype_lazy_send:
117+
if (self.trans.connection.accept_type & ptype_MASK) == ptype_lazy_send:
118118
self.trans.connection.lazy_response_count += 1
119119
else:
120120
(h, oid, buf) = await self.trans.connection._async_op_response()
@@ -124,7 +124,7 @@ async def drop(self):
124124
DEBUG_OUTPUT("AsyncStatement::drop()", self.handle)
125125
if self.handle != -1 and self._is_open:
126126
self.trans.connection._op_free_statement(self.handle, DSQL_drop)
127-
if self.trans.connection.accept_type == ptype_lazy_send:
127+
if (self.trans.connection.accept_type & ptype_MASK) == ptype_lazy_send:
128128
self.trans.connection.lazy_response_count += 1
129129
else:
130130
(h, oid, buf) = await self.trans.connection._async_op_response()

firebirdsql/consts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@
534534
ptype_batch_send = 3 # Batch sends, no asynchrony
535535
ptype_out_of_band = 4 # Batch sends w/ out of band notification
536536
ptype_lazy_send = 5 # Deferred packets delivery
537+
ptype_MASK = 0xFF
538+
pflag_compress = 0x100
539+
pflag_win_sspi_nego = 0x200
537540

538541
PROTOCOL_VERSION10 = 10
539542
PROTOCOL_VERSION11 = 11

firebirdsql/fbcore.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, trans):
7272

7373
def _allocate_stmt(self):
7474
self.trans.connection._op_allocate_statement()
75-
if self.trans.connection.accept_type == ptype_lazy_send:
75+
if (self.trans.connection.accept_type & ptype_MASK) == ptype_lazy_send:
7676
self.trans.connection.lazy_response_count += 1
7777
self.handle = -1
7878
else:
@@ -107,7 +107,7 @@ def fetch_generator(self):
107107
v += buf[2:ln+2]
108108
buf = buf[ln+2:]
109109
connection._op_close_blob(h)
110-
if connection.accept_type == ptype_lazy_send:
110+
if (connection.accept_type & ptype_MASK)== ptype_lazy_send:
111111
connection.lazy_response_count += 1
112112
else:
113113
(h, oid, buf) = connection._op_response()
@@ -151,7 +151,7 @@ def close(self):
151151
DEBUG_OUTPUT("Statement::close()", self.handle)
152152
if self.stmt_type == isc_info_sql_stmt_select and self._is_open:
153153
self.trans.connection._op_free_statement(self.handle, DSQL_close)
154-
if self.trans.connection.accept_type == ptype_lazy_send:
154+
if (self.trans.connection.accept_type & ptype_MASK)== ptype_lazy_send:
155155
self.trans.connection.lazy_response_count += 1
156156
else:
157157
(h, oid, buf) = self.trans.connection._op_response()
@@ -161,7 +161,7 @@ def drop(self):
161161
DEBUG_OUTPUT("Statement::drop()", self.handle)
162162
if self.handle != -1 and self._is_open:
163163
self.trans.connection._op_free_statement(self.handle, DSQL_drop)
164-
if self.trans.connection.accept_type == ptype_lazy_send:
164+
if (self.trans.connection.accept_type & ptype_MASK) == ptype_lazy_send:
165165
self.trans.connection.lazy_response_count += 1
166166
else:
167167
(h, oid, buf) = self.trans.connection._op_response()

misc/fbproxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ def process_wire(client_socket, server_name, server_port):
24272427
continue
24282428
# ptype_lazy_send
24292429
if (
2430-
accept_type == 5 and op_req_name in (
2430+
(accept_type & 0xFF) == 5 and op_req_name in (
24312431
'op_allocate_statement', 'op_free_statement',
24322432
'op_close_blob', 'op_cancel_blob', 'op_release')
24332433
):

0 commit comments

Comments
 (0)