Skip to content

Commit 8478cee

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into jsonlocale
Conflicts: Release/src/json/json_parsing.cpp Release/src/json/json_serialization.cpp Release/src/utilities/asyncrt_utils.cpp
2 parents bb2bc87 + 423be5f commit 8478cee

Some content is hidden

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

45 files changed

+892
-359
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: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class status_codes
101101
#undef DAT
102102
};
103103

104+
/// Message direction
104105
namespace message_direction
105106
{
106107
/// <summary>
@@ -198,8 +199,8 @@ class http_exception : public std::exception
198199
}
199200

200201
private:
201-
std::string m_msg;
202202
std::error_code m_errorCode;
203+
std::string m_msg;
203204
};
204205

205206
namespace details
@@ -299,12 +300,11 @@ class http_msg_base
299300
/// </summary>
300301
concurrency::streams::ostream m_outStream;
301302

303+
http_headers m_headers;
302304
bool m_default_outstream;
303305

304306
/// <summary> The TCE is used to signal the availability of the message body. </summary>
305307
pplx::task_completion_event<utility::size64_t> m_data_available;
306-
307-
http_headers m_headers;
308308
};
309309

310310
/// <summary>
@@ -353,8 +353,6 @@ class _http_response : public http::details::http_msg_base
353353
} // namespace details
354354

355355

356-
#pragma region HTTP response message
357-
358356
/// <summary>
359357
/// Represents an HTTP response.
360358
/// </summary>
@@ -608,8 +606,6 @@ class http_response
608606
std::shared_ptr<http::details::_http_response> _m_impl;
609607
};
610608

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

680+
http::method m_method;
681+
684682
// Tracks whether or not a response has already been started for this message.
685683
pplx::details::atomic_long m_initiated_response;
686684

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

689-
http::method m_method;
687+
pplx::cancellation_token m_cancellationToken;
690688

691689
http::uri m_base_uri;
692690
http::uri m_uri;
693691
utility::string_t m_listener_path;
694-
std::unique_ptr<http::details::_http_server_context> m_server_context;
695692

696693
concurrency::streams::ostream m_response_stream;
697694

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

704701
} // namespace details
705702

706-
#pragma region HTTP Request
707-
708703
/// <summary>
709704
/// Represents an HTTP request.
710705
/// </summary>
@@ -1162,8 +1157,6 @@ class http_request
11621157
std::shared_ptr<http::details::_http_request> _m_impl;
11631158
};
11641159

1165-
#pragma endregion
1166-
11671160
/// <summary>
11681161
/// HTTP client handler class, used to represent an HTTP pipeline stage.
11691162
/// </summary>

0 commit comments

Comments
 (0)