File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -561,6 +561,20 @@ def test_sendfile_zero_size(self):
561
561
self .assertEqual (ret , 0 )
562
562
self .assertEqual (self .file .tell (), 0 )
563
563
564
+ def test_mix_sendfile_and_regular_send (self ):
565
+ buf = b'1234567890' * 1024 * 1024 # 10 MB
566
+ sock , proto = self .prepare ()
567
+ self .run_loop (self .loop .sock_sendall (sock , buf ))
568
+ ret = self .run_loop (self .loop .sock_sendfile (sock , self .file ))
569
+ self .run_loop (self .loop .sock_sendall (sock , buf ))
570
+ sock .close ()
571
+ self .run_loop (proto .wait_closed ())
572
+
573
+ self .assertEqual (ret , len (self .DATA ))
574
+ expected = buf + self .DATA + buf
575
+ self .assertEqual (proto .data , expected )
576
+ self .assertEqual (self .file .tell (), len (self .DATA ))
577
+
564
578
565
579
class UnixReadPipeTransportTests (test_utils .TestCase ):
566
580
You can’t perform that action at this time.
0 commit comments