MCPcopy Create free account
hub / github.com/erans/pgsqlite / encode_authentication

Function encode_authentication

src/protocol/codec.rs:205–220  ·  view source on GitHub ↗
(auth: AuthenticationMessage, dst: &mut BytesMut)

Source from the content-addressed store, hash-verified

203}
204
205fn encode_authentication(auth: AuthenticationMessage, dst: &mut BytesMut) {
206 dst.put_u8(b'R');
207 let len_pos = dst.len();
208 dst.put_i32(0); // Placeholder for length
209
210 match auth {
211 AuthenticationMessage::Ok => dst.put_i32(0),
212 AuthenticationMessage::CleartextPassword => dst.put_i32(3),
213 AuthenticationMessage::MD5Password { salt } => {
214 dst.put_i32(5);
215 dst.put_slice(&salt);
216 }
217 }
218
219 update_message_length(dst, len_pos);
220}
221
222fn encode_parameter_status(name: &str, value: &str, dst: &mut BytesMut) {
223 dst.put_u8(b'S');

Callers 1

encodeMethod · 0.85

Calls 2

update_message_lengthFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected