I'm having trouble with a method that compares two strings. Specifically I need my program to understand the difference between "http://www.csun.edu/
" and "http://www.csun.edu/~steve/
" (see config file below).
If I pass "http://www.csun.edu/
", how can I make my program understand I'm referring to the redirect line in my config file and not the cached line.
I tried doing strcat( URL, " " ) as well as strcat( URL, "\t" ) to add an extra space or tab character at the end of my URL, but then later in my code when I do strstr( URL_ConfigFile, URL ), it returns a NULL pointer saying that a the URL string doesn't exist inside of my config file.
I think it has something to do with the additional space ( " " ) I added.
# Example Configuration File for deflect:
# deflect: Daemon for HTTP Egress, Filtering, Load balancing, and Caching Trivially
# URL-prefix Disposition Host list
http://www.csun.edu/ redirected 18.104.22.168, redwing.csun.edu
http://www.csun.edu/~steve/ cached www.csun.edu
# Note that any URL that is not covered by any rule is transferred through the system
# without any additional processing.