Skip to content

Conversation

@shishirb-MSFT
Copy link
Collaborator

No description provided.

@shishirb-MSFT shishirb-MSFT requested a review from a team as a code owner August 25, 2021 22:50
std::string firstLine{_incomingDataBuf.begin(), itCR};
// std::cout << "Request/Status line: " << firstLine << std::endl;

static const std::regex rxRequestLine{"([a-zA-Z]+) ([a-zA-Z0-9\\-_\\.!~\\*'\\(\\)%:@&=\\+$,/?]+) [hHtTpP/1\\.]+"};
Copy link
Collaborator Author

@shishirb-MSFT shishirb-MSFT Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rxRequestLine

This file is also largely the same as do_http_parser.cpp that is deleted. Only changes are replacing sdk's exception throw with std c++ ones and adding HTTP request parsing (agent will need this). #Closed

@shishirb-MSFT shishirb-MSFT changed the title Prepare for cpprest removal: Extract http parser into common code Pre-cpprest-removal: Extract http parser into common code Aug 25, 2021
unsigned int StatusCode() const { return _parsedData->statusCode; }
std::stringstream& Body() { return _parsedData->body; }
const std::shared_ptr<HttpPacket>& ParsedData() const { return _parsedData; }

Copy link
Contributor

@jimson-msft jimson-msft Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding some unit tests for the parser #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will do it after code complete. For now, the sdk/agent interaction in all the downloads is sufficient.

while (_ParseNextField())
{
}
break;
Copy link
Contributor

@jimson-msft jimson-msft Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty because we're not interested in anything here for the rest interface? #Closed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields here refers to the http headers correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nvm, see the comment in line 128

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the http headers. We aren't interested in anything other than Content-Length.

Copy link
Contributor

@jimson-msft jimson-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shishirb-MSFT shishirb-MSFT merged commit 905b5db into main Aug 26, 2021
@shishirb-MSFT shishirb-MSFT deleted the user/shishirb/ni-server-impl-partial branch August 26, 2021 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants