* @returns {0|-1}
()
| 7342 | * @returns {0|-1} |
| 7343 | */ |
| 7344 | onMessageBegin() { |
| 7345 | const { socket, client } = this; |
| 7346 | if (socket.destroyed) { |
| 7347 | return -1; |
| 7348 | } |
| 7349 | if (client[kRunning] === 0) { |
| 7350 | util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); |
| 7351 | return -1; |
| 7352 | } |
| 7353 | const request = client[kQueue][client[kRunningIdx]]; |
| 7354 | if (!request) { |
| 7355 | return -1; |
| 7356 | } |
| 7357 | request.onResponseStarted(); |
| 7358 | return 0; |
| 7359 | } |
| 7360 | /** |
| 7361 | * @param {Buffer} buf |
| 7362 | * @returns {number} |
no test coverage detected