@ -794,8 +794,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
SCLogDebug ( " No App Layer Data " ) ;
SCLogDebug ( " No App Layer Data " ) ;
/* Nothing is there to clean up, so just return from here after setting
/* Nothing is there to clean up, so just return from here after setting
* up the no reassembly flags */
* up the no reassembly flags */
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOCLIENT ? 1 : 0 ) ;
StreamTcpSetSessionNoApplayerInspectionFlag ( ssn ) ;
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOSERVER ? 1 : 0 ) ;
SCReturnInt ( - 1 ) ;
SCReturnInt ( - 1 ) ;
}
}
@ -870,10 +869,9 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
/* Set the no reassembly flag for both the stream in this TcpSession */
/* Set the no reassembly flag for both the stream in this TcpSession */
if ( parser_state - > flags & APP_LAYER_PARSER_NO_REASSEMBLY ) {
if ( parser_state - > flags & APP_LAYER_PARSER_NO_REASSEMBLY ) {
StreamTcpSetSessionNoReassemblyFlag ( ssn ,
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOCLIENT ? 1 : 0 ) ;
flags & STREAM_TOCLIENT ? 1 : 0 ) ;
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOSERVER ? 1 : 0 ) ;
StreamTcpSetSessionNoReassemblyFlag ( ssn ,
StreamTcpSetSessionNoApplayerInspectionFlag ( ssn ) ;
flags & STREAM_TOSERVER ? 1 : 0 ) ;
}
}
}
}
@ -893,8 +891,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
error :
error :
if ( ssn ! = NULL ) {
if ( ssn ! = NULL ) {
/* Set the no reassembly flag for both the stream in this TcpSession */
/* Set the no reassembly flag for both the stream in this TcpSession */
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOCLIENT ? 1 : 0 ) ;
StreamTcpSetSessionNoApplayerInspectionFlag ( ssn ) ;
StreamTcpSetSessionNoReassemblyFlag ( ssn , flags & STREAM_TOSERVER ? 1 : 0 ) ;
if ( f - > src . family = = AF_INET ) {
if ( f - > src . family = = AF_INET ) {
char src [ 16 ] ;
char src [ 16 ] ;
@ -1302,7 +1299,7 @@ static void TestProtocolStateFree(void *s)
*/
*/
static int AppLayerParserTest01 ( void )
static int AppLayerParserTest01 ( void )
{
{
int result = 1 ;
int result = 0 ;
Flow f ;
Flow f ;
uint8_t testbuf [ ] = { 0x11 } ;
uint8_t testbuf [ ] = { 0x11 } ;
uint32_t testlen = sizeof ( testbuf ) ;
uint32_t testlen = sizeof ( testbuf ) ;
@ -1344,19 +1341,17 @@ static int AppLayerParserTest01 (void)
int r = AppLayerParse ( & f , ALPROTO_TEST , STREAM_TOSERVER | STREAM_EOF , testbuf ,
int r = AppLayerParse ( & f , ALPROTO_TEST , STREAM_TOSERVER | STREAM_EOF , testbuf ,
testlen ) ;
testlen ) ;
if ( r ! = - 1 ) {
if ( r ! = - 1 ) {
printf ( " returned % " PRId32 " , expected -1: \n " , r ) ;
printf ( " returned % " PRId32 " , expected -1: " , r ) ;
result = 0 ;
goto end ;
goto end ;
}
}
if ( ! ( ssn . flags & STREAMTCP_FLAG_NOSERVER_REASSEMBLY ) | |
if ( ! ( ssn . flags & STREAMTCP_FLAG_NO_APPLAYER_INSPECTION ) )
! ( ssn . flags & STREAMTCP_FLAG_NOCLIENT_REASSEMBLY ) )
{
{
printf ( " flags should be set, but they are not ! \n " ) ;
printf ( " flag should have been set, but is not: " ) ;
result = 0 ;
goto end ;
goto end ;
}
}
result = 1 ;
end :
end :
StreamL7DataPtrFree ( & ssn ) ;
StreamL7DataPtrFree ( & ssn ) ;
StreamTcpFreeConfig ( TRUE ) ;
StreamTcpFreeConfig ( TRUE ) ;