mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 23:15:26 +00:00
* introducing execution id * wip * . * adding separate execution context id * lint * vet * fixing pg dialers * test ignore * fixing loader FD limit * test * fd fix * wip: remove CloseProcesses() from dev merge * wip: fix merge issue * protocolstate: stop memguarding on last dialer delete * avoid data race in dialers.RawHTTPClient * use shared logger and avoid race conditions * use shared logger and avoid race conditions * go mod * patch executionId into compiled template cache * clean up comment in Parse * go mod update * bump echarts * address merge issues * fix use of gologger * switch cmd/nuclei to options.Logger * address merge issues with go.mod * go vet: address copy of lock with new Copy function * fixing tests * disable speed control * fix nil ExecuterOptions * removing deprecated code * fixing result print * default logger * cli default logger * filter warning from results * fix performance test * hardcoding path * disable upload * refactor(runner): uses `Warning` instead of `Print` for `pdcpUploadErrMsg` Signed-off-by: Dwi Siswanto <git@dw1.io> * Revert "disable upload" This reverts commit 114fbe6663361bf41cf8b2645fd2d57083d53682. * Revert "hardcoding path" This reverts commit cf12ca800e0a0e974bd9fd4826a24e51547f7c00. --------- Signed-off-by: Dwi Siswanto <git@dw1.io> Co-authored-by: Mzack9999 <mzack9999@protonmail.com> Co-authored-by: Dwi Siswanto <git@dw1.io> Co-authored-by: Dwi Siswanto <25837540+dwisiswant0@users.noreply.github.com>
62 lines
1.9 KiB
Go
Executable File
62 lines
1.9 KiB
Go
Executable File
// Warning - This is generated code
|
|
package postgres
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
_ "github.com/projectdiscovery/nuclei/v3/pkg/js/utils/pgwrap"
|
|
|
|
utils "github.com/projectdiscovery/nuclei/v3/pkg/js/utils"
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
)
|
|
|
|
func memoizedisPostgres(executionId string, host string, port int) (bool, error) {
|
|
hash := "isPostgres" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
|
return isPostgres(executionId, host, port)
|
|
})
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
if value, ok := v.(bool); ok {
|
|
return value, nil
|
|
}
|
|
|
|
return false, errors.New("could not convert cached result")
|
|
}
|
|
|
|
func memoizedexecuteQuery(executionId string, host string, port int, username string, password string, dbName string, query string) (*utils.SQLResult, error) {
|
|
hash := "executeQuery" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port) + ":" + fmt.Sprint(username) + ":" + fmt.Sprint(password) + ":" + fmt.Sprint(dbName) + ":" + fmt.Sprint(query)
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
|
return executeQuery(executionId, host, port, username, password, dbName, query)
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if value, ok := v.(*utils.SQLResult); ok {
|
|
return value, nil
|
|
}
|
|
|
|
return nil, errors.New("could not convert cached result")
|
|
}
|
|
|
|
func memoizedconnect(executionId string, host string, port int, username string, password string, dbName string) (bool, error) {
|
|
hash := "connect" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port) + ":" + fmt.Sprint(username) + ":" + fmt.Sprint(password) + ":" + fmt.Sprint(dbName)
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
|
return connect(executionId, host, port, username, password, dbName)
|
|
})
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
if value, ok := v.(bool); ok {
|
|
return value, nil
|
|
}
|
|
|
|
return false, errors.New("could not convert cached result")
|
|
}
|