fsm in-memory deduplication

This commit is contained in:
Mzack9999 2020-07-25 22:25:21 +02:00
parent 3a8ee75b93
commit 731241c90e
2 changed files with 9 additions and 0 deletions

View File

@ -105,6 +105,11 @@ func (e *HTTPExecuter) ExecuteHTTP(URL string) (result Result) {
result.Extractions = make(map[string]interface{}) result.Extractions = make(map[string]interface{})
dynamicvalues := make(map[string]interface{}) dynamicvalues := make(map[string]interface{})
// verify if the URL is already being processed
if e.bulkHttpRequest.HasGenerator(URL) {
return
}
e.bulkHttpRequest.CreateGenerator(URL) e.bulkHttpRequest.CreateGenerator(URL)
for e.bulkHttpRequest.Next(URL) && !result.Done { for e.bulkHttpRequest.Next(URL) && !result.Done {
httpRequest, err := e.bulkHttpRequest.MakeHTTPRequest(URL, dynamicvalues, e.bulkHttpRequest.Current(URL)) httpRequest, err := e.bulkHttpRequest.MakeHTTPRequest(URL, dynamicvalues, e.bulkHttpRequest.Current(URL))

View File

@ -123,6 +123,10 @@ func (r *BulkHTTPRequest) CreateGenerator(URL string) {
r.gsfm.Add(URL) r.gsfm.Add(URL)
} }
func (r *BulkHTTPRequest) HasGenerator(URL string) bool {
return r.gsfm.Has(URL)
}
func (r *BulkHTTPRequest) ReadOne(URL string) { func (r *BulkHTTPRequest) ReadOne(URL string) {
r.gsfm.ReadOne(URL) r.gsfm.ReadOne(URL)
} }