Rxnet / eventstore-client

EventStore asynchronous PHP client with reactiveX flavours
Apache License 2.0
26 stars 10 forks source link

fix "Unexpected wire type" error caused when message spans across multiple requests #37

Closed eithed closed 5 years ago

eithed commented 5 years ago

There's a couple of changes here:

  1. $value = A at the beginning $this->currentMesage is null at the end $this->currentMessage becomes A
  2. $value = B from previous call $this->currentMessage is A at the beginning $value becomes AB at the end $this->currentMessage becomes AAB
  3. $value = C from previous call $this->currentMessage is AAB at the beginning $value becomes AABC at the end $this->currentMessage becomes AABAABC

At any point $dataLength > $messageLength condition can be encountered; it fails to decompose the message, because it was incorrectly assembled.

Th3Mouk commented 5 years ago

I'm agree with U, the #18 is IMO more understandable and don't need do/while. I don't get the point, why this do/while has been implemented at the beginning.

eithed commented 5 years ago

@Th3Mouk - would it be worth creating a release?

Th3Mouk commented 5 years ago

@eithed yep absolutely i'm just looking if i can include something else in the release

Th3Mouk commented 5 years ago

just released 3.0.1