Skip to content

Commit

Permalink
check error and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
linyows committed Jun 22, 2021
1 parent 15bdfa3 commit 456ba5b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func (p *Pipe) Do() {
}
if !p.tls && p.readytls {
p.locked = true
p.starttls()
er := p.starttls()
if er != nil {
log.Printf("upstream starttls error: %s", er.Error())
}
p.readytls = false
log.Printf(">| %s", p.escapeCRLF(b[0:i]))
}
Expand All @@ -71,7 +74,10 @@ func (p *Pipe) Do() {
p.readytls = true
} else if !p.tls && bytes.Contains(b, []byte(readyToStartTLS)) {
log.Printf("|< %s", p.escapeCRLF(b[0:i]))
p.connectTLS()
er := p.connectTLS()
if er != nil {
log.Printf("downstream connectTLS error: %s", er.Error())
}
}
return b, i
})
Expand Down

0 comments on commit 456ba5b

Please sign in to comment.