File tree 2 files changed +9
-6
lines changed 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ run_test python tests/test.py --with-coverage -b "-m aes-256-cfb -k testrc4 -s 1
49
49
50
50
if [ -f /proc/sys/net/ipv4/tcp_fastopen ] ; then
51
51
if [ 3 -eq ` cat /proc/sys/net/ipv4/tcp_fastopen` ] ; then
52
+ # we have to run it twice:
53
+ # the first time there's no syn cookie
54
+ # the second time there is syn cookie
55
+ run_test python tests/test.py --with-coverage -c tests/fastopen.json
52
56
run_test python tests/test.py --with-coverage -c tests/fastopen.json
53
57
fi
54
58
fi
Original file line number Diff line number Diff line change @@ -241,19 +241,18 @@ def _handle_stage_connecting(self, data):
241
241
self ._create_remote_socket (self ._chosen_server [0 ],
242
242
self ._chosen_server [1 ])
243
243
self ._loop .add (remote_sock , eventloop .POLL_ERR )
244
- data = b'' .join (self ._data_to_write_to_local )
244
+ data = b'' .join (self ._data_to_write_to_remote )
245
245
l = len (data )
246
246
s = remote_sock .sendto (data , MSG_FASTOPEN , self ._chosen_server )
247
247
if s < l :
248
248
data = data [s :]
249
- self ._data_to_write_to_local = [data ]
250
- self ._update_stream (STREAM_UP , WAIT_STATUS_READWRITING )
249
+ self ._data_to_write_to_remote = [data ]
251
250
else :
252
- self ._data_to_write_to_local = []
253
- self ._update_stream (STREAM_UP , WAIT_STATUS_READING )
254
- self ._stage = STAGE_STREAM
251
+ self ._data_to_write_to_remote = []
252
+ self ._update_stream (STREAM_UP , WAIT_STATUS_READWRITING )
255
253
except (OSError , IOError ) as e :
256
254
if eventloop .errno_from_exception (e ) == errno .EINPROGRESS :
255
+ # in this case data is not sent at all
257
256
self ._update_stream (STREAM_UP , WAIT_STATUS_READWRITING )
258
257
elif eventloop .errno_from_exception (e ) == errno .ENOTCONN :
259
258
logging .error ('fast open not supported on this OS' )
You can’t perform that action at this time.
0 commit comments