mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 04:45:27 +00:00
progress tracker fix
This commit is contained in:
parent
b4aabf4b34
commit
eee452a8cd
@ -101,6 +101,8 @@ func (e *HTTPExecuter) ExecuteHTTP(URL string) (result Result) {
|
||||
result.Extractions = make(map[string]interface{})
|
||||
dynamicvalues := make(map[string]interface{})
|
||||
|
||||
e.bulkHttpRequest.Reset()
|
||||
|
||||
for e.bulkHttpRequest.Next() && !result.Done {
|
||||
httpRequest, err := e.bulkHttpRequest.MakeHTTPRequest(URL, dynamicvalues, e.bulkHttpRequest.Current())
|
||||
if err != nil {
|
||||
@ -134,7 +136,6 @@ func (e *HTTPExecuter) handleHTTP(URL string, request *requests.HttpRequest, dyn
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "%s", string(dumpedRequest))
|
||||
}
|
||||
|
||||
resp, err := e.httpClient.Do(req)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
|
||||
@ -377,7 +377,7 @@ func (r *BulkHTTPRequest) Reset() {
|
||||
r.positionRaw = 0
|
||||
}
|
||||
func (r *BulkHTTPRequest) Current() string {
|
||||
if r.positionPath <= len(r.Path) && len(r.Path) != 0 && r.positionRaw == 0 {
|
||||
if r.positionPath < len(r.Path) && len(r.Path) != 0 {
|
||||
return r.Path[r.positionPath]
|
||||
}
|
||||
|
||||
@ -387,16 +387,16 @@ func (r *BulkHTTPRequest) Total() int {
|
||||
return len(r.Path) + len(r.Raw)
|
||||
}
|
||||
|
||||
func (r *BulkHTTPRequest) Increment() int {
|
||||
if r.positionPath <= len(r.Path) && len(r.Path) != 0 && r.positionRaw == 0 {
|
||||
func (r *BulkHTTPRequest) Increment() {
|
||||
if len(r.Path) > 0 && r.positionPath < len(r.Path) {
|
||||
r.positionPath++
|
||||
return r.positionPath
|
||||
return
|
||||
}
|
||||
|
||||
// if we have payloads increment only when the generators are done
|
||||
if r.generator == nil {
|
||||
r.positionRaw++
|
||||
if len(r.Raw) > 0 && r.positionRaw < len(r.Raw) {
|
||||
// if we have payloads increment only when the generators are done
|
||||
if r.generator == nil {
|
||||
r.positionRaw++
|
||||
}
|
||||
}
|
||||
|
||||
return r.positionPath + r.positionRaw
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user