Re: [protobuf] PB parsing with empty/reset values

2010-02-05 Thread Kenton Varda
It sounds to me like the receiving end didn't actually receive any data --
you had it parse an empty message, or a garbage message.

You should verify that the bytes you got from the serializer and the bytes
you fed to the parser are really the same.  For example, compute a checksum
at both ends and print it, then verify manually that they match.

On Fri, Feb 5, 2010 at 8:43 AM, Hershiv Haria wrote:

> Hi all,
>
> I have an odd issue at the moment. I am sending a PB from an android
> app to an app engine server, using Java. My app is being used to store
> files online, and I use the PB to send the file name, destination, and
> file data (as a string).
>
> The problem is that when I send it from the android app, it is fine,
> but attempting to parse it on the server gives my ints as 0 and my
> strings as null. HOWEVER, if I use the same PBs in a test project, it
> works fine.
>
> Any ideas why this would happen?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@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 proto...@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] PB parsing with empty/reset values

2010-02-05 Thread Henner Zeller
Hi,
On Fri, Feb 5, 2010 at 08:43, Hershiv Haria  wrote:
> Hi all,
>
> I have an odd issue at the moment. I am sending a PB from an android
> app to an app engine server, using Java. My app is being used to store
> files online, and I use the PB to send the file name, destination, and
> file data (as a string).

Probably unrelated, but if you have binary file content you might
consider using the type 'bytes' instead of 'string'.

> The problem is that when I send it from the android app, it is fine,
> but attempting to parse it on the server gives my ints as 0 and my
> strings as null. HOWEVER, if I use the same PBs in a test project, it
> works fine.
>
> Any ideas why this would happen?

This is not really enough information to know what is going on. How do
you transfer the data ? Do you have authentication in place that maybe
fails so that you don't get the data to deserialize ? How does the
receiving side know the length of the data it receives (did you check
that it actually gets the number of bytes you expected to be sent) ?
How do you know that sending it from the android app succeeds ?

-h

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@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.