MCPcopy Create free account
hub / github.com/apache/trafficserver / parse_request

Function parse_request

example/plugins/c-api/protocol/TxnSM.cc:961–981  ·  view source on GitHub ↗

Parse the server_name and file name from the request. */

Source from the content-addressed store, hash-verified

959
960/* Parse the server_name and file name from the request. */
961int
962parse_request(char *request, char *server_name, char *file_name)
963{
964 char *saveptr = nullptr;
965 char *temp = strtok_r(request, " ", &saveptr);
966
967 if (temp != nullptr) {
968 TSstrlcpy(server_name, temp, MAX_SERVER_NAME_LENGTH + 1);
969 } else {
970 return 0;
971 }
972
973 temp = strtok_r(nullptr, " ", &saveptr);
974 if (temp != nullptr) {
975 TSstrlcpy(file_name, temp, MAX_FILE_NAME_LENGTH + 1);
976 } else {
977 return 0;
978 }
979
980 return 1;
981}
982
983/* Create 128-bit cache key based on the input string, in this case,
984 the file_name of the requested doc. */

Callers 1

Calls 1

TSstrlcpyFunction · 0.85

Tested by

no test coverage detected