Simplify ChangeCipherSpec code in runner.
Not sure why it was expanded out like that. Change-Id: I6899dbd23130ed7196c45c2784330b2a4fe9bdba Reviewed-on: https://boringssl-review.googlesource.com/17666 Commit-Queue: Steven Valdez <svaldez@google.com> Reviewed-by: Steven Valdez <svaldez@google.com>
This commit is contained in:
parent
be483dbe2d
commit
a818134b67
@ -1141,12 +1141,7 @@ func (c *Conn) doWriteRecord(typ recordType, data []byte) (n int, err error) {
|
||||
if typ == recordTypeChangeCipherSpec {
|
||||
err = c.out.changeCipherSpec(c.config)
|
||||
if err != nil {
|
||||
// Cannot call sendAlert directly,
|
||||
// because we already hold c.out.Mutex.
|
||||
c.tmp[0] = alertLevelError
|
||||
c.tmp[1] = byte(err.(alert))
|
||||
c.writeRecord(recordTypeAlert, c.tmp[0:2])
|
||||
return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err})
|
||||
return n, c.sendAlertLocked(alertLevelError, err.(alert))
|
||||
}
|
||||
}
|
||||
return
|
||||
|
@ -159,12 +159,7 @@ func (c *Conn) dtlsWriteRecord(typ recordType, data []byte) (n int, err error) {
|
||||
if typ == recordTypeChangeCipherSpec {
|
||||
err = c.out.changeCipherSpec(c.config)
|
||||
if err != nil {
|
||||
// Cannot call sendAlert directly,
|
||||
// because we already hold c.out.Mutex.
|
||||
c.tmp[0] = alertLevelError
|
||||
c.tmp[1] = byte(err.(alert))
|
||||
c.writeRecord(recordTypeAlert, c.tmp[0:2])
|
||||
return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err})
|
||||
return n, c.sendAlertLocked(alertLevelError, err.(alert))
|
||||
}
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user