Parse the server_name and file name from the request. */
| 959 | |
| 960 | /* Parse the server_name and file name from the request. */ |
| 961 | int |
| 962 | parse_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. */ |
no test coverage detected