MCPcopy
hub / github.com/XTLS/REALITY / retryReadRecord

Method retryReadRecord

conn.go:829–839  ·  view source on GitHub ↗

retryReadRecord recurs into readRecordOrCCS to drop a non-advancing record, like a warning alert, empty application_data, or a change_cipher_spec in TLS 1.3.

(expectChangeCipherSpec bool)

Source from the content-addressed store, hash-verified

827// retryReadRecord recurs into readRecordOrCCS to drop a non-advancing record, like
828// a warning alert, empty application_data, or a change_cipher_spec in TLS 1.3.
829func (c *Conn) retryReadRecord(expectChangeCipherSpec bool) error {
830 c.retryCount++
831 if c.MaxUselessRecords <= 0 {
832 c.MaxUselessRecords = maxUselessRecords
833 }
834 if c.retryCount > c.MaxUselessRecords {
835 c.sendAlert(alertUnexpectedMessage)
836 return c.in.setErrorLocked(errors.New("tls: too many ignored records"))
837 }
838 return c.readRecordOrCCS(expectChangeCipherSpec)
839}
840
841// atLeastReader reads from R, stopping with EOF once at least N bytes have been
842// read. It is different from an io.LimitedReader in that it doesn't cut short

Callers 1

readRecordOrCCSMethod · 0.95

Calls 3

sendAlertMethod · 0.95
readRecordOrCCSMethod · 0.95
setErrorLockedMethod · 0.80

Tested by

no test coverage detected