tris: drop QuietError

这个提交包含在:
Filippo Valsorda 2016-11-30 03:08:13 +00:00 提交者 Peter Wu
父节点 2b667f2952
当前提交 5c4af70647
共有 2 个文件被更改,包括 1 次插入16 次删除

13
13.go
查看文件

@ -532,23 +532,10 @@ func (hs *serverHandshakeState) sendSessionTicket13() error {
return nil
}
// QuietError is an error wrapper that prevents the verbose handshake log
// dump on errors. Exposed for use by GetCertificate.
type QuietError struct {
Err error
}
func (e QuietError) Error() string {
return e.Err.Error() + " [quiet]"
}
func (hs *serverHandshakeState) traceErr(err error) {
if err == nil {
return
}
if _, ok := err.(QuietError); ok {
return
}
if os.Getenv("TLSDEBUG") == "error" {
if hs != nil && hs.clientHello != nil {
os.Stderr.WriteString(hex.Dump(hs.clientHello.marshal()))

查看文件

@ -282,9 +282,7 @@ Curves:
hs.cert, err = c.config.getCertificate(hs.clientHelloInfo())
if err != nil {
if _, ok := err.(QuietError); ok {
c.out.traceErr, c.in.traceErr = nil, nil
}
c.out.traceErr, c.in.traceErr = nil, nil // disable tracing
c.sendAlert(alertInternalError)
return false, err
}