Skip to content

Commit bde3871

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into http_misc
Conflicts: Release/include/cpprest/http_msg.h
2 parents 0f1684c + 132c739 commit bde3871

File tree

546 files changed

+11098
-633
lines changed

Some content is hidden

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

546 files changed

+11098
-633
lines changed

Build/Common.Build.settings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<TargetsPath>$(BuildRoot)\Build</TargetsPath>
3939
<OsVersion>$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentVersion)</OsVersion>
4040
<!--If Dev11 and Dev12 are both installed, the default is to build Dev12. This can be overridden by setting the DevToolsVersion variable in powershell-->
41+
<DevToolsVersion Condition="'$(DevToolsVersion)' == '' And '$(VS140COMNTOOLS)' != ''">140</DevToolsVersion>
4142
<DevToolsVersion Condition="'$(DevToolsVersion)' == '' And '$(VS120COMNTOOLS)' != ''">120</DevToolsVersion>
4243
<DevToolsVersion Condition="'$(DevToolsVersion)' == '' And '$(VS110COMNTOOLS)' != ''">110</DevToolsVersion>
4344
<!-- ARM tools are installed in $(FrameworkSdkDir)\DesignTime\CommonConfiguration\Neutral\Windows.desktop.arm.props -->

Release/include/cpprest/asyncrt_utils.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@
3030
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3131
#include <ppltasks.h>
3232
namespace pplx = Concurrency;
33-
#else
33+
#else
3434
#include "pplx/pplxtasks.h"
3535
#endif
3636

@@ -250,11 +250,11 @@ namespace details
250250
class windows_category_impl : public std::error_category
251251
{
252252
public:
253-
virtual const char *name() const { return "windows"; }
253+
virtual const char *name() const _noexcept { return "windows"; }
254254

255-
_ASYNCRTIMP virtual std::string message(int errorCode) const;
255+
_ASYNCRTIMP virtual std::string message(int errorCode) const _noexcept;
256256

257-
_ASYNCRTIMP virtual std::error_condition default_error_condition(int errorCode) const;
257+
_ASYNCRTIMP virtual std::error_condition default_error_condition(int errorCode) const _noexcept;
258258
};
259259

260260
/// <summary>

Release/include/cpprest/fileio.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,28 @@
3434
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3535
#include <ppltasks.h>
3636
namespace pplx = Concurrency;
37-
#else
37+
#if (_MSC_VER >= 1900)
38+
#include <concrt.h>
39+
#ifndef DEV14_EXTENSIBILITY_WRKRND
40+
#define DEV14_EXTENSIBILITY_WRKRND
41+
namespace Concurrency {
42+
namespace extensibility {
43+
typedef ::std::condition_variable condition_variable_t;
44+
typedef ::std::mutex critical_section_t;
45+
typedef ::std::unique_lock< ::std::mutex> scoped_critical_section_t;
46+
47+
typedef ::Concurrency::event event_t;
48+
typedef ::Concurrency::reader_writer_lock reader_writer_lock_t;
49+
typedef ::Concurrency::reader_writer_lock::scoped_lock scoped_rw_lock_t;
50+
typedef ::Concurrency::reader_writer_lock::scoped_lock_read scoped_read_lock_t;
51+
52+
typedef ::Concurrency::details::_ReentrantBlockingLock recursive_lock_t;
53+
typedef recursive_lock_t::_Scoped_lock scoped_recursive_lock_t;
54+
}
55+
}
56+
#endif // DEV14_EXTENSIBILITY_WRKRND
57+
#endif // _MSC_VER >= 1900
58+
#else // _MSC_VER
3859
#include "pplx/pplxtasks.h"
3960
#endif
4061

Release/include/cpprest/http_msg.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@
3535
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3636
#include <ppltasks.h>
3737
namespace pplx = Concurrency;
38+
#if (_MSC_VER >= 1900)
39+
#include <concrt.h>
40+
#ifndef DEV14_EXTENSIBILITY_WRKRND
41+
#define DEV14_EXTENSIBILITY_WRKRND
42+
namespace pplx = Concurrency;
43+
namespace Concurrency {
44+
namespace extensibility {
45+
typedef ::Concurrency::event event_t;
46+
typedef ::Concurrency::reader_writer_lock reader_writer_lock_t;
47+
typedef ::Concurrency::reader_writer_lock::scoped_lock scoped_rw_lock_t;
48+
typedef ::Concurrency::reader_writer_lock::scoped_lock_read scoped_read_lock_t;
49+
50+
typedef ::Concurrency::details::_ReentrantBlockingLock recursive_lock_t;
51+
typedef recursive_lock_t::_Scoped_lock scoped_recursive_lock_t;
52+
}
53+
}
54+
#endif // DEV14_EXTENSIBILITY_WRKRND
55+
#endif // _MSC_VER >= 1900
3856
#else
3957
#include "pplx/pplxtasks.h"
4058
#endif

Release/include/cpprest/streams.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ namespace Concurrency { namespace streams
492492
static pplx::task<void> _skip_whitespace(streams::streambuf<CharType> buffer);
493493

494494
// Aid in parsing input: peek at a character at a time, call type-specific code to examine, extract value when done.
495-
template<typename _ParseState, typename _ReturnType>
496-
static pplx::task<_ReturnType> _parse_input(streams::streambuf<CharType> buffer,
497-
std::function<bool(std::shared_ptr<_ParseState>, int_type)> accept_character,
498-
std::function<pplx::task<_ReturnType>(std::shared_ptr<_ParseState>)> extract);
495+
// <remark>AcceptFunctor should model std::function<bool(std::shared_ptr<X>, int_type)></remark>
496+
// <remark>ExtractFunctor should model std::function<pplx::task<ReturnType>(std::shared_ptr<X>)></remark>
497+
template<typename StateType, typename ReturnType, typename AcceptFunctor, typename ExtractFunctor>
498+
static pplx::task<ReturnType> _parse_input(streams::streambuf<CharType> buffer, AcceptFunctor accept_character, ExtractFunctor extract);
499499
};
500500

501501
/// <summary>
@@ -1176,13 +1176,13 @@ pplx::task<void> concurrency::streams::_type_parser_base<CharType>::_skip_whites
11761176
}
11771177

11781178
template<typename CharType>
1179-
template<typename _ParseState, typename _ReturnType>
1180-
pplx::task<_ReturnType> concurrency::streams::_type_parser_base<CharType>::_parse_input(
1179+
template<typename StateType, typename ReturnType, typename AcceptFunctor, typename ExtractFunctor>
1180+
pplx::task<ReturnType> concurrency::streams::_type_parser_base<CharType>::_parse_input(
11811181
concurrency::streams::streambuf<CharType> buffer,
1182-
std::function<bool(std::shared_ptr<_ParseState>, int_type)> accept_character,
1183-
std::function<pplx::task<_ReturnType>(std::shared_ptr<_ParseState>)> extract)
1182+
AcceptFunctor accept_character,
1183+
ExtractFunctor extract)
11841184
{
1185-
std::shared_ptr<_ParseState> state = std::make_shared<_ParseState>();
1185+
std::shared_ptr<StateType> state = std::make_shared<StateType>();
11861186

11871187
auto update_end = [=] (pplx::task<int_type> op) -> bool { op.wait(); return true; };
11881188

@@ -1219,14 +1219,14 @@ pplx::task<_ReturnType> concurrency::streams::_type_parser_base<CharType>::_pars
12191219
};
12201220

12211221
auto finish =
1222-
[=](pplx::task<bool> op) -> pplx::task<_ReturnType>
1222+
[=](pplx::task<bool> op) -> pplx::task<ReturnType>
12231223
{
12241224
op.wait();
1225-
pplx::task<_ReturnType> result = extract(state);
1225+
pplx::task<ReturnType> result = extract(state);
12261226
return result;
12271227
};
12281228

1229-
return _skip_whitespace(buffer).then([=](pplx::task<void> op) -> pplx::task<_ReturnType>
1229+
return _skip_whitespace(buffer).then([=](pplx::task<void> op) -> pplx::task<ReturnType>
12301230
{
12311231
op.wait();
12321232

Release/include/cpprest/x509_cert_utilities.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
@@ -18,7 +18,7 @@
1818
*
1919
* x509_cert_utilities.h
2020
*
21-
* Contains utility functions for helping to verify server certificates in OS X/iOS.
21+
* Contains utility functions for helping to verify server certificates in OS X/iOS and Android.
2222
*
2323
* For the latest on this and related APIs, please see http://casablanca.codeplex.com.
2424
*
@@ -30,8 +30,23 @@
3030
#include <vector>
3131
#include <string>
3232

33+
#if defined(__APPLE__) || defined(ANDROID)
34+
35+
#include <boost/asio/ssl.hpp>
36+
3337
namespace web { namespace http { namespace client { namespace details {
3438

39+
/// <summary>
40+
/// Using platform specific APIs verifies server certificate.
41+
/// Currently implemented to work on iOS, Android, and OS X.
42+
/// </summary>
43+
/// <param name="verifyCtx">Boost.ASIO context get certificate chain from.</param>
44+
/// <param name="hostName">Host name from the URI.</param>
45+
/// <returns>True if verification passed and server can be trusted, false otherwise.</returns>
46+
bool verify_cert_chain_platform_specific(boost::asio::ssl::verify_context &verifyCtx, const std::string &hostName);
47+
3548
bool verify_X509_cert_chain(const std::vector<std::string> &certChain, const std::string &hostName);
3649

3750
}}}}
51+
52+
#endif

Release/include/pplx/ioscheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class io_scheduler
149149
/// <summary>
150150
/// Get the I/O completion key to use with the scheduler.
151151
/// </summary>
152-
DWORD get_key() const { return (((DWORD)this) & 0xFAFAFA00) + sizeof(EXTENDED_OVERLAPPED); }
152+
DWORD get_key() const { return (static_cast<DWORD>((uintptr_t)this) & 0xFAFAFA00) + sizeof(EXTENDED_OVERLAPPED); }
153153

154154
/// <summary>
155155
/// Get the I/O scheduler instance.

Release/samples/BingRequest/BingRequest110.xp/BingRequest110.xp.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<ClCompile Include="..\bingrequest.cpp" />
126126
</ItemGroup>
127127
<ItemGroup>
128-
<ProjectReference Include="$(CasablancaSrcDir)\build\casablanca110.xp.vcxproj">
128+
<ProjectReference Include="$(CasablancaSrcDir)\build\vs11.xp\casablanca110.xp.vcxproj">
129129
<Project>{4D9ED383-673B-4E48-A6AF-6BD9F108150E}</Project>
130130
</ProjectReference>
131131
</ItemGroup>

Release/samples/BingRequest/BingRequest110/BingRequest110.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
</Link>
186186
</ItemDefinitionGroup>
187187
<ItemGroup>
188-
<ProjectReference Include="$(CasablancaSrcDir)\build\casablanca110.vcxproj">
188+
<ProjectReference Include="$(CasablancaSrcDir)\build\vs11\casablanca110.vcxproj">
189189
<Project>{90D85FF4-F0AE-4816-923F-0EF2758F30AB}</Project>
190190
</ProjectReference>
191191
</ItemGroup>

Release/samples/BingRequest/BingRequest120.xp/BingRequest120.xp.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<ClCompile Include="..\bingrequest.cpp" />
126126
</ItemGroup>
127127
<ItemGroup>
128-
<ProjectReference Include="$(CasablancaSrcDir)\build\casablanca120.xp.vcxproj">
128+
<ProjectReference Include="$(CasablancaSrcDir)\build\vs12.xp\casablanca120.xp.vcxproj">
129129
<Project>{15f3b200-1aed-4b57-af37-b21cd67914b1}</Project>
130130
</ProjectReference>
131131
</ItemGroup>

0 commit comments

Comments
 (0)