filename_len = bstr_len(tx->parsed_uri->path);
}
- result = HTPFileOpen(hstate, filename, filename_len, data, data_len,
- hstate->transaction_cnt, STREAM_TOSERVER);
- if (result == -1) {
- goto end;
- } else if (result == -2) {
- htud->flags |= HTP_DONTSTORE;
- } else {
- htud->flags |= HTP_FILENAME_SET;
- htud->flags &= ~HTP_DONTSTORE;
+ if (filename != NULL) {
+ result = HTPFileOpen(hstate, filename, filename_len, data, data_len,
+ hstate->transaction_cnt, STREAM_TOSERVER);
+ if (result == -1) {
+ goto end;
+ } else if (result == -2) {
+ htud->flags |= HTP_DONTSTORE;
+ } else {
+ htud->flags |= HTP_FILENAME_SET;
+ htud->flags &= ~HTP_DONTSTORE;
+ }
}
}
else
filename_len = bstr_len(tx->parsed_uri->path);
}
- result = HTPFileOpen(hstate, filename, filename_len, data, data_len,
- hstate->transaction_cnt, STREAM_TOSERVER);
- if (result == -1) {
- goto end;
- } else if (result == -2) {
- htud->flags |= HTP_DONTSTORE;
- } else {
- htud->flags |= HTP_FILENAME_SET;
- htud->flags &= ~HTP_DONTSTORE;
+ if (filename != NULL) {
+ result = HTPFileOpen(hstate, filename, filename_len, data, data_len,
+ hstate->transaction_cnt, STREAM_TOSERVER);
+ if (result == -1) {
+ goto end;
+ } else if (result == -2) {
+ htud->flags |= HTP_DONTSTORE;
+ } else {
+ htud->flags |= HTP_FILENAME_SET;
+ htud->flags &= ~HTP_DONTSTORE;
+ }
}
}
else
}
}
- result = HTPFileOpen(hstate, filename, filename_len,
+ if (filename != NULL) {
+ result = HTPFileOpen(hstate, filename, filename_len,
data, data_len, hstate->transaction_cnt, STREAM_TOCLIENT);
- SCLogDebug("result %d", result);
- if (result == -1) {
- goto end;
- } else if (result == -2) {
- htud->flags |= HTP_DONTSTORE;
- } else {
- htud->flags |= HTP_FILENAME_SET;
- htud->flags &= ~HTP_DONTSTORE;
+ SCLogDebug("result %d", result);
+ if (result == -1) {
+ goto end;
+ } else if (result == -2) {
+ htud->flags |= HTP_DONTSTORE;
+ } else {
+ htud->flags |= HTP_FILENAME_SET;
+ htud->flags &= ~HTP_DONTSTORE;
+ }
}
}
else