@@ -59,7 +59,6 @@ cdef class SSLProtocol:
5959 object _outgoing_read
6060 char * _ssl_buffer
6161 size_t _ssl_buffer_len
62- object _ssl_buffer_view
6362 SSLProtocolState _state
6463 size_t _conn_lost
6564 AppProtocolState _app_state
@@ -84,55 +83,61 @@ cdef class SSLProtocol:
8483 object _handshake_timeout_handle
8584 object _shutdown_timeout_handle
8685
87- cdef _set_app_protocol(self , app_protocol)
88- cdef _wakeup_waiter(self , exc = * )
89- cdef _get_extra_info(self , name, default = * )
90- cdef _set_state(self , SSLProtocolState new_state)
86+ # Instead of doing python calls, c methods *_impl are called directly
87+ # from stream.pyx
88+
89+ cdef inline get_buffer_impl(self , size_t n, char ** buf, size_t* buf_size)
90+ cdef inline buffer_updated_impl(self , size_t nbytes)
91+
92+ cdef inline _set_app_protocol(self , app_protocol)
93+ cdef inline _wakeup_waiter(self , exc = * )
94+ cdef inline _get_extra_info(self , name, default = * )
95+ cdef inline _set_state(self , SSLProtocolState new_state)
9196
9297 # Handshake flow
9398
94- cdef _start_handshake(self )
95- cdef _check_handshake_timeout(self )
96- cdef _do_handshake(self )
97- cdef _on_handshake_complete(self , handshake_exc)
99+ cdef inline _start_handshake(self )
100+ cdef inline _check_handshake_timeout(self )
101+ cdef inline _do_handshake(self )
102+ cdef inline _on_handshake_complete(self , handshake_exc)
98103
99104 # Shutdown flow
100105
101- cdef _start_shutdown(self , object context = * )
102- cdef _check_shutdown_timeout(self )
103- cdef _do_read_into_void(self , object context)
104- cdef _do_flush(self , object context = * )
105- cdef _do_shutdown(self , object context = * )
106- cdef _on_shutdown_complete(self , shutdown_exc)
107- cdef _abort(self , exc)
106+ cdef inline _start_shutdown(self , object context = * )
107+ cdef inline _check_shutdown_timeout(self )
108+ cdef inline _do_read_into_void(self , object context)
109+ cdef inline _do_flush(self , object context = * )
110+ cdef inline _do_shutdown(self , object context = * )
111+ cdef inline _on_shutdown_complete(self , shutdown_exc)
112+ cdef inline _abort(self , exc)
108113
109114 # Outgoing flow
110115
111- cdef _write_appdata(self , list_of_data, object context)
112- cdef _do_write(self )
113- cdef _process_outgoing(self )
116+ cdef inline _write_appdata(self , list_of_data, object context)
117+ cdef inline _do_write(self )
118+ cdef inline _process_outgoing(self )
114119
115120 # Incoming flow
116121
117- cdef _do_read(self )
118- cdef _do_read__buffered(self )
119- cdef _do_read__copied(self )
120- cdef _call_eof_received(self , object context = * )
122+ cdef inline _do_read(self )
123+ cdef inline _do_read__buffered(self )
124+ cdef inline _do_read__copied(self )
125+ cdef inline _call_eof_received(self , object context = * )
121126
122127 # Flow control for writes from APP socket
123128
124- cdef _control_app_writing(self , object context = * )
125- cdef size_t _get_write_buffer_size(self )
126- cdef _set_write_buffer_limits(self , high = * , low = * )
129+ cdef inline _control_app_writing(self , object context = * )
130+ cdef inline size_t _get_write_buffer_size(self )
131+ cdef inline _set_write_buffer_limits(self , high = * , low = * )
127132
128133 # Flow control for reads to APP socket
129134
130- cdef _pause_reading(self )
131- cdef _resume_reading(self , object context)
135+ cdef inline _pause_reading(self )
136+ cdef inline _resume_reading(self , object context)
132137
133138 # Flow control for reads from SSL socket
134139
135- cdef _control_ssl_reading(self )
136- cdef _set_read_buffer_limits(self , high = * , low = * )
137- cdef size_t _get_read_buffer_size(self )
138- cdef _fatal_error(self , exc, message = * )
140+ cdef inline _control_ssl_reading(self )
141+ cdef inline _set_read_buffer_limits(self , high = * , low = * )
142+ cdef inline size_t _get_read_buffer_size(self )
143+ cdef inline _fatal_error(self , exc, message = * )
0 commit comments