kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | c16b0d92503b4ede38a821de8257bf0d86adb48d0a1d358ad196e06ee4220aaa |
|---|---|
| Author | Norman Maurer <norman_maurer@apple.com> · 2016-07-11 22:39 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-09-15 16:34 -07:00 |
| Parents | dc11f14cdcc4 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Frame.java +2 −2
| @@ -197,7 +197,7 @@ | ||
| 197 | 197 | if (buffer.readableBytes() < 1) |
| 198 | 198 | return; |
| 199 | 199 | |
| 200 | - int version = buffer.getByte(0); | |
| 200 | + int version = buffer.getByte(buffer.readerIndex()); | |
| 201 | 201 | // version first bit is the "direction" of the frame (request or response) |
| 202 | 202 | version = version & 0x7F; |
| 203 | 203 | |
| @@ -223,7 +223,7 @@ | ||
| 223 | 223 | return null; |
| 224 | 224 | |
| 225 | 225 | // Validate the opcode (this will throw if it's not a response) |
| 226 | - Message.Response.Type.fromOpcode(buffer.getByte(opcodeOffset)); | |
| 226 | + Message.Response.Type.fromOpcode(buffer.getByte(buffer.readerIndex() + opcodeOffset)); | |
| 227 | 227 | |
| 228 | 228 | ByteBuf frame = (ByteBuf) super.decode(ctx, buffer); |
| 229 | 229 | if (frame == null) { |