[protobuf] Allocator Support for strings

2011-07-06 Thread Gokul
Hi,
   In the application, i am working on, we are managing the memory of
strings using allocators. But i find that the protobuf uses strings
without any allocator support. Is there a plan to provide allocator
support for strings in future?
Or can someone guide me on how to go about implementing this change?

  I would need a typedef somewhere to mention the string type and the
library should generate the appropriate code for it.

Thanks,
Gokul.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 296 in protobuf: Deploy protobuf-java 2.4.1 JAR to Maven Repository

2011-07-06 Thread protobuf


Comment #15 on issue 296 by jhuxh...@googlemail.com: Deploy protobuf-java  
2.4.1 JAR to Maven Repository

http://code.google.com/p/protobuf/issues/detail?id=296

Thanks! The artifact has just reached the central maven repository.
http://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/

And LOL @ http://code.google.com/p/protobuf/issues/detail?id=296#c12 ;)

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 296 in protobuf: Deploy protobuf-java 2.4.1 JAR to Maven Repository

2011-07-06 Thread protobuf

Updates:
Status: Fixed

Comment #14 on issue 296 by g...@google.com: Deploy protobuf-java 2.4.1 JAR  
to Maven Repository

http://code.google.com/p/protobuf/issues/detail?id=296

Deployed to oss.sonatype.org and released.  Sorry about the wait.

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 296 in protobuf: Deploy protobuf-java 2.4.1 JAR to Maven Repository

2011-07-06 Thread protobuf


Comment #13 on issue 296 by g...@google.com: Deploy protobuf-java 2.4.1 JAR  
to Maven Repository

http://code.google.com/p/protobuf/issues/detail?id=296

Ha.  Yes it did.  Then I got distracted by a long holiday weekend.   
Resuming now.  :-)


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 296 in protobuf: Deploy protobuf-java 2.4.1 JAR to Maven Repository

2011-07-06 Thread protobuf


Comment #12 on issue 296 by trobi...@gmail.com: Deploy protobuf-java 2.4.1  
JAR to Maven Repository

http://code.google.com/p/protobuf/issues/detail?id=296

Has the build finished yet?

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Safe way to access the functionality of MutableCProtoInsidePyProto

2011-07-06 Thread A Richardson
I am writing a python extension (in C++) which needs to work with
protobufs. I would also like to make use of the experimental C++/
Python extension in my application. (i.e. I would like my extension to
handle python protobuf messages which are actually backed by c++
messages.)

Is there a reasonable way to do this right now? It appears that the
secret to doing this would lie gaining access to the
MutableCProtoInsidePyProto method which exists down inside the
protobuf pyext code. However, this method is only implemented in the
internal _net_proto2___python.so library, which is a python extension
itself, and not suitable for 'general' linking to another library
(e.g. it has no soname defined).

It seems like maybe this could be solved by creating a separate
'implementation' library which would contain the implementation of
MutableCProtoInsidePyProto (and its sibling method). This would also
require moving the CMessage struct out of the python-proto2.cc file
and into a header file so it could be used for both the python
extension, and the implementation library.

Thoughts?

Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-06 Thread Jason Hsueh
Can you not control the number of messages?

In any event, I think the problem is the memory lifetime of the streambuf.
>From the docs on async_write:

b

A basic_streambuf object from which data will be written. Ownership of the
streambuf is retained by the caller, which must guarantee that it remains
valid until the handler is called.


On Wed, Jul 6, 2011 at 10:10 AM, platzhirsch
wrote:

> I find it difficult to check this by so many messages. This approach
> was suggested by some people already, I don't know how I would realize
> this.
>
> On Jul 6, 6:56 pm, Jason Hsueh  wrote:
> > I'm not familiar with the boost libraries you're using, but the use of
> > "async_write" and the stack-allocated streambuf looks suspect. If nothing
> > jumps out there, I would first check that the data read from the socket
> in
> > Java exactly matches the data on the C++ side.
> >
> > On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch <
> konrad.rei...@googlemail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Some other exceptions I receive as well:
> >
> > > Protocol message tag had invalid wire type.
> > > Protocol message end-group tag did not match expected tag.
> > > While parsing a protocol message, the input ended unexpectedly in the
> > > middle of a field.  This could mean either than the input has been
> > > truncated or that an embedded message misreported its own length.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Protocol Buffers" group.
> > > To post to this group, send email to protobuf@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > protobuf+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/protobuf?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-06 Thread Christopher Smith
Basic rule: if the memory is used outside the lifetime of the function call, 
you don't want it on the stack. Async_write very much requires the memory to be 
around later.

--Chris

On Jul 6, 2011, at 10:10 AM, platzhirsch  wrote:

> I find it difficult to check this by so many messages. This approach
> was suggested by some people already, I don't know how I would realize
> this.
> 
> On Jul 6, 6:56 pm, Jason Hsueh  wrote:
>> I'm not familiar with the boost libraries you're using, but the use of
>> "async_write" and the stack-allocated streambuf looks suspect. If nothing
>> jumps out there, I would first check that the data read from the socket in
>> Java exactly matches the data on the C++ side.
>> 
>> On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch 
>> wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Some other exceptions I receive as well:
>> 
>>> Protocol message tag had invalid wire type.
>>> Protocol message end-group tag did not match expected tag.
>>> While parsing a protocol message, the input ended unexpectedly in the
>>> middle of a field.  This could mean either than the input has been
>>> truncated or that an embedded message misreported its own length.
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Protocol Buffers" group.
>>> To post to this group, send email to protobuf@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> protobuf+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/protobuf?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to 
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/protobuf?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-06 Thread platzhirsch
I find it difficult to check this by so many messages. This approach
was suggested by some people already, I don't know how I would realize
this.

On Jul 6, 6:56 pm, Jason Hsueh  wrote:
> I'm not familiar with the boost libraries you're using, but the use of
> "async_write" and the stack-allocated streambuf looks suspect. If nothing
> jumps out there, I would first check that the data read from the socket in
> Java exactly matches the data on the C++ side.
>
> On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch 
> wrote:
>
>
>
>
>
>
>
> > Some other exceptions I receive as well:
>
> > Protocol message tag had invalid wire type.
> > Protocol message end-group tag did not match expected tag.
> > While parsing a protocol message, the input ended unexpectedly in the
> > middle of a field.  This could mean either than the input has been
> > truncated or that an embedded message misreported its own length.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To post to this group, send email to protobuf@googlegroups.com.
> > To unsubscribe from this group, send email to
> > protobuf+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-06 Thread Jason Hsueh
I'm not familiar with the boost libraries you're using, but the use of
"async_write" and the stack-allocated streambuf looks suspect. If nothing
jumps out there, I would first check that the data read from the socket in
Java exactly matches the data on the C++ side.

On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch wrote:

> Some other exceptions I receive as well:
>
> Protocol message tag had invalid wire type.
> Protocol message end-group tag did not match expected tag.
> While parsing a protocol message, the input ended unexpectedly in the
> middle of a field.  This could mean either than the input has been
> truncated or that an embedded message misreported its own length.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re:Re: Re:Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-07-06 Thread jianhua
Thanks Wright;
Yes, protostuff has serialize tool for XML, but written by JAVA and my project 
is native C++.  


At 2011-06-27 22:15:48,"Ben Wright"  wrote:
Have you tried http://code.google.com/p/protostuff/ ?


--
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web 
visithttps://groups.google.com/d/msg/protobuf/-/hTS8SDZLVvgJ.
To post to this group, send email toproto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #14 on issue 289 by m...@bakedbeans.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

Thanks for resolving this issue!

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #13 on issue 289 by liuj...@google.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

A Node for myself:

The reason that gtest 1.6 didn't pass, because this diff  
http://code.google.com/p/googletest/source/diff?spec=svn500&r=500&format=side&path=/trunk/include/gtest/internal/gtest-death-test-internal.h&old_path=/trunk/include/gtest/internal/gtest-death-test-internal.h&old=482


In 2.4.0 release, protobuf GOOGLE_CHECK will throw an  
exception(FatalException derived from std::exception) by default instead of  
exit(0) which isn't compatible with gtest 1.6 death check.


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #12 on issue 289 by m...@bakedbeans.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

No, I haven't defined PROTOBUF_USE_EXCEPTIONS anywhere.

I tried using gtest 1.5, now all tests pass in release and debug modes.

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #11 on issue 289 by liuj...@google.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

Wait, did you define PROTOBUF_USE_EXCEPTIONS? That seemed to be the reasons  
of these error.


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #10 on issue 289 by liuj...@google.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

Can you try gtest 1.5 instead? The death test change in gtest doesn't seem  
to be compatible with protobuf unittest.


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 289 in protobuf: 64 bit release build unit tests fail in MSVC 2010

2011-07-06 Thread protobuf


Comment #9 on issue 289 by m...@bakedbeans.com: 64 bit release build unit  
tests fail in MSVC 2010

http://code.google.com/p/protobuf/issues/detail?id=289

I've applied the patch in r402, done a full clean rebuilds of both release  
and debug, but these unit tests still fail in both cases. Strangely both  
fail a different number of tests.

I've attached both test outputs.

Attachments:
debug.txt  113 KB
release.txt  103 KB

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.