File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ cdef class CoreProtocol:
17
17
self .password = con_params.password
18
18
self .auth_msg = None
19
19
self .con_params = con_params
20
- self .transport = None
21
20
self .con_status = CONNECTION_BAD
22
21
self .state = PROTOCOL_IDLE
23
22
self .xact_status = PQTRANS_IDLE
@@ -32,9 +31,6 @@ cdef class CoreProtocol:
32
31
33
32
self ._reset_result()
34
33
35
- cdef _write(self , buf):
36
- self .transport.write(memoryview(buf))
37
-
38
34
cdef _read_server_messages(self ):
39
35
cdef:
40
36
char mtype
@@ -147,7 +143,6 @@ cdef class CoreProtocol:
147
143
if self .result_type != RESULT_OK:
148
144
self .con_status = CONNECTION_BAD
149
145
self ._push_result()
150
- self .transport.close()
151
146
152
147
elif self .auth_msg is not None :
153
148
# Server wants us to send auth data, so do that.
@@ -910,6 +905,9 @@ cdef class CoreProtocol:
910
905
buf.end_message()
911
906
self ._write(buf)
912
907
908
+ cdef _write(self , buf):
909
+ raise NotImplementedError
910
+
913
911
cdef _decode_row(self , const char * buf, ssize_t buf_len):
914
912
pass
915
913
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ cdef class BaseProtocol(CoreProtocol):
98
98
CoreProtocol.__init__ (self , con_params)
99
99
100
100
self .loop = loop
101
+ self .transport = None
101
102
self .waiter = connected_fut
102
103
self .cancel_waiter = None
103
104
self .cancel_sent_waiter = None
@@ -883,6 +884,9 @@ cdef class BaseProtocol(CoreProtocol):
883
884
self .closing = True
884
885
self ._handle_waiter_on_connection_lost(exc)
885
886
887
+ cdef _write(self , buf):
888
+ self .transport.write(memoryview(buf))
889
+
886
890
# asyncio callbacks:
887
891
888
892
def data_received (self , data ):
You can’t perform that action at this time.
0 commit comments