MCPcopy
hub / github.com/go-sql-driver/mysql / writeAuthSwitchPacket

Method writeAuthSwitchPacket

packets.go:418–429  ·  packets.go::mysqlConn.writeAuthSwitchPacket

https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_auth_switch_response.html

(authData []byte)

Source from the content-addressed store, hash-verified

416
417// https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_auth_switch_response.html
418func (mc *mysqlConn) writeAuthSwitchPacket(authData []byte) error {
419 pktLen := 4 + len(authData)
420 data, err := mc.buf.takeBuffer(pktLen)
421 if err != nil {
422 mc.cleanup()
423 return err
424 }
425
426 // Add the auth data [EOF]
427 copy(data[4:], authData)
428 return mc.writePacket(data)
429}
430
431/******************************************************************************
432* Command Packets *

Callers 2

sendEncryptedPasswordMethod · 0.95
handleAuthResultMethod · 0.95

Calls 3

cleanupMethod · 0.95
writePacketMethod · 0.95
takeBufferMethod · 0.80

Tested by

no test coverage detected