Skip to content

Commit d438734

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into androidssl
2 parents 98c97fc + 177d94a commit d438734

33 files changed

+224
-235
lines changed

Release/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ elseif(("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR IOS)
110110
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
111111

112112
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing")
113-
set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic")
114113
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
115114
message("-- Setting gcc options")
116115

@@ -121,7 +120,6 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
121120
set(LD_FLAGS "${LD_FLAGS} -Wl,-z,defs")
122121

123122
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing")
124-
set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic")
125123
else()
126124
message("-- Unknown compiler, success is doubtful.")
127125
endif()

Release/include/cpprest/astreambuf.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ namespace concurrency = Concurrency;
5252
#endif
5353
#endif
5454

55+
#if defined(_MSC_VER)
5556
#pragma warning(push)
5657
// Suppress unreferenced formal parameter warning as they are required for documentation.
5758
#pragma warning(disable : 4100)
5859
// Suppress no-side-effect recursion warning, since it is safe and template-binding-dependent.
5960
#pragma warning(disable : 4718)
61+
#endif
6062

6163
#ifndef _MS_WINDOWS
6264
// TFS 579628 - 1206: figure out how to avoid having this specialization for Linux (beware of 64-bit Linux)
@@ -666,7 +668,7 @@ namespace streams
666668
_commit(count);
667669
m_alloced = false;
668670
}
669-
#pragma region dependencies
671+
670672
public:
671673
virtual bool can_seek() const = 0;
672674
virtual bool has_size() const = 0;
@@ -712,8 +714,6 @@ namespace streams
712714
return pplx::task_from_result();
713715
}
714716

715-
#pragma endregion
716-
717717
protected:
718718
streambuf_state_manager(std::ios_base::openmode mode)
719719
{
@@ -904,8 +904,6 @@ namespace streams
904904
return m_buffer;
905905
}
906906

907-
#pragma region Function forwarding
908-
909907
/// <summary>
910908
/// <c>can_read</c> is used to determine whether a stream buffer will support read operations (get).
911909
/// </summary>
@@ -1195,13 +1193,13 @@ namespace streams
11951193
return get_base()->exception();
11961194
}
11971195

1198-
#pragma endregion
1199-
12001196
private:
12011197
std::shared_ptr<details::basic_streambuf<_CharType>> m_buffer;
12021198

12031199
};
12041200

12051201
}}
12061202

1203+
#if defined(_MSC_VER)
12071204
#pragma warning(pop) // 4100
1205+
#endif

Release/include/cpprest/base_uri.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ namespace web {
153153
/// <returns>The decoded string.</returns>
154154
_ASYNCRTIMP static utility::string_t __cdecl decode(const utility::string_t &encoded);
155155

156-
#pragma endregion
157-
158-
#pragma region splitting
159-
160156
/// <summary>
161157
/// Splits a path into its hierarchical components.
162158
/// </summary>
@@ -171,21 +167,13 @@ namespace web {
171167
/// <returns>A <c>std::map&lt;utility::string_t, utility::string_t&gt;</c> containing the key-value components of the query.</returns>
172168
_ASYNCRTIMP static std::map<utility::string_t, utility::string_t> __cdecl split_query(const utility::string_t &query);
173169

174-
#pragma endregion
175-
176-
#pragma region validation
177-
178170
/// <summary>
179171
/// Validates a string as a uri.
180172
/// </summary>
181173
/// <param name="uri_string">The uri string to be validated.</param>
182174
/// <returns><c>true</c> if the given string represents a valid URI, <c>false</c> otherwise.</returns>
183175
_ASYNCRTIMP static bool __cdecl validate(const utility::string_t &uri_string);
184176

185-
#pragma endregion
186-
187-
#pragma region constructors
188-
189177
/// <summary>
190178
/// Creates an empty uri
191179
/// </summary>
@@ -205,10 +193,6 @@ namespace web {
205193
/// <param name="uri_string">An encoded uri string to create the URI instance.</param>
206194
_ASYNCRTIMP uri(const utility::string_t &uri_string);
207195

208-
#pragma endregion
209-
210-
#pragma region accessors
211-
212196
/// <summary>
213197
/// Get the scheme component of the URI as an encoded string.
214198
/// </summary>
@@ -263,10 +247,6 @@ namespace web {
263247
/// <returns>The new uri object with the path, query and fragment portion of this uri.</returns>
264248
_ASYNCRTIMP uri resource() const;
265249

266-
#pragma endregion
267-
268-
#pragma region diagnostics
269-
270250
/// <summary>
271251
/// An empty uri specifies no components, and serves as a default value
272252
/// </summary>
@@ -350,10 +330,6 @@ namespace web {
350330
return path().empty() || path() == _XPLATSTR("/");
351331
}
352332

353-
#pragma endregion
354-
355-
#pragma region conversion
356-
357333
/// <summary>
358334
/// Returns the full (encoded) uri as a string.
359335
/// </summary>
@@ -363,10 +339,6 @@ namespace web {
363339
return m_uri;
364340
}
365341

366-
#pragma endregion
367-
368-
#pragma region operators
369-
370342
_ASYNCRTIMP bool operator == (const uri &other) const;
371343

372344
bool operator < (const uri &other) const
@@ -379,8 +351,6 @@ namespace web {
379351
return !(this->operator == (other));
380352
}
381353

382-
#pragma endregion
383-
384354
private:
385355
friend class uri_builder;
386356

Release/include/cpprest/containerstream.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ namespace concurrency = Concurrency;
5353
#endif
5454

5555
// Suppress unreferenced formal parameter warning as they are required for documentation
56+
#if defined(_MSC_VER)
5657
#pragma warning(push)
5758
#pragma warning(disable : 4100)
59+
#endif
5860

5961
namespace Concurrency { namespace streams {
6062

@@ -648,4 +650,6 @@ namespace Concurrency { namespace streams {
648650

649651
}} // namespaces
650652

653+
#if defined(_MSC_VER)
651654
#pragma warning(pop) // 4100
655+
#endif

Release/include/cpprest/fileio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ namespace details
9090
// Input buffer
9191

9292
size_t m_buffer_size; // The intended size of the buffer to read into.
93-
SafeSize m_bufsize; // Buffer allocated size, as actually allocated.
94-
9593
char *m_buffer;
96-
size_t m_bufoff; // File position that the start of the buffer represents.
97-
size_t m_buffill; // Amount of file data actually in the buffer
94+
95+
size_t m_bufoff; // File position that the start of the buffer represents.
96+
SafeSize m_bufsize; // Buffer allocated size, as actually allocated.
97+
size_t m_buffill; // Amount of file data actually in the buffer
9898

9999
std::ios_base::openmode m_mode;
100100

Release/include/cpprest/http_client.h

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ class http_client_config
106106
, m_validate_certificates(true)
107107
#endif
108108
, m_set_user_nativehandle_options([](native_handle)->void{})
109-
#ifdef _MS_WINDOWS
110-
#if !defined(__cplusplus_winrt)
109+
#if defined(_MS_WINDOWS) && !defined(__cplusplus_winrt)
111110
, m_buffer_request(false)
112-
#endif
113111
#endif
114112
{
115113
}
@@ -319,29 +317,23 @@ class http_client_config
319317
// Whether or not to guarantee ordering, i.e. only using one underlying TCP connection.
320318
bool m_guarantee_order;
321319

322-
// IXmlHttpRequest2 doesn't allow configuration of certificate verification.
323-
#if !defined(__cplusplus_winrt)
324-
bool m_validate_certificates;
325-
#endif
320+
utility::seconds m_timeout;
321+
size_t m_chunksize;
326322

327-
#ifdef _MS_WINDOWS
328323
#if !defined(__cplusplus_winrt)
329-
bool m_buffer_request;
330-
#endif
324+
// IXmlHttpRequest2 doesn't allow configuration of certificate verification.
325+
bool m_validate_certificates;
331326
#endif
332327

333328
std::function<void(native_handle)> m_set_user_nativehandle_options;
334329

335-
utility::seconds m_timeout;
336-
size_t m_chunksize;
337-
338-
#ifdef _MS_WINDOWS
339-
#ifdef __cplusplus_winrt
330+
#if defined(_MS_WINDOWS) && defined(__cplusplus_winrt)
340331
friend class details::winrt_client;
341-
#else
332+
#elif defined(_MS_WINDOWS)
333+
bool m_buffer_request;
334+
342335
friend class details::winhttp_client;
343-
#endif // __cplusplus_winrt
344-
#endif // _MS_WINDOWS
336+
#endif // defined(_MS_WINDOWS) && defined(__cplusplus_winrt)
345337

346338
/// <summary>
347339
/// Invokes a user callback to allow for customization of the requst

Release/include/cpprest/http_client_impl.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ namespace web { namespace http { namespace client { namespace details
6565

6666
#ifdef _MS_WINDOWS
6767
static const utility::char_t * get_with_body = _XPLATSTR("A GET or HEAD request should not have an entity body.");
68-
#endif
6968

7069
// Helper function to trim leading and trailing null characters from a string.
7170
static void trim_nulls(utility::string_t &str)
@@ -77,6 +76,8 @@ static void trim_nulls(utility::string_t &str)
7776
str.erase(index);
7877
}
7978

79+
#endif
80+
8081
// Flatten the http_headers into a name:value pairs separated by a carriage return and line feed.
8182
static utility::string_t flatten_http_headers(const http_headers &headers)
8283
{
@@ -200,21 +201,21 @@ class request_context
200201
return outstream.streambuf();
201202
}
202203

204+
// Reference to the http_client implementation.
205+
std::shared_ptr<_http_client_communicator> m_http_client;
206+
203207
// request/response pair.
204208
http_request m_request;
205209
http_response m_response;
206210

211+
std::exception_ptr m_exceptionPtr;
212+
207213
size64_t m_uploaded;
208214
size64_t m_downloaded;
209215

210-
std::exception_ptr m_exceptionPtr;
211-
212216
// task completion event to signal request is completed.
213217
pplx::task_completion_event<http_response> m_request_completion;
214218

215-
// Reference to the http_client implementation.
216-
std::shared_ptr<_http_client_communicator> m_http_client;
217-
218219
// Registration for cancellation notification if enabled.
219220
pplx::cancellation_token_registration m_cancellationRegistration;
220221

Release/include/cpprest/http_msg.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class http_exception : public std::exception
198198
}
199199

200200
private:
201-
std::string m_msg;
202201
std::error_code m_errorCode;
202+
std::string m_msg;
203203
};
204204

205205
namespace details
@@ -299,12 +299,11 @@ class http_msg_base
299299
/// </summary>
300300
concurrency::streams::ostream m_outStream;
301301

302+
http_headers m_headers;
302303
bool m_default_outstream;
303304

304305
/// <summary> The TCE is used to signal the availability of the message body. </summary>
305306
pplx::task_completion_event<utility::size64_t> m_data_available;
306-
307-
http_headers m_headers;
308307
};
309308

310309
/// <summary>
@@ -353,8 +352,6 @@ class _http_response : public http::details::http_msg_base
353352
} // namespace details
354353

355354

356-
#pragma region HTTP response message
357-
358355
/// <summary>
359356
/// Represents an HTTP response.
360357
/// </summary>
@@ -608,8 +605,6 @@ class http_response
608605
std::shared_ptr<http::details::_http_response> _m_impl;
609606
};
610607

611-
#pragma endregion
612-
613608
namespace details {
614609
/// <summary>
615610
/// Internal representation of an HTTP request message.
@@ -681,17 +676,18 @@ class _http_request : public http::details::http_msg_base, public std::enable_sh
681676
// Actual initiates sending the response, without checking if a response has already been sent.
682677
pplx::task<void> _reply_impl(http_response response);
683678

679+
http::method m_method;
680+
684681
// Tracks whether or not a response has already been started for this message.
685682
pplx::details::atomic_long m_initiated_response;
686683

687-
pplx::cancellation_token m_cancellationToken;
684+
std::unique_ptr<http::details::_http_server_context> m_server_context;
688685

689-
http::method m_method;
686+
pplx::cancellation_token m_cancellationToken;
690687

691688
http::uri m_base_uri;
692689
http::uri m_uri;
693690
utility::string_t m_listener_path;
694-
std::unique_ptr<http::details::_http_server_context> m_server_context;
695691

696692
concurrency::streams::ostream m_response_stream;
697693

@@ -703,8 +699,6 @@ class _http_request : public http::details::http_msg_base, public std::enable_sh
703699

704700
} // namespace details
705701

706-
#pragma region HTTP Request
707-
708702
/// <summary>
709703
/// Represents an HTTP request.
710704
/// </summary>
@@ -1162,8 +1156,6 @@ class http_request
11621156
std::shared_ptr<http::details::_http_request> _m_impl;
11631157
};
11641158

1165-
#pragma endregion
1166-
11671159
/// <summary>
11681160
/// HTTP client handler class, used to represent an HTTP pipeline stage.
11691161
/// </summary>

Release/include/cpprest/interopstream.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3030
#include <ppltasks.h>
3131
namespace pplx = Concurrency;
32-
#else
32+
#else // defined(_MSC_VER) && (_MSC_VER >= 1800)
3333
#include "pplx/pplxtasks.h"
34-
#endif
34+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1800)
3535

3636
#include "cpprest/astreambuf.h"
3737
#include "cpprest/streams.h"
@@ -43,8 +43,8 @@ namespace pplx = Concurrency;
4343
// is capitalized for historical reasons. The alias let's us pretend that style issue doesn't exist.
4444
namespace Concurrency { }
4545
namespace concurrency = Concurrency;
46-
#endif
47-
#endif
46+
#endif // _LWRCASE_CNCRRNCY
47+
#endif // _CONCRT_H
4848

4949
#pragma warning(push)
5050
// Suppress unreferenced formal parameter warning as they are required for documentation

0 commit comments

Comments
 (0)