Reading packets. * Internally, it calls (if no more data) next() method of the underlying ReadBufferFromPocoSocket, and sets the working buffer to the rest part of the current packet payload. */
| 9 | * Internally, it calls (if no more data) next() method of the underlying ReadBufferFromPocoSocket, and sets the working buffer to the rest part of the current packet payload. |
| 10 | */ |
| 11 | class MySQLPacketPayloadReadBuffer : public ReadBuffer |
| 12 | { |
| 13 | private: |
| 14 | ReadBuffer & in; |
| 15 | uint8_t & sequence_id; |
| 16 | |
| 17 | bool has_read_header = false; |
| 18 | |
| 19 | // Size of packet which is being read now. |
| 20 | size_t payload_length = 0; |
| 21 | |
| 22 | // Offset in packet payload. |
| 23 | size_t offset = 0; |
| 24 | |
| 25 | protected: |
| 26 | bool nextImpl() override; |
| 27 | |
| 28 | public: |
| 29 | MySQLPacketPayloadReadBuffer(ReadBuffer & in_, uint8_t & sequence_id_); |
| 30 | }; |
| 31 | |
| 32 | } |
| 33 |