| 265 | } |
| 266 | |
| 267 | char* internal_match_header(char* message, const char* hdr, const char* compact_hdr) { |
| 268 | // Attempt to find the header |
| 269 | char* header_match = strcasestr(message, hdr); |
| 270 | if (!compact_hdr) { |
| 271 | // Exit when there is no compact header to compare to |
| 272 | return header_match; |
| 273 | } |
| 274 | |
| 275 | char* compact_header_match = strcasestr(message, compact_hdr); |
| 276 | |
| 277 | // Return the other if one is null |
| 278 | if (header_match == nullptr) { |
| 279 | return compact_header_match; |
| 280 | } |
| 281 | if (compact_header_match == nullptr) { |
| 282 | return header_match; |
| 283 | } |
| 284 | |
| 285 | // Value exists return the smaller of the two. |
| 286 | if (header_match < compact_header_match) { |
| 287 | return header_match; |
| 288 | } |
| 289 | |
| 290 | return compact_header_match; |
| 291 | } |
| 292 | |
| 293 | const char* internal_compact_header_name(const char* name) |
| 294 | { |