Fix engine lockup due to mutex locking error.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent cf473bf0ce
commit b3cb29b758

@ -556,9 +556,10 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, uint32_
/* See if we already have a 'app layer' state */ /* See if we already have a 'app layer' state */
void *app_layer_state = NULL; void *app_layer_state = NULL;
mutex_lock(&f->m); if (need_lock == TRUE) mutex_lock(&f->m);
app_layer_state = ssn->aldata[p->storage_id]; app_layer_state = ssn->aldata[p->storage_id];
mutex_unlock(&f->m); if (need_lock == TRUE) mutex_unlock(&f->m);
if (app_layer_state == NULL) { if (app_layer_state == NULL) {
app_layer_state = p->StateAlloc(); app_layer_state = p->StateAlloc();
if (app_layer_state == NULL) if (app_layer_state == NULL)

@ -1279,7 +1279,8 @@ int StreamTcpReassembleHandleSegment(TcpReassemblyThreadCtx *ra_ctx, TcpSession
if (smsg == NULL) if (smsg == NULL)
break; break;
AppLayerHandleMsg(smsg, FALSE); /**< no need to use locking */ /** Handle the stream msg. No need to use locking, flow is already locked */
AppLayerHandleMsg(smsg, FALSE);
} while (ra_ctx->stream_q->len > 0); } while (ra_ctx->stream_q->len > 0);
} }

@ -1670,18 +1670,6 @@ int StreamTcp (ThreadVars *tv, Packet *p, void *data, PacketQueue *pq)
if (p->flow == NULL) if (p->flow == NULL)
return 0; return 0;
#if 0
printf("StreamTcp: seq %" PRIu32 ", ack %" PRIu32 ", %s%s%s%s%s%s%s%s: ", TCP_GET_SEQ(p), TCP_GET_ACK(p),
TCP_ISSET_FLAG_FIN(p) ? "FIN " :"",
TCP_ISSET_FLAG_SYN(p) ? "SYN " :"",
TCP_ISSET_FLAG_RST(p) ? "RST " :"",
TCP_ISSET_FLAG_PUSH(p)? "PUSH ":"",
TCP_ISSET_FLAG_ACK(p) ? "ACK " :"",
TCP_ISSET_FLAG_URG(p) ? "URG " :"",
TCP_ISSET_FLAG_RES2(p)? "RES2 ":"",
TCP_ISSET_FLAG_RES1(p)? "RES1 ":"");
#endif
mutex_lock(&p->flow->m); mutex_lock(&p->flow->m);
StreamTcpPacket(tv, p, stt); StreamTcpPacket(tv, p, stt);
mutex_unlock(&p->flow->m); mutex_unlock(&p->flow->m);

Loading…
Cancel
Save