|
|
|
@ -1414,9 +1414,8 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
|
|
|
|
printf("FILEDATA (final chunk) END: \n");
|
|
|
|
printf("FILEDATA (final chunk) END: \n");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (!(htud->tsflags & HTP_DONTSTORE)) {
|
|
|
|
if (!(htud->tsflags & HTP_DONTSTORE)) {
|
|
|
|
if (HTPFileClose(hstate, filedata, filedata_len, flags,
|
|
|
|
if (HTPFileClose(hstate, htud, filedata, filedata_len, flags, STREAM_TOSERVER) ==
|
|
|
|
STREAM_TOSERVER) == -1)
|
|
|
|
-1) {
|
|
|
|
{
|
|
|
|
|
|
|
|
goto end;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1538,7 +1537,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
|
|
|
|
} else if (result == -2) {
|
|
|
|
} else if (result == -2) {
|
|
|
|
htud->tsflags |= HTP_DONTSTORE;
|
|
|
|
htud->tsflags |= HTP_DONTSTORE;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (HTPFileClose(hstate, NULL, 0, 0, STREAM_TOSERVER) == -1) {
|
|
|
|
if (HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
|
|
|
|
goto end;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1605,7 +1604,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
|
|
|
|
} else if (result == -2) {
|
|
|
|
} else if (result == -2) {
|
|
|
|
htud->tsflags |= HTP_DONTSTORE;
|
|
|
|
htud->tsflags |= HTP_DONTSTORE;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (HTPFileClose(hstate, NULL, 0, 0, STREAM_TOSERVER) == -1) {
|
|
|
|
if (HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
|
|
|
|
goto end;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1891,7 +1890,7 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (tx_ud->tsflags & HTP_FILENAME_SET) {
|
|
|
|
if (tx_ud->tsflags & HTP_FILENAME_SET) {
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
(void)HTPFileClose(hstate, NULL, 0, FILE_TRUNCATED, STREAM_TOSERVER);
|
|
|
|
(void)HTPFileClose(hstate, tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOSERVER);
|
|
|
|
tx_ud->tsflags &= ~HTP_FILENAME_SET;
|
|
|
|
tx_ud->tsflags &= ~HTP_FILENAME_SET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1981,7 +1980,7 @@ static int HTPCallbackResponseBodyData(htp_tx_data_t *d)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (tx_ud->tcflags & HTP_FILENAME_SET) {
|
|
|
|
if (tx_ud->tcflags & HTP_FILENAME_SET) {
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
(void)HTPFileClose(hstate, NULL, 0, FILE_TRUNCATED, STREAM_TOCLIENT);
|
|
|
|
(void)HTPFileClose(hstate, tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOCLIENT);
|
|
|
|
tx_ud->tcflags &= ~HTP_FILENAME_SET;
|
|
|
|
tx_ud->tcflags &= ~HTP_FILENAME_SET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2202,7 +2201,7 @@ static int HTPCallbackRequestComplete(htp_tx_t *tx)
|
|
|
|
if (htud != NULL) {
|
|
|
|
if (htud != NULL) {
|
|
|
|
if (htud->tsflags & HTP_FILENAME_SET) {
|
|
|
|
if (htud->tsflags & HTP_FILENAME_SET) {
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
(void)HTPFileClose(hstate, NULL, 0, 0, STREAM_TOSERVER);
|
|
|
|
(void)HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER);
|
|
|
|
htud->tsflags &= ~HTP_FILENAME_SET;
|
|
|
|
htud->tsflags &= ~HTP_FILENAME_SET;
|
|
|
|
if (abs_right_edge < (uint64_t)UINT32_MAX) {
|
|
|
|
if (abs_right_edge < (uint64_t)UINT32_MAX) {
|
|
|
|
StreamTcpReassemblySetMinInspectDepth(
|
|
|
|
StreamTcpReassemblySetMinInspectDepth(
|
|
|
|
@ -2257,7 +2256,7 @@ static int HTPCallbackResponseComplete(htp_tx_t *tx)
|
|
|
|
if (htud != NULL) {
|
|
|
|
if (htud != NULL) {
|
|
|
|
if (htud->tcflags & HTP_FILENAME_SET) {
|
|
|
|
if (htud->tcflags & HTP_FILENAME_SET) {
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
SCLogDebug("closing file that was being stored");
|
|
|
|
(void)HTPFileClose(hstate, NULL, 0, 0, STREAM_TOCLIENT);
|
|
|
|
(void)HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOCLIENT);
|
|
|
|
htud->tcflags &= ~HTP_FILENAME_SET;
|
|
|
|
htud->tcflags &= ~HTP_FILENAME_SET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|