mirror of
https://github.com/xroche/httrack.git
synced 2026-07-11 19:36:52 +03:00
Compare commits
182 Commits
docs/agent
...
remove-dea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf483a24e4 | ||
|
|
abaea566bd | ||
|
|
f66ec195aa | ||
|
|
7928db5729 | ||
|
|
20be48d56c | ||
|
|
484fc47eab | ||
|
|
abaf9b69a2 | ||
|
|
b0466b1d7b | ||
|
|
f785286c87 | ||
|
|
440a8603a9 | ||
|
|
4979e58dc0 | ||
|
|
894cf5a8d2 | ||
|
|
0c1aa51385 | ||
|
|
fb4267c6d7 | ||
|
|
f0b044c2f3 | ||
|
|
dfafe28002 | ||
|
|
a3f04bde72 | ||
|
|
11beef52e1 | ||
|
|
d7c4eab1f5 | ||
|
|
2eac19655b | ||
|
|
83c231d50e | ||
|
|
9d29b8329b | ||
|
|
ac4a1ca48e | ||
|
|
9f2f2e52fa | ||
|
|
92db2f2b41 | ||
|
|
ec52112446 | ||
|
|
1eaddc9c0e | ||
|
|
d97a7bdfd9 | ||
|
|
d2d02d87c2 | ||
|
|
4958bb8666 | ||
|
|
07da404cb8 | ||
|
|
694e45c698 | ||
|
|
db9ec2cc3b | ||
|
|
6a9ab2a11f | ||
|
|
13b31986d5 | ||
|
|
bd7e0989f6 | ||
|
|
bd74ec7cab | ||
|
|
1ed8ffad64 | ||
|
|
b68de172fa | ||
|
|
aabfd34380 | ||
|
|
65ff9e0f11 | ||
|
|
730a1c8c5b | ||
|
|
f9ee4702a2 | ||
|
|
cca83e5f4a | ||
|
|
97f398e508 | ||
|
|
a62f93a107 | ||
|
|
799ec88dc7 | ||
|
|
71af4a24f0 | ||
|
|
e17f4f12a0 | ||
|
|
5be8ba4bbd | ||
|
|
247a46068e | ||
|
|
669947cd23 | ||
|
|
40a66600ff | ||
|
|
768756e231 | ||
|
|
b138c87a93 | ||
|
|
3de47433b7 | ||
|
|
fb8827718e | ||
|
|
7228210061 | ||
|
|
38882c0aee | ||
|
|
bfc4a016ab | ||
|
|
756d8fb8bd | ||
|
|
5501faa7b1 | ||
|
|
6322b6fb1f | ||
|
|
58f368a91a | ||
|
|
c97b3e233e | ||
|
|
b615a4e7fd | ||
|
|
594cf0da39 | ||
|
|
3845cd1fb3 | ||
|
|
94bffb0804 | ||
|
|
a5c86e7e89 | ||
|
|
54f5717057 | ||
|
|
40fc9de360 | ||
|
|
4614eefefe | ||
|
|
b0e8262db0 | ||
|
|
addbd3136b | ||
|
|
a64c4cd160 | ||
|
|
1611dbcabf | ||
|
|
099501ee50 | ||
|
|
1b9eefa3b4 | ||
|
|
9c8d3a41eb | ||
|
|
ae77cd9d6d | ||
|
|
51b8dcd81c | ||
|
|
bcce664143 | ||
|
|
7a24add87c | ||
|
|
2308e7bafd | ||
|
|
ef5691fc47 | ||
|
|
0a6eb73903 | ||
|
|
fdb243e5a2 | ||
|
|
f8546e146d | ||
|
|
b7f602f2eb | ||
|
|
550100b56a | ||
|
|
33ddb27243 | ||
|
|
4606dfbf66 | ||
|
|
a6f1b9a3dd | ||
|
|
fb35d6a0f1 | ||
|
|
8a270fec03 | ||
|
|
0cbd5279f2 | ||
|
|
05306ee4fd | ||
|
|
1d0fc0a566 | ||
|
|
a4452592b4 | ||
|
|
62c2364b59 | ||
|
|
fe7041ddbf | ||
|
|
f5543df1af | ||
|
|
fee30aa95d | ||
|
|
f9f4700ee1 | ||
|
|
f030fa21e3 | ||
|
|
bdd1c1bc2c | ||
|
|
56665a268f | ||
|
|
2e948b9acd | ||
|
|
cae11499f1 | ||
|
|
02c7f4ebf6 | ||
|
|
9070b44a70 | ||
|
|
799c045061 | ||
|
|
fb1ee3bf2e | ||
|
|
6a08ca7d39 | ||
|
|
a8b491e509 | ||
|
|
a8e4bb3b81 | ||
|
|
0145ec37a3 | ||
|
|
a80fab38ba | ||
|
|
c52a524a63 | ||
|
|
1907621d37 | ||
|
|
3b2d7afdaa | ||
|
|
6ee539619e | ||
|
|
fb098b27b4 | ||
|
|
5f6a3fb917 | ||
|
|
f9e676dbe3 | ||
|
|
1b440c44b5 | ||
|
|
ac6dd1a570 | ||
|
|
4549ec3695 | ||
|
|
ac56c31b24 | ||
|
|
ee6beeeb7d | ||
|
|
6788bda380 | ||
|
|
7ead8d595e | ||
|
|
93f502990c | ||
|
|
0f4b2596b2 | ||
|
|
4a676bb5e1 | ||
|
|
36b4e834b8 | ||
|
|
bbb423f025 | ||
|
|
eed46e0b09 | ||
|
|
fa57f0148f | ||
|
|
76260d5e6e | ||
|
|
5d0913dfce | ||
|
|
9b7601a987 | ||
|
|
4ec38c4e66 | ||
|
|
1142b64696 | ||
|
|
22d3eb44cd | ||
|
|
8246c7bbcd | ||
|
|
f13f90e9c4 | ||
|
|
c177923fa1 | ||
|
|
7091f85104 | ||
|
|
a498745df3 | ||
|
|
f875590b90 | ||
|
|
c1a8c5ffa8 | ||
|
|
46a9f6db5d | ||
|
|
d90f3e356d | ||
|
|
845e2e72eb | ||
|
|
447c2d1d6f | ||
|
|
c86ca62366 | ||
|
|
9bf741f4b0 | ||
|
|
d9c7ea41e8 | ||
|
|
b52b117b90 | ||
|
|
19d925e6e0 | ||
|
|
90847cf083 | ||
|
|
1611add5a9 | ||
|
|
92f4ea044b | ||
|
|
4344801983 | ||
|
|
25b9a53c89 | ||
|
|
5a716a0e30 | ||
|
|
4bc6855213 | ||
|
|
fe8bd59d19 | ||
|
|
83d813eb7f | ||
|
|
31eead95df | ||
|
|
1f29ed41db | ||
|
|
9db360e5fd | ||
|
|
88bfcff10c | ||
|
|
1df45fc231 | ||
|
|
3a0f5779dd | ||
|
|
46fd973e0b | ||
|
|
ddc39b7dc0 | ||
|
|
085937b305 | ||
|
|
36a9f5a827 | ||
|
|
20880c1a4d |
@@ -16,6 +16,7 @@ BasedOnStyle: LLVM
|
|||||||
SpaceAfterCStyleCast: true # "(int) x", overwhelmingly dominant (542 vs 7)
|
SpaceAfterCStyleCast: true # "(int) x", overwhelmingly dominant (542 vs 7)
|
||||||
SortIncludes: false # C include order can be significant; never reorder
|
SortIncludes: false # C include order can be significant; never reorder
|
||||||
IncludeBlocks: Preserve # do not merge/reflow include groups
|
IncludeBlocks: Preserve # do not merge/reflow include groups
|
||||||
|
SeparateDefinitionBlocks: Always # blank line between definitions (readability)
|
||||||
|
|
||||||
# Stated explicitly for robustness against base-style drift (these match LLVM):
|
# Stated explicitly for robustness against base-style drift (these match LLVM):
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
|
|||||||
5
.flake8
Normal file
5
.flake8
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[flake8]
|
||||||
|
# Match black's formatting so the two tools don't fight.
|
||||||
|
max-line-length = 88
|
||||||
|
# E203/W503 conflict with black's slice and line-break style.
|
||||||
|
extend-ignore = E203, W503
|
||||||
171
.github/workflows/ci.yml
vendored
171
.github/workflows/ci.yml
vendored
@@ -61,6 +61,50 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: cat tests/test-suite.log 2>/dev/null || true
|
run: cat tests/test-suite.log 2>/dev/null || true
|
||||||
|
|
||||||
|
# Reproduce the Debian buildds: they build in a minimal chroot with no
|
||||||
|
# python3, so the local-server tests must SKIP (exit 77), not fail. GitHub
|
||||||
|
# runners ship python3, so every other job hides this path; here we remove it
|
||||||
|
# before `make check`. This is the guard that would have caught the 3.49.10-1
|
||||||
|
# FTBFS (28_local-pause failed instead of skipping when python3 was absent).
|
||||||
|
buildd-no-python3:
|
||||||
|
name: build (no python3, Debian buildd)
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
build-essential autoconf automake libtool autoconf-archive \
|
||||||
|
zlib1g-dev libssl-dev
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
autoreconf -fi
|
||||||
|
./configure
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: make -j"$(nproc)"
|
||||||
|
|
||||||
|
- name: Test without python3
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
# Hide every python3* so `command -v python3` fails like it does in the
|
||||||
|
# buildd chroot; masking with /bin/false would still resolve.
|
||||||
|
sudo find /usr/bin /usr/local/bin -maxdepth 1 -name 'python3*' \
|
||||||
|
-exec mv {} {}.hidden \;
|
||||||
|
! command -v python3
|
||||||
|
make check
|
||||||
|
|
||||||
|
- name: Print the test log on failure
|
||||||
|
if: failure()
|
||||||
|
run: cat tests/test-suite.log 2>/dev/null || true
|
||||||
|
|
||||||
# Portability: build and test on macOS (Darwin/clang) on a native runner --
|
# Portability: build and test on macOS (Darwin/clang) on a native runner --
|
||||||
# no VM. The tree has no __APPLE__ branches, so Darwin exercises the
|
# no VM. The tree has no __APPLE__ branches, so Darwin exercises the
|
||||||
# generic-Unix path on a second libc and kernel. brew's openssl@3 is keg-only,
|
# generic-Unix path on a second libc and kernel. brew's openssl@3 is keg-only,
|
||||||
@@ -188,6 +232,52 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: cat tests/test-suite.log 2>/dev/null || true
|
run: cat tests/test-suite.log 2>/dev/null || true
|
||||||
|
|
||||||
|
# MemorySanitizer catches reads of uninitialized memory (#143's stack-garbage
|
||||||
|
# size filter) that ASan/UBSan miss. It flags any byte an uninstrumented lib
|
||||||
|
# wrote, so the job stays in our own code: offline self-tests only, no openssl
|
||||||
|
# (--disable-https), no zlib cache tests, static (the runtime is not in .so's).
|
||||||
|
msan:
|
||||||
|
name: msan (MemorySanitizer, clang)
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
build-essential clang autoconf automake libtool autoconf-archive \
|
||||||
|
zlib1g-dev
|
||||||
|
|
||||||
|
- name: Configure (MSan, static, no https)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
autoreconf -fi
|
||||||
|
./configure CC=clang \
|
||||||
|
CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-recover=all -g -O1 -fno-omit-frame-pointer" \
|
||||||
|
LDFLAGS="-fsanitize=memory" \
|
||||||
|
--disable-https --disable-shared --enable-static
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: make -j"$(nproc)"
|
||||||
|
|
||||||
|
- name: Test (offline self-tests under MSan)
|
||||||
|
env:
|
||||||
|
MSAN_OPTIONS: abort_on_error=1:halt_on_error=1
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
# 01_engine-* only; zlib-dependent self-tests are named 01_zlib-* and
|
||||||
|
# skipped here (uninstrumented libz floods MSan with false positives).
|
||||||
|
tests="$(cd tests && ls 01_engine-*.test | tr '\n' ' ')"
|
||||||
|
make check TESTS="$tests"
|
||||||
|
|
||||||
|
- name: Print the test log on failure
|
||||||
|
if: failure()
|
||||||
|
run: cat tests/test-suite.log 2>/dev/null || true
|
||||||
|
|
||||||
# Optional-dependency build: compile and test with HTTPS/OpenSSL disabled --
|
# Optional-dependency build: compile and test with HTTPS/OpenSSL disabled --
|
||||||
# the configuration users on minimal systems build, and one libssl is not even
|
# the configuration users on minimal systems build, and one libssl is not even
|
||||||
# installed here so configure cannot silently re-enable it. The matrix above
|
# installed here so configure cannot silently re-enable it. The matrix above
|
||||||
@@ -227,34 +317,47 @@ jobs:
|
|||||||
# Validate the Debian packaging via the same script maintainers release with.
|
# Validate the Debian packaging via the same script maintainers release with.
|
||||||
# One amd64/gcc run is enough: packaging (control/rules/manifest/lintian/quilt
|
# One amd64/gcc run is enough: packaging (control/rules/manifest/lintian/quilt
|
||||||
# source build) is arch- and compiler-independent, and the build matrix above
|
# source build) is arch- and compiler-independent, and the build matrix above
|
||||||
# already covers compile portability. lintian runs with --fail-on=error.
|
# already covers compile portability. mkdeb.sh runs lintian as an explicit gate
|
||||||
|
# (debuild does not propagate lintian's exit) with --fail-on=error,warning.
|
||||||
deb:
|
deb:
|
||||||
name: deb package (lintian)
|
name: deb package (lintian)
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
# Build and gate inside Debian sid, the upload target. A Debian dpkg-deb
|
||||||
|
# produces archive-legal xz members (an Ubuntu host defaults to zstd, which
|
||||||
|
# the archive's lintian rejects), and sid's lintian carries the same
|
||||||
|
# data-driven checks (embedded-lib fingerprints and the like) the buildds and
|
||||||
|
# UDD apply -- so issues surface here instead of after upload.
|
||||||
|
container: debian:sid
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install packaging toolchain
|
- name: Install packaging toolchain
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates git \
|
||||||
build-essential autoconf automake libtool autoconf-archive \
|
build-essential autoconf automake libtool autoconf-archive \
|
||||||
zlib1g-dev libssl-dev \
|
zlib1g-dev libssl-dev \
|
||||||
debhelper devscripts lintian fakeroot
|
debhelper devscripts lintian fakeroot
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
# --unsigned: CI has no GPG key (also skips the release sig/checksums).
|
# --unsigned: CI has no GPG key (also skips the release sig/checksums).
|
||||||
# debuild builds every package, then lintian gates on errors.
|
# mkdeb builds every package then runs the lintian gate (--fail-on=error,
|
||||||
|
# warning); debuild runs the packaged test pass.
|
||||||
#
|
#
|
||||||
# DEB_BUILD_OPTIONS trims work CI does not need (release builds via
|
# DEB_BUILD_OPTIONS trims work CI does not need (release builds via
|
||||||
# mkdeb.sh are untouched): noautodbgsym drops the -dbgsym packages whose
|
# mkdeb.sh are untouched): noautodbgsym drops the -dbgsym packages whose
|
||||||
# LTO payloads are slow to compress and that CI never ships; parallel uses
|
# LTO payloads are slow to compress and that CI never ships; parallel uses
|
||||||
# every core. We let debuild run its test pass -- the only one now that
|
# every core.
|
||||||
# mkdeb no longer runs its own -- so CI exercises the packaged tests.
|
- name: Build and lint Debian packages
|
||||||
- name: Build Debian packages
|
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
# The workspace volume is owned by the host runner uid, but the
|
||||||
|
# container runs as root, so mkdeb's git calls (superproject and the
|
||||||
|
# coucal submodule) trip "dubious ownership"; mark them all safe.
|
||||||
|
git config --global --add safe.directory "*"
|
||||||
export DEB_BUILD_OPTIONS="noautodbgsym parallel=$(nproc)"
|
export DEB_BUILD_OPTIONS="noautodbgsym parallel=$(nproc)"
|
||||||
bash tools/mkdeb.sh --unsigned --no-release-artifacts
|
bash tools/mkdeb.sh --unsigned --no-release-artifacts
|
||||||
|
|
||||||
@@ -320,27 +423,38 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
name: lint (shellcheck, shfmt)
|
name: lint (shellcheck, shfmt)
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
# Every tracked shell script; the globs expand at run time. Kept here so the
|
||||||
|
# shellcheck and shfmt steps below cannot drift apart.
|
||||||
|
env:
|
||||||
|
SHELL_SCRIPTS: >-
|
||||||
|
.githooks/pre-commit
|
||||||
|
bootstrap
|
||||||
|
build.sh
|
||||||
|
html/div/search.sh
|
||||||
|
man/makeman.sh
|
||||||
|
src/htsbasiccharsets.sh
|
||||||
|
src/htsentities.sh
|
||||||
|
src/webhttrack
|
||||||
|
tests/*.sh
|
||||||
|
tests/*.test
|
||||||
|
tools/mkdeb.sh
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install linters
|
- name: Install linters
|
||||||
env:
|
|
||||||
SHFMT_VERSION: v3.8.0
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends shellcheck
|
# noble ships shfmt 3.8.0 (universe), matching the pinned local dev
|
||||||
# shfmt is not packaged in apt; fetch a pinned release binary.
|
# version; use it rather than fetching a release binary from github.com.
|
||||||
curl -fsSL -o /tmp/shfmt \
|
sudo apt-get install -y --no-install-recommends shellcheck shfmt
|
||||||
"https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_$(dpkg --print-architecture)"
|
shfmt --version
|
||||||
sudo install -m 0755 /tmp/shfmt /usr/local/bin/shfmt
|
|
||||||
|
|
||||||
# Lint the scripts we maintain; the legacy scripts are a separate cleanup.
|
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
run: shellcheck man/makeman.sh tools/mkdeb.sh .githooks/pre-commit tests/*.test tests/check-network.sh
|
run: shellcheck $SHELL_SCRIPTS
|
||||||
|
|
||||||
- name: shfmt
|
- name: shfmt
|
||||||
run: shfmt -d -i 4 man/makeman.sh tools/mkdeb.sh .githooks/pre-commit
|
run: shfmt -d -i 4 $SHELL_SCRIPTS
|
||||||
|
|
||||||
# Check clang-format on CHANGED LINES ONLY. The engine predates clang-format
|
# Check clang-format on CHANGED LINES ONLY. The engine predates clang-format
|
||||||
# (it was shaped by an old Visual Studio formatter) and does not round-trip,
|
# (it was shaped by an old Visual Studio formatter) and does not round-trip,
|
||||||
@@ -364,11 +478,9 @@ jobs:
|
|||||||
| sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
|
| sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends clang-format-19
|
sudo apt-get install -y --no-install-recommends clang-format-19
|
||||||
# git-clang-format driver, pinned to an immutable release tag (not a
|
# The clang-format-19 package ships the git-clang-format driver;
|
||||||
# moving branch) since we curl and then execute it.
|
# expose it unsuffixed so "git clang-format" finds it.
|
||||||
sudo curl -fsSL -o /usr/local/bin/git-clang-format \
|
sudo ln -sf /usr/bin/git-clang-format-19 /usr/local/bin/git-clang-format
|
||||||
https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-19.1.7/clang/tools/clang-format/git-clang-format
|
|
||||||
sudo chmod 0755 /usr/local/bin/git-clang-format
|
|
||||||
clang-format-19 --version
|
clang-format-19 --version
|
||||||
|
|
||||||
- name: Check formatting of changed lines
|
- name: Check formatting of changed lines
|
||||||
@@ -382,10 +494,9 @@ jobs:
|
|||||||
--diff --extensions c,h "$base")"
|
--diff --extensions c,h "$base")"
|
||||||
rc=$?
|
rc=$?
|
||||||
set -e
|
set -e
|
||||||
# Classify by output first: a non-empty diff means "not clean",
|
# Classify by output, not exit code: a non-empty diff means "not
|
||||||
# regardless of the driver's exit convention (the release-tag driver
|
# clean" (git-clang-format may exit 0 or 1 on a diff). A nonzero exit
|
||||||
# exits 0 and signals via stdout; some packaged drivers exit 1 on a
|
# with clean output is a real checker error.
|
||||||
# diff). A nonzero exit with clean output is a real checker error.
|
|
||||||
case "$diff" in
|
case "$diff" in
|
||||||
"" | "no modified files to format" | *"did not modify any files"*)
|
"" | "no modified files to format" | *"did not modify any files"*)
|
||||||
if [ "$rc" -ne 0 ]; then
|
if [ "$rc" -ne 0 ]; then
|
||||||
|
|||||||
44
.gitignore
vendored
Normal file
44
.gitignore
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Generated by autoreconf/bootstrap (run ./bootstrap after a fresh clone).
|
||||||
|
# Release tarballs ("make dist") ship these; the git tree does not.
|
||||||
|
/configure
|
||||||
|
/config.h.in
|
||||||
|
/config.h.in~
|
||||||
|
/aclocal.m4
|
||||||
|
/ltmain.sh
|
||||||
|
/libtool
|
||||||
|
/config.guess
|
||||||
|
/config.sub
|
||||||
|
/install-sh
|
||||||
|
/missing
|
||||||
|
/depcomp
|
||||||
|
/compile
|
||||||
|
/ar-lib
|
||||||
|
/test-driver
|
||||||
|
/autom4te.cache/
|
||||||
|
/m4/libtool.m4
|
||||||
|
/m4/lt*.m4
|
||||||
|
Makefile.in
|
||||||
|
|
||||||
|
# Generated by configure / make.
|
||||||
|
/config.h
|
||||||
|
/config.log
|
||||||
|
/config.status
|
||||||
|
/stamp-h1
|
||||||
|
Makefile
|
||||||
|
.deps/
|
||||||
|
.libs/
|
||||||
|
*.o
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.a
|
||||||
|
|
||||||
|
# make dist output.
|
||||||
|
/httrack-*.tar.gz
|
||||||
|
|
||||||
|
# Editor / autotools backup files.
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Python bytecode (tests/local-server.py).
|
||||||
|
__pycache__/
|
||||||
20
AGENTS.md
20
AGENTS.md
@@ -5,13 +5,18 @@ the operational checklist: toolchain, invariants, and how to ship a change.
|
|||||||
|
|
||||||
## Build & test
|
## Build & test
|
||||||
- Fresh clone first: `git submodule update --init src/coucal`
|
- Fresh clone first: `git submodule update --init src/coucal`
|
||||||
- `bash configure && make && make check`
|
- `./bootstrap` (regenerates `configure` via `autoreconf`; needs autoconf,
|
||||||
|
automake, libtool), then `bash configure && make && make check`. Or run
|
||||||
|
`sh build.sh` to do bootstrap + configure + make in one shot.
|
||||||
|
|
||||||
## Hard invariants
|
## Hard invariants
|
||||||
- **Toolchain edit** (`configure.ac`, any `Makefile.am`, `m4/`) → run
|
- **Generated autotools files are NOT in git.** `configure`, every
|
||||||
`autoreconf -fi` and commit the regenerated tracked files. The repo ships the
|
`Makefile.in`, `config.h.in`, `ltmain.sh`, `config.guess/sub`, and the aux
|
||||||
generated `configure`/`Makefile.in` so users build without autotools; CI does
|
scripts are build products: `.gitignore`d, regenerated by `./bootstrap`, and
|
||||||
**not** catch staleness.
|
shipped only in `make dist` tarballs (so tarball users still need no
|
||||||
|
autotools). Never commit them. After editing `configure.ac`, any
|
||||||
|
`Makefile.am`, or `m4/`, just commit those sources — re-run `./bootstrap`
|
||||||
|
locally to rebuild and test, but do not stage the regenerated output.
|
||||||
- **Format only changed lines** with `git clang-format` (clang-format 19). Never
|
- **Format only changed lines** with `git clang-format` (clang-format 19). Never
|
||||||
reformat untouched code: the engine was formatted by an old tool and won't
|
reformat untouched code: the engine was formatted by an old tool and won't
|
||||||
round-trip.
|
round-trip.
|
||||||
@@ -28,8 +33,9 @@ the operational checklist: toolchain, invariants, and how to ship a change.
|
|||||||
- Be terse. Comment the why, in English; translate French comments you touch.
|
- Be terse. Comment the why, in English; translate French comments you touch.
|
||||||
- Strip AI tells from prose (em-dash overuse, rule-of-three, filler, vague
|
- Strip AI tells from prose (em-dash overuse, rule-of-three, filler, vague
|
||||||
attributions). Ref: Wikipedia "Signs of AI writing". Claude Code: `/humanizer`.
|
attributions). Ref: Wikipedia "Signs of AI writing". Claude Code: `/humanizer`.
|
||||||
- Behavior change → add a test. Fast path: a hidden `httrack -#N` debug
|
- Behavior change → add a test. Fast path: a hidden `httrack -#test=NAME` engine
|
||||||
subcommand (`htscoremain.c`) driven by a `tests/NN_*.test`, over a slow crawl.
|
self-test (registry in `htsselftest.c`; `-#test` lists them) driven by a
|
||||||
|
`tests/NN_*.test`, over a slow crawl.
|
||||||
|
|
||||||
## Review your change adversarially (strongly suggested)
|
## Review your change adversarially (strongly suggested)
|
||||||
Before pushing, and when reviewing others, don't skim for bugs:
|
Before pushing, and when reviewing others, don't skim for bugs:
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ Welcome, and nothing to disclose. Two rules:
|
|||||||
|
|
||||||
The sign-off covers AI-assisted code too.
|
The sign-off covers AI-assisted code too.
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
|
||||||
|
Interface strings live in [`lang/`](lang/). See [lang/README.md](lang/README.md) for the file format and how to add or update a language.
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
|
||||||
Open an issue with the version, OS, command used, and expected vs actual result.
|
Open an issue with the version, OS, command used, and expected vs actual result.
|
||||||
|
|||||||
@@ -7,4 +7,15 @@ On most systems (including GNU/Linux), installing can be easily achieved using t
|
|||||||
-or- (if not compiling as root)
|
-or- (if not compiling as root)
|
||||||
./configure --prefix=$HOME && make && make install
|
./configure --prefix=$HOME && make && make install
|
||||||
|
|
||||||
|
Building from a git checkout (not a release tarball) first needs the build
|
||||||
|
system regenerated, which requires autoconf, automake and libtool:
|
||||||
|
|
||||||
|
./bootstrap
|
||||||
|
./configure && make && make install
|
||||||
|
|
||||||
|
You can also use the one-shot wrapper, which runs bootstrap, configure and make
|
||||||
|
(extra arguments are passed to configure):
|
||||||
|
|
||||||
|
./build.sh --prefix=$HOME
|
||||||
|
|
||||||
See also the INSTALL generic help file.
|
See also the INSTALL generic help file.
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
|
|
||||||
EXTRA_DIST = INSTALL.Linux \
|
EXTRA_DIST = INSTALL.Linux \
|
||||||
gpl-fr.txt license.txt greetings.txt history.txt \
|
gpl-fr.txt license.txt greetings.txt history.txt \
|
||||||
httrack-doc.html lang.def README.md tools/mkdeb.sh
|
httrack-doc.html lang.def README.md tools/mkdeb.sh \
|
||||||
|
bootstrap build.sh
|
||||||
|
|
||||||
# Build the signed Debian packages from a clean source export. Pass the signing
|
# Build the signed Debian packages from a clean source export. Pass the signing
|
||||||
# key and other options through DEB_FLAGS, e.g.:
|
# key and other options through DEB_FLAGS, e.g.:
|
||||||
|
|||||||
871
Makefile.in
871
Makefile.in
@@ -1,871 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = .
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
|
||||||
$(am__configure_deps) $(am__DIST_COMMON)
|
|
||||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
|
||||||
configure.lineno config.status.lineno
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
|
||||||
install-data-recursive install-dvi-recursive \
|
|
||||||
install-exec-recursive install-html-recursive \
|
|
||||||
install-info-recursive install-pdf-recursive \
|
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|
||||||
distclean-recursive maintainer-clean-recursive
|
|
||||||
am__recursive_targets = \
|
|
||||||
$(RECURSIVE_TARGETS) \
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
cscope distdir distdir-am dist dist-all distcheck
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
|
||||||
config.h.in
|
|
||||||
# Read a list of newline-separated strings from the standard input,
|
|
||||||
# and print each of them once, without duplicates. Input order is
|
|
||||||
# *not* preserved.
|
|
||||||
am__uniquify_input = $(AWK) '\
|
|
||||||
BEGIN { nonempty = 0; } \
|
|
||||||
{ items[$$0] = 1; nonempty = 1; } \
|
|
||||||
END { if (nonempty) { for (i in items) print i; }; } \
|
|
||||||
'
|
|
||||||
# Make sure the list of sources is unique. This is necessary because,
|
|
||||||
# e.g., the same source file might be shared among _SOURCES variables
|
|
||||||
# for different programs/libraries.
|
|
||||||
am__define_uniq_tagged_files = \
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | $(am__uniquify_input)`
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
|
|
||||||
COPYING ChangeLog INSTALL NEWS README compile config.guess \
|
|
||||||
config.sub install-sh ltmain.sh missing
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
top_distdir = $(distdir)
|
|
||||||
am__remove_distdir = \
|
|
||||||
if test -d "$(distdir)"; then \
|
|
||||||
find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \
|
|
||||||
; rm -rf "$(distdir)" \
|
|
||||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
|
||||||
else :; fi
|
|
||||||
am__post_remove_distdir = $(am__remove_distdir)
|
|
||||||
am__relativize = \
|
|
||||||
dir0=`pwd`; \
|
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|
||||||
sed_rest='s,^[^/]*/*,,'; \
|
|
||||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|
||||||
sed_butlast='s,/*[^/]*$$,,'; \
|
|
||||||
while test -n "$$dir1"; do \
|
|
||||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first" != "."; then \
|
|
||||||
if test "$$first" = ".."; then \
|
|
||||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|
||||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|
||||||
else \
|
|
||||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first2" = "$$first"; then \
|
|
||||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|
||||||
else \
|
|
||||||
dir2="../$$dir2"; \
|
|
||||||
fi; \
|
|
||||||
dir0="$$dir0"/"$$first"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|
||||||
done; \
|
|
||||||
reldir="$$dir2"
|
|
||||||
DIST_ARCHIVES = $(distdir).tar.gz
|
|
||||||
GZIP_ENV = -9
|
|
||||||
DIST_TARGETS = dist-gzip
|
|
||||||
# Exists only to be overridden by the user if desired.
|
|
||||||
AM_DISTCHECK_DVI_TARGET = dvi
|
|
||||||
distuninstallcheck_listfiles = find . -type f -print
|
|
||||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
|
||||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
|
||||||
distcleancheck_listfiles = \
|
|
||||||
find . \( -type f -a \! \
|
|
||||||
\( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
SUBDIRS = src man m4 libtest templates lang html tests
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
|
||||||
EXTRA_DIST = INSTALL.Linux \
|
|
||||||
gpl-fr.txt license.txt greetings.txt history.txt \
|
|
||||||
httrack-doc.html lang.def README.md tools/mkdeb.sh
|
|
||||||
|
|
||||||
|
|
||||||
# Build the signed Debian packages from a clean source export. Pass the signing
|
|
||||||
# key and other options through DEB_FLAGS, e.g.:
|
|
||||||
# make deb DEB_FLAGS="--key BB71C7E6CB1AD8FAF53FE42A60C3AA7180598EFB"
|
|
||||||
# See tools/mkdeb.sh --help for all options.
|
|
||||||
DEB_FLAGS =
|
|
||||||
all: config.h
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
am--refresh: Makefile
|
|
||||||
@:
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
|
||||||
&& exit 0; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
echo ' $(SHELL) ./config.status'; \
|
|
||||||
$(SHELL) ./config.status;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
$(SHELL) ./config.status --recheck
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
config.h: stamp-h1
|
|
||||||
@test -f $@ || rm -f stamp-h1
|
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
|
||||||
|
|
||||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
|
||||||
$(AM_V_at)rm -f stamp-h1
|
|
||||||
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h
|
|
||||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
$(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
|
||||||
$(AM_V_at)rm -f stamp-h1
|
|
||||||
$(AM_V_at)touch $@
|
|
||||||
|
|
||||||
distclean-hdr:
|
|
||||||
-rm -f config.h stamp-h1
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
|
|
||||||
distclean-libtool:
|
|
||||||
-rm -f libtool config.lt
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run 'make' without going through this Makefile.
|
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|
||||||
$(am__recursive_targets):
|
|
||||||
@fail=; \
|
|
||||||
if $(am__make_keepgoing); then \
|
|
||||||
failcom='fail=yes'; \
|
|
||||||
else \
|
|
||||||
failcom='exit 1'; \
|
|
||||||
fi; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| eval $$failcom; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-recursive
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|
||||||
include_option=--etags-include; \
|
|
||||||
empty_fix=.; \
|
|
||||||
else \
|
|
||||||
include_option=--include; \
|
|
||||||
empty_fix=; \
|
|
||||||
fi; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test ! -f $$subdir/TAGS || \
|
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
shift; \
|
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
|
||||||
if test $$# -gt 0; then \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
"$$@" $$unique; \
|
|
||||||
else \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$unique; \
|
|
||||||
fi; \
|
|
||||||
fi
|
|
||||||
ctags: ctags-recursive
|
|
||||||
|
|
||||||
CTAGS: ctags
|
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|
||||||
$$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& $(am__cd) $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
|
||||||
cscope: cscope.files
|
|
||||||
test ! -s cscope.files \
|
|
||||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
|
||||||
clean-cscope:
|
|
||||||
-rm -f cscope.files
|
|
||||||
cscope.files: clean-cscope cscopelist
|
|
||||||
cscopelist: cscopelist-recursive
|
|
||||||
|
|
||||||
cscopelist-am: $(am__tagged_files)
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
case "$(srcdir)" in \
|
|
||||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|
||||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|
||||||
esac; \
|
|
||||||
for i in $$list; do \
|
|
||||||
if test -f "$$i"; then \
|
|
||||||
echo "$(subdir)/$$i"; \
|
|
||||||
else \
|
|
||||||
echo "$$sdir/$$i"; \
|
|
||||||
fi; \
|
|
||||||
done >> $(top_builddir)/cscope.files
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
|
||||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
$(am__remove_distdir)
|
|
||||||
$(AM_V_at)$(MKDIR_P) "$(distdir)"
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
$(am__make_dryrun) \
|
|
||||||
|| test -d "$(distdir)/$$subdir" \
|
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|
||||||
|| exit 1; \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_distdir=$$reldir; \
|
|
||||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_top_distdir=$$reldir; \
|
|
||||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|
||||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|
||||||
($(am__cd) $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$$new_top_distdir" \
|
|
||||||
distdir="$$new_distdir" \
|
|
||||||
am__remove_distdir=: \
|
|
||||||
am__skip_length_check=: \
|
|
||||||
am__skip_mode_fix=: \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
-test -n "$(am__skip_mode_fix)" \
|
|
||||||
|| find "$(distdir)" -type d ! -perm -755 \
|
|
||||||
-exec chmod u+rwx,go+rx {} \; -o \
|
|
||||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
|
||||||
|| chmod -R a+r "$(distdir)"
|
|
||||||
dist-gzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-bzip2: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-lzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-xz: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zstd: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-tarZ: distdir
|
|
||||||
@echo WARNING: "Support for distribution archives compressed with" \
|
|
||||||
"legacy program 'compress' is deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-shar: distdir
|
|
||||||
@echo WARNING: "Support for shar distribution archives is" \
|
|
||||||
"deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zip: distdir
|
|
||||||
-rm -f $(distdir).zip
|
|
||||||
zip -rq $(distdir).zip $(distdir)
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist dist-all:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
|
||||||
# it guarantees that the distribution is self-contained by making another
|
|
||||||
# tarfile.
|
|
||||||
distcheck: dist
|
|
||||||
case '$(DIST_ARCHIVES)' in \
|
|
||||||
*.tar.gz*) \
|
|
||||||
eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
|
||||||
*.tar.bz2*) \
|
|
||||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
|
||||||
*.tar.lz*) \
|
|
||||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
|
||||||
*.tar.xz*) \
|
|
||||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
|
||||||
*.tar.Z*) \
|
|
||||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
|
||||||
*.shar.gz*) \
|
|
||||||
eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\
|
|
||||||
*.zip*) \
|
|
||||||
unzip $(distdir).zip ;;\
|
|
||||||
*.tar.zst*) \
|
|
||||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
|
||||||
esac
|
|
||||||
chmod -R a-w $(distdir)
|
|
||||||
chmod u+w $(distdir)
|
|
||||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
|
||||||
chmod a-w $(distdir)
|
|
||||||
test -d $(distdir)/_build || exit 0; \
|
|
||||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
|
||||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
|
||||||
&& am__cwd=`pwd` \
|
|
||||||
&& $(am__cd) $(distdir)/_build/sub \
|
|
||||||
&& ../../configure \
|
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
|
||||||
distuninstallcheck \
|
|
||||||
&& chmod -R a-w "$$dc_install_base" \
|
|
||||||
&& ({ \
|
|
||||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
|
||||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
|
||||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
|
||||||
&& rm -rf "$$dc_destdir" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
|
||||||
&& rm -rf $(DIST_ARCHIVES) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
|
||||||
&& cd "$$am__cwd" \
|
|
||||||
|| exit 1
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
@(echo "$(distdir) archives ready for distribution: "; \
|
|
||||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
|
||||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
|
||||||
distuninstallcheck:
|
|
||||||
@test -n '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: trying to run $@ with an empty' \
|
|
||||||
'$$(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left after uninstall:" ; \
|
|
||||||
if test -n "$(DESTDIR)"; then \
|
|
||||||
echo " (check DESTDIR support)"; \
|
|
||||||
fi ; \
|
|
||||||
$(distuninstallcheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
distcleancheck: distclean
|
|
||||||
@if test '$(srcdir)' = . ; then \
|
|
||||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
|
||||||
exit 1 ; \
|
|
||||||
fi
|
|
||||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
|
||||||
$(distcleancheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile config.h
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
|
||||||
distclean-libtool distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-recursive
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-recursive
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-recursive
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-recursive
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -rf $(top_srcdir)/autom4te.cache
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-recursive
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
|
||||||
am--refresh check check-am clean clean-cscope clean-generic \
|
|
||||||
clean-libtool cscope cscopelist-am ctags ctags-am dist \
|
|
||||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
|
||||||
dist-xz dist-zip dist-zstd distcheck distclean \
|
|
||||||
distclean-generic distclean-hdr distclean-libtool \
|
|
||||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
|
||||||
dvi-am html html-am info info-am install install-am \
|
|
||||||
install-data install-data-am install-dvi install-dvi-am \
|
|
||||||
install-exec install-exec-am install-html install-html-am \
|
|
||||||
install-info install-info-am install-man install-pdf \
|
|
||||||
install-pdf-am install-ps install-ps-am install-strip \
|
|
||||||
installcheck installcheck-am installdirs installdirs-am \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
|
||||||
tags tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
deb:
|
|
||||||
$(SHELL) $(top_srcdir)/tools/mkdeb.sh $(DEB_FLAGS)
|
|
||||||
.PHONY: deb
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
14
README.md
14
README.md
@@ -22,8 +22,22 @@ HTTrack can also update an existing mirrored site, and resume interrupted downlo
|
|||||||
http://www.httrack.com/
|
http://www.httrack.com/
|
||||||
|
|
||||||
## Compile trunk release
|
## Compile trunk release
|
||||||
|
|
||||||
|
A git checkout ships only the autotools sources, so `./bootstrap` (which runs
|
||||||
|
`autoreconf`) regenerates `configure` first; this needs autoconf, automake and
|
||||||
|
libtool. Released tarballs already include `configure`, so building from a
|
||||||
|
tarball skips `./bootstrap`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/xroche/httrack.git --recurse-submodules
|
git clone https://github.com/xroche/httrack.git --recurse-submodules
|
||||||
cd httrack
|
cd httrack
|
||||||
|
./bootstrap
|
||||||
./configure --prefix=$HOME/usr && make -j8 && make install
|
./configure --prefix=$HOME/usr && make -j8 && make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or use the one-shot wrapper (bootstrap + configure + make), which forwards its
|
||||||
|
arguments to `configure`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./build.sh --prefix=$HOME/usr
|
||||||
|
```
|
||||||
|
|||||||
24
bootstrap
Executable file
24
bootstrap
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Regenerate the autotools build system (configure, Makefile.in, config.h.in,
|
||||||
|
# libtool, the aux scripts) from configure.ac and the Makefile.am files.
|
||||||
|
#
|
||||||
|
# Run this once after a fresh git clone, before ./configure. Release tarballs
|
||||||
|
# (made with "make dist") already ship these files, so people building from a
|
||||||
|
# tarball do not need autotools and do not run this.
|
||||||
|
#
|
||||||
|
# Requires: autoconf, automake, libtool (the autoreconf toolchain).
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1007 # "CDPATH= cd" is a deliberate empty-CDPATH prefix.
|
||||||
|
srcdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
cd "$srcdir"
|
||||||
|
|
||||||
|
if ! command -v autoreconf >/dev/null 2>&1; then
|
||||||
|
echo "bootstrap: autoreconf not found; install autoconf, automake and libtool" >&2
|
||||||
|
echo " (or build from a release tarball, which ships ./configure)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec autoreconf -fi "$@"
|
||||||
34
build.sh
Executable file
34
build.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# One-shot build from a git checkout: bootstrap (autoreconf) -> configure -> make.
|
||||||
|
# A convenience wrapper; the canonical steps are ./bootstrap && ./configure && make.
|
||||||
|
#
|
||||||
|
# Extra arguments are passed straight to ./configure, e.g.
|
||||||
|
# ./build.sh --prefix="$HOME" --disable-https
|
||||||
|
#
|
||||||
|
# Build out of tree (recommended; required if the source tree is read-only or
|
||||||
|
# mounted noexec) by pointing BUILD_DIR at a scratch directory:
|
||||||
|
# BUILD_DIR=/var/tmp/httrack-build ./build.sh
|
||||||
|
#
|
||||||
|
# On a noexec filesystem the executable bit does not take effect, so invoke the
|
||||||
|
# script explicitly with sh: sh build.sh
|
||||||
|
#
|
||||||
|
# Requires autoconf/automake/libtool (for bootstrap); the release tarball ships
|
||||||
|
# ./configure, so from a tarball just run ./configure && make.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1007 # "CDPATH= cd" is a deliberate empty-CDPATH prefix.
|
||||||
|
srcdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
|
||||||
|
# 1. Regenerate the build system in the source tree (autotools requires it).
|
||||||
|
sh "$srcdir/bootstrap"
|
||||||
|
|
||||||
|
# 2. Configure and build, out of tree when BUILD_DIR is set.
|
||||||
|
builddir=${BUILD_DIR:-$srcdir}
|
||||||
|
mkdir -p "$builddir"
|
||||||
|
cd "$builddir"
|
||||||
|
# Invoke configure via the shell, not execve: it is a portable sh script, and a
|
||||||
|
# noexec source tree (or a cleared executable bit) would make ./configure fail.
|
||||||
|
"${CONFIG_SHELL:-/bin/sh}" "$srcdir/configure" "$@"
|
||||||
|
make
|
||||||
351
compile
351
compile
@@ -1,351 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
|
|
||||||
scriptversion=2024-06-19.01; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
|
|
||||||
# We need space, tab and new line, in precisely that order. Quoting is
|
|
||||||
# there to prevent tools from complaining about whitespace usage.
|
|
||||||
IFS=" "" $nl"
|
|
||||||
|
|
||||||
file_conv=
|
|
||||||
|
|
||||||
# func_file_conv build_file lazy
|
|
||||||
# Convert a $build file to $host form and store it in $file
|
|
||||||
# Currently only supports Windows hosts. If the determined conversion
|
|
||||||
# type is listed in (the comma separated) LAZY, no conversion will
|
|
||||||
# take place.
|
|
||||||
func_file_conv ()
|
|
||||||
{
|
|
||||||
file=$1
|
|
||||||
case $file in
|
|
||||||
/ | /[!/]*) # absolute file, and not a UNC file
|
|
||||||
if test -z "$file_conv"; then
|
|
||||||
# lazily determine how to convert abs files
|
|
||||||
case `uname -s` in
|
|
||||||
MINGW*)
|
|
||||||
file_conv=mingw
|
|
||||||
;;
|
|
||||||
CYGWIN* | MSYS*)
|
|
||||||
file_conv=cygwin
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
file_conv=wine
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
case $file_conv/,$2, in
|
|
||||||
*,$file_conv,*)
|
|
||||||
;;
|
|
||||||
mingw/*)
|
|
||||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
|
||||||
;;
|
|
||||||
cygwin/* | msys/*)
|
|
||||||
file=`cygpath -m "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
wine/*)
|
|
||||||
file=`winepath -w "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashL linkdir
|
|
||||||
# Make cl look for libraries in LINKDIR
|
|
||||||
func_cl_dashL ()
|
|
||||||
{
|
|
||||||
func_file_conv "$1"
|
|
||||||
if test -z "$lib_path"; then
|
|
||||||
lib_path=$file
|
|
||||||
else
|
|
||||||
lib_path="$lib_path;$file"
|
|
||||||
fi
|
|
||||||
linker_opts="$linker_opts -LIBPATH:$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashl library
|
|
||||||
# Do a library search-path lookup for cl
|
|
||||||
func_cl_dashl ()
|
|
||||||
{
|
|
||||||
lib=$1
|
|
||||||
found=no
|
|
||||||
save_IFS=$IFS
|
|
||||||
IFS=';'
|
|
||||||
for dir in $lib_path $LIB
|
|
||||||
do
|
|
||||||
IFS=$save_IFS
|
|
||||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.dll.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/$lib.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/lib$lib.a"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/lib$lib.a
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS=$save_IFS
|
|
||||||
|
|
||||||
if test "$found" != yes; then
|
|
||||||
lib=$lib.lib
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_wrapper cl arg...
|
|
||||||
# Adjust compile command to suit cl
|
|
||||||
func_cl_wrapper ()
|
|
||||||
{
|
|
||||||
# Assume a capable shell
|
|
||||||
lib_path=
|
|
||||||
shared=:
|
|
||||||
linker_opts=
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.lo | *.[oO][bB][jJ])
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fo"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fe"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
-I)
|
|
||||||
eat=1
|
|
||||||
func_file_conv "$2" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-I*)
|
|
||||||
func_file_conv "${1#-I}" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashl "$2"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l*)
|
|
||||||
func_cl_dashl "${1#-l}"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-L)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashL "$2"
|
|
||||||
;;
|
|
||||||
-L*)
|
|
||||||
func_cl_dashL "${1#-L}"
|
|
||||||
;;
|
|
||||||
-static)
|
|
||||||
shared=false
|
|
||||||
;;
|
|
||||||
-Wl,*)
|
|
||||||
arg=${1#-Wl,}
|
|
||||||
save_ifs="$IFS"; IFS=','
|
|
||||||
for flag in $arg; do
|
|
||||||
IFS="$save_ifs"
|
|
||||||
linker_opts="$linker_opts $flag"
|
|
||||||
done
|
|
||||||
IFS="$save_ifs"
|
|
||||||
;;
|
|
||||||
-Xlinker)
|
|
||||||
eat=1
|
|
||||||
linker_opts="$linker_opts $2"
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
|
||||||
func_file_conv "$1"
|
|
||||||
set x "$@" -Tp"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
|
||||||
func_file_conv "$1" mingw
|
|
||||||
set x "$@" "$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
if test -n "$linker_opts"; then
|
|
||||||
linker_opts="-link$linker_opts"
|
|
||||||
fi
|
|
||||||
exec "$@" $linker_opts
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
eat=
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
'')
|
|
||||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
|
||||||
exit 1;
|
|
||||||
;;
|
|
||||||
-h | --h*)
|
|
||||||
cat <<\EOF
|
|
||||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
|
||||||
|
|
||||||
Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
|
||||||
arguments, and rename the output as expected.
|
|
||||||
|
|
||||||
If you are trying to build a whole package this is not the
|
|
||||||
right script to run: please start by reading the file 'INSTALL'.
|
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
|
||||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
|
||||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
|
||||||
EOF
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
-v | --v*)
|
|
||||||
echo "compile (GNU Automake) $scriptversion"
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
|
||||||
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
|
|
||||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
|
||||||
func_cl_wrapper "$@" # Doesn't return...
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
ofile=
|
|
||||||
cfile=
|
|
||||||
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
# So we strip '-o arg' only if arg is an object.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.obj)
|
|
||||||
ofile=$2
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" -o "$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*.c)
|
|
||||||
cfile=$1
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -z "$ofile" || test -z "$cfile"; then
|
|
||||||
# If no '-o' option was seen then we might have been invoked from a
|
|
||||||
# pattern rule where we don't need one. That is ok -- this is a
|
|
||||||
# normal compilation that the losing compiler can handle. If no
|
|
||||||
# '.c' file was seen then we are probably linking. That is also
|
|
||||||
# ok.
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Name of file we expect compiler to create.
|
|
||||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
|
||||||
|
|
||||||
# Create the lock directory.
|
|
||||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
|
||||||
# that we are using for the .o file. Also, base the name on the expected
|
|
||||||
# object file name, since that is what matters with a parallel build.
|
|
||||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
|
||||||
while true; do
|
|
||||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
# FIXME: race condition here if user kills between mkdir and trap.
|
|
||||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
|
||||||
|
|
||||||
# Run the compile.
|
|
||||||
"$@"
|
|
||||||
ret=$?
|
|
||||||
|
|
||||||
if test -f "$cofile"; then
|
|
||||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
|
||||||
elif test -f "${cofile}bj"; then
|
|
||||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rmdir "$lockdir"
|
|
||||||
exit $ret
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
1815
config.guess
vendored
1815
config.guess
vendored
File diff suppressed because it is too large
Load Diff
222
config.h.in
222
config.h.in
@@ -1,222 +0,0 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* Check for dlopen in c */
|
|
||||||
#undef DLLIB
|
|
||||||
|
|
||||||
/* Define if pointers to integers require aligned access */
|
|
||||||
#undef HAVE_ALIGNED_ACCESS_REQUIRED
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#undef HAVE_DLFCN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <execinfo.h> header file. */
|
|
||||||
#undef HAVE_EXECINFO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'z' library (-lz). */
|
|
||||||
#undef HAVE_LIBZ
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <minix/config.h> header file. */
|
|
||||||
#undef HAVE_MINIX_CONFIG_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'snprintf' function. */
|
|
||||||
#undef HAVE_SNPRINTF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Check for strnlen */
|
|
||||||
#undef HAVE_STRNLEN
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
|
||||||
declarations. */
|
|
||||||
#undef HAVE_VISIBILITY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'vsnprintf' function. */
|
|
||||||
#undef HAVE_VSNPRINTF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <wchar.h> header file. */
|
|
||||||
#undef HAVE_WCHAR_H
|
|
||||||
|
|
||||||
/* Check for in_addr_t */
|
|
||||||
#undef HTS_DO_NOT_REDEFINE_in_addr_t
|
|
||||||
|
|
||||||
/* Check for IPv6 */
|
|
||||||
#undef HTS_INET6
|
|
||||||
|
|
||||||
/* Check for large files support */
|
|
||||||
#undef HTS_LFS
|
|
||||||
|
|
||||||
/* Check for OpenSSL */
|
|
||||||
#undef HTS_USEOPENSSL
|
|
||||||
|
|
||||||
/* Check for libiconv */
|
|
||||||
#undef LIBICONV
|
|
||||||
|
|
||||||
/* Check for libsocket */
|
|
||||||
#undef LIBSOCKET
|
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
|
||||||
#undef LT_OBJDIR
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* "enable replacement (v)snprintf if system (v)snprintf is broken" */
|
|
||||||
#undef PREFER_PORTABLE_SNPRINTF
|
|
||||||
|
|
||||||
/* Check for setuid */
|
|
||||||
#undef SETUID
|
|
||||||
|
|
||||||
/* The size of 'long long', as computed by sizeof. */
|
|
||||||
#undef SIZEOF_LONG_LONG
|
|
||||||
|
|
||||||
/* Define to 1 if all of the C89 standard headers exist (not just the ones
|
|
||||||
required in a freestanding environment). This macro is provided for
|
|
||||||
backward compatibility; new code need not use it. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Check for pthread in pthreads */
|
|
||||||
#undef THREADS
|
|
||||||
|
|
||||||
/* Enable extensions on AIX, Interix, z/OS. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
# undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on macOS. */
|
|
||||||
#ifndef _DARWIN_C_SOURCE
|
|
||||||
# undef _DARWIN_C_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on Solaris. */
|
|
||||||
#ifndef __EXTENSIONS__
|
|
||||||
# undef __EXTENSIONS__
|
|
||||||
#endif
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable X/Open compliant socket functions that do not require linking
|
|
||||||
with -lxnet on HP-UX 11.11. */
|
|
||||||
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
|
|
||||||
# undef _HPUX_ALT_XOPEN_SOCKET_API
|
|
||||||
#endif
|
|
||||||
/* Identify the host operating system as Minix.
|
|
||||||
This macro does not affect the system headers' behavior.
|
|
||||||
A future release of Autoconf may stop defining this macro. */
|
|
||||||
#ifndef _MINIX
|
|
||||||
# undef _MINIX
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on NetBSD.
|
|
||||||
Enable NetBSD compatibility extensions on Minix. */
|
|
||||||
#ifndef _NETBSD_SOURCE
|
|
||||||
# undef _NETBSD_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable OpenBSD compatibility extensions on NetBSD.
|
|
||||||
Oddly enough, this does nothing on OpenBSD. */
|
|
||||||
#ifndef _OPENBSD_SOURCE
|
|
||||||
# undef _OPENBSD_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Define to 1 if needed for POSIX-compatible behavior. */
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
# undef _POSIX_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Define to 2 if needed for POSIX-compatible behavior. */
|
|
||||||
#ifndef _POSIX_1_SOURCE
|
|
||||||
# undef _POSIX_1_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable POSIX-compatible threading on Solaris. */
|
|
||||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
# undef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_BFP_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_DFP_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by C23 Annex F. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
|
|
||||||
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
|
|
||||||
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
|
|
||||||
#ifndef __STDC_WANT_LIB_EXT2__
|
|
||||||
# undef __STDC_WANT_LIB_EXT2__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions specified by ISO/IEC 24747:2009. */
|
|
||||||
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
|
|
||||||
# undef __STDC_WANT_MATH_SPEC_FUNCS__
|
|
||||||
#endif
|
|
||||||
/* Enable extensions on HP NonStop. */
|
|
||||||
#ifndef _TANDEM_SOURCE
|
|
||||||
# undef _TANDEM_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable X/Open extensions. Define to 500 only if necessary
|
|
||||||
to make mbstate_t available. */
|
|
||||||
#ifndef _XOPEN_SOURCE
|
|
||||||
# undef _XOPEN_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* in_port_t */
|
|
||||||
#undef in_port_t
|
|
||||||
|
|
||||||
/* sa_family_t */
|
|
||||||
#undef sa_family_t
|
|
||||||
2354
config.sub
vendored
2354
config.sub
vendored
File diff suppressed because it is too large
Load Diff
26
configure.ac
26
configure.ac
@@ -1,6 +1,6 @@
|
|||||||
AC_PREREQ([2.71])
|
AC_PREREQ([2.71])
|
||||||
|
|
||||||
AC_INIT([httrack], [3.49.8], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
|
AC_INIT([httrack], [3.49.11], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
|
||||||
AC_COPYRIGHT([
|
AC_COPYRIGHT([
|
||||||
HTTrack Website Copier, Offline Browser for Windows and Unix
|
HTTrack Website Copier, Offline Browser for Windows and Unix
|
||||||
Copyright (C) 1998-2015 Xavier Roche and other contributors
|
Copyright (C) 1998-2015 Xavier Roche and other contributors
|
||||||
@@ -29,7 +29,11 @@ AC_CONFIG_SRCDIR(src/httrack.c)
|
|||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
AC_CONFIG_HEADERS(config.h)
|
AC_CONFIG_HEADERS(config.h)
|
||||||
AM_INIT_AUTOMAKE([subdir-objects])
|
AM_INIT_AUTOMAKE([subdir-objects])
|
||||||
VERSION_INFO="2:49:0"
|
# 3:3:0: 3.49.11 only adds enum values, macros and inline helpers to the
|
||||||
|
# installed headers (no struct layout or exported signature changed vs
|
||||||
|
# 3.49.10), so it stays soname .so.3; bump revision.
|
||||||
|
# (3:0:0 was the htsblk mime-buffer widening, the ABI break that moved .so.2 -> .so.3.)
|
||||||
|
VERSION_INFO="3:3:0"
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
|
|
||||||
@@ -60,6 +64,16 @@ AC_SUBST(LT_CV_OBJDIR,$lt_cv_objdir)
|
|||||||
# Export version info
|
# Export version info
|
||||||
AC_SUBST(VERSION_INFO)
|
AC_SUBST(VERSION_INFO)
|
||||||
|
|
||||||
|
# Versioned plugin name for dlopen() in hts_create_opt(); soname major is
|
||||||
|
# libtool's current - age, so this tracks VERSION_INFO bumps automatically.
|
||||||
|
HTS_SONAME_MAJOR=$((${VERSION_INFO%%:*} - ${VERSION_INFO##*:}))
|
||||||
|
case "$host_os" in
|
||||||
|
darwin*) HTS_LIBHTSJAVA_NAME="libhtsjava.$HTS_SONAME_MAJOR.dylib" ;;
|
||||||
|
*) HTS_LIBHTSJAVA_NAME="libhtsjava.so.$HTS_SONAME_MAJOR" ;;
|
||||||
|
esac
|
||||||
|
AC_DEFINE_UNQUOTED([HTS_LIBHTSJAVA_NAME], ["$HTS_LIBHTSJAVA_NAME"],
|
||||||
|
[Versioned libhtsjava runtime name, derived from VERSION_INFO])
|
||||||
|
|
||||||
### Default CFLAGS
|
### Default CFLAGS
|
||||||
DEFAULT_CFLAGS="-Wall -Wformat -Wformat-security \
|
DEFAULT_CFLAGS="-Wall -Wformat -Wformat-security \
|
||||||
-Wmultichar -Wwrite-strings -Wcast-qual -Wcast-align \
|
-Wmultichar -Wwrite-strings -Wcast-qual -Wcast-align \
|
||||||
@@ -82,6 +96,11 @@ AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -W
|
|||||||
AX_CHECK_COMPILE_FLAG([-Wmissing-parameter-type], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wmissing-parameter-type"])
|
AX_CHECK_COMPILE_FLAG([-Wmissing-parameter-type], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wmissing-parameter-type"])
|
||||||
AX_CHECK_COMPILE_FLAG([-Wold-style-definition], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wold-style-definition"])
|
AX_CHECK_COMPILE_FLAG([-Wold-style-definition], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wold-style-definition"])
|
||||||
AX_CHECK_COMPILE_FLAG([-Wignored-qualifiers], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wignored-qualifiers"])
|
AX_CHECK_COMPILE_FLAG([-Wignored-qualifiers], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wignored-qualifiers"])
|
||||||
|
# Make htssafe.h's pointer-dest 'warning' attribute a hard error in our build
|
||||||
|
# (migration is at zero; a new char* dest is a regression). gcc/clang each take
|
||||||
|
# only their own spelling; downstream keeps the plain warning, not a build break.
|
||||||
|
AX_CHECK_COMPILE_FLAG([-Werror=attribute-warning], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Werror=attribute-warning"])
|
||||||
|
AX_CHECK_COMPILE_FLAG([-Werror=user-defined-warnings], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Werror=user-defined-warnings"])
|
||||||
AX_CHECK_COMPILE_FLAG([-fstrict-aliasing -Wstrict-aliasing], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing"])
|
AX_CHECK_COMPILE_FLAG([-fstrict-aliasing -Wstrict-aliasing], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing"])
|
||||||
AX_CHECK_COMPILE_FLAG([-fstack-protector], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstack-protector"])
|
AX_CHECK_COMPILE_FLAG([-fstack-protector], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstack-protector"])
|
||||||
AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstack-clash-protection"])
|
AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstack-clash-protection"])
|
||||||
@@ -207,9 +226,12 @@ AC_SUBST(OPENSSL_LIBS)
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
### Support IPv6
|
### Support IPv6
|
||||||
|
V6_SUPPORT=no
|
||||||
AC_CHECK_LIB(c, getaddrinfo, [V6_FLAG="-DINET6"
|
AC_CHECK_LIB(c, getaddrinfo, [V6_FLAG="-DINET6"
|
||||||
|
V6_SUPPORT=yes
|
||||||
AC_DEFINE(HTS_INET6, 1, [Check for IPv6])], AC_MSG_WARN([*** IPv6 not found IPv6 compatibility disabled]))
|
AC_DEFINE(HTS_INET6, 1, [Check for IPv6])], AC_MSG_WARN([*** IPv6 not found IPv6 compatibility disabled]))
|
||||||
AC_SUBST(V6_FLAG)
|
AC_SUBST(V6_FLAG)
|
||||||
|
AC_SUBST(V6_SUPPORT)
|
||||||
|
|
||||||
### Check for LFS
|
### Check for LFS
|
||||||
AC_CHECK_LIB(c, fopen64, [LFS_FLAG="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
|
AC_CHECK_LIB(c, fopen64, [LFS_FLAG="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
|
||||||
|
|||||||
65
debian/changelog
vendored
65
debian/changelog
vendored
@@ -1,6 +1,67 @@
|
|||||||
|
httrack (3.49.11-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream release: crawl correctness and security fixes (network-facing
|
||||||
|
buffer overflows, file-type detection, redirect handling) and modernized
|
||||||
|
web defaults; full list in history.txt.
|
||||||
|
* Add DEP-12 upstream metadata (#466).
|
||||||
|
* Bump debhelper compat to 14 (#466).
|
||||||
|
* Drop the redundant Priority field and update the NMU lintian override to
|
||||||
|
the current tag names (#466).
|
||||||
|
|
||||||
|
-- Xavier Roche <xavier@debian.org> Sun, 05 Jul 2026 00:03:18 +0200
|
||||||
|
|
||||||
|
httrack (3.49.10-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Fix FTBFS: tests/28_local-pause failed instead of skipping when python3 is
|
||||||
|
absent (the local-server tests need python3, which the buildds lack). Add
|
||||||
|
patches/skip-local-pause-test-without-python3.patch to guard the test on
|
||||||
|
python3 up front, like its siblings, so it skips cleanly.
|
||||||
|
|
||||||
|
-- Xavier Roche <xavier@debian.org> Sun, 28 Jun 2026 20:18:46 +0200
|
||||||
|
|
||||||
|
httrack (3.49.10-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream release: new download-pacing and URL-handling options plus a
|
||||||
|
batch of crawl and robustness fixes (full list in history.txt).
|
||||||
|
* Rewrite debian/copyright in machine-readable DEP-5 format, crediting the
|
||||||
|
bundled minizip, md5 and coucal sources (#415).
|
||||||
|
* Lead the webhttrack browser dependency with chromium so httrack is not
|
||||||
|
dragged into the firefox-esr autoremoval cascade (#436).
|
||||||
|
* Override the embedded-library lint for the bundled minizip (#419).
|
||||||
|
* Bump Standards-Version to 4.7.4 (no changes required).
|
||||||
|
|
||||||
|
-- Xavier Roche <xavier@debian.org> Sun, 28 Jun 2026 14:01:53 +0200
|
||||||
|
|
||||||
|
httrack (3.49.9-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream release: Content-Type and file-type detection fixes (trust a
|
||||||
|
declared Content-Type over a binary URL extension, honor --assume under the
|
||||||
|
delayed type check, keep a known extension against a bogus or empty
|
||||||
|
Content-Type, and avoid an uninitialised read on an empty Content-Type), and
|
||||||
|
restored C++ source-compatibility of the installed headers so reverse
|
||||||
|
dependencies (httraqt) build again.
|
||||||
|
|
||||||
|
-- Xavier Roche <xavier@debian.org> Sun, 21 Jun 2026 17:59:38 +0200
|
||||||
|
|
||||||
|
httrack (3.49.8-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Rename libhttrack2 to libhttrack3 to follow the SONAME, which the 3.49.8
|
||||||
|
ABI bump moved to libhttrack.so.3 (package-name-doesnt-match-sonames). In
|
||||||
|
3.49.8-1 the libhttrack2.files glob still matched .so.2, so the runtime
|
||||||
|
libraries fell through into the httrack package and libhttrack2 shipped no
|
||||||
|
library. The new .files uses a .so.3* wildcard so a future SONAME bump no
|
||||||
|
longer silently misplaces the libraries. New binary package, via NEW.
|
||||||
|
* Drop the stale debian/libhttrack-swf1.files: the swf module is no longer
|
||||||
|
built and no libhttrack-swf1 package exists.
|
||||||
|
|
||||||
|
-- Xavier Roche <xavier@debian.org> Sat, 20 Jun 2026 14:42:13 +0200
|
||||||
|
|
||||||
httrack (3.49.8-1) unstable; urgency=medium
|
httrack (3.49.8-1) unstable; urgency=medium
|
||||||
|
|
||||||
* New upstream release.
|
* New upstream release: HTTPS-proxy CONNECT tunnelling and wider srcset
|
||||||
|
parsing, a batch of crawler and parser fixes (CSS @import, xmlns
|
||||||
|
namespaces, relative paths, RFC 6265 cookies), and security hardening of
|
||||||
|
the parser and of buffer copies throughout the engine.
|
||||||
* Drop the OpenSSL linking exception from the license: OpenSSL 3.0+ is
|
* Drop the OpenSSL linking exception from the license: OpenSSL 3.0+ is
|
||||||
Apache-2.0 and GPL-compatible, so it is no longer needed. httrack is now
|
Apache-2.0 and GPL-compatible, so it is no longer needed. httrack is now
|
||||||
plain GPL-3.0-or-later. Updated debian/copyright accordingly.
|
plain GPL-3.0-or-later. Updated debian/copyright accordingly.
|
||||||
@@ -14,7 +75,7 @@ httrack (3.49.8-1) unstable; urgency=medium
|
|||||||
the QA debcheck page. Depend on firefox-esr | chromium | www-browser
|
the QA debcheck page. Depend on firefox-esr | chromium | www-browser
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
-- Xavier Roche <xavier@debian.org> Sun, 07 Jun 2026 14:29:24 +0200
|
-- Xavier Roche <xavier@debian.org> Sat, 20 Jun 2026 13:02:08 +0200
|
||||||
|
|
||||||
httrack (3.49.7-2) unstable; urgency=medium
|
httrack (3.49.7-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
|||||||
13
debian/control
vendored
13
debian/control
vendored
@@ -1,9 +1,8 @@
|
|||||||
Source: httrack
|
Source: httrack
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
|
||||||
Maintainer: Xavier Roche <roche@httrack.com>
|
Maintainer: Xavier Roche <roche@httrack.com>
|
||||||
Standards-Version: 4.7.0
|
Standards-Version: 4.7.4
|
||||||
Build-Depends: debhelper-compat (= 13), autoconf, autoconf-archive, automake, libtool, zlib1g-dev, libssl-dev
|
Build-Depends: debhelper-compat (= 14), autoconf, autoconf-archive, automake, libtool, zlib1g-dev, libssl-dev
|
||||||
Rules-Requires-Root: no
|
Rules-Requires-Root: no
|
||||||
Homepage: http://www.httrack.com
|
Homepage: http://www.httrack.com
|
||||||
Vcs-Git: https://github.com/xroche/httrack.git
|
Vcs-Git: https://github.com/xroche/httrack.git
|
||||||
@@ -30,7 +29,7 @@ Description: Copy websites to your computer (Offline browser)
|
|||||||
Package: webhttrack
|
Package: webhttrack
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Multi-Arch: foreign
|
Multi-Arch: foreign
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}, webhttrack-common, sensible-utils, firefox-esr | chromium | www-browser
|
Depends: ${misc:Depends}, ${shlibs:Depends}, webhttrack-common, sensible-utils, chromium | firefox-esr | www-browser
|
||||||
Replaces: webhttrack-common (<< 3.43.9-2)
|
Replaces: webhttrack-common (<< 3.43.9-2)
|
||||||
Breaks: webhttrack-common (<< 3.43.9-2)
|
Breaks: webhttrack-common (<< 3.43.9-2)
|
||||||
Suggests: httrack, httrack-doc
|
Suggests: httrack, httrack-doc
|
||||||
@@ -58,13 +57,13 @@ Description: webhttrack common files
|
|||||||
This package is the common files of webhttrack, website copier and
|
This package is the common files of webhttrack, website copier and
|
||||||
mirroring utility
|
mirroring utility
|
||||||
|
|
||||||
Package: libhttrack2
|
Package: libhttrack3
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Multi-Arch: same
|
Multi-Arch: same
|
||||||
Section: libs
|
Section: libs
|
||||||
Replaces: libhttrack1
|
|
||||||
Conflicts: libhttrack1
|
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
Replaces: libhttrack2, httrack (<< 3.49.8-2~)
|
||||||
|
Breaks: libhttrack2, httrack (<< 3.49.8-2~)
|
||||||
Description: Httrack website copier library
|
Description: Httrack website copier library
|
||||||
This package is the library part of httrack, website copier and mirroring
|
This package is the library part of httrack, website copier and mirroring
|
||||||
utility
|
utility
|
||||||
|
|||||||
118
debian/copyright
vendored
118
debian/copyright
vendored
@@ -1,21 +1,109 @@
|
|||||||
This package was debianized by Xavier Roche <roche@httrack.com> on
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Fri, 27 Sep 2002 16:42:26 +0200
|
Upstream-Name: httrack
|
||||||
|
Upstream-Contact: Xavier Roche <roche@httrack.com>
|
||||||
|
Source: https://www.httrack.com/
|
||||||
|
|
||||||
The current Debian maintainer is Xavier Roche <xavier@debian.org>
|
Files: *
|
||||||
|
Copyright: 1998-2026 Xavier Roche and other contributors
|
||||||
|
License: GPL-3+
|
||||||
|
Comment:
|
||||||
|
The engine includes contributions from Yann Philippot (src/htsjava.c,
|
||||||
|
src/htsjava.h). htsbasenet.h links against the system OpenSSL library
|
||||||
|
(originally by Eric Young); no OpenSSL/SSLeay code is bundled here.
|
||||||
|
|
||||||
Upstream author: Xavier Roche <roche@httrack.com>
|
Files: src/minizip/*
|
||||||
|
Copyright: 1998-2010 Gilles Vollant
|
||||||
|
2007-2008 Even Rouault
|
||||||
|
2009-2010 Mathias Svensson
|
||||||
|
1990-2000 Info-ZIP
|
||||||
|
License: Zlib
|
||||||
|
Comment:
|
||||||
|
The decryption code in src/minizip/crypt.h and src/minizip/unzip.c derives
|
||||||
|
from the Info-ZIP distribution, distributed under the same terms.
|
||||||
|
|
||||||
Copyright: 1998-2014 Xavier Roche and other contributors
|
Files: src/md5.c
|
||||||
|
Copyright: 1993 Colin Plumb
|
||||||
|
License: public-domain-md5
|
||||||
|
This code implements the MD5 message-digest algorithm, due to Ron Rivest.
|
||||||
|
It was written by Colin Plumb in 1993, no copyright is claimed. This code
|
||||||
|
is in the public domain; do with it what you wish.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
Files: src/coucal/*
|
||||||
it under the terms of the GNU General Public License as published by
|
Copyright: 2013-2014 Xavier Roche
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
License: BSD-3-clause
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
On Debian systems, the complete text of the GNU General Public
|
Files: src/coucal/murmurhash3.h*
|
||||||
License version 3 can be found in /usr/share/common-licenses/GPL-3 file.
|
Copyright: Austin Appleby
|
||||||
|
License: public-domain-murmurhash3
|
||||||
|
MurmurHash3 was written by Austin Appleby, and is placed in the public
|
||||||
|
domain. The author hereby disclaims copyright to this source code.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
Files: html/server/div/com.httrack.WebHTTrack.metainfo.xml
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Copyright: 1998-2026 Xavier Roche and other contributors
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
License: FSFAP
|
||||||
GNU General Public License for more details.
|
Copying and distribution of this file, with or without modification, are
|
||||||
|
permitted in any medium without royalty provided the copyright notice and
|
||||||
|
this notice are preserved. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2002-2026 Xavier Roche <xavier@debian.org>
|
||||||
|
License: GPL-3+
|
||||||
|
|
||||||
|
License: GPL-3+
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
.
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
.
|
||||||
|
On Debian systems, the complete text of the GNU General Public License
|
||||||
|
version 3 can be found in /usr/share/common-licenses/GPL-3.
|
||||||
|
|
||||||
|
License: Zlib
|
||||||
|
This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
In no event will the authors be held liable for any damages arising from the
|
||||||
|
use of this software.
|
||||||
|
.
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
.
|
||||||
|
1. The origin of this software must not be misrepresented; you must not claim
|
||||||
|
that you wrote the original software. If you use this software in a product,
|
||||||
|
an acknowledgment in the product documentation would be appreciated but is
|
||||||
|
not required.
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
License: BSD-3-clause
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
.
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|||||||
3
debian/httrack-doc.lintian-overrides
vendored
3
debian/httrack-doc.lintian-overrides
vendored
@@ -4,3 +4,6 @@
|
|||||||
# so the path lives in the display pointer, not the override -- match with '*'.
|
# so the path lives in the display pointer, not the override -- match with '*'.
|
||||||
httrack-doc: extra-license-file *
|
httrack-doc: extra-license-file *
|
||||||
httrack-doc: package-contains-documentation-outside-usr-share-doc *
|
httrack-doc: package-contains-documentation-outside-usr-share-doc *
|
||||||
|
# search.sh is a sample CGI shipped alongside the HTML manual, not meant to be
|
||||||
|
# run from the package tree; it stays non-executable by design.
|
||||||
|
httrack-doc: script-not-executable *
|
||||||
|
|||||||
2
debian/libhttrack-swf1.files
vendored
2
debian/libhttrack-swf1.files
vendored
@@ -1,2 +0,0 @@
|
|||||||
usr/lib/*/libhtsswf.so.1.0.0
|
|
||||||
usr/lib/*/libhtsswf.so.1
|
|
||||||
5
debian/libhttrack2.files
vendored
5
debian/libhttrack2.files
vendored
@@ -1,5 +0,0 @@
|
|||||||
usr/lib/*/libhttrack.so.2.0.49
|
|
||||||
usr/lib/*/libhttrack.so.2
|
|
||||||
usr/lib/*/libhtsjava.so.2.0.49
|
|
||||||
usr/lib/*/libhtsjava.so.2
|
|
||||||
usr/share/httrack/templates
|
|
||||||
3
debian/libhttrack2.lintian-overrides
vendored
3
debian/libhttrack2.lintian-overrides
vendored
@@ -1,3 +0,0 @@
|
|||||||
# The shared libraries ship without a versioned symbols control file (ABI is
|
|
||||||
# tracked via the SONAME and a strict =version dependency, see debian/rules).
|
|
||||||
libhttrack2: no-symbols-control-file usr/lib/*
|
|
||||||
3
debian/libhttrack3.files
vendored
Normal file
3
debian/libhttrack3.files
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
usr/lib/*/libhttrack.so.3*
|
||||||
|
usr/lib/*/libhtsjava.so.3*
|
||||||
|
usr/share/httrack/templates
|
||||||
8
debian/libhttrack3.lintian-overrides
vendored
Normal file
8
debian/libhttrack3.lintian-overrides
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# The shared libraries ship without a versioned symbols control file (ABI is
|
||||||
|
# tracked via the SONAME plus a >= upstream-version dependency, see debian/rules).
|
||||||
|
libhttrack3: no-symbols-control-file usr/lib/*
|
||||||
|
|
||||||
|
# Bundled, locally patched minizip (src/minizip): it adds a zipFlush() API the
|
||||||
|
# system libminizip lacks (htscache.c flushes the cache .zip so an interrupted
|
||||||
|
# crawl leaves a valid archive), plus Android/old-zlib portability fixes.
|
||||||
|
libhttrack3: embedded-library *libminizip*
|
||||||
3
debian/proxytrack.lintian-overrides
vendored
Normal file
3
debian/proxytrack.lintian-overrides
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Statically linked against httrack's bundled, patched minizip (see src/minizip
|
||||||
|
# and libhttrack3's override): the zipFlush() API is absent from the system one.
|
||||||
|
proxytrack: embedded-library *libminizip*
|
||||||
2
debian/rules
vendored
2
debian/rules
vendored
@@ -135,7 +135,7 @@ binary-arch: build install
|
|||||||
dh_makeshlibs -a -X/usr/lib/$(DEB_HOST_MULTIARCH)/httrack/libtest --version-info
|
dh_makeshlibs -a -X/usr/lib/$(DEB_HOST_MULTIARCH)/httrack/libtest --version-info
|
||||||
dh_installdeb -a
|
dh_installdeb -a
|
||||||
# we depend on the current version (ABI may change)
|
# we depend on the current version (ABI may change)
|
||||||
dh_shlibdeps -a -ldebian/libhttrack2/usr/lib/$(DEB_HOST_MULTIARCH)
|
dh_shlibdeps -a -ldebian/libhttrack3/usr/lib/$(DEB_HOST_MULTIARCH)
|
||||||
dh_gencontrol -a
|
dh_gencontrol -a
|
||||||
dh_md5sums -a
|
dh_md5sums -a
|
||||||
dh_builddeb -a
|
dh_builddeb -a
|
||||||
|
|||||||
4
debian/source/lintian-overrides
vendored
4
debian/source/lintian-overrides
vendored
@@ -1,4 +1,6 @@
|
|||||||
httrack source: changelog-should-mention-nmu
|
# Maintainer uploads sign the changelog as xavier@debian.org while the control
|
||||||
|
# Maintainer is roche@httrack.com; lintian reads the address mismatch as an NMU.
|
||||||
|
httrack source: no-nmu-in-changelog
|
||||||
httrack source: source-nmu-has-incorrect-version-number
|
httrack source: source-nmu-has-incorrect-version-number
|
||||||
|
|
||||||
# The bundled HTML pages are the genuine upstream documentation taken from
|
# The bundled HTML pages are the genuine upstream documentation taken from
|
||||||
|
|||||||
6
debian/upstream/metadata
vendored
Normal file
6
debian/upstream/metadata
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
Repository: https://github.com/xroche/httrack.git
|
||||||
|
Repository-Browse: https://github.com/xroche/httrack
|
||||||
|
Bug-Database: https://github.com/xroche/httrack/issues
|
||||||
|
Bug-Submit: https://github.com/xroche/httrack/issues/new
|
||||||
|
Contact: Xavier Roche <roche@httrack.com>
|
||||||
792
depcomp
792
depcomp
@@ -1,792 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# depcomp - compile a program generating dependencies as side-effects
|
|
||||||
|
|
||||||
scriptversion=2024-06-19.01; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
'')
|
|
||||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
|
||||||
exit 1;
|
|
||||||
;;
|
|
||||||
-h | --h*)
|
|
||||||
cat <<\EOF
|
|
||||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
|
||||||
|
|
||||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
|
||||||
as side-effects.
|
|
||||||
|
|
||||||
Environment variables:
|
|
||||||
depmode Dependency tracking mode.
|
|
||||||
source Source file read by 'PROGRAMS ARGS'.
|
|
||||||
object Object file output by 'PROGRAMS ARGS'.
|
|
||||||
DEPDIR directory where to store dependencies.
|
|
||||||
depfile Dependency file to output.
|
|
||||||
tmpdepfile Temporary file to use when outputting dependencies.
|
|
||||||
libtool Whether libtool is used (yes/no).
|
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
|
||||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
|
||||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
|
||||||
EOF
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
-v | --v*)
|
|
||||||
echo "depcomp (GNU Automake) $scriptversion"
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Get the directory component of the given path, and save it in the
|
|
||||||
# global variables '$dir'. Note that this directory component will
|
|
||||||
# be either empty or ending with a '/' character. This is deliberate.
|
|
||||||
set_dir_from ()
|
|
||||||
{
|
|
||||||
case $1 in
|
|
||||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
|
||||||
*) dir=;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get the suffix-stripped basename of the given path, and save it the
|
|
||||||
# global variable '$base'.
|
|
||||||
set_base_from ()
|
|
||||||
{
|
|
||||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
|
||||||
}
|
|
||||||
|
|
||||||
# If no dependency file was actually created by the compiler invocation,
|
|
||||||
# we still have to create a dummy depfile, to avoid errors with the
|
|
||||||
# Makefile "include basename.Plo" scheme.
|
|
||||||
make_dummy_depfile ()
|
|
||||||
{
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Factor out some common post-processing of the generated depfile.
|
|
||||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
|
||||||
aix_post_process_depfile ()
|
|
||||||
{
|
|
||||||
# If the compiler actually managed to produce a dependency file,
|
|
||||||
# post-process it.
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
# Each line is of the form 'foo.o: dependency.h'.
|
|
||||||
# Do two passes, one to just change these to
|
|
||||||
# $object: dependency.h
|
|
||||||
# and one to simply output
|
|
||||||
# dependency.h:
|
|
||||||
# which is needed to avoid the deleted-header problem.
|
|
||||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
|
||||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
|
||||||
} > "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
else
|
|
||||||
make_dummy_depfile
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# A tabulation character.
|
|
||||||
tab=' '
|
|
||||||
# A newline character.
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
# Character ranges might be problematic outside the C locale.
|
|
||||||
# These definitions help.
|
|
||||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
||||||
lower=abcdefghijklmnopqrstuvwxyz
|
|
||||||
alpha=${upper}${lower}
|
|
||||||
|
|
||||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
|
||||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
|
||||||
depfile=${depfile-`echo "$object" |
|
|
||||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
|
||||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|
||||||
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
|
|
||||||
# Avoid interference from the environment.
|
|
||||||
gccflag= dashmflag=
|
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
|
||||||
# parameterize here, but still list the modes in the big case below,
|
|
||||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
|
||||||
# here, because this file can only contain one case statement.
|
|
||||||
if test "$depmode" = hp; then
|
|
||||||
# HP compiler uses -M and no extra arg.
|
|
||||||
gccflag=-M
|
|
||||||
depmode=gcc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = dashXmstdout; then
|
|
||||||
# This is just like dashmstdout with a different argument.
|
|
||||||
dashmflag=-xM
|
|
||||||
depmode=dashmstdout
|
|
||||||
fi
|
|
||||||
|
|
||||||
cygpath_u="cygpath -u -f -"
|
|
||||||
if test "$depmode" = msvcmsys; then
|
|
||||||
# This is just like msvisualcpp but w/o cygpath translation.
|
|
||||||
# Just convert the backslash-escaped backslashes to single forward
|
|
||||||
# slashes to satisfy depend.m4
|
|
||||||
cygpath_u='sed s,\\\\,/,g'
|
|
||||||
depmode=msvisualcpp
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = msvc7msys; then
|
|
||||||
# This is just like msvc7 but w/o cygpath translation.
|
|
||||||
# Just convert the backslash-escaped backslashes to single forward
|
|
||||||
# slashes to satisfy depend.m4
|
|
||||||
cygpath_u='sed s,\\\\,/,g'
|
|
||||||
depmode=msvc7
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = xlc; then
|
|
||||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
|
||||||
gccflag=-qmakedep=gcc,-MF
|
|
||||||
depmode=gcc
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$depmode" in
|
|
||||||
gcc3)
|
|
||||||
## gcc 3 implements dependency tracking that does exactly what
|
|
||||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
|
||||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
|
||||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
|
||||||
## the command line argument order; so add the flags where they
|
|
||||||
## appear in depend2.am. Note that the slowdown incurred here
|
|
||||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case $arg in
|
|
||||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
|
||||||
*) set fnord "$@" "$arg" ;;
|
|
||||||
esac
|
|
||||||
shift # fnord
|
|
||||||
shift # $arg
|
|
||||||
done
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
mv "$tmpdepfile" "$depfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
gcc)
|
|
||||||
## Note that this doesn't just cater to obsolete pre-3.x GCC compilers.
|
|
||||||
## but also to in-use compilers like IBM xlc/xlC and the HP C compiler.
|
|
||||||
## (see the conditional assignment to $gccflag above).
|
|
||||||
## There are various ways to get dependency output from gcc. Here's
|
|
||||||
## why we pick this rather obscure method:
|
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
|
||||||
## up in a subdir. Having to rename by hand is ugly.
|
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
|
||||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
|
||||||
## supported by the other compilers which use the 'gcc' depmode.
|
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
|
||||||
## than renaming).
|
|
||||||
if test -z "$gccflag"; then
|
|
||||||
gccflag=-MD,
|
|
||||||
fi
|
|
||||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
# The second -e expression handles DOS-style file names with drive
|
|
||||||
# letters.
|
|
||||||
sed -e 's/^[^:]*: / /' \
|
|
||||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
|
||||||
## This next piece of magic avoids the "deleted header file" problem.
|
|
||||||
## The problem is that when a header file which appears in a .P file
|
|
||||||
## is deleted, the dependency causes make to die (because there is
|
|
||||||
## typically no way to rebuild the header). We avoid this by adding
|
|
||||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
|
||||||
## this for us directly.
|
|
||||||
## Some versions of gcc put a space before the ':'. On the theory
|
|
||||||
## that the space means something, we add a space to the output as
|
|
||||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
|
||||||
## to the object. Take care to not repeat it in the output.
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
hp)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
sgi)
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
|
||||||
else
|
|
||||||
"$@" -MDupdate "$tmpdepfile"
|
|
||||||
fi
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
# Clip off the initial element (the dependent). Don't try to be
|
|
||||||
# clever and replace this with sed code, as IRIX sed won't handle
|
|
||||||
# lines with more than a fixed number of characters (4096 in
|
|
||||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
|
||||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
|
||||||
# dependency line.
|
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
|
||||||
| tr "$nl" ' ' >> "$depfile"
|
|
||||||
echo >> "$depfile"
|
|
||||||
# The second pass generates a dummy entry for each header file.
|
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
|
||||||
>> "$depfile"
|
|
||||||
else
|
|
||||||
make_dummy_depfile
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
xlc)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
aix)
|
|
||||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
|
||||||
# in a .u file. In older versions, this file always lives in the
|
|
||||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
|
||||||
# start of each line; $object doesn't have directory information.
|
|
||||||
# Version 6 uses the directory in both cases.
|
|
||||||
set_dir_from "$object"
|
|
||||||
set_base_from "$object"
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
tmpdepfile1=$dir$base.u
|
|
||||||
tmpdepfile2=$base.u
|
|
||||||
tmpdepfile3=$dir.libs/$base.u
|
|
||||||
"$@" -Wc,-M
|
|
||||||
else
|
|
||||||
tmpdepfile1=$dir$base.u
|
|
||||||
tmpdepfile2=$dir$base.u
|
|
||||||
tmpdepfile3=$dir$base.u
|
|
||||||
"$@" -M
|
|
||||||
fi
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
|
||||||
do
|
|
||||||
test -f "$tmpdepfile" && break
|
|
||||||
done
|
|
||||||
aix_post_process_depfile
|
|
||||||
;;
|
|
||||||
|
|
||||||
tcc)
|
|
||||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
|
||||||
# FIXME: That version still under development at the moment of writing.
|
|
||||||
# Make that this statement remains true also for stable, released
|
|
||||||
# versions.
|
|
||||||
# It will wrap lines (doesn't matter whether long or short) with a
|
|
||||||
# trailing '\', as in:
|
|
||||||
#
|
|
||||||
# foo.o : \
|
|
||||||
# foo.c \
|
|
||||||
# foo.h \
|
|
||||||
#
|
|
||||||
# It will put a trailing '\' even on the last line, and will use leading
|
|
||||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
|
||||||
# "Emit spaces for -MD").
|
|
||||||
"$@" -MD -MF "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
|
||||||
# We have to change lines of the first kind to '$object: \'.
|
|
||||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
|
||||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
|
||||||
# dummy dependency, to avoid the deleted-header problem.
|
|
||||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
## The order of this option in the case statement is important, since the
|
|
||||||
## shell code in configure will try each of these formats in the order
|
|
||||||
## listed in this file. A plain '-MD' option would be understood by many
|
|
||||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
|
||||||
pgcc)
|
|
||||||
# Portland's C compiler understands '-MD'.
|
|
||||||
# Will always output deps to 'file.d' where file is the root name of the
|
|
||||||
# source file under compilation, even if file resides in a subdirectory.
|
|
||||||
# The object file name does not affect the name of the '.d' file.
|
|
||||||
# pgcc 10.2 will output
|
|
||||||
# foo.o: sub/foo.c sub/foo.h
|
|
||||||
# and will wrap long lines using '\' :
|
|
||||||
# foo.o: sub/foo.c ... \
|
|
||||||
# sub/foo.h ... \
|
|
||||||
# ...
|
|
||||||
set_dir_from "$object"
|
|
||||||
# Use the source, not the object, to determine the base name, since
|
|
||||||
# that's sadly what pgcc will do too.
|
|
||||||
set_base_from "$source"
|
|
||||||
tmpdepfile=$base.d
|
|
||||||
|
|
||||||
# For projects that build the same source file twice into different object
|
|
||||||
# files, the pgcc approach of using the *source* file root name can cause
|
|
||||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
|
||||||
# the same $tmpdepfile.
|
|
||||||
lockdir=$base.d-lock
|
|
||||||
trap "
|
|
||||||
echo '$0: caught signal, cleaning up...' >&2
|
|
||||||
rmdir '$lockdir'
|
|
||||||
exit 1
|
|
||||||
" 1 2 13 15
|
|
||||||
numtries=100
|
|
||||||
i=$numtries
|
|
||||||
while test $i -gt 0; do
|
|
||||||
# mkdir is a portable test-and-set.
|
|
||||||
if mkdir "$lockdir" 2>/dev/null; then
|
|
||||||
# This process acquired the lock.
|
|
||||||
"$@" -MD
|
|
||||||
stat=$?
|
|
||||||
# Release the lock.
|
|
||||||
rmdir "$lockdir"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
# If the lock is being held by a different process, wait
|
|
||||||
# until the winning process is done or we timeout.
|
|
||||||
while test -d "$lockdir" && test $i -gt 0; do
|
|
||||||
sleep 1
|
|
||||||
i=`expr $i - 1`
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
i=`expr $i - 1`
|
|
||||||
done
|
|
||||||
trap - 1 2 13 15
|
|
||||||
if test $i -le 0; then
|
|
||||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
|
||||||
echo "$0: check lockdir '$lockdir'" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
# Each line is of the form `foo.o: dependent.h',
|
|
||||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
|
||||||
# Do two passes, one to just change these to
|
|
||||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
|
||||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
|
||||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
hp2)
|
|
||||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
|
||||||
# compilers, which have integrated preprocessors. The correct option
|
|
||||||
# to use with these is +Maked; it writes dependencies to a file named
|
|
||||||
# 'foo.d', which lands next to the object file, wherever that
|
|
||||||
# happens to be.
|
|
||||||
# Much of this is similar to the tru64 case; see comments there.
|
|
||||||
set_dir_from "$object"
|
|
||||||
set_base_from "$object"
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
tmpdepfile1=$dir$base.d
|
|
||||||
tmpdepfile2=$dir.libs/$base.d
|
|
||||||
"$@" -Wc,+Maked
|
|
||||||
else
|
|
||||||
tmpdepfile1=$dir$base.d
|
|
||||||
tmpdepfile2=$dir$base.d
|
|
||||||
"$@" +Maked
|
|
||||||
fi
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
|
||||||
do
|
|
||||||
test -f "$tmpdepfile" && break
|
|
||||||
done
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
|
||||||
# Add 'dependent.h:' lines.
|
|
||||||
sed -ne '2,${
|
|
||||||
s/^ *//
|
|
||||||
s/ \\*$//
|
|
||||||
s/$/:/
|
|
||||||
p
|
|
||||||
}' "$tmpdepfile" >> "$depfile"
|
|
||||||
else
|
|
||||||
make_dummy_depfile
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
|
||||||
;;
|
|
||||||
|
|
||||||
tru64)
|
|
||||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
|
||||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
|
||||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
|
||||||
# dependencies in 'foo.d' instead, so we check for that too.
|
|
||||||
# Subdirectories are respected.
|
|
||||||
set_dir_from "$object"
|
|
||||||
set_base_from "$object"
|
|
||||||
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
|
||||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
|
||||||
# in $dir$base.o.d. We have to check for both files, because
|
|
||||||
# one of the two compilations can be disabled. We should prefer
|
|
||||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
|
||||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
|
||||||
# the former would cause a distcleancheck panic.
|
|
||||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
|
||||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
|
||||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
|
||||||
"$@" -Wc,-MD
|
|
||||||
else
|
|
||||||
tmpdepfile1=$dir$base.d
|
|
||||||
tmpdepfile2=$dir$base.d
|
|
||||||
tmpdepfile3=$dir$base.d
|
|
||||||
"$@" -MD
|
|
||||||
fi
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
|
||||||
do
|
|
||||||
test -f "$tmpdepfile" && break
|
|
||||||
done
|
|
||||||
# Same post-processing that is required for AIX mode.
|
|
||||||
aix_post_process_depfile
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvc7)
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
showIncludes=-Wc,-showIncludes
|
|
||||||
else
|
|
||||||
showIncludes=-showIncludes
|
|
||||||
fi
|
|
||||||
"$@" $showIncludes > "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
# The first sed program below extracts the file names and escapes
|
|
||||||
# backslashes for cygpath. The second sed program outputs the file
|
|
||||||
# name when reading, but also accumulates all include files in the
|
|
||||||
# hold buffer in order to output them again at the end. This only
|
|
||||||
# works with sed implementations that can handle large buffers.
|
|
||||||
sed < "$tmpdepfile" -n '
|
|
||||||
/^Note: including file: *\(.*\)/ {
|
|
||||||
s//\1/
|
|
||||||
s/\\/\\\\/g
|
|
||||||
p
|
|
||||||
}' | $cygpath_u | sort -u | sed -n '
|
|
||||||
s/ /\\ /g
|
|
||||||
s/\(.*\)/'"$tab"'\1 \\/p
|
|
||||||
s/.\(.*\) \\/\1:/
|
|
||||||
H
|
|
||||||
$ {
|
|
||||||
s/.*/'"$tab"'/
|
|
||||||
G
|
|
||||||
p
|
|
||||||
}' >> "$depfile"
|
|
||||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvc7msys)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
#nosideeffect)
|
|
||||||
# This comment above is used by automake to tell side-effect
|
|
||||||
# dependency tracking mechanisms from slower ones.
|
|
||||||
|
|
||||||
dashmstdout)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the preprocessed file to stdout, regardless of -o.
|
|
||||||
"$@" || exit $?
|
|
||||||
|
|
||||||
# Remove the call to Libtool.
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
while test "X$1" != 'X--mode=compile'; do
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove '-o $object'.
|
|
||||||
IFS=" "
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case $arg in
|
|
||||||
-o)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
$object)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # $arg
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
test -z "$dashmflag" && dashmflag=-M
|
|
||||||
# Require at least two characters before searching for ':'
|
|
||||||
# in the target name. This is to cope with DOS-style filenames:
|
|
||||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
|
||||||
"$@" $dashmflag |
|
|
||||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
|
||||||
rm -f "$depfile"
|
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
|
||||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
dashXmstdout)
|
|
||||||
# This case only exists to satisfy depend.m4. It is never actually
|
|
||||||
# run, as this mode is specially recognized in the preamble.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
makedepend)
|
|
||||||
"$@" || exit $?
|
|
||||||
# Remove any Libtool call
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
while test "X$1" != 'X--mode=compile'; do
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
# X makedepend
|
|
||||||
shift
|
|
||||||
cleared=no eat=no
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case $cleared in
|
|
||||||
no)
|
|
||||||
set ""; shift
|
|
||||||
cleared=yes ;;
|
|
||||||
esac
|
|
||||||
if test $eat = yes; then
|
|
||||||
eat=no
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
case "$arg" in
|
|
||||||
-D*|-I*)
|
|
||||||
set fnord "$@" "$arg"; shift ;;
|
|
||||||
# Strip any option that makedepend may not understand. Remove
|
|
||||||
# the object too, otherwise makedepend will parse it as a source file.
|
|
||||||
-arch)
|
|
||||||
eat=yes ;;
|
|
||||||
-*|$object)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"; shift ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
|
||||||
touch "$tmpdepfile"
|
|
||||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
|
||||||
rm -f "$depfile"
|
|
||||||
# makedepend may prepend the VPATH from the source file name to the object.
|
|
||||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
|
||||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
|
||||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed '1,2d' "$tmpdepfile" \
|
|
||||||
| tr ' ' "$nl" \
|
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
|
||||||
;;
|
|
||||||
|
|
||||||
cpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the preprocessed file to stdout.
|
|
||||||
"$@" || exit $?
|
|
||||||
|
|
||||||
# Remove the call to Libtool.
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
while test "X$1" != 'X--mode=compile'; do
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove '-o $object'.
|
|
||||||
IFS=" "
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case $arg in
|
|
||||||
-o)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
$object)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # $arg
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
"$@" -E \
|
|
||||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
|
||||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
|
||||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
cat < "$tmpdepfile" >> "$depfile"
|
|
||||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvisualcpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the preprocessed file to stdout.
|
|
||||||
"$@" || exit $?
|
|
||||||
|
|
||||||
# Remove the call to Libtool.
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
while test "X$1" != 'X--mode=compile'; do
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
IFS=" "
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case "$arg" in
|
|
||||||
-o)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
$object)
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
|
||||||
set fnord "$@"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"$@" -E 2>/dev/null |
|
|
||||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
|
||||||
echo "$tab" >> "$depfile"
|
|
||||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvcmsys)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
none)
|
|
||||||
exec "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Unknown depmode $depmode" 1>&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
62
history.txt
62
history.txt
@@ -4,13 +4,73 @@ HTTrack Website Copier release history:
|
|||||||
|
|
||||||
This file lists all changes and fixes that have been made for HTTrack
|
This file lists all changes and fixes that have been made for HTTrack
|
||||||
|
|
||||||
|
3.49-11
|
||||||
|
+ New: parse robots.txt Allow rules and path wildcards per RFC 9309 (#452)
|
||||||
|
+ New: advertise deflate in Accept-Encoding and decode deflate responses (#450)
|
||||||
|
+ New: follow <source> and <track> media elements as embedded links (#451)
|
||||||
|
+ New: added modern web MIME types to the type/extension table (#448)
|
||||||
|
+ Fixed: enforce the -E time limit during a slow transfer instead of only between files (#481)
|
||||||
|
+ Fixed: sniff the leading bytes of a download so a misdeclared Content-Type no longer renames a correct URL extension
|
||||||
|
+ Fixed: fast transfers could be saved under their temporary .delayed placeholder name (#5, #107)
|
||||||
|
+ Fixed: follow a redirect that maps to the same saved file instead of writing a self-pointing stub (#159)
|
||||||
|
+ Fixed: several network-facing buffer overflows in the FTP, Java and HTML parsers
|
||||||
|
+ Fixed: the htsjava plugin could not be loaded (hidden entry points, stale library name)
|
||||||
|
+ Fixed: HTML-escape truncation and a cache-buffer leak in the parser
|
||||||
|
+ Changed: modernized the default User-Agent to an honest HTTrack identifier (#449)
|
||||||
|
+ Changed: decode the full WHATWG set of HTML named character references (#443)
|
||||||
|
+ Changed: refreshed stale HTTP status, proxy-port and TLS-floor constants (#453)
|
||||||
|
+ Changed: multiple internal hardening, build, test and CI improvements
|
||||||
|
|
||||||
|
3.49-10
|
||||||
|
+ New: --cookies-file to preload a Netscape cookies.txt before crawling (#215)
|
||||||
|
+ New: --pause to space out file downloads by a random delay (#185)
|
||||||
|
+ New: --strip-query to drop selected query keys from the dedup naming (#112)
|
||||||
|
+ Changed: split the -%u URL hacks into independent --keep-www-prefix, --keep-double-slashes and --keep-query-order toggles (#271)
|
||||||
|
+ Fixed: follow a redirect Location after dropping its #fragment, instead of requesting the fragment and polluting the saved name (#204)
|
||||||
|
+ Fixed: escaped brackets inside a *[...] filter character class (#148)
|
||||||
|
+ Fixed: honor the server's Content-Range when resuming a partial download, instead of appending overlapping bytes (#198)
|
||||||
|
+ Fixed: abort the download as soon as the response type is excluded by -mime:, instead of fetching then discarding the body (#58)
|
||||||
|
+ Fixed: keep size-based filter rules neutral until the file size is known (#143)
|
||||||
|
+ Fixed: stop the mirror with a clean fatal error on a cache write failure, instead of crashing (#174, #219)
|
||||||
|
+ Fixed: stop the 412/416 partial re-get loop on --continue and --update (#206)
|
||||||
|
+ Fixed: keep an unrecognized URL tail instead of mangling it to .html (#115)
|
||||||
|
+ Fixed: honor --tolerant (-%B) on a broken Content-Length, and fix an out-of-bounds read it exposed (#32, #41)
|
||||||
|
+ Fixed: fall back to the next resolved address when a connection fails or stalls, instead of hanging on a dead IPv6 address
|
||||||
|
+ Fixed: report why a -%L URL list could not be loaded (#49)
|
||||||
|
+ Changed: multiple internal hardening, build and CI improvements
|
||||||
|
|
||||||
|
.49-9
|
||||||
|
+ Fixed: file-type detection from the Content-Type header: trust a declared type over a binary URL extension, honor --assume under the delayed type check, and keep a known extension against a bogus or empty Content-Type (#267, #29, #56)
|
||||||
|
+ Fixed: an uninitialized-buffer read when the Content-Type is empty (#411)
|
||||||
|
+ Fixed: restored C++ source-compatibility of the installed headers so reverse dependencies (httraqt) build again (#413)
|
||||||
|
+ Changed: multiple internal build, packaging and test-harness improvements
|
||||||
|
|
||||||
3.49-8
|
3.49-8
|
||||||
|
+ New: tunnel HTTPS downloads through the configured HTTP proxy via CONNECT (#85)
|
||||||
|
+ New: parse every candidate URL in <img> and <source> srcset lists (#326)
|
||||||
+ Changed: dropped the obsolete OpenSSL linking exception (OpenSSL 3.0+ is Apache-2.0 and GPL-compatible); httrack is now plain GPLv3-or-later
|
+ Changed: dropped the obsolete OpenSSL linking exception (OpenSSL 3.0+ is Apache-2.0 and GPL-compatible); httrack is now plain GPLv3-or-later
|
||||||
+ Fixed: link libhtsjava and the libtest examples directly against libc
|
+ Fixed: several out-of-bounds reads in the HTML/CSS parser on hostile input (#94, #396)
|
||||||
|
+ Fixed: stored XSS via an unescaped URL in the generated page footer (#165)
|
||||||
|
+ Fixed: hardened buffer copies throughout the engine against overflow
|
||||||
|
+ Fixed: capture conditional CSS @import URLs (#94)
|
||||||
|
+ Fixed: don't crawl xmlns namespace declarations as links (#191)
|
||||||
|
+ Fixed: don't mistake the method argument of XMLHttpRequest.open for a URL (#218)
|
||||||
|
+ Fixed: percent-encode parentheses when rewriting CSS url() targets (#163)
|
||||||
|
+ Fixed: collapse ../ in file:// URLs and widen relative-link handling (#137, #162)
|
||||||
|
+ Fixed: drop the obsolete $Version/$Path attributes from the request Cookie header, per RFC 6265 (#151)
|
||||||
|
+ Fixed: keep empty quoted arguments when reloading doit.log for --update/--continue (#106)
|
||||||
|
+ Fixed: raise the User-Agent and custom-header length limits (#152)
|
||||||
|
+ Fixed: abort on a long log path (lock-file buffer too small) (#183)
|
||||||
|
+ Fixed: race in lazy mutex initialization (#297)
|
||||||
|
+ Fixed: sub-second mtime precision when comparing local files on POSIX (#383)
|
||||||
|
+ Fixed: modernize OpenSSL TLS initialization for the 3.x to 4.x transition (#308)
|
||||||
+ Fixed: in-place changes made by the postprocess callback were not applied (Roman Sęk)
|
+ Fixed: in-place changes made by the postprocess callback were not applied (Roman Sęk)
|
||||||
+ Fixed: "preffered" typo in the help text and man page (yosinn1-blip)
|
+ Fixed: "preffered" typo in the help text and man page (yosinn1-blip)
|
||||||
+ Fixed: corrections and updates of the Russian translation (German Aizek)
|
+ Fixed: corrections and updates of the Russian translation (German Aizek)
|
||||||
+ Fixed: corrections and updates of the Danish translation (scootergrisen)
|
+ Fixed: corrections and updates of the Danish translation (scootergrisen)
|
||||||
|
+ Fixed: link libhtsjava and the libtest examples directly against libc
|
||||||
|
+ New: documented the public library API headers and typed the option fields as named enums
|
||||||
|
+ Fixed: numerous build, packaging, CI and test-coverage improvements (out-of-tree builds, sanitizer/distcheck CI, shell and Python linting, AppStream metainfo)
|
||||||
|
|
||||||
3.49-7
|
3.49-7
|
||||||
+ Fixed: keep generated config.h architecture-independent (Debian #1133728)
|
+ Fixed: keep generated config.h architecture-independent (Debian #1133728)
|
||||||
|
|||||||
888
html/Makefile.in
888
html/Makefile.in
@@ -1,888 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = html
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
{ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(HelpHtmldir)" \
|
|
||||||
"$(DESTDIR)$(HelpHtmlTxtdir)" "$(DESTDIR)$(HelpHtmldivdir)" \
|
|
||||||
"$(DESTDIR)$(HelpHtmlimagesdir)" "$(DESTDIR)$(HelpHtmlimgdir)" \
|
|
||||||
"$(DESTDIR)$(HelpHtmlrootdir)" "$(DESTDIR)$(MetaInfodir)" \
|
|
||||||
"$(DESTDIR)$(VFolderEntrydir)" "$(DESTDIR)$(WebHtmldir)" \
|
|
||||||
"$(DESTDIR)$(WebHtmlimagesdir)" "$(DESTDIR)$(WebIcon16x16dir)" \
|
|
||||||
"$(DESTDIR)$(WebIcon32x32dir)" "$(DESTDIR)$(WebIcon48x48dir)" \
|
|
||||||
"$(DESTDIR)$(WebPixmapdir)"
|
|
||||||
DATA = $(HelpHtml_DATA) $(HelpHtmlTxt_DATA) $(HelpHtmldiv_DATA) \
|
|
||||||
$(HelpHtmlimages_DATA) $(HelpHtmlimg_DATA) \
|
|
||||||
$(HelpHtmlroot_DATA) $(MetaInfo_DATA) $(VFolderEntry_DATA) \
|
|
||||||
$(WebHtml_DATA) $(WebHtmlimages_DATA) $(WebIcon16x16_DATA) \
|
|
||||||
$(WebIcon32x32_DATA) $(WebIcon48x48_DATA) $(WebPixmap_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
HelpHtmlrootdir = $(docdir)
|
|
||||||
HelpHtmldir = $(htmldir)
|
|
||||||
HelpHtmlimgdir = $(HelpHtmldir)/img
|
|
||||||
HelpHtmldivdir = $(HelpHtmldir)/div
|
|
||||||
HelpHtmlimagesdir = $(HelpHtmldir)/images
|
|
||||||
HelpHtmlTxtdir = $(HelpHtmldir)
|
|
||||||
WebHtmldir = $(HelpHtmldir)/server
|
|
||||||
WebHtmlimagesdir = $(HelpHtmldir)/server/images
|
|
||||||
WebPixmapdir = $(datadir)/pixmaps
|
|
||||||
WebIcon16x16dir = $(datadir)/icons/hicolor/16x16/apps
|
|
||||||
WebIcon32x32dir = $(datadir)/icons/hicolor/32x32/apps
|
|
||||||
WebIcon48x48dir = $(datadir)/icons/hicolor/48x48/apps
|
|
||||||
VFolderEntrydir = $(prefix)/share/applications
|
|
||||||
MetaInfodir = $(datadir)/metainfo
|
|
||||||
|
|
||||||
# Wildcards are globbed against $(srcdir): a bare "*.html" is resolved against
|
|
||||||
# the build dir and stays unexpanded (breaking "make") in an out-of-tree build.
|
|
||||||
# Explicit filenames (e.g. ../history.txt, div/search.sh) resolve via VPATH and
|
|
||||||
# need no prefix.
|
|
||||||
HelpHtmlroot_DATA = ../httrack-doc.html ../history.txt
|
|
||||||
HelpHtml_DATA = $(srcdir)/*.html
|
|
||||||
HelpHtmldiv_DATA = div/search.sh
|
|
||||||
HelpHtmlimg_DATA = $(srcdir)/img/*
|
|
||||||
HelpHtmlimages_DATA = $(srcdir)/images/*
|
|
||||||
HelpHtmlTxt_DATA = ../greetings.txt ../history.txt ../license.txt
|
|
||||||
WebHtml_DATA = $(srcdir)/server/*.html $(srcdir)/server/*.js $(srcdir)/server/*.css
|
|
||||||
WebHtmlimages_DATA = $(srcdir)/server/images/*
|
|
||||||
# note: converted & normalized by
|
|
||||||
# ico2xpm favicon.ico -o httrack.xpm
|
|
||||||
# mogrify -format xpm -map /usr/share/doc/menu/examples/cmap.xpm httrack.xpm
|
|
||||||
WebPixmap_DATA = $(srcdir)/server/div/*.xpm
|
|
||||||
WebIcon16x16_DATA = $(srcdir)/server/div/16x16/*.png
|
|
||||||
WebIcon32x32_DATA = $(srcdir)/server/div/32x32/*.png
|
|
||||||
WebIcon48x48_DATA = $(srcdir)/server/div/48x48/*.png
|
|
||||||
VFolderEntry_DATA = $(srcdir)/server/div/*.desktop
|
|
||||||
MetaInfo_DATA = $(srcdir)/server/div/*.metainfo.xml
|
|
||||||
EXTRA_DIST = $(HelpHtml_DATA) $(HelpHtmlimg_DATA) $(HelpHtmlimages_DATA) \
|
|
||||||
$(HelpHtmldiv_DATA) $(WebHtml_DATA) $(WebHtmlimages_DATA) \
|
|
||||||
$(WebPixmap_DATA) $(WebIcon16x16_DATA) $(WebIcon32x32_DATA) $(WebIcon48x48_DATA) \
|
|
||||||
$(VFolderEntry_DATA) $(MetaInfo_DATA) \
|
|
||||||
httrack.css
|
|
||||||
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu html/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu html/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
install-HelpHtmlDATA: $(HelpHtml_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtml_DATA)'; test -n "$(HelpHtmldir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmldir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmldir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmldir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmldir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmlDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtml_DATA)'; test -n "$(HelpHtmldir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmldir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-HelpHtmlTxtDATA: $(HelpHtmlTxt_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtmlTxt_DATA)'; test -n "$(HelpHtmlTxtdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmlTxtdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmlTxtdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmlTxtdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmlTxtdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmlTxtDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtmlTxt_DATA)'; test -n "$(HelpHtmlTxtdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmlTxtdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-HelpHtmldivDATA: $(HelpHtmldiv_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtmldiv_DATA)'; test -n "$(HelpHtmldivdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmldivdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmldivdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmldivdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmldivdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmldivDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtmldiv_DATA)'; test -n "$(HelpHtmldivdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmldivdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-HelpHtmlimagesDATA: $(HelpHtmlimages_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtmlimages_DATA)'; test -n "$(HelpHtmlimagesdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmlimagesdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmlimagesdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmlimagesdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmlimagesdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmlimagesDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtmlimages_DATA)'; test -n "$(HelpHtmlimagesdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmlimagesdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-HelpHtmlimgDATA: $(HelpHtmlimg_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtmlimg_DATA)'; test -n "$(HelpHtmlimgdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmlimgdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmlimgdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmlimgdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmlimgdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmlimgDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtmlimg_DATA)'; test -n "$(HelpHtmlimgdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmlimgdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-HelpHtmlrootDATA: $(HelpHtmlroot_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(HelpHtmlroot_DATA)'; test -n "$(HelpHtmlrootdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(HelpHtmlrootdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(HelpHtmlrootdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(HelpHtmlrootdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(HelpHtmlrootdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-HelpHtmlrootDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(HelpHtmlroot_DATA)'; test -n "$(HelpHtmlrootdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(HelpHtmlrootdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-MetaInfoDATA: $(MetaInfo_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(MetaInfo_DATA)'; test -n "$(MetaInfodir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(MetaInfodir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(MetaInfodir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(MetaInfodir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(MetaInfodir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-MetaInfoDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(MetaInfo_DATA)'; test -n "$(MetaInfodir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(MetaInfodir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-VFolderEntryDATA: $(VFolderEntry_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(VFolderEntry_DATA)'; test -n "$(VFolderEntrydir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(VFolderEntrydir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(VFolderEntrydir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(VFolderEntrydir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(VFolderEntrydir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-VFolderEntryDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(VFolderEntry_DATA)'; test -n "$(VFolderEntrydir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(VFolderEntrydir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebHtmlDATA: $(WebHtml_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebHtml_DATA)'; test -n "$(WebHtmldir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebHtmldir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebHtmldir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebHtmldir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebHtmldir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebHtmlDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebHtml_DATA)'; test -n "$(WebHtmldir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebHtmldir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebHtmlimagesDATA: $(WebHtmlimages_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebHtmlimages_DATA)'; test -n "$(WebHtmlimagesdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebHtmlimagesdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebHtmlimagesdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebHtmlimagesdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebHtmlimagesdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebHtmlimagesDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebHtmlimages_DATA)'; test -n "$(WebHtmlimagesdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebHtmlimagesdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebIcon16x16DATA: $(WebIcon16x16_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebIcon16x16_DATA)'; test -n "$(WebIcon16x16dir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebIcon16x16dir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebIcon16x16dir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebIcon16x16dir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebIcon16x16dir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebIcon16x16DATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebIcon16x16_DATA)'; test -n "$(WebIcon16x16dir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebIcon16x16dir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebIcon32x32DATA: $(WebIcon32x32_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebIcon32x32_DATA)'; test -n "$(WebIcon32x32dir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebIcon32x32dir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebIcon32x32dir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebIcon32x32dir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebIcon32x32dir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebIcon32x32DATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebIcon32x32_DATA)'; test -n "$(WebIcon32x32dir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebIcon32x32dir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebIcon48x48DATA: $(WebIcon48x48_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebIcon48x48_DATA)'; test -n "$(WebIcon48x48dir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebIcon48x48dir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebIcon48x48dir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebIcon48x48dir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebIcon48x48dir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebIcon48x48DATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebIcon48x48_DATA)'; test -n "$(WebIcon48x48dir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebIcon48x48dir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-WebPixmapDATA: $(WebPixmap_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(WebPixmap_DATA)'; test -n "$(WebPixmapdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(WebPixmapdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(WebPixmapdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(WebPixmapdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(WebPixmapdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-WebPixmapDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(WebPixmap_DATA)'; test -n "$(WebPixmapdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(WebPixmapdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(HelpHtmldir)" "$(DESTDIR)$(HelpHtmlTxtdir)" "$(DESTDIR)$(HelpHtmldivdir)" "$(DESTDIR)$(HelpHtmlimagesdir)" "$(DESTDIR)$(HelpHtmlimgdir)" "$(DESTDIR)$(HelpHtmlrootdir)" "$(DESTDIR)$(MetaInfodir)" "$(DESTDIR)$(VFolderEntrydir)" "$(DESTDIR)$(WebHtmldir)" "$(DESTDIR)$(WebHtmlimagesdir)" "$(DESTDIR)$(WebIcon16x16dir)" "$(DESTDIR)$(WebIcon32x32dir)" "$(DESTDIR)$(WebIcon48x48dir)" "$(DESTDIR)$(WebPixmapdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-HelpHtmlDATA install-HelpHtmlTxtDATA \
|
|
||||||
install-HelpHtmldivDATA install-HelpHtmlimagesDATA \
|
|
||||||
install-HelpHtmlimgDATA install-HelpHtmlrootDATA \
|
|
||||||
install-MetaInfoDATA install-VFolderEntryDATA \
|
|
||||||
install-WebHtmlDATA install-WebHtmlimagesDATA \
|
|
||||||
install-WebIcon16x16DATA install-WebIcon32x32DATA \
|
|
||||||
install-WebIcon48x48DATA install-WebPixmapDATA
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-HelpHtmlDATA uninstall-HelpHtmlTxtDATA \
|
|
||||||
uninstall-HelpHtmldivDATA uninstall-HelpHtmlimagesDATA \
|
|
||||||
uninstall-HelpHtmlimgDATA uninstall-HelpHtmlrootDATA \
|
|
||||||
uninstall-MetaInfoDATA uninstall-VFolderEntryDATA \
|
|
||||||
uninstall-WebHtmlDATA uninstall-WebHtmlimagesDATA \
|
|
||||||
uninstall-WebIcon16x16DATA uninstall-WebIcon32x32DATA \
|
|
||||||
uninstall-WebIcon48x48DATA uninstall-WebPixmapDATA
|
|
||||||
|
|
||||||
.MAKE: install-am install-data-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
|
||||||
cscopelist-am ctags-am distclean distclean-generic \
|
|
||||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
|
||||||
install install-HelpHtmlDATA install-HelpHtmlTxtDATA \
|
|
||||||
install-HelpHtmldivDATA install-HelpHtmlimagesDATA \
|
|
||||||
install-HelpHtmlimgDATA install-HelpHtmlrootDATA \
|
|
||||||
install-MetaInfoDATA install-VFolderEntryDATA \
|
|
||||||
install-WebHtmlDATA install-WebHtmlimagesDATA \
|
|
||||||
install-WebIcon16x16DATA install-WebIcon32x32DATA \
|
|
||||||
install-WebIcon48x48DATA install-WebPixmapDATA install-am \
|
|
||||||
install-data install-data-am install-data-hook install-dvi \
|
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
|
||||||
install-html-am install-info install-info-am install-man \
|
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
|
||||||
tags-am uninstall uninstall-HelpHtmlDATA \
|
|
||||||
uninstall-HelpHtmlTxtDATA uninstall-HelpHtmldivDATA \
|
|
||||||
uninstall-HelpHtmlimagesDATA uninstall-HelpHtmlimgDATA \
|
|
||||||
uninstall-HelpHtmlrootDATA uninstall-MetaInfoDATA \
|
|
||||||
uninstall-VFolderEntryDATA uninstall-WebHtmlDATA \
|
|
||||||
uninstall-WebHtmlimagesDATA uninstall-WebIcon16x16DATA \
|
|
||||||
uninstall-WebIcon32x32DATA uninstall-WebIcon48x48DATA \
|
|
||||||
uninstall-WebPixmapDATA uninstall-am
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
if test ! -L $(DESTDIR)$(prefix)/share/httrack/html ; then \
|
|
||||||
( cd $(DESTDIR)$(prefix)/share/httrack \
|
|
||||||
&& $(LN_S) $(htmldir) html \
|
|
||||||
) \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Simple indexing test using HTTrack
|
# Simple indexing test using HTTrack
|
||||||
# A "real" script/program would use advanced search, and
|
# A "real" script/program would use advanced search, and
|
||||||
# use dichotomy to find the word in the index.txt file
|
# use dichotomy to find the word in the index.txt file
|
||||||
# This script is really basic and NOT optimized, and
|
# This script is really basic and NOT optimized, and
|
||||||
# should not be used for professional purpose :)
|
# should not be used for professional purpose :)
|
||||||
@@ -11,50 +10,49 @@ TESTSITE="http://localhost/"
|
|||||||
|
|
||||||
# Create an index if necessary
|
# Create an index if necessary
|
||||||
if ! test -f "index.txt"; then
|
if ! test -f "index.txt"; then
|
||||||
echo "Building the index .."
|
echo "Building the index .."
|
||||||
rm -rf test
|
rm -rf test
|
||||||
httrack --display "$TESTSITE" -%I -O test
|
httrack --display "$TESTSITE" -%I -O test
|
||||||
mv test/index.txt ./
|
mv test/index.txt ./
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert crlf to lf
|
# Convert crlf to lf
|
||||||
if test "`head index.txt -n 1 | tr '\r' '#' | grep -c '#'`" = "1"; then
|
if test "$(head index.txt -n 1 | tr '\r' '#' | grep -c '#')" = "1"; then
|
||||||
echo "Converting index to Unix LF style (not CR/LF) .."
|
echo "Converting index to Unix LF style (not CR/LF) .."
|
||||||
mv -f index.txt index.txt.old
|
mv -f index.txt index.txt.old
|
||||||
cat index.txt.old|tr -d '\r' > index.txt
|
tr -d '\r' <index.txt.old >index.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
keyword=-
|
keyword=-
|
||||||
while test -n "$keyword"; do
|
while test -n "$keyword"; do
|
||||||
printf "Enter a keyword: "
|
printf "Enter a keyword: "
|
||||||
read keyword
|
read -r keyword
|
||||||
|
|
||||||
if test -n "$keyword"; then
|
if test -n "$keyword"; then
|
||||||
FOUNDK="`grep -niE \"^$keyword\" index.txt`"
|
FOUNDK="$(grep -niE "^$keyword" index.txt)"
|
||||||
|
|
||||||
if test -n "$FOUNDK"; then
|
if test -n "$FOUNDK"; then
|
||||||
if ! test `echo "$FOUNDK"|wc -l` = "1"; then
|
if ! test "$(echo "$FOUNDK" | wc -l)" = "1"; then
|
||||||
# Multiple matches
|
# Multiple matches
|
||||||
printf "Found multiple keywords: "
|
printf "Found multiple keywords: "
|
||||||
echo "$FOUNDK"|cut -f2 -d':'|tr '\n' ' '
|
echo "$FOUNDK" | cut -f2 -d':' | tr '\n' ' '
|
||||||
echo ""
|
echo ""
|
||||||
echo "Use keyword$ to find only one"
|
echo "Use keyword$ to find only one"
|
||||||
else
|
else
|
||||||
# One match
|
# One match
|
||||||
N=`echo "$FOUNDK"|cut -f1 -d':'`
|
N=$(echo "$FOUNDK" | cut -f1 -d':')
|
||||||
PM=`tail +$N index.txt|grep -nE "\("|head -n 1`
|
PM=$(tail "+$N" index.txt | grep -nE "\(" | head -n 1)
|
||||||
if ! echo "$PM"|grep "ignored">/dev/null; then
|
if ! echo "$PM" | grep "ignored" >/dev/null; then
|
||||||
M=`echo $PM|cut -f1 -d':'`
|
M=$(echo "$PM" | cut -f1 -d':')
|
||||||
echo "Found in:"
|
echo "Found in:"
|
||||||
cat index.txt | tail "+$N" | head -n "$M" | grep -E "[0-9]* " | cut -f2 -d' '
|
tail "+$N" index.txt | head -n "$M" | grep -E "[0-9]* " | cut -f2 -d' '
|
||||||
else
|
else
|
||||||
echo "keyword ignored (too many hits)"
|
echo "keyword ignored (too many hits)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "not found"
|
echo "not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ See also: The <a href="faq.html#VF1">FAQ</a><br>
|
|||||||
<td>the \ character</td>
|
<td>the \ character</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td nowrap><tt>*[\[\]]</tt></td>
|
<td nowrap><tt>*[\[,\]]</tt></td>
|
||||||
<td>the [ or ] character</td>
|
<td>the [ or ] character</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
541
install-sh
541
install-sh
@@ -1,541 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# install - install a program, script, or datafile
|
|
||||||
|
|
||||||
scriptversion=2024-06-19.01; # UTC
|
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
|
||||||
# following copyright and license.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1994 X Consortium
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
# of this software and associated documentation files (the "Software"), to
|
|
||||||
# deal in the Software without restriction, including without limitation the
|
|
||||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
# sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
# furnished to do so, subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included in
|
|
||||||
# all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
|
||||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
# Except as contained in this notice, the name of the X Consortium shall not
|
|
||||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
|
||||||
# ings in this Software without prior written authorization from the X Consor-
|
|
||||||
# tium.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# FSF changes to this file are in the public domain.
|
|
||||||
#
|
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
|
||||||
# 'make' implicit rules from creating a file called install from it
|
|
||||||
# when there is no Makefile.
|
|
||||||
#
|
|
||||||
# This script is compatible with the BSD install script, but was written
|
|
||||||
# from scratch.
|
|
||||||
|
|
||||||
tab=' '
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
IFS=" $tab$nl"
|
|
||||||
|
|
||||||
# Set DOITPROG to "echo" to test this script.
|
|
||||||
|
|
||||||
doit=${DOITPROG-}
|
|
||||||
doit_exec=${doit:-exec}
|
|
||||||
|
|
||||||
# Put in absolute file names if you don't have them in your path;
|
|
||||||
# or use environment vars.
|
|
||||||
|
|
||||||
chgrpprog=${CHGRPPROG-chgrp}
|
|
||||||
chmodprog=${CHMODPROG-chmod}
|
|
||||||
chownprog=${CHOWNPROG-chown}
|
|
||||||
cmpprog=${CMPPROG-cmp}
|
|
||||||
cpprog=${CPPROG-cp}
|
|
||||||
mkdirprog=${MKDIRPROG-mkdir}
|
|
||||||
mvprog=${MVPROG-mv}
|
|
||||||
rmprog=${RMPROG-rm}
|
|
||||||
stripprog=${STRIPPROG-strip}
|
|
||||||
|
|
||||||
posix_mkdir=
|
|
||||||
|
|
||||||
# Desired mode of installed file.
|
|
||||||
mode=0755
|
|
||||||
|
|
||||||
# Create dirs (including intermediate dirs) using mode 755.
|
|
||||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
|
||||||
mkdir_umask=22
|
|
||||||
|
|
||||||
backupsuffix=
|
|
||||||
chgrpcmd=
|
|
||||||
chmodcmd=$chmodprog
|
|
||||||
chowncmd=
|
|
||||||
mvcmd=$mvprog
|
|
||||||
rmcmd="$rmprog -f"
|
|
||||||
stripcmd=
|
|
||||||
|
|
||||||
src=
|
|
||||||
dst=
|
|
||||||
dir_arg=
|
|
||||||
dst_arg=
|
|
||||||
|
|
||||||
copy_on_change=false
|
|
||||||
is_target_a_directory=possibly
|
|
||||||
|
|
||||||
usage="\
|
|
||||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
|
||||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
|
||||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
|
||||||
or: $0 [OPTION]... -d DIRECTORIES...
|
|
||||||
|
|
||||||
In the 1st form, copy SRCFILE to DSTFILE.
|
|
||||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
|
||||||
In the 4th, create DIRECTORIES.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
--help display this help and exit.
|
|
||||||
--version display version info and exit.
|
|
||||||
|
|
||||||
-c (ignored)
|
|
||||||
-C install only if different (preserve data modification time)
|
|
||||||
-d create directories instead of installing files.
|
|
||||||
-g GROUP $chgrpprog installed files to GROUP.
|
|
||||||
-m MODE $chmodprog installed files to MODE.
|
|
||||||
-o USER $chownprog installed files to USER.
|
|
||||||
-p pass -p to $cpprog.
|
|
||||||
-s $stripprog installed files.
|
|
||||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
|
||||||
-t DIRECTORY install into DIRECTORY.
|
|
||||||
-T report an error if DSTFILE is a directory.
|
|
||||||
|
|
||||||
Environment variables override the default commands:
|
|
||||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
|
||||||
RMPROG STRIPPROG
|
|
||||||
|
|
||||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
|
||||||
it's up to you to specify -f if you want it.
|
|
||||||
|
|
||||||
If -S is not specified, no backups are attempted.
|
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
|
||||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
|
||||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
|
||||||
|
|
||||||
while test $# -ne 0; do
|
|
||||||
case $1 in
|
|
||||||
-c) ;;
|
|
||||||
|
|
||||||
-C) copy_on_change=true;;
|
|
||||||
|
|
||||||
-d) dir_arg=true;;
|
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
--help) echo "$usage"; exit $?;;
|
|
||||||
|
|
||||||
-m) mode=$2
|
|
||||||
case $mode in
|
|
||||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
|
||||||
echo "$0: invalid mode: $mode" >&2
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-p) cpprog="$cpprog -p";;
|
|
||||||
|
|
||||||
-s) stripcmd=$stripprog;;
|
|
||||||
|
|
||||||
-S) backupsuffix="$2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-t)
|
|
||||||
is_target_a_directory=always
|
|
||||||
dst_arg=$2
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-T) is_target_a_directory=never;;
|
|
||||||
|
|
||||||
--version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
|
|
||||||
|
|
||||||
--) shift
|
|
||||||
break;;
|
|
||||||
|
|
||||||
-*) echo "$0: invalid option: $1" >&2
|
|
||||||
exit 1;;
|
|
||||||
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
# We allow the use of options -d and -T together, by making -d
|
|
||||||
# take the precedence; this is for compatibility with GNU install.
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
echo "$0: target directory not allowed when installing a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|
||||||
# When -d is used, all remaining arguments are directories to create.
|
|
||||||
# When -t is used, the destination is already specified.
|
|
||||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
# $@ is not empty: it contains at least $arg.
|
|
||||||
set fnord "$@" "$dst_arg"
|
|
||||||
shift # fnord
|
|
||||||
fi
|
|
||||||
shift # arg
|
|
||||||
dst_arg=$arg
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
echo "$0: no input file specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# It's OK to call 'install-sh -d' without argument.
|
|
||||||
# This can happen when creating conditional directories.
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
|
||||||
if test ! -d "$dst_arg"; then
|
|
||||||
echo "$0: $dst_arg: Is not a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
do_exit='(exit $ret); exit $ret'
|
|
||||||
trap "ret=129; $do_exit" 1
|
|
||||||
trap "ret=130; $do_exit" 2
|
|
||||||
trap "ret=141; $do_exit" 13
|
|
||||||
trap "ret=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Set umask so as not to create temps with too-generous modes.
|
|
||||||
# However, 'strip' requires both read and write access to temps.
|
|
||||||
case $mode in
|
|
||||||
# Optimize common cases.
|
|
||||||
*644) cp_umask=133;;
|
|
||||||
*755) cp_umask=22;;
|
|
||||||
|
|
||||||
*[0-7])
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw='% 200'
|
|
||||||
fi
|
|
||||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
|
||||||
*)
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw=,u+rw
|
|
||||||
fi
|
|
||||||
cp_umask=$mode$u_plus_rw;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
for src
|
|
||||||
do
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $src in
|
|
||||||
-* | [=\(\)!]) src=./$src;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
dst=$src
|
|
||||||
dstdir=$dst
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
# Don't chown directories that already exist.
|
|
||||||
if test $dstdir_status = 0; then
|
|
||||||
chowncmd=""
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
|
||||||
# might cause directories to be created, which would be especially bad
|
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
|
||||||
if test ! -f "$src" && test ! -d "$src"; then
|
|
||||||
echo "$0: $src does not exist." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dst_arg"; then
|
|
||||||
echo "$0: no destination specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dst=$dst_arg
|
|
||||||
|
|
||||||
# If destination is a directory, append the input filename.
|
|
||||||
if test -d "$dst"; then
|
|
||||||
if test "$is_target_a_directory" = never; then
|
|
||||||
echo "$0: $dst_arg: Is a directory" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dstdir=$dst
|
|
||||||
dstbase=`basename "$src"`
|
|
||||||
case $dst in
|
|
||||||
*/) dst=$dst$dstbase;;
|
|
||||||
*) dst=$dst/$dstbase;;
|
|
||||||
esac
|
|
||||||
dstdir_status=0
|
|
||||||
else
|
|
||||||
dstdir=`dirname "$dst"`
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $dstdir in
|
|
||||||
*/) dstdirslash=$dstdir;;
|
|
||||||
*) dstdirslash=$dstdir/;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
obsolete_mkdir_used=false
|
|
||||||
|
|
||||||
if test $dstdir_status != 0; then
|
|
||||||
case $posix_mkdir in
|
|
||||||
'')
|
|
||||||
# With -d, create the new directory with the user-specified mode.
|
|
||||||
# Otherwise, rely on $mkdir_umask.
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
mkdir_mode=-m$mode
|
|
||||||
else
|
|
||||||
mkdir_mode=
|
|
||||||
fi
|
|
||||||
|
|
||||||
posix_mkdir=false
|
|
||||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
|
||||||
# here however when possible just to lower collision chance.
|
|
||||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
|
||||||
|
|
||||||
trap '
|
|
||||||
ret=$?
|
|
||||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
|
||||||
exit $ret
|
|
||||||
' 0
|
|
||||||
|
|
||||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
|
||||||
# directly in world-writable /tmp, make sure that the '$tmpdir'
|
|
||||||
# directory is successfully created first before we actually test
|
|
||||||
# 'mkdir -p'.
|
|
||||||
if (umask $mkdir_umask &&
|
|
||||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
|
||||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
if test -z "$dir_arg" || {
|
|
||||||
# Check for POSIX incompatibility with -m.
|
|
||||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
|
||||||
# other-writable bit of parent directory when it shouldn't.
|
|
||||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
|
||||||
test_tmpdir="$tmpdir/a"
|
|
||||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
|
||||||
case $ls_ld_tmpdir in
|
|
||||||
d????-?r-*) different_mode=700;;
|
|
||||||
d????-?--*) different_mode=755;;
|
|
||||||
*) false;;
|
|
||||||
esac &&
|
|
||||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
|
||||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
|
||||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
then posix_mkdir=:
|
|
||||||
fi
|
|
||||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
|
||||||
else
|
|
||||||
# Remove any dirs left behind by ancient mkdir implementations.
|
|
||||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
|
||||||
fi
|
|
||||||
trap '' 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if
|
|
||||||
$posix_mkdir && (
|
|
||||||
umask $mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
|
||||||
)
|
|
||||||
then :
|
|
||||||
else
|
|
||||||
|
|
||||||
# mkdir does not conform to POSIX,
|
|
||||||
# or it failed possibly due to a race condition. Create the
|
|
||||||
# directory the slow way, step by step, checking for races as we go.
|
|
||||||
|
|
||||||
case $dstdir in
|
|
||||||
/*) prefix='/';;
|
|
||||||
[-=\(\)!]*) prefix='./';;
|
|
||||||
*) prefix='';;
|
|
||||||
esac
|
|
||||||
|
|
||||||
oIFS=$IFS
|
|
||||||
IFS=/
|
|
||||||
set -f
|
|
||||||
set fnord $dstdir
|
|
||||||
shift
|
|
||||||
set +f
|
|
||||||
IFS=$oIFS
|
|
||||||
|
|
||||||
prefixes=
|
|
||||||
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
test X"$d" = X && continue
|
|
||||||
|
|
||||||
prefix=$prefix$d
|
|
||||||
if test -d "$prefix"; then
|
|
||||||
prefixes=
|
|
||||||
else
|
|
||||||
if $posix_mkdir; then
|
|
||||||
(umask $mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
test -d "$prefix" || exit 1
|
|
||||||
else
|
|
||||||
case $prefix in
|
|
||||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
|
||||||
*) qprefix=$prefix;;
|
|
||||||
esac
|
|
||||||
prefixes="$prefixes '$qprefix'"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
prefix=$prefix/
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -n "$prefixes"; then
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
(umask $mkdir_umask &&
|
|
||||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
|
||||||
test -d "$dstdir" || exit 1
|
|
||||||
obsolete_mkdir_used=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
|
||||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
|
||||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
|
||||||
else
|
|
||||||
|
|
||||||
# Make a couple of temp file names in the proper directory.
|
|
||||||
dsttmp=${dstdirslash}_inst.$$_
|
|
||||||
rmtmp=${dstdirslash}_rm.$$_
|
|
||||||
|
|
||||||
# Trap to clean up those temp files at exit.
|
|
||||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
|
||||||
|
|
||||||
# Copy the file name to the temp name.
|
|
||||||
(umask $cp_umask &&
|
|
||||||
{ test -z "$stripcmd" || {
|
|
||||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
|
||||||
# which would cause strip to fail.
|
|
||||||
if test -z "$doit"; then
|
|
||||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
|
||||||
else
|
|
||||||
$doit touch "$dsttmp"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
} &&
|
|
||||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits.
|
|
||||||
#
|
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
|
||||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
|
||||||
#
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
|
||||||
|
|
||||||
# If -C, don't bother to copy if it wouldn't change the file.
|
|
||||||
if $copy_on_change &&
|
|
||||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
|
||||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
|
||||||
set -f &&
|
|
||||||
set X $old && old=:$2:$4:$5:$6 &&
|
|
||||||
set X $new && new=:$2:$4:$5:$6 &&
|
|
||||||
set +f &&
|
|
||||||
test "$old" = "$new" &&
|
|
||||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
rm -f "$dsttmp"
|
|
||||||
else
|
|
||||||
# If $backupsuffix is set, and the file being installed
|
|
||||||
# already exists, attempt a backup. Don't worry if it fails,
|
|
||||||
# e.g., if mv doesn't support -f.
|
|
||||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
|
||||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Rename the file to the real destination.
|
|
||||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
|
||||||
|
|
||||||
# The rename failed, perhaps because mv can't rename something else
|
|
||||||
# to itself, or perhaps because mv is so ancient that it does not
|
|
||||||
# support -f.
|
|
||||||
{
|
|
||||||
# Now remove or move aside any old file at destination location.
|
|
||||||
# We try this two ways since rm can't unlink itself on some
|
|
||||||
# systems and the destination file might be busy for other
|
|
||||||
# reasons. In this case, the final cleanup might fail but the new
|
|
||||||
# file should still install successfully.
|
|
||||||
{
|
|
||||||
test ! -f "$dst" ||
|
|
||||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
|
||||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
|
||||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
|
||||||
} ||
|
|
||||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
|
||||||
(exit 1); exit 1
|
|
||||||
}
|
|
||||||
} &&
|
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
|
||||||
$doit $mvcmd "$dsttmp" "$dst"
|
|
||||||
}
|
|
||||||
fi || exit 1
|
|
||||||
|
|
||||||
trap '' 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
@@ -295,7 +295,7 @@ Max Depth
|
|||||||
Maximum external depth:
|
Maximum external depth:
|
||||||
Maximum external depth:
|
Maximum external depth:
|
||||||
Filters (refuse/accept links) :
|
Filters (refuse/accept links) :
|
||||||
Filters (refuse/accept links) :
|
Filters (refuse/accept links):
|
||||||
Paths
|
Paths
|
||||||
Paths
|
Paths
|
||||||
Save prefs
|
Save prefs
|
||||||
|
|||||||
559
lang/Makefile.in
559
lang/Makefile.in
@@ -1,559 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = lang
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
{ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(langdir)" "$(DESTDIR)$(langrootdir)"
|
|
||||||
DATA = $(lang_DATA) $(langroot_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
langdir = $(datadir)/httrack/lang
|
|
||||||
# Glob against $(srcdir): a bare "*.txt" is resolved against the build dir and
|
|
||||||
# stays unexpanded (breaking "make") in an out-of-tree build.
|
|
||||||
lang_DATA = $(srcdir)/*.txt
|
|
||||||
langrootdir = $(datadir)/httrack
|
|
||||||
langroot_DATA = ../lang.def ../lang.indexes
|
|
||||||
EXTRA_DIST = $(lang_DATA) $(langroot_DATA)
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lang/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu lang/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
install-langDATA: $(lang_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(lang_DATA)'; test -n "$(langdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(langdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(langdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(langdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(langdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-langDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(lang_DATA)'; test -n "$(langdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(langdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
install-langrootDATA: $(langroot_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(langroot_DATA)'; test -n "$(langrootdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(langrootdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(langrootdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(langrootdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(langrootdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-langrootDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(langroot_DATA)'; test -n "$(langrootdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(langrootdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(langdir)" "$(DESTDIR)$(langrootdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-langDATA install-langrootDATA
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-langDATA uninstall-langrootDATA
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
|
||||||
cscopelist-am ctags-am distclean distclean-generic \
|
|
||||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
|
||||||
install install-am install-data install-data-am install-dvi \
|
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
|
||||||
install-html-am install-info install-info-am install-langDATA \
|
|
||||||
install-langrootDATA install-man install-pdf install-pdf-am \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
|
||||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
|
||||||
uninstall-am uninstall-langDATA uninstall-langrootDATA
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
#dist-hook:
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
37
lang/README.md
Normal file
37
lang/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Translating HTTrack
|
||||||
|
|
||||||
|
Interface strings live here, one `.txt` file per language. `English.txt` is the reference: every other file maps each English string to its translation.
|
||||||
|
|
||||||
|
## File format
|
||||||
|
|
||||||
|
Plain text, entries in consecutive pairs of lines:
|
||||||
|
|
||||||
|
```
|
||||||
|
<English string>
|
||||||
|
<translation>
|
||||||
|
```
|
||||||
|
|
||||||
|
The first line of a pair is the lookup key and must stay identical to the one in `English.txt`; translate only the second line. Missing entries fall back to the English text at runtime, so a partial translation works.
|
||||||
|
|
||||||
|
Preserve any `\r\n`, `\t` and `printf` placeholders (`%s`, `%d`, ...) in the translation.
|
||||||
|
|
||||||
|
A few `LANGUAGE_*` entries at the top describe the file itself:
|
||||||
|
|
||||||
|
| Key | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| `LANGUAGE_NAME` | Name shown in the language picker, in its own language (`Deutsch`, not `German`) |
|
||||||
|
| `LANGUAGE_ISO` | ISO 639 code, with region if needed (`de`, `pt_BR`) |
|
||||||
|
| `LANGUAGE_CHARSET` | Encoding the file is saved in (`ISO-8859-1`, `windows-1251`, `UTF-8`, ...) |
|
||||||
|
| `LANGUAGE_AUTHOR` | Your name and contact |
|
||||||
|
| `LANGUAGE_WINDOWSID` | Windows locale name used by WinHTTrack (`German (Standard)`) |
|
||||||
|
|
||||||
|
Save the file in exactly its declared `LANGUAGE_CHARSET`; an editor that rewrites it as UTF-8 will corrupt the non-ASCII bytes.
|
||||||
|
|
||||||
|
## Adding or updating a language
|
||||||
|
|
||||||
|
1. Copy `English.txt` to `<Language>.txt`, or edit the existing file.
|
||||||
|
2. Translate each second line; leave the English keys untouched.
|
||||||
|
3. Fill in the `LANGUAGE_*` header for a new file.
|
||||||
|
4. Open a pull request, or attach the file to a GitHub issue.
|
||||||
|
|
||||||
|
When new strings land in `English.txt` they show up untranslated (as English) until a translator fills them in.
|
||||||
@@ -1,908 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = libtest
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
{ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(exemplesdir)"
|
|
||||||
LTLIBRARIES = $(pkglib_LTLIBRARIES)
|
|
||||||
am__DEPENDENCIES_1 =
|
|
||||||
libbaselinks_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libbaselinks_la_OBJECTS = callbacks-example-baselinks.lo
|
|
||||||
libbaselinks_la_OBJECTS = $(am_libbaselinks_la_OBJECTS)
|
|
||||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
|
||||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
|
||||||
am__v_lt_0 = --silent
|
|
||||||
am__v_lt_1 =
|
|
||||||
libbaselinks_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libbaselinks_la_LDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@
|
|
||||||
libchangecontent_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libchangecontent_la_OBJECTS = callbacks-example-changecontent.lo
|
|
||||||
libchangecontent_la_OBJECTS = $(am_libchangecontent_la_OBJECTS)
|
|
||||||
libchangecontent_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libchangecontent_la_LDFLAGS) \
|
|
||||||
$(LDFLAGS) -o $@
|
|
||||||
libcontentfilter_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libcontentfilter_la_OBJECTS = callbacks-example-contentfilter.lo
|
|
||||||
libcontentfilter_la_OBJECTS = $(am_libcontentfilter_la_OBJECTS)
|
|
||||||
libcontentfilter_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libcontentfilter_la_LDFLAGS) \
|
|
||||||
$(LDFLAGS) -o $@
|
|
||||||
libdisplayheader_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libdisplayheader_la_OBJECTS = callbacks-example-displayheader.lo
|
|
||||||
libdisplayheader_la_OBJECTS = $(am_libdisplayheader_la_OBJECTS)
|
|
||||||
libdisplayheader_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libdisplayheader_la_LDFLAGS) \
|
|
||||||
$(LDFLAGS) -o $@
|
|
||||||
libfilename_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libfilename_la_OBJECTS = callbacks-example-filename.lo
|
|
||||||
libfilename_la_OBJECTS = $(am_libfilename_la_OBJECTS)
|
|
||||||
libfilename_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libfilename_la_LDFLAGS) $(LDFLAGS) -o \
|
|
||||||
$@
|
|
||||||
libfilename2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libfilename2_la_OBJECTS = callbacks-example-filename2.lo
|
|
||||||
libfilename2_la_OBJECTS = $(am_libfilename2_la_OBJECTS)
|
|
||||||
libfilename2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libfilename2_la_LDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@
|
|
||||||
libfilenameiisbug_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libfilenameiisbug_la_OBJECTS = callbacks-example-filenameiisbug.lo
|
|
||||||
libfilenameiisbug_la_OBJECTS = $(am_libfilenameiisbug_la_OBJECTS)
|
|
||||||
libfilenameiisbug_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(libfilenameiisbug_la_LDFLAGS) \
|
|
||||||
$(LDFLAGS) -o $@
|
|
||||||
liblistlinks_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_liblistlinks_la_OBJECTS = callbacks-example-listlinks.lo
|
|
||||||
liblistlinks_la_OBJECTS = $(am_liblistlinks_la_OBJECTS)
|
|
||||||
liblistlinks_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
|
||||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS) $(liblistlinks_la_LDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@
|
|
||||||
liblog_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
|
|
||||||
$(top_builddir)/src/libhttrack.la
|
|
||||||
am_liblog_la_OBJECTS = callbacks-example-log.lo
|
|
||||||
liblog_la_OBJECTS = $(am_liblog_la_OBJECTS)
|
|
||||||
liblog_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
||||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
|
||||||
$(liblog_la_LDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
libsimple_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
|
||||||
$(am__DEPENDENCIES_1) $(top_builddir)/src/libhttrack.la
|
|
||||||
am_libsimple_la_OBJECTS = callbacks-example-simple.lo
|
|
||||||
libsimple_la_OBJECTS = $(am_libsimple_la_OBJECTS)
|
|
||||||
libsimple_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
||||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
|
||||||
$(libsimple_la_LDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
|
||||||
am__maybe_remake_depfiles = depfiles
|
|
||||||
am__depfiles_remade = ./$(DEPDIR)/callbacks-example-baselinks.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-changecontent.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-contentfilter.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-displayheader.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-filename.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-filename2.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-filenameiisbug.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-listlinks.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-log.Plo \
|
|
||||||
./$(DEPDIR)/callbacks-example-simple.Plo
|
|
||||||
am__mv = mv -f
|
|
||||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
|
||||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
||||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
||||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
|
||||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
|
||||||
$(AM_CFLAGS) $(CFLAGS)
|
|
||||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
|
||||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
|
||||||
am__v_CC_0 = @echo " CC " $@;
|
|
||||||
am__v_CC_1 =
|
|
||||||
CCLD = $(CC)
|
|
||||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
||||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
|
||||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
|
||||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
|
||||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
|
||||||
am__v_CCLD_1 =
|
|
||||||
SOURCES = $(libbaselinks_la_SOURCES) $(libchangecontent_la_SOURCES) \
|
|
||||||
$(libcontentfilter_la_SOURCES) $(libdisplayheader_la_SOURCES) \
|
|
||||||
$(libfilename_la_SOURCES) $(libfilename2_la_SOURCES) \
|
|
||||||
$(libfilenameiisbug_la_SOURCES) $(liblistlinks_la_SOURCES) \
|
|
||||||
$(liblog_la_SOURCES) $(libsimple_la_SOURCES)
|
|
||||||
DIST_SOURCES = $(libbaselinks_la_SOURCES) \
|
|
||||||
$(libchangecontent_la_SOURCES) $(libcontentfilter_la_SOURCES) \
|
|
||||||
$(libdisplayheader_la_SOURCES) $(libfilename_la_SOURCES) \
|
|
||||||
$(libfilename2_la_SOURCES) $(libfilenameiisbug_la_SOURCES) \
|
|
||||||
$(liblistlinks_la_SOURCES) $(liblog_la_SOURCES) \
|
|
||||||
$(libsimple_la_SOURCES)
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
DATA = $(exemples_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
# Read a list of newline-separated strings from the standard input,
|
|
||||||
# and print each of them once, without duplicates. Input order is
|
|
||||||
# *not* preserved.
|
|
||||||
am__uniquify_input = $(AWK) '\
|
|
||||||
BEGIN { nonempty = 0; } \
|
|
||||||
{ items[$$0] = 1; nonempty = 1; } \
|
|
||||||
END { if (nonempty) { for (i in items) print i; }; } \
|
|
||||||
'
|
|
||||||
# Make sure the list of sources is unique. This is necessary because,
|
|
||||||
# e.g., the same source file might be shared among _SOURCES variables
|
|
||||||
# for different programs/libraries.
|
|
||||||
am__define_uniq_tagged_files = \
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | $(am__uniquify_input)`
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
exemplesdir = $(datadir)/httrack/libtest
|
|
||||||
# Glob against $(srcdir), not the build dir: a bare "*.c" is resolved relative to
|
|
||||||
# the build dir and stays unexpanded (breaking "make") in an out-of-tree build.
|
|
||||||
exemples_DATA = $(srcdir)/*.c $(srcdir)/*.h $(srcdir)/*.txt
|
|
||||||
EXTRA_DIST = $(exemples_DATA) libtest.mak libtest.vcproj
|
|
||||||
# Use $(top_srcdir)/src, not ../src: the latter is relative to the build dir and
|
|
||||||
# misses the source headers (e.g. httrack-library.h) in an out-of-tree build.
|
|
||||||
AM_CPPFLAGS = @DEFAULT_CFLAGS@ @THREADS_CFLAGS@ @V6_FLAG@ @LFS_FLAG@ \
|
|
||||||
-DPREFIX=\""$(prefix)"\" -DSYSCONFDIR=\""$(sysconfdir)"\" \
|
|
||||||
-DDATADIR=\""$(datadir)"\" -DLIBDIR=\""$(libdir)"\" \
|
|
||||||
-I$(top_srcdir)/src
|
|
||||||
|
|
||||||
# The callback examples reference libc only through libhttrack, so the direct
|
|
||||||
# libc edge gets dropped from DT_NEEDED (library-not-linked-against-libc).
|
|
||||||
# Force libc back; configure gates the flag since only a GNU-style linker
|
|
||||||
# accepts it (LIBC_FORCE_LINK is empty on e.g. macOS).
|
|
||||||
AM_LDFLAGS = \
|
|
||||||
@DEFAULT_LDFLAGS@ \
|
|
||||||
-L../src \
|
|
||||||
@LIBC_FORCE_LINK@
|
|
||||||
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
libbaselinks_la_SOURCES = callbacks-example-baselinks.c
|
|
||||||
libbaselinks_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libbaselinks_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libchangecontent_la_SOURCES = callbacks-example-changecontent.c
|
|
||||||
libchangecontent_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libchangecontent_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libcontentfilter_la_SOURCES = callbacks-example-contentfilter.c
|
|
||||||
libcontentfilter_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libcontentfilter_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libdisplayheader_la_SOURCES = callbacks-example-displayheader.c
|
|
||||||
libdisplayheader_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libdisplayheader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libfilename2_la_SOURCES = callbacks-example-filename2.c
|
|
||||||
libfilename2_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libfilename2_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libfilename_la_SOURCES = callbacks-example-filename.c
|
|
||||||
libfilename_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libfilename_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libfilenameiisbug_la_SOURCES = callbacks-example-filenameiisbug.c
|
|
||||||
libfilenameiisbug_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libfilenameiisbug_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
liblistlinks_la_SOURCES = callbacks-example-listlinks.c
|
|
||||||
liblistlinks_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
liblistlinks_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
liblog_la_SOURCES = callbacks-example-log.c
|
|
||||||
liblog_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
liblog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
libsimple_la_SOURCES = callbacks-example-simple.c
|
|
||||||
libsimple_la_LIBADD = $(THREADS_LIBS) $(SOCKET_LIBS) $(top_builddir)/src/libhttrack.la
|
|
||||||
libsimple_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
|
|
||||||
pkglib_LTLIBRARIES = libbaselinks.la libchangecontent.la libcontentfilter.la libdisplayheader.la libfilename2.la libfilename.la libfilenameiisbug.la liblistlinks.la liblog.la libsimple.la
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .lo .o .obj
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libtest/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu libtest/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
|
|
||||||
list2=; for p in $$list; do \
|
|
||||||
if test -f $$p; then \
|
|
||||||
list2="$$list2 $$p"; \
|
|
||||||
else :; fi; \
|
|
||||||
done; \
|
|
||||||
test -z "$$list2" || { \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
|
|
||||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
|
|
||||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
|
|
||||||
}
|
|
||||||
|
|
||||||
uninstall-pkglibLTLIBRARIES:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
|
|
||||||
for p in $$list; do \
|
|
||||||
$(am__strip_dir) \
|
|
||||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
|
|
||||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
|
|
||||||
done
|
|
||||||
|
|
||||||
clean-pkglibLTLIBRARIES:
|
|
||||||
-$(am__rm_f) $(pkglib_LTLIBRARIES)
|
|
||||||
@list='$(pkglib_LTLIBRARIES)'; \
|
|
||||||
locs=`for p in $$list; do echo $$p; done | \
|
|
||||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
|
||||||
sort -u`; \
|
|
||||||
echo rm -f $${locs}; \
|
|
||||||
$(am__rm_f) $${locs}
|
|
||||||
|
|
||||||
libbaselinks.la: $(libbaselinks_la_OBJECTS) $(libbaselinks_la_DEPENDENCIES) $(EXTRA_libbaselinks_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libbaselinks_la_LINK) -rpath $(pkglibdir) $(libbaselinks_la_OBJECTS) $(libbaselinks_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libchangecontent.la: $(libchangecontent_la_OBJECTS) $(libchangecontent_la_DEPENDENCIES) $(EXTRA_libchangecontent_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libchangecontent_la_LINK) -rpath $(pkglibdir) $(libchangecontent_la_OBJECTS) $(libchangecontent_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libcontentfilter.la: $(libcontentfilter_la_OBJECTS) $(libcontentfilter_la_DEPENDENCIES) $(EXTRA_libcontentfilter_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libcontentfilter_la_LINK) -rpath $(pkglibdir) $(libcontentfilter_la_OBJECTS) $(libcontentfilter_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libdisplayheader.la: $(libdisplayheader_la_OBJECTS) $(libdisplayheader_la_DEPENDENCIES) $(EXTRA_libdisplayheader_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libdisplayheader_la_LINK) -rpath $(pkglibdir) $(libdisplayheader_la_OBJECTS) $(libdisplayheader_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libfilename.la: $(libfilename_la_OBJECTS) $(libfilename_la_DEPENDENCIES) $(EXTRA_libfilename_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libfilename_la_LINK) -rpath $(pkglibdir) $(libfilename_la_OBJECTS) $(libfilename_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libfilename2.la: $(libfilename2_la_OBJECTS) $(libfilename2_la_DEPENDENCIES) $(EXTRA_libfilename2_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libfilename2_la_LINK) -rpath $(pkglibdir) $(libfilename2_la_OBJECTS) $(libfilename2_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libfilenameiisbug.la: $(libfilenameiisbug_la_OBJECTS) $(libfilenameiisbug_la_DEPENDENCIES) $(EXTRA_libfilenameiisbug_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libfilenameiisbug_la_LINK) -rpath $(pkglibdir) $(libfilenameiisbug_la_OBJECTS) $(libfilenameiisbug_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
liblistlinks.la: $(liblistlinks_la_OBJECTS) $(liblistlinks_la_DEPENDENCIES) $(EXTRA_liblistlinks_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(liblistlinks_la_LINK) -rpath $(pkglibdir) $(liblistlinks_la_OBJECTS) $(liblistlinks_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
liblog.la: $(liblog_la_OBJECTS) $(liblog_la_DEPENDENCIES) $(EXTRA_liblog_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(liblog_la_LINK) -rpath $(pkglibdir) $(liblog_la_OBJECTS) $(liblog_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
libsimple.la: $(libsimple_la_OBJECTS) $(libsimple_la_DEPENDENCIES) $(EXTRA_libsimple_la_DEPENDENCIES)
|
|
||||||
$(AM_V_CCLD)$(libsimple_la_LINK) -rpath $(pkglibdir) $(libsimple_la_OBJECTS) $(libsimple_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
mostlyclean-compile:
|
|
||||||
-rm -f *.$(OBJEXT)
|
|
||||||
|
|
||||||
distclean-compile:
|
|
||||||
-rm -f *.tab.c
|
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-baselinks.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-changecontent.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-contentfilter.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-displayheader.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-filename.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-filename2.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-filenameiisbug.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-listlinks.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-log.Plo@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-simple.Plo@am__quote@ # am--include-marker
|
|
||||||
|
|
||||||
$(am__depfiles_remade):
|
|
||||||
@$(MKDIR_P) $(@D)
|
|
||||||
@: >>$@
|
|
||||||
|
|
||||||
am--depfiles: $(am__depfiles_remade)
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
|
||||||
|
|
||||||
.c.obj:
|
|
||||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
|
||||||
|
|
||||||
.c.lo:
|
|
||||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
|
||||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
install-exemplesDATA: $(exemples_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(exemples_DATA)'; test -n "$(exemplesdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(exemplesdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(exemplesdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exemplesdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(exemplesdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-exemplesDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(exemples_DATA)'; test -n "$(exemplesdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(exemplesdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-am
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
shift; \
|
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
|
||||||
if test $$# -gt 0; then \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
"$$@" $$unique; \
|
|
||||||
else \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$unique; \
|
|
||||||
fi; \
|
|
||||||
fi
|
|
||||||
ctags: ctags-am
|
|
||||||
|
|
||||||
CTAGS: ctags
|
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|
||||||
$$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& $(am__cd) $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
|
||||||
cscopelist: cscopelist-am
|
|
||||||
|
|
||||||
cscopelist-am: $(am__tagged_files)
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
case "$(srcdir)" in \
|
|
||||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|
||||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|
||||||
esac; \
|
|
||||||
for i in $$list; do \
|
|
||||||
if test -f "$$i"; then \
|
|
||||||
echo "$(subdir)/$$i"; \
|
|
||||||
else \
|
|
||||||
echo "$$sdir/$$i"; \
|
|
||||||
fi; \
|
|
||||||
done >> $(top_builddir)/cscope.files
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(LTLIBRARIES) $(DATA)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(exemplesdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
|
|
||||||
mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-baselinks.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-changecontent.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-contentfilter.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-displayheader.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filename.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filename2.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filenameiisbug.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-listlinks.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-log.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-simple.Plo
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-compile distclean-generic \
|
|
||||||
distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-exemplesDATA
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am: install-pkglibLTLIBRARIES
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-baselinks.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-changecontent.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-contentfilter.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-displayheader.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filename.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filename2.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-filenameiisbug.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-listlinks.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-log.Plo
|
|
||||||
-rm -f ./$(DEPDIR)/callbacks-example-simple.Plo
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
|
||||||
mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-exemplesDATA uninstall-pkglibLTLIBRARIES
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
|
||||||
clean-generic clean-libtool clean-pkglibLTLIBRARIES \
|
|
||||||
cscopelist-am ctags ctags-am distclean distclean-compile \
|
|
||||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
|
||||||
dvi-am html html-am info info-am install install-am \
|
|
||||||
install-data install-data-am install-dvi install-dvi-am \
|
|
||||||
install-exec install-exec-am install-exemplesDATA install-html \
|
|
||||||
install-html-am install-info install-info-am install-man \
|
|
||||||
install-pdf install-pdf-am install-pkglibLTLIBRARIES \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
|
||||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
|
||||||
tags tags-am uninstall uninstall-am uninstall-exemplesDATA \
|
|
||||||
uninstall-pkglibLTLIBRARIES
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
479
m4/Makefile.in
479
m4/Makefile.in
@@ -1,479 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = m4
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
|
|
||||||
# Glob against $(srcdir) so "make dist" works out-of-tree (a bare "*.m4" is
|
|
||||||
# resolved against the build dir, where there are no sources).
|
|
||||||
EXTRA_DIST = $(srcdir)/*.m4
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu m4/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile
|
|
||||||
installdirs:
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
|
||||||
cscopelist-am ctags-am distclean distclean-generic \
|
|
||||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
|
||||||
install install-am install-data install-data-am install-dvi \
|
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
|
||||||
install-html-am install-info install-info-am install-man \
|
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
|
||||||
tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
574
man/Makefile.in
574
man/Makefile.in
@@ -1,574 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = man
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/check_zlib.m4 \
|
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/snprintf.m4 \
|
|
||||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
{ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
|
|
||||||
}
|
|
||||||
man1dir = $(mandir)/man1
|
|
||||||
am__installdirs = "$(DESTDIR)$(man1dir)"
|
|
||||||
NROFF = nroff
|
|
||||||
MANS = $(man_MANS)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AR = @AR@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BASH = @BASH@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CFLAGS_PIE = @CFLAGS_PIE@
|
|
||||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFAULT_CFLAGS = @DEFAULT_CFLAGS@
|
|
||||||
DEFAULT_LDFLAGS = @DEFAULT_LDFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
DL_LIBS = @DL_LIBS@
|
|
||||||
DSYMUTIL = @DSYMUTIL@
|
|
||||||
DUMPBIN = @DUMPBIN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
FGREP = @FGREP@
|
|
||||||
FILECMD = @FILECMD@
|
|
||||||
GREP = @GREP@
|
|
||||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
|
||||||
HTTPS_SUPPORT = @HTTPS_SUPPORT@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LD = @LD@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LDFLAGS_PIE = @LDFLAGS_PIE@
|
|
||||||
LFS_FLAG = @LFS_FLAG@
|
|
||||||
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LIPO = @LIPO@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
LT_CV_OBJDIR = @LT_CV_OBJDIR@
|
|
||||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
|
||||||
MAINT = @MAINT@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
NM = @NM@
|
|
||||||
NMEDIT = @NMEDIT@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ONLINE_UNIT_TESTS = @ONLINE_UNIT_TESTS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
OTOOL = @OTOOL@
|
|
||||||
OTOOL64 = @OTOOL64@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SED = @SED@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SHLIBPATH_VAR = @SHLIBPATH_VAR@
|
|
||||||
SOCKET_LIBS = @SOCKET_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
THREADS_CFLAGS = @THREADS_CFLAGS@
|
|
||||||
THREADS_LIBS = @THREADS_LIBS@
|
|
||||||
V6_FLAG = @V6_FLAG@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
VERSION_INFO = @VERSION_INFO@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_AR = @ac_ct_AR@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
|
|
||||||
# man_MANS = httrack.1
|
|
||||||
man_MANS = httrack.1 webhttrack.1 htsserver.1 proxytrack.1
|
|
||||||
EXTRA_DIST = $(man_MANS) makeman.sh
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu man/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
install-man1: $(man_MANS)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list1=''; \
|
|
||||||
list2='$(man_MANS)'; \
|
|
||||||
test -n "$(man1dir)" \
|
|
||||||
&& test -n "`echo $$list1$$list2`" \
|
|
||||||
|| exit 0; \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
|
|
||||||
{ for i in $$list1; do echo "$$i"; done; \
|
|
||||||
if test -n "$$list2"; then \
|
|
||||||
for i in $$list2; do echo "$$i"; done \
|
|
||||||
| sed -n '/\.1[a-z]*$$/p'; \
|
|
||||||
fi; \
|
|
||||||
} | while read p; do \
|
|
||||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; echo "$$p"; \
|
|
||||||
done | \
|
|
||||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
|
||||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
|
||||||
sed 'N;N;s,\n, ,g' | { \
|
|
||||||
list=; while read file base inst; do \
|
|
||||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
|
||||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
|
||||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
test -z "$$files" || { \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
|
|
||||||
done; }
|
|
||||||
|
|
||||||
uninstall-man1:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list=''; test -n "$(man1dir)" || exit 0; \
|
|
||||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
|
||||||
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
|
|
||||||
sed -n '/\.1[a-z]*$$/p'; \
|
|
||||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
|
||||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
|
||||||
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(MANS)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(man1dir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-man
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man: install-man1
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-man
|
|
||||||
|
|
||||||
uninstall-man: uninstall-man1
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
|
||||||
cscopelist-am ctags-am distclean distclean-generic \
|
|
||||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
|
||||||
install install-am install-data install-data-am install-dvi \
|
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
|
||||||
install-html-am install-info install-info-am install-man \
|
|
||||||
install-man1 install-pdf install-pdf-am install-ps \
|
|
||||||
install-ps-am install-strip installcheck installcheck-am \
|
|
||||||
installdirs maintainer-clean maintainer-clean-generic \
|
|
||||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
|
||||||
ps ps-am tags-am uninstall uninstall-am uninstall-man \
|
|
||||||
uninstall-man1
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
# Regenerate httrack.1 from the "httrack --help" output and the top-level
|
|
||||||
# README. Run by hand after changing options or help text:
|
|
||||||
# make -C man regen-man
|
|
||||||
# The generated page is committed; this target only refreshes it. Honors
|
|
||||||
# SOURCE_DATE_EPOCH for a reproducible date.
|
|
||||||
regen-man: makeman.sh $(top_builddir)/src/httrack$(EXEEXT)
|
|
||||||
README='$(top_srcdir)/README' $(SHELL) $(srcdir)/makeman.sh \
|
|
||||||
'$(top_builddir)/src/httrack$(EXEEXT)' > $(srcdir)/httrack.1
|
|
||||||
.PHONY: regen-man
|
|
||||||
|
|
||||||
# Render html/httrack.man.html from httrack.1. Needs the groff html device
|
|
||||||
# (Debian: full "groff" package, not "groff-base"). Run by hand: make -C man regen-man-html
|
|
||||||
regen-man-html: httrack.1
|
|
||||||
groff -t -man -Thtml $(srcdir)/httrack.1 > $(top_srcdir)/html/httrack.man.html
|
|
||||||
.PHONY: regen-man-html
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" This file is generated by man/makeman.sh; do not edit by hand.
|
.\" This file is generated by man/makeman.sh; do not edit by hand.
|
||||||
.\" SPDX-License-Identifier: GPL-3.0-or-later
|
.\" SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
.TH httrack 1 "13 June 2026" "httrack website copier"
|
.TH httrack 1 "27 June 2026" "httrack website copier"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
httrack \- offline browser : copy websites to a local directory
|
httrack \- offline browser : copy websites to a local directory
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -24,6 +24,7 @@ httrack \- offline browser : copy websites to a local directory
|
|||||||
[ \fB\-EN, \-\-max\-time[=N]\fR ]
|
[ \fB\-EN, \-\-max\-time[=N]\fR ]
|
||||||
[ \fB\-AN, \-\-max\-rate[=N]\fR ]
|
[ \fB\-AN, \-\-max\-rate[=N]\fR ]
|
||||||
[ \fB\-%cN, \-\-connection\-per\-second[=N]\fR ]
|
[ \fB\-%cN, \-\-connection\-per\-second[=N]\fR ]
|
||||||
|
[ \fB\-%G, \-\-pause\fR ]
|
||||||
[ \fB\-GN, \-\-max\-pause[=N]\fR ]
|
[ \fB\-GN, \-\-max\-pause[=N]\fR ]
|
||||||
[ \fB\-cN, \-\-sockets[=N]\fR ]
|
[ \fB\-cN, \-\-sockets[=N]\fR ]
|
||||||
[ \fB\-TN, \-\-timeout[=N]\fR ]
|
[ \fB\-TN, \-\-timeout[=N]\fR ]
|
||||||
@@ -43,11 +44,13 @@ httrack \- offline browser : copy websites to a local directory
|
|||||||
[ \fB\-x, \-\-replace\-external\fR ]
|
[ \fB\-x, \-\-replace\-external\fR ]
|
||||||
[ \fB\-%x, \-\-disable\-passwords\fR ]
|
[ \fB\-%x, \-\-disable\-passwords\fR ]
|
||||||
[ \fB\-%q, \-\-include\-query\-string\fR ]
|
[ \fB\-%q, \-\-include\-query\-string\fR ]
|
||||||
|
[ \fB\-%g, \-\-strip\-query\fR ]
|
||||||
[ \fB\-o, \-\-generate\-errors\fR ]
|
[ \fB\-o, \-\-generate\-errors\fR ]
|
||||||
[ \fB\-X, \-\-purge\-old[=N]\fR ]
|
[ \fB\-X, \-\-purge\-old[=N]\fR ]
|
||||||
[ \fB\-%p, \-\-preserve\fR ]
|
[ \fB\-%p, \-\-preserve\fR ]
|
||||||
[ \fB\-%T, \-\-utf8\-conversion\fR ]
|
[ \fB\-%T, \-\-utf8\-conversion\fR ]
|
||||||
[ \fB\-bN, \-\-cookies[=N]\fR ]
|
[ \fB\-bN, \-\-cookies[=N]\fR ]
|
||||||
|
[ \fB\-%K, \-\-cookies\-file\fR ]
|
||||||
[ \fB\-u, \-\-check\-type[=N]\fR ]
|
[ \fB\-u, \-\-check\-type[=N]\fR ]
|
||||||
[ \fB\-j, \-\-parse\-java[=N]\fR ]
|
[ \fB\-j, \-\-parse\-java[=N]\fR ]
|
||||||
[ \fB\-sN, \-\-robots[=N]\fR ]
|
[ \fB\-sN, \-\-robots[=N]\fR ]
|
||||||
@@ -153,6 +156,8 @@ maximum mirror time in seconds (60=1 minute, 3600=1 hour) (\-\-max\-time[=N])
|
|||||||
maximum transfer rate in bytes/seconds (1000=1KB/s max) (\-\-max\-rate[=N])
|
maximum transfer rate in bytes/seconds (1000=1KB/s max) (\-\-max\-rate[=N])
|
||||||
.IP \-%cN
|
.IP \-%cN
|
||||||
maximum number of connections/seconds (*%c10) (\-\-connection\-per\-second[=N])
|
maximum number of connections/seconds (*%c10) (\-\-connection\-per\-second[=N])
|
||||||
|
.IP \-%G
|
||||||
|
random pause of MIN[:MAX] seconds between files (e.g. %G5:10) (\-\-pause <param>)
|
||||||
.IP \-GN
|
.IP \-GN
|
||||||
pause transfer if N bytes reached, and wait until lock file is deleted (\-\-max\-pause[=N])
|
pause transfer if N bytes reached, and wait until lock file is deleted (\-\-max\-pause[=N])
|
||||||
.SS Flow control:
|
.SS Flow control:
|
||||||
@@ -198,6 +203,8 @@ replace external html links by error pages (\-\-replace\-external)
|
|||||||
do not include any password for external password protected websites (%x0 include) (\-\-disable\-passwords)
|
do not include any password for external password protected websites (%x0 include) (\-\-disable\-passwords)
|
||||||
.IP \-%q
|
.IP \-%q
|
||||||
*include query string for local files (useless, for information purpose only) (%q0 don't include) (\-\-include\-query\-string)
|
*include query string for local files (useless, for information purpose only) (%q0 don't include) (\-\-include\-query\-string)
|
||||||
|
.IP \-%g
|
||||||
|
strip query keys for dedup ([host/pattern=]key1,key2,...) (\-\-strip\-query <param>)
|
||||||
.IP \-o
|
.IP \-o
|
||||||
*generate output html file in case of error (404..) (o0 don't generate) (\-\-generate\-errors)
|
*generate output html file in case of error (404..) (o0 don't generate) (\-\-generate\-errors)
|
||||||
.IP \-X
|
.IP \-X
|
||||||
@@ -209,6 +216,8 @@ links conversion to UTF\-8 (\-\-utf8\-conversion)
|
|||||||
.SS Spider options:
|
.SS Spider options:
|
||||||
.IP \-bN
|
.IP \-bN
|
||||||
accept cookies in cookies.txt (0=do not accept,* 1=accept) (\-\-cookies[=N])
|
accept cookies in cookies.txt (0=do not accept,* 1=accept) (\-\-cookies[=N])
|
||||||
|
.IP \-%K
|
||||||
|
load extra cookies from a Netscape cookies.txt (\-\-cookies\-file <param>)
|
||||||
.IP \-u
|
.IP \-u
|
||||||
check document type if unknown (cgi,asp..) (u0 don't check, * u1 check but /, u2 check always) (\-\-check\-type[=N])
|
check document type if unknown (cgi,asp..) (u0 don't check, * u1 check but /, u2 check always) (\-\-check\-type[=N])
|
||||||
.IP \-j
|
.IP \-j
|
||||||
@@ -225,6 +234,8 @@ tolerant requests (accept bogus responses on some servers, but not standard!) (\
|
|||||||
update hacks: various hacks to limit re\-transfers when updating (identical size, bogus response..) (\-\-updatehack)
|
update hacks: various hacks to limit re\-transfers when updating (identical size, bogus response..) (\-\-updatehack)
|
||||||
.IP \-%u
|
.IP \-%u
|
||||||
url hacks: various hacks to limit duplicate URLs (strip //, www.foo.com==foo.com..) (\-\-urlhack)
|
url hacks: various hacks to limit duplicate URLs (strip //, www.foo.com==foo.com..) (\-\-urlhack)
|
||||||
|
.br
|
||||||
|
opt out of one url\-hack part: \-\-keep\-www\-prefix (www.foo.com<>foo.com), \-\-keep\-double\-slashes (//), \-\-keep\-query\-order (?b&a)
|
||||||
.IP \-%A
|
.IP \-%A
|
||||||
assume that a type (cgi,asp..) is always linked with a mime type (\-%A php3,cgi=text/html;dat,bin=application/x\-zip) (\-\-assume <param>)
|
assume that a type (cgi,asp..) is always linked with a mime type (\-%A php3,cgi=text/html;dat,bin=application/x\-zip) (\-\-assume <param>)
|
||||||
.br
|
.br
|
||||||
@@ -313,12 +324,8 @@ debug HTTP headers in logfile (\-\-debug\-headers)
|
|||||||
.SS Guru options: (do NOT use if possible)
|
.SS Guru options: (do NOT use if possible)
|
||||||
.IP \-#X
|
.IP \-#X
|
||||||
*use optimized engine (limited memory boundary checks) (\-\-fast\-engine)
|
*use optimized engine (limited memory boundary checks) (\-\-fast\-engine)
|
||||||
.IP \-#0
|
.IP \-#test
|
||||||
filter test (\-#0 '*.gif' 'www.bar.com/foo.gif') (\-\-debug\-testfilters <param>)
|
list engine self\-tests (run one with \-#test=NAME [args])
|
||||||
.IP \-#1
|
|
||||||
simplify test (\-#1 ./foo/bar/../foobar)
|
|
||||||
.IP \-#2
|
|
||||||
type test (\-#2 /foo/bar.php)
|
|
||||||
.IP \-#C
|
.IP \-#C
|
||||||
cache list (\-#C '*.com/spider*.gif' (\-\-debug\-cache <param>)
|
cache list (\-#C '*.com/spider*.gif' (\-\-debug\-cache <param>)
|
||||||
.IP \-#R
|
.IP \-#R
|
||||||
|
|||||||
236
missing
236
missing
@@ -1,236 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Common wrapper for a few potentially missing GNU and other programs.
|
|
||||||
|
|
||||||
scriptversion=2024-06-07.14; # UTC
|
|
||||||
|
|
||||||
# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
|
|
||||||
|
|
||||||
# Copyright (C) 1996-2024 Free Software Foundation, Inc.
|
|
||||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
echo 1>&2 "Try '$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
|
|
||||||
--is-lightweight)
|
|
||||||
# Used by our autoconf macros to check whether the available missing
|
|
||||||
# script is modern enough.
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
--run)
|
|
||||||
# Back-compat with the calling convention used by older automake.
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
|
||||||
echo "\
|
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
|
||||||
|
|
||||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
|
||||||
to PROGRAM being missing or too old.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help display this help and exit
|
|
||||||
-v, --version output version information and exit
|
|
||||||
|
|
||||||
Supported PROGRAM values:
|
|
||||||
aclocal autoconf autogen autoheader autom4te automake autoreconf
|
|
||||||
bison flex help2man lex makeinfo perl yacc
|
|
||||||
|
|
||||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
|
||||||
'g' are ignored when checking the name.
|
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
|
||||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
|
||||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
|
|
||||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
|
||||||
echo "missing (GNU Automake) $scriptversion"
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
|
|
||||||
-*)
|
|
||||||
echo 1>&2 "$0: unknown '$1' option"
|
|
||||||
echo 1>&2 "Try '$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Run the given program, remember its exit status.
|
|
||||||
"$@"; st=$?
|
|
||||||
|
|
||||||
# If it succeeded, we are done.
|
|
||||||
test $st -eq 0 && exit 0
|
|
||||||
|
|
||||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
|
||||||
# passed; such an option is passed most likely to detect whether the
|
|
||||||
# program is present and works.
|
|
||||||
case $2 in --version|--help) exit $st;; esac
|
|
||||||
|
|
||||||
# Exit code 63 means version mismatch. This often happens when the user
|
|
||||||
# tries to use an ancient version of a tool on a file that requires a
|
|
||||||
# minimum version.
|
|
||||||
if test $st -eq 63; then
|
|
||||||
msg="probably too old"
|
|
||||||
elif test $st -eq 127; then
|
|
||||||
# Program was missing.
|
|
||||||
msg="missing on your system"
|
|
||||||
else
|
|
||||||
# Program was found and executed, but failed. Give up.
|
|
||||||
exit $st
|
|
||||||
fi
|
|
||||||
|
|
||||||
perl_URL=https://www.perl.org/
|
|
||||||
flex_URL=https://github.com/westes/flex
|
|
||||||
gnu_software_URL=https://www.gnu.org/software
|
|
||||||
|
|
||||||
program_details ()
|
|
||||||
{
|
|
||||||
case $1 in
|
|
||||||
aclocal|automake|autoreconf)
|
|
||||||
echo "The '$1' program is part of the GNU Automake package:"
|
|
||||||
echo "<$gnu_software_URL/automake>"
|
|
||||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
|
||||||
echo "<$gnu_software_URL/autoconf>"
|
|
||||||
echo "<$gnu_software_URL/m4/>"
|
|
||||||
echo "<$perl_URL>"
|
|
||||||
;;
|
|
||||||
autoconf|autom4te|autoheader)
|
|
||||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
|
||||||
echo "<$gnu_software_URL/autoconf/>"
|
|
||||||
echo "It also requires GNU m4 and Perl in order to run:"
|
|
||||||
echo "<$gnu_software_URL/m4/>"
|
|
||||||
echo "<$perl_URL>"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
:
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
give_advice ()
|
|
||||||
{
|
|
||||||
# Normalize program name to check for.
|
|
||||||
normalized_program=`echo "$1" | sed '
|
|
||||||
s/^gnu-//; t
|
|
||||||
s/^gnu//; t
|
|
||||||
s/^g//; t'`
|
|
||||||
|
|
||||||
printf '%s\n' "'$1' is $msg."
|
|
||||||
|
|
||||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
|
||||||
autoheader_deps="'acconfig.h'"
|
|
||||||
automake_deps="'Makefile.am'"
|
|
||||||
aclocal_deps="'acinclude.m4'"
|
|
||||||
case $normalized_program in
|
|
||||||
aclocal*)
|
|
||||||
echo "You should only need it if you modified $aclocal_deps or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
;;
|
|
||||||
autoconf*)
|
|
||||||
echo "You should only need it if you modified $configure_deps."
|
|
||||||
;;
|
|
||||||
autogen*)
|
|
||||||
echo "You should only need it if you modified a '.def' or '.tpl' file."
|
|
||||||
echo "You may want to install the GNU AutoGen package:"
|
|
||||||
echo "<$gnu_software_URL/autogen/>"
|
|
||||||
;;
|
|
||||||
autoheader*)
|
|
||||||
echo "You should only need it if you modified $autoheader_deps or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
;;
|
|
||||||
automake*)
|
|
||||||
echo "You should only need it if you modified $automake_deps or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
;;
|
|
||||||
autom4te*)
|
|
||||||
echo "You might have modified some maintainer files that require"
|
|
||||||
echo "the 'autom4te' program to be rebuilt."
|
|
||||||
;;
|
|
||||||
autoreconf*)
|
|
||||||
echo "You should only need it if you modified $aclocal_deps or"
|
|
||||||
echo "$automake_deps or $autoheader_deps or $automake_deps or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
;;
|
|
||||||
bison*|yacc*)
|
|
||||||
echo "You should only need it if you modified a '.y' file."
|
|
||||||
echo "You may want to install the GNU Bison package:"
|
|
||||||
echo "<$gnu_software_URL/bison/>"
|
|
||||||
;;
|
|
||||||
help2man*)
|
|
||||||
echo "You should only need it if you modified a dependency" \
|
|
||||||
"of a man page."
|
|
||||||
echo "You may want to install the GNU Help2man package:"
|
|
||||||
echo "<$gnu_software_URL/help2man/>"
|
|
||||||
;;
|
|
||||||
lex*|flex*)
|
|
||||||
echo "You should only need it if you modified a '.l' file."
|
|
||||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
|
||||||
echo "<$flex_URL>"
|
|
||||||
;;
|
|
||||||
makeinfo*)
|
|
||||||
echo "You should only need it if you modified a '.texi' file, or"
|
|
||||||
echo "any other file indirectly affecting the aspect of the manual."
|
|
||||||
echo "You might want to install the Texinfo package:"
|
|
||||||
echo "<$gnu_software_URL/texinfo/>"
|
|
||||||
echo "The spurious makeinfo call might also be the consequence of"
|
|
||||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
|
||||||
echo "want to install GNU make:"
|
|
||||||
echo "<$gnu_software_URL/make/>"
|
|
||||||
;;
|
|
||||||
perl*)
|
|
||||||
echo "You should only need it to run GNU Autoconf, GNU Automake, "
|
|
||||||
echo " assorted other tools, or if you modified a Perl source file."
|
|
||||||
echo "You may want to install the Perl 5 language interpreter:"
|
|
||||||
echo "<$perl_URL>"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "You might have modified some files without having the proper"
|
|
||||||
echo "tools for further handling them. Check the 'README' file, it"
|
|
||||||
echo "often tells you about the needed prerequisites for installing"
|
|
||||||
echo "this package. You may also peek at any GNU archive site, in"
|
|
||||||
echo "case some other package contains this missing '$1' program."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
program_details "$normalized_program"
|
|
||||||
}
|
|
||||||
|
|
||||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
|
||||||
-e '2,$s/^/ /' >&2
|
|
||||||
|
|
||||||
# Propagate the correct exit status (expected to be 127 for a program
|
|
||||||
# not found, 63 for a program that failed due to version mismatch).
|
|
||||||
exit $st
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
@@ -56,21 +56,21 @@ whttrackrundir = $(bindir)
|
|||||||
whttrackrun_SCRIPTS = webhttrack
|
whttrackrun_SCRIPTS = webhttrack
|
||||||
|
|
||||||
libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
|
libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
|
||||||
htscache_selftest.c \
|
htscache_selftest.c htsdns_selftest.c htsselftest.c \
|
||||||
htscatchurl.c htsfilters.c htsftp.c htshash.c coucal/coucal.c \
|
htscatchurl.c htsfilters.c htsftp.c htshash.c coucal/coucal.c \
|
||||||
htshelp.c htslib.c htscoremain.c \
|
htshelp.c htslib.c htscoremain.c \
|
||||||
htsname.c htsrobots.c htstools.c htswizard.c \
|
htsname.c htsrobots.c htstools.c htswizard.c \
|
||||||
htsalias.c htsthread.c htsindex.c htsbauth.c \
|
htsalias.c htsthread.c htsindex.c htsbauth.c \
|
||||||
htsmd5.c htszlib.c htswrap.c htsconcat.c \
|
htsmd5.c htszlib.c htswrap.c htsconcat.c \
|
||||||
htsmodules.c htscharset.c punycode.c htsencoding.c \
|
htsmodules.c htscharset.c punycode.c htsencoding.c htssniff.c \
|
||||||
md5.c \
|
md5.c \
|
||||||
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \
|
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c \
|
||||||
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \
|
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \
|
||||||
htsbasenet.h htsbauth.h htscache.h htscache_selftest.h htscatchurl.h \
|
htsbasenet.h htsbauth.h htscache.h htscache_selftest.h htsdns_selftest.h htsselftest.h htscatchurl.h \
|
||||||
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
|
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
|
||||||
htsfilters.h htsftp.h htsglobal.h htshash.h coucal/coucal.h \
|
htsfilters.h htsftp.h htsglobal.h htshash.h coucal/coucal.h \
|
||||||
htshelp.h htsindex.h htslib.h htsmd5.h \
|
htshelp.h htsindex.h htslib.h htsmd5.h \
|
||||||
htsmodules.h htsname.h htsnet.h \
|
htsmodules.h htsname.h htsnet.h htssniff.h \
|
||||||
htsopt.h htsrobots.h htsthread.h \
|
htsopt.h htsrobots.h htsthread.h \
|
||||||
htstools.h htswizard.h htswrap.h htszlib.h \
|
htstools.h htswizard.h htswrap.h htszlib.h \
|
||||||
htsstrings.h htsarrays.h httrack-library.h \
|
htsstrings.h htsarrays.h httrack-library.h \
|
||||||
|
|||||||
1652
src/Makefile.in
1652
src/Makefile.in
File diff suppressed because it is too large
Load Diff
@@ -41,20 +41,6 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
#define _NOT_NULL(a) ( (a!=NULL) ? (a) : "" )
|
#define _NOT_NULL(a) ( (a!=NULL) ? (a) : "" )
|
||||||
|
|
||||||
// COPY OF cmdl_ins in htsmain.c
|
|
||||||
// Insert a command in the argc/argv
|
|
||||||
#define cmdl_ins(token,argc,argv,buff,ptr) \
|
|
||||||
{ \
|
|
||||||
int i; \
|
|
||||||
for(i=argc;i>0;i--)\
|
|
||||||
argv[i]=argv[i-1];\
|
|
||||||
} \
|
|
||||||
argv[0]=(buff+ptr); \
|
|
||||||
strcpybuff(argv[0],token); \
|
|
||||||
ptr += (int) (strlen(argv[0])+1); \
|
|
||||||
argc++
|
|
||||||
// END OF COPY OF cmdl_ins in htsmain.c
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Aliases for command-line and config file definitions
|
Aliases for command-line and config file definitions
|
||||||
These definitions can be used:
|
These definitions can be used:
|
||||||
@@ -74,6 +60,9 @@ Please visit our Website: http://www.httrack.com
|
|||||||
param1 : this option must be alone, and needs one distinct parameter (-P <path>)
|
param1 : this option must be alone, and needs one distinct parameter (-P <path>)
|
||||||
param0 : this option must be alone, but the parameter should be put together (+*.gif)
|
param0 : this option must be alone, but the parameter should be put together (+*.gif)
|
||||||
*/
|
*/
|
||||||
|
/* clang-format off: hand-aligned table; clang-format reflows the whole
|
||||||
|
initializer (2->4 space) on any edit, churning every untouched row. */
|
||||||
|
/* clang-format off */
|
||||||
const char *hts_optalias[][4] = {
|
const char *hts_optalias[][4] = {
|
||||||
/* {"","","",""}, */
|
/* {"","","",""}, */
|
||||||
{"path", "-O", "param1", "output path"},
|
{"path", "-O", "param1", "output path"},
|
||||||
@@ -121,6 +110,12 @@ const char *hts_optalias[][4] = {
|
|||||||
{"disable-passwords", "-%x", "single", ""}, {"disable-password", "-%x",
|
{"disable-passwords", "-%x", "single", ""}, {"disable-password", "-%x",
|
||||||
"single", ""},
|
"single", ""},
|
||||||
{"include-query-string", "-%q", "single", ""},
|
{"include-query-string", "-%q", "single", ""},
|
||||||
|
{"strip-query", "-%g", "param1",
|
||||||
|
"strip [host/pattern=]key1,key2,... from URLs"},
|
||||||
|
{"cookies-file", "-%K", "param1",
|
||||||
|
"load extra cookies from a Netscape cookies.txt"},
|
||||||
|
{"pause", "-%G", "param1",
|
||||||
|
"random pause of MIN[:MAX] seconds between files"},
|
||||||
{"generate-errors", "-o", "single", ""},
|
{"generate-errors", "-o", "single", ""},
|
||||||
{"do-not-generate-errors", "-o0", "single", ""},
|
{"do-not-generate-errors", "-o0", "single", ""},
|
||||||
{"purge-old", "-X", "param", ""},
|
{"purge-old", "-X", "param", ""},
|
||||||
@@ -137,6 +132,9 @@ const char *hts_optalias[][4] = {
|
|||||||
{"tolerant", "-%B", "single", ""},
|
{"tolerant", "-%B", "single", ""},
|
||||||
{"updatehack", "-%s", "single", ""}, {"sizehack", "-%s", "single", ""},
|
{"updatehack", "-%s", "single", ""}, {"sizehack", "-%s", "single", ""},
|
||||||
{"urlhack", "-%u", "single", ""},
|
{"urlhack", "-%u", "single", ""},
|
||||||
|
{"keep-www-prefix", "-%j", "single", ""},
|
||||||
|
{"keep-double-slashes", "-%o", "single", ""},
|
||||||
|
{"keep-query-order", "-%y", "single", ""},
|
||||||
{"user-agent", "-F", "param1", "user-agent identity"},
|
{"user-agent", "-F", "param1", "user-agent identity"},
|
||||||
{"referer", "-%R", "param1", "default referer URL"},
|
{"referer", "-%R", "param1", "default referer URL"},
|
||||||
{"from", "-%E", "param1", "from email address"},
|
{"from", "-%E", "param1", "from email address"},
|
||||||
@@ -255,6 +253,7 @@ const char *hts_optalias[][4] = {
|
|||||||
|
|
||||||
{"", "", "", ""}
|
{"", "", "", ""}
|
||||||
};
|
};
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Check for alias in command-line
|
Check for alias in command-line
|
||||||
@@ -284,7 +283,6 @@ int optalias_check(int argc, const char *const *argv, int n_arg,
|
|||||||
char *position;
|
char *position;
|
||||||
int need_param = 1;
|
int need_param = 1;
|
||||||
|
|
||||||
//int return_param=0;
|
|
||||||
int pos;
|
int pos;
|
||||||
|
|
||||||
command[0] = param[0] = addcommand[0] = '\0';
|
command[0] = param[0] = addcommand[0] = '\0';
|
||||||
@@ -362,7 +360,6 @@ int optalias_check(int argc, const char *const *argv, int n_arg,
|
|||||||
strlcatbuff(return_argv[0], "0", return_argv_size);
|
strlcatbuff(return_argv[0], "0", return_argv_size);
|
||||||
else if (strcmp(param, "on") == 0) {
|
else if (strcmp(param, "on") == 0) {
|
||||||
// on is the default
|
// on is the default
|
||||||
// strcatbuff(return_argv[0],"1");
|
|
||||||
} else
|
} else
|
||||||
strlcatbuff(return_argv[0], param, return_argv_size);
|
strlcatbuff(return_argv[0], param, return_argv_size);
|
||||||
}
|
}
|
||||||
@@ -468,7 +465,7 @@ const char *optalias_help(const char *token) {
|
|||||||
*/
|
*/
|
||||||
/* Note: NOT utf-8 */
|
/* Note: NOT utf-8 */
|
||||||
int optinclude_file(const char *name, int *argc, char **argv, char *x_argvblk,
|
int optinclude_file(const char *name, int *argc, char **argv, char *x_argvblk,
|
||||||
int *x_ptr) {
|
size_t x_argvblk_size, int *x_ptr) {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
fp = fopen(name, "rb");
|
fp = fopen(name, "rb");
|
||||||
@@ -542,14 +539,15 @@ int optinclude_file(const char *name, int *argc, char **argv, char *x_argvblk,
|
|||||||
/* temporary argc: Number of parameters after minus insert_after_argc */
|
/* temporary argc: Number of parameters after minus insert_after_argc */
|
||||||
insert_after_argc = (*argc) - insert_after;
|
insert_after_argc = (*argc) - insert_after;
|
||||||
cmdl_ins((tmp_argv[2]), insert_after_argc, (argv + insert_after),
|
cmdl_ins((tmp_argv[2]), insert_after_argc, (argv + insert_after),
|
||||||
x_argvblk, (*x_ptr));
|
x_argvblk, x_argvblk_size, (*x_ptr));
|
||||||
*argc = insert_after_argc + insert_after;
|
*argc = insert_after_argc + insert_after;
|
||||||
insert_after++;
|
insert_after++;
|
||||||
/* Second one */
|
/* Second one */
|
||||||
if (return_argc > 1) {
|
if (return_argc > 1) {
|
||||||
insert_after_argc = (*argc) - insert_after;
|
insert_after_argc = (*argc) - insert_after;
|
||||||
cmdl_ins((tmp_argv[3]), insert_after_argc,
|
cmdl_ins((tmp_argv[3]), insert_after_argc,
|
||||||
(argv + insert_after), x_argvblk, (*x_ptr));
|
(argv + insert_after), x_argvblk, x_argvblk_size,
|
||||||
|
(*x_ptr));
|
||||||
*argc = insert_after_argc + insert_after;
|
*argc = insert_after_argc + insert_after;
|
||||||
insert_after++;
|
insert_after++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,13 +45,41 @@ int optalias_find(const char *token);
|
|||||||
const char *optalias_help(const char *token);
|
const char *optalias_help(const char *token);
|
||||||
int optreal_find(const char *token);
|
int optreal_find(const char *token);
|
||||||
int optinclude_file(const char *name, int *argc, char **argv, char *x_argvblk,
|
int optinclude_file(const char *name, int *argc, char **argv, char *x_argvblk,
|
||||||
int *x_ptr);
|
size_t x_argvblk_size, int *x_ptr);
|
||||||
const char *optreal_value(int p);
|
const char *optreal_value(int p);
|
||||||
const char *optalias_value(int p);
|
const char *optalias_value(int p);
|
||||||
const char *opttype_value(int p);
|
const char *opttype_value(int p);
|
||||||
const char *opthelp_value(int p);
|
const char *opthelp_value(int p);
|
||||||
const char *hts_gethome(void);
|
const char *hts_gethome(void);
|
||||||
void expand_home(String * str);
|
void expand_home(String * str);
|
||||||
|
|
||||||
|
/* Command-line argv-block builders, shared by htscoremain.c (the CLI parser)
|
||||||
|
and htsalias.c (config-file alias expansion). Tokens are packed back-to-back
|
||||||
|
into x_argvblk (total capacity bufsize); each argv[] entry points into the
|
||||||
|
block. cmdl_room bounds every copy: the running offset ptr can outrun the
|
||||||
|
block (alias / doit.log expansion outpacing the +32768 slack), so it yields
|
||||||
|
0 rather than a wrapped size_t and the bounded copy aborts cleanly. */
|
||||||
|
#define cmdl_room(bufsize, ptr) \
|
||||||
|
((ptr) < (size_t) (bufsize) ? (size_t) (bufsize) - (ptr) : 0)
|
||||||
|
|
||||||
|
/* Append a token as a new argv[argc]. */
|
||||||
|
#define cmdl_add(token, argc, argv, buff, bufsize, ptr) \
|
||||||
|
argv[argc] = (buff + ptr); \
|
||||||
|
strlcpybuff(argv[argc], token, cmdl_room(bufsize, ptr)); \
|
||||||
|
ptr += (int) (strlen(argv[argc]) + 1); \
|
||||||
|
argc++
|
||||||
|
|
||||||
|
/* Insert a token at argv[0], shifting the existing argc entries up by one. */
|
||||||
|
#define cmdl_ins(token, argc, argv, buff, bufsize, ptr) \
|
||||||
|
{ \
|
||||||
|
int i; \
|
||||||
|
for (i = argc; i > 0; i--) \
|
||||||
|
argv[i] = argv[i - 1]; \
|
||||||
|
} \
|
||||||
|
argv[0] = (buff + ptr); \
|
||||||
|
strlcpybuff(argv[0], token, cmdl_room(bufsize, ptr)); \
|
||||||
|
ptr += (int) (strlen(argv[0]) + 1); \
|
||||||
|
argc++
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
151
src/htsarrays.h
151
src/htsarrays.h
@@ -30,6 +30,12 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** @file htsarrays.h
|
||||||
|
* Header-only generic dynamic array (a typed growable vector). All operations
|
||||||
|
* are macros parameterized by the array lvalue A; the element type T is fixed
|
||||||
|
* by the struct TypedArray(T) declares. Counts and capacities are in
|
||||||
|
* elements, not bytes. The array owns its backing store: grow it via the Add/
|
||||||
|
* Append/EnsureRoom macros and release it with TypedArrayFree. */
|
||||||
#ifndef HTS_ARRAYS_DEFSTATIC
|
#ifndef HTS_ARRAYS_DEFSTATIC
|
||||||
#define HTS_ARRAYS_DEFSTATIC
|
#define HTS_ARRAYS_DEFSTATIC
|
||||||
|
|
||||||
@@ -39,111 +45,118 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
#include "htssafe.h"
|
#include "htssafe.h"
|
||||||
|
|
||||||
/* Memory allocation assertion failure */
|
/* Abort (with the failed byte count) when a growth allocation fails. The
|
||||||
|
array macros never return an out-of-memory error; they assert and abort. */
|
||||||
static void hts_record_assert_memory_failed(const size_t size) {
|
static void hts_record_assert_memory_failed(const size_t size) {
|
||||||
fprintf(stderr, "memory allocation failed (%lu bytes)", \
|
fprintf(stderr, "memory allocation failed (%lu bytes)", (long int) size);
|
||||||
(long int) size); \
|
assertf(!"memory allocation failed");
|
||||||
assertf(! "memory allocation failed"); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Dynamic array of T elements. **/
|
/** Dynamic array of T elements. **/
|
||||||
#define TypedArray(T) \
|
#define TypedArray(T) \
|
||||||
struct { \
|
struct { \
|
||||||
/** Elements. **/ \
|
/** Elements. **/ \
|
||||||
union { \
|
union { \
|
||||||
/** Typed. **/ \
|
/** Typed. **/ \
|
||||||
T* elts; \
|
T *elts; \
|
||||||
/** Opaque. **/ \
|
/** Opaque. **/ \
|
||||||
void* ptr; \
|
void *ptr; \
|
||||||
} data; \
|
} data; \
|
||||||
/** Count. **/ \
|
/** Count. **/ \
|
||||||
size_t size; \
|
size_t size; \
|
||||||
/** Capacity. **/ \
|
/** Capacity. **/ \
|
||||||
size_t capa; \
|
size_t capa; \
|
||||||
}
|
}
|
||||||
#define EMPTY_TYPED_ARRAY { { NULL }, 0, 0 }
|
|
||||||
|
/** Initializer for an empty array (no backing store, size and capacity 0). **/
|
||||||
|
#define EMPTY_TYPED_ARRAY {{NULL}, 0, 0}
|
||||||
|
|
||||||
/** Array size, in elements. **/
|
/** Array size, in elements. **/
|
||||||
#define TypedArraySize(A) ((A).size)
|
#define TypedArraySize(A) ((A).size)
|
||||||
|
|
||||||
/** Array capacity, in elements. **/
|
/** Array capacity, in elements. **/
|
||||||
#define TypedArrayCapa(A) ((A).capa)
|
#define TypedArrayCapa(A) ((A).capa)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remaining free space, in elements.
|
* Remaining free space, in elements.
|
||||||
* Macro, first element evaluated multiple times.
|
* Macro, first element evaluated multiple times.
|
||||||
**/
|
**/
|
||||||
#define TypedArrayRoom(A) ( TypedArrayCapa(A) - TypedArraySize(A) )
|
#define TypedArrayRoom(A) (TypedArrayCapa(A) - TypedArraySize(A))
|
||||||
|
|
||||||
/** Array elements, of type T*. **/
|
/** Array elements, of type T*. **/
|
||||||
#define TypedArrayElts(A) ((A).data.elts)
|
#define TypedArrayElts(A) ((A).data.elts)
|
||||||
|
|
||||||
/** Array pointer, of type void*. **/
|
/** Array pointer, of type void*. **/
|
||||||
#define TypedArrayPtr(A) ((A).data.ptr)
|
#define TypedArrayPtr(A) ((A).data.ptr)
|
||||||
|
|
||||||
/** Size of T. **/
|
/** Size of T. **/
|
||||||
#define TypedArrayWidth(A) (sizeof(*TypedArrayElts(A)))
|
#define TypedArrayWidth(A) (sizeof(*TypedArrayElts(A)))
|
||||||
|
|
||||||
/** Nth element of the array. **/
|
/** Nth element of the array, as an lvalue. No bounds check; N must be
|
||||||
|
< TypedArraySize(A). **/
|
||||||
#define TypedArrayNth(A, N) (TypedArrayElts(A)[N])
|
#define TypedArrayNth(A, N) (TypedArrayElts(A)[N])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tail of the array (outside the array).
|
* Tail of the array (outside the array).
|
||||||
* The returned pointer points to the beginning of TypedArrayRoom(A)
|
* The returned pointer points to the beginning of TypedArrayRoom(A)
|
||||||
* free elements.
|
* free elements.
|
||||||
**/
|
**/
|
||||||
#define TypedArrayTail(A) (TypedArrayNth(A, TypedArraySize(A)))
|
#define TypedArrayTail(A) (TypedArrayNth(A, TypedArraySize(A)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure at least 'ROOM' elements can be put in the remaining space.
|
* Ensure at least 'ROOM' elements can be put in the remaining space.
|
||||||
* After a call to this macro, TypedArrayRoom(A) is guaranteed to be at
|
* After a call to this macro, TypedArrayRoom(A) is guaranteed to be at
|
||||||
* least equal to 'ROOM'.
|
* least equal to 'ROOM'.
|
||||||
**/
|
**/
|
||||||
#define TypedArrayEnsureRoom(A, ROOM) do { \
|
#define TypedArrayEnsureRoom(A, ROOM) \
|
||||||
const size_t room_ = (ROOM); \
|
do { \
|
||||||
while (TypedArrayRoom(A) < room_) { \
|
const size_t room_ = (ROOM); \
|
||||||
TypedArrayCapa(A) = TypedArrayCapa(A) < 16 ? 16 : TypedArrayCapa(A) * 2; \
|
while (TypedArrayRoom(A) < room_) { \
|
||||||
} \
|
TypedArrayCapa(A) = TypedArrayCapa(A) < 16 ? 16 : TypedArrayCapa(A) * 2; \
|
||||||
TypedArrayPtr(A) = realloc(TypedArrayPtr(A), \
|
} \
|
||||||
TypedArrayCapa(A)*TypedArrayWidth(A)); \
|
TypedArrayPtr(A) = \
|
||||||
if (TypedArrayPtr(A) == NULL) { \
|
realloc(TypedArrayPtr(A), TypedArrayCapa(A) * TypedArrayWidth(A)); \
|
||||||
hts_record_assert_memory_failed(TypedArrayCapa(A)*TypedArrayWidth(A)); \
|
if (TypedArrayPtr(A) == NULL) { \
|
||||||
} \
|
hts_record_assert_memory_failed(TypedArrayCapa(A) * TypedArrayWidth(A)); \
|
||||||
} while(0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/** Add an element. Macro, first element evaluated multiple times. **/
|
/** Add an element. Macro, first element evaluated multiple times. **/
|
||||||
#define TypedArrayAdd(A, E) do { \
|
#define TypedArrayAdd(A, E) \
|
||||||
TypedArrayEnsureRoom(A, 1); \
|
do { \
|
||||||
assertf(TypedArraySize(A) < TypedArrayCapa(A)); \
|
TypedArrayEnsureRoom(A, 1); \
|
||||||
TypedArrayTail(A) = (E); \
|
assertf(TypedArraySize(A) < TypedArrayCapa(A)); \
|
||||||
TypedArraySize(A)++; \
|
TypedArrayTail(A) = (E); \
|
||||||
} while(0)
|
TypedArraySize(A)++; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add 'COUNT' elements from 'PTR'.
|
* Add 'COUNT' elements from 'PTR'.
|
||||||
* Macro, first element evaluated multiple times.
|
* Macro, first element evaluated multiple times.
|
||||||
**/
|
**/
|
||||||
#define TypedArrayAppend(A, PTR, COUNT) do { \
|
#define TypedArrayAppend(A, PTR, COUNT) \
|
||||||
const size_t count_ = (COUNT); \
|
do { \
|
||||||
/* This 1-case is to benefit from type safety. */ \
|
const size_t count_ = (COUNT); \
|
||||||
if (count_ == 1) { \
|
/* This 1-case is to benefit from type safety. */ \
|
||||||
TypedArrayAdd(A, *(PTR)); \
|
if (count_ == 1) { \
|
||||||
} else { \
|
TypedArrayAdd(A, *(PTR)); \
|
||||||
const void *const source_ = (PTR); \
|
} else { \
|
||||||
TypedArrayEnsureRoom(A, count_); \
|
const void *const source_ = (PTR); \
|
||||||
assertf(count_ <= TypedArrayRoom(A)); \
|
TypedArrayEnsureRoom(A, count_); \
|
||||||
memcpy(&TypedArrayTail(A), source_, count_ * TypedArrayWidth(A)); \
|
assertf(count_ <= TypedArrayRoom(A)); \
|
||||||
TypedArraySize(A) += count_; \
|
memcpy(&TypedArrayTail(A), source_, count_ *TypedArrayWidth(A)); \
|
||||||
} \
|
TypedArraySize(A) += count_; \
|
||||||
} while(0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/** Clear an array, freeing memory and clearing size and capacity. **/
|
/** Clear an array, freeing memory and clearing size and capacity. **/
|
||||||
#define TypedArrayFree(A) do { \
|
#define TypedArrayFree(A) \
|
||||||
if (TypedArrayPtr(A) != NULL) { \
|
do { \
|
||||||
TypedArrayCapa(A) = TypedArraySize(A) = 0; \
|
if (TypedArrayPtr(A) != NULL) { \
|
||||||
free(TypedArrayPtr(A)); \
|
TypedArrayCapa(A) = TypedArraySize(A) = 0; \
|
||||||
TypedArrayPtr(A) = NULL; \
|
free(TypedArrayPtr(A)); \
|
||||||
} \
|
TypedArrayPtr(A) = NULL; \
|
||||||
} while(0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
553
src/htsback.c
553
src/htsback.c
@@ -43,21 +43,22 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
#include "htsback.h"
|
#include "htsback.h"
|
||||||
|
|
||||||
//#ifdef _WIN32
|
|
||||||
#include "htsftp.h"
|
#include "htsftp.h"
|
||||||
#if HTS_USEZLIB
|
#if HTS_USEZLIB
|
||||||
#include "htszlib.h"
|
#include "htszlib.h"
|
||||||
#else
|
#else
|
||||||
#error HTS_USEZLIB not defined
|
#error HTS_USEZLIB not defined
|
||||||
#endif
|
#endif
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
// DOS
|
// DOS
|
||||||
#include <process.h> /* _beginthread, _endthread */
|
#include <process.h> /* _beginthread, _endthread */
|
||||||
#endif
|
#endif
|
||||||
|
#include <io.h> /* _chsize_s */
|
||||||
|
#define HTS_FTRUNCATE(fp, sz) _chsize_s(_fileno(fp), (sz))
|
||||||
#else
|
#else
|
||||||
|
#define HTS_FTRUNCATE(fp, sz) ftruncate(fileno(fp), (sz))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VT_CLREOL "\33[K"
|
#define VT_CLREOL "\33[K"
|
||||||
@@ -73,6 +74,8 @@ struct_back *back_new(httrackp *opt, int back_max) {
|
|||||||
|
|
||||||
sback->count = back_max;
|
sback->count = back_max;
|
||||||
sback->lnk = (lien_back *) calloct((back_max + 1), sizeof(lien_back));
|
sback->lnk = (lien_back *) calloct((back_max + 1), sizeof(lien_back));
|
||||||
|
sback->connect_fallback = (hts_connect_fallback *) calloct(
|
||||||
|
(back_max + 1), sizeof(hts_connect_fallback));
|
||||||
sback->ready = coucal_new(0);
|
sback->ready = coucal_new(0);
|
||||||
hts_set_hash_handler(sback->ready, opt);
|
hts_set_hash_handler(sback->ready, opt);
|
||||||
coucal_set_name(sback->ready, "back_new");
|
coucal_set_name(sback->ready, "back_new");
|
||||||
@@ -83,6 +86,7 @@ struct_back *back_new(httrackp *opt, int back_max) {
|
|||||||
sback->lnk[i].r.location = sback->lnk[i].location_buffer;
|
sback->lnk[i].r.location = sback->lnk[i].location_buffer;
|
||||||
sback->lnk[i].status = STATUS_FREE;
|
sback->lnk[i].status = STATUS_FREE;
|
||||||
sback->lnk[i].r.soc = INVALID_SOCKET;
|
sback->lnk[i].r.soc = INVALID_SOCKET;
|
||||||
|
sback->connect_fallback[i].addr_count = -1; // not yet probed
|
||||||
}
|
}
|
||||||
return sback;
|
return sback;
|
||||||
}
|
}
|
||||||
@@ -93,6 +97,7 @@ void back_free(struct_back ** sback) {
|
|||||||
freet((*sback)->lnk);
|
freet((*sback)->lnk);
|
||||||
(*sback)->lnk = NULL;
|
(*sback)->lnk = NULL;
|
||||||
}
|
}
|
||||||
|
freet((*sback)->connect_fallback);
|
||||||
if ((*sback)->ready != NULL) {
|
if ((*sback)->ready != NULL) {
|
||||||
coucal_delete(&(*sback)->ready);
|
coucal_delete(&(*sback)->ready);
|
||||||
(*sback)->ready_size_bytes = 0;
|
(*sback)->ready_size_bytes = 0;
|
||||||
@@ -102,6 +107,72 @@ void back_free(struct_back ** sback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Per-candidate connect deadline cap (seconds): a connecting slot with another
|
||||||
|
address to try waits at most this long before falling back, instead of the
|
||||||
|
full (default 120s) slot timeout. Caps the dead-IPv6 stall while staying well
|
||||||
|
above a normal handshake. The last candidate still gets the full timeout. */
|
||||||
|
#define HTS_CONNECT_FALLBACK_TIMEOUT 10
|
||||||
|
|
||||||
|
int back_connect_fallback_due(int addr_index, int addr_count, int elapsed,
|
||||||
|
int timeout) {
|
||||||
|
int deadline;
|
||||||
|
|
||||||
|
if (addr_index + 1 >= addr_count) // last (or only) candidate: no fallback
|
||||||
|
return 0;
|
||||||
|
if (timeout <= 0) // no timeout management: never force it
|
||||||
|
return 0;
|
||||||
|
deadline = (timeout < HTS_CONNECT_FALLBACK_TIMEOUT)
|
||||||
|
? timeout
|
||||||
|
: HTS_CONNECT_FALLBACK_TIMEOUT;
|
||||||
|
return elapsed >= deadline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pending-connect result for a non-blocking socket reported ready by select():
|
||||||
|
0 = connected, >0 = the connect errno (refused, unreachable, ...), -1 if the
|
||||||
|
probe itself failed. A failed connect is reported writable too, so this is
|
||||||
|
how success is told from failure without blocking. */
|
||||||
|
static int connect_socket_error(T_SOC soc) {
|
||||||
|
int soerr = 0;
|
||||||
|
socklen_t len = (socklen_t) sizeof(soerr);
|
||||||
|
|
||||||
|
if (getsockopt(soc, SOL_SOCKET, SO_ERROR, (char *) &soerr, &len) != 0)
|
||||||
|
return -1;
|
||||||
|
return soerr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Retry a stuck/failed connecting slot against its next resolved address.
|
||||||
|
Closes the current socket and starts a non-blocking connect to the next
|
||||||
|
candidate, leaving the slot in STATUS_CONNECTING. Returns 1 if a new connect
|
||||||
|
was started, 0 if no fallback address remains (caller fails the slot). */
|
||||||
|
static int back_connect_next(httrackp *opt, struct_back *sback, int i) {
|
||||||
|
hts_connect_fallback *const cf = &sback->connect_fallback[i];
|
||||||
|
lien_back *const back = sback->lnk;
|
||||||
|
const int next = cf->addr_index + 1;
|
||||||
|
T_SOC soc;
|
||||||
|
|
||||||
|
if (next >= cf->addr_count)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (back[i].r.soc != INVALID_SOCKET) {
|
||||||
|
deletehttp(&back[i].r);
|
||||||
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
|
}
|
||||||
|
soc = newhttp_addr(opt, back[i].url_adr, &back[i].r, -1, 0, next, NULL);
|
||||||
|
if (soc == INVALID_SOCKET)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
back[i].r.soc = soc;
|
||||||
|
cf->addr_index = next;
|
||||||
|
cf->connect_start = time_local();
|
||||||
|
if (back[i].timeout > 0)
|
||||||
|
back[i].timeout_refresh = cf->connect_start;
|
||||||
|
back[i].status = STATUS_CONNECTING;
|
||||||
|
hts_log_print(opt, LOG_DEBUG,
|
||||||
|
"connect failed, trying next address (%d/%d) for %s", next + 1,
|
||||||
|
cf->addr_count, back[i].url_adr);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void back_delete_all(httrackp * opt, cache_back * cache, struct_back * sback) {
|
void back_delete_all(httrackp * opt, cache_back * cache, struct_back * sback) {
|
||||||
if (sback != NULL) {
|
if (sback != NULL) {
|
||||||
int i;
|
int i;
|
||||||
@@ -499,9 +570,12 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
&& back[p].r.size != back[p].r.totalsize && !opt->tolerant) {
|
&& back[p].r.size != back[p].r.totalsize && !opt->tolerant) {
|
||||||
if (back[p].status == STATUS_READY) {
|
if (back[p].status == STATUS_READY) {
|
||||||
hts_log_print(opt, LOG_WARNING,
|
hts_log_print(opt, LOG_WARNING,
|
||||||
"file not stored in cache due to bogus state (broken size, expected "
|
"incomplete transfer (expected " LLintP
|
||||||
LLintP " got " LLintP "): %s%s", back[p].r.totalsize,
|
" bytes, got " LLintP
|
||||||
back[p].r.size, back[p].url_adr, back[p].url_fil);
|
"): file not cached, will be retried on the next update"
|
||||||
|
" (use -%%B to cache anyway): %s%s",
|
||||||
|
back[p].r.totalsize, back[p].r.size, back[p].url_adr,
|
||||||
|
back[p].url_fil);
|
||||||
} else {
|
} else {
|
||||||
hts_log_print(opt, LOG_INFO,
|
hts_log_print(opt, LOG_INFO,
|
||||||
"incomplete file not yet stored in cache (expected "
|
"incomplete file not yet stored in cache (expected "
|
||||||
@@ -521,7 +595,6 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
#if HTS_USEZLIB
|
#if HTS_USEZLIB
|
||||||
if (back[p].r.compressed) {
|
if (back[p].r.compressed) {
|
||||||
if (back[p].r.size > 0) {
|
if (back[p].r.size > 0) {
|
||||||
//if ( (back[p].r.adr) && (back[p].r.size>0) ) {
|
|
||||||
// stats
|
// stats
|
||||||
back[p].compressed_size = back[p].r.size;
|
back[p].compressed_size = back[p].r.size;
|
||||||
// en mémoire -> passage sur disque
|
// en mémoire -> passage sur disque
|
||||||
@@ -806,11 +879,12 @@ int back_finalize(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
back[p].url_fil, NULL);
|
back[p].url_fil, NULL);
|
||||||
} else {
|
} else {
|
||||||
/* Partial file, but marked as "ok" ? */
|
/* Partial file, but marked as "ok" ? */
|
||||||
hts_log_print(opt, LOG_WARNING,
|
hts_log_print(
|
||||||
"file not stored in cache due to bogus state (incomplete type with %s (%d), size "
|
opt, LOG_WARNING,
|
||||||
LLintP "): %s%s", back[p].r.msg, back[p].r.statuscode,
|
"file with unresolved type not cached (%s (%d), size " LLintP
|
||||||
(LLint) back[p].r.size, back[p].url_adr,
|
"): %s%s",
|
||||||
back[p].url_fil);
|
back[p].r.msg, back[p].r.statuscode, (LLint) back[p].r.size,
|
||||||
|
back[p].url_adr, back[p].url_fil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -850,7 +924,6 @@ int back_letlive(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
/* clear everything but connection: switch, close, and reswitch */
|
/* clear everything but connection: switch, close, and reswitch */
|
||||||
back_connxfr(src, &tmp);
|
back_connxfr(src, &tmp);
|
||||||
back_delete(opt, cache, sback, p);
|
back_delete(opt, cache, sback, p);
|
||||||
//deletehttp(src);
|
|
||||||
back_connxfr(&tmp, src);
|
back_connxfr(&tmp, src);
|
||||||
src->req.flush_garbage = 1; /* ignore CRLF garbage */
|
src->req.flush_garbage = 1; /* ignore CRLF garbage */
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1285,7 +1358,49 @@ int back_flush_output(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Move a still-writing .delayed placeholder to its final name (#483). */
|
||||||
|
hts_boolean back_delayed_rename(httrackp *opt, lien_back *back,
|
||||||
|
const char *newname) {
|
||||||
|
hts_boolean renamed;
|
||||||
|
|
||||||
|
if (!back->r.is_write || back->tmpfile != NULL ||
|
||||||
|
!IS_DELAYED_EXT(back->url_sav) || strcmp(back->url_sav, newname) == 0)
|
||||||
|
return HTS_TRUE; /* nothing bound to the placeholder name */
|
||||||
|
if (back->r.out != NULL) {
|
||||||
|
fclose(back->r.out);
|
||||||
|
back->r.out = NULL;
|
||||||
|
}
|
||||||
|
renamed = RENAME(back->url_sav, newname) == 0 ? HTS_TRUE : HTS_FALSE;
|
||||||
|
if (renamed && (back->status == STATUS_READY ||
|
||||||
|
(back->r.out = FOPEN(newname, "ab")) != NULL)) {
|
||||||
|
filenote(&opt->state.strc, newname, NULL);
|
||||||
|
hts_log_print(opt, LOG_DEBUG, "moved placeholder %s to %s", back->url_sav,
|
||||||
|
newname);
|
||||||
|
return HTS_TRUE;
|
||||||
|
}
|
||||||
|
/* partial lost: drop only what we own (Windows rename won't overwrite) */
|
||||||
|
hts_log_print(opt, LOG_WARNING | LOG_ERRNO, "unable to move %s to %s",
|
||||||
|
back->url_sav, newname);
|
||||||
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
|
strcpybuff(back->r.msg, "Write error on disk");
|
||||||
|
back->r.is_write = 0;
|
||||||
|
(void) UNLINK(renamed ? newname : back->url_sav);
|
||||||
|
return HTS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// effacer entrée
|
// effacer entrée
|
||||||
|
/* Discard a cancelled mid-write .delayed placeholder (unusable across runs). */
|
||||||
|
void back_delayed_discard(httrackp *opt, lien_back *back) {
|
||||||
|
if (back->r.out != NULL) {
|
||||||
|
fclose(back->r.out);
|
||||||
|
back->r.out = NULL;
|
||||||
|
}
|
||||||
|
back->r.is_write = 0;
|
||||||
|
if (opt != NULL)
|
||||||
|
url_savename_refname_remove(opt, back->url_adr, back->url_fil);
|
||||||
|
(void) UNLINK(back->url_sav);
|
||||||
|
}
|
||||||
|
|
||||||
int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
||||||
const int p) {
|
const int p) {
|
||||||
lien_back *const back = sback->lnk;
|
lien_back *const back = sback->lnk;
|
||||||
@@ -1293,6 +1408,12 @@ int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
|
|
||||||
assertf(p >= 0 && p < back_max);
|
assertf(p >= 0 && p < back_max);
|
||||||
if (p >= 0 && p < sback->count) { // on sait jamais..
|
if (p >= 0 && p < sback->count) { // on sait jamais..
|
||||||
|
/* mid-write cancel: drop a .delayed placeholder; real-named partials
|
||||||
|
survive for resume (--continue) */
|
||||||
|
if (back[p].r.is_write && IS_DELAYED_EXT(back[p].url_sav) &&
|
||||||
|
(back[p].status != STATUS_READY || back[p].r.statuscode <= 0)) {
|
||||||
|
back_delayed_discard(opt, &back[p]);
|
||||||
|
}
|
||||||
// Vérificateur d'intégrité
|
// Vérificateur d'intégrité
|
||||||
#if DEBUG_CHECKINT
|
#if DEBUG_CHECKINT
|
||||||
_CHECKINT(&back[p], "Appel back_delete")
|
_CHECKINT(&back[p], "Appel back_delete")
|
||||||
@@ -1312,7 +1433,6 @@ int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
|||||||
back[p].url_adr, back[p].url_fil, back[p].url_sav);
|
back[p].url_adr, back[p].url_fil, back[p].url_sav);
|
||||||
}
|
}
|
||||||
if (cache != NULL) {
|
if (cache != NULL) {
|
||||||
//hts_log_print(opt, LOG_TRACE, "finalizing from back_delete");
|
|
||||||
back_finalize(opt, cache, sback, p);
|
back_finalize(opt, cache, sback, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1453,7 +1573,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
if (back[p].r.soc != INVALID_SOCKET) { /* we never know */
|
if (back[p].r.soc != INVALID_SOCKET) { /* we never know */
|
||||||
deletehttp(&back[p].r);
|
deletehttp(&back[p].r);
|
||||||
}
|
}
|
||||||
//memset(&(back[p].r), 0, sizeof(htsblk));
|
|
||||||
hts_init_htsblk(&back[p].r);
|
hts_init_htsblk(&back[p].r);
|
||||||
back[p].r.location = back[p].location_buffer;
|
back[p].r.location = back[p].location_buffer;
|
||||||
|
|
||||||
@@ -1461,7 +1580,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
strcpybuff(back[p].url_adr, adr);
|
strcpybuff(back[p].url_adr, adr);
|
||||||
strcpybuff(back[p].url_fil, fil);
|
strcpybuff(back[p].url_fil, fil);
|
||||||
strcpybuff(back[p].url_sav, save);
|
strcpybuff(back[p].url_sav, save);
|
||||||
//back[p].links_index = links_index;
|
|
||||||
// copier referer si besoin
|
// copier referer si besoin
|
||||||
strcpybuff(back[p].referer_adr, "");
|
strcpybuff(back[p].referer_adr, "");
|
||||||
strcpybuff(back[p].referer_fil, "");
|
strcpybuff(back[p].referer_fil, "");
|
||||||
@@ -1700,8 +1818,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
back[p].url_adr, back[p].url_fil);
|
back[p].url_adr, back[p].url_fil);
|
||||||
}
|
}
|
||||||
back[p].r.notmodified = 1; // fichier non modifié
|
back[p].r.notmodified = 1; // fichier non modifié
|
||||||
back[p].status = STATUS_READY; // OK prêt
|
back[p].status = STATUS_READY; // OK prêt
|
||||||
//file_notify(back[p].url_adr, back[p].url_fil, back[p].url_sav, 0, 0, back[p].r.notmodified); // not modified
|
|
||||||
back_set_finished(sback, p);
|
back_set_finished(sback, p);
|
||||||
|
|
||||||
// finalize transfer
|
// finalize transfer
|
||||||
@@ -1716,7 +1833,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
} else { // erreur
|
} else { // erreur
|
||||||
// effacer r
|
// effacer r
|
||||||
hts_init_htsblk(&back[p].r);
|
hts_init_htsblk(&back[p].r);
|
||||||
//memset(&(back[p].r), 0, sizeof(htsblk));
|
|
||||||
back[p].r.location = back[p].location_buffer;
|
back[p].r.location = back[p].location_buffer;
|
||||||
// et continuer (chercher le fichier)
|
// et continuer (chercher le fichier)
|
||||||
}
|
}
|
||||||
@@ -1911,8 +2027,10 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
// ouvrir liaison, envoyer requète
|
// ouvrir liaison, envoyer requète
|
||||||
// ne pas traiter ou recevoir l'en tête immédiatement
|
// ne pas traiter ou recevoir l'en tête immédiatement
|
||||||
hts_init_htsblk(&back[p].r);
|
hts_init_htsblk(&back[p].r);
|
||||||
//memset(&(back[p].r), 0, sizeof(htsblk));
|
|
||||||
back[p].r.location = back[p].location_buffer;
|
back[p].r.location = back[p].location_buffer;
|
||||||
|
// fresh connect: address list not yet probed, start at the first
|
||||||
|
sback->connect_fallback[p].addr_index = 0;
|
||||||
|
sback->connect_fallback[p].addr_count = -1;
|
||||||
// recopier proxy
|
// recopier proxy
|
||||||
if ((back[p].r.req.proxy.active = opt->proxy.active)) {
|
if ((back[p].r.req.proxy.active = opt->proxy.active)) {
|
||||||
if (StringBuff(opt->proxy.bindhost) != NULL)
|
if (StringBuff(opt->proxy.bindhost) != NULL)
|
||||||
@@ -1959,7 +2077,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
#if HTS_USEOPENSSL
|
#if HTS_USEOPENSSL
|
||||||
else if (strfield(back[p].url_adr, "https://")) { // let's rock
|
else if (strfield(back[p].url_adr, "https://")) { // let's rock
|
||||||
back[p].r.ssl = 1;
|
back[p].r.ssl = 1;
|
||||||
// back[p].r.ssl_soc = NULL;
|
|
||||||
back[p].r.ssl_con = NULL;
|
back[p].r.ssl_con = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -2025,9 +2142,9 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
back[p].rateout = -1; // pas de gestion (default)
|
back[p].rateout = -1; // pas de gestion (default)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: on charge les code-page erreurs (erreur 404, etc) dans le cas où cela est
|
// Note: on charge les code-page erreurs (erreur 404, etc) dans le cas où
|
||||||
// rattrapable (exemple: 301,302 moved xxx -> refresh sur la page!)
|
// cela est rattrapable (exemple: 301,302 moved xxx -> refresh sur la
|
||||||
//if ((back[p].statuscode!=HTTP_OK) || (soc<0)) { // ERREUR HTTP/autre
|
// page!)
|
||||||
|
|
||||||
#if CNXDEBUG
|
#if CNXDEBUG
|
||||||
printf("Xfopen ok, poll..\n");
|
printf("Xfopen ok, poll..\n");
|
||||||
@@ -2045,7 +2162,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
if (soc == INVALID_SOCKET) { // erreur socket
|
if (soc == INVALID_SOCKET) { // erreur socket
|
||||||
back[p].status = STATUS_READY; // FINI
|
back[p].status = STATUS_READY; // FINI
|
||||||
back_set_finished(sback, p);
|
back_set_finished(sback, p);
|
||||||
//if (back[p].soc!=INVALID_SOCKET) deletehttp(back[p].soc);
|
|
||||||
back[p].r.soc = INVALID_SOCKET;
|
back[p].r.soc = INVALID_SOCKET;
|
||||||
} else {
|
} else {
|
||||||
if (!back[p].r.is_file)
|
if (!back[p].r.is_file)
|
||||||
@@ -2066,8 +2182,6 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
|
|||||||
|
|
||||||
// note: si il y a erreur (404,etc) status=2 (terminé/échec) mais
|
// note: si il y a erreur (404,etc) status=2 (terminé/échec) mais
|
||||||
// le lien est considéré comme traité
|
// le lien est considéré comme traité
|
||||||
//if (back[p].soc<0) // erreur
|
|
||||||
// return -1;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -2140,9 +2254,6 @@ void back_solve(httrackp * opt, lien_back * back) {
|
|||||||
} else {
|
} else {
|
||||||
hts_log_print(opt, LOG_DEBUG, "failed to resolve: %s", a);
|
hts_log_print(opt, LOG_DEBUG, "failed to resolve: %s", a);
|
||||||
}
|
}
|
||||||
//if (hts_dnstest(opt, a, 1) == 2) { // non encore testé!..
|
|
||||||
// hts_log_print(opt, LOG_DEBUG, "resolving in background: %s", a);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2161,12 +2272,13 @@ int host_wait(httrackp * opt, lien_back * back) {
|
|||||||
|
|
||||||
static int slot_can_be_cleaned(const lien_back * back) {
|
static int slot_can_be_cleaned(const lien_back * back) {
|
||||||
return (back->status == STATUS_READY) // ready
|
return (back->status == STATUS_READY) // ready
|
||||||
/* Check autoclean */
|
/* Check autoclean */
|
||||||
&& (!back->testmode) // not test mode
|
&& (!back->locked) // not held by hts_wait_delayed (name pending)
|
||||||
&& (strnotempty(back->url_sav)) // filename exists
|
&& (!back->testmode) // not test mode
|
||||||
&& (HTTP_IS_OK(back->r.statuscode)) // HTTP "OK"
|
&& (strnotempty(back->url_sav)) // filename exists
|
||||||
&& (back->r.size >= 0) // size>=0
|
&& (HTTP_IS_OK(back->r.statuscode)) // HTTP "OK"
|
||||||
;
|
&& (back->r.size >= 0) // size>=0
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int slot_can_be_finalized(httrackp * opt, const lien_back * back) {
|
static int slot_can_be_finalized(httrackp * opt, const lien_back * back) {
|
||||||
@@ -2190,11 +2302,6 @@ void back_clean(httrackp * opt, cache_back * cache, struct_back * sback) {
|
|||||||
(void) back_flush_output(opt, cache, sback, i); // flush output buffers
|
(void) back_flush_output(opt, cache, sback, i); // flush output buffers
|
||||||
usercommand(opt, 0, NULL, back[i].url_sav, back[i].url_adr,
|
usercommand(opt, 0, NULL, back[i].url_sav, back[i].url_adr,
|
||||||
back[i].url_fil);
|
back[i].url_fil);
|
||||||
//if (back[i].links_index >= 0) {
|
|
||||||
// assertf(back[i].links_index < opt->hash->max_lien);
|
|
||||||
// opt->hash->liens[back[i].links_index]->pass2 = -1;
|
|
||||||
// // *back[i].pass2_ptr=-1; // Done!
|
|
||||||
//}
|
|
||||||
/* MANDATORY if we don't want back_fill() to endlessly put the same file on download! */
|
/* MANDATORY if we don't want back_fill() to endlessly put the same file on download! */
|
||||||
{
|
{
|
||||||
int index = hash_read(opt->hash, back[i].url_sav, NULL, HASH_STRUCT_FILENAME ); // lecture type 0 (sav)
|
int index = hash_read(opt->hash, back[i].url_sav, NULL, HASH_STRUCT_FILENAME ); // lecture type 0 (sav)
|
||||||
@@ -2342,6 +2449,34 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back_clean(opt, cache, sback);
|
back_clean(opt, cache, sback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Time limit exceeded past grace: abort in-flight transfers so no wait loop
|
||||||
|
starves (#481). FTP slots stay, their thread owns the socket. */
|
||||||
|
if (!back_checkmirror(opt)) {
|
||||||
|
int aborted = 0;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
for (i = 0; i < (unsigned int) back_max; i++) {
|
||||||
|
if (back[i].status > 0 && back[i].status < STATUS_FTP_TRANSFER) {
|
||||||
|
if (back[i].r.soc != INVALID_SOCKET) {
|
||||||
|
deletehttp(&back[i].r);
|
||||||
|
}
|
||||||
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
|
/* drop a .delayed placeholder; real partials survive for resume */
|
||||||
|
if (back[i].r.is_write && IS_DELAYED_EXT(back[i].url_sav))
|
||||||
|
back_delayed_discard(opt, &back[i]);
|
||||||
|
back[i].r.statuscode = STATUSCODE_TIMEOUT;
|
||||||
|
strcpybuff(back[i].r.msg, "Mirror Time Out");
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
aborted++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (aborted > 0)
|
||||||
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"time limit reached, %d transfer(s) aborted", aborted);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// recevoir tant qu'il y a des données (avec un maximum de max_loop boucles)
|
// recevoir tant qu'il y a des données (avec un maximum de max_loop boucles)
|
||||||
do_wait = 0;
|
do_wait = 0;
|
||||||
gestion_timeout = 0;
|
gestion_timeout = 0;
|
||||||
@@ -2350,9 +2485,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
|
|
||||||
busy_state = busy_recv = 0;
|
busy_state = busy_recv = 0;
|
||||||
|
|
||||||
#if 0
|
|
||||||
check_rate(stat_timestart, opt->maxrate); // vérifier taux de transfert
|
|
||||||
#endif
|
|
||||||
// inscrire les sockets actuelles, et rechercher l'ID la plus élevée
|
// inscrire les sockets actuelles, et rechercher l'ID la plus élevée
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
FD_ZERO(&fds_c);
|
FD_ZERO(&fds_c);
|
||||||
@@ -2362,28 +2494,31 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
nfds = INVALID_SOCKET;
|
nfds = INVALID_SOCKET;
|
||||||
|
|
||||||
max_c = 1;
|
max_c = 1;
|
||||||
for(i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
for (i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
||||||
// for(i=0;i<back_max;i++) {
|
|
||||||
unsigned int i = (i_mod + mod_random) % (back_max);
|
unsigned int i = (i_mod + mod_random) % (back_max);
|
||||||
|
|
||||||
// en cas de gestion du connect préemptif
|
// en cas de gestion du connect préemptif
|
||||||
#if HTS_XCONN
|
#if HTS_XCONN
|
||||||
if (back[i].status == STATUS_CONNECTING) { // connexion
|
if (back[i].status == STATUS_CONNECTING) { // connexion
|
||||||
do_wait = 1;
|
// a connecting slot always carries a live socket; guard anyway so a
|
||||||
|
// stray INVALID_SOCKET can never reach FD_SET (mirrors the recv branch)
|
||||||
|
if (back[i].r.soc != INVALID_SOCKET) {
|
||||||
|
do_wait = 1;
|
||||||
|
|
||||||
// noter socket write
|
// noter socket write
|
||||||
FD_SET(back[i].r.soc, &fds_c);
|
FD_SET(back[i].r.soc, &fds_c);
|
||||||
|
|
||||||
// noter socket erreur
|
// noter socket erreur
|
||||||
FD_SET(back[i].r.soc, &fds_e);
|
FD_SET(back[i].r.soc, &fds_e);
|
||||||
|
|
||||||
// calculer max
|
// calculer max
|
||||||
if (max_c) {
|
if (max_c) {
|
||||||
max_c = 0;
|
max_c = 0;
|
||||||
nfds = back[i].r.soc;
|
nfds = back[i].r.soc;
|
||||||
} else if (back[i].r.soc > nfds) {
|
} else if (back[i].r.soc > nfds) {
|
||||||
// ID socket la plus élevée
|
// ID socket la plus élevée
|
||||||
nfds = back[i].r.soc;
|
nfds = back[i].r.soc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else
|
} else
|
||||||
@@ -2396,8 +2531,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
// poll pour la lecture sur les sockets
|
// poll pour la lecture sur les sockets
|
||||||
if ((back[i].status > 0) && (back[i].status < 100)) { // en réception http
|
if ((back[i].status > 0) && (back[i].status < 100)) { // en réception http
|
||||||
|
|
||||||
#if BDEBUG==1
|
#if BDEBUG == 1
|
||||||
//printf("....socket in progress: %d\n",back[i].r.soc);
|
|
||||||
#endif
|
#endif
|
||||||
// non local et non ftp
|
// non local et non ftp
|
||||||
if (!back[i].r.is_file) {
|
if (!back[i].r.is_file) {
|
||||||
@@ -2483,8 +2617,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
busy_recv = 0;
|
busy_recv = 0;
|
||||||
|
|
||||||
// recevoir les données arrivées
|
// recevoir les données arrivées
|
||||||
for(i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
for (i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
||||||
// for(i=0;i<back_max;i++) {
|
|
||||||
unsigned int i = (i_mod + mod_random) % (back_max);
|
unsigned int i = (i_mod + mod_random) % (back_max);
|
||||||
|
|
||||||
if (back[i].status > 0) {
|
if (back[i].status > 0) {
|
||||||
@@ -2517,8 +2650,20 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
}
|
}
|
||||||
// ---- FLAG WRITE MIS A UN?: POUR LE CONNECT
|
// ---- FLAG WRITE MIS A UN?: POUR LE CONNECT
|
||||||
if (back[i].status == STATUS_CONNECTING) { // attendre connect
|
if (back[i].status == STATUS_CONNECTING) { // attendre connect
|
||||||
|
hts_connect_fallback *const cf = &sback->connect_fallback[i];
|
||||||
int dispo = 0;
|
int dispo = 0;
|
||||||
|
|
||||||
|
// probe the resolved address list once per fresh connect (cache hit:
|
||||||
|
// the host was resolved when this connect was opened)
|
||||||
|
if (cf->addr_count < 0 && back[i].r.soc != INVALID_SOCKET &&
|
||||||
|
!back[i].r.is_file) {
|
||||||
|
SOCaddr scratch[HTS_MAXADDRNUM];
|
||||||
|
|
||||||
|
cf->addr_count = hts_dns_resolve_all(opt, back[i].url_adr, scratch,
|
||||||
|
HTS_MAXADDRNUM, NULL);
|
||||||
|
cf->connect_start = time_local();
|
||||||
|
}
|
||||||
|
|
||||||
// vérifier l'existance de timeout-check
|
// vérifier l'existance de timeout-check
|
||||||
if (!gestion_timeout)
|
if (!gestion_timeout)
|
||||||
if (back[i].timeout > 0)
|
if (back[i].timeout > 0)
|
||||||
@@ -2526,14 +2671,45 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
|
|
||||||
// connecté?
|
// connecté?
|
||||||
dispo = FD_ISSET(back[i].r.soc, &fds_c);
|
dispo = FD_ISSET(back[i].r.soc, &fds_c);
|
||||||
if (dispo) { // ok connected!!
|
if (dispo) { // socket ready: connect() finished (ok or failed)
|
||||||
|
// a refused/failed connect is reported writable too; probe SO_ERROR
|
||||||
|
// and, on failure, fall back to the next address (or fail the slot)
|
||||||
|
if (connect_socket_error(back[i].r.soc) != 0) {
|
||||||
|
if (!back_connect_next(opt, sback, i)) {
|
||||||
|
deletehttp(&back[i].r);
|
||||||
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
|
back[i].r.statuscode = STATUSCODE_CONNERROR;
|
||||||
|
strcpybuff(back[i].r.msg, "Connect Error");
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
}
|
||||||
|
continue; // reconnected (stay connecting) or failed
|
||||||
|
}
|
||||||
busy_state = 1;
|
busy_state = 1;
|
||||||
|
|
||||||
#if HTS_USEOPENSSL
|
#if HTS_USEOPENSSL
|
||||||
/* SSL mode */
|
/* SSL mode */
|
||||||
if (back[i].r.ssl) {
|
if (back[i].r.ssl) {
|
||||||
|
int tunnel_ok = 1;
|
||||||
|
|
||||||
|
// https via proxy: CONNECT-tunnel before TLS (#85)
|
||||||
|
if (back[i].r.req.proxy.active && back[i].r.ssl_con == NULL) {
|
||||||
|
const int timeout = back[i].timeout > 0 ? back[i].timeout : 30;
|
||||||
|
|
||||||
|
tunnel_ok =
|
||||||
|
http_proxy_tunnel(opt, &back[i].r, back[i].url_adr, timeout);
|
||||||
|
if (!tunnel_ok) {
|
||||||
|
if (!strnotempty(back[i].r.msg))
|
||||||
|
strcpybuff(back[i].r.msg, "proxy CONNECT failed");
|
||||||
|
deletehttp(&back[i].r);
|
||||||
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
|
back[i].r.statuscode = STATUSCODE_NON_FATAL;
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
// handshake not yet launched
|
// handshake not yet launched
|
||||||
if (!back[i].r.ssl_con) {
|
if (tunnel_ok && !back[i].r.ssl_con) {
|
||||||
SSL_CTX_set_options(openssl_ctx, SSL_OP_ALL);
|
SSL_CTX_set_options(openssl_ctx, SSL_OP_ALL);
|
||||||
// new session
|
// new session
|
||||||
back[i].r.ssl_con = SSL_new(openssl_ctx);
|
back[i].r.ssl_con = SSL_new(openssl_ctx);
|
||||||
@@ -2551,7 +2727,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].r.statuscode = STATUSCODE_SSL_HANDSHAKE;
|
back[i].r.statuscode = STATUSCODE_SSL_HANDSHAKE;
|
||||||
}
|
}
|
||||||
/* Error */
|
/* Error */
|
||||||
if (back[i].r.statuscode == STATUSCODE_SSL_HANDSHAKE) {
|
if (tunnel_ok && back[i].r.statuscode == STATUSCODE_SSL_HANDSHAKE) {
|
||||||
strcpybuff(back[i].r.msg, "bad SSL/TLS handshake");
|
strcpybuff(back[i].r.msg, "bad SSL/TLS handshake");
|
||||||
deletehttp(&back[i].r);
|
deletehttp(&back[i].r);
|
||||||
back[i].r.soc = INVALID_SOCKET;
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
@@ -2581,7 +2757,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].rateout_time = back[i].ka_time_start;
|
back[i].rateout_time = back[i].ka_time_start;
|
||||||
}
|
}
|
||||||
// envoyer header
|
// envoyer header
|
||||||
//if (strcmp(back[i].url_sav,BACK_ADD_TEST)!=0) // vrai get
|
|
||||||
HTS_STAT.stat_nrequests++;
|
HTS_STAT.stat_nrequests++;
|
||||||
if (!back[i].head_request)
|
if (!back[i].head_request)
|
||||||
http_sendhead(opt, opt->cookie, 0, back[i].send_too,
|
http_sendhead(opt, opt->cookie, 0, back[i].send_too,
|
||||||
@@ -2648,7 +2823,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
#if HTS_XGETHOST
|
#if HTS_XGETHOST
|
||||||
else if (back[i].status == STATUS_WAIT_DNS) { // attendre gethostbyname
|
else if (back[i].status == STATUS_WAIT_DNS) { // attendre gethostbyname
|
||||||
#if DEBUGDNS
|
#if DEBUGDNS
|
||||||
//printf("status 101 for %s\n",back[i].url_adr);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!gestion_timeout)
|
if (!gestion_timeout)
|
||||||
@@ -2768,10 +2942,10 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
// range size hack old location
|
// range size hack old location
|
||||||
|
|
||||||
#if HTS_DIRECTDISK
|
#if HTS_DIRECTDISK
|
||||||
// Court-circuit:
|
// Shortcut: store the file directly on disk when possible,
|
||||||
// Peut-on stocker le fichier directement sur disque?
|
// sparing memory
|
||||||
// Ahh que ca serait vachement mieux et que ahh que la mémoire vous dit merci!
|
if (back[i].status &&
|
||||||
if (back[i].status) {
|
!back[i].locked) { // name still pending when locked
|
||||||
if (back[i].r.is_write == 0) { // mode mémoire
|
if (back[i].r.is_write == 0) { // mode mémoire
|
||||||
if (back[i].r.adr == NULL) { // rien n'a été écrit
|
if (back[i].r.adr == NULL) { // rien n'a été écrit
|
||||||
if (!back[i].testmode) { // pas mode test
|
if (!back[i].testmode) { // pas mode test
|
||||||
@@ -2779,7 +2953,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
if (strcmp(back[i].url_fil, "/robots.txt")) {
|
if (strcmp(back[i].url_fil, "/robots.txt")) {
|
||||||
if (back[i].r.statuscode == HTTP_OK) { // 'OK'
|
if (back[i].r.statuscode == HTTP_OK) { // 'OK'
|
||||||
if (!is_hypertext_mime(opt, back[i].r.contenttype, back[i].url_fil)) { // pas HTML
|
if (!is_hypertext_mime(opt, back[i].r.contenttype, back[i].url_fil)) { // pas HTML
|
||||||
if (opt->getmode & 2) { // on peut ecrire des non html
|
if (opt->getmode & HTS_GETMODE_NONHTML) {
|
||||||
int fcheck = 0;
|
int fcheck = 0;
|
||||||
int last_errno = 0;
|
int last_errno = 0;
|
||||||
|
|
||||||
@@ -2852,7 +3026,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // on coupe tout!
|
} else { // on coupe tout!
|
||||||
hts_log_print(opt, LOG_DEBUG,
|
hts_log_print(opt, LOG_DEBUG,
|
||||||
"File cancelled (non HTML): %s%s",
|
"File cancelled (non HTML): %s%s",
|
||||||
back[i].url_adr, back[i].url_fil);
|
back[i].url_adr, back[i].url_fil);
|
||||||
@@ -2921,8 +3095,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
// Si réception chunk, tester si on est pas à la fin!
|
// Si réception chunk, tester si on est pas à la fin!
|
||||||
if (back[i].status == 1) {
|
if (back[i].status == 1) {
|
||||||
if (back[i].is_chunk) { // attendre prochain chunk
|
if (back[i].is_chunk) { // attendre prochain chunk
|
||||||
if (back[i].r.size == back[i].r.totalsize) { // fin chunk!
|
if (back[i].r.size == back[i].r.totalsize) { // fin chunk!
|
||||||
//printf("chunk end at %d\n",back[i].r.size);
|
|
||||||
back[i].status = STATUS_CHUNK_CR; /* fetch ending CRLF */
|
back[i].status = STATUS_CHUNK_CR; /* fetch ending CRLF */
|
||||||
if (back[i].chunk_adr != NULL) {
|
if (back[i].chunk_adr != NULL) {
|
||||||
freet(back[i].chunk_adr);
|
freet(back[i].chunk_adr);
|
||||||
@@ -2985,11 +3158,9 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back_finalize(opt, cache, sback, i);
|
back_finalize(opt, cache, sback, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (back[i].r.totalsize >= 0) { // tester totalsize
|
if (back[i].r.totalsize >= 0) { // tester totalsize
|
||||||
//if ((back[i].r.totalsize>=0) && (back[i].status==STATUS_WAIT_HEADERS)) { // tester totalsize
|
|
||||||
if (back[i].r.totalsize != back[i].r.size) { // pas la même!
|
if (back[i].r.totalsize != back[i].r.size) { // pas la même!
|
||||||
if (!opt->tolerant) {
|
if (!opt->tolerant) {
|
||||||
//#if HTS_CL_IS_FATAL
|
|
||||||
deleteaddr(&back[i].r);
|
deleteaddr(&back[i].r);
|
||||||
if (back[i].r.size < back[i].r.totalsize)
|
if (back[i].r.size < back[i].r.totalsize)
|
||||||
back[i].r.statuscode = STATUSCODE_CONNERROR; // recatch
|
back[i].r.statuscode = STATUSCODE_CONNERROR; // recatch
|
||||||
@@ -2998,14 +3169,13 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
" expected)", (LLint) back[i].r.size,
|
" expected)", (LLint) back[i].r.size,
|
||||||
(LLint) back[i].r.totalsize);
|
(LLint) back[i].r.totalsize);
|
||||||
} else {
|
} else {
|
||||||
//#else
|
|
||||||
// Un warning suffira..
|
// Un warning suffira..
|
||||||
hts_log_print(opt, LOG_WARNING,
|
hts_log_print(opt, LOG_WARNING,
|
||||||
"Incorrect length (" LLintP "!=" LLintP
|
"Incorrect length (" LLintP "!=" LLintP
|
||||||
" expected) for %s%s", (LLint) back[i].r.size,
|
" expected) for %s%s",
|
||||||
|
(LLint) back[i].r.size,
|
||||||
(LLint) back[i].r.totalsize, back[i].url_adr,
|
(LLint) back[i].r.totalsize, back[i].url_adr,
|
||||||
back[i].url_fil);
|
back[i].url_fil);
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3132,10 +3302,8 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].r.size);
|
back[i].r.size);
|
||||||
#endif
|
#endif
|
||||||
/* End */
|
/* End */
|
||||||
//if (back[i].status==STATUS_CHUNK_CR) {
|
back[i].status = STATUS_READY; // fin
|
||||||
back[i].status = STATUS_READY; // fin
|
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
//}
|
|
||||||
|
|
||||||
// finalize transfer if not temporary
|
// finalize transfer if not temporary
|
||||||
if (!IS_DELAYED_EXT(back[i].url_sav)) {
|
if (!IS_DELAYED_EXT(back[i].url_sav)) {
|
||||||
@@ -3584,8 +3752,9 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].r.is_file = 1;
|
back[i].r.is_file = 1;
|
||||||
back[i].r.totalsize = back[i].r.size =
|
back[i].r.totalsize = back[i].r.size =
|
||||||
fsize_utf8(back[i].url_sav);
|
fsize_utf8(back[i].url_sav);
|
||||||
get_httptype(opt, back[i].r.contenttype,
|
get_httptype_sized(opt, back[i].r.contenttype,
|
||||||
back[i].url_sav, 1);
|
sizeof(back[i].r.contenttype),
|
||||||
|
back[i].url_sav, 1);
|
||||||
hts_log_print(opt, LOG_DEBUG,
|
hts_log_print(opt, LOG_DEBUG,
|
||||||
"Not-modified status without cache guessed: %s%s",
|
"Not-modified status without cache guessed: %s%s",
|
||||||
back[i].url_adr, back[i].url_fil);
|
back[i].url_adr, back[i].url_fil);
|
||||||
@@ -3601,7 +3770,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].url_adr, back[i].url_fil);
|
back[i].url_adr, back[i].url_fil);
|
||||||
|
|
||||||
// finalize
|
// finalize
|
||||||
//file_notify(back[i].url_adr, back[i].url_fil, back[i].url_sav, 0, 0, back[i].r.notmodified); // not modified
|
|
||||||
if (back[i].r.statuscode > 0) {
|
if (back[i].r.statuscode > 0) {
|
||||||
hts_log_print(opt, LOG_TRACE, "finalizing after cache load");
|
hts_log_print(opt, LOG_TRACE, "finalizing after cache load");
|
||||||
back_finalize(opt, cache, sback, i);
|
back_finalize(opt, cache, sback, i);
|
||||||
@@ -3611,38 +3779,32 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
back[i].url_adr, back[i].url_fil);
|
back[i].url_adr, back[i].url_fil);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//printf(">%s status %d\n",back[p].r.contenttype,back[p].r.statuscode);
|
|
||||||
} else { // erreur
|
} else { // erreur
|
||||||
back[i].status = STATUS_READY; // terminé
|
back[i].status = STATUS_READY; // terminé
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
//printf("erreur cache\n");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********** NO - must complete the body! ********** */
|
}
|
||||||
#if 0
|
// MIME type excluded by a -mime: filter: abort, don't fetch
|
||||||
} else if (HTTP_IS_REDIRECT(back[i].r.statuscode)
|
// the body (#58)
|
||||||
|| (back[i].r.statuscode == 412)
|
else if (HTTP_IS_OK(back[i].r.statuscode) &&
|
||||||
|| (back[i].r.statuscode == 416)
|
!back[i].testmode &&
|
||||||
) { // Ne pas prendre le html, erreurs connues et gérées
|
strnotempty(back[i].r.contenttype) &&
|
||||||
#if HTS_DEBUG_CLOSESOCK
|
hts_acceptmime(opt, 0, back[i].url_adr,
|
||||||
DEBUG_W
|
back[i].url_fil,
|
||||||
("back_wait(301,302,303,307,412,416..): deletehttp\n");
|
back[i].r.contenttype) == 1) {
|
||||||
#endif
|
deletehttp(&back[i].r);
|
||||||
// Couper connexion
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
/*KA deletehttp(&back[i].r); back[i].r.soc=INVALID_SOCKET; */
|
back[i].status = STATUS_READY;
|
||||||
back_maydeletehttp(opt, cache, sback, i);
|
|
||||||
|
|
||||||
back[i].status = STATUS_READY; // terminé
|
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
// finalize
|
back[i].r.statuscode = STATUSCODE_EXCLUDED;
|
||||||
if (back[i].r.statuscode > 0) {
|
strcpybuff(back[i].r.msg, "Excluded by MIME type filter");
|
||||||
hts_log_print(opt, LOG_TRACE, "finalizing redirect & 4xx");
|
hts_log_print(
|
||||||
back_finalize(opt, cache, sback, i);
|
opt, LOG_NOTICE,
|
||||||
}
|
"File excluded by MIME type filter (%s): %s%s",
|
||||||
#endif
|
back[i].r.contenttype, back[i].url_adr,
|
||||||
/********** **************************** ********** */
|
back[i].url_fil);
|
||||||
} else { // il faut aller le chercher
|
} else { // il faut aller le chercher
|
||||||
|
|
||||||
// effacer buffer (requète)
|
// effacer buffer (requète)
|
||||||
if (!noFreebuff) {
|
if (!noFreebuff) {
|
||||||
@@ -3653,35 +3815,70 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
// xxc SI CHUNK VERIFIER QUE CA MARCHE??
|
// xxc SI CHUNK VERIFIER QUE CA MARCHE??
|
||||||
if (back[i].r.statuscode == 206) { // on nous envoie un morceau (la fin) coz une partie sur disque!
|
if (back[i].r.statuscode == 206) { // on nous envoie un morceau (la fin) coz une partie sur disque!
|
||||||
off_t sz = fsize_utf8(back[i].url_sav);
|
off_t sz = fsize_utf8(back[i].url_sav);
|
||||||
|
/* RFC 7233: resume at the server's Content-Range start,
|
||||||
|
not the offset we requested; a server may resume
|
||||||
|
earlier and appending the overlap duplicates bytes
|
||||||
|
(#198). */
|
||||||
|
const LLint resume = back[i].r.crange_start;
|
||||||
|
const hts_boolean range_ok =
|
||||||
|
back[i].r.crange > 0 && resume >= 0 &&
|
||||||
|
resume <= (LLint) sz &&
|
||||||
|
back[i].r.crange_end + 1 == back[i].r.crange &&
|
||||||
|
(back[i].r.totalsize < 0 ||
|
||||||
|
back[i].r.totalsize ==
|
||||||
|
back[i].r.crange_end - resume + 1);
|
||||||
|
|
||||||
#if HDEBUG
|
#if HDEBUG
|
||||||
printf("partial content: " LLintP " on disk..\n",
|
printf("partial content: " LLintP " on disk..\n",
|
||||||
(LLint) sz);
|
(LLint) sz);
|
||||||
#endif
|
#endif
|
||||||
if (sz >= 0) {
|
if (sz >= 0 && range_ok) {
|
||||||
if (!is_hypertext_mime(opt, back[i].r.contenttype, back[i].url_sav)) { // pas HTML
|
if (!is_hypertext_mime(opt, back[i].r.contenttype, back[i].url_sav)) { // pas HTML
|
||||||
if (opt->getmode & 2) { // on peut ecrire des non html **sinon ben euhh sera intercepté plus loin, donc rap sur ce qui va sortir**
|
if (opt->getmode & HTS_GETMODE_NONHTML) {
|
||||||
filenote(&opt->state.strc, back[i].url_sav, NULL); // noter fichier comme connu
|
filenote(&opt->state.strc, back[i].url_sav, NULL); // noter fichier comme connu
|
||||||
file_notify(opt, back[i].url_adr, back[i].url_fil,
|
file_notify(opt, back[i].url_adr, back[i].url_fil,
|
||||||
back[i].url_sav, 0, 1,
|
back[i].url_sav, 0, 1,
|
||||||
back[i].r.notmodified);
|
back[i].r.notmodified);
|
||||||
back[i].r.out = FOPEN(fconv(catbuff, sizeof(catbuff), back[i].url_sav), "ab"); // append
|
back[i].r.out =
|
||||||
|
FOPEN(fconv(catbuff, sizeof(catbuff),
|
||||||
|
back[i].url_sav),
|
||||||
|
"r+b"); // resume in place
|
||||||
if (back[i].r.out && opt->cache != 0) {
|
if (back[i].r.out && opt->cache != 0) {
|
||||||
back[i].r.is_write = 1; // écrire
|
back[i].r.is_write = 1;
|
||||||
back[i].r.size = sz; // déja écrit
|
back[i].r.size = resume; // bytes already on disk
|
||||||
back[i].r.statuscode = HTTP_OK; // Forcer 'OK'
|
back[i].r.statuscode = HTTP_OK; // force 'OK'
|
||||||
if (back[i].r.totalsize >= 0)
|
if (back[i].r.totalsize >= 0)
|
||||||
back[i].r.totalsize += sz; // plus en fait
|
back[i].r.totalsize += resume; // -> full size
|
||||||
fseek(back[i].r.out, 0, SEEK_END); // à la fin
|
// drop bytes past the resume point; a silent
|
||||||
/* create a temporary reference file in case of broken mirror */
|
// failure could leave a stale tail, so on error
|
||||||
if (back_serialize_ref(opt, &back[i]) != 0) {
|
// drop the partial and refetch the whole file
|
||||||
hts_log_print(opt, LOG_WARNING,
|
if (HTS_FTRUNCATE(back[i].r.out,
|
||||||
"Could not create temporary reference file for %s%s",
|
(off_t) resume) != 0) {
|
||||||
back[i].url_adr, back[i].url_fil);
|
fclose(back[i].r.out);
|
||||||
}
|
back[i].r.out = NULL;
|
||||||
|
url_savename_refname_remove(
|
||||||
|
opt, back[i].url_adr, back[i].url_fil);
|
||||||
|
UNLINK(back[i].url_sav);
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
strcpybuff(back[i].r.msg,
|
||||||
|
"Can not truncate partial file, "
|
||||||
|
"restarting");
|
||||||
|
} else {
|
||||||
|
fseeko(back[i].r.out, (off_t) resume, SEEK_SET);
|
||||||
|
/* create a temporary reference file in case of
|
||||||
|
* broken mirror */
|
||||||
|
if (back_serialize_ref(opt, &back[i]) != 0) {
|
||||||
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"Could not create temporary "
|
||||||
|
"reference file for %s%s",
|
||||||
|
back[i].url_adr,
|
||||||
|
back[i].url_fil);
|
||||||
|
}
|
||||||
#if HDEBUG
|
#if HDEBUG
|
||||||
printf("continue interrupted file\n");
|
printf("continue interrupted file\n");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
} else { // On est dans la m**
|
} else { // On est dans la m**
|
||||||
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
@@ -3693,17 +3890,18 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
FILE *fp =
|
FILE *fp =
|
||||||
FOPEN(fconv(catbuff, sizeof(catbuff), back[i].url_sav), "rb");
|
FOPEN(fconv(catbuff, sizeof(catbuff), back[i].url_sav), "rb");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
LLint alloc_mem = sz + 1;
|
LLint alloc_mem = resume + 1;
|
||||||
|
|
||||||
if (back[i].r.totalsize >= 0)
|
if (back[i].r.totalsize >= 0)
|
||||||
alloc_mem += back[i].r.totalsize; // AJOUTER RESTANT!
|
alloc_mem += back[i].r.totalsize; // AJOUTER RESTANT!
|
||||||
if (deleteaddr(&back[i].r)
|
if (deleteaddr(&back[i].r)
|
||||||
&& (back[i].r.adr =
|
&& (back[i].r.adr =
|
||||||
(char *) malloct((size_t) alloc_mem))) {
|
(char *) malloct((size_t) alloc_mem))) {
|
||||||
back[i].r.size = sz;
|
back[i].r.size = resume;
|
||||||
if (back[i].r.totalsize >= 0)
|
if (back[i].r.totalsize >= 0)
|
||||||
back[i].r.totalsize += sz; // plus en fait
|
back[i].r.totalsize += resume; // -> full size
|
||||||
if ((fread(back[i].r.adr, 1, sz, fp)) != sz) {
|
if ((fread(back[i].r.adr, 1, (size_t) resume,
|
||||||
|
fp)) != (size_t) resume) {
|
||||||
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
strcpybuff(back[i].r.msg,
|
strcpybuff(back[i].r.msg,
|
||||||
@@ -3721,14 +3919,30 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
"No memory for partial file");
|
"No memory for partial file");
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
} else { // Argh..
|
} else { // open failed
|
||||||
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
strcpybuff(back[i].r.msg,
|
strcpybuff(back[i].r.msg,
|
||||||
"Can not open partial file");
|
"Can not open partial file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // Non trouvé??
|
} else if (sz >=
|
||||||
|
0) { // unusable range -> restart whole file
|
||||||
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"Unusable partial-content range for %s%s "
|
||||||
|
"(have " LLintP " bytes, got " LLintP
|
||||||
|
"-" LLintP "/" LLintP "), restarting",
|
||||||
|
back[i].url_adr, back[i].url_fil,
|
||||||
|
(LLint) sz, back[i].r.crange_start,
|
||||||
|
back[i].r.crange_end, back[i].r.crange);
|
||||||
|
url_savename_refname_remove(opt, back[i].url_adr,
|
||||||
|
back[i].url_fil);
|
||||||
|
UNLINK(back[i].url_sav);
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
strcpybuff(back[i].r.msg,
|
||||||
|
"Unusable partial content, restarting");
|
||||||
|
} else { // partial not found
|
||||||
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
back[i].status = STATUS_READY; // terminé (voir plus loin)
|
||||||
back_set_finished(sback, i);
|
back_set_finished(sback, i);
|
||||||
strcpybuff(back[i].r.msg, "Can not find partial file");
|
strcpybuff(back[i].r.msg, "Can not find partial file");
|
||||||
@@ -3743,7 +3957,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
deletehttp(&back[i].r);
|
deletehttp(&back[i].r);
|
||||||
}
|
}
|
||||||
back[i].r.soc = INVALID_SOCKET;
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
//back[i].r.statuscode=206; ????????
|
|
||||||
back[i].r.statuscode = STATUSCODE_NON_FATAL;
|
back[i].r.statuscode = STATUSCODE_NON_FATAL;
|
||||||
if (strnotempty(back[i].r.msg))
|
if (strnotempty(back[i].r.msg))
|
||||||
strcpybuff(back[i].r.msg,
|
strcpybuff(back[i].r.msg,
|
||||||
@@ -3764,10 +3977,13 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
&& (back[i].r.adr = (char *) malloct(2))) {
|
&& (back[i].r.adr = (char *) malloct(2))) {
|
||||||
back[i].r.adr[0] = 0;
|
back[i].r.adr[0] = 0;
|
||||||
}
|
}
|
||||||
hts_log_print(opt, LOG_TRACE, "finalizing empty");
|
/* locked = name pending; the waiter finalizes after
|
||||||
back_finalize(opt, cache, sback, i);
|
patching url_sav (else: cached as .delayed, #5) */
|
||||||
} else if (!back[i].r.is_chunk) { // pas de chunk
|
if (!back[i].locked) {
|
||||||
//if (back[i].r.http11!=2) { // pas de chunk
|
hts_log_print(opt, LOG_TRACE, "finalizing empty");
|
||||||
|
back_finalize(opt, cache, sback, i);
|
||||||
|
}
|
||||||
|
} else if (!back[i].r.is_chunk) { // pas de chunk
|
||||||
back[i].is_chunk = 0;
|
back[i].is_chunk = 0;
|
||||||
back[i].status = 1; // start body
|
back[i].status = 1; // start body
|
||||||
} else {
|
} else {
|
||||||
@@ -3809,7 +4025,6 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*} */
|
/*} */
|
||||||
@@ -3829,15 +4044,12 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
if (back[i].status < 0) {
|
if (back[i].status < 0) {
|
||||||
if (!back[i].testmode) { // pas en test
|
if (!back[i].testmode) { // pas en test
|
||||||
UNLINK(back[i].url_sav); // éliminer fichier (endommagé)
|
UNLINK(back[i].url_sav); // éliminer fichier (endommagé)
|
||||||
//printf("&& %s\n",back[i].url_sav);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* funny log for commandline users */
|
/* funny log for commandline users */
|
||||||
//if (!opt->quiet) {
|
if (opt->verbosedisplay == HTS_VERBOSE_SIMPLE) {
|
||||||
// petite animation
|
|
||||||
if (opt->verbosedisplay == 1) {
|
|
||||||
if (back[i].status == STATUS_READY) {
|
if (back[i].status == STATUS_READY) {
|
||||||
if (back[i].r.statuscode == HTTP_OK)
|
if (back[i].r.statuscode == HTTP_OK)
|
||||||
printf("* %s%s (" LLintP " bytes) - OK" VT_CLREOL "\r",
|
printf("* %s%s (" LLintP " bytes) - OK" VT_CLREOL "\r",
|
||||||
@@ -3849,23 +4061,43 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
} // status>0
|
} // status>0
|
||||||
} // for
|
} // for
|
||||||
|
|
||||||
// vérifier timeouts
|
// vérifier timeouts
|
||||||
if (gestion_timeout) {
|
if (gestion_timeout) {
|
||||||
TStamp act;
|
TStamp act;
|
||||||
|
|
||||||
act = time_local(); // temps en secondes
|
act = time_local(); // temps en secondes
|
||||||
for(i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
for (i_mod = 0; i_mod < (unsigned int) back_max; i_mod++) {
|
||||||
// for(i=0;i<back_max;i++) {
|
|
||||||
unsigned int i = (i_mod + mod_random) % (back_max);
|
unsigned int i = (i_mod + mod_random) % (back_max);
|
||||||
|
|
||||||
if (back[i].status > 0) { // réception/connexion/..
|
if (back[i].status > 0) { // réception/connexion/..
|
||||||
if (back[i].timeout > 0) {
|
if (back[i].timeout > 0) {
|
||||||
//printf("time check %d\n",((int) (act-back[i].timeout_refresh))-back[i].timeout);
|
// a stuck connect with a fallback address: retry the next one well
|
||||||
|
// before the full timeout (dead IPv6 on a dual-stack host, ...)
|
||||||
|
if (back[i].status == STATUS_CONNECTING) {
|
||||||
|
const hts_connect_fallback *const cf =
|
||||||
|
&sback->connect_fallback[i];
|
||||||
|
|
||||||
|
if (back_connect_fallback_due(cf->addr_index, cf->addr_count,
|
||||||
|
(int) (act - cf->connect_start),
|
||||||
|
back[i].timeout)) {
|
||||||
|
if (back_connect_next(opt, sback, i)) {
|
||||||
|
continue; // reconnected to the next candidate
|
||||||
|
}
|
||||||
|
// fallback was due but no socket could be opened
|
||||||
|
// (back_connect_next closed the dead one): stop now rather than
|
||||||
|
// spin on an invalid fd
|
||||||
|
back[i].r.soc = INVALID_SOCKET;
|
||||||
|
back[i].r.statuscode = STATUSCODE_CONNERROR;
|
||||||
|
strcpybuff(back[i].r.msg, "Connect Error");
|
||||||
|
back[i].status = STATUS_READY;
|
||||||
|
back_set_finished(sback, i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (((int) (act - back[i].timeout_refresh)) >= back[i].timeout) {
|
if (((int) (act - back[i].timeout_refresh)) >= back[i].timeout) {
|
||||||
hts_log_print(opt, LOG_DEBUG, "connection timed out for %s%s", back[i].url_adr,
|
hts_log_print(opt, LOG_DEBUG, "connection timed out for %s%s", back[i].url_adr,
|
||||||
back[i].url_fil);
|
back[i].url_fil);
|
||||||
@@ -3941,6 +4173,11 @@ int back_checksize(httrackp * opt, lien_back * eback, int check_only_totalsize)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Grace left to the smooth stop before in-flight transfers are aborted. */
|
||||||
|
static int back_maxtime_grace(const int maxtime) {
|
||||||
|
return maximum(5, minimum(30, maxtime / 10));
|
||||||
|
}
|
||||||
|
|
||||||
int back_checkmirror(httrackp * opt) {
|
int back_checkmirror(httrackp * opt) {
|
||||||
// Check max size
|
// Check max size
|
||||||
if ((opt->maxsite > 0) && (HTS_STAT.stat_bytes >= opt->maxsite)) {
|
if ((opt->maxsite > 0) && (HTS_STAT.stat_bytes >= opt->maxsite)) {
|
||||||
@@ -3957,13 +4194,19 @@ int back_checkmirror(httrackp * opt) {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
// Check max time
|
// Check max time
|
||||||
if ((opt->maxtime > 0)
|
if (opt->maxtime > 0) {
|
||||||
&& ((time_local() - HTS_STAT.stat_timestart) >= opt->maxtime)) {
|
const TStamp elapsed = time_local() - HTS_STAT.stat_timestart;
|
||||||
if (!opt->state.stop) { /* not yet stopped */
|
|
||||||
hts_log_print(opt, LOG_ERROR, "More than %d seconds passed.. giving up",
|
if (elapsed >= opt->maxtime) {
|
||||||
opt->maxtime);
|
if (!opt->state.stop) { /* not yet stopped */
|
||||||
/* cancel mirror smoothly */
|
hts_log_print(opt, LOG_ERROR, "More than %d seconds passed.. giving up",
|
||||||
hts_request_stop(opt, 0);
|
opt->maxtime);
|
||||||
|
/* cancel mirror smoothly */
|
||||||
|
hts_request_stop(opt, 0);
|
||||||
|
}
|
||||||
|
/* smooth stop starved past the grace period: stop waiting (#481) */
|
||||||
|
if (elapsed - opt->maxtime >= back_maxtime_grace(opt->maxtime))
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1; /* Ok, go on */
|
return 1; /* Ok, go on */
|
||||||
|
|||||||
@@ -113,6 +113,12 @@ void back_set_locked(struct_back * sback, const int p);
|
|||||||
void back_set_unlocked(struct_back * sback, const int p);
|
void back_set_unlocked(struct_back * sback, const int p);
|
||||||
int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
int back_delete(httrackp * opt, cache_back * cache, struct_back * sback,
|
||||||
const int p);
|
const int p);
|
||||||
|
/* Discard back's on-disk .delayed placeholder and its refname. */
|
||||||
|
void back_delayed_discard(httrackp *opt, lien_back *back);
|
||||||
|
/* Move back's .delayed placeholder (and open stream) to newname;
|
||||||
|
HTS_FALSE = file lost, slot flagged in error. */
|
||||||
|
hts_boolean back_delayed_rename(httrackp *opt, lien_back *back,
|
||||||
|
const char *newname);
|
||||||
void back_index_unlock(struct_back * sback, const int p);
|
void back_index_unlock(struct_back * sback, const int p);
|
||||||
int back_clear_entry(lien_back * back);
|
int back_clear_entry(lien_back * back);
|
||||||
int back_flush_output(httrackp * opt, cache_back * cache, struct_back * sback,
|
int back_flush_output(httrackp * opt, cache_back * cache, struct_back * sback,
|
||||||
@@ -136,6 +142,8 @@ void back_solve(httrackp * opt, lien_back * sback);
|
|||||||
int host_wait(httrackp * opt, lien_back * sback);
|
int host_wait(httrackp * opt, lien_back * sback);
|
||||||
#endif
|
#endif
|
||||||
int back_checksize(httrackp * opt, lien_back * eback, int check_only_totalsize);
|
int back_checksize(httrackp * opt, lien_back * eback, int check_only_totalsize);
|
||||||
|
/* Enforce -M/-E quotas: requests a smooth stop when reached; returns 0 once
|
||||||
|
the -E deadline overran its grace period (callers must stop waiting). */
|
||||||
int back_checkmirror(httrackp * opt);
|
int back_checkmirror(httrackp * opt);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -63,12 +63,15 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* GCC extension */
|
/* Compiler-portability attribute macros (no-ops on non-GCC). */
|
||||||
#ifndef HTS_UNUSED
|
#ifndef HTS_UNUSED
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define HTS_UNUSED __attribute__ ((unused))
|
#define HTS_UNUSED __attribute__ ((unused))
|
||||||
|
|
||||||
#define HTS_STATIC static __attribute__ ((unused))
|
#define HTS_STATIC static __attribute__ ((unused))
|
||||||
|
|
||||||
#define HTS_INLINE __inline__
|
#define HTS_INLINE __inline__
|
||||||
|
/* printf-style format check; fmt/arg are 1-based argument positions. */
|
||||||
#define HTS_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg)))
|
#define HTS_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg)))
|
||||||
#else
|
#else
|
||||||
#define HTS_UNUSED
|
#define HTS_UNUSED
|
||||||
@@ -78,29 +81,37 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* min/max evaluate their arguments twice; pass side-effect-free expressions. */
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
#define min(a,b) ((a)>(b)?(b):(a))
|
#define min(a,b) ((a)>(b)?(b):(a))
|
||||||
|
|
||||||
#define max(a,b) ((a)>(b)?(a):(b))
|
#define max(a,b) ((a)>(b)?(a):(b))
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#undef Sleep
|
#undef Sleep
|
||||||
#define min(a,b) ((a)>(b)?(b):(a))
|
#define min(a,b) ((a)>(b)?(b):(a))
|
||||||
|
|
||||||
#define max(a,b) ((a)>(b)?(a):(b))
|
#define max(a,b) ((a)>(b)?(a):(b))
|
||||||
|
|
||||||
|
/* Win32 Sleep() shim for POSIX; argument is milliseconds. */
|
||||||
#define Sleep(a) { if (((a)*1000)%1000000) usleep(((a)*1000)%1000000); if (((a)*1000)/1000000) sleep(((a)*1000)/1000000); }
|
#define Sleep(a) { if (((a)*1000)%1000000) usleep(((a)*1000)%1000000); if (((a)*1000)/1000000) sleep(((a)*1000)/1000000); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// teste égalité de 2 chars, case insensitive
|
/* hichar: ASCII uppercasing of one char. streql: case-insensitive equality of
|
||||||
|
two chars. ASCII only; not locale-aware. */
|
||||||
#define hichar(a) ((((a)>='a') && ((a)<='z')) ? ((a)-('a'-'A')) : (a))
|
#define hichar(a) ((((a)>='a') && ((a)<='z')) ? ((a)-('a'-'A')) : (a))
|
||||||
|
|
||||||
#define streql(a,b) (hichar(a)==hichar(b))
|
#define streql(a,b) (hichar(a)==hichar(b))
|
||||||
|
|
||||||
// caractère maj
|
/* True if c is an ASCII uppercase letter. */
|
||||||
#define isUpperLetter(a) ( ((a) >= 'A') && ((a) <= 'Z') )
|
#define isUpperLetter(a) ( ((a) >= 'A') && ((a) <= 'Z') )
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library-internal only (engine translation units that define
|
||||||
|
HTS_INTERNAL_BYTECODE); not part of the consumer surface. */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
// functions
|
/* Resolve a symbol in an already-loaded dynamic module. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define DynamicGet(handle, sym) GetProcAddress(handle, sym)
|
#define DynamicGet(handle, sym) GetProcAddress(handle, sym)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -31,12 +31,17 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** @file htsbasenet.h
|
||||||
|
Base networking definitions: platform socket headers, the optional global
|
||||||
|
OpenSSL context, and the status-code/connection-state enumerations stored in
|
||||||
|
htsblk and lien_back. Pulled in by htsnet.h. */
|
||||||
|
|
||||||
#ifndef HTS_DEFBASENETH
|
#ifndef HTS_DEFBASENETH
|
||||||
#define HTS_DEFBASENETH
|
#define HTS_DEFBASENETH
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#if HTS_INET6==0
|
#if HTS_INET6 == 0
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -44,13 +49,12 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
// KB955045 (http://support.microsoft.com/kb/955045)
|
// KB955045 (http://support.microsoft.com/kb/955045)
|
||||||
// To execute an application using this function on earlier versions of Windows
|
// To execute an application using this function on earlier versions of Windows
|
||||||
// (Windows 2000, Windows NT, and Windows Me/98/95), then it is mandatary to #include Ws2tcpip.h
|
// (Windows 2000, Windows NT, and Windows Me/98/95), then it is mandatary to
|
||||||
// and also Wspiapi.h. When the Wspiapi.h header file is included, the 'getaddrinfo' function is
|
// #include Ws2tcpip.h and also Wspiapi.h. When the Wspiapi.h header file is
|
||||||
// #defined to the 'WspiapiGetAddrInfo' inline function in Wspiapi.h.
|
// included, the 'getaddrinfo' function is #defined to the 'WspiapiGetAddrInfo'
|
||||||
|
// inline function in Wspiapi.h.
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#include <Wspiapi.h>
|
#include <Wspiapi.h>
|
||||||
//#include <winsock2.h>
|
|
||||||
//#include <tpipv6.h>
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -80,7 +84,8 @@ extern "C" {
|
|||||||
/* OpenSSL structure */
|
/* OpenSSL structure */
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
|
|
||||||
/* Global SSL context */
|
/** Process-wide OpenSSL client context, created lazily on first TLS use;
|
||||||
|
shared by all connections. NULL until initialized. */
|
||||||
extern SSL_CTX *openssl_ctx;
|
extern SSL_CTX *openssl_ctx;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -122,6 +127,8 @@ typedef enum HTTPStatusCode {
|
|||||||
HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
|
HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
|
||||||
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
|
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
|
||||||
HTTP_EXPECTATION_FAILED = 417,
|
HTTP_EXPECTATION_FAILED = 417,
|
||||||
|
HTTP_TOO_MANY_REQUESTS = 429,
|
||||||
|
HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451,
|
||||||
HTTP_INTERNAL_SERVER_ERROR = 500,
|
HTTP_INTERNAL_SERVER_ERROR = 500,
|
||||||
HTTP_NOT_IMPLEMENTED = 501,
|
HTTP_NOT_IMPLEMENTED = 501,
|
||||||
HTTP_BAD_GATEWAY = 502,
|
HTTP_BAD_GATEWAY = 502,
|
||||||
@@ -139,7 +146,8 @@ typedef enum BackStatusCode {
|
|||||||
STATUSCODE_NON_FATAL = -5,
|
STATUSCODE_NON_FATAL = -5,
|
||||||
STATUSCODE_SSL_HANDSHAKE = -6,
|
STATUSCODE_SSL_HANDSHAKE = -6,
|
||||||
STATUSCODE_TOO_BIG = -7,
|
STATUSCODE_TOO_BIG = -7,
|
||||||
STATUSCODE_TEST_OK = -10
|
STATUSCODE_TEST_OK = -10,
|
||||||
|
STATUSCODE_EXCLUDED = -11 /* aborted: MIME excluded by a -mime: filter */
|
||||||
} BackStatusCode;
|
} BackStatusCode;
|
||||||
|
|
||||||
/** HTTrack status ('status' member of of 'lien_back') **/
|
/** HTTrack status ('status' member of of 'lien_back') **/
|
||||||
|
|||||||
@@ -3,57 +3,59 @@
|
|||||||
|
|
||||||
# Change this to download files
|
# Change this to download files
|
||||||
if false; then
|
if false; then
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/ISO8859/8859-*.TXT" | lftp
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP*.TXT" | lftp
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP*.TXT" | lftp
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP*.TXT" | lftp
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/CP*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/CP*.TXT" | lftp
|
||||||
echo "mget ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8*.TXT" | lftp
|
echo "mget https://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8*.TXT" | lftp
|
||||||
rm -f CP932.TXT CP936.TXT CP949.TXT CP950.TXT
|
rm -f CP932.TXT CP936.TXT CP949.TXT CP950.TXT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Produce code
|
# Produce code
|
||||||
printf "/** GENERATED FILE ($0), DO NOT EDIT **/\n\n"
|
printf '/** GENERATED FILE (%s), DO NOT EDIT **/\n\n' "$0"
|
||||||
for i in *.TXT ; do
|
for i in *.TXT; do
|
||||||
echo "processing $i" >&2
|
echo "processing $i" >&2
|
||||||
grep -vE "^(#|$)" $i | grep -E "^0x" | sed -e 's/[[:space:]]/ /g' | cut -f1,2 -d' ' | \
|
grep -vE "^(#|$)" "$i" | grep -E "^0x" | sed -e 's/[[:space:]]/ /g' | cut -f1,2 -d' ' |
|
||||||
(
|
(
|
||||||
unset arr
|
unset arr
|
||||||
while read LINE ; do
|
while read -r LINE; do
|
||||||
from=$[$(echo $LINE | cut -f1 -d' ')]
|
from=$(($(echo "$LINE" | cut -f1 -d' ')))
|
||||||
if ! test -n "$from"; then
|
if ! test -n "$from"; then
|
||||||
echo "error with $i" >&2
|
echo "error with $i" >&2
|
||||||
exit 1
|
exit 1
|
||||||
elif test $from -ge 256; then
|
elif test $from -ge 256; then
|
||||||
echo "out-of-range ($LINE) with $i" >&2
|
echo "out-of-range ($LINE) with $i" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
to=$(echo $LINE | cut -f2 -d' ')
|
to=$(echo "$LINE" | cut -f2 -d' ')
|
||||||
arr[$from]=$to
|
arr[from]=$to
|
||||||
done
|
done
|
||||||
name=$(echo $i | tr 'A-Z' 'a-z' | tr '-' '_' | sed -e 's/\.txt//' -e 's/8859/iso_8859/')
|
# shellcheck disable=SC2018,SC2019 # charset filenames are ASCII; keep C-locale A-Z/a-z
|
||||||
printf "/* Table for $i */\nstatic const hts_UCS4 table_${name}[256] = {\n "
|
name=$(echo "$i" | tr 'A-Z' 'a-z' | tr '-' '_' | sed -e 's/\.txt//' -e 's/8859/iso_8859/')
|
||||||
i=0
|
printf '/* Table for %s */\nstatic const hts_UCS4 table_%s[256] = {\n ' "$i" "$name"
|
||||||
while test "$i" -lt 256; do
|
idx=0
|
||||||
if test "$i" -gt 0; then
|
while test "$idx" -lt 256; do
|
||||||
printf ", "
|
if test "$idx" -gt 0; then
|
||||||
if test $[${i}%8] -eq 0; then
|
printf ", "
|
||||||
printf "\n "
|
if test $((idx % 8)) -eq 0; then
|
||||||
fi
|
printf "\n "
|
||||||
fi
|
fi
|
||||||
value=${arr[$i]:-0}
|
fi
|
||||||
printf "0x%04x" $value
|
value=${arr[$idx]:-0}
|
||||||
i=$[${i}+1]
|
printf "0x%04x" "$value"
|
||||||
done
|
idx=$((idx + 1))
|
||||||
printf " };\n\n"
|
done
|
||||||
)
|
printf " };\n\n"
|
||||||
echo "processed $i" >&2
|
)
|
||||||
|
echo "processed $i" >&2
|
||||||
done
|
done
|
||||||
|
|
||||||
# Indexes
|
# Indexes
|
||||||
printf "static const struct {\n const char *name;\n const hts_UCS4 *table;\n} table_mappings[] = {\n"
|
printf "static const struct {\n const char *name;\n const hts_UCS4 *table;\n} table_mappings[] = {\n"
|
||||||
for i in *.TXT ; do
|
for i in *.TXT; do
|
||||||
name=$(echo $i | tr 'A-Z' 'a-z' | tr '-' '_' | sed -e 's/\.txt//' -e 's/8859/iso_8859/')
|
# shellcheck disable=SC2018,SC2019 # charset filenames are ASCII; keep C-locale A-Z/a-z
|
||||||
printf " { \"$(echo $name | tr -d '_')\", table_${name} },\n"
|
name=$(echo "$i" | tr 'A-Z' 'a-z' | tr '-' '_' | sed -e 's/\.txt//' -e 's/8859/iso_8859/')
|
||||||
|
printf ' { "%s", table_%s },\n' "$(echo "$name" | tr -d '_')" "$name"
|
||||||
done
|
done
|
||||||
printf " { NULL, NULL }\n};\n"
|
printf " { NULL, NULL }\n};\n"
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ int cookie_add(t_cookie * cookie, const char *cook_name, const char *cook_value,
|
|||||||
#if DEBUG_COOK
|
#if DEBUG_COOK
|
||||||
printf("add_new cookie: name=\"%s\" value=\"%s\" domain=\"%s\" path=\"%s\"\n",
|
printf("add_new cookie: name=\"%s\" value=\"%s\" domain=\"%s\" path=\"%s\"\n",
|
||||||
cook_name, cook_value, domain, path);
|
cook_name, cook_value, domain, path);
|
||||||
//printf(">>>cook: %s<<<\n",cookie->data);
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -208,8 +207,6 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
|
|||||||
char catbuff[CATBUFF_SIZE];
|
char catbuff[CATBUFF_SIZE];
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
|
|
||||||
// cookie->data[0]='\0';
|
|
||||||
|
|
||||||
// Fusionner d'abord les éventuels cookies IE
|
// Fusionner d'abord les éventuels cookies IE
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,51 +31,80 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** @file htsbauth.h
|
||||||
|
HTTP Basic authentication storage: a per-session list of (URL-prefix,
|
||||||
|
credentials) pairs, plus the cookie jar that holds it. */
|
||||||
|
|
||||||
#ifndef HTSBAUTH_DEFH
|
#ifndef HTSBAUTH_DEFH
|
||||||
#define HTSBAUTH_DEFH
|
#define HTSBAUTH_DEFH
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
// robots wizard
|
/** One stored credential: the longest-prefix match against a request's
|
||||||
|
host+path selects which auth header to send. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_bauth_chain
|
#ifndef HTS_DEF_FWSTRUCT_bauth_chain
|
||||||
#define HTS_DEF_FWSTRUCT_bauth_chain
|
#define HTS_DEF_FWSTRUCT_bauth_chain
|
||||||
typedef struct bauth_chain bauth_chain;
|
typedef struct bauth_chain bauth_chain;
|
||||||
#endif
|
#endif
|
||||||
struct bauth_chain {
|
struct bauth_chain {
|
||||||
char prefix[1024]; /* www.foo.com/secure/ */
|
char prefix[1024]; /* host + path prefix, e.g. www.foo.com/secure/ */
|
||||||
char auth[1024]; /* base-64 encoded user:pass */
|
char auth[1024]; /* base-64 encoded user:pass (Authorization payload) */
|
||||||
struct bauth_chain *next; /* next element */
|
struct bauth_chain *next; /* next element, NULL-terminated list */
|
||||||
};
|
};
|
||||||
|
|
||||||
// buffer pour les cookies et authentification
|
/** Per-session cookie jar; also holds the basic-auth list head (auth).
|
||||||
|
The head node (auth) is embedded, not heap-allocated. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_t_cookie
|
#ifndef HTS_DEF_FWSTRUCT_t_cookie
|
||||||
#define HTS_DEF_FWSTRUCT_t_cookie
|
#define HTS_DEF_FWSTRUCT_t_cookie
|
||||||
typedef struct t_cookie t_cookie;
|
typedef struct t_cookie t_cookie;
|
||||||
#endif
|
#endif
|
||||||
struct t_cookie {
|
struct t_cookie {
|
||||||
int max_len;
|
int max_len; /* capacity of data[] in use */
|
||||||
char data[32768];
|
char data[32768]; /* raw cookie store (NUL-terminated field list) */
|
||||||
bauth_chain auth;
|
bauth_chain auth; /* embedded head of the basic-auth list */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library internal definictions */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
// cookies
|
/* cookies */
|
||||||
int cookie_add(t_cookie * cookie, const char *cook_name, const char *cook_value,
|
int cookie_add(t_cookie *cookie, const char *cook_name, const char *cook_value,
|
||||||
const char *domain, const char *path);
|
const char *domain, const char *path);
|
||||||
int cookie_del(t_cookie * cookie, const char *cook_name, const char *domain, const char *path);
|
|
||||||
int cookie_load(t_cookie * cookie, const char *path, const char *name);
|
int cookie_del(t_cookie *cookie, const char *cook_name, const char *domain,
|
||||||
int cookie_save(t_cookie * cookie, const char *name);
|
const char *path);
|
||||||
|
|
||||||
|
int cookie_load(t_cookie *cookie, const char *path, const char *name);
|
||||||
|
|
||||||
|
int cookie_save(t_cookie *cookie, const char *name);
|
||||||
|
|
||||||
void cookie_insert(char *s, size_t s_size, const char *ins);
|
void cookie_insert(char *s, size_t s_size, const char *ins);
|
||||||
|
|
||||||
void cookie_delete(char *s, size_t s_size, size_t pos);
|
void cookie_delete(char *s, size_t s_size, size_t pos);
|
||||||
|
|
||||||
const char *cookie_get(char *buffer, const char *cookie_base, int param);
|
const char *cookie_get(char *buffer, const char *cookie_base, int param);
|
||||||
char *cookie_find(char *s, const char *cook_name, const char *domain, const char *path);
|
|
||||||
|
char *cookie_find(char *s, const char *cook_name, const char *domain,
|
||||||
|
const char *path);
|
||||||
|
|
||||||
char *cookie_nextfield(char *a);
|
char *cookie_nextfield(char *a);
|
||||||
|
|
||||||
// basic auth
|
/* basic auth */
|
||||||
int bauth_add(t_cookie * cookie, const char *adr, const char *fil, const char *auth);
|
|
||||||
char *bauth_check(t_cookie * cookie, const char *adr, const char *fil);
|
/** Register credentials (auth = base-64 user:pass) for the prefix derived from
|
||||||
|
adr (host) and fil (path). No-op returning 0 if cookie is NULL, allocation
|
||||||
|
fails, or a matching prefix is already stored; returns 1 on insertion. */
|
||||||
|
int bauth_add(t_cookie *cookie, const char *adr, const char *fil,
|
||||||
|
const char *auth);
|
||||||
|
|
||||||
|
/** Return the stored base-64 credentials whose prefix matches adr+fil, or NULL
|
||||||
|
if none (or cookie is NULL). Returned pointer aliases the jar's bauth_chain;
|
||||||
|
caller must not free it. */
|
||||||
|
char *bauth_check(t_cookie *cookie, const char *adr, const char *fil);
|
||||||
|
|
||||||
|
/** Build the auth lookup key (host + path, query string stripped, truncated at
|
||||||
|
the last '/') from adr and fil into prefix; returns prefix. Caller must
|
||||||
|
supply a buffer of HTS_URLMAXSIZE * 2 bytes. */
|
||||||
char *bauth_prefix(char *buffer, const char *adr, const char *fil);
|
char *bauth_prefix(char *buffer, const char *adr, const char *fil);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
268
src/htscache.c
268
src/htscache.c
@@ -40,6 +40,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#include "htscore.h"
|
#include "htscore.h"
|
||||||
#include "htsbasenet.h"
|
#include "htsbasenet.h"
|
||||||
#include "htsmd5.h"
|
#include "htsmd5.h"
|
||||||
|
#include <limits.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "htszlib.h"
|
#include "htszlib.h"
|
||||||
@@ -220,6 +221,40 @@ struct cache_back_zip_entry {
|
|||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
/* Consecutive entry write failures before the cache stream is declared dead. */
|
||||||
|
#define CACHE_MAX_WRITE_FAILURES 8
|
||||||
|
|
||||||
|
/* Cache write failed: a fatal errno or a failure streak aborts the mirror
|
||||||
|
(exit_xh); an isolated failure only drops the current entry. */
|
||||||
|
static void cache_zip_write_failed(httrackp *opt, cache_back *cache,
|
||||||
|
const char *what, int zErr,
|
||||||
|
hts_boolean entry_open, const char *url_adr,
|
||||||
|
const char *url_fil) {
|
||||||
|
const int fatal_errno = zErr == ZIP_ERRNO && check_fatal_io_errno();
|
||||||
|
|
||||||
|
cache->zipWriteFailures++;
|
||||||
|
if (fatal_errno || cache->zipWriteFailures >= CACHE_MAX_WRITE_FAILURES) {
|
||||||
|
if (!cache->zipWriteFailed) {
|
||||||
|
cache->zipWriteFailed = HTS_TRUE;
|
||||||
|
if (fatal_errno) {
|
||||||
|
hts_log_print(opt, LOG_ERROR,
|
||||||
|
"Mirror aborted: disk full or filesystem problems");
|
||||||
|
} else {
|
||||||
|
hts_log_print(opt, LOG_ERROR,
|
||||||
|
"Mirror aborted: cache write failed (%s): %s", what,
|
||||||
|
hts_get_zerror(zErr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
opt->state.exit_xh = -1; /* fatal: stop the mirror, exit non-zero */
|
||||||
|
} else {
|
||||||
|
if (entry_open)
|
||||||
|
zipCloseFileInZip((zipFile) cache->zipOutput); /* abandon, best-effort */
|
||||||
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"cache write failed (%s: %s), entry not cached: %s%s", what,
|
||||||
|
hts_get_zerror(zErr), url_adr, url_fil);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Ajout d'un fichier en cache */
|
/* Ajout d'un fichier en cache */
|
||||||
void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
||||||
const char *url_adr, const char *url_fil, const char *url_save,
|
const char *url_adr, const char *url_fil, const char *url_save,
|
||||||
@@ -230,12 +265,14 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
char BIGSTK headers[8192];
|
char BIGSTK headers[8192];
|
||||||
int headersSize = 0;
|
int headersSize = 0;
|
||||||
|
|
||||||
//int entryBodySize = 0;
|
|
||||||
//int entryFilenameSize = 0;
|
|
||||||
zip_fileinfo fi;
|
zip_fileinfo fi;
|
||||||
const char *url_save_suffix = url_save;
|
const char *url_save_suffix = url_save;
|
||||||
int zErr;
|
int zErr;
|
||||||
|
|
||||||
|
/* already failed and aborting; don't touch the broken stream again */
|
||||||
|
if (cache->zipWriteFailed)
|
||||||
|
return;
|
||||||
|
|
||||||
// robots.txt hack
|
// robots.txt hack
|
||||||
if (url_save == NULL) {
|
if (url_save == NULL) {
|
||||||
dataincache = 0; // testing links
|
dataincache = 0; // testing links
|
||||||
@@ -263,10 +300,19 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
if (r->size < 0) // error
|
if (r->size < 0) // error
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// data in cache
|
// data in cache: the body must fit the 32-bit zip write API
|
||||||
if (dataincache) {
|
if (dataincache && (LLint) (int) r->size != r->size) {
|
||||||
assertf(((int) r->size) == r->size);
|
if (r->is_write && url_save != NULL && strnotempty(url_save)) {
|
||||||
//entryBodySize = (int) r->size;
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"file too large for the cache, storing headers only: %s%s",
|
||||||
|
url_adr, url_fil);
|
||||||
|
dataincache = 0;
|
||||||
|
} else {
|
||||||
|
hts_log_print(opt, LOG_WARNING,
|
||||||
|
"entry too large for the cache, not cached: %s%s", url_adr,
|
||||||
|
url_fil);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fields */
|
/* Fields */
|
||||||
@@ -311,8 +357,6 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
ZIP_FIELD_STRING(headers, headersSize, "X-Fil", url_fil); // Original URI filename
|
ZIP_FIELD_STRING(headers, headersSize, "X-Fil", url_fil); // Original URI filename
|
||||||
ZIP_FIELD_STRING(headers, headersSize, "X-Save", url_save_suffix); // Original save filename
|
ZIP_FIELD_STRING(headers, headersSize, "X-Save", url_save_suffix); // Original save filename
|
||||||
|
|
||||||
//entryFilenameSize = (int) ( strlen(url_adr) + strlen(url_fil));
|
|
||||||
|
|
||||||
/* Filename */
|
/* Filename */
|
||||||
if (!link_has_authority(url_adr)) {
|
if (!link_has_authority(url_adr)) {
|
||||||
strcpybuff(filename, "http://");
|
strcpybuff(filename, "http://");
|
||||||
@@ -346,9 +390,9 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
*/
|
*/
|
||||||
headers, (uInt) strlen(headers), NULL, 0, NULL, /* comment */
|
headers, (uInt) strlen(headers), NULL, 0, NULL, /* comment */
|
||||||
Z_DEFLATED, Z_DEFAULT_COMPRESSION)) != Z_OK) {
|
Z_DEFLATED, Z_DEFAULT_COMPRESSION)) != Z_OK) {
|
||||||
int zip_zipOpenNewFileInZip_failed = 0;
|
cache_zip_write_failed(opt, cache, "opening a cache entry", zErr, HTS_FALSE,
|
||||||
|
url_adr, url_fil);
|
||||||
assertf(zip_zipOpenNewFileInZip_failed);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write data in cache */
|
/* Write data in cache */
|
||||||
@@ -358,9 +402,9 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
if ((zErr =
|
if ((zErr =
|
||||||
zipWriteInFileInZip((zipFile) cache->zipOutput, r->adr,
|
zipWriteInFileInZip((zipFile) cache->zipOutput, r->adr,
|
||||||
(int) r->size)) != Z_OK) {
|
(int) r->size)) != Z_OK) {
|
||||||
int zip_zipWriteInFileInZip_failed = 0;
|
cache_zip_write_failed(opt, cache, "writing to the cache", zErr,
|
||||||
|
HTS_TRUE, url_adr, url_fil);
|
||||||
assertf(zip_zipWriteInFileInZip_failed);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -381,9 +425,10 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
if ((zErr =
|
if ((zErr =
|
||||||
zipWriteInFileInZip((zipFile) cache->zipOutput, buff,
|
zipWriteInFileInZip((zipFile) cache->zipOutput, buff,
|
||||||
(int) nl)) != Z_OK) {
|
(int) nl)) != Z_OK) {
|
||||||
int zip_zipWriteInFileInZip_failed = 0;
|
cache_zip_write_failed(opt, cache, "writing to the cache", zErr,
|
||||||
|
HTS_TRUE, url_adr, url_fil);
|
||||||
assertf(zip_zipWriteInFileInZip_failed);
|
fclose(fp);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while(nl > 0);
|
} while(nl > 0);
|
||||||
@@ -397,17 +442,19 @@ void cache_add(httrackp * opt, cache_back * cache, const htsblk * r,
|
|||||||
|
|
||||||
/* Close */
|
/* Close */
|
||||||
if ((zErr = zipCloseFileInZip((zipFile) cache->zipOutput)) != Z_OK) {
|
if ((zErr = zipCloseFileInZip((zipFile) cache->zipOutput)) != Z_OK) {
|
||||||
int zip_zipCloseFileInZip_failed = 0;
|
cache_zip_write_failed(opt, cache, "closing a cache entry", zErr, HTS_FALSE,
|
||||||
|
url_adr, url_fil);
|
||||||
assertf(zip_zipCloseFileInZip_failed);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush */
|
/* Flush */
|
||||||
if ((zErr = zipFlush((zipFile) cache->zipOutput)) != 0) {
|
if ((zErr = zipFlush((zipFile) cache->zipOutput)) != 0) {
|
||||||
int zip_zipFlush_failed = 0;
|
cache_zip_write_failed(opt, cache, "flushing the cache", zErr, HTS_FALSE,
|
||||||
|
url_adr, url_fil);
|
||||||
assertf(zip_zipFlush_failed);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cache->zipWriteFailures = 0; /* entry stored: reset the failure streak */
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -576,15 +623,18 @@ htsblk cache_read_ro(httrackp * opt, cache_back * cache, const char *adr,
|
|||||||
return cache_readex(opt, cache, adr, fil, save, location, NULL, 1);
|
return cache_readex(opt, cache, adr, fil, save, location, NULL, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
htsblk cache_read_including_broken(httrackp * opt, cache_back * cache,
|
htsblk cache_read_including_broken(httrackp *opt, cache_back *cache,
|
||||||
const char *adr, const char *fil) {
|
const char *adr, const char *fil,
|
||||||
htsblk r = cache_read(opt, cache, adr, fil, NULL, NULL);
|
char *return_save) {
|
||||||
|
htsblk r = cache_readex(opt, cache, adr, fil, NULL, NULL, return_save, 0);
|
||||||
|
|
||||||
if (r.statuscode == -1) {
|
if (r.statuscode == -1) {
|
||||||
lien_back *itemback = NULL;
|
lien_back *itemback = NULL;
|
||||||
|
|
||||||
if (back_unserialize_ref(opt, adr, fil, &itemback) == 0) {
|
if (back_unserialize_ref(opt, adr, fil, &itemback) == 0) {
|
||||||
r = itemback->r;
|
r = itemback->r;
|
||||||
|
if (return_save != NULL)
|
||||||
|
strlcpybuff(return_save, itemback->url_sav, HTS_URLMAXSIZE * 2);
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
back_clear_entry(itemback); /* delete entry content */
|
back_clear_entry(itemback); /* delete entry content */
|
||||||
freet(itemback); /* delete item */
|
freet(itemback); /* delete item */
|
||||||
@@ -671,7 +721,6 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
char BIGSTK headerBuff[8192 + 2];
|
char BIGSTK headerBuff[8192 + 2];
|
||||||
int readSizeHeader;
|
int readSizeHeader;
|
||||||
|
|
||||||
//int totalHeader = 0;
|
|
||||||
int dataincache = 0;
|
int dataincache = 0;
|
||||||
|
|
||||||
/* For BIG comments */
|
/* For BIG comments */
|
||||||
@@ -722,13 +771,10 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
HTS_URLMAXSIZE * 2);
|
HTS_URLMAXSIZE * 2);
|
||||||
ZIP_READFIELD_STRING(line, value, "Content-Disposition", r.cdispo,
|
ZIP_READFIELD_STRING(line, value, "Content-Disposition", r.cdispo,
|
||||||
sizeof(r.cdispo));
|
sizeof(r.cdispo));
|
||||||
//ZIP_READFIELD_STRING(line, value, "X-Addr", ..); // Original address
|
|
||||||
//ZIP_READFIELD_STRING(line, value, "X-Fil", ..); // Original URI filename
|
|
||||||
ZIP_READFIELD_STRING(line, value, "X-Save", previous_save_,
|
ZIP_READFIELD_STRING(line, value, "X-Save", previous_save_,
|
||||||
sizeof(previous_save_));
|
sizeof(previous_save_));
|
||||||
}
|
}
|
||||||
} while(offset < readSizeHeader && !lineEof);
|
} while (offset < readSizeHeader && !lineEof);
|
||||||
//totalHeader = offset;
|
|
||||||
|
|
||||||
/* Previous entry */
|
/* Previous entry */
|
||||||
if (previous_save_[0] != '\0') {
|
if (previous_save_[0] != '\0') {
|
||||||
@@ -745,6 +791,15 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
strlcpybuff(return_save, previous_save, HTS_URLMAXSIZE * 2);
|
strlcpybuff(return_save, previous_save, HTS_URLMAXSIZE * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A negative X-Size is corrupt; so is one >= INT_MAX when the data
|
||||||
|
is in the zip (the write path asserts int-sized). Headers-only
|
||||||
|
entries legitimately exceed INT_MAX (>2GB body on disk): keep
|
||||||
|
them, or every update would re-fetch the file. */
|
||||||
|
if (r.size < 0 || (dataincache && r.size >= INT_MAX)) {
|
||||||
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
|
strcpybuff(r.msg, "Cache Read Error : Bad Size");
|
||||||
|
}
|
||||||
|
|
||||||
/* Complete fields */
|
/* Complete fields */
|
||||||
r.totalsize = r.size;
|
r.totalsize = r.size;
|
||||||
r.adr = NULL;
|
r.adr = NULL;
|
||||||
@@ -771,7 +826,8 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
} // otherwise, the ZIP file is supposed to be consistent with data.
|
} // otherwise, the ZIP file is supposed to be consistent with data.
|
||||||
}
|
}
|
||||||
/* Read data ? */
|
/* Read data ? */
|
||||||
else { /* ne pas lire uniquement header */
|
else if (r.statuscode !=
|
||||||
|
STATUSCODE_INVALID) { /* ne pas lire uniquement header */
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
#if HTS_DIRECTDISK
|
#if HTS_DIRECTDISK
|
||||||
@@ -900,7 +956,6 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
r.statuscode = STATUSCODE_INVALID;
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
strcpybuff(r.msg,
|
strcpybuff(r.msg,
|
||||||
"Cache Write Error : Unable to Create File");
|
"Cache Write Error : Unable to Create File");
|
||||||
//printf("%s\n",save);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,7 +990,10 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
strcpybuff(r.msg,
|
strcpybuff(r.msg,
|
||||||
"Previous cache file not found (empty filename)");
|
"Previous cache file not found (empty filename)");
|
||||||
}
|
}
|
||||||
} else { /* Read in memory from disk */
|
} else if (r.size >= INT_MAX) { /* too big to read in memory */
|
||||||
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
|
strcpybuff(r.msg, "Cache Read Error : Bad Size");
|
||||||
|
} else { /* Read in memory from disk */
|
||||||
FILE *const fp = FOPEN(fconv(catbuff, sizeof(catbuff), previous_save), "rb");
|
FILE *const fp = FOPEN(fconv(catbuff, sizeof(catbuff), previous_save), "rb");
|
||||||
|
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
@@ -975,7 +1033,6 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
|
|||||||
strcpybuff(r.msg, "Cache Read Error : Read Data");
|
strcpybuff(r.msg, "Cache Read Error : Read Data");
|
||||||
} else
|
} else
|
||||||
*(r.adr + r.size) = '\0';
|
*(r.adr + r.size) = '\0';
|
||||||
//printf(">%s status %d\n",back[p].r.contenttype,back[p].r.statuscode);
|
|
||||||
} else { // erreur
|
} else { // erreur
|
||||||
r.statuscode = STATUSCODE_INVALID;
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
strcpybuff(r.msg, "Cache Memory Error");
|
strcpybuff(r.msg, "Cache Memory Error");
|
||||||
@@ -1154,17 +1211,14 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
|
|||||||
// sécurité
|
// sécurité
|
||||||
r.adr = NULL;
|
r.adr = NULL;
|
||||||
r.out = NULL;
|
r.out = NULL;
|
||||||
////r.location=NULL; non, fixée lors des 301 ou 302
|
|
||||||
r.fp = NULL;
|
r.fp = NULL;
|
||||||
|
|
||||||
if ((r.statuscode >= 0) && (r.statuscode <= 999)
|
if ((r.statuscode >= 0) && (r.statuscode <= 999)
|
||||||
&& (r.notmodified >= 0) && (r.notmodified <= 9)) { // petite vérif intégrité
|
&& (r.notmodified >= 0) && (r.notmodified <= 9)) { // petite vérif intégrité
|
||||||
if ((save) && (!header_only)) { /* ne pas lire uniquement header */
|
if ((save) && (!header_only)) { /* ne pas lire uniquement header */
|
||||||
//int to_file=0;
|
|
||||||
|
|
||||||
r.adr = NULL;
|
r.adr = NULL;
|
||||||
r.soc = INVALID_SOCKET;
|
r.soc = INVALID_SOCKET;
|
||||||
// // r.location=NULL;
|
|
||||||
|
|
||||||
#if HTS_DIRECTDISK
|
#if HTS_DIRECTDISK
|
||||||
// Court-circuit:
|
// Court-circuit:
|
||||||
@@ -1173,12 +1227,11 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
|
|||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
r.is_write = 1; // écrire
|
r.is_write = 1; // écrire
|
||||||
if (fexist_utf8(fconv(catbuff, sizeof(catbuff), save))) { // un fichier existe déja
|
if (fexist_utf8(fconv(catbuff, sizeof(catbuff),
|
||||||
//if (fsize_utf8(fconv(save))==r.size) { // même taille -- NON tant pis (taille mal declaree)
|
save))) { // un fichier existe déja
|
||||||
ok = 1; // plus rien à faire
|
ok = 1; // plus rien à faire
|
||||||
filenote(&opt->state.strc, save, NULL); // noter comme connu
|
filenote(&opt->state.strc, save, NULL); // noter comme connu
|
||||||
file_notify(opt, adr, fil, save, 0, 0, 0);
|
file_notify(opt, adr, fil, save, 0, 0, 0);
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pos < 0) && (!ok)) { // Pas de donnée en cache et fichier introuvable : erreur!
|
if ((pos < 0) && (!ok)) { // Pas de donnée en cache et fichier introuvable : erreur!
|
||||||
@@ -1229,7 +1282,6 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
|
|||||||
r.statuscode = STATUSCODE_INVALID;
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
strcpybuff(r.msg,
|
strcpybuff(r.msg,
|
||||||
"Cache Write Error : Unable to Create File");
|
"Cache Write Error : Unable to Create File");
|
||||||
//printf("%s\n",save);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1277,14 +1329,13 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
|
|||||||
strcpybuff(r.msg, "Cache Read Error : Read Data");
|
strcpybuff(r.msg, "Cache Read Error : Read Data");
|
||||||
} else
|
} else
|
||||||
*(r.adr + r.size) = '\0';
|
*(r.adr + r.size) = '\0';
|
||||||
//printf(">%s status %d\n",back[p].r.contenttype,back[p].r.statuscode);
|
|
||||||
} else { // erreur
|
} else { // erreur
|
||||||
r.statuscode = STATUSCODE_INVALID;
|
r.statuscode = STATUSCODE_INVALID;
|
||||||
strcpybuff(r.msg, "Cache Memory Error");
|
strcpybuff(r.msg, "Cache Memory Error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // si save==null, ne rien charger (juste en tête)
|
} // si save==null, ne rien charger (juste en tête)
|
||||||
} else {
|
} else {
|
||||||
#if DEBUGCA
|
#if DEBUGCA
|
||||||
printf("Cache Read Error : Bad Data");
|
printf("Cache Read Error : Bad Data");
|
||||||
@@ -1397,6 +1448,86 @@ static int hts_rename(httrackp * opt, const char *a, const char *b) {
|
|||||||
return rename(a, b);
|
return rename(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Pathname of a file inside the mirror dir (rotating concat buffer). */
|
||||||
|
static char *reconcile_path(httrackp *opt, const char *name) {
|
||||||
|
return fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
||||||
|
StringBuff(opt->path_log), name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Interrupted-run heuristic: prefer the old generation when the new cache
|
||||||
|
stalled below NEW_TINY while the old one grew past OLD_SOLID (historical
|
||||||
|
arbitrary thresholds). */
|
||||||
|
#define CACHE_RECONCILE_NEW_TINY 32768
|
||||||
|
#define CACHE_RECONCILE_OLD_SOLID 65536
|
||||||
|
|
||||||
|
/* Replace the new-generation file by the old one, when the old one exists. */
|
||||||
|
static void reconcile_promote(httrackp *opt, const char *oldname,
|
||||||
|
const char *newname) {
|
||||||
|
if (fexist(reconcile_path(opt, oldname))) {
|
||||||
|
remove(reconcile_path(opt, newname));
|
||||||
|
rename(reconcile_path(opt, oldname), reconcile_path(opt, newname));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void hts_cache_reconcile(httrackp *opt, hts_cache_reconcile_mode mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case CACHE_RECONCILE_PROMOTE:
|
||||||
|
/* Previous run rotated new.* to old.* then died before writing: promote
|
||||||
|
the old generation back, whichever format it uses. */
|
||||||
|
if (!fexist(reconcile_path(opt, "hts-cache/new.zip")))
|
||||||
|
reconcile_promote(opt, "hts-cache/old.zip", "hts-cache/new.zip");
|
||||||
|
if ((!fexist(reconcile_path(opt, "hts-cache/new.dat")) ||
|
||||||
|
!fexist(reconcile_path(opt, "hts-cache/new.ndx"))) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.dat")) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.ndx"))) {
|
||||||
|
reconcile_promote(opt, "hts-cache/old.dat", "hts-cache/new.dat");
|
||||||
|
reconcile_promote(opt, "hts-cache/old.ndx", "hts-cache/new.ndx");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CACHE_RECONCILE_INTERRUPTED:
|
||||||
|
/* Aborted run: keep the larger generation when the new cache is
|
||||||
|
suspiciously small next to the old one. The new file must exist: fsize()
|
||||||
|
is -1 for a missing file, which would spuriously pass the "< TINY" test
|
||||||
|
and overwrite a solid old generation that PROMOTE/ROLLBACK should keep.
|
||||||
|
*/
|
||||||
|
if (!opt->cache || !fexist(reconcile_path(opt, "hts-in_progress.lock")))
|
||||||
|
break;
|
||||||
|
if (fexist(reconcile_path(opt, "hts-cache/new.zip")) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.zip")) &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/new.zip")) <
|
||||||
|
CACHE_RECONCILE_NEW_TINY &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/old.zip")) >
|
||||||
|
CACHE_RECONCILE_OLD_SOLID &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/old.zip")) >
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/new.zip")))
|
||||||
|
reconcile_promote(opt, "hts-cache/old.zip", "hts-cache/new.zip");
|
||||||
|
if (fexist(reconcile_path(opt, "hts-cache/new.dat")) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.dat")) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.ndx")) &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/new.dat")) <
|
||||||
|
CACHE_RECONCILE_NEW_TINY &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/old.dat")) >
|
||||||
|
CACHE_RECONCILE_OLD_SOLID &&
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/old.dat")) >
|
||||||
|
fsize(reconcile_path(opt, "hts-cache/new.dat"))) {
|
||||||
|
reconcile_promote(opt, "hts-cache/old.dat", "hts-cache/new.dat");
|
||||||
|
reconcile_promote(opt, "hts-cache/old.ndx", "hts-cache/new.ndx");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CACHE_RECONCILE_ROLLBACK:
|
||||||
|
/* Nothing transferred: restore the previous generation and sidecars. */
|
||||||
|
reconcile_promote(opt, "hts-cache/old.zip", "hts-cache/new.zip");
|
||||||
|
if (fexist(reconcile_path(opt, "hts-cache/old.dat")) &&
|
||||||
|
fexist(reconcile_path(opt, "hts-cache/old.ndx"))) {
|
||||||
|
reconcile_promote(opt, "hts-cache/old.dat", "hts-cache/new.dat");
|
||||||
|
reconcile_promote(opt, "hts-cache/old.ndx", "hts-cache/new.ndx");
|
||||||
|
}
|
||||||
|
reconcile_promote(opt, "hts-cache/old.lst", "hts-cache/new.lst");
|
||||||
|
reconcile_promote(opt, "hts-cache/old.txt", "hts-cache/new.txt");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// renvoyer uniquement en tête, ou NULL si erreur
|
// renvoyer uniquement en tête, ou NULL si erreur
|
||||||
// return NULL upon error, and set -1 to r.statuscode
|
// return NULL upon error, and set -1 to r.statuscode
|
||||||
htsblk *cache_header(httrackp * opt, cache_back * cache, const char *adr,
|
htsblk *cache_header(httrackp * opt, cache_back * cache, const char *adr,
|
||||||
@@ -1427,25 +1558,10 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
mkdir(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache"),
|
mkdir(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache"),
|
||||||
HTS_PROTECT_FOLDER);
|
HTS_PROTECT_FOLDER);
|
||||||
#endif
|
#endif
|
||||||
if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.zip")))) { // il existe déja un cache précédent.. renommer
|
if ((fexist(fconcat(
|
||||||
/* Previous cache from the previous cache version */
|
OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
||||||
#if 0
|
StringBuff(opt->path_log),
|
||||||
/* No.. reuse with old httrack releases! */
|
"hts-cache/new.zip")))) { // a previous cache exists.. rename it
|
||||||
if (fexist
|
|
||||||
(fconcat
|
|
||||||
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log),
|
|
||||||
"hts-cache/old.dat")))
|
|
||||||
remove(fconcat
|
|
||||||
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log),
|
|
||||||
"hts-cache/old.dat"));
|
|
||||||
if (fexist
|
|
||||||
(fconcat
|
|
||||||
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log),
|
|
||||||
"hts-cache/old.ndx")))
|
|
||||||
remove(fconcat
|
|
||||||
(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log),
|
|
||||||
"hts-cache/old.ndx"));
|
|
||||||
#endif
|
|
||||||
/* Previous cache version */
|
/* Previous cache version */
|
||||||
if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer
|
if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer
|
||||||
rename(fconcat
|
rename(fconcat
|
||||||
@@ -1486,7 +1602,13 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
} else {
|
} else {
|
||||||
hts_log_print(opt, LOG_DEBUG, "Cache: successfully renamed");
|
hts_log_print(opt, LOG_DEBUG, "Cache: successfully renamed");
|
||||||
}
|
}
|
||||||
} else if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.dat"))) && (fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), StringBuff(opt->path_log), "hts-cache/new.ndx")))) { // il existe déja un cache précédent.. renommer
|
} else if ((fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
||||||
|
StringBuff(opt->path_log),
|
||||||
|
"hts-cache/new.dat"))) &&
|
||||||
|
(fexist(fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
||||||
|
StringBuff(opt->path_log),
|
||||||
|
"hts-cache/new.ndx")))) { // a previous cache
|
||||||
|
// exists.. rename it
|
||||||
#if DEBUGCA
|
#if DEBUGCA
|
||||||
printf("work with former cache\n");
|
printf("work with former cache\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -1515,7 +1637,7 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
"hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
"hts-cache/new.ndx"), fconcat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt),
|
||||||
StringBuff(opt->path_log),
|
StringBuff(opt->path_log),
|
||||||
"hts-cache/old.ndx"));
|
"hts-cache/old.ndx"));
|
||||||
} else { // un des deux (ou les deux) fichiers cache absents: effacer l'autre éventuel
|
} else { // one or both cache files missing: remove the remaining one
|
||||||
#if DEBUGCA
|
#if DEBUGCA
|
||||||
printf("new cache\n");
|
printf("new cache\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -1884,12 +2006,6 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
"hts-cache/new.lst"), "wb");
|
"hts-cache/new.lst"), "wb");
|
||||||
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
|
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
|
||||||
opt->state.strc.lst = cache->lst;
|
opt->state.strc.lst = cache->lst;
|
||||||
//{
|
|
||||||
//filecreate_params tmp;
|
|
||||||
//strcpybuff(tmp.path,StringBuff(opt->path_html)); // chemin
|
|
||||||
//tmp.lst=cache->lst; // fichier lst
|
|
||||||
//filenote("",&tmp); // initialiser filecreate
|
|
||||||
//}
|
|
||||||
|
|
||||||
// supprimer old.txt
|
// supprimer old.txt
|
||||||
if (fexist
|
if (fexist
|
||||||
@@ -1978,12 +2094,6 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
"hts-cache/new.lst"), "wb");
|
"hts-cache/new.lst"), "wb");
|
||||||
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
|
strcpybuff(opt->state.strc.path, StringBuff(opt->path_html));
|
||||||
opt->state.strc.lst = cache->lst;
|
opt->state.strc.lst = cache->lst;
|
||||||
//{
|
|
||||||
// filecreate_params tmp;
|
|
||||||
// strcpybuff(tmp.path,StringBuff(opt->path_html)); // chemin
|
|
||||||
// tmp.lst=cache->lst; // fichier lst
|
|
||||||
// filenote("",&tmp); // initialiser filecreate
|
|
||||||
//}
|
|
||||||
|
|
||||||
// supprimer old.txt
|
// supprimer old.txt
|
||||||
if (fexist
|
if (fexist
|
||||||
@@ -2015,8 +2125,6 @@ void cache_init(cache_back * cache, httrackp * opt) {
|
|||||||
"statuscode\tstatus ('servermsg')\tMIME\tEtag|Date\tURL\tlocalfile\t(from URL)"
|
"statuscode\tstatus ('servermsg')\tMIME\tEtag|Date\tURL\tlocalfile\t(from URL)"
|
||||||
LF);
|
LF);
|
||||||
}
|
}
|
||||||
// test
|
|
||||||
// cache_writedata(cache->ndx,cache->dat,"//[TEST]//","test1","TEST PIPO",9);
|
|
||||||
} // cache->ndx!=NULL
|
} // cache->ndx!=NULL
|
||||||
} //cache->zipOutput != NULL
|
} //cache->zipOutput != NULL
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,11 @@ htsblk cache_read(httrackp * opt, cache_back * cache, const char *adr,
|
|||||||
const char *fil, const char *save, char *location);
|
const char *fil, const char *save, char *location);
|
||||||
htsblk cache_read_ro(httrackp * opt, cache_back * cache, const char *adr,
|
htsblk cache_read_ro(httrackp * opt, cache_back * cache, const char *adr,
|
||||||
const char *fil, const char *save, char *location);
|
const char *fil, const char *save, char *location);
|
||||||
htsblk cache_read_including_broken(httrackp * opt, cache_back * cache,
|
/* Like cache_read, but also yields entries whose transfer broke; return_save
|
||||||
const char *adr, const char *fil);
|
(optional, HTS_URLMAXSIZE*2) receives the entry's recorded save name. */
|
||||||
|
htsblk cache_read_including_broken(httrackp *opt, cache_back *cache,
|
||||||
|
const char *adr, const char *fil,
|
||||||
|
char *return_save);
|
||||||
htsblk cache_readex(httrackp * opt, cache_back * cache, const char *adr,
|
htsblk cache_readex(httrackp * opt, cache_back * cache, const char *adr,
|
||||||
const char *fil, const char *save, char *location,
|
const char *fil, const char *save, char *location,
|
||||||
char *return_save, int readonly);
|
char *return_save, int readonly);
|
||||||
@@ -75,6 +78,17 @@ htsblk *cache_header(httrackp * opt, cache_back * cache, const char *adr,
|
|||||||
const char *fil, htsblk * r);
|
const char *fil, htsblk * r);
|
||||||
void cache_init(cache_back * cache, httrackp * opt);
|
void cache_init(cache_back * cache, httrackp * opt);
|
||||||
|
|
||||||
|
/* Which hts-cache/ generation (new.* vs old.*) is authoritative. */
|
||||||
|
typedef enum {
|
||||||
|
CACHE_RECONCILE_PROMOTE, /* no new cache: promote the old generation */
|
||||||
|
CACHE_RECONCILE_INTERRUPTED, /* aborted run: keep the larger generation */
|
||||||
|
CACHE_RECONCILE_ROLLBACK /* nothing transferred: restore the old one */
|
||||||
|
} hts_cache_reconcile_mode;
|
||||||
|
|
||||||
|
/* Reconcile the on-disk cache generations according to mode; a no-op when
|
||||||
|
the involved files are absent. */
|
||||||
|
void hts_cache_reconcile(httrackp *opt, hts_cache_reconcile_mode mode);
|
||||||
|
|
||||||
int cache_writedata(FILE * cache_ndx, FILE * cache_dat, const char *str1,
|
int cache_writedata(FILE * cache_ndx, FILE * cache_dat, const char *str1,
|
||||||
const char *str2, char *outbuff, int len);
|
const char *str2, char *outbuff, int len);
|
||||||
int cache_readdata(cache_back * cache, const char *str1, const char *str2,
|
int cache_readdata(cache_back * cache, const char *str1, const char *str2,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -44,6 +44,27 @@ typedef struct httrackp httrackp;
|
|||||||
Returns the number of failed checks (0 == success). */
|
Returns the number of failed checks (0 == success). */
|
||||||
int cache_selftests(httrackp *opt, const char *dir);
|
int cache_selftests(httrackp *opt, const char *dir);
|
||||||
|
|
||||||
|
/* Read a committed (frozen) cache fixture under <dir>/hts-cache/new.zip and
|
||||||
|
assert a fixed set of entries decodes field- and byte-exact. Unlike
|
||||||
|
cache_selftests (write-then-read with the same build, a round-trip), this
|
||||||
|
reads bytes an earlier build froze, so it catches read-path / format drift.
|
||||||
|
regen!=0 first rewrites the fixture from the same table (to regenerate the
|
||||||
|
committed file, never by the test). Returns the failed-check count. */
|
||||||
|
int cache_golden_selftest(httrackp *opt, const char *dir, int regen);
|
||||||
|
|
||||||
|
/* Cache write-failure policy (#174/#219): abort on fatal errno or a streak,
|
||||||
|
drop just the entry otherwise. Returns the failed-check count. */
|
||||||
|
int cache_write_failure_selftest(httrackp *opt, const char *dir);
|
||||||
|
|
||||||
|
/* Exercise the hts_cache_reconcile() generation policies on file fixtures
|
||||||
|
under <dir>. Returns the failed-check count. */
|
||||||
|
int cache_reconcile_selftest(httrackp *opt, const char *dir);
|
||||||
|
|
||||||
|
/* Inject read-side corruption (zip byte surgery: bad size, header, deflate)
|
||||||
|
under <dir> and assert every case degrades to STATUSCODE_INVALID without
|
||||||
|
tainting a sibling entry. */
|
||||||
|
int cache_corruption_selftest(httrackp *opt, const char *dir);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
// catch_url_init(&port,&return_host);
|
// catch_url_init(&port,&return_host);
|
||||||
HTSEXT_API T_SOC catch_url_init_std(int *port_prox, char *adr_prox) {
|
HTSEXT_API T_SOC catch_url_init_std(int *port_prox, char *adr_prox) {
|
||||||
T_SOC soc;
|
T_SOC soc;
|
||||||
int try_to_listen_to[] = { 8080, 3128, 80, 81, 82, 8081, 3129, 31337, 0, -1 };
|
int try_to_listen_to[] = {8080, 3128, 80, 81, 82, 8081, 3129, 0, -1};
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -135,7 +135,8 @@ HTSEXT_API T_SOC catch_url_init(int *port, /* 128 bytes */ char *adr) {
|
|||||||
// returns 0 if error
|
// returns 0 if error
|
||||||
// url: buffer where URL must be stored - or ip:port in case of failure
|
// url: buffer where URL must be stored - or ip:port in case of failure
|
||||||
// data: 32Kb
|
// data: 32Kb
|
||||||
HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
|
HTSEXT_API hts_boolean catch_url(T_SOC soc, char *url, char *method,
|
||||||
|
char *data) {
|
||||||
int retour = 0;
|
int retour = 0;
|
||||||
|
|
||||||
// connexion (accept)
|
// connexion (accept)
|
||||||
@@ -174,7 +175,9 @@ HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
|
|||||||
//
|
//
|
||||||
socinput(soc, line, 1000);
|
socinput(soc, line, 1000);
|
||||||
if (strnotempty(line)) {
|
if (strnotempty(line)) {
|
||||||
if (sscanf(line, "%s %s %s", method, url, protocol) == 3) {
|
/* widths bound the caller buffers: method[32], url[HTS_URLMAXSIZE*2],
|
||||||
|
protocol[256] */
|
||||||
|
if (sscanf(line, "%31s %2047s %255s", method, url, protocol) == 3) {
|
||||||
lien_adrfil af;
|
lien_adrfil af;
|
||||||
|
|
||||||
// méthode en majuscule
|
// méthode en majuscule
|
||||||
@@ -194,7 +197,6 @@ HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
|
|||||||
htsblk blkretour;
|
htsblk blkretour;
|
||||||
|
|
||||||
hts_init_htsblk(&blkretour);
|
hts_init_htsblk(&blkretour);
|
||||||
//memset(&blkretour, 0, sizeof(htsblk)); // effacer
|
|
||||||
blkretour.location = loc; // si non nul, contiendra l'adresse véritable en cas de moved xx
|
blkretour.location = loc; // si non nul, contiendra l'adresse véritable en cas de moved xx
|
||||||
// Lire en têtes restants
|
// Lire en têtes restants
|
||||||
sprintf(data, "%s %s %s\r\n", method, af.fil, protocol);
|
sprintf(data, "%s %s %s\r\n", method, af.fil, protocol);
|
||||||
@@ -204,8 +206,8 @@ HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
|
|||||||
strlcatbuff(data, line, CATCH_URL_DATA_SIZE);
|
strlcatbuff(data, line, CATCH_URL_DATA_SIZE);
|
||||||
strlcatbuff(data, "\r\n", CATCH_URL_DATA_SIZE);
|
strlcatbuff(data, "\r\n", CATCH_URL_DATA_SIZE);
|
||||||
}
|
}
|
||||||
// CR/LF final de l'en tête inutile car déja placé via la ligne vide juste au dessus
|
// CR/LF final de l'en tête inutile car déja placé via la ligne vide
|
||||||
//strcatbuff(data,"\r\n");
|
// juste au dessus
|
||||||
if (blkretour.totalsize > 0) {
|
if (blkretour.totalsize > 0) {
|
||||||
int len = (int) min(blkretour.totalsize, 32000);
|
int len = (int) min(blkretour.totalsize, 32000);
|
||||||
int pos = (int) strlen(data);
|
int pos = (int) strlen(data);
|
||||||
|
|||||||
@@ -841,71 +841,6 @@ static unsigned int nlz8(unsigned char x) {
|
|||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
/* Sample. */
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
int i;
|
|
||||||
int hex = 0;
|
|
||||||
|
|
||||||
#define READ_INT(DEST) \
|
|
||||||
( ( !hex && sscanf(argv[i], "%d", &(DEST)) == 1) \
|
|
||||||
|| (hex && sscanf(argv[i], "%x", &(DEST)) == 1 ) )
|
|
||||||
|
|
||||||
for(i = 1 ; i < argc ; i++) {
|
|
||||||
unsigned int uc, from, to;
|
|
||||||
|
|
||||||
if (strcmp(argv[i], "--hex") == 0) {
|
|
||||||
hex = 1;
|
|
||||||
}
|
|
||||||
else if (strcmp(argv[i], "--decimal") == 0) {
|
|
||||||
hex = 0;
|
|
||||||
}
|
|
||||||
else if (strcmp(argv[i], "--decode") == 0) {
|
|
||||||
#define RD fgetc_unlocked(stdin)
|
|
||||||
#define WR(C) do { \
|
|
||||||
if (C != -1) { \
|
|
||||||
printf("%04x\n", C); \
|
|
||||||
} else if (!feof(stdin)) { \
|
|
||||||
fprintf(stderr, "read error\n"); \
|
|
||||||
exit(EXIT_FAILURE); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
while(!feof(stdin)) {
|
|
||||||
READ_UNICODE(RD, WR);
|
|
||||||
}
|
|
||||||
#undef RD
|
|
||||||
#undef WR
|
|
||||||
}
|
|
||||||
else if (strcmp(argv[i], "-range") == 0
|
|
||||||
&& i + 2 < argc
|
|
||||||
&& (++i, 1)
|
|
||||||
&& READ_INT(from)
|
|
||||||
&& (++i, 1)
|
|
||||||
&& READ_INT(to)
|
|
||||||
) {
|
|
||||||
unsigned int i;
|
|
||||||
for(i = from ; i < to ; i++) {
|
|
||||||
#define EM(C) fputc_unlocked(C, stdout)
|
|
||||||
EMIT_UNICODE(i, EM);
|
|
||||||
#undef EM
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (READ_INT(uc)) {
|
|
||||||
#define EM(C) fputc_unlocked(C, stdout)
|
|
||||||
EMIT_UNICODE(uc, EM);
|
|
||||||
#undef EM
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* IDNA helpers. */
|
/* IDNA helpers. */
|
||||||
#undef ADD_BYTE
|
#undef ADD_BYTE
|
||||||
#undef INCREASE_CAPA
|
#undef INCREASE_CAPA
|
||||||
|
|||||||
@@ -52,12 +52,8 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#define DEFAULT_FTP "index.txt"
|
#define DEFAULT_FTP "index.txt"
|
||||||
|
|
||||||
// extension par défaut pour fichiers n'en ayant pas
|
// extension par défaut pour fichiers n'en ayant pas
|
||||||
#define DEFAULT_EXT ".html"
|
#define DEFAULT_EXT ".html"
|
||||||
#define DEFAULT_EXT_SHORT ".htm"
|
#define DEFAULT_EXT_SHORT ".htm"
|
||||||
//#define DEFAULT_BIN_EXT ".bin"
|
|
||||||
//#define DEFAULT_BIN_EXT_SHORT ".bin"
|
|
||||||
//#define DEFAULT_EXT ".txt"
|
|
||||||
//#define DEFAULT_EXT_SHORT ".txt"
|
|
||||||
|
|
||||||
// éviter les /nul, /con..
|
// éviter les /nul, /con..
|
||||||
#define HTS_OVERRIDE_DOS_FOLDERS 1
|
#define HTS_OVERRIDE_DOS_FOLDERS 1
|
||||||
@@ -80,14 +76,11 @@ Please visit our Website: http://www.httrack.com
|
|||||||
// always direct-to-disk (0/1)
|
// always direct-to-disk (0/1)
|
||||||
#define HTS_DIRECTDISK_ALWAYS 1
|
#define HTS_DIRECTDISK_ALWAYS 1
|
||||||
|
|
||||||
// gérer une table de hachage?
|
|
||||||
// REMOVED
|
|
||||||
// #define HTS_HASH 1
|
|
||||||
|
|
||||||
// fast cache (build hash table)
|
// fast cache (build hash table)
|
||||||
#define HTS_FAST_CACHE 1
|
#define HTS_FAST_CACHE 1
|
||||||
|
|
||||||
// le > peut être considéré comme un tag de fermeture de commentaire (<!-- > est valide)
|
// le > peut être considéré comme un tag de fermeture de commentaire (<!-- > est
|
||||||
|
// valide)
|
||||||
#define GT_ENDS_COMMENT 1
|
#define GT_ENDS_COMMENT 1
|
||||||
|
|
||||||
// always adds a '/' at the end if a '~' is encountered (/~smith -> /~smith/)
|
// always adds a '/' at the end if a '~' is encountered (/~smith -> /~smith/)
|
||||||
@@ -96,26 +89,10 @@ Please visit our Website: http://www.httrack.com
|
|||||||
// always transform a '//' into a sigle '/'
|
// always transform a '//' into a sigle '/'
|
||||||
#define HTS_STRIP_DOUBLE_SLASH 0
|
#define HTS_STRIP_DOUBLE_SLASH 0
|
||||||
|
|
||||||
// case-sensitive pour les dossiers et fichiers (0/1)
|
|
||||||
// [normalement 1, mais pose des problèmes (url malformée par exemple) et n'est pas très utile..
|
|
||||||
// ..et pas bcp respecté]
|
|
||||||
// REMOVED
|
|
||||||
// #define HTS_CASSE 0
|
|
||||||
|
|
||||||
// Un fichier ayant une taille différente du content-length doit il être annulé?
|
|
||||||
// SEE opt.tolerant and opt.http10
|
|
||||||
// #define HTS_CL_IS_FATAL 0
|
|
||||||
|
|
||||||
// une erreur supprime le fichier sur disque
|
// une erreur supprime le fichier sur disque
|
||||||
// (non fixé pour cause de retry)
|
// (non fixé pour cause de retry)
|
||||||
#define HTS_REMOVE_BAD_FILES 0
|
#define HTS_REMOVE_BAD_FILES 0
|
||||||
|
|
||||||
// en cas de Range: xx- donnant un Content-length: xx
|
|
||||||
// alors skipper le fichier, considéré comme transmis
|
|
||||||
// #define HTS_SKIP_FULL_RANGE 1
|
|
||||||
|
|
||||||
// nombre max de filtres que l'utilisateur peut fixer
|
|
||||||
// #define HTS_FILTERSMAX 10000
|
|
||||||
#define HTS_FILTERSINC 1000
|
#define HTS_FILTERSINC 1000
|
||||||
|
|
||||||
// connect non bloquant? (poll sur write)
|
// connect non bloquant? (poll sur write)
|
||||||
|
|||||||
774
src/htscore.c
774
src/htscore.c
File diff suppressed because it is too large
Load Diff
282
src/htscore.h
282
src/htscore.h
@@ -30,7 +30,9 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
// Fichier librairie .h
|
/* Core engine declarations. Not an installed header, but part of the de-facto
|
||||||
|
API surface: external consumers (e.g. httrack-android) read these structs and
|
||||||
|
constants and call functions declared here. */
|
||||||
#ifndef HTS_CORE_DEFH
|
#ifndef HTS_CORE_DEFH
|
||||||
#define HTS_CORE_DEFH
|
#define HTS_CORE_DEFH
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
/* specific definitions */
|
/* specific definitions */
|
||||||
#include "htsbase.h"
|
#include "htsbase.h"
|
||||||
// Includes & définitions
|
/* Includes and definitions */
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -83,45 +85,45 @@ typedef struct filecreate_params filecreate_params;
|
|||||||
// options
|
// options
|
||||||
#include "htsopt.h"
|
#include "htsopt.h"
|
||||||
|
|
||||||
// INCLUDES .H PARTIES DE CODE HTTRACK
|
// HTTrack engine sub-headers
|
||||||
|
|
||||||
// routine main
|
// main entry point
|
||||||
#include "htscoremain.h"
|
#include "htscoremain.h"
|
||||||
|
|
||||||
// core routines
|
// core routines
|
||||||
#include "htscore.h"
|
#include "htscore.h"
|
||||||
|
|
||||||
// divers outils pour httrack.c
|
// misc tools for httrack.c
|
||||||
#include "htstools.h"
|
#include "htstools.h"
|
||||||
|
|
||||||
// aide pour la version en ligne de commande
|
// command-line help
|
||||||
#include "htshelp.h"
|
#include "htshelp.h"
|
||||||
|
|
||||||
// génération du nom de fichier à sauver
|
// build the on-disk save filename
|
||||||
#include "htsname.h"
|
#include "htsname.h"
|
||||||
|
|
||||||
// gestion ftp
|
// FTP support
|
||||||
#include "htsftp.h"
|
#include "htsftp.h"
|
||||||
|
|
||||||
// gestion interception d'URL
|
// URL interception
|
||||||
#include "htscatchurl.h"
|
#include "htscatchurl.h"
|
||||||
|
|
||||||
// gestion robots.txt
|
// robots.txt handling
|
||||||
#include "htsrobots.h"
|
#include "htsrobots.h"
|
||||||
|
|
||||||
// routines d'acceptation de liens
|
// link-acceptance rules
|
||||||
#include "htswizard.h"
|
#include "htswizard.h"
|
||||||
|
|
||||||
// routines de regexp
|
// regexp/filter routines
|
||||||
#include "htsfilters.h"
|
#include "htsfilters.h"
|
||||||
|
|
||||||
// gestion backing
|
// download backing (the back[] slot ring)
|
||||||
#include "htsback.h"
|
#include "htsback.h"
|
||||||
|
|
||||||
// gestion cache
|
// cache handling
|
||||||
#include "htscache.h"
|
#include "htscache.h"
|
||||||
|
|
||||||
// gestion hashage
|
// hashing
|
||||||
#include "htshash.h"
|
#include "htshash.h"
|
||||||
#include "coucal.h"
|
#include "coucal.h"
|
||||||
|
|
||||||
@@ -129,87 +131,116 @@ typedef struct filecreate_params filecreate_params;
|
|||||||
|
|
||||||
#include "hts-indextmpl.h"
|
#include "hts-indextmpl.h"
|
||||||
|
|
||||||
// adr, fil
|
/** A remote URL split into host and path, each a fixed inline buffer
|
||||||
|
(HTS_URLMAXSIZE*2 bytes, NUL-terminated). */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_adrfil
|
#ifndef HTS_DEF_FWSTRUCT_lien_adrfil
|
||||||
#define HTS_DEF_FWSTRUCT_lien_adrfil
|
#define HTS_DEF_FWSTRUCT_lien_adrfil
|
||||||
typedef struct lien_adrfil lien_adrfil;
|
typedef struct lien_adrfil lien_adrfil;
|
||||||
#endif
|
#endif
|
||||||
struct lien_adrfil {
|
struct lien_adrfil {
|
||||||
char adr[HTS_URLMAXSIZE * 2]; // adresse
|
char adr[HTS_URLMAXSIZE * 2]; /**< host (address) */
|
||||||
char fil[HTS_URLMAXSIZE * 2]; // nom du fichier distant
|
char fil[HTS_URLMAXSIZE * 2]; /**< remote file path */
|
||||||
};
|
};
|
||||||
|
|
||||||
// adr, fil, save
|
/** A remote URL plus the local on-disk path it is saved to. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_adrfilsave
|
#ifndef HTS_DEF_FWSTRUCT_lien_adrfilsave
|
||||||
#define HTS_DEF_FWSTRUCT_lien_adrfilsave
|
#define HTS_DEF_FWSTRUCT_lien_adrfilsave
|
||||||
typedef struct lien_adrfilsave lien_adrfilsave;
|
typedef struct lien_adrfilsave lien_adrfilsave;
|
||||||
#endif
|
#endif
|
||||||
struct lien_adrfilsave {
|
struct lien_adrfilsave {
|
||||||
lien_adrfil af;
|
lien_adrfil af;
|
||||||
char save[HTS_URLMAXSIZE * 2]; // nom à sauver sur disque (avec chemin éventuel)
|
char save[HTS_URLMAXSIZE * 2]; /**< local save path (with directory) */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Per-slot connect-fallback bookkeeping (parallel to struct_back.lnk).
|
||||||
|
Tracks which resolved address the slot is currently connecting to so a
|
||||||
|
stuck connect can be retried against the next one. */
|
||||||
|
typedef struct hts_connect_fallback {
|
||||||
|
int addr_index; /**< candidate being connected (0-based) */
|
||||||
|
int addr_count; /**< resolved addresses; -1 = not yet probed */
|
||||||
|
TStamp connect_start; /**< when the current candidate's connect began */
|
||||||
|
} hts_connect_fallback;
|
||||||
|
|
||||||
|
/** The download-slot ring: the set of concurrent transfers in flight.
|
||||||
|
Allocated/owned by the engine; consumers (status callbacks, the loop)
|
||||||
|
read it but do not resize or free it. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_struct_back
|
#ifndef HTS_DEF_FWSTRUCT_struct_back
|
||||||
#define HTS_DEF_FWSTRUCT_struct_back
|
#define HTS_DEF_FWSTRUCT_struct_back
|
||||||
typedef struct struct_back struct_back;
|
typedef struct struct_back struct_back;
|
||||||
#endif
|
#endif
|
||||||
struct struct_back {
|
struct struct_back {
|
||||||
lien_back *lnk;
|
lien_back *lnk; /**< slot array, valid indices [0..count-1]
|
||||||
int count;
|
(count+1 entries allocated); a slot is
|
||||||
coucal ready;
|
active iff lnk[i].status != STATUS_FREE.
|
||||||
LLint ready_size_bytes;
|
See struct lien_back in htsopt.h and the
|
||||||
|
STATUS_* codes in htsbasenet.h. */
|
||||||
|
int count; /**< number of usable slots (back_max) */
|
||||||
|
coucal ready; /**< index of slots whose transfer completed */
|
||||||
|
LLint ready_size_bytes; /**< total bytes buffered in completed slots */
|
||||||
|
hts_connect_fallback *connect_fallback; /**< per-slot, count+1 entries */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct cache_back_zip_entry cache_back_zip_entry;
|
typedef struct cache_back_zip_entry cache_back_zip_entry;
|
||||||
|
|
||||||
// cache
|
/** Open handle to the mirror cache (the read-from-old / write-to-new state
|
||||||
|
used to resume and to avoid re-fetching unchanged files). Engine-owned. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_cache_back
|
#ifndef HTS_DEF_FWSTRUCT_cache_back
|
||||||
#define HTS_DEF_FWSTRUCT_cache_back
|
#define HTS_DEF_FWSTRUCT_cache_back
|
||||||
typedef struct cache_back cache_back;
|
typedef struct cache_back cache_back;
|
||||||
#endif
|
#endif
|
||||||
struct cache_back {
|
struct cache_back {
|
||||||
int version; // 0 ou 1
|
int version; /**< cache-file format version being read */
|
||||||
/* */
|
/* */
|
||||||
int type;
|
int type;
|
||||||
int ro;
|
int ro; /**< read-only: no new cache is written */
|
||||||
FILE *dat, *ndx, *olddat;
|
FILE *dat, *ndx, *olddat; /**< new data, new index, old data files */
|
||||||
char *use; // liste des adr+fil
|
char *use; /**< in-memory list of cached adr+fil keys */
|
||||||
FILE *lst; // liste des fichiers pour la "purge"
|
FILE *lst; /**< file list, used for purge */
|
||||||
FILE *txt; // liste des fichiers (info)
|
FILE *txt; /**< human-readable file list (info) */
|
||||||
char lastmodified[256];
|
char lastmodified[256];
|
||||||
// HASH
|
// HASH
|
||||||
coucal hashtable;
|
coucal hashtable;
|
||||||
// HASH for tests (naming subsystem)
|
// HASH for tests (naming subsystem)
|
||||||
coucal cached_tests;
|
coucal cached_tests;
|
||||||
// fichiers log optionnels
|
/* optional log files */
|
||||||
FILE *log;
|
FILE *log;
|
||||||
FILE *errlog;
|
FILE *errlog;
|
||||||
// variables
|
/* read-ahead cursors into the old cache */
|
||||||
int ptr_ant; // pointeur pour anticiper
|
int ptr_ant;
|
||||||
int ptr_last; // pointeur pour anticiper
|
int ptr_last;
|
||||||
//
|
/* ZIP-backed cache backend (newer format) */
|
||||||
void *zipInput;
|
void *zipInput;
|
||||||
void *zipOutput;
|
void *zipOutput;
|
||||||
cache_back_zip_entry *zipEntries;
|
cache_back_zip_entry *zipEntries;
|
||||||
int zipEntriesOffs;
|
int zipEntriesOffs;
|
||||||
int zipEntriesCapa;
|
int zipEntriesCapa;
|
||||||
|
hts_boolean
|
||||||
|
zipWriteFailed; /**< a cache write failed; stop touching the stream */
|
||||||
|
int zipWriteFailures; /**< consecutive entry write failures; reset on store */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_hash_struct
|
#ifndef HTS_DEF_FWSTRUCT_hash_struct
|
||||||
#define HTS_DEF_FWSTRUCT_hash_struct
|
#define HTS_DEF_FWSTRUCT_hash_struct
|
||||||
typedef struct hash_struct hash_struct;
|
typedef struct hash_struct hash_struct;
|
||||||
#endif
|
#endif
|
||||||
|
/** Lookup indexes over the link heap: map save-name / URL back to a link, so a
|
||||||
|
URL seen twice resolves to one entry. The coucal tables index into liens;
|
||||||
|
they do not own the links. */
|
||||||
struct hash_struct {
|
struct hash_struct {
|
||||||
/* Links big array reference */
|
/* points at the engine's link array (opt->liens); not owned */
|
||||||
const lien_url *const*const*liens;
|
const lien_url *const*const*liens;
|
||||||
/* Savename (case insensitive ; lowercased) */
|
/* save-name -> link index (case-insensitive: keys lowercased) */
|
||||||
coucal sav;
|
coucal sav;
|
||||||
/* Address and path */
|
/* address+path -> link index */
|
||||||
coucal adrfil;
|
coucal adrfil;
|
||||||
/* Former address and path */
|
/* former address+path -> link index (renamed/moved entries) */
|
||||||
coucal former_adrfil;
|
coucal former_adrfil;
|
||||||
/** Buffers **/
|
/* effective urlhack sub-flags: www.==host / // collapse / query-arg sort */
|
||||||
int normalized;
|
hts_boolean norm_host;
|
||||||
|
hts_boolean norm_slash;
|
||||||
|
hts_boolean norm_query;
|
||||||
|
/* query-strip keys (not owned); set from opt->strip_query at hash_init */
|
||||||
|
const char *strip_query;
|
||||||
char normfil[HTS_URLMAXSIZE * 2];
|
char normfil[HTS_URLMAXSIZE * 2];
|
||||||
char normfil2[HTS_URLMAXSIZE * 2];
|
char normfil2[HTS_URLMAXSIZE * 2];
|
||||||
char catbuff[CATBUFF_SIZE];
|
char catbuff[CATBUFF_SIZE];
|
||||||
@@ -219,134 +250,243 @@ struct hash_struct {
|
|||||||
#define HTS_DEF_FWSTRUCT_filecreate_params
|
#define HTS_DEF_FWSTRUCT_filecreate_params
|
||||||
typedef struct filecreate_params filecreate_params;
|
typedef struct filecreate_params filecreate_params;
|
||||||
#endif
|
#endif
|
||||||
|
/** Parameters threaded through file-creation callbacks (filenote). */
|
||||||
struct filecreate_params {
|
struct filecreate_params {
|
||||||
FILE *lst;
|
FILE *lst; /**< open file list to append created paths to */
|
||||||
char path[HTS_URLMAXSIZE * 2];
|
char path[HTS_URLMAXSIZE * 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Access macros. */
|
/* Convenience accessors over the link heap; assume `opt` (and where used,
|
||||||
|
`ptr`/`parent_relative`) are in scope. heap(N) is the Nth link;
|
||||||
|
heap_top_index() is the last recorded link's index. */
|
||||||
#define heap(N) (opt->liens[N])
|
#define heap(N) (opt->liens[N])
|
||||||
|
|
||||||
#define heap_top_index() (opt->lien_tot - 1)
|
#define heap_top_index() (opt->lien_tot - 1)
|
||||||
|
|
||||||
#define heap_top() (heap(heap_top_index()))
|
#define heap_top() (heap(heap_top_index()))
|
||||||
|
|
||||||
#define urladr() (heap(ptr)->adr)
|
#define urladr() (heap(ptr)->adr)
|
||||||
|
|
||||||
#define urlfil() (heap(ptr)->fil)
|
#define urlfil() (heap(ptr)->fil)
|
||||||
|
|
||||||
#define savename() (heap(ptr)->sav)
|
#define savename() (heap(ptr)->sav)
|
||||||
|
|
||||||
#define parenturladr() (heap(heap(ptr)->precedent)->adr)
|
#define parenturladr() (heap(heap(ptr)->precedent)->adr)
|
||||||
|
|
||||||
#define parenturlfil() (heap(heap(ptr)->precedent)->fil)
|
#define parenturlfil() (heap(heap(ptr)->precedent)->fil)
|
||||||
|
|
||||||
#define parentsavename() (heap(heap(ptr)->precedent)->sav)
|
#define parentsavename() (heap(heap(ptr)->precedent)->sav)
|
||||||
|
|
||||||
#define relativeurladr() ((!parent_relative)?urladr():parenturladr())
|
#define relativeurladr() ((!parent_relative)?urladr():parenturladr())
|
||||||
|
|
||||||
#define relativeurlfil() ((!parent_relative)?urlfil():parenturlfil())
|
#define relativeurlfil() ((!parent_relative)?urlfil():parenturlfil())
|
||||||
|
|
||||||
#define relativesavename() ((!parent_relative)?savename():parentsavename())
|
#define relativesavename() ((!parent_relative)?savename():parentsavename())
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library-internal helpers (engine-only, HTS_INTERNAL_BYTECODE). */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
|
/* True if a new cache is being written (plain or zip backend). */
|
||||||
HTS_STATIC int cache_writable(cache_back * cache) {
|
HTS_STATIC int cache_writable(cache_back * cache) {
|
||||||
return (cache != NULL && (cache->dat != NULL || cache->zipOutput != NULL));
|
return (cache != NULL && (cache->dat != NULL || cache->zipOutput != NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* True if an old cache is available to read (plain or zip backend). */
|
||||||
HTS_STATIC int cache_readable(cache_back * cache) {
|
HTS_STATIC int cache_readable(cache_back * cache) {
|
||||||
return (cache != NULL && (cache->olddat != NULL || cache->zipInput != NULL));
|
return (cache != NULL && (cache->olddat != NULL || cache->zipInput != NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fonctions
|
// Functions
|
||||||
|
|
||||||
// INCLUDES .H PARTIES DE CODE HTTRACK
|
/* Library-internal only (engine TUs). */
|
||||||
|
|
||||||
/* Library internal definictions */
|
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
char *hts_cancel_file_pop(httrackp * opt);
|
char *hts_cancel_file_pop(httrackp * opt);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// add a link on the heap
|
/* Record a link on the heap. All strings are copied (caller keeps ownership).
|
||||||
|
Returns 1 on success, 0 if the link limit (opt->maxlink) is reached. */
|
||||||
int hts_record_link(httrackp * opt,
|
int hts_record_link(httrackp * opt,
|
||||||
const char *address, const char *file, const char *save,
|
const char *address, const char *file, const char *save,
|
||||||
const char *ref_address, const char *ref_file,
|
const char *ref_address, const char *ref_file,
|
||||||
const char *codebase);
|
const char *codebase);
|
||||||
|
|
||||||
// index of the latest added link
|
/* Index of the most recently recorded link. */
|
||||||
size_t hts_record_link_latest(httrackp *opt);
|
size_t hts_record_link_latest(httrackp *opt);
|
||||||
|
|
||||||
// invalidate an entry
|
/* Mark link at index lpos as not to be processed (sets pass2 = -1). */
|
||||||
void hts_invalidate_link(httrackp * opt, int lpos);
|
void hts_invalidate_link(httrackp * opt, int lpos);
|
||||||
|
|
||||||
// wipe all records
|
/* Reset / free the engine's link heap. */
|
||||||
void hts_record_init(httrackp *opt);
|
void hts_record_init(httrackp *opt);
|
||||||
|
|
||||||
void hts_record_free(httrackp *opt);
|
void hts_record_free(httrackp *opt);
|
||||||
|
|
||||||
//int httpmirror(char* url,int level,httrackp opt);
|
/* Run the mirror for the given start URL(s) under opt. Top-level engine entry.
|
||||||
|
*/
|
||||||
int httpmirror(char *url1, httrackp * opt);
|
int httpmirror(char *url1, httrackp * opt);
|
||||||
|
|
||||||
|
/* Write len bytes of adr to local path s. url_adr/url_fil (may be NULL) name
|
||||||
|
the source URL for logging/notification. */
|
||||||
int filesave(httrackp * opt, const char *adr, int len, const char *s,
|
int filesave(httrackp * opt, const char *adr, int len, const char *s,
|
||||||
const char *url_adr /* = NULL */ ,
|
const char *url_adr /* = NULL */ ,
|
||||||
const char *url_fil /* = NULL */ );
|
const char *url_fil /* = NULL */ );
|
||||||
|
|
||||||
char *hts_cancel_file_pop(httrackp * opt);
|
char *hts_cancel_file_pop(httrackp * opt);
|
||||||
|
|
||||||
int check_fatal_io_errno(void);
|
int check_fatal_io_errno(void);
|
||||||
|
|
||||||
int engine_stats(void);
|
int engine_stats(void);
|
||||||
|
|
||||||
void host_ban(httrackp * opt, int ptr, struct_back * sback, const char *host);
|
void host_ban(httrackp * opt, int ptr, struct_back * sback, const char *host);
|
||||||
|
|
||||||
|
/* Open local file s for writing (filecreate, truncate) or appending
|
||||||
|
(fileappend), creating parent directories as needed. Return an open FILE*
|
||||||
|
the caller must fclose(), or NULL on failure. */
|
||||||
FILE *filecreate(filenote_strc * strct, const char *s);
|
FILE *filecreate(filenote_strc * strct, const char *s);
|
||||||
|
|
||||||
FILE *fileappend(filenote_strc * strct, const char *s);
|
FILE *fileappend(filenote_strc * strct, const char *s);
|
||||||
|
|
||||||
|
/* Create an empty file, return 1 on success, 0 on failure. */
|
||||||
int filecreateempty(filenote_strc * strct, const char *filename);
|
int filecreateempty(filenote_strc * strct, const char *filename);
|
||||||
|
|
||||||
int filenote(filenote_strc * strct, const char *s, filecreate_params * params);
|
int filenote(filenote_strc * strct, const char *s, filecreate_params * params);
|
||||||
|
|
||||||
void file_notify(httrackp * opt, const char *adr, const char *fil,
|
void file_notify(httrackp * opt, const char *adr, const char *fil,
|
||||||
const char *save, int create, int modify, int wasupdated);
|
const char *save, int create, int modify, int wasupdated);
|
||||||
|
|
||||||
void usercommand(httrackp * opt, int exe, const char *cmd, const char *file,
|
void usercommand(httrackp * opt, int exe, const char *cmd, const char *file,
|
||||||
const char *adr, const char *fil);
|
const char *adr, const char *fil);
|
||||||
|
|
||||||
void usercommand_exe(const char *cmd, const char *file);
|
void usercommand_exe(const char *cmd, const char *file);
|
||||||
|
|
||||||
|
// Finish the makeindex index.html (footer + refresh meta), run usercommand.
|
||||||
|
// Updates *makeindex_done/*makeindex_fp in place; adr/fil are the mode strings.
|
||||||
|
void hts_finish_makeindex(httrackp *opt, int *makeindex_done,
|
||||||
|
FILE **makeindex_fp, int makeindex_links,
|
||||||
|
const char *makeindex_firstlink,
|
||||||
|
const char *template_footer, const char *adr,
|
||||||
|
const char *fil);
|
||||||
|
|
||||||
|
// Flush ht_buff[0..ht_len] to save on disk (skip if MD5 unchanged); *fp
|
||||||
|
// closed+NULLed on write. Precondition: ht_len>0.
|
||||||
|
void hts_finish_html_file(httrackp *opt, cache_back *cache, htsblk *r,
|
||||||
|
FILE **fp, const char *ht_buff, size_t ht_len,
|
||||||
|
const char *adr, const char *fil, const char *save);
|
||||||
|
|
||||||
int filters_init(char ***ptrfilters, int maxfilter, int filterinc);
|
int filters_init(char ***ptrfilters, int maxfilter, int filterinc);
|
||||||
|
|
||||||
int fspc(httrackp * opt, FILE * fp, const char *type);
|
int fspc(httrackp * opt, FILE * fp, const char *type);
|
||||||
|
|
||||||
char *next_token(char *p, int flag);
|
char *next_token(char *p, int flag);
|
||||||
|
|
||||||
//
|
/* Like fil_normalized(), but first drops query keys in STRIP (comma-separated,
|
||||||
|
"*" = all); STRIP NULL/empty behaves exactly like fil_normalized(). */
|
||||||
|
char *fil_normalized_filtered(const char *source, char *dest,
|
||||||
|
const char *strip);
|
||||||
|
|
||||||
|
/* As fil_normalized_filtered(), but DO_SLASH/DO_QUERY gate the // collapse and
|
||||||
|
the query-argument sort independently (the urlhack sub-flags). */
|
||||||
|
char *fil_normalized_filtered_ex(const char *source, char *dest,
|
||||||
|
const char *strip, int do_slash, int do_query);
|
||||||
|
|
||||||
|
/* For URL ADR/FIL, return (in DEST) the comma keylist to strip from the
|
||||||
|
'\n'-separated "[pattern=]keys" RULES (patterns matched on host/path via
|
||||||
|
strjoker, last wins); NULL if none match. Feeds fil_normalized_filtered(). */
|
||||||
|
const char *hts_query_strip_keys(const char *rules, const char *adr,
|
||||||
|
const char *fil, char *dest, size_t destsize);
|
||||||
|
|
||||||
|
/* Read a whole file into a freshly malloc'd, NUL-terminated buffer; the caller
|
||||||
|
owns it and must release it with freet(). Return NULL on missing/unreadable
|
||||||
|
file (readfile_or substitutes defaultdata instead). The byte content is NOT
|
||||||
|
transcoded except readfile_utf8, which expects a UTF-8 path. readfile2
|
||||||
|
reports the byte size (excluding the NUL) via *size when non-NULL. */
|
||||||
char *readfile(const char *fil);
|
char *readfile(const char *fil);
|
||||||
|
|
||||||
char *readfile2(const char *fil, LLint * size);
|
char *readfile2(const char *fil, LLint * size);
|
||||||
|
|
||||||
char *readfile_utf8(const char *fil);
|
char *readfile_utf8(const char *fil);
|
||||||
|
|
||||||
char *readfile_or(const char *fil, const char *defaultdata);
|
char *readfile_or(const char *fil, const char *defaultdata);
|
||||||
|
|
||||||
#if 0
|
/* Backing (download-slot) scheduler. Operate on the back[] ring (struct_back).
|
||||||
void check_rate(TStamp stat_timestart, int maxrate);
|
Not thread-safe; call from the single crawl loop. */
|
||||||
#endif
|
|
||||||
|
|
||||||
// liens
|
/* True if a connecting slot should give up on the current address and try the
|
||||||
int liens_record(char *adr, char *fil, char *save, char *former_adr,
|
next one: a fallback address remains (addr_index+1 < addr_count) and the
|
||||||
char *former_fil, char *codebase);
|
candidate has been connecting for at least its deadline, min(timeout, an
|
||||||
|
internal cap). elapsed/timeout in seconds. Exposed for the -#D self-test. */
|
||||||
|
int back_connect_fallback_due(int addr_index, int addr_count, int elapsed,
|
||||||
|
int timeout);
|
||||||
|
|
||||||
// backing, routines externes
|
/* How many new sockets may be opened now, honoring maxsoc and the maxconn rate
|
||||||
|
limit (>=0). _strict ignores reserved-slot headroom; the plain form leaves
|
||||||
|
room for naming tests and stops at 0 when the stack is nearly full. */
|
||||||
int back_pluggable_sockets(struct_back * sback, httrackp * opt);
|
int back_pluggable_sockets(struct_back * sback, httrackp * opt);
|
||||||
|
|
||||||
int back_pluggable_sockets_strict(struct_back * sback, httrackp * opt);
|
int back_pluggable_sockets_strict(struct_back * sback, httrackp * opt);
|
||||||
|
|
||||||
|
/* One engine-loop tick: refresh the transfer stats and run the loop callback
|
||||||
|
for slot b (-1 = none). HTS_FALSE = the callback requested an abort. */
|
||||||
|
hts_boolean hts_loop_tick(struct_back *sback, httrackp *opt, int b, int ptr);
|
||||||
|
|
||||||
|
/* Wait until a test socket can be plugged, pumping transfers, stats and the
|
||||||
|
loop callback; gives up past the -E deadline. HTS_FALSE = callback abort. */
|
||||||
|
hts_boolean hts_wait_available_socket(struct_back *sback, httrackp *opt,
|
||||||
|
cache_back *cache, int ptr);
|
||||||
|
|
||||||
|
/* Randomized inter-file pause target in [min_ms,max_ms] (#185), derived from a
|
||||||
|
timestamp seed so it is stable within one gap and rerolls per launch. */
|
||||||
|
int hts_pause_target_ms(TStamp seed, int min_ms, int max_ms);
|
||||||
|
|
||||||
|
/* Schedule more links from the heap into free slots. Returns the number queued,
|
||||||
|
or <=0 if none could be added (no free slot / paused / stopped). */
|
||||||
int back_fill(struct_back * sback, httrackp * opt, cache_back * cache,
|
int back_fill(struct_back * sback, httrackp * opt, cache_back * cache,
|
||||||
int ptr, int numero_passe);
|
int ptr, int numero_passe);
|
||||||
int backlinks_done(const struct_back * sback, lien_url ** liens,
|
|
||||||
int lien_tot, int ptr);
|
/* Count of links already finished (in background or served from cache). */
|
||||||
|
int backlinks_done(const struct_back *sback, lien_url **liens, int lien_tot,
|
||||||
|
int ptr);
|
||||||
|
|
||||||
|
/* Like back_fill, but a no-op (returns -1) when in-memory buffered data already
|
||||||
|
exceeds opt->maxcache. */
|
||||||
int back_fillmax(struct_back * sback, httrackp * opt, cache_back * cache,
|
int back_fillmax(struct_back * sback, httrackp * opt, cache_back * cache,
|
||||||
int ptr, int numero_passe);
|
int ptr, int numero_passe);
|
||||||
|
|
||||||
|
/* Interactive prompt: continue an interrupted mirror? Returns nonzero to go on.
|
||||||
|
*/
|
||||||
int ask_continue(httrackp * opt);
|
int ask_continue(httrackp * opt);
|
||||||
int nombre_digit(int n);
|
|
||||||
|
|
||||||
// Java
|
/* Number of decimal digits in n. */
|
||||||
#if 0
|
int nombre_digit(int n);
|
||||||
int hts_add_file(char *file, int file_position);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Polling
|
// Polling
|
||||||
#if HTS_POLL
|
#if HTS_POLL
|
||||||
int check_flot(T_SOC s);
|
int check_flot(T_SOC s);
|
||||||
|
|
||||||
int check_stdin(void);
|
int check_stdin(void);
|
||||||
|
|
||||||
int read_stdin(char *s, int max);
|
int read_stdin(char *s, int max);
|
||||||
#endif
|
#endif
|
||||||
|
/* Socket readiness probes: nonzero if the socket has an error / has data. */
|
||||||
int check_sockerror(T_SOC s);
|
int check_sockerror(T_SOC s);
|
||||||
|
|
||||||
int check_sockdata(T_SOC s);
|
int check_sockdata(T_SOC s);
|
||||||
|
|
||||||
/* external modules */
|
/* external modules: register a link discovered by a parser plugin. */
|
||||||
int htsAddLink(htsmoduleStruct * str, char *link);
|
int htsAddLink(htsmoduleStruct * str, char *link);
|
||||||
|
|
||||||
// Void
|
/* No-op function (used as a do-nothing callback / to defeat optimizers). */
|
||||||
void voidf(void);
|
void voidf(void);
|
||||||
|
|
||||||
|
/* HTML marker comment marking where the top index is spliced. */
|
||||||
#define HTS_TOPINDEX "TOP_INDEX_HTTRACK"
|
#define HTS_TOPINDEX "TOP_INDEX_HTTRACK"
|
||||||
|
|
||||||
|
/* Worst-case byte expansion HT_ADD_HTMLESCAPED* must reserve per escaper. */
|
||||||
|
#define HTS_HTMLESCAPE_MAXEXP 5 /* escape_for_html_print: '&'->"&" */
|
||||||
|
#define HTS_HTMLESCAPE_FULL_MAXEXP 6 /* _full: high byte->"&#xHH;" */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
1239
src/htscoremain.c
1239
src/htscoremain.c
File diff suppressed because it is too large
Load Diff
283
src/htsdefines.h
283
src/htsdefines.h
@@ -30,11 +30,16 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
// Fichier librairie .h
|
/** @file htsdefines.h
|
||||||
|
* Public callback prototypes and the wrapper/plug-in interface: the function
|
||||||
|
* pointer types a parser or wrapper module implements, and the callback table
|
||||||
|
* the engine dispatches through. */
|
||||||
#ifndef HTS_DEFINES_DEFH
|
#ifndef HTS_DEFINES_DEFH
|
||||||
#define HTS_DEFINES_DEFH
|
#define HTS_DEFINES_DEFH
|
||||||
|
|
||||||
/* Forward definitions */
|
/* Forward declarations of engine structs, so this header is usable without
|
||||||
|
pulling in their full definitions. Each is guarded so multiple public
|
||||||
|
headers can repeat the typedef without clashing. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
||||||
#define HTS_DEF_FWSTRUCT_httrackp
|
#define HTS_DEF_FWSTRUCT_httrackp
|
||||||
typedef struct httrackp httrackp;
|
typedef struct httrackp httrackp;
|
||||||
@@ -64,99 +69,167 @@ typedef struct t_hts_callbackarg t_hts_callbackarg;
|
|||||||
typedef struct t_hts_callbackarg t_hts_callbackarg;
|
typedef struct t_hts_callbackarg t_hts_callbackarg;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* External callbacks */
|
/* Marks a symbol an external wrapper module exports back to the engine.
|
||||||
|
Must override -fvisibility=hidden on ELF, or dlopen()ed plugins (htsjava)
|
||||||
|
hide their own hts_plug()/hts_unplug() entry points. */
|
||||||
#ifndef EXTERNAL_FUNCTION
|
#ifndef EXTERNAL_FUNCTION
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define EXTERNAL_FUNCTION __declspec(dllexport)
|
#define EXTERNAL_FUNCTION __declspec(dllexport)
|
||||||
|
#elif ((defined(__GNUC__) && (__GNUC__ >= 4)) || \
|
||||||
|
(defined(HAVE_VISIBILITY) && HAVE_VISIBILITY))
|
||||||
|
#define EXTERNAL_FUNCTION __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
#define EXTERNAL_FUNCTION
|
#define EXTERNAL_FUNCTION
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* --wrapper plug function prototype */
|
/* Entry points of a --wrapper plug-in: hts_plug(opt, argv) is called once to
|
||||||
|
install the wrapper (argv is the wrapper's argument string), hts_unplug(opt)
|
||||||
|
once to tear it down. Both return non-zero on success. */
|
||||||
|
typedef int (*t_hts_plug)(httrackp *opt, const char *argv);
|
||||||
|
|
||||||
typedef int (*t_hts_plug) (httrackp * opt, const char *argv);
|
typedef int (*t_hts_unplug)(httrackp *opt);
|
||||||
typedef int (*t_hts_unplug) (httrackp * opt);
|
|
||||||
|
|
||||||
/* htsopt function callbacks definitions */
|
/* Engine callback prototypes. Each is one hook the engine fires at a defined
|
||||||
|
point of a mirror; a wrapper installs the ones it cares about in the
|
||||||
|
callback table below. carg carries the user-defined argument chain; int
|
||||||
|
returns are 1 to continue/accept, 0 to abort/refuse unless noted. */
|
||||||
|
|
||||||
typedef void (*t_hts_htmlcheck_init) (t_hts_callbackarg * carg);
|
/* Called once when the wrapper is installed; allocate per-run state here. */
|
||||||
typedef void (*t_hts_htmlcheck_uninit) (t_hts_callbackarg * carg);
|
typedef void (*t_hts_htmlcheck_init)(t_hts_callbackarg *carg);
|
||||||
typedef int (*t_hts_htmlcheck_start) (t_hts_callbackarg * carg, httrackp * opt);
|
|
||||||
typedef int (*t_hts_htmlcheck_end) (t_hts_callbackarg * carg, httrackp * opt);
|
/* Called once when the wrapper is removed; release per-run state here. */
|
||||||
typedef int (*t_hts_htmlcheck_chopt) (t_hts_callbackarg * carg, httrackp * opt);
|
typedef void (*t_hts_htmlcheck_uninit)(t_hts_callbackarg *carg);
|
||||||
typedef int (*t_hts_htmlcheck_process) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char **html, int *len,
|
/* Fired at the start of a mirror, after options are parsed. */
|
||||||
const char *url_adresse,
|
typedef int (*t_hts_htmlcheck_start)(t_hts_callbackarg *carg, httrackp *opt);
|
||||||
const char *url_fichier);
|
|
||||||
|
/* Fired at the end of a mirror. */
|
||||||
|
typedef int (*t_hts_htmlcheck_end)(t_hts_callbackarg *carg, httrackp *opt);
|
||||||
|
|
||||||
|
/* Fired while options are being changed, to validate or adjust them. */
|
||||||
|
typedef int (*t_hts_htmlcheck_chopt)(t_hts_callbackarg *carg, httrackp *opt);
|
||||||
|
|
||||||
|
/* Rewrite hook over an in-memory page: the html and len arguments point at the
|
||||||
|
buffer and its length (the callback may reallocate and resize it),
|
||||||
|
url_adresse and url_fichier name it. */
|
||||||
|
typedef int (*t_hts_htmlcheck_process)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
char **html, int *len,
|
||||||
|
const char *url_adresse,
|
||||||
|
const char *url_fichier);
|
||||||
|
|
||||||
|
/* Same shape as process, run before HTML parsing. */
|
||||||
typedef t_hts_htmlcheck_process t_hts_htmlcheck_preprocess;
|
typedef t_hts_htmlcheck_process t_hts_htmlcheck_preprocess;
|
||||||
typedef t_hts_htmlcheck_process t_hts_htmlcheck_postprocess;
|
|
||||||
typedef int (*t_hts_htmlcheck_check_html) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char *html, int len,
|
|
||||||
const char *url_adresse,
|
|
||||||
const char *url_fichier);
|
|
||||||
typedef const char *(*t_hts_htmlcheck_query) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt,
|
|
||||||
const char *question);
|
|
||||||
typedef const char *(*t_hts_htmlcheck_query2) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt,
|
|
||||||
const char *question);
|
|
||||||
typedef const char *(*t_hts_htmlcheck_query3) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt,
|
|
||||||
const char *question);
|
|
||||||
typedef int (*t_hts_htmlcheck_loop) (t_hts_callbackarg * carg, httrackp * opt,
|
|
||||||
lien_back * back, int back_max,
|
|
||||||
int back_index, int lien_tot,
|
|
||||||
int lien_ntot, int stat_time,
|
|
||||||
hts_stat_struct * stats);
|
|
||||||
typedef int (*t_hts_htmlcheck_check_link) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, const char *adr,
|
|
||||||
const char *fil, int status);
|
|
||||||
typedef int (*t_hts_htmlcheck_check_mime) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, const char *adr,
|
|
||||||
const char *fil, const char *mime,
|
|
||||||
int status);
|
|
||||||
typedef void (*t_hts_htmlcheck_pause) (t_hts_callbackarg * carg, httrackp * opt,
|
|
||||||
const char *lockfile);
|
|
||||||
typedef void (*t_hts_htmlcheck_filesave) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, const char *file);
|
|
||||||
typedef void (*t_hts_htmlcheck_filesave2) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, const char *hostname,
|
|
||||||
const char *filename,
|
|
||||||
const char *localfile, int is_new,
|
|
||||||
int is_modified, int not_updated);
|
|
||||||
typedef int (*t_hts_htmlcheck_linkdetected) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char *link);
|
|
||||||
typedef int (*t_hts_htmlcheck_linkdetected2) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char *link,
|
|
||||||
const char *tag_start);
|
|
||||||
typedef int (*t_hts_htmlcheck_xfrstatus) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, lien_back * back);
|
|
||||||
typedef int (*t_hts_htmlcheck_savename) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt,
|
|
||||||
const char *adr_complete,
|
|
||||||
const char *fil_complete,
|
|
||||||
const char *referer_adr,
|
|
||||||
const char *referer_fil, char *save);
|
|
||||||
typedef t_hts_htmlcheck_savename t_hts_htmlcheck_extsavename;
|
|
||||||
typedef int (*t_hts_htmlcheck_sendhead) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char *buff,
|
|
||||||
const char *adr, const char *fil,
|
|
||||||
const char *referer_adr,
|
|
||||||
const char *referer_fil,
|
|
||||||
htsblk * outgoing);
|
|
||||||
typedef int (*t_hts_htmlcheck_receivehead) (t_hts_callbackarg * carg,
|
|
||||||
httrackp * opt, char *buff,
|
|
||||||
const char *adr, const char *fil,
|
|
||||||
const char *referer_adr,
|
|
||||||
const char *referer_fil,
|
|
||||||
htsblk * incoming);
|
|
||||||
|
|
||||||
/* External additional parsing module(s) */
|
/* Same shape as process, run after HTML parsing. */
|
||||||
typedef int (*t_hts_htmlcheck_detect) (t_hts_callbackarg * carg, httrackp * opt,
|
typedef t_hts_htmlcheck_process t_hts_htmlcheck_postprocess;
|
||||||
htsmoduleStruct * str);
|
|
||||||
typedef int (*t_hts_htmlcheck_parse) (t_hts_callbackarg * carg, httrackp * opt,
|
/* Inspect a page (read-only html/len) without rewriting it. */
|
||||||
htsmoduleStruct * str);
|
typedef int (*t_hts_htmlcheck_check_html)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, char *html, int len,
|
||||||
|
const char *url_adresse,
|
||||||
|
const char *url_fichier);
|
||||||
|
|
||||||
|
/* Answer an engine query identified by 'question'; returns the answer string
|
||||||
|
(owned by the callback, must stay valid until the next call). */
|
||||||
|
typedef const char *(*t_hts_htmlcheck_query)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt,
|
||||||
|
const char *question);
|
||||||
|
|
||||||
|
/* Second query channel, same contract as query. */
|
||||||
|
typedef const char *(*t_hts_htmlcheck_query2)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt,
|
||||||
|
const char *question);
|
||||||
|
|
||||||
|
/* Third query channel, same contract as query. */
|
||||||
|
typedef const char *(*t_hts_htmlcheck_query3)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt,
|
||||||
|
const char *question);
|
||||||
|
|
||||||
|
/* Per-tick progress hook: 'back' is the transfer slot array of 'back_max'
|
||||||
|
entries, back_index the active one; lien_tot/lien_ntot and stats report
|
||||||
|
queue size and running totals, stat_time the elapsed time. */
|
||||||
|
typedef int (*t_hts_htmlcheck_loop)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
lien_back *back, int back_max,
|
||||||
|
int back_index, int lien_tot, int lien_ntot,
|
||||||
|
int stat_time, hts_stat_struct *stats);
|
||||||
|
|
||||||
|
/* Veto a link (adr host, fil path) after its transfer; status is the result.
|
||||||
|
Return 0 to drop the link. */
|
||||||
|
typedef int (*t_hts_htmlcheck_check_link)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, const char *adr,
|
||||||
|
const char *fil, int status);
|
||||||
|
|
||||||
|
/* Veto a link by its MIME type before download; return 0 to skip it. */
|
||||||
|
typedef int (*t_hts_htmlcheck_check_mime)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, const char *adr,
|
||||||
|
const char *fil, const char *mime,
|
||||||
|
int status);
|
||||||
|
|
||||||
|
/* Fired when the mirror pauses, waiting on 'lockfile' to be removed. */
|
||||||
|
typedef void (*t_hts_htmlcheck_pause)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
const char *lockfile);
|
||||||
|
|
||||||
|
/* Fired after a file is written to disk; 'file' is the local path. */
|
||||||
|
typedef void (*t_hts_htmlcheck_filesave)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
const char *file);
|
||||||
|
|
||||||
|
/* Richer file-saved notification: source host/filename, local path, and flags
|
||||||
|
telling whether the file is new, modified, or left unchanged. */
|
||||||
|
typedef void (*t_hts_htmlcheck_filesave2)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, const char *hostname,
|
||||||
|
const char *filename,
|
||||||
|
const char *localfile, int is_new,
|
||||||
|
int is_modified, int not_updated);
|
||||||
|
|
||||||
|
/* Fired for each link parsed out of a page; 'link' may be edited in place. */
|
||||||
|
typedef int (*t_hts_htmlcheck_linkdetected)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, char *link);
|
||||||
|
|
||||||
|
/* As linkdetected, plus tag_start, the markup the link was found in. */
|
||||||
|
typedef int (*t_hts_htmlcheck_linkdetected2)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, char *link,
|
||||||
|
const char *tag_start);
|
||||||
|
|
||||||
|
/* Fired on each transfer-status change of slot 'back'. */
|
||||||
|
typedef int (*t_hts_htmlcheck_xfrstatus)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
lien_back *back);
|
||||||
|
|
||||||
|
/* Choose the local save path for a URL; write it into 'save'. adr/fil name the
|
||||||
|
target, referer_adr/referer_fil the page that linked it. */
|
||||||
|
typedef int (*t_hts_htmlcheck_savename)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
const char *adr_complete,
|
||||||
|
const char *fil_complete,
|
||||||
|
const char *referer_adr,
|
||||||
|
const char *referer_fil, char *save);
|
||||||
|
|
||||||
|
/* Extended save-name hook, same signature as savename. */
|
||||||
|
typedef t_hts_htmlcheck_savename t_hts_htmlcheck_extsavename;
|
||||||
|
|
||||||
|
/* Inspect or edit the outgoing request headers in 'buff' before they are sent.
|
||||||
|
*/
|
||||||
|
typedef int (*t_hts_htmlcheck_sendhead)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
char *buff, const char *adr,
|
||||||
|
const char *fil,
|
||||||
|
const char *referer_adr,
|
||||||
|
const char *referer_fil,
|
||||||
|
htsblk *outgoing);
|
||||||
|
|
||||||
|
/* Inspect the incoming response headers in 'buff' after they are received. */
|
||||||
|
typedef int (*t_hts_htmlcheck_receivehead)(t_hts_callbackarg *carg,
|
||||||
|
httrackp *opt, char *buff,
|
||||||
|
const char *adr, const char *fil,
|
||||||
|
const char *referer_adr,
|
||||||
|
const char *referer_fil,
|
||||||
|
htsblk *incoming);
|
||||||
|
|
||||||
|
/* External parser module hooks: detect claims a document type (return 1 to
|
||||||
|
take it), parse then extracts its links. 'str' carries the document. */
|
||||||
|
typedef int (*t_hts_htmlcheck_detect)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
htsmoduleStruct *str);
|
||||||
|
|
||||||
|
typedef int (*t_hts_htmlcheck_parse)(t_hts_callbackarg *carg, httrackp *opt,
|
||||||
|
htsmoduleStruct *str);
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_t_hts_htmlcheck_callbacks
|
#ifndef HTS_DEF_FWSTRUCT_t_hts_htmlcheck_callbacks
|
||||||
@@ -164,20 +237,24 @@ typedef int (*t_hts_htmlcheck_parse) (t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
typedef struct t_hts_htmlcheck_callbacks t_hts_htmlcheck_callbacks;
|
typedef struct t_hts_htmlcheck_callbacks t_hts_htmlcheck_callbacks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Callabck array */
|
/* Declares one named callback slot: its function pointer (typed
|
||||||
#define DEFCALLBACK(NAME) \
|
t_hts_htmlcheck_<NAME>) paired with the carg passed to it. */
|
||||||
struct NAME { \
|
#define DEFCALLBACK(NAME) \
|
||||||
t_hts_htmlcheck_ ##NAME fun; \
|
struct NAME { \
|
||||||
t_hts_callbackarg *carg; \
|
t_hts_htmlcheck_##NAME fun; \
|
||||||
|
t_hts_callbackarg *carg; \
|
||||||
} NAME
|
} NAME
|
||||||
|
|
||||||
/* Callback items */
|
/* Generic, type-erased callback slot used where the hook type is opaque. */
|
||||||
typedef void *t_hts_htmlcheck_t_hts_htmlcheck_callbacks_item;
|
typedef void *t_hts_htmlcheck_t_hts_htmlcheck_callbacks_item;
|
||||||
|
|
||||||
typedef DEFCALLBACK(t_hts_htmlcheck_callbacks_item);
|
typedef DEFCALLBACK(t_hts_htmlcheck_callbacks_item);
|
||||||
|
|
||||||
/* Linked list, which should be used for the 'arg' user-defined argument */
|
/* Per-callback argument node. Wrappers chain these so a new hook can wrap an
|
||||||
|
existing one: userdef is the wrapper's own data, prev points back to the
|
||||||
|
function and carg it displaced (call it to keep the previous behavior). */
|
||||||
struct t_hts_callbackarg {
|
struct t_hts_callbackarg {
|
||||||
/* User-defined agument for the called function */
|
/* User-defined argument for the called function */
|
||||||
void *userdef;
|
void *userdef;
|
||||||
|
|
||||||
/* Previous function, if any (fun != NULL) */
|
/* Previous function, if any (fun != NULL) */
|
||||||
@@ -187,7 +264,9 @@ struct t_hts_callbackarg {
|
|||||||
} prev;
|
} prev;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Callback structure */
|
/* The full callback table, one slot per hook; installed in httrackp options
|
||||||
|
and dispatched by the engine. The trailing comments mark the API version a
|
||||||
|
slot first appeared in. */
|
||||||
struct t_hts_htmlcheck_callbacks {
|
struct t_hts_htmlcheck_callbacks {
|
||||||
/* v3.41 */
|
/* v3.41 */
|
||||||
DEFCALLBACK(init);
|
DEFCALLBACK(init);
|
||||||
@@ -219,9 +298,11 @@ struct t_hts_htmlcheck_callbacks {
|
|||||||
DEFCALLBACK(extsavename);
|
DEFCALLBACK(extsavename);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Library internal definitions */
|
/* Library-internal helpers, compiled only inside the engine. */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
|
/* Maps a callback slot's name to its byte offset in the callback table, so a
|
||||||
|
slot can be installed by name. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_t_hts_callback_ref
|
#ifndef HTS_DEF_FWSTRUCT_t_hts_callback_ref
|
||||||
#define HTS_DEF_FWSTRUCT_t_hts_callback_ref
|
#define HTS_DEF_FWSTRUCT_t_hts_callback_ref
|
||||||
typedef struct t_hts_callback_ref t_hts_callback_ref;
|
typedef struct t_hts_callback_ref t_hts_callback_ref;
|
||||||
@@ -235,20 +316,28 @@ struct t_hts_callback_ref {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Default (no-op) callback table the engine starts from. */
|
||||||
extern const t_hts_htmlcheck_callbacks default_callbacks;
|
extern const t_hts_htmlcheck_callbacks default_callbacks;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HT_PRINT(A) strcatbuff(opt->state.HTbuff,A);
|
/* Internal helpers for building an HTTP request/response into the engine's
|
||||||
#define HT_REQUEST_START opt->state.HTbuff[0]='\0';
|
scratch buffer (opt->state.HTbuff): START resets it, PRINT appends; the
|
||||||
|
PANIC variant records a fatal error message. */
|
||||||
|
#define HT_PRINT(A) strcatbuff(opt->state.HTbuff, A);
|
||||||
|
|
||||||
|
#define HT_REQUEST_START opt->state.HTbuff[0] = '\0';
|
||||||
|
|
||||||
#define HT_REQUEST_END
|
#define HT_REQUEST_END
|
||||||
#define HTT_REQUEST_START opt->state.HTbuff[0]='\0';
|
#define HTT_REQUEST_START opt->state.HTbuff[0] = '\0';
|
||||||
|
|
||||||
#define HTT_REQUEST_END
|
#define HTT_REQUEST_END
|
||||||
#define HTS_REQUEST_START opt->state.HTbuff[0]='\0';
|
#define HTS_REQUEST_START opt->state.HTbuff[0] = '\0';
|
||||||
|
|
||||||
#define HTS_REQUEST_END
|
#define HTS_REQUEST_END
|
||||||
#define HTS_PANIC_PRINTF(S) strcpybuff(opt->state._hts_errmsg,S);
|
#define HTS_PANIC_PRINTF(S) strcpybuff(opt->state._hts_errmsg, S);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
359
src/htsdns_selftest.c
Normal file
359
src/htsdns_selftest.c
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/*
|
||||||
|
HTTrack Website Copier, Offline Browser for Windows and Unix
|
||||||
|
Copyright (C) 2026 Xavier Roche and other contributors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Ethical use: we kindly ask that you NOT use this software to harvest email
|
||||||
|
addresses or to collect any other private information about people. Doing so
|
||||||
|
would dishonor our work and waste the many hours we have spent on it.
|
||||||
|
|
||||||
|
Please visit our Website: http://www.httrack.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/* File: htsdns_selftest.c subroutines: */
|
||||||
|
/* in-process self-test for the DNS resolver and cache */
|
||||||
|
/* Author: Xavier Roche */
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/* Routes the resolver through a scripted getaddrinfo (hts_resolver_backend)
|
||||||
|
instead of the network, so resolution and the DNS cache are testable for a
|
||||||
|
fixed set of scenarios (IPv4/IPv6/dual-stack, errors, family filter,
|
||||||
|
cache reuse) with no live DNS. */
|
||||||
|
|
||||||
|
#define HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
|
#include "htsdns_selftest.h"
|
||||||
|
|
||||||
|
#include "htscore.h"
|
||||||
|
#include "htslib.h"
|
||||||
|
#include "htsnet.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if HTS_INET6 != 0
|
||||||
|
|
||||||
|
/* IPV6_resolver: 0 = v4+v6, 1 = v4 only, 2 = v6 only (htscoremain -@i). */
|
||||||
|
extern int IPV6_resolver;
|
||||||
|
|
||||||
|
/* One scripted host: either a getaddrinfo error, or an ordered address list. */
|
||||||
|
typedef struct mock_addr {
|
||||||
|
int family; /* AF_INET / AF_INET6 */
|
||||||
|
unsigned char addr[16]; /* 4 (v4) or 16 (v6) meaningful bytes */
|
||||||
|
} mock_addr;
|
||||||
|
|
||||||
|
typedef struct mock_host {
|
||||||
|
const char *name;
|
||||||
|
int gai_err; /* non-zero: getaddrinfo returns this */
|
||||||
|
int naddr;
|
||||||
|
mock_addr addr[6];
|
||||||
|
int calls; /* times the backend resolved this host */
|
||||||
|
} mock_host;
|
||||||
|
|
||||||
|
static mock_host mock_hosts[] = {
|
||||||
|
{"v4only.test", 0, 1, {{AF_INET, {1, 2, 3, 4}}}, 0},
|
||||||
|
{"v6only.test", 0, 1, {{AF_INET6, {0x20, 0x01, 0x0d, 0xb8, [15] = 1}}}, 0},
|
||||||
|
/* dual stack, IPv6 first (RFC 6724 order) then IPv4 */
|
||||||
|
{"dual.test",
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
{{AF_INET6, {0x20, 0x01, 0x0d, 0xb8, [15] = 2}}, {AF_INET, {5, 6, 7, 8}}},
|
||||||
|
0},
|
||||||
|
/* dual stack, IPv4 first: distinguishes "keep the first address" from
|
||||||
|
"prefer a family", so the selection contract is actually pinned. */
|
||||||
|
{"dual4.test",
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
{{AF_INET, {9, 10, 11, 12}},
|
||||||
|
{AF_INET6, {0x20, 0x01, 0x0d, 0xb8, [15] = 3}}},
|
||||||
|
0},
|
||||||
|
/* more addresses than HTS_MAXADDRNUM: the list must clamp to the cap. */
|
||||||
|
{"many.test",
|
||||||
|
0,
|
||||||
|
6,
|
||||||
|
{{AF_INET, {10, 0, 0, 1}},
|
||||||
|
{AF_INET, {10, 0, 0, 2}},
|
||||||
|
{AF_INET, {10, 0, 0, 3}},
|
||||||
|
{AF_INET, {10, 0, 0, 4}},
|
||||||
|
{AF_INET, {10, 0, 0, 5}},
|
||||||
|
{AF_INET, {10, 0, 0, 6}}},
|
||||||
|
0},
|
||||||
|
{"nodns.test", EAI_NONAME, 0, {{0}}, 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
static mock_host *mock_find(const char *name) {
|
||||||
|
for (size_t i = 0; i < sizeof(mock_hosts) / sizeof(mock_hosts[0]); i++) {
|
||||||
|
if (strcmp(mock_hosts[i].name, name) == 0)
|
||||||
|
return &mock_hosts[i];
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mock_reset_calls(void) {
|
||||||
|
for (size_t i = 0; i < sizeof(mock_hosts) / sizeof(mock_hosts[0]); i++)
|
||||||
|
mock_hosts[i].calls = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build one addrinfo node owning its sockaddr (freed by mock_freeaddrinfo). */
|
||||||
|
static struct addrinfo *mock_mkai(const mock_addr *a) {
|
||||||
|
struct addrinfo *ai = calloct(1, sizeof(*ai));
|
||||||
|
|
||||||
|
ai->ai_family = a->family;
|
||||||
|
if (a->family == AF_INET) {
|
||||||
|
struct sockaddr_in *sin = calloct(1, sizeof(*sin));
|
||||||
|
|
||||||
|
sin->sin_family = AF_INET;
|
||||||
|
memcpy(&sin->sin_addr, a->addr, 4);
|
||||||
|
ai->ai_addr = (struct sockaddr *) sin;
|
||||||
|
ai->ai_addrlen = sizeof(*sin);
|
||||||
|
} else {
|
||||||
|
struct sockaddr_in6 *sin6 = calloct(1, sizeof(*sin6));
|
||||||
|
|
||||||
|
sin6->sin6_family = AF_INET6;
|
||||||
|
memcpy(&sin6->sin6_addr, a->addr, 16);
|
||||||
|
ai->ai_addr = (struct sockaddr *) sin6;
|
||||||
|
ai->ai_addrlen = sizeof(*sin6);
|
||||||
|
}
|
||||||
|
return ai;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mock_getaddrinfo(const char *node, const char *service,
|
||||||
|
const struct addrinfo *hints,
|
||||||
|
struct addrinfo **res) {
|
||||||
|
mock_host *const h = mock_find(node);
|
||||||
|
const int want = (hints != NULL) ? hints->ai_family : PF_UNSPEC;
|
||||||
|
struct addrinfo *head = NULL, *tail = NULL;
|
||||||
|
|
||||||
|
(void) service;
|
||||||
|
*res = NULL;
|
||||||
|
if (h == NULL)
|
||||||
|
return EAI_NONAME;
|
||||||
|
h->calls++; /* a real backend hit; a cached host skips this */
|
||||||
|
if (h->gai_err != 0)
|
||||||
|
return h->gai_err;
|
||||||
|
for (int i = 0; i < h->naddr; i++) {
|
||||||
|
if (want != PF_UNSPEC && want != h->addr[i].family)
|
||||||
|
continue; /* honor the requested family (v4/v6 only) */
|
||||||
|
struct addrinfo *const ai = mock_mkai(&h->addr[i]);
|
||||||
|
|
||||||
|
if (head == NULL)
|
||||||
|
head = ai;
|
||||||
|
else
|
||||||
|
tail->ai_next = ai;
|
||||||
|
tail = ai;
|
||||||
|
}
|
||||||
|
if (head == NULL)
|
||||||
|
return EAI_NONAME; /* filtered to empty, as the libc resolver does */
|
||||||
|
*res = head;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mock_freeaddrinfo(struct addrinfo *res) {
|
||||||
|
while (res != NULL) {
|
||||||
|
struct addrinfo *const next = res->ai_next;
|
||||||
|
|
||||||
|
freet(res->ai_addr);
|
||||||
|
freet(res);
|
||||||
|
res = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const hts_resolver_backend mock_backend = {mock_getaddrinfo,
|
||||||
|
mock_freeaddrinfo};
|
||||||
|
|
||||||
|
static int failures = 0;
|
||||||
|
|
||||||
|
#define CHECK(cond) \
|
||||||
|
do { \
|
||||||
|
if (!(cond)) { \
|
||||||
|
failures++; \
|
||||||
|
fprintf(stderr, "dns-selftest: FAIL at %s:%d: %s\n", __FILE__, __LINE__, \
|
||||||
|
#cond); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/* Resolve via the uncached entry point; return the address family, or
|
||||||
|
AF_UNSPEC if the host did not resolve. */
|
||||||
|
static int resolve_family_nocache(const char *host) {
|
||||||
|
SOCaddr addr;
|
||||||
|
const char *err = NULL;
|
||||||
|
|
||||||
|
if (hts_dns_resolve_nocache2(host, &addr, &err) == NULL)
|
||||||
|
return AF_UNSPEC;
|
||||||
|
return SOCaddr_sinfamily(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dns_selftests(httrackp *opt) {
|
||||||
|
failures = 0;
|
||||||
|
hts_dns_set_resolver_backend(&mock_backend);
|
||||||
|
|
||||||
|
/* IPv4-only / IPv6-only hosts map to the right family. */
|
||||||
|
IPV6_resolver = 0;
|
||||||
|
CHECK(resolve_family_nocache("v4only.test") == AF_INET);
|
||||||
|
CHECK(resolve_family_nocache("v6only.test") == AF_INET6);
|
||||||
|
|
||||||
|
/* Dual-stack: the single-address API returns the *first* resolved address.
|
||||||
|
Both orderings pin selection by position, not a family preference. The
|
||||||
|
multi-address API (resolve_all, below) exposes the whole list. */
|
||||||
|
CHECK(resolve_family_nocache("dual.test") == AF_INET6); /* v6 listed first */
|
||||||
|
CHECK(resolve_family_nocache("dual4.test") == AF_INET); /* v4 listed first */
|
||||||
|
|
||||||
|
/* Unknown host does not resolve. */
|
||||||
|
CHECK(resolve_family_nocache("nodns.test") == AF_UNSPEC);
|
||||||
|
|
||||||
|
/* Family filter (-@i4 / -@i6) selects v4 / v6 out of the dual-stack host. */
|
||||||
|
IPV6_resolver = 1;
|
||||||
|
CHECK(resolve_family_nocache("dual.test") == AF_INET);
|
||||||
|
IPV6_resolver = 2;
|
||||||
|
CHECK(resolve_family_nocache("dual.test") == AF_INET6);
|
||||||
|
IPV6_resolver = 0;
|
||||||
|
|
||||||
|
/* Cached driver resolves a host once and reuses the *same* address. */
|
||||||
|
mock_reset_calls();
|
||||||
|
{
|
||||||
|
SOCaddr a1, a2;
|
||||||
|
char ip1[64], ip2[64];
|
||||||
|
const char *err = NULL;
|
||||||
|
|
||||||
|
CHECK(hts_dns_resolve2(opt, "v4only.test", &a1, &err) != NULL);
|
||||||
|
CHECK(hts_dns_resolve2(opt, "v4only.test", &a2, &err) != NULL);
|
||||||
|
CHECK(mock_find("v4only.test")->calls == 1);
|
||||||
|
/* the cache returns the right address, not merely a hit for the key */
|
||||||
|
SOCaddr_inetntoa(ip1, sizeof(ip1), a1);
|
||||||
|
SOCaddr_inetntoa(ip2, sizeof(ip2), a2);
|
||||||
|
CHECK(strcmp(ip1, "1.2.3.4") == 0);
|
||||||
|
CHECK(strcmp(ip1, ip2) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A negative result is cached too: a second lookup does not re-resolve. */
|
||||||
|
{
|
||||||
|
SOCaddr a1, a2;
|
||||||
|
const char *err = NULL;
|
||||||
|
|
||||||
|
CHECK(hts_dns_resolve2(opt, "nodns.test", &a1, &err) == NULL);
|
||||||
|
CHECK(hts_dns_resolve2(opt, "nodns.test", &a2, &err) == NULL);
|
||||||
|
CHECK(mock_find("nodns.test")->calls == 1); /* resolved once, then cached */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Multi-address resolution: count and order are the connect-fallback
|
||||||
|
contract. A dead first address is retried against the next, so both must be
|
||||||
|
exact. */
|
||||||
|
mock_reset_calls();
|
||||||
|
{
|
||||||
|
SOCaddr addrs[HTS_MAXADDRNUM];
|
||||||
|
char ip[64];
|
||||||
|
const char *err = NULL;
|
||||||
|
|
||||||
|
/* dual-stack, in resolver order: [0]=v6, [1]=v4 */
|
||||||
|
CHECK(hts_dns_resolve_all(opt, "dual.test", addrs, HTS_MAXADDRNUM, &err) ==
|
||||||
|
2);
|
||||||
|
CHECK(SOCaddr_sinfamily(addrs[0]) == AF_INET6);
|
||||||
|
CHECK(SOCaddr_sinfamily(addrs[1]) == AF_INET);
|
||||||
|
SOCaddr_inetntoa(ip, sizeof(ip), addrs[1]);
|
||||||
|
CHECK(strcmp(ip, "5.6.7.8") == 0);
|
||||||
|
CHECK(mock_find("dual.test")->calls ==
|
||||||
|
1); /* one backend hit for the list */
|
||||||
|
|
||||||
|
/* single-address host: count 1 */
|
||||||
|
CHECK(hts_dns_resolve_all(opt, "v4only.test", addrs, HTS_MAXADDRNUM,
|
||||||
|
&err) == 1);
|
||||||
|
SOCaddr_inetntoa(ip, sizeof(ip), addrs[0]);
|
||||||
|
CHECK(strcmp(ip, "1.2.3.4") == 0);
|
||||||
|
|
||||||
|
/* does-not-resolve: count 0 (negative), no addresses */
|
||||||
|
CHECK(hts_dns_resolve_all(opt, "nodns.test", addrs, HTS_MAXADDRNUM, &err) ==
|
||||||
|
0);
|
||||||
|
|
||||||
|
/* more than the cap: the kept list is clamped to HTS_MAXADDRNUM, keeping
|
||||||
|
the FIRST addresses in resolver order (not some other window) */
|
||||||
|
CHECK(hts_dns_resolve_all(opt, "many.test", addrs, HTS_MAXADDRNUM, &err) ==
|
||||||
|
HTS_MAXADDRNUM);
|
||||||
|
SOCaddr_inetntoa(ip, sizeof(ip), addrs[0]);
|
||||||
|
CHECK(strcmp(ip, "10.0.0.1") == 0);
|
||||||
|
SOCaddr_inetntoa(ip, sizeof(ip), addrs[HTS_MAXADDRNUM - 1]);
|
||||||
|
CHECK(strcmp(ip, "10.0.0.4") == 0);
|
||||||
|
|
||||||
|
/* family filter still applies through the list path */
|
||||||
|
IPV6_resolver = 1;
|
||||||
|
CHECK(hts_dns_resolve_all(opt, "dual4.test", addrs, HTS_MAXADDRNUM, &err) ==
|
||||||
|
1);
|
||||||
|
CHECK(SOCaddr_sinfamily(addrs[0]) == AF_INET);
|
||||||
|
IPV6_resolver = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* newhttp_addr() must connect to the addr_index-th address, not always the
|
||||||
|
first: this is what back_connect_next relies on to reach the fallback. */
|
||||||
|
{
|
||||||
|
htsblk r;
|
||||||
|
int count = -1;
|
||||||
|
T_SOC s;
|
||||||
|
|
||||||
|
hts_init_htsblk(&r);
|
||||||
|
s = newhttp_addr(opt, "dual.test", &r, 80, 0, 0, &count);
|
||||||
|
CHECK(count == 2);
|
||||||
|
CHECK(SOCaddr_sinfamily(r.address) == AF_INET6); /* index 0 = v6 */
|
||||||
|
if (s != INVALID_SOCKET)
|
||||||
|
deletesoc(s);
|
||||||
|
|
||||||
|
hts_init_htsblk(&r);
|
||||||
|
count = -1;
|
||||||
|
s = newhttp_addr(opt, "dual.test", &r, 80, 0, 1, &count);
|
||||||
|
CHECK(count == 2);
|
||||||
|
CHECK(SOCaddr_sinfamily(r.address) == AF_INET); /* index 1 = v4 */
|
||||||
|
if (s != INVALID_SOCKET)
|
||||||
|
deletesoc(s);
|
||||||
|
|
||||||
|
/* out-of-range index: no address selected (address stays unset) */
|
||||||
|
hts_init_htsblk(&r);
|
||||||
|
s = newhttp_addr(opt, "dual.test", &r, 80, 0, 2, NULL);
|
||||||
|
CHECK(s == INVALID_SOCKET);
|
||||||
|
if (s != INVALID_SOCKET)
|
||||||
|
deletesoc(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Connect-fallback decision (consumer of the multi-address list): when a
|
||||||
|
stuck connect should abandon the current address for the next one. */
|
||||||
|
{
|
||||||
|
/* no fallback for the last/only candidate, whatever the elapsed time */
|
||||||
|
CHECK(back_connect_fallback_due(0, 1, 9999, 120) == 0);
|
||||||
|
CHECK(back_connect_fallback_due(1, 2, 9999, 120) == 0);
|
||||||
|
CHECK(back_connect_fallback_due(3, 4, 9999, 120) == 0);
|
||||||
|
/* fallback available: wait the per-candidate deadline (cap 10s here) */
|
||||||
|
CHECK(back_connect_fallback_due(0, 2, 9, 120) == 0);
|
||||||
|
CHECK(back_connect_fallback_due(0, 2, 10, 120) == 1);
|
||||||
|
CHECK(back_connect_fallback_due(2, 4, 10, 120) == 1);
|
||||||
|
/* a shorter slot timeout shortens the deadline (min(timeout, cap)) */
|
||||||
|
CHECK(back_connect_fallback_due(0, 2, 4, 5) == 0);
|
||||||
|
CHECK(back_connect_fallback_due(0, 2, 5, 5) == 1);
|
||||||
|
/* no timeout management: never force a fallback */
|
||||||
|
CHECK(back_connect_fallback_due(0, 2, 9999, 0) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
hts_dns_set_resolver_backend(NULL);
|
||||||
|
return failures;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int dns_selftests(httrackp *opt) {
|
||||||
|
(void) opt;
|
||||||
|
return 0; /* resolver seam only exists in the IPv6 build */
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
51
src/htsdns_selftest.h
Normal file
51
src/htsdns_selftest.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/*
|
||||||
|
HTTrack Website Copier, Offline Browser for Windows and Unix
|
||||||
|
Copyright (C) 2026 Xavier Roche and other contributors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Ethical use: we kindly ask that you NOT use this software to harvest email
|
||||||
|
addresses or to collect any other private information about people. Doing so
|
||||||
|
would dishonor our work and waste the many hours we have spent on it.
|
||||||
|
|
||||||
|
Please visit our Website: http://www.httrack.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/* File: htsdns_selftest.h */
|
||||||
|
/* Author: Xavier Roche */
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#ifndef HTSDNS_SELFTEST_DEFH
|
||||||
|
#define HTSDNS_SELFTEST_DEFH
|
||||||
|
|
||||||
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
|
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
||||||
|
#define HTS_DEF_FWSTRUCT_httrackp
|
||||||
|
typedef struct httrackp httrackp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Drive the DNS resolver and cache through a scripted (mock) getaddrinfo,
|
||||||
|
asserting address family, single-address selection, negative caching, the
|
||||||
|
IPv4/IPv6 family filter, and that a cached host is resolved only once.
|
||||||
|
Returns the number of failed checks (0 == success). */
|
||||||
|
int dns_selftests(httrackp *opt);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -30,12 +30,14 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "htscharset.h"
|
#include "htscharset.h"
|
||||||
#include "htsencoding.h"
|
#include "htsencoding.h"
|
||||||
#include "htssafe.h"
|
#include "htssafe.h"
|
||||||
|
|
||||||
/* static int decode_entity(const unsigned int hash, const size_t len);
|
/* static int decode_entity(const uint64_t hash, const size_t len);
|
||||||
*/
|
*/
|
||||||
#include "htsentities.h"
|
#include "htsentities.h"
|
||||||
|
|
||||||
/* hexadecimal conversion */
|
/* hexadecimal conversion */
|
||||||
@@ -50,30 +52,31 @@ static int get_hex_value(char c) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Numerical Recipes,
|
/* 64-bit FNV-1a; must match htsentities.sh, which keys the entity table on it.
|
||||||
see <http://en.wikipedia.org/wiki/Linear_congruential_generator> */
|
*/
|
||||||
#define HASH_PRIME ( 1664525 )
|
#define HASH_INIT 0xcbf29ce484222325ULL
|
||||||
#define HASH_CONST ( 1013904223 )
|
#define HASH_PRIME 0x100000001b3ULL
|
||||||
#define HASH_ADD(HASH, C) do { \
|
#define HASH_ADD(HASH, C) \
|
||||||
(HASH) *= HASH_PRIME; \
|
do { \
|
||||||
(HASH) += HASH_CONST; \
|
(HASH) ^= (unsigned char) (C); \
|
||||||
(HASH) += (C); \
|
(HASH) *= HASH_PRIME; \
|
||||||
} while(0)
|
} while (0)
|
||||||
|
|
||||||
int hts_unescapeEntitiesWithCharset(const char *src, char *dest, const size_t max, const char *charset) {
|
int hts_unescapeEntitiesWithCharset(const char *src, char *dest, const size_t max, const char *charset) {
|
||||||
size_t i, j, ampStart, ampStartDest;
|
size_t i, j, ampStart, ampStartDest;
|
||||||
int uc;
|
int uc;
|
||||||
int hex;
|
int hex;
|
||||||
unsigned int hash;
|
uint64_t hash;
|
||||||
|
|
||||||
assertf(max != 0);
|
assertf(max != 0);
|
||||||
for(i = 0, j = 0, ampStart = (size_t) -1, ampStartDest = 0,
|
for (i = 0, j = 0, ampStart = (size_t) -1, ampStartDest = 0, uc = -1, hex = 0,
|
||||||
uc = -1, hex = 0, hash = 0 ; src[i] != '\0' ; i++) {
|
hash = HASH_INIT;
|
||||||
|
src[i] != '\0'; i++) {
|
||||||
/* start of entity */
|
/* start of entity */
|
||||||
if (src[i] == '&') {
|
if (src[i] == '&') {
|
||||||
ampStart = i;
|
ampStart = i;
|
||||||
ampStartDest = j;
|
ampStartDest = j;
|
||||||
hash = 0;
|
hash = HASH_INIT;
|
||||||
uc = -1;
|
uc = -1;
|
||||||
}
|
}
|
||||||
/* inside a potential entity */
|
/* inside a potential entity */
|
||||||
@@ -174,14 +177,11 @@ int hts_unescapeEntitiesWithCharset(const char *src, char *dest, const size_t ma
|
|||||||
}
|
}
|
||||||
/* alphanumerical entity */
|
/* alphanumerical entity */
|
||||||
else {
|
else {
|
||||||
/* alphanum and not too far ('ϑ' is the longest) */
|
/* alphanum, capped at the longest name
|
||||||
if (i <= ampStart + 10 &&
|
* '∳' (31) */
|
||||||
(
|
if (i <= ampStart + 31 && ((src[i] >= '0' && src[i] <= '9') ||
|
||||||
(src[i] >= '0' && src[i] <= '9')
|
(src[i] >= 'A' && src[i] <= 'Z') ||
|
||||||
|| (src[i] >= 'A' && src[i] <= 'Z')
|
(src[i] >= 'a' && src[i] <= 'z'))) {
|
||||||
|| (src[i] >= 'a' && src[i] <= 'z')
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
/* compute hash */
|
/* compute hash */
|
||||||
HASH_ADD(hash, (unsigned char) src[i]);
|
HASH_ADD(hash, (unsigned char) src[i]);
|
||||||
} else {
|
} else {
|
||||||
@@ -190,9 +190,9 @@ int hts_unescapeEntitiesWithCharset(const char *src, char *dest, const size_t ma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy */
|
/* reserve one byte for the trailing NUL written after the loop */
|
||||||
if (j + 1 > max) {
|
if (j + 1 >= max) {
|
||||||
/* overflow */
|
/* overflow */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -300,6 +300,11 @@ int hts_unescapeUrlSpecial(const char *src, char *dest, const size_t max,
|
|||||||
|
|
||||||
/* Was the character read successfully ? */
|
/* Was the character read successfully ? */
|
||||||
if (nRead == utfBufferSize) {
|
if (nRead == utfBufferSize) {
|
||||||
|
/* the 'continue' below skips the NUL-reserve guard: re-check */
|
||||||
|
if (utfBufferJ + utfBufferSize >= max) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Rollback write position to sequence start write position */
|
/* Rollback write position to sequence start write position */
|
||||||
j = utfBufferJ;
|
j = utfBufferJ;
|
||||||
|
|
||||||
@@ -314,8 +319,8 @@ int hts_unescapeUrlSpecial(const char *src, char *dest, const size_t max,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for overflow */
|
/* reserve one byte for the trailing NUL written after the loop */
|
||||||
if (j + 1 > max) {
|
if (j + 1 >= max) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13586
src/htsentities.h
13586
src/htsentities.h
File diff suppressed because it is too large
Load Diff
@@ -1,75 +1,92 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
|
# Regenerate htsentities.h from the WHATWG named character references.
|
||||||
|
|
||||||
src=html40.txt
|
set -euo pipefail
|
||||||
url=http://www.w3.org/TR/1998/REC-html40-19980424/html40.txt
|
|
||||||
|
src=entities.json
|
||||||
|
url=https://html.spec.whatwg.org/entities.json
|
||||||
dest=htsentities.h
|
dest=htsentities.h
|
||||||
|
|
||||||
(
|
# 64-bit FNV-1a of $1, printed as a C constant. Must match the hash in
|
||||||
cat <<EOF
|
# htsencoding.c. The offset basis is stored as its wrapped (signed) bit pattern;
|
||||||
/*
|
# bash arithmetic is 64-bit two's complement, so the result is bit-exact.
|
||||||
-- ${dest} --
|
fnv1a() {
|
||||||
FILE GENERATED BY $0, DO NOT MODIFY
|
local s=$1 i c h=$((0xcbf29ce484222325))
|
||||||
|
for ((i = 0; i < ${#s}; i++)); do
|
||||||
|
printf -v c '%d' "'${s:i:1}"
|
||||||
|
h=$(((h ^ (c & 0xff)) * 0x100000001b3))
|
||||||
|
done
|
||||||
|
printf '0x%016xULL' "$h"
|
||||||
|
}
|
||||||
|
|
||||||
We compute the LCG hash
|
if [ ! -f "$src" ]; then
|
||||||
(see <http://en.wikipedia.org/wiki/Linear_congruential_generator>)
|
curl -fsS "$url" -o "$src"
|
||||||
for each entity. We should in theory check using strncmp() that we
|
fi
|
||||||
actually have the correct entity, but this is actually statistically
|
|
||||||
not needed.
|
|
||||||
|
|
||||||
We may want to do better, but we expect the hash function to be uniform, and
|
# Keep ';'-terminated single-codepoint names; the ~93 multi-codepoint refs can't
|
||||||
let the compiler be smart enough to optimize the switch (for example by
|
# fit decode_entity's single-codepoint return and are skipped (left verbatim).
|
||||||
checking in log2() intervals)
|
pairs=$(jq -r '
|
||||||
|
to_entries
|
||||||
This code has been generated using the evil $0 script.
|
| map(select((.key | endswith(";")) and (.value.codepoints | length == 1)))
|
||||||
*/
|
| sort_by(.key)
|
||||||
|
| .[] | "\(.key | ltrimstr("&") | rtrimstr(";"))\t\(.value.codepoints[0])"' "$src")
|
||||||
|
|
||||||
static int decode_entity(const unsigned int hash, const size_t len) {
|
# Skipped multi-codepoint names, kept to prove none aliases an emitted hash.
|
||||||
|
skipped=$(jq -r '
|
||||||
|
to_entries
|
||||||
|
| map(select((.key | endswith(";")) and (.value.codepoints | length > 1)))
|
||||||
|
| .[] | .key | ltrimstr("&") | rtrimstr(";")' "$src")
|
||||||
|
|
||||||
|
cases=""
|
||||||
|
emit_hashes=""
|
||||||
|
while IFS=$'\t' read -r name cp; do
|
||||||
|
hash=$(fnv1a "$name")
|
||||||
|
cases+=" /* $name */"$'\n'
|
||||||
|
cases+=" case $hash:"$'\n'
|
||||||
|
cases+=" if (len == ${#name}) {"$'\n'
|
||||||
|
cases+=" return $cp;"$'\n'
|
||||||
|
cases+=" }"$'\n'
|
||||||
|
cases+=" break;"$'\n'
|
||||||
|
emit_hashes+="$hash"$'\n'
|
||||||
|
done <<<"$pairs"
|
||||||
|
|
||||||
|
skip_hashes=""
|
||||||
|
while IFS= read -r name; do
|
||||||
|
[ -n "$name" ] && skip_hashes+="$(fnv1a "$name")"$'\n'
|
||||||
|
done <<<"$skipped"
|
||||||
|
|
||||||
|
# The switch keys on the hash alone, so the dispatch is correct only while every
|
||||||
|
# emitted name hashes uniquely; prove it here, no runtime name compare needed.
|
||||||
|
dups=$(printf '%s' "$emit_hashes" | sort | uniq -d || true)
|
||||||
|
if [ -n "$dups" ]; then
|
||||||
|
echo "FATAL: two entity names share a hash (duplicate switch case); change the hash:" >&2
|
||||||
|
echo "$dups" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# A skipped name colliding with an emitted hash would mis-decode instead of
|
||||||
|
# staying verbatim; forbid that too.
|
||||||
|
aliased=$(comm -12 <(printf '%s' "$emit_hashes" | sort -u) <(printf '%s' "$skip_hashes" | sort -u) || true)
|
||||||
|
if [ -n "$aliased" ]; then
|
||||||
|
echo "FATAL: a skipped multi-codepoint name aliases an emitted hash:" >&2
|
||||||
|
echo "$aliased" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >"$dest" <<EOF
|
||||||
|
/* GENERATED by $0 from the WHATWG named character references
|
||||||
|
(${url}). DO NOT EDIT.
|
||||||
|
Dispatch keys on a 64-bit FNV-1a hash of the entity name; the generator
|
||||||
|
aborts on any hash collision, so no runtime name compare is needed. */
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
static int decode_entity(const uint64_t hash, const size_t len) {
|
||||||
switch(hash) {
|
switch(hash) {
|
||||||
EOF
|
${cases} }
|
||||||
(
|
|
||||||
if test -f ${src}; then
|
|
||||||
cat ${src}
|
|
||||||
else
|
|
||||||
GET "${url}"
|
|
||||||
fi
|
|
||||||
) \
|
|
||||||
| grep -E '^<!ENTITY [a-zA-Z0-9_]' \
|
|
||||||
| sed \
|
|
||||||
-e 's/<!ENTITY //' -e "s/[[:space:]][[:space:]]*/ /g" \
|
|
||||||
-e 's/-->$//' \
|
|
||||||
-e 's/\([^ ]*\) CDATA "&#\([^\"]*\);" -- \(.*\)/\1 \2 \3/'\
|
|
||||||
| ( \
|
|
||||||
read A
|
|
||||||
while test -n "$A"; do
|
|
||||||
ent="${A%% *}"
|
|
||||||
code=$(echo "$A"|cut -f2 -d' ')
|
|
||||||
# compute hash
|
|
||||||
hash=0
|
|
||||||
i=0
|
|
||||||
a=1664525
|
|
||||||
c=1013904223
|
|
||||||
m="$[1 << 32]"
|
|
||||||
while test "$i" -lt ${#ent}; do
|
|
||||||
d="$(echo -n "${ent:${i}:1}"|hexdump -v -e '/1 "%d"')"
|
|
||||||
hash="$[((${hash}*${a})%(${m})+${d}+${c})%(${m})]"
|
|
||||||
i=$[${i}+1]
|
|
||||||
done
|
|
||||||
echo -e " /* $A */"
|
|
||||||
echo -e " case ${hash}u:"
|
|
||||||
echo -e " if (len == ${#ent} /* && strncmp(ent, \"${ent}\") == 0 */) {"
|
|
||||||
echo -e " return ${code};"
|
|
||||||
echo -e " }"
|
|
||||||
echo -e " break;"
|
|
||||||
|
|
||||||
# next
|
|
||||||
read A
|
|
||||||
done
|
|
||||||
)
|
|
||||||
cat <<EOF
|
|
||||||
}
|
|
||||||
/* unknown */
|
/* unknown */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
) > ${dest}
|
|
||||||
|
echo "wrote $dest ($(grep -c '^ case ' "$dest") entities)" >&2
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ int fa_strjoker(int type, char **filters, int nfil, const char *nom, LLint * siz
|
|||||||
}
|
}
|
||||||
if (size)
|
if (size)
|
||||||
sz = *size;
|
sz = *size;
|
||||||
if (strjoker(nom, filters[i] + filteroffs, &sz, size_flag)) { // reconnu
|
/* size unknown (scan time): no size pointer => size tests stay neutral */
|
||||||
|
if (strjoker(nom, filters[i] + filteroffs, size ? &sz : NULL, size_flag)) {
|
||||||
if (size)
|
if (size)
|
||||||
if (sz != *size)
|
if (sz != *size)
|
||||||
sizelimit = sz;
|
sizelimit = sz;
|
||||||
@@ -101,9 +102,8 @@ int fa_strjoker(int type, char **filters, int nfil, const char *nom, LLint * siz
|
|||||||
// cet algo est 'un peu' récursif mais ne consomme pas trop de tm
|
// cet algo est 'un peu' récursif mais ne consomme pas trop de tm
|
||||||
// * = toute lettre
|
// * = toute lettre
|
||||||
// --?-- : spécifique à HTTrack et aux ?
|
// --?-- : spécifique à HTTrack et aux ?
|
||||||
HTS_INLINE const char *strjoker(const char *chaine, const char *joker, LLint * size,
|
HTS_INLINE const char *strjoker(const char *chaine, const char *joker,
|
||||||
int *size_flag) {
|
LLint *size, int *size_flag) {
|
||||||
//int err=0;
|
|
||||||
if (strnotempty(joker) == 0) { // fin de chaine joker
|
if (strnotempty(joker) == 0) { // fin de chaine joker
|
||||||
if (strnotempty(chaine) == 0) // fin aussi pour la chaine: ok
|
if (strnotempty(chaine) == 0) // fin aussi pour la chaine: ok
|
||||||
return chaine;
|
return chaine;
|
||||||
@@ -192,7 +192,12 @@ HTS_INLINE const char *strjoker(const char *chaine, const char *joker, LLint * s
|
|||||||
int len = (int) strlen(joker);
|
int len = (int) strlen(joker);
|
||||||
|
|
||||||
while((joker[i] != RIGHT) && (joker[i]) && (i < len)) {
|
while((joker[i] != RIGHT) && (joker[i]) && (i < len)) {
|
||||||
if ((joker[i] == '<') || (joker[i] == '>')) { // *[<10]
|
// '\' escapes the next char as a literal member, e.g. *[\[\]]
|
||||||
|
if (joker[i] == '\\' && joker[i + 1] != '\0') {
|
||||||
|
i++;
|
||||||
|
pass[(int) (unsigned char) joker[i]] = 1;
|
||||||
|
i++;
|
||||||
|
} else if ((joker[i] == '<') || (joker[i] == '>')) { // *[<10]
|
||||||
int lsize = 0;
|
int lsize = 0;
|
||||||
int lverdict;
|
int lverdict;
|
||||||
|
|
||||||
@@ -220,7 +225,9 @@ HTS_INLINE const char *strjoker(const char *chaine, const char *joker, LLint * s
|
|||||||
while(isdigit((unsigned char) joker[i]))
|
while(isdigit((unsigned char) joker[i]))
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} else if (joker[i + 1] == '-') { // 2 car, ex: *[A-Z]
|
} else if (joker[i + 1] == '-' && joker[i + 2] != '\0') {
|
||||||
|
// range *[A-Z]; the '\0' guard rejects a truncated *[a- (else
|
||||||
|
// i+=3 overshoots the NUL)
|
||||||
if ((int) (unsigned char) joker[i + 2] >
|
if ((int) (unsigned char) joker[i + 2] >
|
||||||
(int) (unsigned char) joker[i]) {
|
(int) (unsigned char) joker[i]) {
|
||||||
int j;
|
int j;
|
||||||
@@ -228,14 +235,9 @@ HTS_INLINE const char *strjoker(const char *chaine, const char *joker, LLint * s
|
|||||||
for(j = (int) (unsigned char) joker[i];
|
for(j = (int) (unsigned char) joker[i];
|
||||||
j <= (int) (unsigned char) joker[i + 2]; j++)
|
j <= (int) (unsigned char) joker[i + 2]; j++)
|
||||||
pass[j] = 1;
|
pass[j] = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
// else err=1;
|
|
||||||
i += 3;
|
i += 3;
|
||||||
} else { // 1 car, ex: *[ ]
|
} else { // 1 car, ex: *[ ]
|
||||||
if (joker[i + 2] == '\\' && joker[i + 3] != 0) { // escaped char, such as *[\[] or *[\]]
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
pass[(int) (unsigned char) joker[i]] = 1;
|
pass[(int) (unsigned char) joker[i]] = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -257,7 +259,6 @@ HTS_INLINE const char *strjoker(const char *chaine, const char *joker, LLint * s
|
|||||||
for(i = 0; i < 256; i++)
|
for(i = 0; i < 256; i++)
|
||||||
pass[i] = 1; // tout autoriser
|
pass[i] = 1; // tout autoriser
|
||||||
jmp = 1;
|
jmp = 1;
|
||||||
////if (joker[2]==LEFT) jmp=3; // permet de recher *<crochet ouvrant>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
185
src/htsftp.c
185
src/htsftp.c
@@ -54,15 +54,9 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ftp mode passif
|
// ftp mode passif
|
||||||
// #if HTS_INET6==0
|
|
||||||
#define FTP_PASV 1
|
#define FTP_PASV 1
|
||||||
// #else
|
|
||||||
// no passive mode for v6
|
|
||||||
// #define FTP_PASV 0
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
#define FTP_DEBUG 0
|
#define FTP_DEBUG 0
|
||||||
//#define FORK_DEBUG 0
|
|
||||||
|
|
||||||
#if USE_BEGINTHREAD
|
#if USE_BEGINTHREAD
|
||||||
|
|
||||||
@@ -128,6 +122,33 @@ void launch_ftp(FTPDownloadStruct * params) {
|
|||||||
return 0; \
|
return 0; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bounded split of a hostile-URL "user[:pass]@" prefix (see htsftp.h). */
|
||||||
|
void ftp_split_userpass(const char *src, const char *end, char *user,
|
||||||
|
size_t user_size, char *pass, size_t pass_size) {
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
assertf(user_size > 0 && pass_size > 0); /* the size-1 math underflows on 0 */
|
||||||
|
|
||||||
|
while (src[n] != '\0' && src[n] != ':') {
|
||||||
|
if (n < user_size - 1)
|
||||||
|
user[n] = src[n];
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
user[n < user_size ? n : user_size - 1] = '\0';
|
||||||
|
pass[0] = '\0';
|
||||||
|
if (src[n] == ':') { // password follows the colon
|
||||||
|
const size_t base = n + 1;
|
||||||
|
size_t k = 0;
|
||||||
|
|
||||||
|
while (&src[base + k + 1] < end && src[base + k] != '\0') {
|
||||||
|
if (k < pass_size - 1)
|
||||||
|
pass[k] = src[base + k];
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
pass[k < pass_size ? k : pass_size - 1] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// la véritable fonction une fois lancées les routines thread/fork
|
// la véritable fonction une fois lancées les routines thread/fork
|
||||||
int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
||||||
lien_back *back = pStruct->pBack;
|
lien_back *back = pStruct->pBack;
|
||||||
@@ -173,43 +194,14 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
while(*real_adr == '/')
|
while(*real_adr == '/')
|
||||||
real_adr++; // sauter /
|
real_adr++; // sauter /
|
||||||
if ((adr = jump_identification(real_adr)) != real_adr) { // user
|
if ((adr = jump_identification(real_adr)) != real_adr) { // user
|
||||||
int i = -1;
|
ftp_split_userpass(real_adr, adr, user, sizeof(user), pass, sizeof(pass));
|
||||||
|
|
||||||
pass[0] = '\0';
|
|
||||||
do {
|
|
||||||
i++;
|
|
||||||
user[i] = real_adr[i];
|
|
||||||
} while((real_adr[i] != ':') && (real_adr[i]));
|
|
||||||
user[i] = '\0';
|
|
||||||
if (real_adr[i] == ':') { // pass
|
|
||||||
int j = -1;
|
|
||||||
|
|
||||||
i++; // oui on saute aussi le :
|
|
||||||
do {
|
|
||||||
j++;
|
|
||||||
pass[j] = real_adr[i + j];
|
|
||||||
} while(((&real_adr[i + j + 1]) < adr) && (real_adr[i + j]));
|
|
||||||
pass[j] = '\0';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Calculer RETR <nom>
|
// Calculer RETR <nom>
|
||||||
{
|
{
|
||||||
char *a;
|
char *a;
|
||||||
|
|
||||||
#if 0
|
|
||||||
a = back->url_fil + strlen(back->url_fil) - 1;
|
|
||||||
while((a > back->url_fil) && (*a != '/'))
|
|
||||||
a--;
|
|
||||||
if (*a != '/') {
|
|
||||||
a = NULL;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
a = back->url_fil;
|
a = back->url_fil;
|
||||||
#endif
|
|
||||||
if (a != NULL && *a != '\0') {
|
if (a != NULL && *a != '\0') {
|
||||||
#if 0
|
|
||||||
a++; // sauter /
|
|
||||||
#endif
|
|
||||||
ftp_filename = a;
|
ftp_filename = a;
|
||||||
if (strnotempty(a)) {
|
if (strnotempty(a)) {
|
||||||
char catbuff[CATBUFF_SIZE];
|
char catbuff[CATBUFF_SIZE];
|
||||||
@@ -233,7 +225,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "Unexpected PORT error");
|
strcpybuff(back->r.msg, "Unexpected PORT error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,7 +258,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
if (hts_dns_resolve2(opt, _adr, &server, &error) == NULL) {
|
if (hts_dns_resolve2(opt, _adr, &server, &error) == NULL) {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg),
|
snprintf(back->r.msg, sizeof(back->r.msg),
|
||||||
"Unable to get server's address: %s", error);
|
"Unable to get server's address: %s", error);
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_NON_FATAL;
|
back->r.statuscode = STATUSCODE_NON_FATAL;
|
||||||
_HALT_FTP return 0;
|
_HALT_FTP return 0;
|
||||||
}
|
}
|
||||||
@@ -280,20 +270,17 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
soc_ctl = (T_SOC) socket(SOCaddr_sinfamily(server), SOCK_STREAM, 0);
|
soc_ctl = (T_SOC) socket(SOCaddr_sinfamily(server), SOCK_STREAM, 0);
|
||||||
if (soc_ctl == INVALID_SOCKET) {
|
if (soc_ctl == INVALID_SOCKET) {
|
||||||
strcpybuff(back->r.msg, "Unable to create a socket");
|
strcpybuff(back->r.msg, "Unable to create a socket");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
_HALT_FTP return 0;
|
_HALT_FTP return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCaddr_initport(server, port);
|
SOCaddr_initport(server, port);
|
||||||
// server.sin_port = htons((unsigned short int) port);
|
|
||||||
|
|
||||||
// connexion (bloquante, on est en thread)
|
// connexion (bloquante, on est en thread)
|
||||||
strcpybuff(back->info, "connect");
|
strcpybuff(back->info, "connect");
|
||||||
|
|
||||||
if (connect(soc_ctl, &SOCaddr_sockaddr(server), SOCaddr_size(server)) != 0) {
|
if (connect(soc_ctl, &SOCaddr_sockaddr(server), SOCaddr_size(server)) != 0) {
|
||||||
strcpybuff(back->r.msg, "Unable to connect to the server");
|
strcpybuff(back->r.msg, "Unable to connect to the server");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
_HALT_FTP return 0;
|
_HALT_FTP return 0;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -335,64 +322,22 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
// ok
|
// ok
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "TYPE I error");
|
strcpybuff(back->r.msg, "TYPE I error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
// --CWD--
|
|
||||||
char *a;
|
|
||||||
|
|
||||||
a = back->url_fil + strlen(back->url_fil) - 1;
|
|
||||||
while((a > back->url_fil) && (*a != '/'))
|
|
||||||
a--;
|
|
||||||
if (*a == '/') { // ok repéré
|
|
||||||
char BIGSTK target[1024];
|
|
||||||
|
|
||||||
target[0] = '\0';
|
|
||||||
strncatbuff(target, back->url_fil, (int) (a - back->url_fil));
|
|
||||||
if (strnotempty(target) == 0)
|
|
||||||
strcatbuff(target, "/");
|
|
||||||
strcpybuff(back->info, "cwd");
|
|
||||||
snprintf(line, sizeof(line), "CWD %s", target);
|
|
||||||
send_line(soc_ctl, line);
|
|
||||||
get_ftp_line(soc_ctl, line, sizeof(line), timeout);
|
|
||||||
_CHECK_HALT_FTP;
|
|
||||||
if (line[0] == '2') {
|
|
||||||
send_line(soc_ctl, "TYPE I");
|
|
||||||
get_ftp_line(soc_ctl, line, sizeof(line), timeout);
|
|
||||||
_CHECK_HALT_FTP;
|
|
||||||
if (line[0] == '2') {
|
|
||||||
// ok..
|
|
||||||
} else {
|
|
||||||
strcpybuff(back->r.msg, "TYPE I error");
|
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "CWD error: %s", linejmp(line));
|
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
|
||||||
} // sinon on est prêts
|
|
||||||
} else {
|
|
||||||
strcpybuff(back->r.msg, "Unexpected ftp error");
|
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "Bad password: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "Bad password: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "Bad user name: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "Bad user name: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "Connection refused: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "Connection refused: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,8 +404,8 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
// -- fin analyse de l'adresse IP et du port --
|
// -- fin analyse de l'adresse IP et du port --
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "PASV incorrect: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "PASV incorrect: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
} else {
|
} else {
|
||||||
@@ -491,13 +436,13 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "EPSV incorrect: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "EPSV incorrect: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "PASV/EPSV error: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "PASV/EPSV error: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
}
|
}
|
||||||
@@ -603,9 +548,8 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
deletesoc(soc_dat);
|
deletesoc(soc_dat);
|
||||||
soc_dat = INVALID_SOCKET;
|
soc_dat = INVALID_SOCKET;
|
||||||
//
|
//
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "RETR command error: %s",
|
snprintf(back->r.msg, sizeof(back->r.msg),
|
||||||
linejmp(line));
|
"RETR command error: %s", linejmp(line));
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
} else {
|
} else {
|
||||||
@@ -616,23 +560,20 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
soc_dat = INVALID_SOCKET;
|
soc_dat = INVALID_SOCKET;
|
||||||
//
|
//
|
||||||
strcpybuff(back->r.msg, "Unable to connect");
|
strcpybuff(back->r.msg, "Unable to connect");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "Unable to create a socket");
|
strcpybuff(back->r.msg, "Unable to create a socket");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg),
|
snprintf(back->r.msg, sizeof(back->r.msg),
|
||||||
"Unable to resolve IP %s: %s", adr_ip, error);
|
"Unable to resolve IP %s: %s", adr_ip, error);
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "PASV incorrect: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "PASV incorrect: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
} // sinon on est prêts
|
} // sinon on est prêts
|
||||||
#else
|
#else
|
||||||
@@ -653,17 +594,16 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
//T_SOC soc_dat;
|
//T_SOC soc_dat;
|
||||||
if ((soc_dat = accept(soc_servdat, NULL, NULL)) == INVALID_SOCKET) {
|
if ((soc_dat = accept(soc_servdat, NULL, NULL)) == INVALID_SOCKET) {
|
||||||
strcpybuff(back->r.msg, "Unable to accept connection");
|
strcpybuff(back->r.msg, "Unable to accept connection");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "RETR command error: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg),
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
"RETR command error: %s", linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "PORT command error: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "PORT command error: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -673,7 +613,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "Unable to listen to a port");
|
strcpybuff(back->r.msg, "Unable to listen to a port");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -697,21 +636,18 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
int len = 1;
|
int len = 1;
|
||||||
int read_len = 1024;
|
int read_len = 1024;
|
||||||
|
|
||||||
//HTS_TOTAL_RECV_CHECK(read_len); // Diminuer au besoin si trop de données reçues
|
|
||||||
|
|
||||||
while((len > 0) && (!stop_ftp(back))) {
|
while((len > 0) && (!stop_ftp(back))) {
|
||||||
// attendre les données
|
// attendre les données
|
||||||
len = 1; // pas d'erreur pour le moment
|
len = 1; // pas d'erreur pour le moment
|
||||||
switch (wait_socket_receive(soc_dat, timeout)) {
|
switch (wait_socket_receive(soc_dat, timeout)) {
|
||||||
case -1:
|
case -1:
|
||||||
strcpybuff(back->r.msg, "FTP read error");
|
strcpybuff(back->r.msg, "FTP read error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
len = 0; // fin
|
len = 0; // fin
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "Time out (%d)", timeout);
|
snprintf(back->r.msg, sizeof(back->r.msg), "Time out (%d)",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
timeout);
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
len = 0; // fin
|
len = 0; // fin
|
||||||
break;
|
break;
|
||||||
@@ -733,17 +669,14 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
strcpybuff(back->r.msg, "Write error");
|
strcpybuff(back->r.msg, "Write error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
len = 0; // error
|
len = 0; // error
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "Unexpected write error");
|
strcpybuff(back->r.msg, "Unexpected write error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else { // Erreur ou terminé
|
} else { // Erreur ou terminé
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = 0;
|
back->r.statuscode = 0;
|
||||||
if (back->r.totalsize > 0
|
if (back->r.totalsize > 0
|
||||||
&& back->r.size != back->r.totalsize) {
|
&& back->r.size != back->r.totalsize) {
|
||||||
@@ -752,7 +685,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
read_len = 1024;
|
read_len = 1024;
|
||||||
//HTS_TOTAL_RECV_CHECK(read_len); // Diminuer au besoin si trop de données reçues
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (back->r.fp) {
|
if (back->r.fp) {
|
||||||
@@ -761,7 +693,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "Unable to write file");
|
strcpybuff(back->r.msg, "Unable to write file");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -777,16 +708,14 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
get_ftp_line(soc_ctl, line, sizeof(line), timeout);
|
get_ftp_line(soc_ctl, line, sizeof(line), timeout);
|
||||||
if (line[0] == '2') { // OK
|
if (line[0] == '2') { // OK
|
||||||
strcpybuff(back->r.msg, "OK");
|
strcpybuff(back->r.msg, "OK");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = HTTP_OK;
|
back->r.statuscode = HTTP_OK;
|
||||||
} else {
|
} else {
|
||||||
snprintf(back->r.msg, sizeof(back->r.msg), "RETR incorrect: %s", linejmp(line));
|
snprintf(back->r.msg, sizeof(back->r.msg), "RETR incorrect: %s",
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
linejmp(line));
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strcpybuff(back->r.msg, "FTP read error");
|
strcpybuff(back->r.msg, "FTP read error");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -812,7 +741,6 @@ int run_launch_ftp(FTPDownloadStruct * pStruct) {
|
|||||||
back->r.statuscode = HTTP_OK;
|
back->r.statuscode = HTTP_OK;
|
||||||
strcpybuff(back->r.msg, "OK");
|
strcpybuff(back->r.msg, "OK");
|
||||||
}
|
}
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -979,13 +907,11 @@ int get_ftp_line(T_SOC soc, char *ptrline, size_t line_size, int timeout) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//HTS_TOTAL_RECV_CHECK(dummy); // Diminuer au besoin si trop de données reçues
|
|
||||||
switch (recv(soc, &b, 1, 0)) {
|
switch (recv(soc, &b, 1, 0)) {
|
||||||
//case 0: break; // pas encore --> erreur (on attend)!
|
|
||||||
case 1:
|
case 1:
|
||||||
HTS_STAT.HTS_TOTAL_RECV += 1; // compter flux entrant
|
HTS_STAT.HTS_TOTAL_RECV += 1; // compter flux entrant
|
||||||
if ((b != 10) && (b != 13))
|
if ((b != 10) && (b != 13) && (i < (int) sizeof(data) - 1))
|
||||||
data[i++] = b;
|
data[i++] = b; // truncate hostile over-long reply lines
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (ptrline)
|
if (ptrline)
|
||||||
@@ -1108,7 +1034,6 @@ int wait_socket_receive(T_SOC soc, int timeout) {
|
|||||||
int stop_ftp(lien_back * back) {
|
int stop_ftp(lien_back * back) {
|
||||||
if (back->stop_ftp) {
|
if (back->stop_ftp) {
|
||||||
strcpybuff(back->r.msg, "Cancelled by User");
|
strcpybuff(back->r.msg, "Cancelled by User");
|
||||||
// back->status=STATUS_FTP_READY; // fini
|
|
||||||
back->r.statuscode = STATUSCODE_INVALID;
|
back->r.statuscode = STATUSCODE_INVALID;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ int back_launch_ftp(FTPDownloadStruct * params);
|
|||||||
int run_launch_ftp(FTPDownloadStruct * params);
|
int run_launch_ftp(FTPDownloadStruct * params);
|
||||||
int send_line(T_SOC soc, const char *data);
|
int send_line(T_SOC soc, const char *data);
|
||||||
int get_ftp_line(T_SOC soc, char *line, size_t line_size, int timeout);
|
int get_ftp_line(T_SOC soc, char *line, size_t line_size, int timeout);
|
||||||
|
/* Split a "user[:pass]@" prefix (end = jump_identification result) into
|
||||||
|
bounded, NUL-terminated user/pass buffers, truncating to fit.
|
||||||
|
Both sizes must be nonzero. */
|
||||||
|
void ftp_split_userpass(const char *src, const char *end, char *user,
|
||||||
|
size_t user_size, char *pass, size_t pass_size);
|
||||||
T_SOC get_datasocket(char *to_send, size_t to_send_size);
|
T_SOC get_datasocket(char *to_send, size_t to_send_size);
|
||||||
int stop_ftp(lien_back * back);
|
int stop_ftp(lien_back * back);
|
||||||
char *linejmp(char *line);
|
char *linejmp(char *line);
|
||||||
|
|||||||
225
src/htsglobal.h
225
src/htsglobal.h
@@ -30,23 +30,30 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
// Fichier réunissant l'ensemble des defines
|
/** @file htsglobal.h
|
||||||
|
* Foundational portability layer included by every other public header:
|
||||||
|
* version strings, platform/feature switches, the HTSEXT_API export marker,
|
||||||
|
* the integer/time/socket typedefs (LLint, TStamp, INTsys, T_SOC), printf
|
||||||
|
* format helpers, and the file-access mode constants. */
|
||||||
|
|
||||||
#ifndef HTTRACK_GLOBAL_DEFH
|
#ifndef HTTRACK_GLOBAL_DEFH
|
||||||
#define HTTRACK_GLOBAL_DEFH
|
#define HTTRACK_GLOBAL_DEFH
|
||||||
|
|
||||||
// Version (also check external version information)
|
/* Package version strings (the library ABI version is VERSION_INFO in
|
||||||
#define HTTRACK_VERSION "3.49-8"
|
configure.ac, decoupled from these). VERSION is the display form, VERSIONID
|
||||||
#define HTTRACK_VERSIONID "3.49.8"
|
the dotted numeric form, AFF_VERSION the short form shown in footers,
|
||||||
#define HTTRACK_AFF_VERSION "3.x"
|
LIB_VERSION the data/cache format generation. */
|
||||||
#define HTTRACK_LIB_VERSION "2.0"
|
#define HTTRACK_VERSION "3.49-11"
|
||||||
|
#define HTTRACK_VERSIONID "3.49.11"
|
||||||
|
#define HTTRACK_AFF_VERSION "3.x"
|
||||||
|
#define HTTRACK_LIB_VERSION "2.0"
|
||||||
|
|
||||||
#ifndef HTS_NOINCLUDES
|
#ifndef HTS_NOINCLUDES
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Définition plate-forme
|
// Platform detection (sizes, feature macros)
|
||||||
#include "htsconfig.h"
|
#include "htsconfig.h"
|
||||||
|
|
||||||
// WIN32 types
|
// WIN32 types
|
||||||
@@ -57,12 +64,18 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* GCC extension */
|
/* Compiler-attribute helpers, no-ops where unsupported.
|
||||||
|
HTS_UNUSED: suppress unused-symbol warnings. HTS_STATIC: an unused-safe
|
||||||
|
static. HTS_PRINTF_FUN(fmt, arg): mark a printf-like function so the
|
||||||
|
compiler type-checks the format string at argument index fmt against the
|
||||||
|
varargs starting at arg. */
|
||||||
#ifndef HTS_UNUSED
|
#ifndef HTS_UNUSED
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define HTS_UNUSED __attribute__ ((unused))
|
#define HTS_UNUSED __attribute__((unused))
|
||||||
#define HTS_STATIC static __attribute__ ((unused))
|
|
||||||
#define HTS_PRINTF_FUN(fmt, arg) __attribute__ ((format (printf, fmt, arg)))
|
#define HTS_STATIC static __attribute__((unused))
|
||||||
|
|
||||||
|
#define HTS_PRINTF_FUN(fmt, arg) __attribute__((format(printf, fmt, arg)))
|
||||||
#else
|
#else
|
||||||
#define HTS_UNUSED
|
#define HTS_UNUSED
|
||||||
#define HTS_STATIC static
|
#define HTS_STATIC static
|
||||||
@@ -86,6 +99,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
#ifndef S_ISREG
|
#ifndef S_ISREG
|
||||||
#define S_ISREG(m) ((m) & _S_IFREG)
|
#define S_ISREG(m) ((m) & _S_IFREG)
|
||||||
|
|
||||||
#define S_ISDIR(m) ((m) & _S_IFDIR)
|
#define S_ISDIR(m) ((m) & _S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -99,7 +113,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
#ifndef HTS_LONGLONG
|
#ifndef HTS_LONGLONG
|
||||||
#ifdef SIZEOF_LONG_LONG
|
#ifdef SIZEOF_LONG_LONG
|
||||||
#if SIZEOF_LONG_LONG==8
|
#if SIZEOF_LONG_LONG == 8
|
||||||
#define HTS_LONGLONG 1
|
#define HTS_LONGLONG 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -132,7 +146,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#define BIGSTK
|
#define BIGSTK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// compatibilité DOS
|
// DOS-style 8.3 filenames? 1 on Windows, 0 elsewhere
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define HTS_DOSNAME 1
|
#define HTS_DOSNAME 1
|
||||||
#else
|
#else
|
||||||
@@ -168,7 +182,10 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#define __cdecl
|
#define __cdecl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* rc file */
|
/* Install paths and config-file names. HTTRACKRC is the per-user rc filename,
|
||||||
|
HTTRACKCNF the system-wide config, HTTRACKDIR the shared data directory; the
|
||||||
|
ETC/BIN/LIB/PREFIX paths are the defaults these derive from when not set by
|
||||||
|
the build. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define HTS_HTTRACKRC "httrackrc"
|
#define HTS_HTTRACKRC "httrackrc"
|
||||||
#else
|
#else
|
||||||
@@ -187,53 +204,92 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HTS_HTTRACKRC ".httrackrc"
|
#define HTS_HTTRACKRC ".httrackrc"
|
||||||
#define HTS_HTTRACKCNF HTS_ETCPATH"/httrack.conf"
|
#define HTS_HTTRACKCNF HTS_ETCPATH "/httrack.conf"
|
||||||
|
|
||||||
#ifdef DATADIR
|
#ifdef DATADIR
|
||||||
#define HTS_HTTRACKDIR DATADIR"/httrack/"
|
#define HTS_HTTRACKDIR DATADIR "/httrack/"
|
||||||
#else
|
#else
|
||||||
#define HTS_HTTRACKDIR HTS_PREFIX"/share/httrack/"
|
#define HTS_HTTRACKDIR HTS_PREFIX "/share/httrack/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Taille max d'une URL */
|
/* Maximum URL length, in bytes. Callers size URL/path string buffers to this;
|
||||||
|
anything longer is rejected. */
|
||||||
#define HTS_URLMAXSIZE 1024
|
#define HTS_URLMAXSIZE 1024
|
||||||
/* Taille max ligne de commande (>=HTS_URLMAXSIZE*2) */
|
/* Maximum command-line argument length, in bytes (kept >= HTS_URLMAXSIZE*2 so
|
||||||
|
an addr+path pair always fits). */
|
||||||
#define HTS_CDLMAXSIZE 1024
|
#define HTS_CDLMAXSIZE 1024
|
||||||
|
/* MIME-type buffer contract (htsblk.contenttype/charset/contentencoding); holds
|
||||||
|
the longest registered MIME type, the Office OOXML ones reaching 73 chars */
|
||||||
|
#define HTS_MIMETYPE_SIZE 128
|
||||||
|
|
||||||
/* Copyright (C) 1998 Xavier Roche and other contributors */
|
/* Copyright (C) 1998 Xavier Roche and other contributors */
|
||||||
#define HTTRACK_AFF_AUTHORS "[XR&CO'2014]"
|
#define HTTRACK_AFF_AUTHORS "[XR&CO'2014]"
|
||||||
#define HTS_DEFAULT_FOOTER "<!-- Mirrored from %s%s by HTTrack Website Copier/" HTTRACK_AFF_VERSION " " HTTRACK_AFF_AUTHORS ", %s -->"
|
#define HTS_DEFAULT_FOOTER \
|
||||||
|
"<!-- Mirrored from %s%s by HTTrack Website Copier/" HTTRACK_AFF_VERSION \
|
||||||
|
" " HTTRACK_AFF_AUTHORS ", %s -->"
|
||||||
|
/* Honest crawler User-Agent; no fake OS/browser to go stale. */
|
||||||
|
#define HTS_DEFAULT_USER_AGENT \
|
||||||
|
"Mozilla/5.0 (compatible; HTTrack/" HTTRACK_AFF_VERSION \
|
||||||
|
"; +https://www.httrack.com/)"
|
||||||
#define HTTRACK_WEB "http://www.httrack.com"
|
#define HTTRACK_WEB "http://www.httrack.com"
|
||||||
#define HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version=" HTTRACK_VERSIONID "&VersionStr=" HTTRACK_VERSION "&Platform=%d&Language=%s"
|
#define HTS_UPDATE_WEBSITE \
|
||||||
|
"http://www.httrack.com/" \
|
||||||
|
"update.php3?Product=HTTrack&Version=" HTTRACK_VERSIONID \
|
||||||
|
"&VersionStr=" HTTRACK_VERSION "&Platform=%d&Language=%s"
|
||||||
|
|
||||||
#define H_CRLF "\x0d\x0a"
|
#define H_CRLF "\x0d\x0a"
|
||||||
#define CRLF "\x0d\x0a"
|
#define CRLF "\x0d\x0a"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define LF "\x0d\x0a"
|
#define LF "\x0d\x0a"
|
||||||
#else
|
#else
|
||||||
#define LF "\x0a"
|
#define LF "\x0a"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* équivaut à "paramètre vide", par exemple -F (none) */
|
/* Sentinel meaning "empty parameter", e.g. -F (none) */
|
||||||
#define HTS_NOPARAM "(none)"
|
#define HTS_NOPARAM "(none)"
|
||||||
#define HTS_NOPARAM2 "\"(none)\""
|
#define HTS_NOPARAM2 "\"(none)\""
|
||||||
|
|
||||||
/* maximum et minimum */
|
/* Boolean flag for option fields and API yes/no returns. Int-backed, not an
|
||||||
#define maximum(A,B) ( (A) > (B) ? (A) : (B) )
|
enum: an enum makes C++ reject `field = 1` / `f(0)` on the exported fields
|
||||||
#define minimum(A,B) ( (A) < (B) ? (A) : (B) )
|
and params. Int-sized, so the httrackp layout and the ABI are unchanged. */
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_boolean
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_boolean
|
||||||
|
|
||||||
/* chaine no empty ? (and not null) */
|
typedef int hts_boolean;
|
||||||
|
#define HTS_FALSE 0
|
||||||
|
#define HTS_TRUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_tristate
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_tristate
|
||||||
|
/* Tri-state hts_boolean: HTS_DEFAULT (-1) = "unspecified" (copy_htsopt leaves
|
||||||
|
the target untouched); HTS_FALSE/HTS_TRUE = off/on. */
|
||||||
|
typedef int hts_tristate;
|
||||||
|
#define HTS_DEFAULT (-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Larger/smaller of two values. Macros: arguments are evaluated twice. */
|
||||||
|
#define maximum(A, B) ((A) > (B) ? (A) : (B))
|
||||||
|
|
||||||
|
#define minimum(A, B) ((A) < (B) ? (A) : (B))
|
||||||
|
|
||||||
|
/* True when A is a non-NULL, non-empty string. */
|
||||||
#define strnotempty(A) (((A) != NULL && (A)[0] != '\0'))
|
#define strnotempty(A) (((A) != NULL && (A)[0] != '\0'))
|
||||||
|
|
||||||
/* optimisation inline si possible */
|
/* 'inline' where the dialect supports it (C++), nothing in plain C. */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define HTS_INLINE inline
|
#define HTS_INLINE inline
|
||||||
#else
|
#else
|
||||||
#define HTS_INLINE
|
#define HTS_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Marks a symbol as part of the library's public ABI: exported from
|
||||||
|
libhttrack and visible to callers. Symbols without it stay internal (hidden
|
||||||
|
under -fvisibility=hidden). Expands to dllexport when building the library,
|
||||||
|
dllimport when consuming it, and the visibility("default") attribute on
|
||||||
|
ELF. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef LIBHTTRACK_EXPORTS
|
#ifdef LIBHTTRACK_EXPORTS
|
||||||
#define HTSEXT_API __declspec(dllexport)
|
#define HTSEXT_API __declspec(dllexport)
|
||||||
@@ -242,14 +298,34 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* See <http://gcc.gnu.org/wiki/Visibility> */
|
/* See <http://gcc.gnu.org/wiki/Visibility> */
|
||||||
#if ( ( defined(__GNUC__) && ( __GNUC__ >= 4 ) ) \
|
#if ((defined(__GNUC__) && (__GNUC__ >= 4)) || \
|
||||||
|| ( defined(HAVE_VISIBILITY) && HAVE_VISIBILITY ) )
|
(defined(HAVE_VISIBILITY) && HAVE_VISIBILITY))
|
||||||
#define HTSEXT_API __attribute__ ((visibility ("default")))
|
|
||||||
|
#define HTSEXT_API __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
#define HTSEXT_API
|
#define HTSEXT_API
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark a function deprecated, with a message pointing at the replacement.
|
||||||
|
* Placed before the declaration so both the GCC/Clang attribute and the MSVC
|
||||||
|
* __declspec sit in a position both accept. Degrades to nothing elsewhere.
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) && \
|
||||||
|
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
|
||||||
|
|
||||||
|
#define HTS_DEPRECATED(msg) __attribute__((deprecated(msg)))
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
|
||||||
|
#define HTS_DEPRECATED(msg) __attribute__((deprecated))
|
||||||
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||||
|
|
||||||
|
#define HTS_DEPRECATED(msg) __declspec(deprecated(msg))
|
||||||
|
#else
|
||||||
|
#define HTS_DEPRECATED(msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HTS_LONGLONG
|
#ifndef HTS_LONGLONG
|
||||||
#ifdef HTS_NO_64_BIT
|
#ifdef HTS_NO_64_BIT
|
||||||
#define HTS_LONGLONG 0
|
#define HTS_LONGLONG 0
|
||||||
@@ -258,12 +334,16 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// long long int? (or int)
|
/* Wide integer types, chosen per platform.
|
||||||
// (and int cast for system functions like malloc() )
|
LLint: signed 64-bit counter for byte counts and large sizes (falls back to
|
||||||
|
plain int where 64-bit is unavailable).
|
||||||
|
TStamp: timestamp/duration in the same width (a double in the no-64-bit
|
||||||
|
fallback).
|
||||||
|
LLintP: the printf conversion for an LLint. */
|
||||||
#if HTS_LONGLONG
|
#if HTS_LONGLONG
|
||||||
#ifdef LLINT_FORMAT
|
#ifdef LLINT_FORMAT
|
||||||
typedef LLINT_TYPE LLint;
|
typedef LLINT_TYPE LLint;
|
||||||
|
|
||||||
typedef LLINT_TYPE TStamp;
|
typedef LLINT_TYPE TStamp;
|
||||||
|
|
||||||
#define LLintP LLINT_FORMAT
|
#define LLintP LLINT_FORMAT
|
||||||
@@ -271,17 +351,21 @@ typedef LLINT_TYPE TStamp;
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
typedef __int64 LLint;
|
typedef __int64 LLint;
|
||||||
|
|
||||||
typedef __int64 TStamp;
|
typedef __int64 TStamp;
|
||||||
|
|
||||||
#define LLintP "%I64d"
|
#define LLintP "%I64d"
|
||||||
#elif (defined(_LP64) || defined(__x86_64__) \
|
#elif (defined(_LP64) || defined(__x86_64__) || defined(__powerpc64__) || \
|
||||||
|| defined(__powerpc64__) || defined(__64BIT__))
|
defined(__64BIT__))
|
||||||
|
|
||||||
typedef long int LLint;
|
typedef long int LLint;
|
||||||
|
|
||||||
typedef long int TStamp;
|
typedef long int TStamp;
|
||||||
|
|
||||||
#define LLintP "%ld"
|
#define LLintP "%ld"
|
||||||
#else
|
#else
|
||||||
typedef long long int LLint;
|
typedef long long int LLint;
|
||||||
|
|
||||||
typedef long long int TStamp;
|
typedef long long int TStamp;
|
||||||
|
|
||||||
#define LLintP "%lld"
|
#define LLintP "%lld"
|
||||||
@@ -296,6 +380,9 @@ typedef int LLint;
|
|||||||
typedef double TStamp;
|
typedef double TStamp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Integer type for file offsets/sizes passed to the C library. Widens to
|
||||||
|
LLint (with HTS_FSEEKO for fseeko/ftello) under large-file support, plain
|
||||||
|
int otherwise; INTsysP is its printf conversion. */
|
||||||
#ifdef LFS_FLAG
|
#ifdef LFS_FLAG
|
||||||
typedef LLint INTsys;
|
typedef LLint INTsys;
|
||||||
|
|
||||||
@@ -309,8 +396,11 @@ typedef int INTsys;
|
|||||||
#define INTsysP "%d"
|
#define INTsysP "%d"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Socket-handle type. An unsigned integer wide enough for a Windows SOCKET;
|
||||||
|
a plain int file descriptor on POSIX. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
|
|
||||||
typedef unsigned __int64 T_SOC;
|
typedef unsigned __int64 T_SOC;
|
||||||
#else
|
#else
|
||||||
typedef unsigned __int32 T_SOC;
|
typedef unsigned __int32 T_SOC;
|
||||||
@@ -319,25 +409,35 @@ typedef unsigned __int32 T_SOC;
|
|||||||
typedef int T_SOC;
|
typedef int T_SOC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* IPV4, IPV6 and various unified structures */
|
/* Buffer size for a printed network address (IPv4 or IPv6, NUL included). */
|
||||||
#define HTS_MAXADDRLEN 64
|
#define HTS_MAXADDRLEN 64
|
||||||
|
|
||||||
|
/* Max resolved addresses kept per host for connect fallback (dead IPv6 etc.).
|
||||||
|
*/
|
||||||
|
#define HTS_MAXADDRNUM 4
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#else
|
#else
|
||||||
#define __cdecl
|
#define __cdecl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* mode pour mkdir ET chmod (accès aux fichiers) */
|
/* Permission bits for created folders and files (mkdir and chmod).
|
||||||
#define HTS_PROTECT_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
|
PROTECT_FOLDER is owner-only. With HTS_ACCESS set (the default) the ACCESS_
|
||||||
|
modes also grant group/other read; otherwise they stay owner-only. */
|
||||||
|
#define HTS_PROTECT_FOLDER (S_IRUSR | S_IWUSR | S_IXUSR)
|
||||||
|
|
||||||
#if HTS_ACCESS
|
#if HTS_ACCESS
|
||||||
#define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
|
#define HTS_ACCESS_FILE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
|
||||||
#define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
|
|
||||||
|
#define HTS_ACCESS_FOLDER \
|
||||||
|
(S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
|
||||||
#else
|
#else
|
||||||
#define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR)
|
#define HTS_ACCESS_FILE (S_IRUSR | S_IWUSR)
|
||||||
#define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
|
|
||||||
|
#define HTS_ACCESS_FOLDER (S_IRUSR | S_IWUSR | S_IXUSR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* vérifier la déclaration des variables préprocesseur */
|
/* Sanity-check that the required preprocessor switches are defined */
|
||||||
#ifndef HTS_DOSNAME
|
#ifndef HTS_DOSNAME
|
||||||
#error | HTS_DOSNAME Has not been defined.
|
#error | HTS_DOSNAME Has not been defined.
|
||||||
#error | Set it to 1 if you are under DOS, 0 under Unix.
|
#error | Set it to 1 if you are under DOS, 0 under Unix.
|
||||||
@@ -347,22 +447,26 @@ typedef int T_SOC;
|
|||||||
#error
|
#error
|
||||||
#endif
|
#endif
|
||||||
#ifndef HTS_ACCESS
|
#ifndef HTS_ACCESS
|
||||||
/* Par défaut, accès à tous les utilisateurs */
|
/* Default: files readable by all users */
|
||||||
#define HTS_ACCESS 1
|
#define HTS_ACCESS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* fflush sur stdout */
|
/* fflush sur stdout */
|
||||||
#define io_flush { fflush(stdout); fflush(stdin); }
|
#define io_flush \
|
||||||
|
{ \
|
||||||
|
fflush(stdout); \
|
||||||
|
fflush(stdin); \
|
||||||
|
}
|
||||||
|
|
||||||
/* HTSLib */
|
/* HTSLib */
|
||||||
|
|
||||||
// Cache DNS, accélère les résolution d'adresses
|
// Enable the DNS cache (speeds up address resolution)
|
||||||
#define HTS_DNSCACHE 1
|
#define HTS_DNSCACHE 1
|
||||||
|
|
||||||
// ID d'une pseudo-socket locale pour les file://
|
// Pseudo-socket id standing in for a local file:// transfer
|
||||||
#define LOCAL_SOCKET_ID -2
|
#define LOCAL_SOCKET_ID -2
|
||||||
|
|
||||||
// taille de chaque buffer (10 sockets 650 ko)
|
// Per-connection transfer buffer size, in bytes
|
||||||
#define TAILLE_BUFFER 65536
|
#define TAILLE_BUFFER 65536
|
||||||
|
|
||||||
#ifdef HTS_DO_NOT_USE_PTHREAD
|
#ifdef HTS_DO_NOT_USE_PTHREAD
|
||||||
@@ -372,7 +476,7 @@ typedef int T_SOC;
|
|||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// trace mallocs
|
// trace mallocs
|
||||||
//#define HTS_TRACE_MALLOC
|
// #define HTS_TRACE_MALLOC
|
||||||
#ifdef HTS_TRACE_MALLOC
|
#ifdef HTS_TRACE_MALLOC
|
||||||
typedef unsigned long int t_htsboundary;
|
typedef unsigned long int t_htsboundary;
|
||||||
|
|
||||||
@@ -386,6 +490,7 @@ struct mlink {
|
|||||||
int id;
|
int id;
|
||||||
struct mlink *next;
|
struct mlink *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const t_htsboundary htsboundary = 0xDEADBEEF;
|
static const t_htsboundary htsboundary = 0xDEADBEEF;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -399,7 +504,7 @@ static const t_htsboundary htsboundary = 0xDEADBEEF;
|
|||||||
/* Debugging */
|
/* Debugging */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
// débuggage types
|
// type-detection debug
|
||||||
#define DEBUG_SHOWTYPES 0
|
#define DEBUG_SHOWTYPES 0
|
||||||
// backing debug
|
// backing debug
|
||||||
#define BDEBUG 0
|
#define BDEBUG 0
|
||||||
@@ -417,28 +522,28 @@ static const t_htsboundary htsboundary = 0xDEADBEEF;
|
|||||||
#define DEBUG_ROBOTS 0
|
#define DEBUG_ROBOTS 0
|
||||||
// debug hash
|
// debug hash
|
||||||
#define DEBUG_HASH 0
|
#define DEBUG_HASH 0
|
||||||
// Vérification d'intégrité
|
// integrity-check debug
|
||||||
#define DEBUG_CHECKINT 0
|
#define DEBUG_CHECKINT 0
|
||||||
// nbr sockets debug
|
// nbr sockets debug
|
||||||
#define NSDEBUG 0
|
#define NSDEBUG 0
|
||||||
|
|
||||||
// débuggage HTSLib
|
// HTSLib debug
|
||||||
#define HDEBUG 0
|
#define HDEBUG 0
|
||||||
// surveillance de la connexion
|
// surveillance de la connexion
|
||||||
#define CNXDEBUG 0
|
#define CNXDEBUG 0
|
||||||
// debuggage cookies
|
// debuggage cookies
|
||||||
#define DEBUG_COOK 0
|
#define DEBUG_COOK 0
|
||||||
// débuggage hard..
|
// heavy/low-level debug
|
||||||
#define HTS_WIDE_DEBUG 0
|
#define HTS_WIDE_DEBUG 0
|
||||||
// debuggage deletehttp et cie
|
// debuggage deletehttp et cie
|
||||||
#define HTS_DEBUG_CLOSESOCK 0
|
#define HTS_DEBUG_CLOSESOCK 0
|
||||||
// debug tracage mémoire
|
// memory-tracing debug
|
||||||
#define MEMDEBUG 0
|
#define MEMDEBUG 0
|
||||||
|
|
||||||
// htsmain
|
// htsmain
|
||||||
#define DEBUG_STEPS 0
|
#define DEBUG_STEPS 0
|
||||||
|
|
||||||
// Débuggage de contrôle
|
// Derived debug control switches
|
||||||
#if HTS_DEBUG_CLOSESOCK
|
#if HTS_DEBUG_CLOSESOCK
|
||||||
#define _HTS_WIDE 1
|
#define _HTS_WIDE 1
|
||||||
#endif
|
#endif
|
||||||
@@ -448,7 +553,13 @@ static const t_htsboundary htsboundary = 0xDEADBEEF;
|
|||||||
#if _HTS_WIDE
|
#if _HTS_WIDE
|
||||||
extern FILE *DEBUG_fp;
|
extern FILE *DEBUG_fp;
|
||||||
|
|
||||||
#define DEBUG_W(A) { if (DEBUG_fp==NULL) DEBUG_fp=fopen("bug.out","wb"); fprintf(DEBUG_fp,":>"A); fflush(DEBUG_fp); }
|
#define DEBUG_W(A) \
|
||||||
|
{ \
|
||||||
|
if (DEBUG_fp == NULL) \
|
||||||
|
DEBUG_fp = fopen("bug.out", "wb"); \
|
||||||
|
fprintf(DEBUG_fp, ":>" A); \
|
||||||
|
fflush(DEBUG_fp); \
|
||||||
|
}
|
||||||
#undef _
|
#undef _
|
||||||
#define _ ,
|
#define _ ,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ static coucal_key key_duphandler(void *arg, coucal_key_const name) {
|
|||||||
/* Key sav hashes are using case-insensitive version */
|
/* Key sav hashes are using case-insensitive version */
|
||||||
static coucal_hashkeys key_sav_hashes(void *arg, coucal_key_const key) {
|
static coucal_hashkeys key_sav_hashes(void *arg, coucal_key_const key) {
|
||||||
hash_struct *const hash = (hash_struct*) arg;
|
hash_struct *const hash = (hash_struct*) arg;
|
||||||
convtolower(hash->catbuff, (const char*) key);
|
convtolower(hash->catbuff, sizeof(hash->catbuff), (const char *) key);
|
||||||
return coucal_hash_string(hash->catbuff);
|
return coucal_hash_string(hash->catbuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,10 +106,10 @@ static coucal_hashkeys key_adrfil_hashes_generic(void *arg,
|
|||||||
const lien_url*const lien = (const lien_url*) value;
|
const lien_url*const lien = (const lien_url*) value;
|
||||||
const char *const adr = !former ? lien->adr : lien->former_adr;
|
const char *const adr = !former ? lien->adr : lien->former_adr;
|
||||||
const char *const fil = !former ? lien->fil : lien->former_fil;
|
const char *const fil = !former ? lien->fil : lien->former_fil;
|
||||||
const char *const adr_norm = adr != NULL ?
|
const char *const adr_norm =
|
||||||
( hash->normalized ? jump_normalized_const(adr)
|
adr != NULL ? (hash->norm_host ? jump_normalized_const(adr)
|
||||||
: jump_identification_const(adr) )
|
: jump_identification_const(adr))
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
// copy address
|
// copy address
|
||||||
assertf(adr_norm != NULL);
|
assertf(adr_norm != NULL);
|
||||||
@@ -117,10 +117,18 @@ static coucal_hashkeys key_adrfil_hashes_generic(void *arg,
|
|||||||
|
|
||||||
// copy link
|
// copy link
|
||||||
assertf(fil != NULL);
|
assertf(fil != NULL);
|
||||||
if (hash->normalized) {
|
{
|
||||||
fil_normalized(fil, &hash->normfil[strlen(hash->normfil)]);
|
/* resolve the per-URL strip keys; strip applies even when urlhack is off */
|
||||||
} else {
|
char BIGSTK keybuf[HTS_URLMAXSIZE];
|
||||||
strcpy(&hash->normfil[strlen(hash->normfil)], fil);
|
const char *const keys = hts_query_strip_keys(hash->strip_query, adr, fil,
|
||||||
|
keybuf, sizeof(keybuf));
|
||||||
|
|
||||||
|
if (hash->norm_slash || hash->norm_query || keys != NULL) {
|
||||||
|
fil_normalized_filtered_ex(fil, &hash->normfil[strlen(hash->normfil)],
|
||||||
|
keys, hash->norm_slash, hash->norm_query);
|
||||||
|
} else {
|
||||||
|
strcpy(&hash->normfil[strlen(hash->normfil)], fil);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hash
|
// hash
|
||||||
@@ -132,8 +140,7 @@ static int key_adrfil_equals_generic(void *arg,
|
|||||||
coucal_key_const a_,
|
coucal_key_const a_,
|
||||||
coucal_key_const b_,
|
coucal_key_const b_,
|
||||||
const int former) {
|
const int former) {
|
||||||
hash_struct *const hash = (hash_struct*) arg;
|
hash_struct *const hash = (hash_struct *) arg;
|
||||||
const int normalized = hash->normalized;
|
|
||||||
const lien_url*const a = (const lien_url*) a_;
|
const lien_url*const a = (const lien_url*) a_;
|
||||||
const lien_url*const b = (const lien_url*) b_;
|
const lien_url*const b = (const lien_url*) b_;
|
||||||
const char *const a_adr = !former ? a->adr : a->former_adr;
|
const char *const a_adr = !former ? a->adr : a->former_adr;
|
||||||
@@ -150,10 +157,10 @@ static int key_adrfil_equals_generic(void *arg,
|
|||||||
assertf(b_fil != NULL);
|
assertf(b_fil != NULL);
|
||||||
|
|
||||||
// skip scheme and authentication to the domain (possibly without www.)
|
// skip scheme and authentication to the domain (possibly without www.)
|
||||||
ja = normalized
|
ja = hash->norm_host ? jump_normalized_const(a_adr)
|
||||||
? jump_normalized_const(a_adr) : jump_identification_const(a_adr);
|
: jump_identification_const(a_adr);
|
||||||
jb = normalized
|
jb = hash->norm_host ? jump_normalized_const(b_adr)
|
||||||
? jump_normalized_const(b_adr) : jump_identification_const(b_adr);
|
: jump_identification_const(b_adr);
|
||||||
assertf(ja != NULL);
|
assertf(ja != NULL);
|
||||||
assertf(jb != NULL);
|
assertf(jb != NULL);
|
||||||
if (strcasecmp(ja, jb) != 0) {
|
if (strcasecmp(ja, jb) != 0) {
|
||||||
@@ -161,12 +168,23 @@ static int key_adrfil_equals_generic(void *arg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now compare pathes
|
// now compare pathes
|
||||||
if (normalized) {
|
{
|
||||||
fil_normalized(a_fil, hash->normfil);
|
char BIGSTK ka[HTS_URLMAXSIZE], kb[HTS_URLMAXSIZE];
|
||||||
fil_normalized(b_fil, hash->normfil2);
|
const char *const keysa =
|
||||||
return strcmp(hash->normfil, hash->normfil2) == 0;
|
hts_query_strip_keys(hash->strip_query, a_adr, a_fil, ka, sizeof(ka));
|
||||||
} else {
|
const char *const keysb =
|
||||||
return strcmp(a_fil, b_fil) == 0;
|
hts_query_strip_keys(hash->strip_query, b_adr, b_fil, kb, sizeof(kb));
|
||||||
|
|
||||||
|
if (hash->norm_slash || hash->norm_query || keysa != NULL ||
|
||||||
|
keysb != NULL) {
|
||||||
|
fil_normalized_filtered_ex(a_fil, hash->normfil, keysa, hash->norm_slash,
|
||||||
|
hash->norm_query);
|
||||||
|
fil_normalized_filtered_ex(b_fil, hash->normfil2, keysb, hash->norm_slash,
|
||||||
|
hash->norm_query);
|
||||||
|
return strcmp(hash->normfil, hash->normfil2) == 0;
|
||||||
|
} else {
|
||||||
|
return strcmp(a_fil, b_fil) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,11 +240,17 @@ static int key_former_adrfil_equals(void *arg,
|
|||||||
return key_adrfil_equals_generic(arg, a, b, 1);
|
return key_adrfil_equals_generic(arg, a, b, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
|
void hash_init(httrackp *opt, hash_struct *hash, hts_boolean normalized) {
|
||||||
hash->sav = coucal_new(0);
|
hash->sav = coucal_new(0);
|
||||||
hash->adrfil = coucal_new(0);
|
hash->adrfil = coucal_new(0);
|
||||||
hash->former_adrfil = coucal_new(0);
|
hash->former_adrfil = coucal_new(0);
|
||||||
hash->normalized = normalized;
|
/* urlhack is the umbrella; per-feature negatives opt out of each part */
|
||||||
|
hash->norm_host = normalized && !opt->no_www_dedup;
|
||||||
|
hash->norm_slash = normalized && !opt->no_slash_dedup;
|
||||||
|
hash->norm_query = normalized && !opt->no_query_dedup;
|
||||||
|
/* snapshot the query-strip list (not owned; valid for the hash lifetime) */
|
||||||
|
hash->strip_query =
|
||||||
|
StringNotEmpty(opt->strip_query) ? StringBuff(opt->strip_query) : NULL;
|
||||||
|
|
||||||
hts_set_hash_handler(hash->sav, opt);
|
hts_set_hash_handler(hash->sav, opt);
|
||||||
hts_set_hash_handler(hash->adrfil, opt);
|
hts_set_hash_handler(hash->adrfil, opt);
|
||||||
@@ -282,6 +306,26 @@ void hash_free(hash_struct *hash) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Test helper: do the two URLs dedupe to the same key under opt's urlhack
|
||||||
|
flags? Exercises the live hash compare (norm_host/slash/query resolution). */
|
||||||
|
hts_boolean hash_url_equals(httrackp *opt, const char *adra, const char *fila,
|
||||||
|
const char *adrb, const char *filb) {
|
||||||
|
hash_struct hash;
|
||||||
|
lien_url la, lb;
|
||||||
|
hts_boolean eq;
|
||||||
|
|
||||||
|
memset(&la, 0, sizeof(la));
|
||||||
|
memset(&lb, 0, sizeof(lb));
|
||||||
|
la.adr = key_duphandler(NULL, adra);
|
||||||
|
la.fil = key_duphandler(NULL, fila);
|
||||||
|
lb.adr = key_duphandler(NULL, adrb);
|
||||||
|
lb.fil = key_duphandler(NULL, filb);
|
||||||
|
hash_init(opt, &hash, opt->urlhack);
|
||||||
|
eq = key_adrfil_equals(&hash, &la, &lb);
|
||||||
|
hash_free(&hash);
|
||||||
|
return eq;
|
||||||
|
}
|
||||||
|
|
||||||
// retour: position ou -1 si non trouvé
|
// retour: position ou -1 si non trouvé
|
||||||
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
|
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
|
||||||
hash_struct_type type) {
|
hash_struct_type type) {
|
||||||
|
|||||||
@@ -51,8 +51,12 @@ typedef enum hash_struct_type {
|
|||||||
} hash_struct_type;
|
} hash_struct_type;
|
||||||
|
|
||||||
// tables de hachage
|
// tables de hachage
|
||||||
void hash_init(httrackp *opt, hash_struct *hash, int normalized);
|
void hash_init(httrackp *opt, hash_struct *hash, hts_boolean normalized);
|
||||||
void hash_free(hash_struct *hash);
|
void hash_free(hash_struct *hash);
|
||||||
|
/* Test helper: HTS_TRUE if the two URLs dedupe together under opt's urlhack
|
||||||
|
flags. */
|
||||||
|
hts_boolean hash_url_equals(httrackp *opt, const char *adra, const char *fila,
|
||||||
|
const char *adrb, const char *filb);
|
||||||
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
|
int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
|
||||||
hash_struct_type type);
|
hash_struct_type type);
|
||||||
void hash_write(hash_struct * hash, size_t lpos);
|
void hash_write(hash_struct * hash, size_t lpos);
|
||||||
|
|||||||
@@ -152,16 +152,6 @@ void help_wizard(httrackp * opt) {
|
|||||||
#define str (buffers->str)
|
#define str (buffers->str)
|
||||||
#define argv (buffers->argv)
|
#define argv (buffers->argv)
|
||||||
|
|
||||||
//char *urls = (char *) malloct(HTS_URLMAXSIZE * 2);
|
|
||||||
//char *mainpath = (char *) malloct(256);
|
|
||||||
//char *projname = (char *) malloct(256);
|
|
||||||
//char *stropt = (char *) malloct(2048); // options
|
|
||||||
//char *stropt2 = (char *) malloct(2048); // options longues
|
|
||||||
//char *strwild = (char *) malloct(2048); // wildcards
|
|
||||||
//char *cmd = (char *) malloct(4096);
|
|
||||||
//char *str = (char *) malloct(256);
|
|
||||||
//char **argv = (char **) malloct(256 * sizeof(char *));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
char *a;
|
char *a;
|
||||||
|
|
||||||
@@ -227,8 +217,6 @@ void help_wizard(httrackp * opt) {
|
|||||||
strcatbuff(stropt2, str);
|
strcatbuff(stropt2, str);
|
||||||
strcatbuff(stropt2, projname);
|
strcatbuff(stropt2, projname);
|
||||||
strcatbuff(stropt2, "\" ");
|
strcatbuff(stropt2, "\" ");
|
||||||
// Créer si ce n'est fait un index.html 1er niveau
|
|
||||||
make_empty_index(str);
|
|
||||||
//
|
//
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Enter URLs (separated by commas or blank spaces) :");
|
printf("Enter URLs (separated by commas or blank spaces) :");
|
||||||
@@ -349,8 +337,6 @@ void help_wizard(httrackp * opt) {
|
|||||||
}
|
}
|
||||||
hts_main(argc, argv);
|
hts_main(argc, argv);
|
||||||
}
|
}
|
||||||
//} else {
|
|
||||||
// help("httrack",1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free buffers */
|
/* Free buffers */
|
||||||
@@ -455,23 +441,6 @@ void help_catchurl(const char *dest_path) {
|
|||||||
printf("Unable to create a temporary proxy (no remaining port)\n");
|
printf("Unable to create a temporary proxy (no remaining port)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Créer un index.html vide
|
|
||||||
void make_empty_index(const char *str) {
|
|
||||||
#if 0
|
|
||||||
if (!fexist(fconcat(str, "index.html"))) {
|
|
||||||
FILE *fp = fopen(fconcat(str, "index.html"), "wb");
|
|
||||||
|
|
||||||
if (fp) {
|
|
||||||
fprintf(fp, "<!-- " HTS_TOPINDEX " -->" CRLF);
|
|
||||||
fprintf(fp,
|
|
||||||
"<HTML><BODY>Index is empty!<BR>(File used to index all HTTrack projects)</BODY></HTML>"
|
|
||||||
CRLF);
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// mini-aide (h: help)
|
// mini-aide (h: help)
|
||||||
// y
|
// y
|
||||||
void help(const char *app, int more) {
|
void help(const char *app, int more) {
|
||||||
@@ -521,6 +490,7 @@ void help(const char *app, int more) {
|
|||||||
infomsg(" EN maximum mirror time in seconds (60=1 minute, 3600=1 hour)");
|
infomsg(" EN maximum mirror time in seconds (60=1 minute, 3600=1 hour)");
|
||||||
infomsg(" AN maximum transfer rate in bytes/seconds (1000=1KB/s max)");
|
infomsg(" AN maximum transfer rate in bytes/seconds (1000=1KB/s max)");
|
||||||
infomsg(" %cN maximum number of connections/seconds (*%c10)");
|
infomsg(" %cN maximum number of connections/seconds (*%c10)");
|
||||||
|
infomsg(" %G random pause of MIN[:MAX] seconds between files (e.g. %G5:10)");
|
||||||
infomsg
|
infomsg
|
||||||
(" GN pause transfer if N bytes reached, and wait until lock file is deleted");
|
(" GN pause transfer if N bytes reached, and wait until lock file is deleted");
|
||||||
infomsg("");
|
infomsg("");
|
||||||
@@ -563,6 +533,7 @@ void help(const char *app, int more) {
|
|||||||
(" %x do not include any password for external password protected websites (%x0 include)");
|
(" %x do not include any password for external password protected websites (%x0 include)");
|
||||||
infomsg
|
infomsg
|
||||||
(" %q *include query string for local files (useless, for information purpose only) (%q0 don't include)");
|
(" %q *include query string for local files (useless, for information purpose only) (%q0 don't include)");
|
||||||
|
infomsg(" %g strip query keys for dedup ([host/pattern=]key1,key2,...)");
|
||||||
infomsg
|
infomsg
|
||||||
(" o *generate output html file in case of error (404..) (o0 don't generate)");
|
(" o *generate output html file in case of error (404..) (o0 don't generate)");
|
||||||
infomsg(" X *purge old files after update (X0 keep delete)");
|
infomsg(" X *purge old files after update (X0 keep delete)");
|
||||||
@@ -571,6 +542,7 @@ void help(const char *app, int more) {
|
|||||||
infomsg("");
|
infomsg("");
|
||||||
infomsg("Spider options:");
|
infomsg("Spider options:");
|
||||||
infomsg(" bN accept cookies in cookies.txt (0=do not accept,* 1=accept)");
|
infomsg(" bN accept cookies in cookies.txt (0=do not accept,* 1=accept)");
|
||||||
|
infomsg(" %K load extra cookies from a Netscape cookies.txt");
|
||||||
infomsg
|
infomsg
|
||||||
(" u check document type if unknown (cgi,asp..) (u0 don't check, * u1 check but /, u2 check always)");
|
(" u check document type if unknown (cgi,asp..) (u0 don't check, * u1 check but /, u2 check always)");
|
||||||
infomsg
|
infomsg
|
||||||
@@ -587,6 +559,9 @@ void help(const char *app, int more) {
|
|||||||
(" %s update hacks: various hacks to limit re-transfers when updating (identical size, bogus response..)");
|
(" %s update hacks: various hacks to limit re-transfers when updating (identical size, bogus response..)");
|
||||||
infomsg
|
infomsg
|
||||||
(" %u url hacks: various hacks to limit duplicate URLs (strip //, www.foo.com==foo.com..)");
|
(" %u url hacks: various hacks to limit duplicate URLs (strip //, www.foo.com==foo.com..)");
|
||||||
|
infomsg(" opt out of one url-hack part: --keep-www-prefix "
|
||||||
|
"(www.foo.com<>foo.com), --keep-double-slashes (//), "
|
||||||
|
"--keep-query-order (?b&a)");
|
||||||
infomsg
|
infomsg
|
||||||
(" %A assume that a type (cgi,asp..) is always linked with a mime type (-%A php3,cgi=text/html;dat,bin=application/x-zip)");
|
(" %A assume that a type (cgi,asp..) is always linked with a mime type (-%A php3,cgi=text/html;dat,bin=application/x-zip)");
|
||||||
infomsg(" shortcut: '--assume standard' is equivalent to -%A "
|
infomsg(" shortcut: '--assume standard' is equivalent to -%A "
|
||||||
@@ -646,9 +621,7 @@ void help(const char *app, int more) {
|
|||||||
infomsg("");
|
infomsg("");
|
||||||
infomsg("Guru options: (do NOT use if possible)");
|
infomsg("Guru options: (do NOT use if possible)");
|
||||||
infomsg(" #X *use optimized engine (limited memory boundary checks)");
|
infomsg(" #X *use optimized engine (limited memory boundary checks)");
|
||||||
infomsg(" #0 filter test (-#0 '*.gif' 'www.bar.com/foo.gif')");
|
infomsg(" #test list engine self-tests (run one with -#test=NAME [args])");
|
||||||
infomsg(" #1 simplify test (-#1 ./foo/bar/../foobar)");
|
|
||||||
infomsg(" #2 type test (-#2 /foo/bar.php)");
|
|
||||||
infomsg(" #C cache list (-#C '*.com/spider*.gif'");
|
infomsg(" #C cache list (-#C '*.com/spider*.gif'");
|
||||||
infomsg(" #R cache repair (damaged cache)");
|
infomsg(" #R cache repair (damaged cache)");
|
||||||
infomsg(" #d debug parser");
|
infomsg(" #d debug parser");
|
||||||
@@ -804,7 +777,4 @@ void help(const char *app, int more) {
|
|||||||
infomsg("[compiled: " HTS_PLATFORM_NAME "]");
|
infomsg("[compiled: " HTS_PLATFORM_NAME "]");
|
||||||
#endif
|
#endif
|
||||||
infomsg(NULL);
|
infomsg(NULL);
|
||||||
|
|
||||||
// infomsg(" R *relative links (e.g ../link)\n");
|
|
||||||
// infomsg(" A absolute links (e.g /www.adr/link)\n");
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ typedef struct httrackp httrackp;
|
|||||||
|
|
||||||
void infomsg(const char *msg);
|
void infomsg(const char *msg);
|
||||||
void help(const char *app, int more);
|
void help(const char *app, int more);
|
||||||
void make_empty_index(const char *str);
|
|
||||||
void help_wizard(httrackp * opt);
|
void help_wizard(httrackp * opt);
|
||||||
int help_query(const char *list, int def);
|
int help_query(const char *list, int def);
|
||||||
void help_catchurl(const char *dest_path);
|
void help_catchurl(const char *dest_path);
|
||||||
|
|||||||
@@ -142,8 +142,6 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
|
|||||||
char keyword[KEYW_LEN + 32];
|
char keyword[KEYW_LEN + 32];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
//
|
|
||||||
//int WordIndexSize = 1024;
|
|
||||||
coucal WordIndexHash = NULL;
|
coucal WordIndexHash = NULL;
|
||||||
FILE *tmpfp = NULL;
|
FILE *tmpfp = NULL;
|
||||||
|
|
||||||
@@ -178,8 +176,6 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
|
|||||||
|| (strfield2(mime, "text/css"))
|
|| (strfield2(mime, "text/css"))
|
||||||
) {
|
) {
|
||||||
inscript = 1;
|
inscript = 1;
|
||||||
//} else if (strfield2(mime, "text/vnd.wap.wml")) { // humm won't work in many cases
|
|
||||||
// inscript=0;
|
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -275,8 +271,6 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
|
|||||||
|
|
||||||
// Process indexing for this page
|
// Process indexing for this page
|
||||||
{
|
{
|
||||||
//FILE* fp=NULL;
|
|
||||||
//fp=fopen(concat(indexpath,"index.txt"),"ab");
|
|
||||||
if (fp_tmpproject) {
|
if (fp_tmpproject) {
|
||||||
while(!feof(tmpfp)) {
|
while(!feof(tmpfp)) {
|
||||||
char line[KEYW_LEN + 32];
|
char line[KEYW_LEN + 32];
|
||||||
@@ -286,7 +280,6 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
|
|||||||
intptr_t e = 0;
|
intptr_t e = 0;
|
||||||
|
|
||||||
if (coucal_read(WordIndexHash, line, &e)) {
|
if (coucal_read(WordIndexHash, line, &e)) {
|
||||||
//if (e) {
|
|
||||||
char BIGSTK savelst[HTS_URLMAXSIZE * 2];
|
char BIGSTK savelst[HTS_URLMAXSIZE * 2];
|
||||||
|
|
||||||
e++; /* 0 means "once" */
|
e++; /* 0 means "once" */
|
||||||
@@ -300,11 +293,9 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
|
|||||||
fprintf(fp_tmpproject, "%s %d %s\n", line,
|
fprintf(fp_tmpproject, "%s %d %s\n", line,
|
||||||
(int) (KEYW_SORT_MAXCOUNT - e), savelst);
|
(int) (KEYW_SORT_MAXCOUNT - e), savelst);
|
||||||
hts_primindex_size++;
|
hts_primindex_size++;
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fclose(fp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +321,6 @@ void index_finish(const char *indexpath, int mode) {
|
|||||||
off_t size = fpsize(fp_tmpproject);
|
off_t size = fpsize(fp_tmpproject);
|
||||||
|
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
//FILE* fp=fopen(concat(indexpath,"index.txt"),"rb");
|
|
||||||
if (fp_tmpproject) {
|
if (fp_tmpproject) {
|
||||||
tab = (char **) malloct(sizeof(char *) * (hts_primindex_size + 2));
|
tab = (char **) malloct(sizeof(char *) * (hts_primindex_size + 2));
|
||||||
if (tab) {
|
if (tab) {
|
||||||
@@ -398,8 +388,6 @@ void index_finish(const char *indexpath, int mode) {
|
|||||||
if (total_hit) {
|
if (total_hit) {
|
||||||
if (mode == 1) // TEXT
|
if (mode == 1) // TEXT
|
||||||
fprintf(fp, "\t=%d\r\n", total_hit);
|
fprintf(fp, "\t=%d\r\n", total_hit);
|
||||||
//else // HTML
|
|
||||||
// fprintf(fp,"<br>(%d total hits)\r\n",total_hit);
|
|
||||||
if ((((total_hit * 1000) / hts_primindex_words) >=
|
if ((((total_hit * 1000) / hts_primindex_words) >=
|
||||||
KEYW_USELESS1K)
|
KEYW_USELESS1K)
|
||||||
|| (((total_line * 1000) / index) >=
|
|| (((total_line * 1000) / index) >=
|
||||||
@@ -416,8 +404,6 @@ void index_finish(const char *indexpath, int mode) {
|
|||||||
if (mode == 1) // TEXT
|
if (mode == 1) // TEXT
|
||||||
fprintf(fp, "\t(%d)\r\n",
|
fprintf(fp, "\t(%d)\r\n",
|
||||||
((total_hit * 1000) / hts_primindex_words));
|
((total_hit * 1000) / hts_primindex_words));
|
||||||
//else // HTML
|
|
||||||
// fprintf(fp,"(%d)\r\n",((total_hit*1000)/hts_primindex_words));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mode == 1) // TEXT
|
if (mode == 1) // TEXT
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* This file */
|
/* This file */
|
||||||
#include "htsjava.h"
|
#include "htsjava.h"
|
||||||
|
|
||||||
|
/* calloct/freet wrappers */
|
||||||
|
#include "htssafe.h"
|
||||||
|
|
||||||
static int reverse_endian(void) {
|
static int reverse_endian(void) {
|
||||||
int endian = 1;
|
int endian = 1;
|
||||||
|
|
||||||
@@ -172,15 +175,14 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
#if JAVADEBUG
|
#if JAVADEBUG
|
||||||
printf("fopen\n");
|
printf("fopen\n");
|
||||||
#endif
|
#endif
|
||||||
if ((fpout = FOPEN(fconv(catbuff, sizeof(catbuff), file), "r+b")) == NULL) {
|
if ((fpout = FOPEN(fconv(catbuff, sizeof(catbuff), file), "r+b")) ==
|
||||||
//fprintf(stderr, "Cannot open input file.\n");
|
NULL) {
|
||||||
sprintf(str->err_msg, "Unable to open file %s", file);
|
sprintf(str->err_msg, "Unable to open file %s", file);
|
||||||
return 0; // une erreur..
|
return 0; // une erreur..
|
||||||
}
|
}
|
||||||
#if JAVADEBUG
|
#if JAVADEBUG
|
||||||
printf("fread\n");
|
printf("fread\n");
|
||||||
#endif
|
#endif
|
||||||
//if (fread(&header,1,sizeof(JAVA_HEADER),fpout) != sizeof(JAVA_HEADER)) { // pas complet..
|
|
||||||
if (fread(&header, 1, 10, fpout) != 10) { // pas complet..
|
if (fread(&header, 1, 10, fpout) != 10) { // pas complet..
|
||||||
fclose(fpout);
|
fclose(fpout);
|
||||||
sprintf(str->err_msg, "File header too small (file len = " LLintP ")",
|
sprintf(str->err_msg, "File header too small (file len = " LLintP ")",
|
||||||
@@ -204,7 +206,16 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tab = (RESP_STRUCT *) calloc(header.count, sizeof(RESP_STRUCT));
|
/* A constant-pool entry is >= 1 byte on disk; reject a count exceeding
|
||||||
|
the file size (hostile .class ~68 MB alloc DoS). */
|
||||||
|
if (!hts_count_fits(header.count, (LLint) fsize(file))) {
|
||||||
|
fclose(fpout);
|
||||||
|
sprintf(str->err_msg,
|
||||||
|
"Invalid constant pool count %u (file len " LLintP ")",
|
||||||
|
(unsigned) header.count, (LLint) fsize(file));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
tab = (RESP_STRUCT *) calloct(header.count, sizeof(RESP_STRUCT));
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
sprintf(str->err_msg, "Unable to alloc %d bytes",
|
sprintf(str->err_msg, "Unable to alloc %d bytes",
|
||||||
(int) sizeof(RESP_STRUCT));
|
(int) sizeof(RESP_STRUCT));
|
||||||
@@ -230,7 +241,7 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
} else { // ++ une erreur est survenue!
|
} else { // ++ une erreur est survenue!
|
||||||
if (strnotempty(str->err_msg) == 0)
|
if (strnotempty(str->err_msg) == 0)
|
||||||
strcpy(str->err_msg, "Internal readtable error");
|
strcpy(str->err_msg, "Internal readtable error");
|
||||||
free(tab);
|
freet(tab);
|
||||||
if (fpout) {
|
if (fpout) {
|
||||||
fclose(fpout);
|
fclose(fpout);
|
||||||
fpout = NULL;
|
fpout = NULL;
|
||||||
@@ -245,12 +256,10 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
printf("addfiles\n");
|
printf("addfiles\n");
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
//unsigned int acess;
|
|
||||||
unsigned int Class;
|
unsigned int Class;
|
||||||
unsigned int SClass;
|
unsigned int SClass;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//acess = readshort(fpout);
|
|
||||||
Class = readshort(fpout);
|
Class = readshort(fpout);
|
||||||
SClass = readshort(fpout);
|
SClass = readshort(fpout);
|
||||||
|
|
||||||
@@ -288,7 +297,7 @@ static int hts_parse_java(t_hts_callbackarg * carg, httrackp * opt,
|
|||||||
#if JAVADEBUG
|
#if JAVADEBUG
|
||||||
printf("end\n");
|
printf("end\n");
|
||||||
#endif
|
#endif
|
||||||
free(tab);
|
freet(tab);
|
||||||
if (fpout) {
|
if (fpout) {
|
||||||
fclose(fpout);
|
fclose(fpout);
|
||||||
fpout = NULL;
|
fpout = NULL;
|
||||||
@@ -395,11 +404,9 @@ static RESP_STRUCT readtable(htsmoduleStruct * str, FILE * fp,
|
|||||||
|
|
||||||
p = &buffer[0];
|
p = &buffer[0];
|
||||||
|
|
||||||
//fflush(fp);
|
|
||||||
trans.file_position = ftell(fp);
|
trans.file_position = ftell(fp);
|
||||||
length = readshort(fp);
|
length = readshort(fp);
|
||||||
if (length < HTS_URLMAXSIZE) {
|
if (length < HTS_URLMAXSIZE) {
|
||||||
// while ((length > 0) && (length<500)) {
|
|
||||||
while(length > 0) {
|
while(length > 0) {
|
||||||
*p++ = fgetc(fp);
|
*p++ = fgetc(fp);
|
||||||
|
|
||||||
@@ -407,17 +414,13 @@ static RESP_STRUCT readtable(htsmoduleStruct * str, FILE * fp,
|
|||||||
}
|
}
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
//#if JDEBUG
|
|
||||||
// if(tris(buffer)==1) printf("%s\n ",buffer);
|
|
||||||
// if(tris(buffer)==2) printf("%s\n ",printname(buffer));
|
|
||||||
//#endif
|
|
||||||
if (tris(str->opt, buffer) == 1)
|
if (tris(str->opt, buffer) == 1)
|
||||||
str->addLink(str, buffer); /* trans.file_position */
|
str->addLink(str, buffer); /* trans.file_position */
|
||||||
else if (tris(str->opt, buffer) == 2)
|
else if (tris(str->opt, buffer) == 2)
|
||||||
str->addLink(str, printname(rname, buffer));
|
str->addLink(str, printname(rname, buffer));
|
||||||
|
|
||||||
strcpy(trans.name, buffer);
|
strcpy(trans.name, buffer);
|
||||||
} else { // gros pb
|
} else { // gros pb
|
||||||
while((length > 0) && (!feof(fp))) {
|
while((length > 0) && (!feof(fp))) {
|
||||||
fgetc(fp);
|
fgetc(fp);
|
||||||
length--;
|
length--;
|
||||||
@@ -433,7 +436,6 @@ static RESP_STRUCT readtable(htsmoduleStruct * str, FILE * fp,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// printf("Type inconnue\n");
|
|
||||||
// on arrête tout
|
// on arrête tout
|
||||||
sprintf(str->err_msg, "Internal structure unknown (type %d)", trans.type);
|
sprintf(str->err_msg, "Internal structure unknown (type %d)", trans.type);
|
||||||
*error = 1;
|
*error = 1;
|
||||||
@@ -472,9 +474,8 @@ static int tris(httrackp * opt, char *buffer) {
|
|||||||
{
|
{
|
||||||
char type[256];
|
char type[256];
|
||||||
|
|
||||||
type[0] = '\0';
|
if (get_httptype_sized(opt, type, sizeof(type), buffer,
|
||||||
get_httptype(opt, type, buffer, 0);
|
0)) // recognized type
|
||||||
if (strnotempty(type)) // type reconnu!
|
|
||||||
return 1;
|
return 1;
|
||||||
// ajout RX 05/2001
|
// ajout RX 05/2001
|
||||||
else if (is_dyntype(get_ext(catbuff, sizeof(catbuff), buffer))) // asp,cgi...
|
else if (is_dyntype(get_ext(catbuff, sizeof(catbuff), buffer))) // asp,cgi...
|
||||||
@@ -497,7 +498,6 @@ static char *printname(char rname[1024], char name[1024]) {
|
|||||||
return rname; // ""
|
return rname; // ""
|
||||||
}
|
}
|
||||||
p += 2;
|
p += 2;
|
||||||
//rname=(char*)calloct(strlen(name)+8,sizeof(char));
|
|
||||||
p1 = rname;
|
p1 = rname;
|
||||||
for(j = 0; name[j] != '\0'; j++, p++) {
|
for(j = 0; name[j] != '\0'; j++, p++) {
|
||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
|
|||||||
@@ -33,15 +33,19 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#ifndef HTSJAVA_DEFH
|
#ifndef HTSJAVA_DEFH
|
||||||
#define HTSJAVA_DEFH
|
#define HTSJAVA_DEFH
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_JAVA_HEADER
|
#ifndef HTS_DEF_FWSTRUCT_JAVA_HEADER
|
||||||
#define HTS_DEF_FWSTRUCT_JAVA_HEADER
|
#define HTS_DEF_FWSTRUCT_JAVA_HEADER
|
||||||
typedef struct JAVA_HEADER JAVA_HEADER;
|
typedef struct JAVA_HEADER JAVA_HEADER;
|
||||||
#endif
|
#endif
|
||||||
|
/* 10-byte on-disk .class header image, fread() directly: fields need exact
|
||||||
|
widths (LP64's 8-byte 'unsigned long' magic never matched 0xCAFEBABE). */
|
||||||
struct JAVA_HEADER {
|
struct JAVA_HEADER {
|
||||||
unsigned long int magic;
|
uint32_t magic;
|
||||||
unsigned short int minor;
|
uint16_t minor;
|
||||||
unsigned short int major;
|
uint16_t major;
|
||||||
unsigned short int count;
|
uint16_t count;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_RESP_STRUCT
|
#ifndef HTS_DEF_FWSTRUCT_RESP_STRUCT
|
||||||
|
|||||||
1543
src/htslib.c
1543
src/htslib.c
File diff suppressed because it is too large
Load Diff
88
src/htslib.h
88
src/htslib.h
@@ -147,11 +147,13 @@ struct OLD_htsblk {
|
|||||||
#define HTS_DEF_FWSTRUCT_t_dnscache
|
#define HTS_DEF_FWSTRUCT_t_dnscache
|
||||||
typedef struct t_dnscache t_dnscache;
|
typedef struct t_dnscache t_dnscache;
|
||||||
#endif
|
#endif
|
||||||
|
// One DNS cache record, stored as a coucal value keyed by hostname.
|
||||||
struct t_dnscache {
|
struct t_dnscache {
|
||||||
struct t_dnscache *next;
|
// resolved addresses, in resolver (RFC 6724) order; host_count==0 means the
|
||||||
const char *iadr;
|
// name does not resolve (negative cache). host_count<=HTS_MAXADDRNUM.
|
||||||
size_t host_length; // length ; (4 or 16) ; 0 for error
|
int host_count;
|
||||||
char host_addr[HTS_MAXADDRLEN];
|
size_t host_length[HTS_MAXADDRNUM]; // sockaddr length of each (16 or 28)
|
||||||
|
char host_addr[HTS_MAXADDRNUM][HTS_MAXADDRLEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library internal definictions */
|
||||||
@@ -169,7 +171,6 @@ HTSEXT_API const char* hts_version(void);
|
|||||||
// fonctions unix/winsock
|
// fonctions unix/winsock
|
||||||
int hts_read(htsblk * r, char *buff, int size);
|
int hts_read(htsblk * r, char *buff, int size);
|
||||||
|
|
||||||
//int HTS_TOTAL_RECV_CHECK(int var);
|
|
||||||
LLint check_downloadable_bytes(int rate);
|
LLint check_downloadable_bytes(int rate);
|
||||||
|
|
||||||
HTSEXT_API int hts_uninit_module(void);
|
HTSEXT_API int hts_uninit_module(void);
|
||||||
@@ -182,10 +183,21 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode, const char *xsend
|
|||||||
const char *adr, const char *fil,
|
const char *adr, const char *fil,
|
||||||
const char *referer_adr, const char *referer_fil,
|
const char *referer_adr, const char *referer_fil,
|
||||||
htsblk * retour);
|
htsblk * retour);
|
||||||
|
/* Build the request "Cookie:" header line for stored cookies matching
|
||||||
|
domain/path into dst (NUL-terminated). Exposed for the -#Q self-test;
|
||||||
|
wraps the same logic http_sendhead() uses. Returns cookies emitted. */
|
||||||
|
int http_cookie_header_selftest(t_cookie *cookie, const char *domain,
|
||||||
|
const char *path, char *dst, size_t dst_size);
|
||||||
|
|
||||||
//int newhttp(char* iadr,char* err=NULL);
|
|
||||||
T_SOC newhttp(httrackp * opt, const char *iadr, htsblk * retour, int port,
|
T_SOC newhttp(httrackp * opt, const char *iadr, htsblk * retour, int port,
|
||||||
int waitconnect);
|
int waitconnect);
|
||||||
|
/* Like newhttp(), but connect to the addr_index-th resolved address of the host
|
||||||
|
(0-based) instead of always the first; *addr_count, if non-NULL, is set to
|
||||||
|
the total resolved addresses. newhttp() == newhttp_addr(...,0,NULL). Used by
|
||||||
|
the slot scheduler to try the next address when a connect fails (dead IPv6
|
||||||
|
etc.). */
|
||||||
|
T_SOC newhttp_addr(httrackp *opt, const char *iadr, htsblk *retour, int port,
|
||||||
|
int waitconnect, int addr_index, int *addr_count);
|
||||||
HTS_INLINE void deletehttp(htsblk * r);
|
HTS_INLINE void deletehttp(htsblk * r);
|
||||||
HTS_INLINE int deleteaddr(htsblk * r);
|
HTS_INLINE int deleteaddr(htsblk * r);
|
||||||
HTS_INLINE void deletesoc(T_SOC soc);
|
HTS_INLINE void deletesoc(T_SOC soc);
|
||||||
@@ -193,15 +205,31 @@ HTS_INLINE void deletesoc_r(htsblk * r);
|
|||||||
htsblk http_test(httrackp * opt, const char *adr, const char *fil, char *loc);
|
htsblk http_test(httrackp * opt, const char *adr, const char *fil, char *loc);
|
||||||
int check_readinput(htsblk * r);
|
int check_readinput(htsblk * r);
|
||||||
int check_readinput_t(T_SOC soc, int timeout);
|
int check_readinput_t(T_SOC soc, int timeout);
|
||||||
|
int check_writeinput_t(T_SOC soc, int timeout);
|
||||||
|
|
||||||
|
/* Open an HTTP CONNECT tunnel through the active proxy for an https request:
|
||||||
|
`retour->soc` must already be TCP-connected to the proxy, and `adr` is the
|
||||||
|
origin authority (url_adr, e.g. "https://host:port"). Sends the CONNECT
|
||||||
|
request (with Proxy-Authorization when the proxy carries credentials) and
|
||||||
|
reads the proxy's status line, so the caller's TLS handshake then runs
|
||||||
|
end-to-end with the origin. Blocks up to `timeout` seconds. Returns 1 on a
|
||||||
|
2xx tunnel, 0 on failure (retour->msg/statuscode set). */
|
||||||
|
int http_proxy_tunnel(httrackp *opt, htsblk *retour, const char *adr,
|
||||||
|
int timeout);
|
||||||
void treathead(t_cookie * cookie, const char *adr, const char *fil, htsblk * retour,
|
void treathead(t_cookie * cookie, const char *adr, const char *fil, htsblk * retour,
|
||||||
char *rcvd);
|
char *rcvd);
|
||||||
void treatfirstline(htsblk * retour, const char *rcvd);
|
void treatfirstline(htsblk * retour, const char *rcvd);
|
||||||
|
|
||||||
// sous-fonctions
|
// sous-fonctions
|
||||||
LLint http_xfread1(htsblk * r, int bufl);
|
LLint http_xfread1(htsblk * r, int bufl);
|
||||||
HTS_INLINE SOCaddr* hts_dns_resolve2(httrackp * opt, const char *iadr,
|
/* Cached resolver: fill out[0..count-1] with up to max addresses for iadr (in
|
||||||
SOCaddr *const addr,
|
resolver order), returning the count (0 = does not resolve, negative-cached).
|
||||||
const char **error);
|
Resolves once per host; later calls read the DNS cache. Must hold no lock
|
||||||
|
(brackets opt->state.lock itself). */
|
||||||
|
int hts_dns_resolve_all(httrackp *opt, const char *iadr, SOCaddr *out, int max,
|
||||||
|
const char **error);
|
||||||
|
HTS_INLINE SOCaddr *hts_dns_resolve2(httrackp *opt, const char *iadr,
|
||||||
|
SOCaddr *const addr, const char **error);
|
||||||
HTS_INLINE SOCaddr* hts_dns_resolve(httrackp * opt, const char *iadr,
|
HTS_INLINE SOCaddr* hts_dns_resolve(httrackp * opt, const char *iadr,
|
||||||
SOCaddr *const addr);
|
SOCaddr *const addr);
|
||||||
HTSEXT_API SOCaddr* hts_dns_resolve_nocache2(const char *const hostname,
|
HTSEXT_API SOCaddr* hts_dns_resolve_nocache2(const char *const hostname,
|
||||||
@@ -214,8 +242,9 @@ HTSEXT_API int check_hostname_dns(const char *const hostname);
|
|||||||
int ftp_available(void);
|
int ftp_available(void);
|
||||||
|
|
||||||
#if HTS_DNSCACHE
|
#if HTS_DNSCACHE
|
||||||
void hts_cache_free(t_dnscache *const cache);
|
/* Return opt's DNS cache hashtable (hostname -> t_dnscache record), creating it
|
||||||
t_dnscache *hts_cache(httrackp * opt);
|
on first use. Records are owned by the table and freed on coucal_delete. */
|
||||||
|
coucal hts_cache(httrackp *opt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// outils divers
|
// outils divers
|
||||||
@@ -252,7 +281,10 @@ int ishtml_ext(const char *a);
|
|||||||
int ishttperror(int err);
|
int ishttperror(int err);
|
||||||
|
|
||||||
int get_userhttptype(httrackp * opt, char *s, const char *fil);
|
int get_userhttptype(httrackp * opt, char *s, const char *fil);
|
||||||
void give_mimext(char *s, const char *st);
|
int give_mimext(char *s, size_t ssize, const char *st);
|
||||||
|
|
||||||
|
/* Advertised Accept-Encoding value (no header name/CRLF); see htslib.c. */
|
||||||
|
const char *hts_acceptencoding(hts_boolean compressible);
|
||||||
|
|
||||||
int may_bogus_multiple(httrackp * opt, const char *mime, const char *filename);
|
int may_bogus_multiple(httrackp * opt, const char *mime, const char *filename);
|
||||||
int may_unknown2(httrackp * opt, const char *mime, const char *filename);
|
int may_unknown2(httrackp * opt, const char *mime, const char *filename);
|
||||||
@@ -264,7 +296,7 @@ void code64(unsigned char *a, int size_a, unsigned char *b, int crlf);
|
|||||||
|
|
||||||
#define copychar(catbuff,a) concat(catbuff,(a),NULL)
|
#define copychar(catbuff,a) concat(catbuff,(a),NULL)
|
||||||
|
|
||||||
char *convtolower(char *catbuff, const char *a);
|
char *convtolower(char *catbuff, size_t catbuffsize, const char *a);
|
||||||
void hts_lowcase(char *s);
|
void hts_lowcase(char *s);
|
||||||
void hts_replace(char *s, char from, char to);
|
void hts_replace(char *s, char from, char to);
|
||||||
int multipleStringMatch(const char *s, const char *match);
|
int multipleStringMatch(const char *s, const char *match);
|
||||||
@@ -276,7 +308,8 @@ void fprintfio(FILE * fp, const char *buff, const char *prefix);
|
|||||||
int sig_ignore_flag(int setflag); // flag ignore
|
int sig_ignore_flag(int setflag); // flag ignore
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cut_path(char *fullpath, char *path, char *pname);
|
void cut_path(char *fullpath, char *path, size_t path_size, char *pname,
|
||||||
|
size_t pname_size);
|
||||||
int fexist(const char *s);
|
int fexist(const char *s);
|
||||||
int fexist_utf8(const char *s);
|
int fexist_utf8(const char *s);
|
||||||
|
|
||||||
@@ -464,10 +497,22 @@ HTS_STATIC int strcmpnocase(const char *a, const char *b) {
|
|||||||
|
|
||||||
// is this MIME an hypertext MIME (text/html), html/js-style or other script/text type?
|
// is this MIME an hypertext MIME (text/html), html/js-style or other script/text type?
|
||||||
#define HTS_HYPERTEXT_DEFAULT_MIME "text/html"
|
#define HTS_HYPERTEXT_DEFAULT_MIME "text/html"
|
||||||
|
/* Sentinel stored when the server declared no Content-Type. It is html-ish
|
||||||
|
for every type test (so a typeless response still parses/stores as today),
|
||||||
|
but the naming code (wire_patches_ext) treats it as "no declared type" and
|
||||||
|
keeps the URL extension. It rides the cache, so updates name consistently. */
|
||||||
|
#define HTS_UNKNOWN_MIME "unknown/unknown"
|
||||||
|
/* Map the no-declared-type sentinel back to a real type for any header or
|
||||||
|
record we EMIT or PERSIST, so "unknown/unknown" never reaches a consumer
|
||||||
|
(a served Content-Type, a ProxyTrack .arc record, ...). */
|
||||||
|
#define hts_effective_mime(m) \
|
||||||
|
(strfield2((m), HTS_UNKNOWN_MIME) ? HTS_HYPERTEXT_DEFAULT_MIME : (m))
|
||||||
|
|
||||||
#define is_html_mime_type(a) \
|
#define is_html_mime_type(a) \
|
||||||
( (strfield2((a),"text/html")!=0)\
|
((strfield2((a), "text/html") != 0) || \
|
||||||
|| (strfield2((a),"application/xhtml+xml")!=0) \
|
(strfield2((a), "application/xhtml+xml") != 0) || \
|
||||||
|
(strfield2((a), HTS_UNKNOWN_MIME) != \
|
||||||
|
0) /* no declared type: treat as html */ \
|
||||||
)
|
)
|
||||||
#define is_hypertext_mime__(a) \
|
#define is_hypertext_mime__(a) \
|
||||||
( \
|
( \
|
||||||
@@ -499,7 +544,8 @@ HTS_STATIC int is_hypertext_mime(httrackp * opt, const char *mime,
|
|||||||
char guessed[256];
|
char guessed[256];
|
||||||
|
|
||||||
guessed[0] = '\0';
|
guessed[0] = '\0';
|
||||||
guess_httptype(opt, guessed, file);
|
if (!guess_httptype_sized(opt, guessed, sizeof(guessed), file))
|
||||||
|
return 0;
|
||||||
return is_hypertext_mime__(guessed);
|
return is_hypertext_mime__(guessed);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -514,7 +560,8 @@ HTS_STATIC int may_be_hypertext_mime(httrackp * opt, const char *mime,
|
|||||||
char guessed[256];
|
char guessed[256];
|
||||||
|
|
||||||
guessed[0] = '\0';
|
guessed[0] = '\0';
|
||||||
guess_httptype(opt, guessed, file);
|
if (!guess_httptype_sized(opt, guessed, sizeof(guessed), file))
|
||||||
|
return 0;
|
||||||
return may_be_hypertext_mime__(guessed);
|
return may_be_hypertext_mime__(guessed);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -529,7 +576,8 @@ HTS_STATIC int compare_mime(httrackp * opt, const char *mime, const char *file,
|
|||||||
char guessed[256];
|
char guessed[256];
|
||||||
|
|
||||||
guessed[0] = '\0';
|
guessed[0] = '\0';
|
||||||
guess_httptype(opt, guessed, file);
|
if (!guess_httptype_sized(opt, guessed, sizeof(guessed), file))
|
||||||
|
return 0;
|
||||||
return strfield2(guessed, reference);
|
return strfield2(guessed, reference);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -55,12 +55,6 @@ extern int fspc(httrackp * opt, FILE * fp, const char *type);
|
|||||||
|
|
||||||
/* >>> Put all modules variables here */
|
/* >>> Put all modules variables here */
|
||||||
|
|
||||||
#if 0
|
|
||||||
t_gzopen gzopen = NULL;
|
|
||||||
t_gzread gzread = NULL;
|
|
||||||
t_gzclose gzclose = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int V6_is_available = HTS_INET6;
|
int V6_is_available = HTS_INET6;
|
||||||
|
|
||||||
static char WHAT_is_available[64] = "";
|
static char WHAT_is_available[64] = "";
|
||||||
@@ -112,18 +106,6 @@ int hts_parse_externals(htsmoduleStruct * str) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static void addCallback(htscallbacks* chain, void* moduleHandle, htscallbacksfncptr exitFnc) {
|
|
||||||
// while(chain->next != NULL) {
|
|
||||||
// chain = chain->next;
|
|
||||||
// }
|
|
||||||
// chain->next = calloct(1, sizeof(htscallbacks));
|
|
||||||
// assertf(chain->next != NULL);
|
|
||||||
// chain = chain->next;
|
|
||||||
// memset(chain, 0, sizeof(*chain));
|
|
||||||
// chain->exitFnc = exitFnc;
|
|
||||||
// chain->moduleHandle = moduleHandle;
|
|
||||||
//}
|
|
||||||
|
|
||||||
void clearCallbacks(htscallbacks * chain_);
|
void clearCallbacks(htscallbacks * chain_);
|
||||||
void clearCallbacks(htscallbacks * chain_) {
|
void clearCallbacks(htscallbacks * chain_) {
|
||||||
htscallbacks *chain;
|
htscallbacks *chain;
|
||||||
|
|||||||
100
src/htsmodules.h
100
src/htsmodules.h
@@ -31,10 +31,15 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** @file htsmodules.h
|
||||||
|
Loadable-parser (external module) interface. The engine hands a downloaded
|
||||||
|
object to a module via htsmoduleStruct; the module reports discovered links
|
||||||
|
back through the addLink callback. */
|
||||||
|
|
||||||
#ifndef HTS_MODULES
|
#ifndef HTS_MODULES
|
||||||
#define HTS_MODULES
|
#define HTS_MODULES
|
||||||
|
|
||||||
/* Forware definitions */
|
/* Forward definitions */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_url
|
#ifndef HTS_DEF_FWSTRUCT_lien_url
|
||||||
#define HTS_DEF_FWSTRUCT_lien_url
|
#define HTS_DEF_FWSTRUCT_lien_url
|
||||||
typedef struct lien_url lien_url;
|
typedef struct lien_url lien_url;
|
||||||
@@ -56,49 +61,49 @@ typedef struct cache_back cache_back;
|
|||||||
typedef struct hash_struct hash_struct;
|
typedef struct hash_struct hash_struct;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Function type to add links inside the module
|
/** Callback a module invokes to report a discovered link.
|
||||||
link : link to add (absolute or relative)
|
str: the per-object context the module was called with.
|
||||||
str : structure defined below
|
link: link to add (absolute or relative); the engine copies it.
|
||||||
Returns 1 if the link was added, 0 if not
|
Returns 1 if the engine accepted/queued the link, 0 if it was rejected. */
|
||||||
*/
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsmoduleStruct
|
#ifndef HTS_DEF_FWSTRUCT_htsmoduleStruct
|
||||||
#define HTS_DEF_FWSTRUCT_htsmoduleStruct
|
#define HTS_DEF_FWSTRUCT_htsmoduleStruct
|
||||||
typedef struct htsmoduleStruct htsmoduleStruct;
|
typedef struct htsmoduleStruct htsmoduleStruct;
|
||||||
#endif
|
#endif
|
||||||
typedef int (*t_htsAddLink) (htsmoduleStruct * str, char *link);
|
typedef int (*t_htsAddLink)(htsmoduleStruct *str, char *link);
|
||||||
|
|
||||||
/* Structure passed to the module */
|
/** Per-object context passed to a parser module for one downloaded file.
|
||||||
|
Field access classes are noted; engine owns all pointers unless stated. */
|
||||||
struct htsmoduleStruct {
|
struct htsmoduleStruct {
|
||||||
/* Read-only elements */
|
/* Read-only elements */
|
||||||
const char *filename; /* filename (C:\My Web Sites\...) */
|
const char *filename; /* filename (C:\My Web Sites\...) */
|
||||||
int size; /* size of filename (should be > 0) */
|
int size; /* size of filename (should be > 0) */
|
||||||
const char *mime; /* MIME type of the object */
|
const char *mime; /* MIME type of the object */
|
||||||
const char *url_host; /* incoming hostname (www.foo.com) */
|
const char *url_host; /* incoming hostname (www.foo.com) */
|
||||||
const char *url_file; /* incoming filename (/bar/bar.gny) */
|
const char *url_file; /* incoming filename (/bar/bar.gny) */
|
||||||
|
|
||||||
/* Write-only */
|
/* Write-only */
|
||||||
const char *wrapper_name; /* name of wrapper (static string) */
|
const char *wrapper_name; /* name of wrapper (static string) */
|
||||||
char *err_msg; /* if an error occurred, the error message (max. 1KB) */
|
char *err_msg; /* if an error occurred, the error message (max. 1KB) */
|
||||||
|
|
||||||
/* Read/Write */
|
/* Read/Write */
|
||||||
int relativeToHtmlLink; /* set this to 1 if all urls you pass to addLink
|
int relativeToHtmlLink; /* set this to 1 if all urls you pass to addLink
|
||||||
are in fact relative to the html file where your
|
are in fact relative to the html file where your
|
||||||
module was originally */
|
module was originally */
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
t_htsAddLink addLink; /* call this function when links are
|
t_htsAddLink addLink; /* call this function when links are
|
||||||
being detected. it if not your responsability to decide
|
being detected. it if not your responsability to
|
||||||
if the engine will keep them, or not. */
|
decide if the engine will keep them, or not. */
|
||||||
|
|
||||||
/* Optional */
|
/* Optional */
|
||||||
char *localLink; /* if non null, the engine will write there the local
|
char *localLink; /* if non null, the engine will write there the local
|
||||||
relative filename of the link added by addLink(), or
|
relative filename of the link added by addLink(), or
|
||||||
the absolute path if the link was refused by the wizard */
|
the absolute path if the link was refused by the wizard */
|
||||||
int localLinkSize; /* size of the optionnal buffer */
|
int localLinkSize; /* size of the optionnal buffer */
|
||||||
|
|
||||||
/* User-defined */
|
/* User-defined */
|
||||||
void *userdef; /* can be used by callback routines
|
void *userdef; /* can be used by callback routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The parser httrackp structure (may be used) */
|
/* The parser httrackp structure (may be used) */
|
||||||
httrackp *opt;
|
httrackp *opt;
|
||||||
@@ -112,28 +117,45 @@ struct htsmoduleStruct {
|
|||||||
int *ptr_;
|
int *ptr_;
|
||||||
const char *page_charset_;
|
const char *page_charset_;
|
||||||
/* Internal use - please don't touch */
|
/* Internal use - please don't touch */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Used to wrap module initialization */
|
/** Module lifecycle hooks. Init/PlugInit return 1 on success, 0 on failure;
|
||||||
/* return 1 if init was ok */
|
Exit returns its own status (ignored by the engine). */
|
||||||
typedef int (*t_htsWrapperInit) (char *fn, char *args);
|
typedef int (*t_htsWrapperInit)(char *fn, char *args);
|
||||||
typedef int (*t_htsWrapperExit) (void);
|
|
||||||
typedef int (*t_htsWrapperPlugInit) (char *args);
|
typedef int (*t_htsWrapperExit)(void);
|
||||||
|
|
||||||
|
typedef int (*t_htsWrapperPlugInit)(char *args);
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library internal definictions */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
HTSEXT_API const char *hts_get_version_info(httrackp * opt);
|
|
||||||
HTSEXT_API const char *hts_is_available(void);
|
|
||||||
extern void htspe_init(void);
|
|
||||||
extern void htspe_uninit(void);
|
|
||||||
extern int hts_parse_externals(htsmoduleStruct * str);
|
|
||||||
|
|
||||||
/*extern int swf_is_available;*/
|
/** Capabilities string ("-noV6", "-nossl", ...) followed by "+name" for each
|
||||||
|
loaded module. Returned pointer aliases opt->state.HTbuff; do not free, and
|
||||||
|
it is overwritten by the next call. */
|
||||||
|
HTSEXT_API const char *hts_get_version_info(httrackp *opt);
|
||||||
|
|
||||||
|
/** Static capabilities string set by htspe_init(); valid for the process
|
||||||
|
lifetime, do not free. */
|
||||||
|
HTSEXT_API const char *hts_is_available(void);
|
||||||
|
|
||||||
|
/** Initialize the module subsystem (idempotent): builds the capabilities
|
||||||
|
string and, on Windows, hardens the DLL search path. */
|
||||||
|
extern void htspe_init(void);
|
||||||
|
|
||||||
|
/** Tear-down counterpart of htspe_init(); currently a no-op. */
|
||||||
|
extern void htspe_uninit(void);
|
||||||
|
|
||||||
|
/** Run the external-parser callbacks for the object described by str.
|
||||||
|
Returns the parse callback result (>=0) on a handled object, or -1 if no
|
||||||
|
module claimed it or its wrapper_name is blacklisted. */
|
||||||
|
extern int hts_parse_externals(htsmoduleStruct *str);
|
||||||
|
|
||||||
|
/** Nonzero if IPv6 support was compiled in (== HTS_INET6). */
|
||||||
extern int V6_is_available;
|
extern int V6_is_available;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
567
src/htsname.c
567
src/htsname.c
@@ -41,6 +41,10 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#include "htstools.h"
|
#include "htstools.h"
|
||||||
#include "htscharset.h"
|
#include "htscharset.h"
|
||||||
#include "htsencoding.h"
|
#include "htsencoding.h"
|
||||||
|
#include "htssniff.h"
|
||||||
|
#if HTS_USEZLIB
|
||||||
|
#include "htszlib.h"
|
||||||
|
#endif
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#define ADD_STANDARD_PATH \
|
#define ADD_STANDARD_PATH \
|
||||||
@@ -51,12 +55,13 @@ Please visit our Website: http://www.httrack.com
|
|||||||
url_savename_addstr(afs->save, buff);\
|
url_savename_addstr(afs->save, buff);\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADD_STANDARD_NAME(shortname) \
|
#define ADD_STANDARD_NAME(shortname) \
|
||||||
{ /* ajout nom */\
|
{ /* add name */ \
|
||||||
char BIGSTK buff[HTS_URLMAXSIZE*2];\
|
char BIGSTK buff[HTS_URLMAXSIZE * 2]; \
|
||||||
standard_name(buff,dot_pos,nom_pos,fil_complete,(shortname));\
|
standard_name(buff, sizeof(buff), dot_pos, nom_pos, fil_complete, \
|
||||||
url_savename_addstr(afs->save, buff);\
|
(shortname)); \
|
||||||
}
|
url_savename_addstr(afs->save, buff); \
|
||||||
|
}
|
||||||
|
|
||||||
/* Avoid stupid DOS system folders/file such as 'nul' */
|
/* Avoid stupid DOS system folders/file such as 'nul' */
|
||||||
/* Based on linux/fs/umsdos/mangle.c */
|
/* Based on linux/fs/umsdos/mangle.c */
|
||||||
@@ -69,31 +74,6 @@ static const char *hts_tbdev[] = {
|
|||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
#define URLSAVENAME_WAIT_FOR_AVAILABLE_SOCKET() do { \
|
|
||||||
int prev = opt->state._hts_in_html_parsing; \
|
|
||||||
while(back_pluggable_sockets_strict(sback, opt) <= 0) { \
|
|
||||||
opt->state. _hts_in_html_parsing = 6; \
|
|
||||||
/* Wait .. */ \
|
|
||||||
back_wait(sback,opt,cache,0); \
|
|
||||||
/* Transfer rate */ \
|
|
||||||
engine_stats(); \
|
|
||||||
/* Refresh various stats */ \
|
|
||||||
HTS_STAT.stat_nsocket=back_nsoc(sback); \
|
|
||||||
HTS_STAT.stat_errors=fspc(opt,NULL,"error"); \
|
|
||||||
HTS_STAT.stat_warnings=fspc(opt,NULL,"warning"); \
|
|
||||||
HTS_STAT.stat_infos=fspc(opt,NULL,"info"); \
|
|
||||||
HTS_STAT.nbk=backlinks_done(sback,opt->liens,opt->lien_tot,ptr); \
|
|
||||||
HTS_STAT.nb=back_transferred(HTS_STAT.stat_bytes,sback); \
|
|
||||||
/* Check */ \
|
|
||||||
{ \
|
|
||||||
if (!RUN_CALLBACK7(opt, loop, sback->lnk, sback->count,-1,ptr,opt->lien_tot,(int) (time_local()-HTS_STAT.stat_timestart),&HTS_STAT)) { \
|
|
||||||
return -1; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
opt->state._hts_in_html_parsing = prev; \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
/* Strip all // */
|
/* Strip all // */
|
||||||
static void cleanDoubleSlash(char *s) {
|
static void cleanDoubleSlash(char *s) {
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -137,8 +117,191 @@ static void cleanEndingSpaceOrDot(char *s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// forme le nom du fichier à sauver (save) à partir de fil et adr
|
/* Wire Content-Type vs URL extension: a patchable wire type wins over an
|
||||||
// système intelligent, qui renomme en cas de besoin (exemple: deux INDEX.HTML et index.html)
|
unspecific ext, the HTS_UNKNOWN_MIME sentinel keeps a specific non-HTML ext
|
||||||
|
(#267 guard), a declared disagreement is CONTESTED (sniffed below). */
|
||||||
|
typedef enum wire_verdict {
|
||||||
|
WIRE_KEEPS_EXT,
|
||||||
|
WIRE_WINS,
|
||||||
|
WIRE_CONTESTED
|
||||||
|
} wire_verdict;
|
||||||
|
|
||||||
|
static wire_verdict wire_ext_verdict(httrackp *opt, const char *wiremime,
|
||||||
|
const char *file, char *urlmime,
|
||||||
|
size_t urlmime_size) {
|
||||||
|
if (may_unknown2(opt, wiremime, file))
|
||||||
|
return WIRE_KEEPS_EXT; /* type kept verbatim (keep-list / bogus-multiple) */
|
||||||
|
urlmime[0] = '\0';
|
||||||
|
/* type implied by the URL extension, only when confidently known (flag 0) */
|
||||||
|
if (!get_httptype_sized(opt, urlmime, urlmime_size, file, 0))
|
||||||
|
return WIRE_WINS; /* URL ext implies no known type */
|
||||||
|
if (strfield2(wiremime, urlmime))
|
||||||
|
return WIRE_KEEPS_EXT; /* agreement (no .htm->.html churn) */
|
||||||
|
if (!is_hypertext_mime(opt, urlmime, file) &&
|
||||||
|
strfield2(wiremime, HTS_UNKNOWN_MIME))
|
||||||
|
return WIRE_KEEPS_EXT; /* no declared type */
|
||||||
|
return WIRE_CONTESTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Optional evidence for a contested wire-vs-ext verdict. */
|
||||||
|
typedef struct sniff_src {
|
||||||
|
struct_back *sback; /* live backing (looked up by adr/fil) */
|
||||||
|
const lien_back *headers; /* snapshot: r.adr, else the url_sav file */
|
||||||
|
const char *adr, *fil;
|
||||||
|
const char *prev_save; /* previous run's save name (cache X-Save) */
|
||||||
|
} sniff_src;
|
||||||
|
|
||||||
|
#if HTS_USEZLIB
|
||||||
|
/* Inflate the head of a gzip/zlib stream; 0 when undecodable. */
|
||||||
|
static size_t sniff_inflate_head(const void *in, size_t in_len, void *out,
|
||||||
|
size_t out_len) {
|
||||||
|
z_stream zs;
|
||||||
|
size_t n = 0;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
memset(&zs, 0, sizeof(zs));
|
||||||
|
if (inflateInit2(&zs, 47) != Z_OK) /* 47: gzip or zlib, autodetected */
|
||||||
|
return 0;
|
||||||
|
zs.next_in = (const Bytef *) in;
|
||||||
|
zs.avail_in = (uInt) in_len;
|
||||||
|
zs.next_out = (Bytef *) out;
|
||||||
|
zs.avail_out = (uInt) out_len;
|
||||||
|
err = inflate(&zs, Z_SYNC_FLUSH);
|
||||||
|
if (err == Z_OK || err == Z_STREAM_END || err == Z_BUF_ERROR)
|
||||||
|
n = out_len - zs.avail_out;
|
||||||
|
inflateEnd(&zs);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static size_t sniff_read_head(const char *path, void *buf, size_t len) {
|
||||||
|
char catbuff[CATBUFF_SIZE];
|
||||||
|
FILE *const fp = FOPEN(fconv(catbuff, sizeof(catbuff), path), "rb");
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (fp != NULL) {
|
||||||
|
n = fread(buf, 1, len, fp);
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Body head of one slot: memory, else its flushed on-disk file (url_sav, or
|
||||||
|
tmpfile for a compressed stream); inflated so the sniff sees the final body.
|
||||||
|
*/
|
||||||
|
static size_t sniff_slot_head(const lien_back *slot, void *buf, size_t len) {
|
||||||
|
const htsblk *const r = &slot->r;
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (r->adr != NULL && r->size > 0) {
|
||||||
|
n = (size_t) r->size < len ? (size_t) r->size : len;
|
||||||
|
memcpy(buf, r->adr, n);
|
||||||
|
} else {
|
||||||
|
if (r->out != NULL)
|
||||||
|
fflush(r->out);
|
||||||
|
if (slot->url_sav[0] != '\0')
|
||||||
|
n = sniff_read_head(slot->url_sav, buf, len);
|
||||||
|
if (n == 0 && slot->tmpfile != NULL && slot->tmpfile[0] != '\0')
|
||||||
|
n = sniff_read_head(slot->tmpfile, buf, len);
|
||||||
|
}
|
||||||
|
if (n > 0 && r->compressed) {
|
||||||
|
#if HTS_USEZLIB
|
||||||
|
unsigned char raw[HTS_SNIFF_LEN];
|
||||||
|
|
||||||
|
if (n > sizeof(raw))
|
||||||
|
n = sizeof(raw);
|
||||||
|
memcpy(raw, buf, n);
|
||||||
|
n = sniff_inflate_head(raw, n, buf, len);
|
||||||
|
#else
|
||||||
|
n = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Up to len leading body bytes; 0 when unavailable, and always in
|
||||||
|
non-delayed mode (its HEAD-probe first run couldn't sniff either). */
|
||||||
|
static size_t sniff_body_head(httrackp *opt, const sniff_src *src, void *buf,
|
||||||
|
size_t len) {
|
||||||
|
size_t n = 0;
|
||||||
|
|
||||||
|
if (src == NULL || opt->savename_delayed == HTS_SAVENAME_DELAYED_NONE)
|
||||||
|
return 0;
|
||||||
|
/* live backing slot: a snapshot (back_copy_static) loses r.adr/r.out */
|
||||||
|
if (src->sback != NULL && src->adr != NULL && src->fil != NULL) {
|
||||||
|
const int b = back_index(opt, src->sback, src->adr, src->fil, NULL);
|
||||||
|
|
||||||
|
if (b >= 0)
|
||||||
|
n = sniff_slot_head(&src->sback->lnk[b], buf, len);
|
||||||
|
}
|
||||||
|
if (n == 0 && src->headers != NULL)
|
||||||
|
n = sniff_slot_head(src->headers, buf, len);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Contested verdicts: magic proving the URL ext keeps it, else wire wins. */
|
||||||
|
static int wire_patches_ext(httrackp *opt, const sniff_src *src,
|
||||||
|
const char *wiremime, const char *file) {
|
||||||
|
char urlmime[256];
|
||||||
|
|
||||||
|
switch (wire_ext_verdict(opt, wiremime, file, urlmime, sizeof(urlmime))) {
|
||||||
|
case WIRE_KEEPS_EXT:
|
||||||
|
return 0;
|
||||||
|
case WIRE_WINS:
|
||||||
|
return 1;
|
||||||
|
case WIRE_CONTESTED:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (src != NULL) {
|
||||||
|
if (hts_sniff_mime_known(urlmime)) {
|
||||||
|
unsigned char head[HTS_SNIFF_LEN];
|
||||||
|
const size_t n = sniff_body_head(opt, src, head, sizeof(head));
|
||||||
|
|
||||||
|
if (n > 0)
|
||||||
|
return hts_sniff_mime_consistent(head, n, urlmime) ? 0 : 1;
|
||||||
|
}
|
||||||
|
/* no bytes: reproduce the previous run's verdict (cached X-Save name) */
|
||||||
|
if (src->prev_save != NULL && src->prev_save[0] != '\0') {
|
||||||
|
char prevmime[256];
|
||||||
|
|
||||||
|
prevmime[0] = '\0';
|
||||||
|
if (get_httptype_sized(opt, prevmime, sizeof(prevmime), src->prev_save,
|
||||||
|
0) &&
|
||||||
|
strfield2(prevmime, urlmime))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int hts_ext_sniff_wanted(httrackp *opt, const char *wiremime,
|
||||||
|
const char *file) {
|
||||||
|
char urlmime[256];
|
||||||
|
|
||||||
|
return wiremime != NULL && strnotempty(wiremime) &&
|
||||||
|
wire_ext_verdict(opt, wiremime, file, urlmime, sizeof(urlmime)) ==
|
||||||
|
WIRE_CONTESTED &&
|
||||||
|
hts_sniff_mime_known(urlmime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Wire-metadata name change: a Content-Disposition filename wins (returns 2),
|
||||||
|
else the declared type's ext when wire_patches_ext() allows (returns 1),
|
||||||
|
else 0. ext receives the new extension or replacement filename. */
|
||||||
|
static int resolve_extension(httrackp *opt, const sniff_src *src,
|
||||||
|
const char *cdispo, const char *contenttype,
|
||||||
|
const char *fil, char *ext, size_t ext_size) {
|
||||||
|
if (strnotempty(cdispo)) {
|
||||||
|
strlcpybuff(ext, cdispo, ext_size);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
if (wire_patches_ext(opt, src, contenttype, fil) &&
|
||||||
|
give_mimext(ext, ext_size, contenttype))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build the local save name (save) from adr/fil; renames on collision
|
||||||
|
// (e.g. INDEX.HTML vs index.html).
|
||||||
int url_savename(lien_adrfilsave *const afs,
|
int url_savename(lien_adrfilsave *const afs,
|
||||||
lien_adrfil *const former,
|
lien_adrfil *const former,
|
||||||
const char *referer_adr, const char *referer_fil,
|
const char *referer_adr, const char *referer_fil,
|
||||||
@@ -168,6 +331,13 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
// copy of fil, used for lookups (see urlhack)
|
// copy of fil, used for lookups (see urlhack)
|
||||||
const char *normadr = adr;
|
const char *normadr = adr;
|
||||||
const char *normfil = fil_complete;
|
const char *normfil = fil_complete;
|
||||||
|
/* query keys to strip for this URL (NULL = none); decoupled from urlhack */
|
||||||
|
char BIGSTK stripkeys[HTS_URLMAXSIZE];
|
||||||
|
const char *const strip =
|
||||||
|
StringNotEmpty(opt->strip_query)
|
||||||
|
? hts_query_strip_keys(StringBuff(opt->strip_query), adr,
|
||||||
|
fil_complete, stripkeys, sizeof(stripkeys))
|
||||||
|
: NULL;
|
||||||
const char *const print_adr = jump_protocol_const(adr);
|
const char *const print_adr = jump_protocol_const(adr);
|
||||||
const char *start_pos = NULL, *nom_pos = NULL, *dot_pos = NULL; // Position nom et point
|
const char *start_pos = NULL, *nom_pos = NULL, *dot_pos = NULL; // Position nom et point
|
||||||
|
|
||||||
@@ -183,10 +353,11 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
|
|
||||||
/* 8-3 ? */
|
/* 8-3 ? */
|
||||||
switch (opt->savename_83) {
|
switch (opt->savename_83) {
|
||||||
case 1: // 8-3
|
case HTS_SAVENAME_83_DOS: // 8-3
|
||||||
max_char = 8;
|
max_char = 8;
|
||||||
break;
|
break;
|
||||||
case 2: // Level 2 File names may be up to 31 characters.
|
case HTS_SAVENAME_83_ISO9660: // Level 2 File names may be up to 31
|
||||||
|
// characters.
|
||||||
max_char = 31;
|
max_char = 31;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -199,9 +370,13 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
// www-42.foo.com -> foo.com
|
// www-42.foo.com -> foo.com
|
||||||
// foo.com/bar//foobar -> foo.com/bar/foobar
|
// foo.com/bar//foobar -> foo.com/bar/foobar
|
||||||
if (opt->urlhack) {
|
if (opt->urlhack) {
|
||||||
// copy of adr (without protocol), used for lookups (see urlhack)
|
// dedup-lookup key; honor the per-feature negatives like htshash.c so
|
||||||
normadr = adr_normalized(adr, normadr_);
|
// distinct URLs keep distinct savenames (else keep normadr = adr)
|
||||||
normfil = fil_normalized(fil_complete, normfil_);
|
if (!opt->no_www_dedup)
|
||||||
|
normadr = adr_normalized_sized(adr, normadr_, sizeof(normadr_));
|
||||||
|
normfil =
|
||||||
|
fil_normalized_filtered_ex(fil_complete, normfil_, strip,
|
||||||
|
!opt->no_slash_dedup, !opt->no_query_dedup);
|
||||||
} else {
|
} else {
|
||||||
if (link_has_authority(adr_complete)) { // https or other protocols : in "http/" subfolder
|
if (link_has_authority(adr_complete)) { // https or other protocols : in "http/" subfolder
|
||||||
char *pos = strchr(adr_complete, ':');
|
char *pos = strchr(adr_complete, ':');
|
||||||
@@ -214,6 +389,11 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
normadr = normadr_;
|
normadr = normadr_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// strip still applies with urlhack off (host left untouched); no // or
|
||||||
|
// query-sort here, to match the hash key (norm_slash/norm_query are 0 when
|
||||||
|
// urlhack is off) so a URL is looked up under the key it was stored with
|
||||||
|
if (strip != NULL)
|
||||||
|
normfil = fil_normalized_filtered_ex(fil_complete, normfil_, strip, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// à afficher sans ftp://
|
// à afficher sans ftp://
|
||||||
@@ -323,7 +503,10 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* replace shtml to html.. */
|
/* replace shtml to html.. */
|
||||||
if (opt->savename_delayed == 2)
|
/* HARD delays every type, except one the user pinned with --assume: honor it
|
||||||
|
immediately (ishtml() consults the user type), no delayed name (#56) */
|
||||||
|
if (opt->savename_delayed == HTS_SAVENAME_DELAYED_HARD &&
|
||||||
|
!is_userknowntype(opt, fil))
|
||||||
is_html = -1; /* ALWAYS delay type */
|
is_html = -1; /* ALWAYS delay type */
|
||||||
else
|
else
|
||||||
is_html = ishtml(opt, fil);
|
is_html = ishtml(opt, fil);
|
||||||
@@ -344,8 +527,7 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
mime[0] = ext[0] = '\0';
|
mime[0] = ext[0] = '\0';
|
||||||
get_userhttptype(opt, mime, fil);
|
get_userhttptype(opt, mime, fil);
|
||||||
if (strnotempty(mime)) {
|
if (strnotempty(mime)) {
|
||||||
give_mimext(ext, mime);
|
if (give_mimext(ext, sizeof(ext), mime)) {
|
||||||
if (strnotempty(ext)) {
|
|
||||||
ext_chg = 1;
|
ext_chg = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -356,100 +538,77 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
|
|
||||||
// si option check_type activée
|
// si option check_type activée
|
||||||
if (is_html < 0 && opt->check_type && !ext_chg) {
|
if (is_html < 0 && opt->check_type && !ext_chg) {
|
||||||
int ishtest = 0;
|
|
||||||
|
|
||||||
if (protocol != PROTOCOL_FILE
|
if (protocol != PROTOCOL_FILE
|
||||||
&& protocol != PROTOCOL_FTP
|
&& protocol != PROTOCOL_FTP
|
||||||
) {
|
) {
|
||||||
// tester type avec requète HEAD si on ne connait pas le type du fichier
|
// tester type avec requète HEAD si on ne connait pas le type du fichier
|
||||||
if (!((opt->check_type == 1) && (fil[strlen(fil) - 1] == '/'))) // slash doit être html?
|
if (!((opt->check_type == 1) && (fil[strlen(fil) - 1] == '/'))) // slash doit être html?
|
||||||
if (opt->savename_delayed == 2 || (ishtest = ishtml(opt, fil)) < 0) { // on ne sait pas si c'est un html ou un fichier..
|
if (opt->savename_delayed == HTS_SAVENAME_DELAYED_HARD ||
|
||||||
|
ishtml(opt, fil) < 0) { // unsure whether it's html or a file
|
||||||
// lire dans le cache
|
// lire dans le cache
|
||||||
htsblk r = cache_read_including_broken(opt, cache, adr, fil); // test uniquement
|
char BIGSTK previous_save[HTS_URLMAXSIZE * 2];
|
||||||
|
htsblk r;
|
||||||
|
|
||||||
if (r.statuscode != -1) { // pas d'erreur de lecture cache
|
previous_save[0] = '\0';
|
||||||
char s[32];
|
r = cache_read_including_broken(opt, cache, adr, fil,
|
||||||
|
previous_save); // test uniquement
|
||||||
|
|
||||||
s[0] = '\0';
|
if (r.statuscode != -1) { // cache entry read OK
|
||||||
hts_log_print(opt, LOG_DEBUG, "Testing link type (from cache) %s%s",
|
hts_log_print(opt, LOG_DEBUG, "Testing link type (from cache) %s%s",
|
||||||
adr_complete, fil_complete);
|
adr_complete, fil_complete);
|
||||||
if (!HTTP_IS_REDIRECT(r.statuscode)) {
|
if (!HTTP_IS_REDIRECT(r.statuscode)) {
|
||||||
if (strnotempty(r.cdispo)) { /* filename given */
|
const sniff_src src = {sback, NULL, adr, fil, previous_save};
|
||||||
ext_chg = 2; /* change filename */
|
|
||||||
strcpybuff(ext, r.cdispo);
|
ext_chg = resolve_extension(opt, &src, r.cdispo, r.contenttype,
|
||||||
} else if (!may_unknown2(opt, r.contenttype, fil)) { // on peut patcher à priori?
|
fil, ext, sizeof(ext));
|
||||||
give_mimext(s, r.contenttype); // obtenir extension
|
|
||||||
if (strnotempty(s) > 0) { // on a reconnu l'extension
|
|
||||||
ext_chg = 1;
|
|
||||||
strcpybuff(ext, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ifdef DEFAULT_BIN_EXT
|
} else if (opt->savename_delayed != HTS_SAVENAME_DELAYED_HARD &&
|
||||||
// no extension and potentially bogus
|
is_userknowntype(opt, fil)) { /* PATCH BY BRIAN SCHRÖDER.
|
||||||
else if (ishtest == -2) {
|
Lookup mimetype not only by extension,
|
||||||
ext_chg = 1;
|
but also by filename */
|
||||||
strcpybuff(ext, DEFAULT_BIN_EXT + 1);
|
/* Note: "foo.cgi => text/html" means that foo.cgi shall have the
|
||||||
}
|
text/html MIME file type, that is, ".html" */
|
||||||
#endif
|
|
||||||
//
|
|
||||||
} else if (opt->savename_delayed != 2 && is_userknowntype(opt, fil)) { /* PATCH BY BRIAN SCHRÖDER.
|
|
||||||
Lookup mimetype not only by extension,
|
|
||||||
but also by filename */
|
|
||||||
/* Note: "foo.cgi => text/html" means that foo.cgi shall have the text/html MIME file type,
|
|
||||||
that is, ".html" */
|
|
||||||
char BIGSTK mime[1024];
|
char BIGSTK mime[1024];
|
||||||
|
|
||||||
mime[0] = ext[0] = '\0';
|
mime[0] = ext[0] = '\0';
|
||||||
get_userhttptype(opt, mime, fil);
|
get_userhttptype(opt, mime, fil);
|
||||||
if (strnotempty(mime)) {
|
if (strnotempty(mime)) {
|
||||||
give_mimext(ext, mime);
|
if (give_mimext(ext, sizeof(ext), mime)) {
|
||||||
if (strnotempty(ext)) {
|
|
||||||
ext_chg = 1;
|
ext_chg = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// note: if savename_delayed is enabled, the naming will be temporary (and slightly invalid!)
|
// note: if savename_delayed is enabled, the naming will be temporary
|
||||||
// note: if we are about to stop (opt->state.stop), back_add() will fail later
|
// (and slightly invalid!)
|
||||||
else if (opt->savename_delayed != 0 && !opt->state.stop) {
|
//
|
||||||
// Check if the file is ready in backing. We basically take the same logic as later.
|
// note: if we are about to stop (opt->state.stop), back_add() will
|
||||||
// FIXME: we should cleanup and factorize this unholy mess
|
// fail later
|
||||||
|
else if (opt->savename_delayed != HTS_SAVENAME_DELAYED_NONE &&
|
||||||
|
!opt->state.stop) {
|
||||||
|
// Check if the file is ready in backing.
|
||||||
if (headers != NULL && headers->status >= 0 && !is_redirect) {
|
if (headers != NULL && headers->status >= 0 && !is_redirect) {
|
||||||
if (strnotempty(headers->r.cdispo)) { /* filename given */
|
const sniff_src src = {sback, headers, adr, fil, NULL};
|
||||||
ext_chg = 2; /* change filename */
|
|
||||||
strcpybuff(ext, headers->r.cdispo);
|
ext_chg = resolve_extension(opt, &src, headers->r.cdispo,
|
||||||
} else if (!may_unknown2(opt, headers->r.contenttype, headers->url_fil)) { // on peut patcher à priori? (pas interdit ou pas de type)
|
headers->r.contenttype,
|
||||||
char s[16];
|
headers->url_fil, ext, sizeof(ext));
|
||||||
s[0] = '\0';
|
|
||||||
give_mimext(s, headers->r.contenttype); // obtenir extension
|
|
||||||
if (strnotempty(s) > 0) { // on a reconnu l'extension
|
|
||||||
ext_chg = 1;
|
|
||||||
strcpybuff(ext, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (mime_type != NULL) {
|
else if (mime_type != NULL) {
|
||||||
ext[0] = '\0';
|
ext[0] = '\0';
|
||||||
if (*mime_type) {
|
if (*mime_type) {
|
||||||
give_mimext(ext, mime_type);
|
give_mimext(ext, sizeof(ext), mime_type);
|
||||||
}
|
}
|
||||||
if (strnotempty(ext)) {
|
if (strnotempty(ext)) {
|
||||||
char mime_from_file[128];
|
char mime_from_file[128];
|
||||||
|
|
||||||
mime_from_file[0] = 0;
|
mime_from_file[0] = 0;
|
||||||
get_httptype(opt, mime_from_file, fil, 1);
|
get_httptype_sized(opt, mime_from_file, sizeof(mime_from_file),
|
||||||
|
fil, 1);
|
||||||
if (!strnotempty(mime_from_file) || strcasecmp(mime_type, mime_from_file) != 0) { /* different mime for this type */
|
if (!strnotempty(mime_from_file) || strcasecmp(mime_type, mime_from_file) != 0) { /* different mime for this type */
|
||||||
/* type change not forbidden (or no extension at all) */
|
/* type change not forbidden (or no extension at all) */
|
||||||
if (!may_unknown2(opt, mime_type, fil)) {
|
if (!may_unknown2(opt, mime_type, fil)) {
|
||||||
ext_chg = 1;
|
ext_chg = 1;
|
||||||
}
|
}
|
||||||
#ifdef DEFAULT_BIN_EXT
|
|
||||||
// no extension and potentially bogus
|
|
||||||
else if (ishtml(opt, fil) == -2) {
|
|
||||||
ext_chg = 1;
|
|
||||||
strcpybuff(ext, DEFAULT_BIN_EXT + 1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
ext_chg = 0;
|
ext_chg = 0;
|
||||||
}
|
}
|
||||||
@@ -468,11 +627,10 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
int has_been_moved = 0;
|
int has_been_moved = 0;
|
||||||
lien_adrfil current;
|
lien_adrfil current;
|
||||||
|
|
||||||
/* Ensure we don't use too many sockets by using a "testing" one
|
/* Wait for an available test slot, honoring the connection limits
|
||||||
If we have only 1 simultaneous connection authorized, wait for pending download
|
|
||||||
Wait for an available slot
|
|
||||||
*/
|
*/
|
||||||
URLSAVENAME_WAIT_FOR_AVAILABLE_SOCKET();
|
if (!hts_wait_available_socket(sback, opt, cache, ptr))
|
||||||
|
return -1;
|
||||||
|
|
||||||
/* Rock'in */
|
/* Rock'in */
|
||||||
current.adr[0] = current.fil[0] = '\0';
|
current.adr[0] = current.fil[0] = '\0';
|
||||||
@@ -502,24 +660,11 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
if (ptr >= 0) {
|
if (ptr >= 0) {
|
||||||
back_fillmax(sback, opt, cache, ptr, numero_passe);
|
back_fillmax(sback, opt, cache, ptr, numero_passe);
|
||||||
}
|
}
|
||||||
// on est obligé d'appeler le shell pour le refresh..
|
if (!hts_loop_tick(sback, opt, b, ptr)) {
|
||||||
// Transfer rate
|
|
||||||
engine_stats();
|
|
||||||
|
|
||||||
// Refresh various stats
|
|
||||||
HTS_STAT.stat_nsocket = back_nsoc(sback);
|
|
||||||
HTS_STAT.stat_errors = fspc(opt, NULL, "error");
|
|
||||||
HTS_STAT.stat_warnings = fspc(opt, NULL, "warning");
|
|
||||||
HTS_STAT.stat_infos = fspc(opt, NULL, "info");
|
|
||||||
HTS_STAT.nbk = backlinks_done(sback, opt->liens, opt->lien_tot, ptr);
|
|
||||||
HTS_STAT.nb = back_transferred(HTS_STAT.stat_bytes, sback);
|
|
||||||
|
|
||||||
if (!RUN_CALLBACK7
|
|
||||||
(opt, loop, sback->lnk, sback->count, b, ptr, opt->lien_tot,
|
|
||||||
(int) (time_local() - HTS_STAT.stat_timestart),
|
|
||||||
&HTS_STAT)) {
|
|
||||||
return -1;
|
return -1;
|
||||||
} else if (opt->state._hts_cancel || !back_checkmirror(opt)) { // cancel 2 ou 1 (cancel parsing)
|
} else if (opt->state._hts_cancel ||
|
||||||
|
!back_checkmirror(
|
||||||
|
opt)) { // cancel level 2 or 1 (cancel parsing)
|
||||||
back_delete(opt, cache, sback, b); // cancel test
|
back_delete(opt, cache, sback, b); // cancel test
|
||||||
stop_looping = 1;
|
stop_looping = 1;
|
||||||
}
|
}
|
||||||
@@ -584,8 +729,9 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
"Loop with HEAD request (during prefetch) at %s%s",
|
"Loop with HEAD request (during prefetch) at %s%s",
|
||||||
current.adr, current.fil);
|
current.adr, current.fil);
|
||||||
}
|
}
|
||||||
// Ajouter
|
if (!hts_wait_available_socket(sback, opt,
|
||||||
URLSAVENAME_WAIT_FOR_AVAILABLE_SOCKET();
|
cache, ptr))
|
||||||
|
return -1;
|
||||||
if (back_add(sback, opt, cache, moved.adr, moved.fil, methode, referer_adr, referer_fil, 1) != -1) { // OK
|
if (back_add(sback, opt, cache, moved.adr, moved.fil, methode, referer_adr, referer_fil, 1) != -1) { // OK
|
||||||
hts_log_print(opt, LOG_DEBUG,
|
hts_log_print(opt, LOG_DEBUG,
|
||||||
"(during prefetch) %s (%d) to link %s at %s%s",
|
"(during prefetch) %s (%d) to link %s at %s%s",
|
||||||
@@ -633,33 +779,16 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
if (!has_been_moved) {
|
if (!has_been_moved) {
|
||||||
if (back[b].r.statuscode != -10) { // erreur
|
if (back[b].r.statuscode != -10) { // erreur
|
||||||
if (strnotempty(back[b].r.contenttype) == 0)
|
if (strnotempty(back[b].r.contenttype) == 0)
|
||||||
strcpybuff(back[b].r.contenttype, "text/html"); // message d'erreur en html
|
strcpybuff(back[b].r.contenttype,
|
||||||
|
HTS_UNKNOWN_MIME); // no declared type
|
||||||
// Finalement on, renvoie un erreur, pour ne toucher à rien dans le code
|
// Finalement on, renvoie un erreur, pour ne toucher à rien dans le code
|
||||||
// libérer emplacement backing
|
// libérer emplacement backing
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // pas d'erreur, changer type?
|
// no error: change the type?
|
||||||
char s[16];
|
ext_chg = resolve_extension(
|
||||||
|
opt, NULL, back[b].r.cdispo, back[b].r.contenttype,
|
||||||
s[0] = '\0';
|
back[b].url_fil, ext, sizeof(ext));
|
||||||
if (strnotempty(back[b].r.cdispo)) { /* filename given */
|
|
||||||
ext_chg = 2; /* change filename */
|
|
||||||
strcpybuff(ext, back[b].r.cdispo);
|
|
||||||
} else if (!may_unknown2(opt, back[b].r.contenttype, back[b].url_fil)) { // on peut patcher à priori? (pas interdit ou pas de type)
|
|
||||||
give_mimext(s, back[b].r.contenttype); // obtenir extension
|
|
||||||
if (strnotempty(s) > 0) { // on a reconnu l'extension
|
|
||||||
ext_chg = 1;
|
|
||||||
strcpybuff(ext, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef DEFAULT_BIN_EXT
|
|
||||||
// no extension and potentially bogus
|
|
||||||
else if (ishtest == -2) {
|
|
||||||
ext_chg = 1;
|
|
||||||
strcpybuff(ext, DEFAULT_BIN_EXT + 1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// FIN Si non déplacé, forcer type?
|
// FIN Si non déplacé, forcer type?
|
||||||
|
|
||||||
@@ -697,7 +826,7 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
}
|
}
|
||||||
// restaurer
|
// restaurer
|
||||||
opt->state._hts_in_html_parsing = hihp;
|
opt->state._hts_in_html_parsing = hihp;
|
||||||
} // caché?
|
} // caché?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -716,9 +845,9 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
strcatbuff(fil, DEFAULT_HTML); // nommer page par défaut (à priori ici html depuis un proxy http)
|
strcatbuff(fil, DEFAULT_HTML); // nommer page par défaut (à priori ici html depuis un proxy http)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Changer extension?
|
// Change the extension? e.g. php3 saved as html, cgi as html or gif/xbm
|
||||||
// par exemple, php3 sera sauvé en html, cgi en html ou gif, xbm etc.. selon les cas
|
// depending on the resolved type.
|
||||||
if (ext_chg && !opt->no_type_change) { // changer ext
|
if (ext_chg && !opt->no_type_change) {
|
||||||
char *a = fil + strlen(fil) - 1;
|
char *a = fil + strlen(fil) - 1;
|
||||||
|
|
||||||
if ((opt->debug > 1) && (opt->log != NULL)) {
|
if ((opt->debug > 1) && (opt->log != NULL)) {
|
||||||
@@ -730,11 +859,19 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
adr_complete, fil_complete, ext);
|
adr_complete, fil_complete, ext);
|
||||||
}
|
}
|
||||||
if (ext_chg == 1) {
|
if (ext_chg == 1) {
|
||||||
|
// Cut the old extension only when it is empty (a bare trailing dot), the
|
||||||
|
// new one, or a recognized one; an unknown trailing ".token" (e.g.
|
||||||
|
// /article-1.884291, #115) is part of the name, not an extension.
|
||||||
|
const char *const old_ext = get_ext(catbuff, sizeof(catbuff), fil);
|
||||||
|
const int known_ext = !*old_ext || strfield2(old_ext, ext) ||
|
||||||
|
is_knowntype(opt, fil) || is_dyntype(old_ext) ||
|
||||||
|
ishtml_ext(old_ext) != -1;
|
||||||
|
|
||||||
while((a > fil) && (*a != '.') && (*a != '/'))
|
while((a > fil) && (*a != '.') && (*a != '/'))
|
||||||
a--;
|
a--;
|
||||||
if (*a == '.')
|
if (*a == '.' && known_ext)
|
||||||
*a = '\0'; // couper
|
*a = '\0'; // cut
|
||||||
strcatbuff(fil, "."); // recopier point
|
strcatbuff(fil, "."); // re-add the dot
|
||||||
} else {
|
} else {
|
||||||
while((a > fil) && (*a != '/'))
|
while((a > fil) && (*a != '/'))
|
||||||
a--;
|
a--;
|
||||||
@@ -742,7 +879,7 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
a++;
|
a++;
|
||||||
*a = '\0';
|
*a = '\0';
|
||||||
}
|
}
|
||||||
strcatbuff(fil, ext); // copier ext/nom
|
strcatbuff(fil, ext); // append ext/name
|
||||||
}
|
}
|
||||||
// Rechercher premier / et dernier .
|
// Rechercher premier / et dernier .
|
||||||
{
|
{
|
||||||
@@ -924,7 +1061,7 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
|
|
||||||
pth[0] = n83[0] = '\0';
|
pth[0] = n83[0] = '\0';
|
||||||
strncatbuff(pth, fil, (int) (nom_pos - fil) - 1);
|
strncatbuff(pth, fil, (int) (nom_pos - fil) - 1);
|
||||||
long_to_83(opt->savename_83, n83, pth);
|
long_to_83(opt->savename_83, n83, sizeof(n83), pth);
|
||||||
htsbuff_cat(&sb, n83);
|
htsbuff_cat(&sb, n83);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1189,13 +1326,13 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
// Not used anymore unless non-delayed types.
|
// Not used anymore unless non-delayed types.
|
||||||
// de même en cas de manque d'extension on en place une de manière forcée..
|
// de même en cas de manque d'extension on en place une de manière forcée..
|
||||||
// cela évite les /chez/toto et les /chez/toto/index.html incompatibles
|
// cela évite les /chez/toto et les /chez/toto/index.html incompatibles
|
||||||
if (opt->savename_type != -1 && opt->savename_delayed != 2) {
|
if (opt->savename_type != -1 &&
|
||||||
|
opt->savename_delayed != HTS_SAVENAME_DELAYED_HARD) {
|
||||||
char *a = afs->save + strlen(afs->save) - 1;
|
char *a = afs->save + strlen(afs->save) - 1;
|
||||||
|
|
||||||
while((a > afs->save) && (*a != '.') && (*a != '/'))
|
while((a > afs->save) && (*a != '.') && (*a != '/'))
|
||||||
a--;
|
a--;
|
||||||
if (*a != '.') { // agh pas de point
|
if (*a != '.') { // agh pas de point
|
||||||
//strcatbuff(save,".none"); // a éviter
|
|
||||||
strcatbuff(afs->save, ".html"); // préférable!
|
strcatbuff(afs->save, ".html"); // préférable!
|
||||||
hts_log_print(opt, LOG_DEBUG, "Default HTML type set for %s%s => %s",
|
hts_log_print(opt, LOG_DEBUG, "Default HTML type set for %s%s => %s",
|
||||||
adr_complete, fil_complete, afs->save);
|
adr_complete, fil_complete, afs->save);
|
||||||
@@ -1235,31 +1372,21 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
size_t i;
|
size_t i;
|
||||||
for(i = 0 ; afs->save[i] != '\0' ; i++) {
|
for(i = 0 ; afs->save[i] != '\0' ; i++) {
|
||||||
unsigned char c = (unsigned char) afs->save[i];
|
unsigned char c = (unsigned char) afs->save[i];
|
||||||
if (c < 32 // control
|
if (c < 32 // control
|
||||||
|| c == 127 // unwise
|
|| c == 127 // unwise
|
||||||
|| c == '~' // unix unwise
|
|| c == '~' // unix unwise
|
||||||
|| c == '\\' // windows separator
|
|| c == '\\' // windows separator
|
||||||
|| c == ':' // windows forbidden
|
|| c == ':' // windows forbidden
|
||||||
|| c == '*' // windows forbidden
|
|| c == '*' // windows forbidden
|
||||||
|| c == '?' // windows forbidden
|
|| c == '?' // windows forbidden
|
||||||
|| c == '\"' // windows forbidden
|
|| c == '\"' // windows forbidden
|
||||||
|| c == '<' // windows forbidden
|
|| c == '<' // windows forbidden
|
||||||
|| c == '>' // windows forbidden
|
|| c == '>' // windows forbidden
|
||||||
|| c == '|' // windows forbidden
|
|| c == '|' // windows forbidden
|
||||||
//|| c == '@' // ?
|
//|| c == '@' // ?
|
||||||
||
|
|| (opt->savename_83 == HTS_SAVENAME_83_ISO9660 // CDROM
|
||||||
(
|
&& (c == '-' || c == '=' || c == '+'))) {
|
||||||
opt->savename_83 == 2 // CDROM
|
afs->save[i] = '_';
|
||||||
&&
|
|
||||||
(
|
|
||||||
c == '-'
|
|
||||||
|| c == '='
|
|
||||||
|| c == '+'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
afs->save[i] = '_';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1306,7 +1433,7 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
if (opt->savename_83) {
|
if (opt->savename_83) {
|
||||||
char BIGSTK n83[HTS_URLMAXSIZE * 2];
|
char BIGSTK n83[HTS_URLMAXSIZE * 2];
|
||||||
|
|
||||||
long_to_83(opt->savename_83, n83, afs->save);
|
long_to_83(opt->savename_83, n83, sizeof(n83), afs->save);
|
||||||
strcpybuff(afs->save, n83);
|
strcpybuff(afs->save, n83);
|
||||||
}
|
}
|
||||||
// enforce stricter ISO9660 compliance (bug reported by Steffo Carlsson)
|
// enforce stricter ISO9660 compliance (bug reported by Steffo Carlsson)
|
||||||
@@ -1343,17 +1470,6 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
fil_simplifie(afs->save);
|
fil_simplifie(afs->save);
|
||||||
|
|
||||||
/* convert name to UTF-8 ? Note: already done while parsing. */
|
/* convert name to UTF-8 ? Note: already done while parsing. */
|
||||||
//if (charset != NULL && charset[0] != '\0') {
|
|
||||||
// char *const s = hts_convertStringToUTF8(save, (int) strlen(save), charset);
|
|
||||||
|
|
||||||
// if (s != NULL) {
|
|
||||||
// hts_log_print(opt, LOG_DEBUG,
|
|
||||||
// "engine: save-name: charset conversion from '%s' to '%s' using charset '%s'",
|
|
||||||
// save, s, charset);
|
|
||||||
// strcpybuff(save, s);
|
|
||||||
// free(s);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
/* callback */
|
/* callback */
|
||||||
RUN_CALLBACK5(opt, savename, adr_complete, fil_complete, referer_adr,
|
RUN_CALLBACK5(opt, savename, adr_complete, fil_complete, referer_adr,
|
||||||
@@ -1377,7 +1493,9 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
if (lastDot == NULL) {
|
if (lastDot == NULL) {
|
||||||
strcatbuff(afs->save, "." DELAYED_EXT);
|
strcatbuff(afs->save, "." DELAYED_EXT);
|
||||||
} else if (!IS_DELAYED_EXT(afs->save)) {
|
} else if (!IS_DELAYED_EXT(afs->save)) {
|
||||||
strcatbuff(lastDot, "." DELAYED_EXT);
|
/* lastDot points within afs->save; bound by the remaining capacity */
|
||||||
|
strlcatbuff(lastDot, "." DELAYED_EXT,
|
||||||
|
sizeof(afs->save) - (size_t) (lastDot - afs->save));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// enforce 260-character path limit before inserting destination path
|
// enforce 260-character path limit before inserting destination path
|
||||||
@@ -1499,10 +1617,6 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
int sameAdr = (strfield2(heap(i)->adr, normadr) != 0);
|
int sameAdr = (strfield2(heap(i)->adr, normadr) != 0);
|
||||||
int sameFil;
|
int sameFil;
|
||||||
|
|
||||||
// NO - URL hack is only for stripping // and www.
|
|
||||||
//if (opt->urlhack != 0)
|
|
||||||
// sameFil = ( strfield2(heap(i)->fil, normfil) != 0);
|
|
||||||
//else
|
|
||||||
sameFil = (strcmp(heap(i)->fil, normfil) == 0);
|
sameFil = (strcmp(heap(i)->fil, normfil) == 0);
|
||||||
if (sameAdr && sameFil) { // ok c'est le même lien, adresse déja définie
|
if (sameAdr && sameFil) { // ok c'est le même lien, adresse déja définie
|
||||||
/* Take the existing name not to screw up with cAsE sEnSiTiViTy of Linux/Unix */
|
/* Take the existing name not to screw up with cAsE sEnSiTiViTy of Linux/Unix */
|
||||||
@@ -1518,7 +1632,8 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
char *a = afs->save + strlen(afs->save) - 1;
|
char *a = afs->save + strlen(afs->save) - 1;
|
||||||
char *b;
|
char *b;
|
||||||
int n = 2;
|
int n = 2;
|
||||||
char collisionSeparator = ((opt->savename_83 != 2) ? '-' : '_');
|
char collisionSeparator =
|
||||||
|
((opt->savename_83 != HTS_SAVENAME_83_ISO9660) ? '-' : '_');
|
||||||
|
|
||||||
tempo[0] = '\0';
|
tempo[0] = '\0';
|
||||||
|
|
||||||
@@ -1567,56 +1682,52 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
|
|
||||||
strcpybuff(afs->save, tempo);
|
strcpybuff(afs->save, tempo);
|
||||||
|
|
||||||
//printf("switched: %s\n",save);
|
|
||||||
|
|
||||||
} // if
|
} // if
|
||||||
}
|
}
|
||||||
#if DEBUG_SAVENAME
|
#if DEBUG_SAVENAME
|
||||||
printf("\nEnd search, %s\n", fil_complete);
|
printf("\nEnd search, %s\n", fil_complete);
|
||||||
#endif
|
#endif
|
||||||
} while(!nom_ok);
|
} while (!nom_ok);
|
||||||
|
|
||||||
}
|
}
|
||||||
//printf("'%s' %s %s\n",save,adr,fil);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nom avec md5 urilisé partout */
|
/* md5-based name used everywhere; builds into b (capacity bsize) */
|
||||||
void standard_name(char *b, const char *dot_pos, const char *nom_pos, const char *fil,
|
void standard_name(char *b, size_t bsize, const char *dot_pos,
|
||||||
int short_ver) {
|
const char *nom_pos, const char *fil, int short_ver) {
|
||||||
char md5[32 + 2];
|
char md5[32 + 2];
|
||||||
|
htsbuff bb = htsbuff_ptr(b, bsize);
|
||||||
|
|
||||||
b[0] = '\0';
|
/* Name */
|
||||||
/* Nom */
|
|
||||||
if (dot_pos) {
|
if (dot_pos) {
|
||||||
if (!short_ver) // Noms longs
|
if (!short_ver) // long names
|
||||||
strncatbuff(b, nom_pos, (dot_pos - nom_pos));
|
htsbuff_catn(&bb, nom_pos, (size_t) (dot_pos - nom_pos));
|
||||||
else
|
else
|
||||||
strncatbuff(b, nom_pos, min(dot_pos - nom_pos, 8));
|
htsbuff_catn(&bb, nom_pos, (size_t) min(dot_pos - nom_pos, 8));
|
||||||
} else {
|
} else {
|
||||||
if (!short_ver) // Noms longs
|
if (!short_ver) // long names
|
||||||
strcatbuff(b, nom_pos);
|
htsbuff_cat(&bb, nom_pos);
|
||||||
else
|
else
|
||||||
strncatbuff(b, nom_pos, 8);
|
htsbuff_catn(&bb, nom_pos, 8);
|
||||||
}
|
}
|
||||||
/* MD5 - 16 bits */
|
/* MD5 - 16 bits */
|
||||||
strncatbuff(b, url_md5(md5, fil), 4);
|
htsbuff_catn(&bb, url_md5(md5, fil), 4);
|
||||||
/* Ext */
|
/* Ext */
|
||||||
if (dot_pos) {
|
if (dot_pos) {
|
||||||
strcatbuff(b, ".");
|
htsbuff_catc(&bb, '.');
|
||||||
if (!short_ver) // Noms longs
|
if (!short_ver) // long names
|
||||||
strcatbuff(b, dot_pos + 1);
|
htsbuff_cat(&bb, dot_pos + 1);
|
||||||
else
|
else
|
||||||
strncatbuff(b, dot_pos + 1, 3);
|
htsbuff_catn(&bb, dot_pos + 1, 3);
|
||||||
}
|
}
|
||||||
// Allow extensionless
|
// Allow extensionless
|
||||||
#ifdef DO_NOT_ALLOW_EXTENSIONLESS
|
#ifdef DO_NOT_ALLOW_EXTENSIONLESS
|
||||||
else {
|
else {
|
||||||
if (!short_ver) // Noms longs
|
if (!short_ver) // long names
|
||||||
strcatbuff(b, DEFAULT_EXT);
|
htsbuff_cat(&bb, DEFAULT_EXT);
|
||||||
else
|
else
|
||||||
strcatbuff(b, DEFAULT_EXT_SHORT);
|
htsbuff_cat(&bb, DEFAULT_EXT_SHORT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1683,10 +1794,10 @@ char *url_savename_refname_fullpath(httrackp * opt, const char *adr,
|
|||||||
StringBuff(opt->path_log), digest_filename);
|
StringBuff(opt->path_log), digest_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove refname if any */
|
/* remove refname if any; HTS_TRUE if it was removed */
|
||||||
void url_savename_refname_remove(httrackp * opt, const char *adr,
|
hts_boolean url_savename_refname_remove(httrackp *opt, const char *adr,
|
||||||
const char *fil) {
|
const char *fil) {
|
||||||
char *filename = url_savename_refname_fullpath(opt, adr, fil);
|
char *filename = url_savename_refname_fullpath(opt, adr, fil);
|
||||||
|
|
||||||
(void) UNLINK(filename);
|
return UNLINK(filename) == 0 ? HTS_TRUE : HTS_FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,16 +96,19 @@ int url_savename(lien_adrfilsave *const afs,
|
|||||||
httrackp * opt, struct_back * sback, cache_back * cache,
|
httrackp * opt, struct_back * sback, cache_back * cache,
|
||||||
hash_struct * hash, int ptr, int numero_passe,
|
hash_struct * hash, int ptr, int numero_passe,
|
||||||
const lien_back * headers);
|
const lien_back * headers);
|
||||||
void standard_name(char *b, const char *dot_pos, const char *nom_pos,
|
void standard_name(char *b, size_t bsize, const char *dot_pos,
|
||||||
const char *fil_complete,
|
const char *nom_pos, const char *fil_complete,
|
||||||
int short_ver);
|
int short_ver);
|
||||||
void url_savename_addstr(char *d, const char *s);
|
void url_savename_addstr(char *d, const char *s);
|
||||||
|
/* Contested wire-vs-ext verdict that a body sniff could settle (htssniff.h). */
|
||||||
|
int hts_ext_sniff_wanted(httrackp *opt, const char *wiremime, const char *file);
|
||||||
char *url_md5(char *digest_buffer, const char *fil_complete);
|
char *url_md5(char *digest_buffer, const char *fil_complete);
|
||||||
void url_savename_refname(const char *adr, const char *fil, char *filename);
|
void url_savename_refname(const char *adr, const char *fil, char *filename);
|
||||||
char *url_savename_refname_fullpath(httrackp * opt, const char *adr,
|
char *url_savename_refname_fullpath(httrackp * opt, const char *adr,
|
||||||
const char *fil);
|
const char *fil);
|
||||||
void url_savename_refname_remove(httrackp * opt, const char *adr,
|
/* Remove the temp-ref for (adr,fil); HTS_TRUE if it was removed. */
|
||||||
const char *fil);
|
hts_boolean url_savename_refname_remove(httrackp *opt, const char *adr,
|
||||||
|
const char *fil);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
191
src/htsnet.h
191
src/htsnet.h
@@ -32,6 +32,11 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/* Author: Xavier Roche */
|
/* Author: Xavier Roche */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** @file htsnet.h
|
||||||
|
Socket/connection layer. Provides SOCaddr, an opaque IPv4/IPv6
|
||||||
|
socket-address wrapper, plus accessor macros so callers never branch on
|
||||||
|
address family. Builds on htsbasenet.h. */
|
||||||
|
|
||||||
#ifndef HTS_DEFNETH
|
#ifndef HTS_DEFNETH
|
||||||
#define HTS_DEFNETH
|
#define HTS_DEFNETH
|
||||||
|
|
||||||
@@ -43,32 +48,32 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// pour read
|
// for read
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
// pour FindFirstFile
|
// for FindFirstFile
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
typedef USHORT in_port_t;
|
typedef USHORT in_port_t;
|
||||||
|
|
||||||
typedef ADDRESS_FAMILY sa_family_t;
|
typedef ADDRESS_FAMILY sa_family_t;
|
||||||
#else
|
#else
|
||||||
//typedef int T_SOC;
|
|
||||||
#define INVALID_SOCKET -1
|
#define INVALID_SOCKET -1
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
/* Force for sun env. */
|
/* Force BSD_COMP for Sun environments. */
|
||||||
#ifndef BSD_COMP
|
#ifndef BSD_COMP
|
||||||
#define BSD_COMP
|
#define BSD_COMP
|
||||||
#endif
|
#endif
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
/* gethostname & co */
|
/* gethostname & co */
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
/* inet_addr */
|
/* inet_addr */
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
// pas la peine normalement..
|
/* normally not needed; provide in_addr_t where the platform lacks it */
|
||||||
#ifndef HTS_DO_NOT_REDEFINE_in_addr_t
|
#ifndef HTS_DO_NOT_REDEFINE_in_addr_t
|
||||||
typedef unsigned long in_addr_t;
|
typedef unsigned long in_addr_t;
|
||||||
#endif
|
#endif
|
||||||
@@ -78,14 +83,16 @@ typedef unsigned long in_addr_t;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Ipv4 structures */
|
/** Raw IP address type: in6_addr when IPv6 is enabled, else in_addr. */
|
||||||
#if HTS_INET6 != 0
|
#if HTS_INET6 != 0
|
||||||
typedef struct in6_addr INaddr;
|
typedef struct in6_addr INaddr;
|
||||||
#else
|
#else
|
||||||
typedef struct in_addr INaddr;
|
typedef struct in_addr INaddr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This should handle all cases */
|
/** Opaque socket address holding either an IPv4 or IPv6 endpoint. Use the
|
||||||
|
SOCaddr_* accessors rather than touching m_addr; sa_family selects the
|
||||||
|
active union member. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_SOCaddr
|
#ifndef HTS_DEF_FWSTRUCT_SOCaddr
|
||||||
#define HTS_DEF_FWSTRUCT_SOCaddr
|
#define HTS_DEF_FWSTRUCT_SOCaddr
|
||||||
typedef struct SOCaddr SOCaddr;
|
typedef struct SOCaddr SOCaddr;
|
||||||
@@ -103,10 +110,12 @@ struct SOCaddr {
|
|||||||
} m_addr;
|
} m_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED in_port_t* SOCaddr_sinport_(SOCaddr *const addr,
|
/** Pointer to the port field (network byte order) for the active family.
|
||||||
const char *file, const int line) {
|
Asserts on NULL or an unset/unknown family. */
|
||||||
|
static HTS_INLINE HTS_UNUSED in_port_t *
|
||||||
|
SOCaddr_sinport_(SOCaddr *const addr, const char *file, const int line) {
|
||||||
assertf_(addr != NULL, file, line);
|
assertf_(addr != NULL, file, line);
|
||||||
switch(addr->m_addr.sa.sa_family) {
|
switch (addr->m_addr.sa.sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return &addr->m_addr.in.sin_port;
|
return &addr->m_addr.in.sin_port;
|
||||||
break;
|
break;
|
||||||
@@ -116,16 +125,19 @@ static HTS_INLINE HTS_UNUSED in_port_t* SOCaddr_sinport_(SOCaddr *const addr,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
assertf_(! "invalid structure", file, line);
|
assertf_(!"invalid structure", file, line);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED socklen_t SOCaddr_size_(const SOCaddr*const addr,
|
/** Length of the active sockaddr (sockaddr_in or sockaddr_in6), or 0 if the
|
||||||
const char *file, const int line) {
|
family is unset/unknown. The 0 case doubles as the "not valid" test. */
|
||||||
|
static HTS_INLINE HTS_UNUSED socklen_t SOCaddr_size_(const SOCaddr *const addr,
|
||||||
|
const char *file,
|
||||||
|
const int line) {
|
||||||
assertf_(addr != NULL, file, line);
|
assertf_(addr != NULL, file, line);
|
||||||
switch(addr->m_addr.sa.sa_family) {
|
switch (addr->m_addr.sa.sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return sizeof(addr->m_addr.in);
|
return sizeof(addr->m_addr.in);
|
||||||
break;
|
break;
|
||||||
@@ -140,51 +152,77 @@ static HTS_INLINE HTS_UNUSED socklen_t SOCaddr_size_(const SOCaddr*const addr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED void SOCaddr_clear_(SOCaddr*const addr,
|
/** Reset to the unset state (family AF_UNSPEC), making the address invalid. */
|
||||||
const char *file, const int line) {
|
static HTS_INLINE HTS_UNUSED void
|
||||||
|
SOCaddr_clear_(SOCaddr *const addr, const char *file, const int line) {
|
||||||
assertf_(addr != NULL, file, line);
|
assertf_(addr != NULL, file, line);
|
||||||
addr->m_addr.sa.sa_family = AF_UNSPEC;
|
addr->m_addr.sa.sa_family = AF_UNSPEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ipv4/6 structure members */
|
/* SOCaddr accessors; server is an lvalue SOCaddr, not a pointer. */
|
||||||
#define SOCaddr_sinfamily(server) ((server).m_addr.sa.sa_family)
|
#define SOCaddr_sinfamily(server) \
|
||||||
#define SOCaddr_sinport(server) (*SOCaddr_sinport_(&(server), __FILE__, __LINE__))
|
((server).m_addr.sa.sa_family) /* AF_INET / AF_INET6 */
|
||||||
#define SOCaddr_size(server) (SOCaddr_size_(&(server), __FILE__, __LINE__))
|
|
||||||
#define SOCaddr_is_valid(server) (SOCaddr_size_(&(server), __FILE__, __LINE__) != 0 )
|
|
||||||
#define SOCaddr_clear(server) SOCaddr_clear_(&(server), __FILE__, __LINE__)
|
|
||||||
#define SOCaddr_sockaddr(server) ((server).m_addr.sa)
|
|
||||||
#define SOCaddr_capacity(server) sizeof((server).m_addr)
|
|
||||||
|
|
||||||
/* AF_xx */
|
#define SOCaddr_sinport(server) \
|
||||||
|
(*SOCaddr_sinport_(&(server), __FILE__, \
|
||||||
|
__LINE__)) /* port lvalue (network order) */
|
||||||
|
|
||||||
|
#define SOCaddr_size(server) \
|
||||||
|
(SOCaddr_size_(&(server), __FILE__, __LINE__)) /* active sockaddr length */
|
||||||
|
|
||||||
|
#define SOCaddr_is_valid(server) \
|
||||||
|
(SOCaddr_size_(&(server), __FILE__, __LINE__) != \
|
||||||
|
0) /* nonzero if family is set */
|
||||||
|
|
||||||
|
#define SOCaddr_clear(server) SOCaddr_clear_(&(server), __FILE__, __LINE__)
|
||||||
|
|
||||||
|
#define SOCaddr_sockaddr(server) \
|
||||||
|
((server).m_addr.sa) /* generic struct sockaddr view */
|
||||||
|
|
||||||
|
#define SOCaddr_capacity(server) \
|
||||||
|
sizeof((server).m_addr) /* full union size, for recvfrom() etc. */
|
||||||
|
|
||||||
|
/** Address family to bind/listen with: AF_INET6 when IPv6 is enabled (dual
|
||||||
|
stack), else AF_INET. */
|
||||||
#if HTS_INET6 != 0
|
#if HTS_INET6 != 0
|
||||||
#define AFinet AF_INET6
|
#define AFinet AF_INET6
|
||||||
#else
|
#else
|
||||||
#define AFinet AF_INET
|
#define AFinet AF_INET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set port to sockaddr structure */
|
/** Set the port (host-order argument, stored network-order) on the active
|
||||||
#define SOCaddr_initport(server, port) do { \
|
* family. */
|
||||||
SOCaddr_sinport(server) = htons((in_port_t) (port)); \
|
#define SOCaddr_initport(server, port) \
|
||||||
} while(0)
|
do { \
|
||||||
|
SOCaddr_sinport(server) = htons((in_port_t) (port)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED socklen_t SOCaddr_initany_(SOCaddr*const addr,
|
/** Initialize as an all-zero IPv4 wildcard (INADDR_ANY) address; returns its
|
||||||
const char *file, const int line) {
|
sockaddr length. */
|
||||||
|
static HTS_INLINE HTS_UNUSED socklen_t SOCaddr_initany_(SOCaddr *const addr,
|
||||||
|
const char *file,
|
||||||
|
const int line) {
|
||||||
assertf_(addr != NULL, file, line);
|
assertf_(addr != NULL, file, line);
|
||||||
memset(&addr->m_addr.in, 0, sizeof(addr->m_addr.in));
|
memset(&addr->m_addr.in, 0, sizeof(addr->m_addr.in));
|
||||||
addr->m_addr.in.sin_family = AF_INET;
|
addr->m_addr.in.sin_family = AF_INET;
|
||||||
return SOCaddr_size_(addr, file, line);
|
return SOCaddr_size_(addr, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SOCaddr_initany(server) do { \
|
/** Initialize server as an IPv4 wildcard (INADDR_ANY) address. */
|
||||||
SOCaddr_initany_(&(server), __FILE__, __LINE__); \
|
#define SOCaddr_initany(server) \
|
||||||
} while(0)
|
do { \
|
||||||
|
SOCaddr_initany_(&(server), __FILE__, __LINE__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/*
|
/** Populate server from data. data_size selects the source form: a full
|
||||||
Copy sockaddr_in/sockaddr_in6/raw IPv4/raw IPv6 to our opaque SOCaddr
|
sockaddr_in / sockaddr_in6, or a raw 4-byte (IPv4) / 16-byte (IPv6) address
|
||||||
*/
|
with port zeroed. Any other size leaves an AF_INET shell. Returns the
|
||||||
static HTS_UNUSED socklen_t SOCaddr_copyaddr_(SOCaddr*const server,
|
resulting sockaddr length. */
|
||||||
const void *data, const size_t data_size,
|
static HTS_UNUSED socklen_t SOCaddr_copyaddr_(SOCaddr *const server,
|
||||||
const char *file, const int line) {
|
const void *data,
|
||||||
|
const size_t data_size,
|
||||||
|
const char *file,
|
||||||
|
const int line) {
|
||||||
assertf_(server != NULL, file, line);
|
assertf_(server != NULL, file, line);
|
||||||
assertf_(data != NULL, file, line);
|
assertf_(data != NULL, file, line);
|
||||||
|
|
||||||
@@ -214,30 +252,37 @@ static HTS_UNUSED socklen_t SOCaddr_copyaddr_(SOCaddr*const server,
|
|||||||
return SOCaddr_size_(server, file, line);
|
return SOCaddr_size_(server, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SOCaddr_copyaddr(server, server_len, hpaddr, hpsize) do { \
|
/** Copy hpaddr (length hpsize) into server, writing the result length into the
|
||||||
server_len = (int) SOCaddr_copyaddr_(&(server), hpaddr, hpsize, __FILE__, __LINE__); \
|
lvalue server_len (int). See SOCaddr_copyaddr_ for accepted forms. */
|
||||||
} while(0)
|
#define SOCaddr_copyaddr(server, server_len, hpaddr, hpsize) \
|
||||||
|
do { \
|
||||||
|
server_len = (int) SOCaddr_copyaddr_(&(server), hpaddr, hpsize, __FILE__, \
|
||||||
|
__LINE__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define SOCaddr_copyaddr2(server, hpaddr, hpsize) do { \
|
/** Like SOCaddr_copyaddr but discards the result length. */
|
||||||
(void) SOCaddr_copyaddr_(&(server), hpaddr, hpsize, __FILE__, __LINE__); \
|
#define SOCaddr_copyaddr2(server, hpaddr, hpsize) \
|
||||||
} while(0)
|
do { \
|
||||||
|
(void) SOCaddr_copyaddr_(&(server), hpaddr, hpsize, __FILE__, __LINE__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define SOCaddr_copy_SOCaddr(dest, src) do { \
|
/** Copy one SOCaddr (src) into another (dest), preserving family and port. */
|
||||||
SOCaddr_copyaddr_(&(dest), &(src).m_addr.sa, SOCaddr_size(src), __FILE__, __LINE__); \
|
#define SOCaddr_copy_SOCaddr(dest, src) \
|
||||||
} while(0)
|
do { \
|
||||||
|
SOCaddr_copyaddr_(&(dest), &(src).m_addr.sa, SOCaddr_size(src), __FILE__, \
|
||||||
|
__LINE__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/* Get dotted address */
|
/** Write the numeric (dotted/colon) host of ss into namebuf (capacity
|
||||||
|
namebuflen), scope id stripped. On failure namebuf becomes "". */
|
||||||
static HTS_UNUSED void SOCaddr_inetntoa_(char *namebuf, size_t namebuflen,
|
static HTS_UNUSED void SOCaddr_inetntoa_(char *namebuf, size_t namebuflen,
|
||||||
SOCaddr *const ss,
|
SOCaddr *const ss, const char *file,
|
||||||
const char *file, const int line) {
|
const int line) {
|
||||||
assertf_(namebuf != NULL, file, line);
|
assertf_(namebuf != NULL, file, line);
|
||||||
assertf_(ss != NULL, file, line);
|
assertf_(ss != NULL, file, line);
|
||||||
|
|
||||||
if (getnameinfo(&ss->m_addr.sa, sizeof(ss->m_addr),
|
if (getnameinfo(&ss->m_addr.sa, sizeof(ss->m_addr), namebuf, namebuflen, NULL,
|
||||||
namebuf, namebuflen,
|
0, NI_NUMERICHOST) == 0) {
|
||||||
NULL, 0,
|
|
||||||
NI_NUMERICHOST) == 0) {
|
|
||||||
/* remove scope id(s) */
|
/* remove scope id(s) */
|
||||||
char *const pos = strchr(namebuf, '%');
|
char *const pos = strchr(namebuf, '%');
|
||||||
if (pos != NULL) {
|
if (pos != NULL) {
|
||||||
@@ -248,15 +293,33 @@ static HTS_UNUSED void SOCaddr_inetntoa_(char *namebuf, size_t namebuflen,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SOCaddr_inetntoa(namebuf, namebuflen, ss) \
|
/** Numeric host of ss into namebuf (capacity namebuflen); "" on failure. */
|
||||||
|
#define SOCaddr_inetntoa(namebuf, namebuflen, ss) \
|
||||||
SOCaddr_inetntoa_(namebuf, namebuflen, &(ss), __FILE__, __LINE__)
|
SOCaddr_inetntoa_(namebuf, namebuflen, &(ss), __FILE__, __LINE__)
|
||||||
|
|
||||||
/* Get protocol ID */
|
/** Single-char family tag: '1' for IPv4, '2' otherwise (used in the cache). */
|
||||||
#define SOCaddr_getproto(ss) ( SOCaddr_size(ss) == sizeof(struct sockaddr_in) ? '1' : '2')
|
#define SOCaddr_getproto(ss) \
|
||||||
|
(SOCaddr_size(ss) == sizeof(struct sockaddr_in) ? '1' : '2')
|
||||||
|
|
||||||
/* Socket length type */
|
/** Length type for socket APIs (getsockname, accept, ...). */
|
||||||
typedef socklen_t SOClen;
|
typedef socklen_t SOClen;
|
||||||
|
|
||||||
|
#if HTS_INET6 != 0
|
||||||
|
/** Resolver backend: getaddrinfo/freeaddrinfo as a swappable pair, so the
|
||||||
|
self-test can script DNS answers (families, multiplicity, errors)
|
||||||
|
in-process. The free function must match its getaddrinfo (a fake allocates
|
||||||
|
its own chain), hence the pair. */
|
||||||
|
typedef struct hts_resolver_backend {
|
||||||
|
int (*getaddrinfo)(const char *node, const char *service,
|
||||||
|
const struct addrinfo *hints, struct addrinfo **res);
|
||||||
|
void (*freeaddrinfo)(struct addrinfo *res);
|
||||||
|
} hts_resolver_backend;
|
||||||
|
|
||||||
|
/** Install a resolver backend for the process; NULL restores the libc default.
|
||||||
|
Test-only seam, not thread-safe; callers must serialize against resolves. */
|
||||||
|
void hts_dns_set_resolver_backend(const hts_resolver_backend *backend);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
702
src/htsopt.h
702
src/htsopt.h
@@ -72,6 +72,7 @@ typedef struct String String;
|
|||||||
#endif
|
#endif
|
||||||
#ifndef HTS_DEF_STRUCT_String
|
#ifndef HTS_DEF_STRUCT_String
|
||||||
#define HTS_DEF_STRUCT_String
|
#define HTS_DEF_STRUCT_String
|
||||||
|
|
||||||
struct String {
|
struct String {
|
||||||
char *buffer_;
|
char *buffer_;
|
||||||
size_t length_;
|
size_t length_;
|
||||||
@@ -80,39 +81,41 @@ struct String {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Defines */
|
/* Defines */
|
||||||
#define CATBUFF_SIZE (STRING_SIZE*2*2)
|
#define CATBUFF_SIZE (STRING_SIZE * 2 * 2)
|
||||||
|
|
||||||
#define STRING_SIZE 2048
|
#define STRING_SIZE 2048
|
||||||
|
|
||||||
/* Proxy structure */
|
/* Proxy configuration. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_t_proxy
|
#ifndef HTS_DEF_FWSTRUCT_t_proxy
|
||||||
#define HTS_DEF_FWSTRUCT_t_proxy
|
#define HTS_DEF_FWSTRUCT_t_proxy
|
||||||
typedef struct t_proxy t_proxy;
|
typedef struct t_proxy t_proxy;
|
||||||
#endif
|
#endif
|
||||||
struct t_proxy {
|
struct t_proxy {
|
||||||
int active;
|
int active; /**< nonzero if a proxy is configured */
|
||||||
String name;
|
String name; /**< proxy host name */
|
||||||
int port;
|
int port; /**< proxy port */
|
||||||
String bindhost; // bind this host
|
String bindhost; /**< local address to bind the outgoing socket to */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Structure utile pour copier en bloc les paramètres */
|
/* Bundle of filter pointers, kept together for bulk copy. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsfilters
|
#ifndef HTS_DEF_FWSTRUCT_htsfilters
|
||||||
#define HTS_DEF_FWSTRUCT_htsfilters
|
#define HTS_DEF_FWSTRUCT_htsfilters
|
||||||
typedef struct htsfilters htsfilters;
|
typedef struct htsfilters htsfilters;
|
||||||
#endif
|
#endif
|
||||||
struct htsfilters {
|
struct htsfilters {
|
||||||
char ***filters;
|
char ***filters; /**< pointer to the +/-pattern filter array */
|
||||||
int *filptr;
|
int *filptr; /**< pointer to the current filter count */
|
||||||
//int* filter_max;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* User callbacks chain */
|
/* User callbacks chain */
|
||||||
typedef int (*htscallbacksfncptr) (void);
|
typedef int (*htscallbacksfncptr)(void);
|
||||||
|
|
||||||
typedef struct htscallbacks htscallbacks;
|
typedef struct htscallbacks htscallbacks;
|
||||||
|
|
||||||
struct htscallbacks {
|
struct htscallbacks {
|
||||||
void *moduleHandle;
|
void *moduleHandle; /**< handle of the module that registered the callback */
|
||||||
htscallbacksfncptr exitFnc;
|
htscallbacksfncptr exitFnc; /**< function to run on engine exit */
|
||||||
htscallbacks *next;
|
htscallbacks *next; /**< next entry in the callback chain */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* filenote() internal file structure */
|
/* filenote() internal file structure */
|
||||||
@@ -176,6 +179,7 @@ typedef struct lien_url lien_url;
|
|||||||
|
|
||||||
#ifndef HTS_DEF_DEFSTRUCT_hts_log_type
|
#ifndef HTS_DEF_DEFSTRUCT_hts_log_type
|
||||||
#define HTS_DEF_DEFSTRUCT_hts_log_type
|
#define HTS_DEF_DEFSTRUCT_hts_log_type
|
||||||
|
|
||||||
typedef enum hts_log_type {
|
typedef enum hts_log_type {
|
||||||
LOG_PANIC,
|
LOG_PANIC,
|
||||||
LOG_ERROR,
|
LOG_ERROR,
|
||||||
@@ -188,14 +192,14 @@ typedef enum hts_log_type {
|
|||||||
} hts_log_type;
|
} hts_log_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Structure état du miroir */
|
/* Mirror cancellation list node. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsoptstatecancel
|
#ifndef HTS_DEF_FWSTRUCT_htsoptstatecancel
|
||||||
#define HTS_DEF_FWSTRUCT_htsoptstatecancel
|
#define HTS_DEF_FWSTRUCT_htsoptstatecancel
|
||||||
typedef struct htsoptstatecancel htsoptstatecancel;
|
typedef struct htsoptstatecancel htsoptstatecancel;
|
||||||
#endif
|
#endif
|
||||||
struct htsoptstatecancel {
|
struct htsoptstatecancel {
|
||||||
char *url;
|
char *url; /**< URL flagged to be cancelled */
|
||||||
htsoptstatecancel *next;
|
htsoptstatecancel *next; /**< next cancellation entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Mutexes */
|
/* Mutexes */
|
||||||
@@ -210,48 +214,48 @@ typedef struct htsmutex_s htsmutex_s, *htsmutex;
|
|||||||
typedef struct struct_coucal struct_coucal, *coucal;
|
typedef struct struct_coucal struct_coucal, *coucal;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Structure état du miroir */
|
/* Mirror runtime state (mutable engine state, not user options). */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsoptstate
|
#ifndef HTS_DEF_FWSTRUCT_htsoptstate
|
||||||
#define HTS_DEF_FWSTRUCT_htsoptstate
|
#define HTS_DEF_FWSTRUCT_htsoptstate
|
||||||
typedef struct htsoptstate htsoptstate;
|
typedef struct htsoptstate htsoptstate;
|
||||||
#endif
|
#endif
|
||||||
struct htsoptstate {
|
struct htsoptstate {
|
||||||
htsmutex lock; /* 3.41 */
|
htsmutex lock; /**< guards this state block */
|
||||||
/* */
|
/* */
|
||||||
int stop;
|
int stop; /**< set to request the mirror to stop */
|
||||||
int exit_xh;
|
int exit_xh;
|
||||||
int back_add_stats;
|
int back_add_stats;
|
||||||
/* */
|
/* */
|
||||||
int mimehtml_created;
|
int mimehtml_created; /**< MIME/MHTML output already started */
|
||||||
String mimemid;
|
String mimemid; /**< MIME multipart boundary id */
|
||||||
FILE *mimefp;
|
FILE *mimefp; /**< MIME/MHTML output file */
|
||||||
int delayedId;
|
int delayedId; /**< counter for delayed-type-check ids */
|
||||||
/* */
|
/* */
|
||||||
filenote_strc strc;
|
filenote_strc strc; /**< filenote() listing state */
|
||||||
/* Functions context (avoir thread variables!) */
|
/* Per-call function contexts (thread-local scratch, avoids globals) */
|
||||||
htscallbacks callbacks;
|
htscallbacks callbacks; /**< user callback chain head */
|
||||||
concat_strc concat;
|
concat_strc concat; /**< concat() rotating buffers */
|
||||||
usercommand_strc usercmd;
|
usercommand_strc usercmd; /**< pending user shell command */
|
||||||
fspc_strc fspc;
|
fspc_strc fspc; /**< error/warning/info counters */
|
||||||
char *userhttptype;
|
char *userhttptype;
|
||||||
int verif_backblue_done;
|
int verif_backblue_done; /**< backblue.gif/fade.gif already emitted */
|
||||||
int verif_external_status;
|
int verif_external_status;
|
||||||
t_dnscache *dns_cache;
|
coucal dns_cache; /**< DNS resolution cache: hostname -> t_dnscache record */
|
||||||
int dns_cache_nthreads;
|
int dns_cache_nthreads; /**< number of in-flight DNS resolver threads */
|
||||||
/* HTML parsing state */
|
/* HTML parsing state */
|
||||||
char _hts_errmsg[HTS_CDLMAXSIZE + 256];
|
char _hts_errmsg[HTS_CDLMAXSIZE + 256]; /**< last engine error message */
|
||||||
int _hts_in_html_parsing;
|
int _hts_in_html_parsing;
|
||||||
int _hts_in_html_done;
|
int _hts_in_html_done;
|
||||||
int _hts_in_html_poll;
|
int _hts_in_html_poll;
|
||||||
int _hts_setpause;
|
int _hts_setpause;
|
||||||
int _hts_in_mirror;
|
int _hts_in_mirror; /**< nonzero while a mirror is running */
|
||||||
char **_hts_addurl;
|
char **_hts_addurl; /**< extra URLs to inject at runtime */
|
||||||
int _hts_cancel;
|
int _hts_cancel;
|
||||||
htsoptstatecancel *cancel; /* 3.41 */
|
htsoptstatecancel *cancel; /**< list of URLs flagged for cancellation */
|
||||||
char HTbuff[2048];
|
char HTbuff[2048];
|
||||||
unsigned int debug_state;
|
unsigned int debug_state;
|
||||||
unsigned int tmpnameid; /* 3.41 */
|
unsigned int tmpnameid; /**< counter for temporary file names */
|
||||||
int is_ended; /* 3.48-14 */
|
int is_ended; /**< mirror has finished */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Library handles */
|
/* Library handles */
|
||||||
@@ -264,198 +268,327 @@ typedef struct htslibhandles htslibhandles;
|
|||||||
typedef struct htslibhandle htslibhandle;
|
typedef struct htslibhandle htslibhandle;
|
||||||
#endif
|
#endif
|
||||||
struct htslibhandle {
|
struct htslibhandle {
|
||||||
char *moduleName;
|
char *moduleName; /**< name of a loaded external module */
|
||||||
void *handle;
|
void *handle; /**< dlopen() handle for it */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct htslibhandles {
|
struct htslibhandles {
|
||||||
int count;
|
int count; /**< number of loaded module handles */
|
||||||
htslibhandle *handles;
|
htslibhandle *handles; /**< array of loaded module handles */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Javascript parser flags */
|
/* Javascript parser flags */
|
||||||
typedef enum htsparsejava_flags {
|
typedef enum htsparsejava_flags {
|
||||||
HTSPARSE_NONE = 0, // don't parse
|
HTSPARSE_NONE = 0, // don't parse
|
||||||
HTSPARSE_DEFAULT = 1, // parse default (all)
|
HTSPARSE_DEFAULT = 1, // parse default (all)
|
||||||
HTSPARSE_NO_CLASS = 2, // don't parse .java
|
HTSPARSE_NO_CLASS = 2, // don't parse .java
|
||||||
HTSPARSE_NO_JAVASCRIPT = 4, // don't parse .js
|
HTSPARSE_NO_JAVASCRIPT = 4, // don't parse .js
|
||||||
HTSPARSE_NO_AGGRESSIVE = 8 // don't aggressively parse .js or .java
|
HTSPARSE_NO_AGGRESSIVE = 8 // don't aggressively parse .js or .java
|
||||||
} htsparsejava_flags;
|
} htsparsejava_flags;
|
||||||
|
|
||||||
|
/* Link-rewriting style for saved pages (opt->urlmode). */
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_urlmode
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_urlmode
|
||||||
|
|
||||||
|
typedef enum hts_urlmode {
|
||||||
|
HTS_URLMODE_ABSOLUTE = 0, /**< absolute URL (http://host/path) everywhere */
|
||||||
|
HTS_URLMODE_ABSOLUTE_FILE = 1, /**< legacy file: form, unused */
|
||||||
|
HTS_URLMODE_RELATIVE = 2, /**< relative link (default) */
|
||||||
|
HTS_URLMODE_ABSOLUTE_URI = 3, /**< absolute URI from root (/path) */
|
||||||
|
HTS_URLMODE_KEEP_ORIGINAL = 4, /**< keep the original link, do not rewrite */
|
||||||
|
HTS_URLMODE_TRANSPARENT_PROXY = 5 /**< transparent-proxy URL */
|
||||||
|
} hts_urlmode;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Cache policy for updates and retries (opt->cache). */
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_cachemode
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_cachemode
|
||||||
|
|
||||||
|
typedef enum hts_cachemode {
|
||||||
|
HTS_CACHE_NONE = 0, /**< no cache */
|
||||||
|
HTS_CACHE_PRIORITY = 1, /**< cache takes priority over the network */
|
||||||
|
HTS_CACHE_TEST_UPDATE = 2 /**< check for update before reuse (default) */
|
||||||
|
} hts_cachemode;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Interactive wizard level (opt->wizard). */
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_wizard
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_wizard
|
||||||
|
|
||||||
|
typedef enum hts_wizard {
|
||||||
|
HTS_WIZARD_NONE = 0, /**< no wizard */
|
||||||
|
HTS_WIZARD_ASK = 1, /**< wizard asks questions */
|
||||||
|
HTS_WIZARD_AUTO = 2 /**< wizard runs without asking */
|
||||||
|
} hts_wizard;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* robots.txt / meta-robots obedience level (opt->robots). */
|
||||||
|
#ifndef HTS_DEF_DEFSTRUCT_hts_robots
|
||||||
|
#define HTS_DEF_DEFSTRUCT_hts_robots
|
||||||
|
|
||||||
|
typedef enum hts_robots {
|
||||||
|
HTS_ROBOTS_NEVER = 0, /**< ignore robots rules */
|
||||||
|
HTS_ROBOTS_SOMETIMES = 1, /**< partial obedience (default) */
|
||||||
|
HTS_ROBOTS_ALWAYS = 2, /**< obey robots rules */
|
||||||
|
HTS_ROBOTS_ALWAYS_STRICT = 3 /**< obey even strict rules */
|
||||||
|
} hts_robots;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* What to fetch (opt->getmode bitmask). */
|
||||||
|
typedef enum hts_getmode {
|
||||||
|
HTS_GETMODE_HTML = 1 << 0, /**< save HTML files */
|
||||||
|
HTS_GETMODE_NONHTML = 1 << 1, /**< save non-HTML files */
|
||||||
|
HTS_GETMODE_HTML_FIRST = 1 << 2 /**< fetch HTML first, then the other files */
|
||||||
|
} hts_getmode;
|
||||||
|
|
||||||
|
/* Allowed directions in the directory tree (opt->seeker bitmask). */
|
||||||
|
typedef enum hts_seeker {
|
||||||
|
HTS_SEEKER_DOWN = 1 << 0, /**< may descend into subdirectories */
|
||||||
|
HTS_SEEKER_UP = 1 << 1 /**< may ascend to parent directories */
|
||||||
|
} hts_seeker;
|
||||||
|
|
||||||
|
/* opt->travel: link-following scope in the low byte, flags OR'd in above it. */
|
||||||
|
typedef enum hts_travel_scope {
|
||||||
|
HTS_TRAVEL_SAME_ADDRESS = 0, /**< stay on the same address (host) */
|
||||||
|
HTS_TRAVEL_SAME_DOMAIN = 1, /**< stay on the same principal domain */
|
||||||
|
HTS_TRAVEL_SAME_TLD = 2, /**< stay on the same TLD (e.g. .com) */
|
||||||
|
HTS_TRAVEL_EVERYWHERE = 7, /**< follow links anywhere on the web */
|
||||||
|
HTS_TRAVEL_TEST_ALL = 1 << 8 /**< also test forbidden URLs (-t) */
|
||||||
|
} hts_travel_scope;
|
||||||
|
|
||||||
|
/* Mask selecting the scope value out of opt->travel. */
|
||||||
|
#define HTS_TRAVEL_SCOPE_MASK 0xff
|
||||||
|
|
||||||
|
/* Text progress display detail (opt->verbosedisplay). */
|
||||||
|
typedef enum hts_verbosedisplay {
|
||||||
|
HTS_VERBOSE_NONE = 0, /**< no animated progress display (default) */
|
||||||
|
HTS_VERBOSE_SIMPLE = 1, /**< minimal single-line progress */
|
||||||
|
HTS_VERBOSE_FULL = 2 /**< full animated progress */
|
||||||
|
} hts_verbosedisplay;
|
||||||
|
|
||||||
|
/* Delayed file-type resolution policy (opt->savename_delayed). */
|
||||||
|
typedef enum hts_savename_delayed {
|
||||||
|
HTS_SAVENAME_DELAYED_NONE = 0, /**< resolve the type immediately */
|
||||||
|
HTS_SAVENAME_DELAYED_SOFT = 1, /**< delay the type check when unknown */
|
||||||
|
HTS_SAVENAME_DELAYED_HARD = 2 /**< always delay the type check (default) */
|
||||||
|
} hts_savename_delayed;
|
||||||
|
|
||||||
|
/* Saved-name length layout (opt->savename_83). */
|
||||||
|
typedef enum hts_savename_83 {
|
||||||
|
HTS_SAVENAME_83_LONG = 0, /**< long file names (default) */
|
||||||
|
HTS_SAVENAME_83_DOS = 1, /**< DOS 8.3 names (ISO9660 level 1) */
|
||||||
|
HTS_SAVENAME_83_ISO9660 = 2 /**< ISO9660 level 2 names (up to 31 chars) */
|
||||||
|
} hts_savename_83;
|
||||||
|
|
||||||
|
/* Host-banning triggers (opt->hostcontrol bitmask). */
|
||||||
|
typedef enum hts_hostcontrol {
|
||||||
|
HTS_HOSTCONTROL_BAN_TIMEOUT = 1 << 0, /**< ban a timing-out host */
|
||||||
|
HTS_HOSTCONTROL_BAN_SLOW = 1 << 1 /**< ban a too-slow host */
|
||||||
|
} hts_hostcontrol;
|
||||||
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_buffers
|
#ifndef HTS_DEF_FWSTRUCT_lien_buffers
|
||||||
#define HTS_DEF_FWSTRUCT_lien_buffers
|
#define HTS_DEF_FWSTRUCT_lien_buffers
|
||||||
typedef struct lien_buffers lien_buffers;
|
typedef struct lien_buffers lien_buffers;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// paramètres httrack (options)
|
/*
|
||||||
|
* Per-mirror options and state block. This is the central HTTrack parameters
|
||||||
|
* structure: created by hts_create_opt(), it carries every tunable option for
|
||||||
|
* one mirror and embeds the live engine state, and is then consumed by
|
||||||
|
* hts_main2().
|
||||||
|
*
|
||||||
|
* Callers normally configure it through the command-line argv vector (the
|
||||||
|
* option parser), not by writing fields directly. The only fields real
|
||||||
|
* consumers poke directly are 'log' and 'errlog' (set either to NULL to
|
||||||
|
* silence logging).
|
||||||
|
*/
|
||||||
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
||||||
#define HTS_DEF_FWSTRUCT_httrackp
|
#define HTS_DEF_FWSTRUCT_httrackp
|
||||||
typedef struct httrackp httrackp;
|
typedef struct httrackp httrackp;
|
||||||
#endif
|
#endif
|
||||||
struct httrackp {
|
struct httrackp {
|
||||||
size_t size_httrackp; // size of this structure
|
size_t size_httrackp; /**< size of this structure (version/ABI guard) */
|
||||||
/* */
|
/* */
|
||||||
int wizard; // wizard aucun/grand/petit
|
hts_wizard wizard; /**< interactive wizard level (none/ask/auto) */
|
||||||
int flush; // fflush sur les fichiers log
|
hts_boolean flush; /**< fflush() log files after each write */
|
||||||
int travel; // type de déplacements (same domain etc)
|
int travel; /**< link-following scope (same domain, etc.) */
|
||||||
int seeker; // up & down
|
int seeker; /**< allowed direction: go up and/or down the tree */
|
||||||
int depth; // nombre de niveaux de récursion
|
int depth; /**< maximum recursion depth (-rN) */
|
||||||
int extdepth; // nombre de niveaux de récursion à l'éxtérieur
|
int extdepth; /**< maximum recursion depth outside the start domain */
|
||||||
int urlmode; // liens relatifs etc
|
hts_urlmode
|
||||||
int no_type_change; // do not change file type according to MIME
|
urlmode; /**< saved-link rewriting style (relative, absolute, etc.) */
|
||||||
int debug; // mode débug log
|
hts_boolean no_type_change; // do not change file type according to MIME
|
||||||
int getmode; // sauver html, images..
|
hts_log_type debug; /**< debug logging level */
|
||||||
FILE *log; // fichier log
|
int getmode; /**< what to fetch (HTML, images, ...) bitmask */
|
||||||
FILE *errlog; // et erreur
|
FILE *log; /**< informational log stream; NULL mutes it */
|
||||||
LLint maxsite; // taille max site
|
FILE *errlog; /**< error log stream; NULL mutes it */
|
||||||
LLint maxfile_nonhtml; // taille max non html
|
LLint maxsite; /**< max total bytes for the whole mirror */
|
||||||
LLint maxfile_html; // taille max html
|
LLint maxfile_nonhtml; /**< max bytes per non-HTML file */
|
||||||
int maxsoc; // nbre sockets
|
LLint maxfile_html; /**< max bytes per HTML file */
|
||||||
LLint fragment; // fragmentation d'un site
|
int maxsoc; /**< max simultaneous sockets (-cN) */
|
||||||
int nearlink; // prendre les images/data proche d'une page mais à l'extérieur
|
LLint fragment; /**< split site after this many bytes */
|
||||||
int makeindex; // faire un index
|
hts_tristate
|
||||||
int kindex; // et un index 'keyword'
|
nearlink; /**< also fetch images/data adjacent to a page but off-site */
|
||||||
int delete_old; // effacer anciens fichiers
|
hts_boolean makeindex; /**< build a top-level index.html */
|
||||||
int timeout; // nombre de secondes de timeout
|
hts_boolean kindex; /**< build a keyword index */
|
||||||
int rateout; // nombre d'octets minium pour le transfert
|
hts_tristate delete_old; /**< delete locally obsolete files after update */
|
||||||
int maxtime; // temps max en secondes
|
int timeout; /**< connection timeout in seconds */
|
||||||
int maxrate; // taux de transfert max
|
int rateout; /**< minimum transfer rate (bytes/s) before abort */
|
||||||
float maxconn; // nombre max de connexions/s
|
int maxtime; /**< max total mirror duration in seconds */
|
||||||
int waittime; // démarrage programmé
|
int maxrate; /**< max transfer rate cap (bytes/s) */
|
||||||
int cache; // génération d'un cache
|
float maxconn; /**< max connections per second */
|
||||||
//int aff_progress; // barre de progression
|
int waittime; /**< scheduled start time (wall-clock seconds) */
|
||||||
int shell; // gestion d'un shell par pipe stdin/stdout
|
hts_cachemode cache; /**< cache generation mode */
|
||||||
t_proxy proxy; // configuration du proxy
|
hts_boolean shell; /**< driven by a shell over stdin/stdout pipes */
|
||||||
int savename_83; // conversion 8-3 pour les noms de fichiers
|
t_proxy proxy; /**< proxy configuration */
|
||||||
int savename_type; // type de noms: structure originale/html-images en un seul niveau
|
hts_savename_83
|
||||||
String savename_userdef; // structure userdef (ex: %h%p/%n%q.%t)
|
savename_83; /**< saved-name length layout (long/DOS/ISO9660) */
|
||||||
int savename_delayed; // delayed type check
|
int savename_type; /**< saved-name layout (original tree, flat, ...) */
|
||||||
int delayed_cached; // delayed type check can be cached to speedup updates
|
String
|
||||||
int mimehtml; // MIME-html
|
savename_userdef; /**< user-defined name template (e.g. %h%p/%n%q.%t) */
|
||||||
int user_agent_send; // user agent (ex: httrack/1.0 [sun])
|
hts_savename_delayed savename_delayed; /**< delayed type-check policy */
|
||||||
String user_agent; //
|
hts_boolean
|
||||||
String referer; // referer
|
delayed_cached; // delayed type check can be cached to speedup updates
|
||||||
String from; // from
|
hts_boolean mimehtml; /**< produce a single MIME/MHTML archive */
|
||||||
String path_log; // chemin pour cache et log
|
hts_boolean user_agent_send; /**< send a User-Agent header */
|
||||||
String path_html; // chemin pour miroir
|
String user_agent; /**< User-Agent value (e.g. httrack/1.0) */
|
||||||
String path_html_utf8; // chemin pour miroir, UTF-8
|
String referer; /**< Referer value to send */
|
||||||
String path_bin; // chemin pour templates
|
String from; /**< From value to send */
|
||||||
int retry; // nombre d'essais supplémentaires en cas d'échec
|
String path_log; /**< directory for cache and logs */
|
||||||
int makestat; // mettre à jour un fichier log de statistiques de transfert
|
String path_html; /**< output directory for the mirror */
|
||||||
int maketrack; // mettre à jour un fichier log de statistiques d'opérations
|
String path_html_utf8; /**< output directory for the mirror, UTF-8 form */
|
||||||
int parsejava; // parsing des classes java pour récupérer les class, gif & cie ; see htsparsejava_flags
|
String path_bin; /**< directory for HTML templates */
|
||||||
int hostcontrol; // abandon d'un host trop lent etc.
|
int retry; /**< extra retries on a failed transfer */
|
||||||
int errpage; // générer une page d'erreur en cas de 404 etc.
|
hts_boolean makestat; /**< maintain a transfer-statistics log */
|
||||||
int check_type; // si type inconnu (cgi,asp,/) alors tester lien (et gérer moved éventuellement)
|
hts_boolean maketrack; /**< maintain an operations-statistics log */
|
||||||
int all_in_cache; // tout mettre en cache!
|
int parsejava; /**< Java/JS parsing mode; see htsparsejava_flags */
|
||||||
int robots; // traitement des robots
|
int hostcontrol; /**< ban slow/timing-out hosts; see hts_hostcontrol bits */
|
||||||
int external; // pages externes->pages d'erreur
|
hts_tristate errpage; /**< generate an error page on 404 and similar */
|
||||||
int passprivacy; // pas de mot de pass dans les liens externes?
|
hts_boolean
|
||||||
int includequery; // include la query-string
|
check_type; /**< probe unknown-type links (cgi/asp/dir) and follow moves
|
||||||
int mirror_first_page; // miroir des liens
|
*/
|
||||||
String sys_com; // commande système
|
hts_boolean all_in_cache; /**< keep all retrieved data in the cache */
|
||||||
int sys_com_exec; // executer commande
|
hts_robots robots; /**< robots.txt handling level */
|
||||||
int accept_cookie; // gestion des cookies
|
hts_tristate external; /**< render external links as error pages */
|
||||||
t_cookie *cookie;
|
hts_boolean passprivacy; /**< strip passwords from external links */
|
||||||
int http10; // forcer http 1.0
|
hts_boolean includequery; /**< include the query string in saved names */
|
||||||
int nokeepalive; // pas de keep-alive
|
hts_boolean mirror_first_page; /**< only mirror the links of the first page */
|
||||||
int nocompression; // pas de compression
|
String sys_com; /**< system command to run */
|
||||||
int sizehack; // forcer réponse "mis à jour" si taille identique
|
hts_boolean sys_com_exec; /**< actually execute sys_com */
|
||||||
int urlhack; // force "url normalization" to avoid loops
|
hts_boolean accept_cookie; /**< accept and send cookies */
|
||||||
int tolerant; // accepter content-length incorrect
|
t_cookie *cookie; /**< cookie store */
|
||||||
int parseall; // essayer de tout parser (tags inconnus contenant des liens, par exemple)
|
hts_boolean http10; /**< force HTTP/1.0 */
|
||||||
int parsedebug; // débugger parser (debug!)
|
hts_boolean nokeepalive; /**< disable keep-alive */
|
||||||
int norecatch; // ne pas reprendre les fichiers effacés localement par l'utilisateur
|
hts_boolean nocompression; /**< disable content compression */
|
||||||
int verbosedisplay; // animation textuelle
|
hts_boolean sizehack; /**< treat same-size response as "updated" */
|
||||||
String footer; // ligne d'infos
|
hts_boolean urlhack; // force "url normalization" to avoid loops
|
||||||
int maxcache; // maximum en mémoire au niveau du cache (backing)
|
hts_boolean tolerant; /**< accept an incorrect Content-Length */
|
||||||
//int maxcache_anticipate; // maximum de liens à anticiper (majorant)
|
hts_tristate
|
||||||
int ftp_proxy; // proxy http pour ftp
|
parseall; /**< parse aggressively, including unknown tags with links */
|
||||||
String filelist; // fichier liste URL à inclure
|
hts_boolean parsedebug; /**< parser debug mode */
|
||||||
String urllist; // fichier liste de filtres à inclure
|
hts_boolean norecatch; /**< do not re-fetch files the user deleted locally */
|
||||||
htsfilters filters; // contient les pointeurs pour les filtres
|
hts_verbosedisplay verbosedisplay; /**< animated text progress display */
|
||||||
hash_struct *hash; // hash structure
|
String footer; /**< footer/info line injected into pages */
|
||||||
lien_url **liens; // links
|
int maxcache; /**< in-memory cache backing limit (bytes) */
|
||||||
int lien_tot; // top index of "links" heap (always out-of-range)
|
hts_boolean ftp_proxy; /**< use the HTTP proxy for FTP too */
|
||||||
lien_buffers *liensbuf; // links buffers
|
String filelist; /**< file listing URLs to include */
|
||||||
robots_wizard *robotsptr; // robots ptr
|
String urllist; /**< file listing filters to include */
|
||||||
String lang_iso; // en, fr ..
|
htsfilters filters; /**< filter pointers (+/-pattern rules) */
|
||||||
String accept; // Accept:
|
hash_struct *hash; // hash structure
|
||||||
String headers; // Additional headers
|
lien_url **liens; // links
|
||||||
String mimedefs; // ext1=mimetype1\next2=mimetype2..
|
int lien_tot; // top index of "links" heap (always out-of-range)
|
||||||
String mod_blacklist; // (3.41)
|
lien_buffers *liensbuf; // links buffers
|
||||||
int convert_utf8; // filenames UTF-8 conversion (3.46)
|
robots_wizard *robotsptr; // robots ptr
|
||||||
|
String lang_iso; /**< Accept-Language value (en, fr, ...) */
|
||||||
|
String accept; // Accept:
|
||||||
|
String headers; // Additional headers
|
||||||
|
String mimedefs; // ext1=mimetype1\next2=mimetype2..
|
||||||
|
String mod_blacklist; /**< blacklisted modules */
|
||||||
|
hts_boolean convert_utf8; // filenames UTF-8 conversion (3.46)
|
||||||
//
|
//
|
||||||
int maxlink; // nombre max de liens
|
int maxlink; /**< max number of links */
|
||||||
int maxfilter; // nombre max de filtres
|
int maxfilter; /**< max number of filters */
|
||||||
//
|
//
|
||||||
const char *exec; // adresse du nom de l'éxecutable
|
const char *exec; /**< path of the running executable */
|
||||||
//
|
//
|
||||||
int quiet; // poser des questions autres que wizard?
|
hts_boolean quiet; /**< suppress non-wizard questions */
|
||||||
int keyboard; // vérifier stdin
|
hts_boolean keyboard; /**< poll stdin for keyboard input */
|
||||||
int bypass_limits; // bypass built-in limits
|
hts_boolean bypass_limits; // bypass built-in limits
|
||||||
int background_on_suspend; // background process on suspend signal
|
hts_boolean background_on_suspend; // background process on suspend signal
|
||||||
//
|
//
|
||||||
int is_update; // c'est une update (afficher "File updated...")
|
hts_boolean is_update; /**< this run is an update (show "File updated...") */
|
||||||
int dir_topindex; // reconstruire top index par la suite
|
hts_boolean dir_topindex; /**< rebuild the top index afterwards */
|
||||||
//
|
//
|
||||||
// callbacks
|
// callbacks
|
||||||
t_hts_htmlcheck_callbacks *callbacks_fun;
|
t_hts_htmlcheck_callbacks
|
||||||
|
*callbacks_fun; /**< user HTML/parsing callback table */
|
||||||
// store library handles
|
// store library handles
|
||||||
htslibhandles libHandles;
|
htslibhandles libHandles; /**< loaded external module handles */
|
||||||
//
|
//
|
||||||
htsoptstate state; // state
|
htsoptstate state; /**< embedded live engine state */
|
||||||
|
String strip_query; /**< query keys to drop when deduping URLs (-strip-query);
|
||||||
|
appended at the tail to keep field offsets stable */
|
||||||
|
hts_boolean
|
||||||
|
no_www_dedup; /**< with urlhack, keep www.host distinct from host */
|
||||||
|
hts_boolean no_slash_dedup; /**< with urlhack, keep redundant // in paths */
|
||||||
|
hts_boolean no_query_dedup; /**< with urlhack, keep query-argument order */
|
||||||
|
String cookies_file; /**< extra Netscape cookies.txt to preload
|
||||||
|
(--cookies-file) */
|
||||||
|
int pause_min_ms; /**< inter-file pause lower bound, ms (0=off, #185) */
|
||||||
|
int pause_max_ms; /**< inter-file pause upper bound, ms */
|
||||||
};
|
};
|
||||||
|
|
||||||
// stats for httrack
|
/* Running statistics for a mirror. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_hts_stat_struct
|
#ifndef HTS_DEF_FWSTRUCT_hts_stat_struct
|
||||||
#define HTS_DEF_FWSTRUCT_hts_stat_struct
|
#define HTS_DEF_FWSTRUCT_hts_stat_struct
|
||||||
typedef struct hts_stat_struct hts_stat_struct;
|
typedef struct hts_stat_struct hts_stat_struct;
|
||||||
#endif
|
#endif
|
||||||
struct hts_stat_struct {
|
struct hts_stat_struct {
|
||||||
LLint HTS_TOTAL_RECV; // flux entrant reçu
|
LLint HTS_TOTAL_RECV; /**< total bytes received from the network */
|
||||||
LLint stat_bytes; // octets écrits sur disque
|
LLint stat_bytes; /**< total bytes written to disk */
|
||||||
// int HTS_TOTAL_RECV_STATE; // status: 0 tout va bien 1: ralentir un peu 2: ralentir 3: beaucoup
|
TStamp stat_timestart; /**< mirror start time */
|
||||||
TStamp stat_timestart; // départ
|
|
||||||
//
|
//
|
||||||
LLint total_packed; // flux entrant compressé reçu
|
LLint total_packed; /**< compressed bytes received (on the wire) */
|
||||||
LLint total_unpacked; // flux entrant compressé reçu
|
LLint total_unpacked; /**< bytes after decompression */
|
||||||
int total_packedfiles; // fichiers compressés
|
int total_packedfiles; /**< number of compressed files */
|
||||||
//
|
//
|
||||||
TStamp istat_timestart[2]; // départ pour calcul instantanné
|
TStamp
|
||||||
LLint istat_bytes[2]; // calcul pour instantanné
|
istat_timestart[2]; /**< window start times for the instantaneous rate */
|
||||||
TStamp istat_reference01; // top départ donné par #0 à #1
|
LLint istat_bytes[2]; /**< window byte counts for the instantaneous rate */
|
||||||
int istat_idlasttimer; // id du timer qui a récemment donné une stat
|
TStamp
|
||||||
|
istat_reference01; /**< reference timestamp handed from window #0 to #1 */
|
||||||
|
int istat_idlasttimer; /**< id of the timer that last produced a stat */
|
||||||
//
|
//
|
||||||
int stat_files; // nombre de fichiers écrits
|
int stat_files; /**< number of files written */
|
||||||
int stat_updated_files; // nombre de fichiers mis à jour
|
int stat_updated_files; /**< number of files updated */
|
||||||
int stat_background; // nombre de fichiers écrits en arrière plan
|
int stat_background; /**< number of files written in the background */
|
||||||
//
|
//
|
||||||
int stat_nrequests; // nombre de requêtes sur socket
|
int stat_nrequests; /**< number of requests issued on sockets */
|
||||||
int stat_sockid; // nombre de sockets allouées au total
|
int stat_sockid; /**< total number of sockets ever allocated */
|
||||||
int stat_nsocket; // nombre de sockets
|
int stat_nsocket; /**< current number of open sockets */
|
||||||
int stat_errors; // nombre d'erreurs
|
int stat_errors; /**< number of errors */
|
||||||
int stat_errors_front; // idem, mais au tout premier niveau
|
int stat_errors_front; /**< errors at the very first level */
|
||||||
int stat_warnings; // '' warnings
|
int stat_warnings; /**< number of warnings */
|
||||||
int stat_infos; // '' infos
|
int stat_infos; /**< number of info messages */
|
||||||
int nbk; // fichiers anticipés en arrière plan et terminés
|
int nbk; /**< background-anticipated files now completed */
|
||||||
LLint nb; // données transférées actuellement (estimation)
|
LLint nb; /**< bytes currently being transferred (estimate) */
|
||||||
//
|
//
|
||||||
LLint rate;
|
LLint rate; /**< current transfer rate */
|
||||||
//
|
//
|
||||||
TStamp last_connect; // last connect() call
|
TStamp last_connect; /**< time of the last connect() call */
|
||||||
TStamp last_request; // last request issued
|
TStamp last_request; /**< time of the last request issued */
|
||||||
};
|
};
|
||||||
|
|
||||||
// structure pour paramètres supplémentaires lors de la requête
|
/* Extra per-request parameters (mirrors httrackp request options). */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy
|
#ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy
|
||||||
#define HTS_DEF_FWSTRUCT_htsrequest_proxy
|
#define HTS_DEF_FWSTRUCT_htsrequest_proxy
|
||||||
typedef struct htsrequest_proxy htsrequest_proxy;
|
typedef struct htsrequest_proxy htsrequest_proxy;
|
||||||
#endif
|
#endif
|
||||||
struct htsrequest_proxy {
|
struct htsrequest_proxy {
|
||||||
int active;
|
int active; /**< nonzero if a proxy is used for this request */
|
||||||
const char* name;
|
const char *name; /**< proxy host name */
|
||||||
int port;
|
int port; /**< proxy port */
|
||||||
const char* bindhost; // bind this host
|
const char *bindhost; /**< local address to bind the outgoing socket to */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsrequest
|
#ifndef HTS_DEF_FWSTRUCT_htsrequest
|
||||||
@@ -463,93 +596,92 @@ struct htsrequest_proxy {
|
|||||||
typedef struct htsrequest htsrequest;
|
typedef struct htsrequest htsrequest;
|
||||||
#endif
|
#endif
|
||||||
struct htsrequest {
|
struct htsrequest {
|
||||||
short int user_agent_send; // user agent (ex: httrack/1.0 [sun])
|
short int user_agent_send; /**< send a User-Agent header */
|
||||||
short int http11; // l'en tête peut (doit) être signé HTTP/1.1 et non HTTP/1.0
|
short int http11; /**< sign the request as HTTP/1.1 rather than HTTP/1.0 */
|
||||||
short int nokeepalive; // pas de keep-alive
|
short int nokeepalive; /**< disable keep-alive */
|
||||||
short int range_used; // Range utilisé
|
short int range_used; /**< a Range header is in use */
|
||||||
short int nocompression; // Pas de compression
|
short int nocompression; /**< disable compression */
|
||||||
short int flush_garbage; // recycled
|
short int flush_garbage; // recycled
|
||||||
const char* user_agent;
|
const char *user_agent; /**< User-Agent value */
|
||||||
const char* referer;
|
const char *referer; /**< Referer value */
|
||||||
const char* from;
|
const char *from; /**< From value */
|
||||||
const char* lang_iso;
|
const char *lang_iso; /**< Accept-Language value */
|
||||||
const char* accept;
|
const char *accept; /**< Accept value */
|
||||||
const char* headers;
|
const char *headers; /**< extra request headers */
|
||||||
htsrequest_proxy proxy; // proxy
|
htsrequest_proxy proxy; /**< proxy for this request */
|
||||||
};
|
};
|
||||||
|
|
||||||
// structure pour retour d'une connexion/prise d'en tête
|
/* Result of a connection / header fetch. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsblk
|
#ifndef HTS_DEF_FWSTRUCT_htsblk
|
||||||
#define HTS_DEF_FWSTRUCT_htsblk
|
#define HTS_DEF_FWSTRUCT_htsblk
|
||||||
typedef struct htsblk htsblk;
|
typedef struct htsblk htsblk;
|
||||||
#endif
|
#endif
|
||||||
struct htsblk {
|
struct htsblk {
|
||||||
int statuscode; // status-code, -1=erreur, 200=OK,201=..etc (cf RFC1945)
|
int statuscode; /**< HTTP status code; -1=error, 200=OK, ... (RFC1945) */
|
||||||
short int notmodified; // page ou fichier NON modifié (transféré)
|
short int notmodified; /**< page/file was not modified (not transferred) */
|
||||||
short int is_write; // sortie sur disque (out) ou en mémoire (adr)
|
short int is_write; /**< output goes to disk (out) vs memory (adr) */
|
||||||
short int is_chunk; // mode chunk
|
short int is_chunk; /**< chunked transfer encoding */
|
||||||
short int compressed; // compressé?
|
short int compressed; /**< body is compressed */
|
||||||
short int empty; // vide?
|
short int empty; /**< body is empty */
|
||||||
short int keep_alive; // Keep-Alive?
|
short int keep_alive; /**< connection is keep-alive */
|
||||||
short int keep_alive_trailers; // ..with trailers extension
|
short int keep_alive_trailers; /**< keep-alive with trailers extension */
|
||||||
int keep_alive_t; // KA timeout
|
int keep_alive_t; /**< keep-alive timeout (seconds) */
|
||||||
int keep_alive_max; // KA number of requests
|
int keep_alive_max; /**< keep-alive max number of requests */
|
||||||
char *adr; // adresse du bloc de mémoire, NULL=vide
|
char *adr; /**< in-memory body buffer; NULL if empty */
|
||||||
char *headers; // adresse des en têtes si présents
|
char *headers; /**< received headers, if any */
|
||||||
FILE *out; // écriture directe sur disque (si is_write=1)
|
FILE *out; /**< destination file when is_write=1 */
|
||||||
LLint size; // taille fichier
|
LLint size; /**< body size */
|
||||||
char msg[80]; // message éventuel si échec ("\0"=non précisé)
|
char msg[80]; /**< failure message ("" if none) */
|
||||||
char contenttype[64]; // content-type ("text/html" par exemple)
|
char contenttype[HTS_MIMETYPE_SIZE]; // content-type (e.g. "text/html")
|
||||||
char charset[64]; // charset ("iso-8859-1" par exemple)
|
char charset[HTS_MIMETYPE_SIZE]; // charset (e.g. "iso-8859-1")
|
||||||
char contentencoding[64]; // content-encoding ("gzip" par exemple)
|
char contentencoding[HTS_MIMETYPE_SIZE]; // content-encoding (e.g. "gzip")
|
||||||
char *location; // on copie dedans éventuellement la véritable 'location'
|
char *location; /**< resolved Location target, if any */
|
||||||
LLint totalsize; // taille totale à télécharger (-1=inconnue)
|
LLint totalsize; /**< total size to download (-1=unknown) */
|
||||||
short int is_file; // ce n'est pas une socket mais un descripteur de fichier si 1
|
short int is_file; /**< 1 if a file descriptor rather than a socket */
|
||||||
T_SOC soc; // ID socket
|
T_SOC soc; /**< socket id */
|
||||||
SOCaddr address; // IP address
|
SOCaddr address; /**< peer IP address */
|
||||||
int address_size; // IP address structure length (unused internally)
|
int address_size; // IP address structure length (unused internally)
|
||||||
FILE *fp; // fichier pour file://
|
FILE *fp; /**< file handle for file:// */
|
||||||
#if HTS_USEOPENSSL
|
#if HTS_USEOPENSSL
|
||||||
short int ssl; // is this connection a SSL one? (https)
|
short int ssl; /**< nonzero if this is an SSL connection (https) */
|
||||||
// BIO* ssl_soc; // SSL structure
|
// BIO* ssl_soc; // SSL structure
|
||||||
SSL *ssl_con; // connection structure
|
SSL *ssl_con; /**< SSL connection structure */
|
||||||
#endif
|
#endif
|
||||||
char lastmodified[64]; // Last-Modified
|
char lastmodified[64]; /**< Last-Modified value */
|
||||||
char etag[256]; // Etag
|
char etag[256]; /**< ETag value */
|
||||||
char cdispo[256]; // Content-Disposition coupé
|
char cdispo[256]; /**< Content-Disposition filename (truncated) */
|
||||||
LLint crange; // Content-Range
|
LLint crange; /**< Content-Range length */
|
||||||
LLint crange_start; // Content-Range
|
LLint crange_start; /**< Content-Range start offset */
|
||||||
LLint crange_end; // Content-Range
|
LLint crange_end; /**< Content-Range end offset */
|
||||||
int debugid; // debug connection
|
int debugid; /**< connection debug id */
|
||||||
/* */
|
/* */
|
||||||
htsrequest req; // paramètres pour la requête
|
htsrequest req; /**< parameters used for the request */
|
||||||
/*char digest[32+2]; // digest md5 généré par le moteur ("" si non généré) */
|
/*char digest[32+2]; // md5 digest generated by the engine ("" if none) */
|
||||||
};
|
};
|
||||||
|
|
||||||
// structure d'un lien
|
/* A single link in the crawl. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_url
|
#ifndef HTS_DEF_FWSTRUCT_lien_url
|
||||||
#define HTS_DEF_FWSTRUCT_lien_url
|
#define HTS_DEF_FWSTRUCT_lien_url
|
||||||
typedef struct lien_url lien_url;
|
typedef struct lien_url lien_url;
|
||||||
#endif
|
#endif
|
||||||
struct lien_url {
|
struct lien_url {
|
||||||
char *adr; // adresse
|
char *adr; /**< host/address part of the URL */
|
||||||
char *fil; // nom du fichier distant
|
char *fil; /**< remote file path */
|
||||||
char *sav; // nom à sauver sur disque (avec chemin éventuel)
|
char *sav; /**< local save name (with any path) */
|
||||||
char *cod; // chemin codebase éventuel si classe java
|
char *cod; /**< codebase path for a Java class, if any */
|
||||||
char *former_adr; // adresse initiale (avant éventuel moved), peut être nulle
|
char *former_adr; /**< original address before a move; may be NULL */
|
||||||
char *former_fil; // nom du fichier distant initial (avant éventuel moved), peut être nul
|
char *former_fil; /**< original remote file before a move; may be NULL */
|
||||||
|
|
||||||
int premier; // pointeur sur le premier lien qui a donné lieu aux autres liens du domaine
|
int premier; /**< index of the first link that seeded this domain */
|
||||||
int precedent; // pointeur sur le lien qui a donné lieu à ce lien précis
|
int precedent; /**< index of the link that referenced this one */
|
||||||
int depth; // profondeur autorisée lien ; >0 forte 0=faible
|
int depth; /**< remaining allowed depth; >0 strong, 0 weak */
|
||||||
int pass2; // traiter après les autres, seconde passe. si == -1, lien traité en background
|
int pass2; /**< second-pass marker; -1 means handled in background */
|
||||||
char link_import; // lien importé à la suite d'un moved - ne pas appliquer les règles classiques up/down
|
char link_import; /**< imported after a move; skip the usual up/down rules */
|
||||||
//int moved; // pointeur sur moved
|
int retry; /**< remaining retries */
|
||||||
int retry; // nombre de retry restants
|
int testmode; /**< test only: send just a HEAD */
|
||||||
int testmode; // mode test uniquement, envoyer juste un head!
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// chargement de fichiers en 'arrière plan'
|
/* A file being fetched in the background. */
|
||||||
#ifndef HTS_DEF_FWSTRUCT_lien_back
|
#ifndef HTS_DEF_FWSTRUCT_lien_back
|
||||||
#define HTS_DEF_FWSTRUCT_lien_back
|
#define HTS_DEF_FWSTRUCT_lien_back
|
||||||
typedef struct lien_back lien_back;
|
typedef struct lien_back lien_back;
|
||||||
@@ -558,43 +690,41 @@ struct lien_back {
|
|||||||
#if DEBUG_CHECKINT
|
#if DEBUG_CHECKINT
|
||||||
char magic;
|
char magic;
|
||||||
#endif
|
#endif
|
||||||
char url_adr[HTS_URLMAXSIZE * 2]; // adresse
|
char url_adr[HTS_URLMAXSIZE * 2]; /**< host/address part of the URL */
|
||||||
char url_fil[HTS_URLMAXSIZE * 2]; // nom du fichier distant
|
char url_fil[HTS_URLMAXSIZE * 2]; /**< remote file path */
|
||||||
char url_sav[HTS_URLMAXSIZE * 2]; // nom à sauver sur disque (avec chemin éventuel)
|
char url_sav[HTS_URLMAXSIZE * 2]; /**< local save name (with any path) */
|
||||||
char referer_adr[HTS_URLMAXSIZE * 2]; // adresse host page referer
|
char referer_adr[HTS_URLMAXSIZE * 2]; /**< referer page host/address */
|
||||||
char referer_fil[HTS_URLMAXSIZE * 2]; // fichier page referer
|
char referer_fil[HTS_URLMAXSIZE * 2]; /**< referer page file */
|
||||||
char location_buffer[HTS_URLMAXSIZE * 2]; // "location" en cas de "moved" (302,..)
|
char
|
||||||
char *tmpfile; // nom à sauver temporairement (compressé)
|
location_buffer[HTS_URLMAXSIZE * 2]; /**< Location on a move (302, ...) */
|
||||||
char tmpfile_buffer[HTS_URLMAXSIZE * 2]; // buffer pour le nom à sauver temporairement
|
char *tmpfile; /**< temporary save name (compressed) */
|
||||||
char send_too[1024]; // données à envoyer en même temps que le header
|
char tmpfile_buffer[HTS_URLMAXSIZE * 2]; /**< storage for tmpfile */
|
||||||
int status; // status (-1=non utilisé, 0: prêt, >0: opération en cours)
|
char send_too[1024]; /**< data to send together with the header */
|
||||||
int locked; // locked (to be used soon)
|
int status; /**< -1=unused, 0=ready, >0=operation in progress */
|
||||||
int testmode; // mode de test
|
int locked; /**< locked (reserved) */
|
||||||
int timeout; // gérer des timeouts? (!=0 : nombre de secondes)
|
int testmode; /**< test mode */
|
||||||
TStamp timeout_refresh; // si oui, time refresh
|
int timeout; /**< timeout in seconds (0=none) */
|
||||||
int rateout; // timeout refresh? (!=0 : taux minimum toléré en octets/s)
|
TStamp timeout_refresh; /**< last activity time, for timeout tracking */
|
||||||
TStamp rateout_time; // si oui, date de départ
|
int rateout; /**< minimum tolerated rate in bytes/s (0=none) */
|
||||||
LLint maxfile_nonhtml; // taille max d'un fichier non html
|
TStamp rateout_time; /**< start time for the rate window */
|
||||||
LLint maxfile_html; // idem pour un ficheir html
|
LLint maxfile_nonhtml; /**< max bytes for a non-HTML file */
|
||||||
htsblk r; // structure htsblk de chaque objet en background
|
LLint maxfile_html; /**< max bytes for an HTML file */
|
||||||
int is_update; // mode update
|
htsblk r; /**< per-object result block */
|
||||||
int head_request; // requète HEAD?
|
int is_update; /**< update mode */
|
||||||
LLint range_req_size; // range utilisé
|
int head_request; /**< this is a HEAD request */
|
||||||
TStamp ka_time_start; // refresh time for KA
|
LLint range_req_size; /**< Range request size used */
|
||||||
|
TStamp ka_time_start; /**< keep-alive refresh start time */
|
||||||
//
|
//
|
||||||
int http11; // L'en tête doit être signé HTTP/1.1 et non HTTP/1.0
|
int http11; /**< sign the request as HTTP/1.1 rather than HTTP/1.0 */
|
||||||
int is_chunk; // chunk?
|
int is_chunk; /**< chunked transfer */
|
||||||
char *chunk_adr; // adresse chunk en cours de chargement
|
char *chunk_adr; /**< buffer for the chunk being loaded */
|
||||||
LLint chunk_size; // taille chunk en cours de chargement
|
LLint chunk_size; /**< size of the chunk being loaded */
|
||||||
LLint chunk_blocksize; // taille data declaree par le chunk
|
LLint chunk_blocksize; /**< data size declared by the chunk */
|
||||||
LLint compressed_size; // taille compressés (stats uniquement)
|
LLint compressed_size; /**< compressed size (stats only) */
|
||||||
//
|
char info[256]; /**< status text, e.g. for FTP */
|
||||||
//int links_index; // to access liens[links_index]
|
int stop_ftp; /**< stop flag for FTP */
|
||||||
//
|
int finalized; /**< finalized (memory optimization) */
|
||||||
char info[256]; // éventuel status pour le ftp
|
int early_add; /**< was added before the link heap saw it */
|
||||||
int stop_ftp; // flag stop pour ftp
|
|
||||||
int finalized; // finalized (optim memory)
|
|
||||||
int early_add; // was added before link heap saw it
|
|
||||||
#if DEBUG_CHECKINT
|
#if DEBUG_CHECKINT
|
||||||
char magic2;
|
char magic2;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
1127
src/htsparse.c
1127
src/htsparse.c
File diff suppressed because it is too large
Load Diff
@@ -66,7 +66,6 @@ struct htsmoduleStructExtended {
|
|||||||
char ***filters_;
|
char ***filters_;
|
||||||
robots_wizard *robots_;
|
robots_wizard *robots_;
|
||||||
hash_struct *hash_;
|
hash_struct *hash_;
|
||||||
//int *lien_max_;
|
|
||||||
|
|
||||||
/* Base & codebase */
|
/* Base & codebase */
|
||||||
char *base;
|
char *base;
|
||||||
@@ -116,6 +115,19 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre);
|
|||||||
int hts_mirror_check_moved(htsmoduleStruct * str,
|
int hts_mirror_check_moved(htsmoduleStruct * str,
|
||||||
htsmoduleStructExtended * stre);
|
htsmoduleStructExtended * stre);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Non-zero if a redirect (cur_adr,cur_fil)->(moved_adr,moved_fil) saves to the
|
||||||
|
same local file, so it must be followed rather than turned into a
|
||||||
|
self-pointing "moved" stub (#159). Mirrors the savename: scheme+userinfo
|
||||||
|
stripped, www kept (www dedup is the crawl layer's job), path
|
||||||
|
slash/query-normalized per the URL-hack flags. Not hash_url_equals: that keys
|
||||||
|
on the dedup hash, which folds www and never collapses http<->https.
|
||||||
|
*/
|
||||||
|
hts_boolean hts_redirect_same_savefile(httrackp *opt, const char *cur_adr,
|
||||||
|
const char *cur_fil,
|
||||||
|
const char *moved_adr,
|
||||||
|
const char *moved_fil);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Process user intercations: pause, add link, delete link..
|
Process user intercations: pause, add link, delete link..
|
||||||
*/
|
*/
|
||||||
@@ -162,27 +174,4 @@ int hts_wait_delayed(htsmoduleStruct * str, lien_adrfilsave *afs,
|
|||||||
/* Apply changes */ \
|
/* Apply changes */ \
|
||||||
* str->ptr_ = ptr
|
* str->ptr_ = ptr
|
||||||
|
|
||||||
#define WAIT_FOR_AVAILABLE_SOCKET() do { \
|
|
||||||
int prev = opt->state._hts_in_html_parsing; \
|
|
||||||
while(back_pluggable_sockets_strict(sback, opt) <= 0) { \
|
|
||||||
opt->state._hts_in_html_parsing = 6; \
|
|
||||||
/* Wait .. */ \
|
|
||||||
back_wait(sback,opt,cache,0); \
|
|
||||||
/* Transfer rate */ \
|
|
||||||
engine_stats(); \
|
|
||||||
/* Refresh various stats */ \
|
|
||||||
HTS_STAT.stat_nsocket=back_nsoc(sback); \
|
|
||||||
HTS_STAT.stat_errors=fspc(opt,NULL,"error"); \
|
|
||||||
HTS_STAT.stat_warnings=fspc(opt,NULL,"warning"); \
|
|
||||||
HTS_STAT.stat_infos=fspc(opt,NULL,"info"); \
|
|
||||||
HTS_STAT.nbk=backlinks_done(sback,opt->liens,opt->lien_tot,ptr); \
|
|
||||||
HTS_STAT.nb=back_transferred(HTS_STAT.stat_bytes,sback); \
|
|
||||||
/* Check */ \
|
|
||||||
if (!RUN_CALLBACK7(opt, loop, sback->lnk, sback->count, -1,ptr,opt->lien_tot,(int) (time_local()-HTS_STAT.stat_timestart),&HTS_STAT)) { \
|
|
||||||
return -1; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
opt->state._hts_in_html_parsing = prev; \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
167
src/htsrobots.c
167
src/htsrobots.c
@@ -44,28 +44,84 @@ Please visit our Website: http://www.httrack.com
|
|||||||
|
|
||||||
// -- robots --
|
// -- robots --
|
||||||
|
|
||||||
|
/* RFC 9309 path-prefix match; '*' any run, '$' anchors end; linear. */
|
||||||
|
static hts_boolean robots_pattern_match(const char *pattern, const char *path) {
|
||||||
|
size_t patlen = strlen(pattern);
|
||||||
|
hts_boolean anchored = HTS_FALSE;
|
||||||
|
const char *p, *pend, *s;
|
||||||
|
const char *star = NULL, *star_s = NULL;
|
||||||
|
|
||||||
|
if (patlen > 0 && pattern[patlen - 1] == '$') {
|
||||||
|
anchored = HTS_TRUE;
|
||||||
|
patlen--;
|
||||||
|
}
|
||||||
|
p = pattern;
|
||||||
|
pend = pattern + patlen;
|
||||||
|
s = path;
|
||||||
|
while (*s != '\0') {
|
||||||
|
if (p == pend) {
|
||||||
|
if (!anchored)
|
||||||
|
return HTS_TRUE; // prefix matched
|
||||||
|
if (star != NULL) { // anchored: '*' must eat the rest
|
||||||
|
p = star + 1;
|
||||||
|
s = ++star_s;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return HTS_FALSE;
|
||||||
|
}
|
||||||
|
if (*p == '*') {
|
||||||
|
star = p++;
|
||||||
|
star_s = s;
|
||||||
|
} else if (*p == *s) {
|
||||||
|
p++;
|
||||||
|
s++;
|
||||||
|
} else if (star != NULL) {
|
||||||
|
p = star + 1;
|
||||||
|
s = ++star_s;
|
||||||
|
} else {
|
||||||
|
return HTS_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (p < pend && *p == '*')
|
||||||
|
p++;
|
||||||
|
return (p == pend) ? HTS_TRUE : HTS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// fil="" : vérifier si règle déja enregistrée
|
// fil="" : vérifier si règle déja enregistrée
|
||||||
int checkrobots(robots_wizard * robots, const char *adr, const char *fil) {
|
int checkrobots(robots_wizard * robots, const char *adr, const char *fil) {
|
||||||
while(robots) {
|
while(robots) {
|
||||||
if (strfield2(robots->adr, adr)) {
|
if (strfield2(robots->adr, adr)) {
|
||||||
if (fil[0]) {
|
if (fil[0]) {
|
||||||
|
/* RFC 9309: longest pattern wins, Allow beats Disallow on ties. */
|
||||||
int ptr = 0;
|
int ptr = 0;
|
||||||
char line[250];
|
char line[HTS_ROBOTS_TOKEN_SIZE];
|
||||||
|
size_t toklen = strlen(robots->token);
|
||||||
|
size_t best_len = 0;
|
||||||
|
hts_boolean matched = HTS_FALSE;
|
||||||
|
hts_boolean best_allow = HTS_FALSE;
|
||||||
|
|
||||||
if (strnotempty(robots->token)) {
|
while (ptr < (int) toklen) {
|
||||||
do {
|
ptr += binput(robots->token + ptr, line, sizeof(line) - 1);
|
||||||
ptr += binput(robots->token + ptr, line, 200);
|
if (line[0] != 'A' && line[0] != 'D')
|
||||||
if (line[0] == '/') { // absolu
|
continue;
|
||||||
if (strfield(fil, line)) { // commence avec ligne
|
{
|
||||||
return -1; // interdit
|
const hts_boolean is_allow =
|
||||||
}
|
(line[0] == 'A') ? HTS_TRUE : HTS_FALSE;
|
||||||
} else { // relatif
|
const char *pat = line + 1;
|
||||||
if (strstrcase(fil, line)) {
|
|
||||||
return -1;
|
if (robots_pattern_match(pat, fil)) {
|
||||||
|
const size_t len = strlen(pat);
|
||||||
|
|
||||||
|
if (!matched || len > best_len || (len == best_len && is_allow)) {
|
||||||
|
matched = HTS_TRUE;
|
||||||
|
best_len = len;
|
||||||
|
best_allow = is_allow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while((strnotempty(line)) && (ptr < (int) strlen(robots->token)));
|
}
|
||||||
}
|
}
|
||||||
|
if (matched && !best_allow)
|
||||||
|
return -1; // forbidden
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -74,6 +130,93 @@ int checkrobots(robots_wizard * robots, const char *adr, const char *fil) {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Append "<marker><pattern>\n" to the bounded rule blob if it fits. */
|
||||||
|
static void robots_blob_add(char *blob, size_t blobsize, char marker,
|
||||||
|
const char *pat) {
|
||||||
|
const size_t used = strlen(blob);
|
||||||
|
const size_t need = strlen(pat) + 2; // marker + '\n'
|
||||||
|
|
||||||
|
if (need < blobsize - used) { // overflow-safe: used <= blobsize-1
|
||||||
|
blob[used] = marker;
|
||||||
|
blob[used + 1] = '\0';
|
||||||
|
strlcatbuff(blob, pat, blobsize);
|
||||||
|
strlcatbuff(blob, "\n", blobsize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void robots_parse(robots_wizard *robots, const char *adr, const char *body,
|
||||||
|
size_t bodysize, char *info, size_t infosize,
|
||||||
|
hts_boolean keep_root_disallow) {
|
||||||
|
size_t bptr = 0;
|
||||||
|
int record = 0;
|
||||||
|
char BIGSTK line[1024];
|
||||||
|
char BIGSTK blob[HTS_ROBOTS_TOKEN_SIZE];
|
||||||
|
|
||||||
|
blob[0] = '\0';
|
||||||
|
if (info != NULL && infosize > 0)
|
||||||
|
info[0] = '\0';
|
||||||
|
#if DEBUG_ROBOTS
|
||||||
|
printf("robots.txt dump:\n%s\n", body);
|
||||||
|
#endif
|
||||||
|
while (bptr < bodysize) {
|
||||||
|
char *comm;
|
||||||
|
int llen;
|
||||||
|
|
||||||
|
bptr += binput(body + bptr, line, sizeof(line) - 2);
|
||||||
|
comm = strchr(line, '#'); // strip comment
|
||||||
|
if (comm != NULL)
|
||||||
|
*comm = '\0';
|
||||||
|
llen = (int) strlen(line); // strip trailing spaces
|
||||||
|
while (llen > 0 && is_realspace(line[llen - 1])) {
|
||||||
|
line[llen - 1] = '\0';
|
||||||
|
llen--;
|
||||||
|
}
|
||||||
|
if (strfield(line, "user-agent:")) {
|
||||||
|
char *a = line + 11;
|
||||||
|
|
||||||
|
while (is_realspace(*a))
|
||||||
|
a++;
|
||||||
|
if (*a == '*') {
|
||||||
|
if (record != 2)
|
||||||
|
record = 1; // generic group applies to us
|
||||||
|
} else if (strfield(a, "httrack") || strfield(a, "winhttrack") ||
|
||||||
|
strfield(a, "webhttrack")) {
|
||||||
|
blob[0] = '\0'; // explicit group: restart capture
|
||||||
|
if (info != NULL && infosize > 0)
|
||||||
|
info[0] = '\0';
|
||||||
|
record = 2; // locked to the httrack group
|
||||||
|
} else
|
||||||
|
record = 0;
|
||||||
|
} else if (record) {
|
||||||
|
hts_boolean is_allow = strfield(line, "allow:");
|
||||||
|
hts_boolean is_disallow = !is_allow && strfield(line, "disallow:");
|
||||||
|
|
||||||
|
if (is_allow || is_disallow) {
|
||||||
|
char *a = line + (is_allow ? 6 : 9);
|
||||||
|
|
||||||
|
while (is_realspace(*a))
|
||||||
|
a++;
|
||||||
|
if (strnotempty(a)) {
|
||||||
|
if (is_disallow && !keep_root_disallow && strcmp(a, "/") == 0) {
|
||||||
|
// dropped: site-wide disallow ignored by option
|
||||||
|
} else {
|
||||||
|
robots_blob_add(blob, sizeof(blob), is_allow ? 'A' : 'D', a);
|
||||||
|
if (is_disallow && info != NULL &&
|
||||||
|
strlen(a) + 2 < infosize - strlen(info)) {
|
||||||
|
if (strnotempty(info))
|
||||||
|
strlcatbuff(info, ", ", infosize);
|
||||||
|
strlcatbuff(info, a, infosize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strnotempty(blob))
|
||||||
|
checkrobots_set(robots, adr, blob);
|
||||||
|
}
|
||||||
|
|
||||||
int checkrobots_set(robots_wizard * robots, const char *adr, const char *data) {
|
int checkrobots_set(robots_wizard * robots, const char *adr, const char *data) {
|
||||||
if (((int) strlen(adr)) >= sizeof(robots->adr) - 2)
|
if (((int) strlen(adr)) >= sizeof(robots->adr) - 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -39,17 +39,27 @@ Please visit our Website: http://www.httrack.com
|
|||||||
#define HTS_DEF_FWSTRUCT_robots_wizard
|
#define HTS_DEF_FWSTRUCT_robots_wizard
|
||||||
typedef struct robots_wizard robots_wizard;
|
typedef struct robots_wizard robots_wizard;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Per-host blob: one rule per line, first byte 'A'/'D' then path pattern. */
|
||||||
|
#define HTS_ROBOTS_TOKEN_SIZE 4096
|
||||||
|
|
||||||
struct robots_wizard {
|
struct robots_wizard {
|
||||||
char adr[128];
|
char adr[128];
|
||||||
char token[4096];
|
char token[HTS_ROBOTS_TOKEN_SIZE];
|
||||||
struct robots_wizard *next;
|
struct robots_wizard *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Library internal definictions */
|
/* Library internal definictions */
|
||||||
#ifdef HTS_INTERNAL_BYTECODE
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
/* -1 if `fil` disallowed for `adr` (RFC 9309); empty: -1 if rules exist. */
|
||||||
int checkrobots(robots_wizard * robots, const char *adr, const char *fil);
|
int checkrobots(robots_wizard * robots, const char *adr, const char *fil);
|
||||||
void checkrobots_free(robots_wizard * robots);
|
void checkrobots_free(robots_wizard * robots);
|
||||||
int checkrobots_set(robots_wizard * robots, const char *adr, const char *data);
|
int checkrobots_set(robots_wizard * robots, const char *adr, const char *data);
|
||||||
|
/* Parse robots.txt `body` for `adr`, storing the HTTrack group's rules; `info`
|
||||||
|
gets a disallow summary, `keep_root_disallow` FALSE drops "Disallow: /". */
|
||||||
|
void robots_parse(robots_wizard *robots, const char *adr, const char *body,
|
||||||
|
size_t bodysize, char *info, size_t infosize,
|
||||||
|
hts_boolean keep_root_disallow);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
279
src/htssafe.h
279
src/htssafe.h
@@ -48,7 +48,7 @@ Please visit our Website: http://www.httrack.com
|
|||||||
/** Assert error callback. **/
|
/** Assert error callback. **/
|
||||||
#ifndef HTS_DEF_FWSTRUCT_htsErrorCallback
|
#ifndef HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||||
#define HTS_DEF_FWSTRUCT_htsErrorCallback
|
#define HTS_DEF_FWSTRUCT_htsErrorCallback
|
||||||
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
|
typedef void (*htsErrorCallback)(const char *msg, const char *file, int line);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -58,12 +58,13 @@ HTSEXT_API htsErrorCallback hts_get_error_callback(void);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HTSSAFE_ABORT_FUNCTION(A,B,C) do { \
|
#define HTSSAFE_ABORT_FUNCTION(A, B, C) \
|
||||||
htsErrorCallback callback = hts_get_error_callback(); \
|
do { \
|
||||||
if (callback != NULL) { \
|
htsErrorCallback callback = hts_get_error_callback(); \
|
||||||
callback(A,B,C); \
|
if (callback != NULL) { \
|
||||||
} \
|
callback(A, B, C); \
|
||||||
} while(0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -75,7 +76,8 @@ HTSEXT_API htsErrorCallback hts_get_error_callback(void);
|
|||||||
/**
|
/**
|
||||||
* Fatal assertion check.
|
* Fatal assertion check.
|
||||||
*/
|
*/
|
||||||
#define assertf__(exp, sexp, file, line) (void) ( (exp) || (abortf_(sexp, file, line), 0) )
|
#define assertf__(exp, sexp, file, line) \
|
||||||
|
(void) ((exp) || (abortf_(sexp, file, line), 0))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal assertion check.
|
* Fatal assertion check.
|
||||||
@@ -104,13 +106,15 @@ static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
|
|||||||
* Check whether 'VAR' is of type char[].
|
* Check whether 'VAR' is of type char[].
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
|
|
||||||
/* Note: char[] and const char[] are compatible */
|
/* Note: char[] and const char[] are compatible */
|
||||||
#define HTS_IS_CHAR_BUFFER(VAR) ( __builtin_types_compatible_p ( typeof (VAR), char[] ) )
|
#define HTS_IS_CHAR_BUFFER(VAR) \
|
||||||
|
(__builtin_types_compatible_p(typeof(VAR), char[]))
|
||||||
#else
|
#else
|
||||||
/* Note: a bit lame as char[8] won't be seen. */
|
/* Note: a bit lame as char[8] won't be seen. */
|
||||||
#define HTS_IS_CHAR_BUFFER(VAR) ( sizeof(VAR) != sizeof(char*) )
|
#define HTS_IS_CHAR_BUFFER(VAR) (sizeof(VAR) != sizeof(char *))
|
||||||
#endif
|
#endif
|
||||||
#define HTS_IS_NOT_CHAR_BUFFER(VAR) ( ! HTS_IS_CHAR_BUFFER(VAR) )
|
#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
|
||||||
|
|
||||||
/* Compile-time checks. */
|
/* Compile-time checks. */
|
||||||
static HTS_UNUSED void htssafe_compile_time_check_(void) {
|
static HTS_UNUSED void htssafe_compile_time_check_(void) {
|
||||||
@@ -139,8 +143,11 @@ static HTS_UNUSED void htssafe_compile_time_check_(void) {
|
|||||||
* (MSVC, ...) keep the previous behavior via the #else branches.
|
* (MSVC, ...) keep the previous behavior via the #else branches.
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
|
|
||||||
#if defined(__has_attribute)
|
#if defined(__has_attribute)
|
||||||
|
|
||||||
#if __has_attribute(warning)
|
#if __has_attribute(warning)
|
||||||
|
|
||||||
#define HTS_BUFF_PTR_ATTR(msg) __attribute__((unused, noinline, warning(msg)))
|
#define HTS_BUFF_PTR_ATTR(msg) __attribute__((unused, noinline, warning(msg)))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -152,122 +159,189 @@ static HTS_UNUSED void htssafe_compile_time_check_(void) {
|
|||||||
|
|
||||||
HTS_BUFF_PTR_ATTR("strcpybuff() destination is a pointer (capacity unknown): "
|
HTS_BUFF_PTR_ATTR("strcpybuff() destination is a pointer (capacity unknown): "
|
||||||
"NOT bounds-checked; use strlcpybuff(dst, src, size)")
|
"NOT bounds-checked; use strlcpybuff(dst, src, size)")
|
||||||
|
|
||||||
static char *strcpybuff_ptr_(char *dest, const char *src) {
|
static char *strcpybuff_ptr_(char *dest, const char *src) {
|
||||||
return strcpy(dest, src);
|
return strcpy(dest, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTS_BUFF_PTR_ATTR("strcatbuff() destination is a pointer (capacity unknown): "
|
HTS_BUFF_PTR_ATTR("strcatbuff() destination is a pointer (capacity unknown): "
|
||||||
"NOT bounds-checked; use strlcatbuff(dst, src, size)")
|
"NOT bounds-checked; use strlcatbuff(dst, src, size)")
|
||||||
|
|
||||||
static char *strcatbuff_ptr_(char *dest, const char *src) {
|
static char *strcatbuff_ptr_(char *dest, const char *src) {
|
||||||
return strcat(dest, src);
|
return strcat(dest, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTS_BUFF_PTR_ATTR("strncatbuff() destination is a pointer (capacity unknown): "
|
HTS_BUFF_PTR_ATTR("strncatbuff() destination is a pointer (capacity unknown): "
|
||||||
"NOT bounds-checked; use strlcatbuff(dst, src, size)")
|
"NOT bounds-checked; use strlcatbuff(dst, src, size)")
|
||||||
|
|
||||||
static char *strncatbuff_ptr_(char *dest, const char *src, size_t n) {
|
static char *strncatbuff_ptr_(char *dest, const char *src, size_t n) {
|
||||||
return strncat(dest, src, n);
|
return strncat(dest, src, n);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SIZE CONTRACT shared by strcpybuff/strcatbuff/strncatbuff (the "buff"
|
||||||
|
* family): the destination bound is taken from sizeof(A), so A MUST be a real
|
||||||
|
* char[] array in scope. The bound is the full array size in bytes, INCLUDING
|
||||||
|
* the terminating NUL. On overflow the *_safe_ helpers do NOT truncate: they
|
||||||
|
* abort() (assertf). On success the result is always NUL-terminated.
|
||||||
|
*
|
||||||
|
* CRITICAL CAVEAT: if A is a bare char* pointer (not an array), sizeof(A) is
|
||||||
|
* the pointer size, not the buffer capacity. There is no way to recover the
|
||||||
|
* real capacity, so these macros SILENTLY DEGRADE to the unbounded raw
|
||||||
|
* strcpy()/strcat()/strncat() while still looking like a checked call. The
|
||||||
|
* bound is lost. On GCC/Clang (C) the pointer case routes through the
|
||||||
|
* *_ptr_ stubs above, which carry a 'warning' attribute to flag the site at
|
||||||
|
* compile time; on other compilers it is silent. When the destination is a
|
||||||
|
* pointer of known capacity, call the explicit-size strlcpybuff/strlcatbuff
|
||||||
|
* (passing the capacity, NUL included) instead.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append at most N characters from "B" to "A".
|
* Append at most N characters from "B" to "A".
|
||||||
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
||||||
* is assumed to be the capacity of this array.
|
* is assumed to be the capacity of this array.
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
#define strncatbuff(A, B, N) __builtin_choose_expr( HTS_IS_CHAR_BUFFER(A), \
|
|
||||||
strncat_safe_(A, sizeof(A), B, \
|
#define strncatbuff(A, B, N) \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), N, \
|
__builtin_choose_expr( \
|
||||||
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__), \
|
HTS_IS_CHAR_BUFFER(A), \
|
||||||
strncatbuff_ptr_((A), (B), (N)) )
|
strncat_safe_(A, sizeof(A), B, \
|
||||||
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), N, \
|
||||||
|
"overflow while appending '" #B "' to '" #A "'", __FILE__, \
|
||||||
|
__LINE__), \
|
||||||
|
strncatbuff_ptr_((A), (B), (N)))
|
||||||
#else
|
#else
|
||||||
#define strncatbuff(A, B, N) \
|
#define strncatbuff(A, B, N) \
|
||||||
( HTS_IS_NOT_CHAR_BUFFER(A) \
|
(HTS_IS_NOT_CHAR_BUFFER(A) \
|
||||||
? strncat(A, B, N) \
|
? strncat(A, B, N) \
|
||||||
: strncat_safe_(A, sizeof(A), B, \
|
: strncat_safe_(A, sizeof(A), B, \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), N, \
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), N, \
|
||||||
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__) )
|
"overflow while appending '" #B "' to '" #A "'", \
|
||||||
|
__FILE__, __LINE__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append characters of "B" to "A".
|
* Append characters of "B" to "A".
|
||||||
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
||||||
* is assumed to be the capacity of this array.
|
* is assumed to be the capacity of this array.
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
#define strcatbuff(A, B) __builtin_choose_expr( HTS_IS_CHAR_BUFFER(A), \
|
|
||||||
strncat_safe_(A, sizeof(A), B, \
|
#define strcatbuff(A, B) \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), (size_t) -1, \
|
__builtin_choose_expr( \
|
||||||
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__), \
|
HTS_IS_CHAR_BUFFER(A), \
|
||||||
strcatbuff_ptr_((A), (B)) )
|
strncat_safe_(A, sizeof(A), B, \
|
||||||
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
|
(size_t) -1, \
|
||||||
|
"overflow while appending '" #B "' to '" #A "'", __FILE__, \
|
||||||
|
__LINE__), \
|
||||||
|
strcatbuff_ptr_((A), (B)))
|
||||||
#else
|
#else
|
||||||
#define strcatbuff(A, B) \
|
#define strcatbuff(A, B) \
|
||||||
( HTS_IS_NOT_CHAR_BUFFER(A) \
|
(HTS_IS_NOT_CHAR_BUFFER(A) \
|
||||||
? strcat(A, B) \
|
? strcat(A, B) \
|
||||||
: strncat_safe_(A, sizeof(A), B, \
|
: strncat_safe_(A, sizeof(A), B, \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), (size_t) -1, \
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__) )
|
(size_t) -1, \
|
||||||
|
"overflow while appending '" #B "' to '" #A "'", \
|
||||||
|
__FILE__, __LINE__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy characters from "B" to "A".
|
* Copy characters from "B" to "A".
|
||||||
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
* If "A" is a char[] variable whose size is not sizeof(char*), then the size
|
||||||
* is assumed to be the capacity of this array.
|
* is assumed to be the capacity of this array.
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
#define strcpybuff(A, B) __builtin_choose_expr( HTS_IS_CHAR_BUFFER(A), \
|
|
||||||
strcpy_safe_(A, sizeof(A), B, \
|
#define strcpybuff(A, B) \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
__builtin_choose_expr( \
|
||||||
"overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__), \
|
HTS_IS_CHAR_BUFFER(A), \
|
||||||
strcpybuff_ptr_((A), (B)) )
|
strcpy_safe_(A, sizeof(A), B, \
|
||||||
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
|
"overflow while copying '" #B "' to '" #A "'", __FILE__, \
|
||||||
|
__LINE__), \
|
||||||
|
strcpybuff_ptr_((A), (B)))
|
||||||
#else
|
#else
|
||||||
#define strcpybuff(A, B) \
|
#define strcpybuff(A, B) \
|
||||||
( HTS_IS_NOT_CHAR_BUFFER(A) \
|
(HTS_IS_NOT_CHAR_BUFFER(A) \
|
||||||
? strcpy(A, B) \
|
? strcpy(A, B) \
|
||||||
: strcpy_safe_(A, sizeof(A), B, \
|
: strcpy_safe_(A, sizeof(A), B, \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
"overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__) )
|
"overflow while copying '" #B "' to '" #A "'", __FILE__, \
|
||||||
|
__LINE__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Explicit-size variants (strlcatbuff/strlncatbuff/strlcpybuff): the
|
||||||
|
* destination capacity is the caller-supplied S (total bytes, NUL included),
|
||||||
|
* NOT derived from sizeof(A). Use these when A is a pointer or its capacity is
|
||||||
|
* not its sizeof. Same abort-on-overflow, always-NUL-terminated contract; no
|
||||||
|
* silent pointer degradation since the bound is passed in.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append characters of "B" to "A", "A" having a maximum capacity of "S".
|
* Append characters of "B" to "A", "A" having a maximum capacity of "S".
|
||||||
*/
|
*/
|
||||||
#define strlcatbuff(A, B, S) \
|
#define strlcatbuff(A, B, S) \
|
||||||
strncat_safe_(A, S, B, \
|
strncat_safe_(A, S, B, HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), (size_t) -1, \
|
(size_t) -1, "overflow while appending '" #B "' to '" #A "'", \
|
||||||
"overflow while appending '" #B "' to '"#A"'", __FILE__, __LINE__)
|
__FILE__, __LINE__)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append at most "N" characters of "B" to "A", "A" having a maximum capacity
|
||||||
|
* of "S".
|
||||||
|
*/
|
||||||
|
#define strlncatbuff(A, B, S, N) \
|
||||||
|
strncat_safe_(A, S, B, HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
|
N, "overflow while appending '" #B "' to '" #A "'", __FILE__, \
|
||||||
|
__LINE__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy characters of "B" to "A", "A" having a maximum capacity of "S".
|
* Copy characters of "B" to "A", "A" having a maximum capacity of "S".
|
||||||
*/
|
*/
|
||||||
#define strlcpybuff(A, B, S) \
|
#define strlcpybuff(A, B, S) \
|
||||||
strcpy_safe_(A, S, B, \
|
strcpy_safe_(A, S, B, HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
||||||
HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(B), \
|
"overflow while copying '" #B "' to '" #A "'", __FILE__, \
|
||||||
"overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__)
|
__LINE__)
|
||||||
|
|
||||||
/** strnlen replacement (autotools). **/
|
/** strnlen replacement (autotools). **/
|
||||||
#if ( ! defined(_WIN32) && ! defined(HAVE_STRNLEN) )
|
#if (!defined(_WIN32) && !defined(HAVE_STRNLEN))
|
||||||
|
|
||||||
static HTS_UNUSED size_t strnlen(const char *s, size_t maxlen) {
|
static HTS_UNUSED size_t strnlen(const char *s, size_t maxlen) {
|
||||||
size_t i;
|
size_t i;
|
||||||
for(i = 0 ; i < maxlen && s[i] != '\0' ; i++) ;
|
for (i = 0; i < maxlen && s[i] != '\0'; i++)
|
||||||
|
;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED size_t strlen_safe_(const char *source, const size_t sizeof_source,
|
/* strlen of source, but bounded by sizeof_source (its capacity, NUL included).
|
||||||
|
Aborts if source is NULL or has no NUL within that capacity. The sentinel
|
||||||
|
sizeof_source == (size_t)-1 means "capacity unknown", and falls back to the
|
||||||
|
unbounded strlen (used when the source is a pointer rather than an array). */
|
||||||
|
static HTS_INLINE HTS_UNUSED size_t strlen_safe_(const char *source,
|
||||||
|
const size_t sizeof_source,
|
||||||
const char *file, int line) {
|
const char *file, int line) {
|
||||||
size_t size;
|
size_t size;
|
||||||
assertf_( source != NULL, file, line );
|
assertf_(source != NULL, file, line);
|
||||||
size = sizeof_source != (size_t) -1
|
size = sizeof_source != (size_t) -1 ? strnlen(source, sizeof_source)
|
||||||
? strnlen(source, sizeof_source) : strlen(source);
|
: strlen(source);
|
||||||
assertf_( size < sizeof_source, file, line );
|
assertf_(size < sizeof_source, file, line);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED char* strncat_safe_(char *const dest, const size_t sizeof_dest,
|
/* Core bounded append. Appends min(strlen(source), n) bytes of source onto
|
||||||
const char *const source, const size_t sizeof_source,
|
dest. sizeof_dest is dest's total capacity (NUL included); sizeof_source is
|
||||||
const size_t n,
|
source's capacity or (size_t)-1 if unknown. Aborts if the result (existing
|
||||||
const char *exp, const char *file, int line) {
|
dest length + appended bytes + NUL) would not fit sizeof_dest: this NEVER
|
||||||
|
truncates. Always NUL-terminates on success. */
|
||||||
|
static HTS_INLINE HTS_UNUSED char *
|
||||||
|
strncat_safe_(char *const dest, const size_t sizeof_dest,
|
||||||
|
const char *const source, const size_t sizeof_source,
|
||||||
|
const size_t n, const char *exp, const char *file, int line) {
|
||||||
const size_t source_len = strlen_safe_(source, sizeof_source, file, line);
|
const size_t source_len = strlen_safe_(source, sizeof_source, file, line);
|
||||||
const size_t dest_len = strlen_safe_(dest, sizeof_dest, file, line);
|
const size_t dest_len = strlen_safe_(dest, sizeof_dest, file, line);
|
||||||
/* note: "size_t is an unsigned integral type" ((size_t) -1 is positive) */
|
/* note: "size_t is an unsigned integral type" ((size_t) -1 is positive) */
|
||||||
@@ -279,12 +353,17 @@ static HTS_INLINE HTS_UNUSED char* strncat_safe_(char *const dest, const size_t
|
|||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED char* strcpy_safe_(char *const dest, const size_t sizeof_dest,
|
/* Core bounded copy: empties dest then appends all of source via
|
||||||
const char *const source, const size_t sizeof_source,
|
strncat_safe_. sizeof_dest is dest's total capacity (NUL included). Aborts
|
||||||
const char *exp, const char *file, int line) {
|
(no truncation) if source plus its NUL would not fit. */
|
||||||
|
static HTS_INLINE HTS_UNUSED char *
|
||||||
|
strcpy_safe_(char *const dest, const size_t sizeof_dest,
|
||||||
|
const char *const source, const size_t sizeof_source,
|
||||||
|
const char *exp, const char *file, int line) {
|
||||||
assertf_(sizeof_dest != 0, file, line);
|
assertf_(sizeof_dest != 0, file, line);
|
||||||
dest[0] = '\0';
|
dest[0] = '\0';
|
||||||
return strncat_safe_(dest, sizeof_dest, source, sizeof_source, (size_t) -1, exp, file, line);
|
return strncat_safe_(dest, sizeof_dest, source, sizeof_source, (size_t) -1,
|
||||||
|
exp, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -302,9 +381,9 @@ static HTS_INLINE HTS_UNUSED char* strcpy_safe_(char *const dest, const size_t s
|
|||||||
* htsbuff_ptr(). The buffer is kept NUL-terminated; htsbuff_str() returns it.
|
* htsbuff_ptr(). The buffer is kept NUL-terminated; htsbuff_str() returns it.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *buf; /* backing buffer (kept NUL-terminated) */
|
char *buf; /* backing buffer (kept NUL-terminated) */
|
||||||
size_t cap; /* total capacity of buf, including the NUL */
|
size_t cap; /* total capacity of buf, including the NUL */
|
||||||
size_t len; /* current length, excluding the NUL */
|
size_t len; /* current length, excluding the NUL */
|
||||||
} htsbuff;
|
} htsbuff;
|
||||||
|
|
||||||
static HTS_INLINE HTS_UNUSED htsbuff htsbuff_ptr_(char *buf, size_t cap) {
|
static HTS_INLINE HTS_UNUSED htsbuff htsbuff_ptr_(char *buf, size_t cap) {
|
||||||
@@ -324,23 +403,31 @@ static HTS_INLINE HTS_UNUSED htsbuff htsbuff_ptr_(char *buf, size_t cap) {
|
|||||||
* On other compilers there is no such guard, so pass only true arrays there.
|
* On other compilers there is no such guard, so pass only true arrays there.
|
||||||
*/
|
*/
|
||||||
#if (defined(__GNUC__) && !defined(__cplusplus))
|
#if (defined(__GNUC__) && !defined(__cplusplus))
|
||||||
|
|
||||||
/* 0 for an array, a -1 array-size compile error for a pointer. */
|
/* 0 for an array, a -1 array-size compile error for a pointer. */
|
||||||
#define htsbuff_must_be_array_(A) \
|
#define htsbuff_must_be_array_(A) \
|
||||||
(sizeof(char[1 - 2 * !!__builtin_types_compatible_p(typeof(A), typeof(&(A)[0]))]) - 1)
|
(sizeof(char[1 - 2 * !!__builtin_types_compatible_p(typeof(A), \
|
||||||
#define htsbuff_array(ARR) htsbuff_ptr_((ARR), sizeof(ARR) + htsbuff_must_be_array_(ARR))
|
typeof(&(A)[0]))]) - \
|
||||||
|
1)
|
||||||
|
|
||||||
|
#define htsbuff_array(ARR) \
|
||||||
|
htsbuff_ptr_((ARR), sizeof(ARR) + htsbuff_must_be_array_(ARR))
|
||||||
#else
|
#else
|
||||||
#define htsbuff_array(ARR) htsbuff_ptr_((ARR), sizeof(ARR))
|
#define htsbuff_array(ARR) htsbuff_ptr_((ARR), sizeof(ARR))
|
||||||
#endif
|
#endif
|
||||||
/** Builder over pointer P of known capacity N (N includes the NUL). */
|
/** Builder over pointer P of known capacity N (N includes the NUL). */
|
||||||
#define htsbuff_ptr(P, N) htsbuff_ptr_((P), (N))
|
#define htsbuff_ptr(P, N) htsbuff_ptr_((P), (N))
|
||||||
|
|
||||||
/** Append at most n characters of s (stopping at its NUL). Aborts on overflow. */
|
/** Append at most n characters of s (stopping at its NUL). Aborts on overflow.
|
||||||
static HTS_INLINE HTS_UNUSED void htsbuff_catn(htsbuff *b, const char *s, size_t n) {
|
*/
|
||||||
|
static HTS_INLINE HTS_UNUSED void htsbuff_catn(htsbuff *b, const char *s,
|
||||||
|
size_t n) {
|
||||||
const size_t add = strnlen(s, n);
|
const size_t add = strnlen(s, n);
|
||||||
/* Overflow-safe: keep the (potentially huge) 'add' alone on one side. The
|
/* Overflow-safe: keep the (potentially huge) 'add' alone on one side. The
|
||||||
maintained invariant len < cap makes 'cap - len' >= 1 (no underflow), so
|
maintained invariant len < cap makes 'cap - len' >= 1 (no underflow), so
|
||||||
'add < cap - len' cannot wrap the way 'len + add < cap' could. */
|
'add < cap - len' cannot wrap the way 'len + add < cap' could. */
|
||||||
assertf__(add < b->cap - b->len, "htsbuff append overflow", __FILE__, __LINE__);
|
assertf__(add < b->cap - b->len, "htsbuff append overflow", __FILE__,
|
||||||
|
__LINE__);
|
||||||
memcpy(b->buf + b->len, s, add);
|
memcpy(b->buf + b->len, s, add);
|
||||||
b->len += add;
|
b->len += add;
|
||||||
b->buf[b->len] = '\0';
|
b->buf[b->len] = '\0';
|
||||||
@@ -369,11 +456,33 @@ static HTS_INLINE HTS_UNUSED const char *htsbuff_str(const htsbuff *b) {
|
|||||||
return b->buf;
|
return b->buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define malloct(A) malloc(A)
|
/** True if 'count' records of >= 1 byte each fit in 'available' bytes; guards
|
||||||
#define calloct(A,B) calloc((A), (B))
|
an attacker-controlled count driving a large allocation. */
|
||||||
#define freet(A) do { if ((A) != NULL) { free(A); (A) = NULL; } } while(0)
|
static HTS_INLINE HTS_UNUSED hts_boolean hts_count_fits(size_t count,
|
||||||
#define strdupt(A) strdup(A)
|
LLint available) {
|
||||||
#define realloct(A,B) realloc(A, B)
|
return (available >= 0 && (LLint) count <= available) ? HTS_TRUE : HTS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Thin aliases over the libc allocator/memcpy (historical "t" suffix); no
|
||||||
|
added bounds checking. freet() also NULLs the freed pointer and tolerates
|
||||||
|
NULL. memcpybuff() despite the name is a raw memcpy: the caller owns the
|
||||||
|
bounds. */
|
||||||
|
#define malloct(A) malloc(A)
|
||||||
|
|
||||||
|
#define calloct(A, B) calloc((A), (B))
|
||||||
|
|
||||||
|
#define freet(A) \
|
||||||
|
do { \
|
||||||
|
if ((A) != NULL) { \
|
||||||
|
free(A); \
|
||||||
|
(A) = NULL; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define strdupt(A) strdup(A)
|
||||||
|
|
||||||
|
#define realloct(A, B) realloc(A, B)
|
||||||
|
|
||||||
#define memcpybuff(A, B, N) memcpy((A), (B), (N))
|
#define memcpybuff(A, B, N) memcpy((A), (B), (N))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
2196
src/htsselftest.c
Normal file
2196
src/htsselftest.c
Normal file
File diff suppressed because it is too large
Load Diff
52
src/htsselftest.h
Normal file
52
src/htsselftest.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/*
|
||||||
|
HTTrack Website Copier, Offline Browser for Windows and Unix
|
||||||
|
Copyright (C) 2026 Xavier Roche and other contributors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Ethical use: we kindly ask that you NOT use this software to harvest email
|
||||||
|
addresses or to collect any other private information about people. Doing so
|
||||||
|
would dishonor our work and waste the many hours we have spent on it.
|
||||||
|
|
||||||
|
Please visit our Website: http://www.httrack.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/* File: htsselftest.h */
|
||||||
|
/* named dispatch for the hidden engine self-tests */
|
||||||
|
/* Author: Xavier Roche */
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#ifndef HTSSELFTEST_DEFH
|
||||||
|
#define HTSSELFTEST_DEFH
|
||||||
|
|
||||||
|
#ifdef HTS_INTERNAL_BYTECODE
|
||||||
|
|
||||||
|
#ifndef HTS_DEF_FWSTRUCT_httrackp
|
||||||
|
#define HTS_DEF_FWSTRUCT_httrackp
|
||||||
|
typedef struct httrackp httrackp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Run engine self-test `name` over the positional args argv[0..argc-1], or list
|
||||||
|
the available tests when name is NULL, empty, or "list". Prints the result;
|
||||||
|
returns the process exit code (0 == success). The caller owns option cleanup.
|
||||||
|
Reached through the hidden `httrack -#test[=NAME ...]` subcommand. */
|
||||||
|
int hts_selftest(httrackp *opt, const char *name, int argc, char **argv);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user