MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / request_buf_auth

Method request_buf_auth

libhsclient/hstcpcli.cpp:190–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void
191hstcpcli::request_buf_auth(const char *secret, const char *typ)
192{
193 if (num_req_sent > 0 || num_req_rcvd > 0) {
194 close();
195 set_error(-1, "request_buf_auth: protocol out of sync");
196 return;
197 }
198 if (typ == 0) {
199 typ = "1";
200 }
201 const string_ref typ_ref(typ, strlen(typ));
202 const string_ref secret_ref(secret, strlen(secret));
203 writebuf.append_literal("A\t");
204 writebuf.append(typ_ref.begin(), typ_ref.end());
205 writebuf.append_literal("\t");
206 writebuf.append(secret_ref.begin(), secret_ref.end());
207 writebuf.append_literal("\n");
208 ++num_req_bufd;
209}
210
211namespace {
212

Callers

nothing calls this directly

Calls 4

append_literalMethod · 0.80
appendMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected