Skip to content

Commit

Permalink
Avoid unused 'autoproxy' variable when built without libproxy support.
Browse files Browse the repository at this point in the history
If we change the way we detect and abort, we can *check* that variable
that the compiler is complaining about.

I just noticed that libproxy support isn't working; OPENCONNECT_LIBPROXY
is never being defined. Will fix that shortly...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 15, 2011
1 parent 69de84a commit 2703136
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.c
Expand Up @@ -375,10 +375,6 @@ int main(int argc, char **argv)
autoproxy = 0;
proxy = NULL;
case OPT_LIBPROXY:
#ifndef OPENCONNECT_LIBPROXY
fprintf(stderr, "This version of openconnect was built without libproxy support\n");
exit(1);
#endif
autoproxy = 1;
proxy = NULL;
break;
Expand Down Expand Up @@ -479,10 +475,15 @@ int main(int argc, char **argv)

vpninfo->progress = write_progress;

if (autoproxy) {
#ifdef OPENCONNECT_LIBPROXY
if (autoproxy)
vpninfo->proxy_factory = px_proxy_factory_new();
#else
fprintf(stderr, "This version of openconnect was built without libproxy support\n");
exit(1);
#endif
}

if (proxy && openconnect_set_http_proxy(vpninfo, strdup(proxy)))
exit(1);

Expand Down

0 comments on commit 2703136

Please sign in to comment.