MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / handshake

Method handshake

IceFireDB-SQLite/pkg/mysql/server/conn.go:147–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145}
146
147func (c *Conn) handshake() error {
148 if err := c.writeInitialHandshake(); err != nil {
149 return err
150 }
151
152 if err := c.readHandshakeResponse(); err != nil {
153 if errors.Is(err, ErrAccessDenied) {
154 var usingPasswd uint16 = ER_YES
155 if errors.Is(err, ErrAccessDeniedNoPassword) {
156 usingPasswd = ER_NO
157 }
158 err = NewDefaultError(ER_ACCESS_DENIED_ERROR, c.user, c.RemoteAddr().String(), MySQLErrName[usingPasswd])
159 }
160 _ = c.writeError(err)
161 return err
162 }
163
164 if err := c.writeOK(nil); err != nil {
165 return err
166 }
167
168 c.ResetSequence()
169
170 return nil
171}
172
173func (c *Conn) Close() {
174 c.closed.Set(true)

Callers 4

NewConnFunction · 0.95
NewCustomizedConnFunction · 0.95
NewClientConnFunction · 0.95
HandshakeMethod · 0.95

Calls 7

writeInitialHandshakeMethod · 0.95
readHandshakeResponseMethod · 0.95
writeErrorMethod · 0.95
writeOKMethod · 0.95
ResetSequenceMethod · 0.95
StringMethod · 0.65
NewDefaultErrorFunction · 0.50

Tested by

no test coverage detected