2024-03-01 16:10:18 +03:00
|
|
|
// Warning - This is generated code
|
|
|
|
|
package mssql
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2024-07-25 05:29:35 +08:00
|
|
|
_ "github.com/microsoft/go-mssqldb"
|
2024-03-01 16:10:18 +03:00
|
|
|
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
|
|
|
)
|
|
|
|
|
|
2025-07-09 14:47:26 -05:00
|
|
|
func memoizedconnect(executionId string, host string, port int, username string, password string, dbName string) (bool, error) {
|
2024-03-01 16:10:18 +03:00
|
|
|
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) {
|
2025-07-09 14:47:26 -05:00
|
|
|
return connect(executionId, host, port, username, password, dbName)
|
2024-03-01 16:10:18 +03:00
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if value, ok := v.(bool); ok {
|
|
|
|
|
return value, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false, errors.New("could not convert cached result")
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-09 14:47:26 -05:00
|
|
|
func memoizedisMssql(executionId string, host string, port int) (bool, error) {
|
2024-03-01 16:10:18 +03:00
|
|
|
hash := "isMssql" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
|
|
|
|
|
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
2025-07-09 14:47:26 -05:00
|
|
|
return isMssql(executionId, host, port)
|
2024-03-01 16:10:18 +03:00
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if value, ok := v.(bool); ok {
|
|
|
|
|
return value, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false, errors.New("could not convert cached result")
|
|
|
|
|
}
|