Skip to content

Commit 8c83b96

Browse files
committed
merge from tfs to codeplex (rc2)
1 parent 912b1d2 commit 8c83b96

27 files changed

+129
-44
lines changed

Release/samples/FacebookDemo/FacebookDemo/FacebookDemo.vcxproj renamed to Release/collateral/Samples/FacebookDemo/FacebookDemo/FacebookDemo.vcxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,27 @@
7373
</ImportGroup>
7474
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7575
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
76-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\x86\CppRESTWindowsSDK.props" />
76+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\x86\CppRESTWindowsSDK.props" />
7777
</ImportGroup>
7878
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7979
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
80-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\x86\CppRESTWindowsSDK.props" />
80+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\x86\CppRESTWindowsSDK.props" />
8181
</ImportGroup>
8282
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
8383
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
84-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\ARM\CppRESTWindowsSDK.props" />
84+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\ARM\CppRESTWindowsSDK.props" />
8585
</ImportGroup>
8686
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
8787
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
88-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\ARM\CppRESTWindowsSDK.props" />
88+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\ARM\CppRESTWindowsSDK.props" />
8989
</ImportGroup>
9090
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
9191
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
92-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\x64\CppRESTWindowsSDK.props" />
92+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\x64\CppRESTWindowsSDK.props" />
9393
</ImportGroup>
9494
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
9595
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
96-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\x64\CppRESTWindowsSDK.props" />
96+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\x64\CppRESTWindowsSDK.props" />
9797
</ImportGroup>
9898
<PropertyGroup Label="UserMacros" />
9999
<PropertyGroup>
@@ -186,9 +186,9 @@
186186
</ClCompile>
187187
</ItemGroup>
188188
<ItemGroup>
189-
<SDKReference Include="CppRESTWindowsSDK, Version=0.6" />
189+
<SDKReference Include="CppRESTWindowsSDK, Version=1.0" />
190190
</ItemGroup>
191191
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
192192
<ImportGroup Label="ExtensionTargets">
193193
</ImportGroup>
194-
</Project>
194+
</Project>

Release/samples/FacebookDemo/FacebookDemo110/FacebookDemo.vcxproj renamed to Release/collateral/Samples/FacebookDemo/FacebookDemo110/FacebookDemo.vcxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@
7272
</ImportGroup>
7373
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
75-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\x86\CppRESTWindowsSDK.props" />
75+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\x86\CppRESTWindowsSDK.props" />
7676
</ImportGroup>
7777
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7878
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\x86\CppRESTWindowsSDK.props" />
79+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\x86\CppRESTWindowsSDK.props" />
8080
</ImportGroup>
8181
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
8282
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
83-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\ARM\CppRESTWindowsSDK.props" />
83+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\ARM\CppRESTWindowsSDK.props" />
8484
</ImportGroup>
8585
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
8686
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
87-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\ARM\CppRESTWindowsSDK.props" />
87+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\ARM\CppRESTWindowsSDK.props" />
8888
</ImportGroup>
8989
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
9090
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
91-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Debug\x64\CppRESTWindowsSDK.props" />
91+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Debug\x64\CppRESTWindowsSDK.props" />
9292
</ImportGroup>
9393
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
9494
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
95-
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\0.6\DesignTime\Retail\x64\CppRESTWindowsSDK.props" />
95+
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\CppRESTWindowsSDK\1.0\DesignTime\Retail\x64\CppRESTWindowsSDK.props" />
9696
</ImportGroup>
9797
<PropertyGroup Label="UserMacros" />
9898
<PropertyGroup>
@@ -185,9 +185,9 @@
185185
</ClCompile>
186186
</ItemGroup>
187187
<ItemGroup>
188-
<SDKReference Include="CppRESTWindowsSDK, Version=0.6" />
188+
<SDKReference Include="CppRESTWindowsSDK, Version=1.0" />
189189
</ItemGroup>
190190
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
191191
<ImportGroup Label="ExtensionTargets">
192192
</ImportGroup>
193-
</Project>
193+
</Project>

Release/include/astreambuf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ namespace Concurrency { namespace streams
354354
/// <summary>
355355
/// Retrieves the stream buffer exception_ptr if it has been set.
356356
/// </summary>
357-
/// <returns>Pointer to the exception, if it has been set; otherwise, <c>nullptr<c> will be returned</returns>
357+
/// <returns>Pointer to the exception, if it has been set; otherwise, <c>nullptr</c> will be returned</returns>
358358
virtual std::exception_ptr exception() const = 0;
359359
};
360360

@@ -1138,7 +1138,7 @@ namespace Concurrency { namespace streams
11381138
/// <summary>
11391139
/// Retrieves the stream buffer exception_ptr if it has been set.
11401140
/// </summary>
1141-
/// <returns>Pointer to the exception, if it has been set; otherwise, <c>nullptr<c> will be returned</returns>
1141+
/// <returns>Pointer to the exception, if it has been set; otherwise, <c>nullptr</c> will be returned</returns>
11421142
virtual std::exception_ptr exception() const
11431143
{
11441144
return get_base()->exception();

Release/src/http/client/http_client.cpp

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ namespace web { namespace http
216216
auto instream = m_request.body();
217217

218218
_ASSERTE((bool)instream);
219-
_ASSERTE(instream.is_open());
220-
221219
return instream.streambuf();
222220
}
223221

@@ -226,7 +224,6 @@ namespace web { namespace http
226224
auto outstream = m_response._get_impl()->outstream();
227225

228226
_ASSERTE((bool)outstream);
229-
_ASSERTE(outstream.is_open());
230227

231228
return outstream.streambuf();
232229
}
@@ -515,13 +512,10 @@ namespace web { namespace http
515512

516513
return S_OK;
517514
}
518-
catch (const http_exception &exc)
519-
{
520-
return (HRESULT)exc.error_code().value();
521-
}
522-
catch(const std::system_error &exc)
515+
catch(...)
523516
{
524-
return (HRESULT)exc.code().value();
517+
m_request->m_exceptionPtr = std::current_exception();
518+
return (HRESULT)STG_E_CANTSAVE;
525519
}
526520
}
527521

@@ -628,7 +622,11 @@ namespace web { namespace http
628622
{
629623
IXMLHTTPRequest2 * req = m_request->m_hRequest;
630624

631-
m_request->complete_request(m_request->m_stream_bridge->total_bytes());
625+
if (m_request->m_exceptionPtr != nullptr)
626+
m_request->report_exception(m_request->m_exceptionPtr);
627+
else
628+
m_request->complete_request(m_request->m_stream_bridge->total_bytes());
629+
632630
m_request = nullptr;
633631

634632
if ( req != nullptr ) req->Release();
@@ -1428,6 +1426,19 @@ namespace web { namespace http
14281426

14291427
private:
14301428

1429+
static bool _check_streambuf(_In_ winhttp_request_context * winhttp_context, concurrency::streams::streambuf<uint8_t> rdbuf, const utility::char_t* msg)
1430+
{
1431+
if ( !rdbuf.is_open() )
1432+
{
1433+
auto eptr = rdbuf.exception();
1434+
if ( !(eptr == nullptr) )
1435+
winhttp_context->report_exception(eptr);
1436+
else
1437+
winhttp_context->report_error(msg);
1438+
}
1439+
return rdbuf.is_open();
1440+
}
1441+
14311442
void _start_request_send(_In_ winhttp_request_context * winhttp_context, size_t content_length)
14321443
{
14331444
if ( !winhttp_context->m_need_to_chunk && !winhttp_context->m_too_large )
@@ -1446,13 +1457,18 @@ namespace web { namespace http
14461457
winhttp_context->report_error(U("Error starting to send request"));
14471458
}
14481459

1449-
winhttp_context->m_readbuf_pos = 0;
14501460
return;
14511461
}
14521462

14531463
// Capure the current read position of the stream.
14541464

1455-
winhttp_context->m_readbuf_pos = winhttp_context->_get_readbuffer().seekoff(0, std::ios_base::cur, std::ios_base::in);
1465+
auto rbuf = winhttp_context->_get_readbuffer();
1466+
if ( !_check_streambuf(winhttp_context, rbuf, U("Input stream is not open")) )
1467+
{
1468+
return;
1469+
}
1470+
1471+
winhttp_context->m_readbuf_pos = rbuf.getpos(std::ios_base::in);
14561472

14571473
// If we find ourselves here, we either don't know how large the message
14581474
// body is, or it is larger than our threshold.
@@ -1479,6 +1495,10 @@ namespace web { namespace http
14791495
p_request_context->allocate_request_space(nullptr, chunk_size+http::details::chunked_encoding::additional_encoding_space);
14801496

14811497
auto rbuf = p_request_context->_get_readbuffer();
1498+
if ( !_check_streambuf(p_request_context, rbuf, U("Input stream is not open")) )
1499+
{
1500+
return;
1501+
}
14821502

14831503
rbuf.getn(&p_request_context->request_data.get()[http::details::chunked_encoding::data_offset], chunk_size).then(
14841504
[p_request_context, chunk_size](pplx::task<size_t> op)
@@ -1514,6 +1534,10 @@ namespace web { namespace http
15141534
static void _multiple_segment_write_data(_In_ winhttp_request_context * p_request_context)
15151535
{
15161536
auto rbuf = p_request_context->_get_readbuffer();
1537+
if ( !_check_streambuf(p_request_context, rbuf, U("Input stream is not open")) )
1538+
{
1539+
return;
1540+
}
15171541

15181542
msl::utilities::SafeInt<size_t> safeCount = p_request_context->m_remaining_to_write;
15191543

@@ -1567,8 +1591,7 @@ namespace web { namespace http
15671591
try { read = op.get(); } catch (...)
15681592
{
15691593
p_request_context->report_exception(std::current_exception());
1570-
read = 0;
1571-
p_request_context->m_remaining_to_write = 0;
1594+
return;
15721595
}
15731596

15741597
_ASSERTE(read != static_cast<size_t>(-1));
@@ -1626,6 +1649,10 @@ namespace web { namespace http
16261649
if (rdpos != (std::char_traits<uint8_t>::pos_type)-1)
16271650
{
16281651
auto rbuf = p_request_context->_get_readbuffer();
1652+
if ( !rbuf.is_open() )
1653+
{
1654+
can_resend = false;
1655+
}
16291656

16301657
// Try to seek back to the saved read position
16311658
if ( rbuf.seekpos(rdpos, std::ios::ios_base::in) == rdpos )
@@ -1892,6 +1919,8 @@ namespace web { namespace http
18921919
_ASSERTE(content_length > 0);
18931920

18941921
concurrency::streams::streambuf<uint8_t> writebuf = p_request_context->_get_writebuffer();
1922+
if ( !_check_streambuf(p_request_context, writebuf, U("Output stream is not open")) )
1923+
break;
18951924

18961925
p_request_context->allocate_reply_space(writebuf.alloc(content_length), content_length);
18971926

@@ -1915,6 +1944,9 @@ namespace web { namespace http
19151944
if(num_bytes > 0)
19161945
{
19171946
auto writebuf = p_request_context->_get_writebuffer();
1947+
if ( !_check_streambuf(p_request_context, writebuf, U("Output stream is not open")) )
1948+
break;
1949+
19181950
p_request_context->allocate_reply_space(writebuf.alloc(num_bytes), num_bytes);
19191951

19201952
// Read in body all at once.
@@ -1941,6 +1973,8 @@ namespace web { namespace http
19411973
if(statusInfoLength > 0)
19421974
{
19431975
auto writebuf = p_request_context->_get_writebuffer();
1976+
if ( !_check_streambuf(p_request_context, writebuf, U("Output stream is not open")) )
1977+
break;
19441978

19451979
auto after_sync =
19461980
[hRequestHandle, p_request_context]
@@ -1956,6 +1990,7 @@ namespace web { namespace http
19561990
if( !WinHttpQueryDataAvailable(hRequestHandle, nullptr))
19571991
{
19581992
p_request_context->report_error(U("Error querying for http body chunk"));
1993+
return;
19591994
}
19601995
};
19611996

@@ -1989,6 +2024,8 @@ namespace web { namespace http
19892024
}
19902025

19912026
auto wbuf = p_request_context->_get_writebuffer();
2027+
if ( !_check_streambuf(p_request_context, wbuf, U("Output stream is not open")) )
2028+
return;
19922029

19932030
wbuf.sync().then(after_sync);
19942031
});

Release/src/streams/linux/fileio_linux.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ class _filestream_callback_fill_buffer : public _filestream_callback
455455
m_func(result);
456456
delete this;
457457
}
458-
//TODO: [HH] this is a merge hack
459458
virtual void on_error(const std::exception &e)
460459
{
461460
auto exptr = std::make_exception_ptr(e);

0 commit comments

Comments
 (0)