Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 412579 | Differences between
and this patch

Collapse All | Expand All

(-)wget-1.13.4_orig/configure.ac (+16 lines)
Lines 338-343 Link Here
338
  fi
338
  fi
339
fi
339
fi
340
340
341
dnl
342
dnl libproxy support
343
dnl
344
AC_ARG_ENABLE(libproxy,
345
  [  --enable-libproxy       libproxy support for system wide proxy configuration])
346
if test "${enable_libproxy}" != "no"
347
then
348
  PKG_CHECK_MODULES([libproxy], [libproxy-1.0], [enable_libproxy=yes], [enable_libproxy=no])
349
fi
350
if test "${enable_libproxy}" = "yes"
351
then
352
  AC_SUBST(libproxy_CFLAGS)
353
  AC_SUBST(libproxy_LIBS)
354
  AC_DEFINE([HAVE_LIBPROXY], 1, [Define when using libproxy])
355
fi
356
341
dnl **********************************************************************
357
dnl **********************************************************************
342
dnl Checks for IPv6
358
dnl Checks for IPv6
343
dnl **********************************************************************
359
dnl **********************************************************************
(-)wget-1.13.4_orig/src/Makefile.am (-1 / +1 lines)
Lines 37-43 Link Here
37
37
38
# The following line is losing on some versions of make!
38
# The following line is losing on some versions of make!
39
DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
39
DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
40
LIBS     = @LIBICONV@ @LIBINTL@ @LIBS@ $(LIB_CLOCK_GETTIME)
40
LIBS     = @LIBICONV@ @LIBINTL@ @LIBS@ $(LIB_CLOCK_GETTIME) @libproxy_LIBS@
41
41
42
EXTRA_DIST = css.l css.c css_.c build_info.c.in
42
EXTRA_DIST = css.l css.c css_.c build_info.c.in
43
43
(-)wget-1.13.4_orig/src/log.c (-2 / +3 lines)
Lines 41-46 Link Here
41
#include "utils.h"
41
#include "utils.h"
42
#include "log.h"
42
#include "log.h"
43
43
44
44
/* 2005-10-25 SMS.
45
/* 2005-10-25 SMS.
45
   VMS log files are often VFC record format, not stream, so fputs() can
46
   VMS log files are often VFC record format, not stream, so fputs() can
46
   produce multiple records, even when there's no newline terminator in
47
   produce multiple records, even when there's no newline terminator in
Lines 506-517 Link Here
506
  while (!done);
507
  while (!done);
507
}
508
}
508
509
509
#ifdef ENABLE_DEBUG
510
/* The same as logprintf(), but does anything only if opt.debug is
510
/* The same as logprintf(), but does anything only if opt.debug is
511
   true.  */
511
   true.  */
512
void
512
void
513
debug_logprintf (const char *fmt, ...)
513
debug_logprintf (const char *fmt, ...)
514
{
514
{
515
#ifdef ENABLE_DEBUG
515
  if (opt.debug)
516
  if (opt.debug)
516
    {
517
    {
517
      va_list args;
518
      va_list args;
Lines 531-538 Link Here
531
        }
532
        }
532
      while (!done);
533
      while (!done);
533
    }
534
    }
534
}
535
#endif /* ENABLE_DEBUG */
535
#endif /* ENABLE_DEBUG */
536
}
536
537
537
/* Open FILE and set up a logging stream.  If FILE cannot be opened,
538
/* Open FILE and set up a logging stream.  If FILE cannot be opened,
538
   exit with status of 1.  */
539
   exit with status of 1.  */
(-)wget-1.13.4_orig/src/retr.c (-1 / +35 lines)
Lines 54-59 Link Here
54
#include "html-url.h"
54
#include "html-url.h"
55
#include "iri.h"
55
#include "iri.h"
56
56
57
#ifdef HAVE_LIBPROXY
58
#include "proxy.h"
59
#endif
60
57
/* Total size of downloaded files.  Used to enforce quota.  */
61
/* Total size of downloaded files.  Used to enforce quota.  */
58
SUM_SIZE_INT total_downloaded_bytes;
62
SUM_SIZE_INT total_downloaded_bytes;
59
63
Lines 1165-1171 Link Here
1165
  if (no_proxy_match (u->host, (const char **)opt.no_proxy))
1169
  if (no_proxy_match (u->host, (const char **)opt.no_proxy))
1166
    return NULL;
1170
    return NULL;
1167
1171
1168
  switch (u->scheme)
1172
#ifdef HAVE_LIBPROXY
1173
  pxProxyFactory *pf = px_proxy_factory_new();
1174
  if (!pf)
1175
  {
1176
    debug_logprintf (_("retr.c, getproxy: Allocating memory for libproxy failed"));
1177
    return NULL;
1178
  }
1179
  int i; 
1180
  char direct[] = "direct://";
1181
1182
  debug_logprintf (_("retr.c, getproxy: asking libproxy which proxy to use for url '%s'\n"), u->url);
1183
  char **proxies = px_proxy_factory_get_proxies(pf, u->url);
1184
  if (proxies[0])
1185
  {
1186
    char *check = NULL;
1187
    asprintf(&check , "%s", proxies[0]);
1188
    if(strcmp(check ,direct) != 0)
1189
    {
1190
        asprintf(&proxy , "%s", proxies[0]);
1191
    }
1192
    debug_logprintf (_("retr.c, getproxy: libproxy suggests to use '%s'\n"), check);
1193
  }
1194
  for(i=0;proxies[i];i++) free(proxies[i]);
1195
  free(proxies);
1196
  free(pf);
1197
#endif
1198
1199
  if (!proxy || !*proxy)
1200
  {
1201
    switch (u->scheme)
1169
    {
1202
    {
1170
    case SCHEME_HTTP:
1203
    case SCHEME_HTTP:
1171
      proxy = opt.http_proxy ? opt.http_proxy : getenv ("http_proxy");
1204
      proxy = opt.http_proxy ? opt.http_proxy : getenv ("http_proxy");
Lines 1183-1188 Link Here
1183
    }
1216
    }
1184
  if (!proxy || !*proxy)
1217
  if (!proxy || !*proxy)
1185
    return NULL;
1218
    return NULL;
1219
  }
1186
1220
1187
  /* Handle shorthands.  `rewritten_storage' is a kludge to allow
1221
  /* Handle shorthands.  `rewritten_storage' is a kludge to allow
1188
     getproxy() to return static storage. */
1222
     getproxy() to return static storage. */

Return to bug 412579