Skip to content

Commit c7774b7

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into ios_build_update
2 parents db7844d + 91c9215 commit c7774b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+431
-195
lines changed

Release/include/cpprest/astreambuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace concurrency = Concurrency;
6262

6363
namespace Concurrency
6464
{
65-
/// Library for asychronous streams.
65+
/// Library for asynchronous streams.
6666
namespace streams
6767
{
6868
/// <summary>

Release/include/cpprest/ws_client.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,14 @@ class websocket_exception : public std::exception
276276
}
277277

278278
/// <summary>
279-
/// Destroys the <c>websocket_exception</c> object.
279+
/// Creates a <c>websocket_exception</c> from a error code and string message to use as the what() argument.
280+
/// <param name="code">Error code.</param>
281+
/// <param name="whatArg">Message to use in what() string.</param>
280282
/// </summary>
281-
~websocket_exception() CPPREST_NOEXCEPT {}
283+
websocket_exception(std::error_code code, std::string whatArg) :
284+
m_errorCode(std::move(code)),
285+
m_msg(std::move(whatArg))
286+
{}
282287

283288
/// <summary>
284289
/// Gets a string identifying the cause of the exception.

Release/include/cpprest/x509_cert_utilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <vector>
3131
#include <string>
3232

33-
#if defined(__APPLE__) || defined(ANDROID)
33+
#if defined(__APPLE__) || defined(ANDROID) || (defined(_MS_WINDOWS) && !defined(__cplusplus_winrt) && !defined(_M_ARM))
3434

3535
#include <boost/asio/ssl.hpp>
3636

Release/libs/websocketpp/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PROJECT_NAME = "websocketpp"
3333
# if some version control system is used.
3434

3535

36-
PROJECT_NUMBER = "0.4.0-dev"
36+
PROJECT_NUMBER = "0.3.0"
3737

3838

3939
# Using the PROJECT_BRIEF tag one can provide an optional one line description

Release/libs/websocketpp/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
HEAD
2+
3+
0.3.0 - 2014-08-10
24
- Feature: Adds `start_perpetual` and `stop_perpetual` methods to asio transport
35
These may be used to replace manually managed `asio::io_service::work` objects
46
- Feature: Allow setting pong and handshake timeouts at runtime.
@@ -17,6 +19,9 @@ HEAD
1719
- Feature: Adds the ability to specify a maximum message size.
1820
- Feature: Adds `close::status::get_string(...)` method to look up a human
1921
readable string given a close code value.
22+
- Feature: Adds `connection::read_all(...)` method to iostream transport as a
23+
convenience method for reading all data into the connection buffer without the
24+
end user needing to manually loop on `read_some`.
2025
- Improvement: Open, close, and pong timeouts can be disabled entirely by
2126
setting their duration to 0.
2227
- Improvement: Numerous performance improvements. Including: tuned default

Release/libs/websocketpp/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
WebSocket++ (0.3.0-alpha4)
1+
WebSocket++ (0.3.0)
22
==========================
33

44
WebSocket++ is a header only C++ library that implements RFC6455 The WebSocket

Release/libs/websocketpp/test/transport/iostream/connection.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct stub_con : public iostream_con {
6363
// Set the error to a known code that is unused by the library
6464
// This way we can easily confirm that the handler was run at all.
6565
, ec(websocketpp::error::make_error_code(websocketpp::error::test))
66+
, indef_read_total(0)
6667
{}
6768

6869
/// Get a shared pointer to this component
@@ -111,7 +112,41 @@ struct stub_con : public iostream_con {
111112
ec = e;
112113
}
113114

115+
void async_read_indef(size_t num_bytes, char *buf, size_t len)
116+
{
117+
indef_read_size = num_bytes;
118+
indef_read_buf = buf;
119+
indef_read_len = len;
120+
121+
indef_read();
122+
}
123+
124+
void indef_read() {
125+
iostream_con::async_read_at_least(
126+
indef_read_size,
127+
indef_read_buf,
128+
indef_read_len,
129+
websocketpp::lib::bind(
130+
&stub_con::handle_indef,
131+
type::get_shared(),
132+
websocketpp::lib::placeholders::_1,
133+
websocketpp::lib::placeholders::_2
134+
)
135+
);
136+
}
137+
138+
void handle_indef(websocketpp::lib::error_code const & e, size_t read) {
139+
ec = e;
140+
indef_read_total += read;
141+
142+
indef_read();
143+
}
144+
114145
websocketpp::lib::error_code ec;
146+
size_t indef_read_size;
147+
char * indef_read_buf;
148+
size_t indef_read_len;
149+
size_t indef_read_total;
115150
};
116151

117152
// Stubs
@@ -314,6 +349,47 @@ BOOST_AUTO_TEST_CASE( async_read_at_least_read_some ) {
314349
BOOST_CHECK_EQUAL( std::string(buf,10), "abcdefgxxx" );
315350
}
316351

352+
BOOST_AUTO_TEST_CASE( async_read_at_least_read_some_indef ) {
353+
stub_con::ptr con(new stub_con(true,alogger,elogger));
354+
355+
char buf[20];
356+
memset(buf,'x',20);
357+
358+
con->async_read_indef(5,buf,5);
359+
BOOST_CHECK( con->ec == make_error_code(websocketpp::error::test) );
360+
361+
// here we expect to return early from read some because the outstanding
362+
// read was for 5 bytes and we were called with 10.
363+
char input[11] = "aaaaabbbbb";
364+
BOOST_CHECK_EQUAL(con->read_some(input,10), 5);
365+
BOOST_CHECK( !con->ec );
366+
BOOST_CHECK_EQUAL( std::string(buf,10), "aaaaaxxxxx" );
367+
BOOST_CHECK_EQUAL( con->indef_read_total, 5 );
368+
369+
// A subsequent read should read 5 more because the indef read refreshes
370+
// itself. The new read will start again at the beginning of the buffer.
371+
BOOST_CHECK_EQUAL(con->read_some(input+5,5), 5);
372+
BOOST_CHECK( !con->ec );
373+
BOOST_CHECK_EQUAL( std::string(buf,10), "bbbbbxxxxx" );
374+
BOOST_CHECK_EQUAL( con->indef_read_total, 10 );
375+
}
376+
377+
BOOST_AUTO_TEST_CASE( async_read_at_least_read_all ) {
378+
stub_con::ptr con(new stub_con(true,alogger,elogger));
379+
380+
char buf[20];
381+
memset(buf,'x',20);
382+
383+
con->async_read_indef(5,buf,5);
384+
BOOST_CHECK( con->ec == make_error_code(websocketpp::error::test) );
385+
386+
char input[11] = "aaaaabbbbb";
387+
BOOST_CHECK_EQUAL(con->read_all(input,10), 10);
388+
BOOST_CHECK( !con->ec );
389+
BOOST_CHECK_EQUAL( std::string(buf,10), "bbbbbxxxxx" );
390+
BOOST_CHECK_EQUAL( con->indef_read_total, 10 );
391+
}
392+
317393
BOOST_AUTO_TEST_CASE( eof_flag ) {
318394
stub_con::ptr con(new stub_con(true,alogger,elogger));
319395
char buf[10];

Release/libs/websocketpp/websocketpp/close.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ namespace status {
204204
/**
205205
* See https://tools.ietf.org/html/rfc6455#section-7.4 for more details.
206206
*
207-
* @since 0.4.0-beta1
207+
* @since 0.3.0
208208
*
209209
* @param [in] code The code to look up.
210210
* @return A human readable interpretation of the code.

Release/libs/websocketpp/websocketpp/concurrency/none.hpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, Peter Thorson. All rights reserved.
2+
* Copyright (c) 2014, Peter Thorson. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are met:
@@ -29,26 +29,48 @@
2929
#define WEBSOCKETPP_CONCURRENCY_NONE_HPP
3030

3131
namespace websocketpp {
32+
33+
/// Concurrency handling support
3234
namespace concurrency {
3335

36+
/// Implementation for no-op locking primitives
3437
namespace none_impl {
38+
/// A fake mutex implementation that does nothing
3539
class fake_mutex {
3640
public:
3741
fake_mutex() {}
3842
~fake_mutex() {}
3943
};
4044

45+
/// A fake lock guard implementation that does nothing
4146
class fake_lock_guard {
4247
public:
4348
explicit fake_lock_guard(fake_mutex foo) {}
4449
~fake_lock_guard() {}
4550
};
4651
} // namespace none_impl
4752

48-
/// Stub Concurrency policy to remove locking in single threaded projects
53+
/// Stub concurrency policy that implements the interface using no-ops.
54+
/**
55+
* This policy documents the concurrency policy interface using no-ops. It can
56+
* be used as a reference or base for building a new concurrency policy. It can
57+
* also be used as is to disable all locking for endpoints used in purely single
58+
* threaded programs.
59+
*/
4960
class none {
5061
public:
62+
/// The type of a mutex primitive
63+
/**
64+
* std::mutex is an example.
65+
*/
5166
typedef none_impl::fake_mutex mutex_type;
67+
68+
/// The type of a scoped/RAII lock primitive.
69+
/**
70+
* The scoped lock constructor should take a mutex_type as a parameter,
71+
* acquire that lock, and release it in its destructor. std::lock_guard is
72+
* an example.
73+
*/
5274
typedef none_impl::fake_lock_guard scoped_lock_type;
5375
};
5476

Release/libs/websocketpp/websocketpp/config/core.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct core {
223223
*
224224
* The default is 32MB
225225
*
226-
* @since 0.4.0-alpha1
226+
* @since 0.3.0
227227
*/
228228
static const size_t max_message_size = 32000000;
229229

0 commit comments

Comments
 (0)