MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / sendHello

Method sendHello

src/SecureRpcHelper96.java:72–101  ·  view source on GitHub ↗
(final Channel channel)

Source from the content-addressed store, hash-verified

70 }
71
72 @Override
73 public void sendHello(final Channel channel) {
74 ChannelBuffer buffer = ChannelBuffers.wrappedBuffer(connection_header);
75 Channels.write(channel, buffer);
76
77 // sasl_client is null for Simple Auth case
78 if (sasl_client != null) {
79 byte[] challenge_bytes = null;
80 if (sasl_client.hasInitialResponse()) {
81 challenge_bytes = processChallenge(new byte[0]);
82 }
83 if (challenge_bytes != null) {
84 final byte[] buf = new byte[4 + challenge_bytes.length];
85 buffer = ChannelBuffers.wrappedBuffer(buf);
86 buffer.clear();
87 buffer.writeInt(challenge_bytes.length);
88 buffer.writeBytes(challenge_bytes);
89
90 //if (LOG.isDebugEnabled()) {
91 // LOG.debug("Sending initial SASL Challenge: " + Bytes.pretty(buf));
92 //}
93 Channels.write(channel, buffer);
94 } else {
95 // TODO - is this exception worthy? We'll never get back here
96 LOG.error("Missing initial Sasl response on client " + region_client);
97 }
98 } else {
99 sendRPCHeader(channel);
100 }
101 }
102
103 @Override
104 public ChannelBuffer handleResponse(final ChannelBuffer buf,

Callers

nothing calls this directly

Calls 3

sendRPCHeaderMethod · 0.95
clearMethod · 0.80
processChallengeMethod · 0.45

Tested by

no test coverage detected