[protobuf] Re: Issue 531 in protobuf: Cannot build protobuf using VS2013

2015-03-18 Thread protobuf


Comment #14 on issue 531 by st.ere...@gmail.com: Cannot build protobuf  
using VS2013

https://code.google.com/p/protobuf/issues/detail?id=531

Same problem as #12

--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Using CodedOutputStream to send many messages across network

2015-03-18 Thread Sayan Goswami
Hi All,

I am using CodedOutputStream and CodedInputStream to transfer messages 
across a network like so:

*Client requests:*

Socket serverSocket = new Socket(hosts, ports);

CodedOutputStream outputStream = CodedOutputStream.newInstance(serverSocket
.getOutputStream());

outputStream.flush();

CodedInputStream inputStream = CodedInputStream.newInstance(serverSocket
.getInputStream());


// the following happens inside a loop

 Request request = Request.newBuilder()

.setType(Request.RequestType.GET)

.setKey(key)

 .build();


 outputStream.writeRawVarint32(request.getSerializedSize());

 request.writeTo(outputStream);

 outputStream.flush();


*Server Processes Request:*


CodedOutputStream output = CodedOutputStream.newInstance(clientSocket
.getOutputStream());

output.flush();

CodedInputStream input = CodedInputStream.newInstance(clientSocket
.getInputStream());


int length = input.readRawVarint32();

byte[] message = input.readRawBytes(length);

Request request = Request.parseFrom(message);

// do things with request


Now, each request of mine, has a serialized size of 56.. so I can send many 
messages up the stream, but what can I do when the size limit of 64MB is 
exceeded? Is there any way to reset the buffer? Following is the error 
message I am getting:


Protocol message was too large.  May be malicious.  Use 
CodedInputStream.setSizeLimit() to increase the size limit.


Thanks,


Sayan

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Using CodedOutputStream to send many messages across network

2015-03-18 Thread Ilia Mirkin
On Tue, Mar 17, 2015 at 10:15 PM, Sayan Goswami sayan.n...@gmail.com wrote:
 Hi All,

 I am using CodedOutputStream and CodedInputStream to transfer messages
 across a network like so:

 Client requests:

 Socket serverSocket = new Socket(hosts, ports);

 CodedOutputStream outputStream =
 CodedOutputStream.newInstance(serverSocket.getOutputStream());

 outputStream.flush();

 CodedInputStream inputStream =
 CodedInputStream.newInstance(serverSocket.getInputStream());


 // the following happens inside a loop

  Request request = Request.newBuilder()

 .setType(Request.RequestType.GET)

 .setKey(key)

 .build();


  outputStream.writeRawVarint32(request.getSerializedSize());

  request.writeTo(outputStream);

  outputStream.flush();


 Server Processes Request:


 CodedOutputStream output =
 CodedOutputStream.newInstance(clientSocket.getOutputStream());

 output.flush();

 CodedInputStream input =
 CodedInputStream.newInstance(clientSocket.getInputStream());


 int length = input.readRawVarint32();

 byte[] message = input.readRawBytes(length);

Ew. You can just do a

limit = input.pushLimit(length)
request = Request.Builder.mergeFrom(input).build();
input.popLimit(limit);


 Request request = Request.parseFrom(message);

 // do things with request


 Now, each request of mine, has a serialized size of 56.. so I can send many
 messages up the stream, but what can I do when the size limit of 64MB is
 exceeded? Is there any way to reset the buffer? Following is the error
 message I am getting:


 Protocol message was too large.  May be malicious.  Use
 CodedInputStream.setSizeLimit() to increase the size limit.

From the docs:

If you want to read several messages from a single CodedInputStream,
you could call resetSizeCounter() after each one to avoid hitting the
size limit.

Cheers,

  -ilia

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Using CodedOutputStream to send many messages across network

2015-03-18 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Mar 17, 2015 at 7:15 PM, Sayan Goswami sayan.n...@gmail.com wrote:

 Hi All,

 I am using CodedOutputStream and CodedInputStream to transfer messages
 across a network like so:

 *Client requests:*

 Socket serverSocket = new Socket(hosts, ports);

 CodedOutputStream outputStream = CodedOutputStream.newInstance(
 serverSocket.getOutputStream());

 outputStream.flush();

 CodedInputStream inputStream = CodedInputStream.newInstance(serverSocket
 .getInputStream());


 // the following happens inside a loop

  Request request = Request.newBuilder()

 .setType(Request.RequestType.GET)

 .setKey(key)

  .build();


  outputStream.writeRawVarint32(request.getSerializedSize());

  request.writeTo(outputStream);

  outputStream.flush();


 *Server Processes Request:*


 CodedOutputStream output = CodedOutputStream.newInstance(clientSocket
 .getOutputStream());

 output.flush();

 CodedInputStream input = CodedInputStream.newInstance(clientSocket
 .getInputStream());


 int length = input.readRawVarint32();

 byte[] message = input.readRawBytes(length);

 Request request = Request.parseFrom(message);

 // do things with request


 Now, each request of mine, has a serialized size of 56.. so I can send
 many messages up the stream, but what can I do when the size limit of 64MB
 is exceeded? Is there any way to reset the buffer? Following is the error
 message I am getting:


 Protocol message was too large.  May be malicious.  Use 
 CodedInputStream.setSizeLimit() to increase the size limit.


 CodedInputStream.resetSizeCounter() should do the trick. You can call it
before reading each message.


 Thanks,


 Sayan

  --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to protobuf+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at http://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Issue 694 in protobuf: module machine type 'x64' conflicts with target machine type 'X86'

2015-03-18 Thread protobuf

Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 694 by va...@pushstrength.com: module machine type 'x64'  
conflicts with target machine type 'X86'

https://code.google.com/p/protobuf/issues/detail?id=694

What steps will reproduce the problem?
1. Create a project on x64 platform that exploits gtest
2. Compile
3. Error shows up

What is the expected output? What do you see instead?
module machine type 'x64' conflicts with target machine type 'X86'

What version of the product are you using? On what operating system?


Please provide any additional information below.

I have a project on Win32 platform. I followed all the steps on VS 2013 to  
move it to x64 platform as follows:


Build - Configuration Manager - Active Solution Platform - New - Copy  
from Win32

Build - Configuration Manager - Platform - x64 (for all the projects)
Project - Properties - Configuration Properties - VC++ Directories -  
Library Directories -  
$(VCInstallDir)\bin\x86_amd64;$(VCInstallDir)\bin.;$(WindowsSdkDir)lib\x64

Build - Build Solution
If I don't select x64 for my unit tests, the solution builds like a charm!  
The problem is when I select to have the unit tests in x64 format as well.  
The problem should be from the google protobuf side but I don't know how to  
resolve it.


Does anyone have any clue?
Thanks

--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.