Skip to content

Commit 519b56d

Browse files
committed
Merge branch 'development' of https://github.com/Microsoft/cpprestsdk into development
2 parents 9635a76 + 8e3e041 commit 519b56d

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

Release/libs/websocketpp/websocketpp/connection.hpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@ typedef lib::function<void(lib::error_code const & ec)> write_frame_handler;
161161
* @todo Move this to configs to allow compile/runtime disabling or enabling
162162
* of protocol versions
163163
*/
164+
#if defined(_MSC_VER)
165+
#pragma warning(push)
166+
#pragma warning(disable : 4592)
167+
#endif
164168
static std::vector<int> const versions_supported = {0,7,8,13};
169+
#if defined(_MSC_VER)
170+
#pragma warning(pop)
171+
#endif
165172
#else
166173
/// Helper array to get around lack of initializer lists pre C++11
167174
static int const helper[] = {0,7,8,13};
@@ -534,7 +541,7 @@ class connection
534541

535542
/// Get maximum message size
536543
/**
537-
* Get maximum message size. Maximum message size determines the point at
544+
* Get maximum message size. Maximum message size determines the point at
538545
* which the connection will fail with the message_too_big protocol error.
539546
*
540547
* The default is set by the endpoint that creates the connection.
@@ -544,11 +551,11 @@ class connection
544551
size_t get_max_message_size() const {
545552
return m_max_message_size;
546553
}
547-
554+
548555
/// Set maximum message size
549556
/**
550-
* Set maximum message size. Maximum message size determines the point at
551-
* which the connection will fail with the message_too_big protocol error.
557+
* Set maximum message size. Maximum message size determines the point at
558+
* which the connection will fail with the message_too_big protocol error.
552559
* This value may be changed during the connection.
553560
*
554561
* The default is set by the endpoint that creates the connection.
@@ -563,7 +570,7 @@ class connection
563570
m_processor->set_max_message_size(new_value);
564571
}
565572
}
566-
573+
567574
/// Get maximum HTTP message body size
568575
/**
569576
* Get maximum HTTP message body size. Maximum message body size determines
@@ -579,7 +586,7 @@ class connection
579586
size_t get_max_http_body_size() const {
580587
return m_request.get_max_body_size();
581588
}
582-
589+
583590
/// Set maximum HTTP message body size
584591
/**
585592
* Set maximum HTTP message body size. Maximum message body size determines
@@ -683,14 +690,14 @@ class connection
683690
* @return An error code
684691
*/
685692
lib::error_code interrupt();
686-
693+
687694
/// Transport inturrupt callback
688695
void handle_interrupt();
689-
696+
690697
/// Pause reading of new data
691698
/**
692-
* Signals to the connection to halt reading of new data. While reading is paused,
693-
* the connection will stop reading from its associated socket. In turn this will
699+
* Signals to the connection to halt reading of new data. While reading is paused,
700+
* the connection will stop reading from its associated socket. In turn this will
694701
* result in TCP based flow control kicking in and slowing data flow from the remote
695702
* endpoint.
696703
*
@@ -702,7 +709,7 @@ class connection
702709
*
703710
* If supported by the transport this is done asynchronously. As such reading may not
704711
* stop until the current read operation completes. Typically you can expect to
705-
* receive no more bytes after initiating a read pause than the size of the read
712+
* receive no more bytes after initiating a read pause than the size of the read
706713
* buffer.
707714
*
708715
* If reading is paused for this connection already nothing is changed.
@@ -1357,7 +1364,7 @@ class connection
13571364
* Includes: error code and message for why it was failed
13581365
*/
13591366
void log_fail_result();
1360-
1367+
13611368
/// Prints information about HTTP connections
13621369
/**
13631370
* Includes: TODO
@@ -1506,7 +1513,7 @@ class connection
15061513

15071514
/// Detailed internal error code
15081515
lib::error_code m_ec;
1509-
1516+
15101517
/// A flag that gets set once it is determined that the connection is an
15111518
/// HTTP connection and not a WebSocket one.
15121519
bool m_is_http;

Release/tests/functional/streams/istream_tests.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
#include <float.h>
2727

28+
#ifdef max
29+
#undef max
30+
#endif
31+
2832
#if defined(__cplusplus_winrt)
2933
using namespace Windows::Storage;
3034
#endif
@@ -90,7 +94,7 @@ void fill_file_w(const utility::string_t &name, size_t repetitions = 1)
9094
for (size_t i = 0; i < repetitions; i++)
9195
for (wchar_t ch = L'a'; ch <= L'z'; ++ch)
9296
fwrite(&ch, sizeof(wchar_t), 1, stream);
93-
97+
9498
fclose(stream);
9599
}
96100
#pragma warning (pop)
@@ -372,7 +376,7 @@ TEST(stream_read_5)
372376
VERIFY_ARE_EQUAL(len, rbuf.putn_nocopy(text, len).get());
373377

374378
istream stream(rbuf);
375-
379+
376380
VERIFY_IS_FALSE(stream.is_eof());
377381
VERIFY_ARE_EQUAL(26u, stream.read_to_delim(trg, '\n').get());
378382
VERIFY_IS_FALSE(stream.is_eof());
@@ -725,7 +729,7 @@ TEST(fstream_read_to_end_3)
725729
pplx::details::do_while([=]()-> pplx::task<bool> {
726730
return stream.read().then(lambda1);
727731
}).wait();
728-
732+
729733
auto& target = sbuf.collection();
730734
VERIFY_ARE_EQUAL(26, target.size());
731735
VERIFY_IS_TRUE(stream.is_eof());
@@ -1174,7 +1178,7 @@ TEST(istream_extract_bool_from_number)
11741178
{
11751179
producer_consumer_buffer<char> rbuf;
11761180
const char *text = " 1 0 NOT_OK";
1177-
1181+
11781182
size_t len = strlen(text);
11791183
rbuf.putn_nocopy(text, len).wait();
11801184
rbuf.close(std::ios_base::out).get();
@@ -1212,7 +1216,7 @@ TEST(istream_extract_bool_from_number_w)
12121216
{
12131217
producer_consumer_buffer<wchar_t> rbuf;
12141218
const wchar_t *text = L" 1 0 NOT_OK";
1215-
1219+
12161220
size_t len = wcslen(text);
12171221
rbuf.putn_nocopy(text, len).wait();
12181222
rbuf.close(std::ios_base::out).get();
@@ -1343,10 +1347,10 @@ TEST(extract_floating_point)
13431347
{
13441348
double expected = 0;
13451349
std_istream >> expected;
1346-
1350+
13471351
const auto actual = istream_double.extract<double>().get();
13481352
compare_double(expected, actual);
1349-
1353+
13501354
if (actual <= std::numeric_limits<float>::max())
13511355
compare_float(float(expected), istream_float.extract<float>().get());
13521356
else
@@ -1360,7 +1364,7 @@ TEST(extract_floating_point)
13601364

13611365
TEST(extract_floating_point_with_exceptions)
13621366
{
1363-
std::vector<std::pair<std::string, std::string>> tests;
1367+
std::vector<std::pair<std::string, std::string>> tests;
13641368
tests.push_back(std::pair<std::string, std::string>("a", "Invalid character 'a'"));
13651369
tests.push_back(std::pair<std::string, std::string>("x", "Invalid character 'x'"));
13661370
tests.push_back(std::pair<std::string, std::string>("e", "Invalid character 'e'"));
@@ -1412,7 +1416,7 @@ TEST(extract_floating_point_with_exceptions)
14121416
TEST(streambuf_read_delim)
14131417
{
14141418
producer_consumer_buffer<uint8_t> rbuf;
1415-
std::string s("Hello World"); // there are 2 spaces here
1419+
std::string s("Hello World"); // there are 2 spaces here
14161420

14171421
streams::stringstreambuf data;
14181422

@@ -1423,7 +1427,7 @@ TEST(streambuf_read_delim)
14231427
std::string r("Hello");
14241428
VERIFY_ARE_EQUAL(size, r.size());
14251429
VERIFY_IS_FALSE(is.is_eof());
1426-
1430+
14271431
auto& s2 = data.collection();
14281432
VERIFY_ARE_EQUAL(s2, r);
14291433
return is.read_to_delim(data, ' ');
@@ -1465,7 +1469,7 @@ TEST(uninitialized_streambuf)
14651469
// All operations should throw
14661470
uint8_t * ptr = nullptr;
14671471
size_t count = 0;
1468-
1472+
14691473
VERIFY_THROWS(strbuf.acquire(ptr, count), std::invalid_argument);
14701474
VERIFY_THROWS(strbuf.release(ptr, count), std::invalid_argument);
14711475

0 commit comments

Comments
 (0)