You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.6 KiB

  1. From 1cb3af1e5b392ac2fae6d9ed8b5d7be399d9f37e Mon Sep 17 00:00:00 2001
  2. From: Ygal Blum <address@hidden>
  3. Date: Tue, 24 Nov 2015 11:24:54 +0200
  4. Subject: [PATCH] Fix compilation when without-ssl is selected
  5. ---
  6. src/ftp.c | 2 ++
  7. src/main.c | 12 ++++++++++--
  8. src/recur.c | 6 +++++-
  9. src/retr.c | 18 +++++++++++++++---
  10. src/url.c | 6 +++++-
  11. 5 files changed, 37 insertions(+), 7 deletions(-)
  12. diff --git a/src/ftp.c b/src/ftp.c
  13. index 80420ef..5394b71 100644
  14. --- a/src/ftp.c
  15. +++ b/src/ftp.c
  16. @@ -393,7 +393,9 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
  17. if (!(cmd & DO_LOGIN))
  18. {
  19. csock = con->csock;
  20. +#ifdef HAVE_SSL
  21. using_data_security = con->st & DATA_CHANNEL_SECURITY;
  22. +#endif
  23. }
  24. else /* cmd & DO_LOGIN */
  25. {
  26. diff --git a/src/main.c b/src/main.c
  27. index 61a157a..4641008 100644
  28. --- a/src/main.c
  29. +++ b/src/main.c
  30. @@ -1842,13 +1842,21 @@ only if outputting to a regular file.\n"));
  31. else
  32. {
  33. if ((opt.recursive || opt.page_requisites)
  34. - && ((url_scheme (*t) != SCHEME_FTP && url_scheme (*t) != SCHEME_FTPS)
  35. + && ((url_scheme (*t) != SCHEME_FTP
  36. +#ifdef HAVE_SSL
  37. + && url_scheme (*t) != SCHEME_FTPS
  38. +#endif
  39. + )
  40. || url_uses_proxy (url_parsed)))
  41. {
  42. int old_follow_ftp = opt.follow_ftp;
  43. /* Turn opt.follow_ftp on in case of recursive FTP retrieval */
  44. - if (url_scheme (*t) == SCHEME_FTP || url_scheme (*t) == SCHEME_FTPS)
  45. + if (url_scheme (*t) == SCHEME_FTP
  46. +#ifdef HAVE_SSL
  47. + || url_scheme (*t) == SCHEME_FTPS
  48. +#endif
  49. + )
  50. opt.follow_ftp = 1;
  51. retrieve_tree (url_parsed, NULL);
  52. diff --git a/src/recur.c b/src/recur.c
  53. index 25cdbb7..b212ec6 100644
  54. --- a/src/recur.c
  55. +++ b/src/recur.c
  56. @@ -610,7 +610,11 @@ download_child (const struct urlpos *upos, struct url *parent, int depth,
  57. u_scheme_like_http = schemes_are_similar_p (u->scheme, SCHEME_HTTP);
  58. /* 1. Schemes other than HTTP are normally not recursed into. */
  59. - if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS) && opt.follow_ftp))
  60. + if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP
  61. +#ifdef HAVE_SSL
  62. + || u->scheme == SCHEME_FTPS
  63. +#endif
  64. + ) && opt.follow_ftp))
  65. {
  66. DEBUGP (("Not following non-HTTP schemes.\n"));
  67. reason = WG_RR_NONHTTP;
  68. diff --git a/src/retr.c b/src/retr.c
  69. index 318b09c..a6a9bd7 100644
  70. --- a/src/retr.c
  71. +++ b/src/retr.c
  72. @@ -837,7 +837,11 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
  73. FTP. In these cases we must decide whether the text is HTML
  74. according to the suffix. The HTML suffixes are `.html',
  75. `.htm' and a few others, case-insensitive. */
  76. - if (redirection_count && local_file && (u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS))
  77. + if (redirection_count && local_file && (u->scheme == SCHEME_FTP
  78. +#ifdef HAVE_SSL
  79. + || u->scheme == SCHEME_FTPS
  80. +#endif
  81. + ))
  82. {
  83. if (has_html_suffix_p (local_file))
  84. *dt |= TEXTHTML;
  85. @@ -1099,12 +1103,20 @@ retrieve_from_file (const char *file, bool html, int *count)
  86. proxy = getproxy (cur_url->url);
  87. if ((opt.recursive || opt.page_requisites)
  88. - && ((cur_url->url->scheme != SCHEME_FTP && cur_url->url->scheme != SCHEME_FTPS) || proxy))
  89. + && ((cur_url->url->scheme != SCHEME_FTP
  90. +#ifdef HAVE_SSL
  91. + && cur_url->url->scheme != SCHEME_FTPS
  92. +#endif
  93. + ) || proxy))
  94. {
  95. int old_follow_ftp = opt.follow_ftp;
  96. /* Turn opt.follow_ftp on in case of recursive FTP retrieval */
  97. - if (cur_url->url->scheme == SCHEME_FTP || cur_url->url->scheme == SCHEME_FTPS)
  98. + if (cur_url->url->scheme == SCHEME_FTP
  99. +#ifdef HAVE_SSL
  100. + || cur_url->url->scheme == SCHEME_FTPS
  101. +#endif
  102. + )
  103. opt.follow_ftp = 1;
  104. status = retrieve_tree (parsed_url ? parsed_url : cur_url->url,
  105. diff --git a/src/url.c b/src/url.c
  106. index 56079cd..c62867f 100644
  107. --- a/src/url.c
  108. +++ b/src/url.c
  109. @@ -1787,7 +1787,11 @@ path_simplify (enum url_scheme scheme, char *path)
  110. for (--t; t > beg && t[-1] != '/'; t--)
  111. ;
  112. }
  113. - else if (scheme == SCHEME_FTP || scheme == SCHEME_FTPS)
  114. + else if (scheme == SCHEME_FTP
  115. +#ifdef HAVE_SSL
  116. + || scheme == SCHEME_FTPS
  117. +#endif
  118. + )
  119. {
  120. /* If we're at the beginning, copy the "../" literally
  121. and move the beginning so a later ".." doesn't remove
  122. --
  123. 1.9.1