Skip to content

Commit 09a6a6b

Browse files
committed
bring the latest TFS changes to git
1 parent b8b382f commit 09a6a6b

File tree

12 files changed

+147
-127
lines changed

12 files changed

+147
-127
lines changed

Release/casablanca110.sln

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "casablanca110.winrt", "src\
2929
EndProject
3030
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HttpListener110_test", "tests\Functional\http\listener\VS11\HttpListener110_test.vcxproj", "{2853EC0B-1B8E-4D9D-8436-4EF6DDED5378}"
3131
EndProject
32+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utils110_test.xp", "tests\Functional\utils\VS11.xp\utils110_test.xp.vcxproj", "{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}"
33+
EndProject
34+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utils110_test", "tests\Functional\utils\VS11\utils110_test.vcxproj", "{77BD8C21-0E78-46AD-8420-09F36FC192AA}"
35+
EndProject
3236
Global
3337
GlobalSection(TeamFoundationVersionControl) = preSolution
34-
SccNumberOfProjects = 14
38+
SccNumberOfProjects = 16
3539
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
3640
SccTeamFoundationServer = http://tkbgitvstfat01:8080/devdiv2
3741
SccProjectUniqueName0 = src\\build\\casablanca110.vcxproj
@@ -104,6 +108,16 @@ Global
104108
SccAuxPath13 = http://tkbgitvstfat01:8080/devdiv2
105109
SccLocalPath13 = tests\\Functional\\http\\listener\\VS11
106110
SccProvider13 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
111+
SccProjectUniqueName14 = tests\\Functional\\utils\\VS11.xp\\utils110_test.xp.vcxproj
112+
SccProjectName14 = tests/Functional/utils/VS11.xp
113+
SccAuxPath14 = http://tkbgitvstfat01:8080/devdiv2
114+
SccLocalPath14 = tests\\Functional\\utils\\VS11.xp
115+
SccProvider14 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
116+
SccProjectUniqueName15 = tests\\Functional\\utils\\VS11\\utils110_test.vcxproj
117+
SccProjectName15 = tests/Functional/utils/VS11
118+
SccAuxPath15 = http://tkbgitvstfat01:8080/devdiv2
119+
SccLocalPath15 = tests\\Functional\\utils\\VS11
120+
SccProvider15 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
107121
EndGlobalSection
108122
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109123
Debug|ARM = Debug|ARM
@@ -280,6 +294,30 @@ Global
280294
{2853EC0B-1B8E-4D9D-8436-4EF6DDED5378}.Release|Win32.Build.0 = Release|Win32
281295
{2853EC0B-1B8E-4D9D-8436-4EF6DDED5378}.Release|x64.ActiveCfg = Release|x64
282296
{2853EC0B-1B8E-4D9D-8436-4EF6DDED5378}.Release|x64.Build.0 = Release|x64
297+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|ARM.ActiveCfg = Debug|ARM
298+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|ARM.Build.0 = Debug|ARM
299+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|Win32.ActiveCfg = Debug|Win32
300+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|Win32.Build.0 = Debug|Win32
301+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|x64.ActiveCfg = Debug|x64
302+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Debug|x64.Build.0 = Debug|x64
303+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|ARM.ActiveCfg = Release|ARM
304+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|ARM.Build.0 = Release|ARM
305+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|Win32.ActiveCfg = Release|Win32
306+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|Win32.Build.0 = Release|Win32
307+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|x64.ActiveCfg = Release|x64
308+
{0A9F1C3A-A8F4-417B-AD25-DF0E2CE9B299}.Release|x64.Build.0 = Release|x64
309+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|ARM.ActiveCfg = Debug|ARM
310+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|ARM.Build.0 = Debug|ARM
311+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|Win32.ActiveCfg = Debug|Win32
312+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|Win32.Build.0 = Debug|Win32
313+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|x64.ActiveCfg = Debug|x64
314+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Debug|x64.Build.0 = Debug|x64
315+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|ARM.ActiveCfg = Release|ARM
316+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|ARM.Build.0 = Release|ARM
317+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|Win32.ActiveCfg = Release|Win32
318+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|Win32.Build.0 = Release|Win32
319+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|x64.ActiveCfg = Release|x64
320+
{77BD8C21-0E78-46AD-8420-09F36FC192AA}.Release|x64.Build.0 = Release|x64
283321
EndGlobalSection
284322
GlobalSection(SolutionProperties) = preSolution
285323
HideSolutionNode = FALSE

Release/casablanca120.sln

Lines changed: 29 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.20625.1 MAIN
4+
VisualStudioVersion = 12.0.20930.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "casablanca120", "src\build\casablanca120.vcxproj", "{1014C621-BC2D-4813-B8C1-6D83AD6F9249}"
77
EndProject
@@ -29,82 +29,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Uri120_test", "tests\Functi
2929
EndProject
3030
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utils120_test", "tests\Functional\utils\VS12\Utils120_test.vcxproj", "{50386698-0180-4EBC-8827-F2C36561F6B4}"
3131
EndProject
32+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "casablanca120.winrt", "src\build\casablanca120.winrt.vcxproj", "{9AD285A2-301E-47A0-A299-14AD5D4F2758}"
33+
EndProject
34+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "streams120_test.winrt", "tests\Functional\streams\vs12.winrt\streams120_test.winrt.vcxproj", "{337E0660-2300-4DC6-883E-283D5A7281B5}"
35+
EndProject
3236
Global
33-
GlobalSection(TeamFoundationVersionControl) = preSolution
34-
SccNumberOfProjects = 14
35-
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
36-
SccTeamFoundationServer = http://tkbgitvstfat01:8080/devdiv2
37-
SccProjectUniqueName0 = src\\build\\casablanca120.vcxproj
38-
SccProjectName0 = src/build
39-
SccAuxPath0 = http://tkbgitvstfat01:8080/devdiv2
40-
SccLocalPath0 = src\\build
41-
SccProvider0 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
42-
SccProjectUniqueName1 = tests\\Common\\TestRunner\\VS11\\TestRunner120.vcxproj
43-
SccProjectName1 = tests/Common/TestRunner/VS11
44-
SccAuxPath1 = http://tkbgitvstfat01:8080/devdiv2
45-
SccLocalPath1 = tests\\Common\\TestRunner\\VS11
46-
SccProvider1 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
47-
SccProjectUniqueName2 = tests\\Common\\UnitTestpp\\VS11\\TestUnitTestpp120.vcxproj
48-
SccProjectName2 = tests/Common/UnitTestpp/VS11
49-
SccAuxPath2 = http://tkbgitvstfat01:8080/devdiv2
50-
SccLocalPath2 = tests\\Common\\UnitTestpp\\VS11
51-
SccProvider2 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
52-
SccProjectUniqueName3 = tests\\Common\\UnitTestpp\\VS11\\UnitTestpp120.vcxproj
53-
SccProjectName3 = tests/Common/UnitTestpp/VS11
54-
SccAuxPath3 = http://tkbgitvstfat01:8080/devdiv2
55-
SccLocalPath3 = tests\\Common\\UnitTestpp\\VS11
56-
SccProvider3 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
57-
SccProjectUniqueName4 = tests\\Common\\utilities\\VS11\\CommonUtilities120.vcxproj
58-
SccProjectName4 = tests/Common/utilities/VS11
59-
SccAuxPath4 = http://tkbgitvstfat01:8080/devdiv2
60-
SccLocalPath4 = tests\\Common\\utilities\\VS11
61-
SccProvider4 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
62-
SccProjectUniqueName5 = tests\\Functional\\http\\client\\VS11\\HttpClient110_test.vcxproj
63-
SccProjectName5 = tests/Functional/http/client/VS11
64-
SccAuxPath5 = http://tkbgitvstfat01:8080/devdiv2
65-
SccLocalPath5 = tests\\Functional\\http\\client\\VS11
66-
SccProvider5 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
67-
SccProjectUniqueName6 = tests\\Functional\\http\\utilities\\VS11\\HttpTestUtilities120.vcxproj
68-
SccProjectName6 = tests/Functional/http/utilities/VS11
69-
SccAuxPath6 = http://tkbgitvstfat01:8080/devdiv2
70-
SccLocalPath6 = tests\\Functional\\http\\utilities\\VS11
71-
SccProvider6 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
72-
SccProjectUniqueName7 = tests\\Functional\\json\\VS11\\JSON110_test.vcxproj
73-
SccProjectName7 = tests/Functional/json/VS11
74-
SccAuxPath7 = http://tkbgitvstfat01:8080/devdiv2
75-
SccLocalPath7 = tests\\Functional\\json\\VS11
76-
SccProvider7 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
77-
SccProjectUniqueName8 = tests\\Functional\\misc\\atl_headers\\VS11\\header_test120.vcxproj
78-
SccProjectName8 = tests/Functional/misc/atl_headers/VS11
79-
SccAuxPath8 = http://tkbgitvstfat01:8080/devdiv2
80-
SccLocalPath8 = tests\\Functional\\misc\\atl_headers\\VS11
81-
SccProvider8 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
82-
SccProjectUniqueName9 = tests\\Functional\\pplx\\pplx_test\\VS11\\pplx110_test.vcxproj
83-
SccProjectName9 = tests/Functional/pplx/pplx_test/VS11
84-
SccAuxPath9 = http://tkbgitvstfat01:8080/devdiv2
85-
SccLocalPath9 = tests\\Functional\\pplx\\pplx_test\\VS11
86-
SccProvider9 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
87-
SccProjectUniqueName10 = tests\\Functional\\streams\\VS11\\streams110_test.vcxproj
88-
SccProjectName10 = tests/Functional/streams/VS11
89-
SccAuxPath10 = http://tkbgitvstfat01:8080/devdiv2
90-
SccLocalPath10 = tests\\Functional\\streams\\VS11
91-
SccProvider10 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
92-
SccProjectUniqueName11 = tests\\Functional\\uri\\VS11\\Uri110_test.vcxproj
93-
SccProjectName11 = tests/Functional/uri/VS11
94-
SccAuxPath11 = http://tkbgitvstfat01:8080/devdiv2
95-
SccLocalPath11 = tests\\Functional\\uri\\VS11
96-
SccProvider11 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
97-
SccProjectUniqueName12 = src\\build\\casablanca110.winrt.vcxproj
98-
SccProjectName12 = src/build
99-
SccAuxPath12 = http://tkbgitvstfat01:8080/devdiv2
100-
SccLocalPath12 = src\\build
101-
SccProvider12 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
102-
SccProjectUniqueName13 = tests\\Functional\\http\\listener\\VS11\\HttpListener110_test.vcxproj
103-
SccProjectName13 = tests/Functional/http/listener/VS11
104-
SccAuxPath13 = http://tkbgitvstfat01:8080/devdiv2
105-
SccLocalPath13 = tests\\Functional\\http\\listener\\VS11
106-
SccProvider13 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
107-
EndGlobalSection
10837
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10938
Debug|ARM = Debug|ARM
11039
Debug|Win32 = Debug|Win32
@@ -268,6 +197,30 @@ Global
268197
{50386698-0180-4EBC-8827-F2C36561F6B4}.Release|Win32.Build.0 = Release|Win32
269198
{50386698-0180-4EBC-8827-F2C36561F6B4}.Release|x64.ActiveCfg = Release|x64
270199
{50386698-0180-4EBC-8827-F2C36561F6B4}.Release|x64.Build.0 = Release|x64
200+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|ARM.ActiveCfg = Debug|ARM
201+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|ARM.Build.0 = Debug|ARM
202+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|Win32.ActiveCfg = Debug|Win32
203+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|Win32.Build.0 = Debug|Win32
204+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|x64.ActiveCfg = Debug|x64
205+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Debug|x64.Build.0 = Debug|x64
206+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|ARM.ActiveCfg = Release|ARM
207+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|ARM.Build.0 = Release|ARM
208+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|Win32.ActiveCfg = Release|Win32
209+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|Win32.Build.0 = Release|Win32
210+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|x64.ActiveCfg = Release|x64
211+
{9AD285A2-301E-47A0-A299-14AD5D4F2758}.Release|x64.Build.0 = Release|x64
212+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|ARM.ActiveCfg = Debug|ARM
213+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|ARM.Build.0 = Debug|ARM
214+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|Win32.ActiveCfg = Debug|Win32
215+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|Win32.Build.0 = Debug|Win32
216+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|x64.ActiveCfg = Debug|x64
217+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Debug|x64.Build.0 = Debug|x64
218+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|ARM.ActiveCfg = Release|ARM
219+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|ARM.Build.0 = Release|ARM
220+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|Win32.ActiveCfg = Release|Win32
221+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|Win32.Build.0 = Release|Win32
222+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|x64.ActiveCfg = Release|x64
223+
{337E0660-2300-4DC6-883E-283D5A7281B5}.Release|x64.Build.0 = Release|x64
271224
EndGlobalSection
272225
GlobalSection(SolutionProperties) = preSolution
273226
HideSolutionNode = FALSE

Release/include/cpprest/http_client_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ namespace web { namespace http { namespace client { namespace details
345345
unsigned long open_if_required()
346346
{
347347
unsigned long error = S_OK;
348-
348+
349349
if( !m_opened )
350350
{
351351
pplx::extensibility::scoped_critical_section_t l(m_open_lock);

Release/setup/Casablanca.natvis

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,34 +100,34 @@
100100
<DisplayString Condition="(m_kind==web::json::value::String) &amp;&amp; (((&amp;((*((web::json::details::_String*)(m_value._Myptr))).m_string))))->_Myptr==0x00000000">
101101
{*((((&amp;((*((web::json::details::_String*)(m_value._Myptr))).m_wstring)))))->_Myptr}
102102
</DisplayString>
103-
104103
<DisplayString Condition="(m_kind==web::json::value::String) &amp;&amp; (((&amp;((*((web::json::details::_String*)(m_value._Myptr))).m_wstring))))->_Myptr==0x00000000">
105104
{*((((&amp;((*((web::json::details::_String*)(m_value._Myptr))).m_string)))))->_Myptr}
106105
</DisplayString>
107-
106+
107+
<DisplayString Condition="m_kind==web::json::value::Null">null</DisplayString>
108+
109+
<DisplayString Condition="m_kind==0xcccccccc">not initialized</DisplayString>
110+
108111
<DisplayString Condition="m_kind==web::json::value::Object">
109-
object {(*((web::json::details::_Value*)(m_value._Myptr))).m_elements}
112+
object {(*((web::json::details::_Object*)(m_value._Myptr))).m_elements}
110113
</DisplayString>
111114

112115
<DisplayString Condition="m_kind==web::json::value::Array">
113-
array {(*((web::json::details::_Value*)(m_value._Myptr))).m_elements}
116+
array {(*((web::json::details::_Array*)(m_value._Myptr))).m_elements}
114117
</DisplayString>
115118

116-
<DisplayString Condition="m_kind==web::json::value::Null">null</DisplayString>
117-
118-
<DisplayString Condition="m_kind==0xcccccccc">not initialized</DisplayString>
119119
<Expand>
120120
<ArrayItems Condition="m_kind==web::json::value::Object">
121-
<Size>(*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Mylast - (*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Myfirst</Size>
122-
<ValuePointer>(*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Myfirst</ValuePointer>
121+
<Size>(*((web::json::details::_Object*)((m_value)._Myptr))).m_elements._Mylast - (*((web::json::details::_Object*)((m_value)._Myptr))).m_elements._Myfirst</Size>
122+
<ValuePointer>(*((web::json::details::_Object*)((m_value)._Myptr))).m_elements._Myfirst</ValuePointer>
123123
</ArrayItems>
124124

125125
<ArrayItems Condition="m_kind==web::json::value::Array">
126-
<Size>(*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Mylast - (*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Myfirst</Size>
127-
<ValuePointer>(*((web::json::details::_Value*)((m_value)._Myptr))).m_elements._Myfirst</ValuePointer>
126+
<Size>(*((web::json::details::_Array*)((m_value)._Myptr))).m_elements._Mylast - (*((web::json::details::_Array*)((m_value)._Myptr))).m_elements._Myfirst</Size>
127+
<ValuePointer>(*((web::json::details::_Array*)((m_value)._Myptr))).m_elements._Myfirst</ValuePointer>
128128
</ArrayItems>
129-
130129
</Expand>
130+
131131
</Type>
132132

133133
</AutoVisualizer>

Release/src/http/client/http_win8.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace web { namespace http
5353
: public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<ClassicCom>, ISequentialStream>
5454
{
5555
public:
56-
ISequentialStream_bridge(streams::streambuf<uint8_t> buf, std::shared_ptr<request_context> request, size_t read_length = std::numeric_limits<size_t>::max())
56+
ISequentialStream_bridge(streams::streambuf<uint8_t> buf, request_context *request, size_t read_length = std::numeric_limits<size_t>::max())
5757
: m_buffer(buf),
5858
m_request(request),
5959
m_read_length(read_length),
@@ -163,7 +163,10 @@ namespace web { namespace http
163163
private:
164164
concurrency::streams::streambuf<uint8_t> m_buffer;
165165

166-
std::shared_ptr<request_context> m_request;
166+
// The request context controls the lifetime of this class so directly take a
167+
// raw pointer. We could use std::weak_ptr but the extra code and overhead of lock
168+
// is unecessary since we completely know the lifetime guarantee here.
169+
request_context *m_request;
167170

168171
// Total count of bytes read
169172
size_t m_bytes_read;
@@ -464,7 +467,7 @@ namespace web { namespace http
464467
return;
465468
}
466469

467-
winrt_context->m_stream_bridge = Make<ISequentialStream_bridge>(writebuf, request);
470+
winrt_context->m_stream_bridge = Make<ISequentialStream_bridge>(writebuf, request.get());
468471

469472
hr = xhr->SetCustomResponseStream(winrt_context->m_stream_bridge.Get());
470473

@@ -516,7 +519,7 @@ namespace web { namespace http
516519
xhr->Release();
517520
return;
518521
}
519-
auto str = Make<ISequentialStream_bridge>(readbuf, request, content_length);
522+
auto str = Make<ISequentialStream_bridge>(readbuf, request.get(), content_length);
520523

521524
hr = xhr->Send(str.Get(), content_length);
522525
}

Release/src/http/common/http_helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ namespace details
298298
// unknown defaults to big endian.
299299
return convert_utf16be_to_utf16le(src, false);
300300
}
301-
301+
302302
UNREACHABLE;
303303
}
304304

Release/src/http/common/http_msg.cpp

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static const utility::char_t * unsupported_charset = _XPLATSTR("Charset must be
9696

9797
http_msg_base::http_msg_base()
9898
: m_headers(),
99-
m_default_outstream(false)
99+
m_default_outstream(false)
100100
{
101101
}
102102

@@ -174,10 +174,10 @@ void http_msg_base::_complete(utility::size64_t body_size, std::exception_ptr ex
174174
// Close the write head
175175
if ((bool)outstream())
176176
{
177-
if ( !(exceptionPtr == std::exception_ptr()) )
178-
outstream().close(exceptionPtr).get();
179-
else if ( m_default_outstream )
180-
outstream().close().get();
177+
if ( !(exceptionPtr == std::exception_ptr()) )
178+
outstream().close(exceptionPtr).get();
179+
else if ( m_default_outstream )
180+
outstream().close().get();
181181
}
182182

183183
if(exceptionPtr == std::exception_ptr())
@@ -203,6 +203,12 @@ utility::string_t details::http_msg_base::_extract_string()
203203
utility::string_t content, charset;
204204
parse_content_type_and_charset(headers().content_type(), content, charset);
205205

206+
// If no Content-Type then just return an empty string.
207+
if(content.empty())
208+
{
209+
return utility::string_t();
210+
}
211+
206212
// Content-Type must have textual type.
207213
if(!is_content_type_textual(content))
208214
{
@@ -310,10 +316,16 @@ json::value details::http_msg_base::_extract_json()
310316
utility::string_t content, charset;
311317
parse_content_type_and_charset(headers().content_type(), content, charset);
312318

319+
// If no Content-Type then just return a null json value.
320+
if(content.empty())
321+
{
322+
return json::value();
323+
}
324+
313325
// Content-Type must be "application/json" or one of the unofficial, but common JSON types.
314326
if(!is_content_type_json(content))
315327
{
316-
const utility::string_t actualContentType = utility::conversions::to_string_t(content);
328+
const utility::string_t actualContentType = utility::conversions::to_string_t(content);
317329
throw http_exception((_XPLATSTR("Content-Type must be JSON to extract (is: ") + actualContentType + _XPLATSTR(")")).c_str());
318330
}
319331

@@ -410,14 +422,14 @@ std::vector<uint8_t> details::http_msg_base::_extract_vector()
410422

411423
std::vector<uint8_t> body;
412424
auto buf_r = instream().streambuf();
413-
size_t size = buf_r.in_avail();
425+
size_t size = buf_r.in_avail();
414426

415427
body.resize((std::vector<uint8_t>::size_type)buf_r.in_avail());
416-
if (size > 0)
417-
{
418-
body.resize(size);
419-
buf_r.getn((uint8_t*)&body[0], body.size()).get(); // There is no risk of blocking.
420-
}
428+
if (size > 0)
429+
{
430+
body.resize(size);
431+
buf_r.getn((uint8_t*)&body[0], body.size()).get(); // There is no risk of blocking.
432+
}
421433

422434
return body;
423435
}

Release/src/json/json_serialization.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,11 @@ bool web::json::details::_String::has_escape_chars(const _String &str)
263263
{
264264
if (str.is_wide())
265265
{
266-
const utf16char *escapes = u"\"\\\b\f\r\n\t";
266+
#ifdef _MS_WINDOWS
267+
const wchar_t *escapes = L"\"\\\b\f\r\n\t";
268+
#else
269+
const utf16char *escapes = u"\"\\\b\f\r\n\t";
270+
#endif
267271
return str.m_wstring->find_first_of(escapes) != std::wstring::npos;
268272
}
269273
else

0 commit comments

Comments
 (0)