Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit adfcc89

Browse files
committed
Incorporated comments
modified: System/Net/Http/Unix/CurlCallbacks.cs
1 parent 71bf169 commit adfcc89

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/System.Net.Http/src/System/Net/Http/Unix/CurlCallbacks.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ private static bool TryParseStatusLine(HttpResponseMessage response, string resp
228228
{
229229
response.Version = HttpVersion.Version10;
230230
}
231+
else
232+
{
233+
response.Version = new Version(0, 0);
234+
}
235+
}
236+
else
237+
{
238+
response.Version = new Version(0, 0);
231239
}
232240

233241
// TODO: Parsing errors are treated as fatal. Find right behaviour
@@ -236,15 +244,16 @@ private static bool TryParseStatusLine(HttpResponseMessage response, string resp
236244

237245
if (spaceIndex > -1)
238246
{
239-
int codeStartIndex = spaceIndex + 1;
240-
int codeEndIndex = codeStartIndex + StatusCodeLength;
247+
int codeStartIndex = spaceIndex + 1;
241248
int statusCode = 0;
242249

243250
// Parse first 3 characters after a space as status code
244251
if (TryParseStatusCode(responseHeader, codeStartIndex, out statusCode))
245252
{
246253
response.StatusCode = (HttpStatusCode)statusCode;
247254

255+
int codeEndIndex = codeStartIndex + StatusCodeLength;
256+
248257
int reasonPhraseIndex = codeEndIndex + 1;
249258

250259
if (reasonPhraseIndex < responseHeaderLength && responseHeader[codeEndIndex] == SpaceChar)

0 commit comments

Comments
 (0)