mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 20:51:52 +08:00
fix: UDP插件改用 conn.SetDeadline 替代类型断言
This commit is contained in:
@@ -33,9 +33,7 @@ func (p *TFTPPlugin) Scan(ctx context.Context, info *common.HostInfo, session *c
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
if dl, ok := conn.(interface{ SetReadDeadline(time.Time) error }); ok {
|
||||
_ = dl.SetReadDeadline(time.Now().Add(timeout))
|
||||
}
|
||||
_ = conn.SetDeadline(time.Now().Add(timeout))
|
||||
|
||||
if _, err := conn.Write(buildTFTPReadRequest("probe")); err != nil {
|
||||
return &ScanResult{Success: false, Service: "tftp"}
|
||||
|
||||
Reference in New Issue
Block a user