Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when reuse toStream on same object(without change value of field) #12

Closed
Mararok opened this issue Sep 20, 2016 · 1 comment
Closed

Comments

@Mararok
Copy link

Mararok commented Sep 20, 2016

I found some problem :(
When I called toStream second time on message without any changes it's throws me Exception
Reproduce instruction:

  1. .proto file with bytes field
import "php.proto";

message Test {
  required bytes foo = 1;
}
  1. script used generated class
$data = new Test();
$data->setFoo("foo");

$data->toStream();
$data->toStream();

Will produce exception on second call toStream:

RuntimeException: Failed to write stream with 3 bytes in vendor/protobuf-php/protobuf/src/Stream.php:238
@FabioBatSilva
Copy link
Member

Thanks for reporting @Mararok !
This should fix the problem : c0da95f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants