|
1 | 1 | "use strict";
|
2 | 2 |
|
3 |
| -const Errors = require("../misc/errors"); |
4 | 3 | const Iconv = require("iconv-lite");
|
5 | 4 | const Capabilities = require("../const/capabilities");
|
6 | 5 | const NativePasswordAuth = require("./handshake/auth/native_password_auth");
|
@@ -134,50 +133,6 @@ class ChangeUser extends Handshake {
|
134 | 133 | connOpts.password = opt.password;
|
135 | 134 | }
|
136 | 135 |
|
137 |
| - /** |
138 |
| - * Read ping response packet. |
139 |
| - * packet can be : |
140 |
| - * - an ERR_Packet |
141 |
| - * - a OK_Packet |
142 |
| - * |
143 |
| - * @param packet query response |
144 |
| - * @param out output writer |
145 |
| - * @param opts connection options |
146 |
| - * @param info connection info |
147 |
| - * @returns {null} |
148 |
| - */ |
149 |
| - readChangeUserResponsePacket(packet, out, opts, info) { |
150 |
| - switch (packet.peek()) { |
151 |
| - //********************************************************************************************************* |
152 |
| - //* OK response |
153 |
| - //********************************************************************************************************* |
154 |
| - case 0x00: |
155 |
| - packet.skip(1); //skip header |
156 |
| - info.status = packet.readUInt16(); |
157 |
| - if (this.onResult) process.nextTick(this.onResult, null); |
158 |
| - this.emit("end"); |
159 |
| - return null; |
160 |
| - |
161 |
| - //********************************************************************************************************* |
162 |
| - //* ERROR response |
163 |
| - //********************************************************************************************************* |
164 |
| - case 0xff: |
165 |
| - const err = packet.readError(info); |
166 |
| - this.throwError(err); |
167 |
| - return null; |
168 |
| - |
169 |
| - default: |
170 |
| - const errUnexpected = Errors.createError( |
171 |
| - "unexpected packet", |
172 |
| - false, |
173 |
| - info, |
174 |
| - "42000", |
175 |
| - Errors.ER_CHANGE_USER_BAD_PACKET |
176 |
| - ); |
177 |
| - this.throwError(errUnexpected); |
178 |
| - return null; |
179 |
| - } |
180 |
| - } |
181 | 136 | }
|
182 | 137 |
|
183 | 138 | function writeParam(out, val, encoding) {
|
|
0 commit comments