Skip to content

Commit

Permalink
index on (no branch): 819f120 ext_time_quota_acl: remove -l option (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
rousskov committed Oct 29, 2024
1 parent 819f120 commit c1d4b80
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 69 deletions.
65 changes: 5 additions & 60 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
sudo apt-get --quiet=2 install libtool-bin
- name: Setup a nodejs environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Checkout Squid sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.CHECKOUT_FETCH_DEPTH }}

- run: ./bootstrap.sh
- run: ./configure --with-openssl
- run: make -j2
- run: make -j`nproc`
- run: |
sudo make install
sudo chown -R nobody:nogroup /usr/local/squid
Expand All @@ -58,65 +58,10 @@ jobs:

- name: Publish test logs
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
${{ runner.temp }}/*.log
/usr/local/squid/var/logs/overlord/*.log
source-maintenance-tests:

runs-on: ubuntu-22.04

steps:
- name: Install prerequisite packages
run: |
sudo apt-get --quiet=2 update
sudo apt-get --quiet=2 install astyle
sudo apt-get --quiet=2 install gperf
pip install \
--user \
--no-cache-dir \
--disable-pip-version-check \
--quiet \
--progress-bar off \
codespell==1.16 # TODO: Upgrade to codespell v2
- uses: actions/checkout@v3
with:
fetch-depth: ${{ env.CHECKOUT_FETCH_DEPTH }}

- run: ./test-suite/test-sources.sh

build-tests:

strategy:
fail-fast: true
matrix:
os: [ ubuntu-22.04 ]

runs-on: ${{ matrix.os }}

steps:

- name: Install prerequisite Linux packages
if: runner.os == 'Linux'
run: |
# required for "apt-get build-dep" to work
sudo sed --in-place -E 's/# (deb-src.*updates main)/ \1/g' /etc/apt/sources.list
sudo apt-get --quiet=2 update
sudo apt-get --quiet=2 build-dep squid
sudo apt-get --quiet=2 install linuxdoc-tools
- name: Checkout sources
uses: actions/checkout@v3

- run: ./test-builds.sh

- name: Publish build logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: build-logs-${{ runner.os }}
path: btlayer-*.log
6 changes: 3 additions & 3 deletions src/MemStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ MemStore::copyFromShm(StoreEntry &e, const sfileno index, const Ipc::StoreMapAnc
" from " << extra.page << '+' << prefixSize);

// parse headers if needed; they might span multiple slices!
auto &reply = e.mem().adjustableBaseReply();
if (reply.pstate != Http::Message::psParsed) {
if (!e.hasParsedReplyHeader()) {
httpHeaderParsingBuffer.append(sliceBuf.data, sliceBuf.length);
auto &reply = e.mem().adjustableBaseReply();
if (reply.parseTerminatedPrefix(httpHeaderParsingBuffer.c_str(), httpHeaderParsingBuffer.length()))
httpHeaderParsingBuffer = SBuf(); // we do not need these bytes anymore
}
Expand Down Expand Up @@ -544,7 +544,7 @@ MemStore::copyFromShm(StoreEntry &e, const sfileno index, const Ipc::StoreMapAnc
debugs(20, 5, "mem-loaded all " << e.mem_obj->endOffset() << '/' <<
anchor.basics.swap_file_sz << " bytes of " << e);

if (e.mem().adjustableBaseReply().pstate != Http::Message::psParsed)
if (!e.hasParsedReplyHeader())
throw TextException(ToSBuf("truncated mem-cached headers; accumulated: ", httpHeaderParsingBuffer.length()), Here());

// from StoreEntry::complete()
Expand Down
3 changes: 3 additions & 0 deletions src/Store.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class StoreEntry : public hash_link, public Packable
/// \see MemObject::freshestReply()
const HttpReply *hasFreshestReply() const { return mem_obj ? &mem_obj->freshestReply() : nullptr; }

/// whether this entry has access to [deserialized] [HTTP] response headers
bool hasParsedReplyHeader() const;

void write(StoreIOBuffer);

/** Check if the Store entry is empty
Expand Down
2 changes: 1 addition & 1 deletion src/client_side_reply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ clientReplyContext::storeNotOKTransferDone() const
assert(mem != nullptr);
assert(http->request != nullptr);

if (mem->baseReply().pstate != Http::Message::psParsed)
if (!http->storeEntry()->hasParsedReplyHeader())
/* haven't found end of headers yet */
return 0;

Expand Down
13 changes: 13 additions & 0 deletions src/store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@ StoreEntry::bytesWanted (Range<size_t> const aRange, bool ignoreDelayPools) cons
return mem_obj->mostBytesWanted(aRange.end, ignoreDelayPools);
}

bool
StoreEntry::hasParsedReplyHeader() const
{
if (mem_obj) {
const auto &reply = mem_obj->baseReply();
if (reply.pstate == Http::Message::psParsed) {
debugs(20, 7, reply.hdr_sz);
return true;
}
}
return false;
}

bool
StoreEntry::checkDeferRead(int) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/store_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ store_client::handleBodyFromDisk()
if (!answeredOnce()) {
// All on-disk responses have HTTP headers. First disk body read(s)
// include HTTP headers that we must parse (if needed) and skip.
const auto haveHttpHeaders = entry->mem_obj->baseReply().pstate == Http::Message::psParsed;
const auto haveHttpHeaders = entry->hasParsedReplyHeader();
if (!haveHttpHeaders && !parseHttpHeadersFromDisk())
return;
skipHttpHeadersFromDisk();
Expand Down
10 changes: 6 additions & 4 deletions test-suite/test-functionality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ has_commit_by_message() {
clone_repo() {
local repo_url="$1"
local destination_dir="$2"
local branch="$3"

if test -e $destination_dir
then
echo "Skipping already fetched $destination_dir"
elif run git clone --no-tags --quiet --depth=1 --branch production -- "$repo_url" "$destination_dir"
elif run git clone --no-tags --quiet --depth=1 --branch "$branch" -- "$repo_url" "$destination_dir"
then
if test -e "$destination_dir/package.json"
then
Expand Down Expand Up @@ -93,9 +94,9 @@ start_overlord() {
setup_test_tools() {
echo "::group::Setup test tools"

clone_repo https://github.com/measurement-factory/daft $DAFT_DIR || return
clone_repo https://github.com/measurement-factory/squid-dafts $SQUID_DAFTS_DIR || return
clone_repo https://github.com/measurement-factory/squid-overlord $SQUID_OVERLORD_DIR || return
clone_repo https://github.com/measurement-factory/daft $DAFT_DIR auto || return
clone_repo https://github.com/measurement-factory/squid-dafts $SQUID_DAFTS_DIR auto || return
clone_repo https://github.com/measurement-factory/squid-overlord $SQUID_OVERLORD_DIR auto || return

if ! test -e $SQUID_DAFTS_DIR/src
then
Expand Down Expand Up @@ -221,6 +222,7 @@ main() {
proxy-collapsed-forwarding
busy-restart
truncated-responses
hit-revalidation
"
tests="$default_tests"
fi
Expand Down

0 comments on commit c1d4b80

Please sign in to comment.