@@ -564,6 +564,40 @@ TEST_F(tls, msg_more)
564564 EXPECT_EQ (memcmp (buf , test_str , send_len ), 0 );
565565}
566566
567+ TEST_F (tls , cmsg_msg_more )
568+ {
569+ char * test_str = "test_read" ;
570+ char record_type = 100 ;
571+ int send_len = 10 ;
572+
573+ /* we don't allow MSG_MORE with non-DATA records */
574+ EXPECT_EQ (tls_send_cmsg (self -> fd , record_type , test_str , send_len ,
575+ MSG_MORE ), -1 );
576+ EXPECT_EQ (errno , EINVAL );
577+ }
578+
579+ TEST_F (tls , msg_more_then_cmsg )
580+ {
581+ char * test_str = "test_read" ;
582+ char record_type = 100 ;
583+ int send_len = 10 ;
584+ char buf [10 * 2 ];
585+ int ret ;
586+
587+ EXPECT_EQ (send (self -> fd , test_str , send_len , MSG_MORE ), send_len );
588+ EXPECT_EQ (recv (self -> cfd , buf , send_len , MSG_DONTWAIT ), -1 );
589+
590+ ret = tls_send_cmsg (self -> fd , record_type , test_str , send_len , 0 );
591+ EXPECT_EQ (ret , send_len );
592+
593+ /* initial DATA record didn't get merged with the non-DATA record */
594+ EXPECT_EQ (recv (self -> cfd , buf , send_len * 2 , 0 ), send_len );
595+
596+ EXPECT_EQ (tls_recv_cmsg (_metadata , self -> cfd , record_type ,
597+ buf , sizeof (buf ), MSG_WAITALL ),
598+ send_len );
599+ }
600+
567601TEST_F (tls , msg_more_unsent )
568602{
569603 char const * test_str = "test_read" ;
0 commit comments