@ -292,15 +292,16 @@ static inline Packet *FlowForceReassemblyPseudoPacketGet(int direction,
int FlowForceReassemblyNeedReassmbly ( Flow * f , int * server , int * client ) {
int FlowForceReassemblyNeedReassmbly ( Flow * f , int * server , int * client ) {
TcpSession * ssn ;
TcpSession * ssn ;
/* looks like we have no flows in this queue */
if ( f = = NULL ) {
if ( f = = NULL | | ( f - > flags & FLOW_TIMEOUT_REASSEMBLY_DONE ) ) {
* server = * client = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE ;
return 0 ;
SCReturnInt ( 0 ) ;
}
}
/* Get the tcp session for the flow */
/* Get the tcp session for the flow */
ssn = ( TcpSession * ) f - > protoctx ;
ssn = ( TcpSession * ) f - > protoctx ;
if ( ssn = = NULL ) {
if ( ssn = = NULL ) {
return 0 ;
* server = * client = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE ;
SCReturnInt ( 0 ) ;
}
}
* client = StreamNeedsReassembly ( ssn , 0 ) ;
* client = StreamNeedsReassembly ( ssn , 0 ) ;
@ -317,13 +318,29 @@ int FlowForceReassemblyNeedReassmbly(Flow *f, int *server, int *client) {
* server = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION ;
* server = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION ;
}
}
/* if app layer still needs some love, push through */
if ( f - > alproto ! = ALPROTO_UNKNOWN & & f - > alstate ! = NULL & &
AppLayerAlprotoSupportsTxs ( f - > alproto ) )
{
uint64_t total_txs = AppLayerGetTxCnt ( f - > alproto , f - > alstate ) ;
if ( AppLayerTransactionGetActive ( f , STREAM_TOCLIENT ) < total_txs ) {
if ( * server ! = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY )
* server = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION ;
}
if ( AppLayerTransactionGetActive ( f , STREAM_TOSERVER ) < total_txs ) {
if ( * client ! = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY )
* client = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION ;
}
}
/* nothing to do */
/* nothing to do */
if ( * client = = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE & &
if ( * client = = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE & &
* server = = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE ) {
* server = = STREAM_HAS_UNPROCESSED_SEGMENTS_NONE ) {
return 0 ;
SCReturnInt ( 0 ) ;
}
}
return 1 ;
SCReturnInt ( 1 ) ;
}
}
/**
/**
@ -528,8 +545,10 @@ static inline void FlowForceReassemblyForHash(void)
continue ;
continue ;
}
}
( void ) FlowForceReassemblyNeedReassmbly ( f , & server_ok , & client_ok ) ;
/* ah ah! We have some unattended toserver segments */
/* ah ah! We have some unattended toserver segments */
if ( ( client_ok = StreamNeedsReassembly ( ssn , 0 ) ) = = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY ) {
if ( client_ok = = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY ) {
StreamTcpThread * stt = SC_ATOMIC_GET ( stream_pseudo_pkt_stream_tm_slot - > slot_data ) ;
StreamTcpThread * stt = SC_ATOMIC_GET ( stream_pseudo_pkt_stream_tm_slot - > slot_data ) ;
ssn - > client . last_ack = ( ssn - > client . seg_list_tail - > seq +
ssn - > client . last_ack = ( ssn - > client . seg_list_tail - > seq +
@ -547,7 +566,7 @@ static inline void FlowForceReassemblyForHash(void)
}
}
}
}
/* oh oh! We have some unattended toclient segments */
/* oh oh! We have some unattended toclient segments */
if ( ( server_ok = StreamNeedsReassembly ( ssn , 1 ) ) = = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY ) {
if ( server_ok = = STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY ) {
StreamTcpThread * stt = SC_ATOMIC_GET ( stream_pseudo_pkt_stream_tm_slot - > slot_data ) ;
StreamTcpThread * stt = SC_ATOMIC_GET ( stream_pseudo_pkt_stream_tm_slot - > slot_data ) ;
ssn - > server . last_ack = ( ssn - > server . seg_list_tail - > seq +
ssn - > server . last_ack = ( ssn - > server . seg_list_tail - > seq +