Projects STRLCPY afrog Commits e60ecbe2
🤬
  • 修复report报告mac存在漏报问题 & version 1.3.1

  • Loading...
  • zan8in committed 2 years ago
    e60ecbe2
    1 parent 3eb95af2
  • ■ ■ ■ ■ ■
    cmd/afrog/main.go
    skipped 54 lines
    55 55   r := result.(*core.Result)
    56 56   
    57 57   lock.Lock()
    58  - defer lock.Unlock()
    59 58   
    60 59   if !options.Silent {
    61 60   options.CurrentCount++
    skipped 14 lines
    76 75   if !options.Silent {
    77 76   fmt.Printf("\r%d/%d | %d%% ", options.CurrentCount, options.Count, options.CurrentCount*100/options.Count)
    78 77   }
     78 + 
     79 + lock.Unlock()
    79 80   
    80 81   })
    81 82   if err != nil {
    skipped 13 lines
  • ■ ■ ■ ■
    internal/runner/banner.go
    skipped 8 lines
    9 9  )
    10 10   
    11 11  func ShowBanner() string {
    12  - return "afrog"
     12 + return "afrog "
    13 13  }
    14 14   
    15 15  func ShowUsage() string {
    skipped 13 lines
  • ■ ■ ■ ■
    pkg/config/config.go
    skipped 38 lines
    39 39  }
    40 40   
    41 41  const afrogConfigFilename = "afrog-config.yaml"
    42  -const Version = "1.3.0"
     42 +const Version = "1.3.1"
    43 43   
    44 44  // Create and initialize afrog-config.yaml configuration info
    45 45  func New() (*Config, error) {
    skipped 109 lines
  • pkg/html/html.go
    Unable to diff as some line is too long.
  • ■ ■ ■ ■ ■ ■
    pkg/utils/syncfile.go
     1 +package utils
     2 + 
     3 +import (
     4 + "bufio"
     5 + "os"
     6 + "sync"
     7 +)
     8 + 
     9 +type Syncfile struct {
     10 + mutex *sync.Mutex
     11 + iohandler *os.File
     12 +}
     13 + 
     14 +func NewSyncfile(filename string) (*Syncfile, error) {
     15 + f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
     16 + if err != nil {
     17 + return nil, err
     18 + }
     19 + return &Syncfile{mutex: &sync.Mutex{}, iohandler: f}, nil
     20 +}
     21 + 
     22 +func (sf *Syncfile) Write(content string) {
     23 + sf.mutex.Lock()
     24 + 
     25 + wbuf := bufio.NewWriterSize(sf.iohandler, len(content))
     26 + wbuf.WriteString(content)
     27 + wbuf.Flush()
     28 + 
     29 + RandSleep(1)
     30 + 
     31 + sf.mutex.Unlock()
     32 +}
     33 + 
Please wait...
Page is in error, reload to recover