+
+ st->server_type = -1; // not set as yet
+ // if the user specified string doesn't match apache or lighttpd, then
+ // ignore it. Headers will be parsed to find out the server type
+ if (st->server != NULL)
+ {
+ if (strcasecmp(st->server, "apache") == 0)
+ st->server_type = APACHE;
+ else if (strcasecmp(st->server, "lighttpd") == 0)
+ st->server_type = LIGHTTPD;
+ }
+
+ // if not found register a header callback to determine the
+ // server_type
+ if (st->server_type == -1)
+ {
+ curl_easy_setopt (st->curl, CURLOPT_HEADERFUNCTION, apache_header_callback);
+ curl_easy_setopt (st->curl, CURLOPT_WRITEHEADER, st);
+ }
+