Fix windows bustage
authorMartin Thomson <martin.thomson@gmail.com>
Mon, 12 Jun 2017 07:56:39 +0100
changeset 13430 e483be3667d8a68c2ffb8073368a0c9c9ca74658
parent 13429 016802032ef475fd9ca9c8dab81bffd1ad64be5a
child 13431 a0daa19d5ac9bbc3477e5f939d38cb92193643c2
push id2245
push usermartin.thomson@gmail.com
push dateMon, 12 Jun 2017 06:57:04 +0000
Fix windows bustage
gtests/ssl_gtest/tls_agent.cc
--- a/gtests/ssl_gtest/tls_agent.cc
+++ b/gtests/ssl_gtest/tls_agent.cc
@@ -914,19 +914,19 @@ void TlsAgent::SendBuffer(const DataBuff
     error_code_ = PR_GetError();
     expect_readwrite_error_ = false;
   } else {
     ASSERT_EQ(buf.len(), static_cast<size_t>(rv));
   }
 }
 
 void TlsAgent::ReadBytes(size_t amount) {
-  uint8_t block[amount];
+  uint8_t block[16384];
 
-  int32_t rv = PR_Read(ssl_fd(), block, sizeof(block));
+  int32_t rv = PR_Read(ssl_fd(), block, (std::min)(amount, sizeof(block)));
   LOGV("ReadBytes " << rv);
   int32_t err;
 
   if (rv >= 0) {
     size_t count = static_cast<size_t>(rv);
     for (size_t i = 0; i < count; ++i) {
       ASSERT_EQ(recv_ctr_ & 0xff, block[i]);
       recv_ctr_++;