Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Htp table optimization + workflows cleanups/v2 #431

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 44 additions & 24 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,56 @@ env:
DEBIAN_FRONTEND: "noninteractive"

jobs:
ubuntu-2004:
name: Ubuntu 20.04
almalinux-9:
name: AlmaLinux 9
runs-on: ubuntu-latest
container: ubuntu:20.04
container: almalinux:9
steps:
- uses: actions/[email protected]
- name: Install system dependencies
run: |
apt update
apt-get upgrade -y
apt-get -y install make \
dnf -y install make \
autoconf \
build-essential \
automake \
libtool \
gcc \
gcc-c++ \
make \
pkgconfig \
zlib-devel
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
- run: make -j2
- run: make install
- run: make distcheck

almalinux-8:
name: AlmaLinux 8
runs-on: ubuntu-latest
container: almalinux:8
steps:
- uses: actions/[email protected]
- name: Install system dependencies
run: |
dnf -y install make \
autoconf \
automake \
dpkg-dev \
debhelper \
libtool \
gcc \
gcc-c++ \
make \
pkg-config \
zlib1g-dev
pkgconfig \
zlib-devel
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
- run: make -j2
- run: make install
- run: make distcheck

ubuntu-2204:
name: Ubuntu 22.04
ubuntu-2004:
name: Ubuntu 20.04
runs-on: ubuntu-latest
container: ubuntu:22.04
container: ubuntu:20.04
steps:
- uses: actions/[email protected]
- name: Install system dependencies
Expand All @@ -53,8 +72,9 @@ jobs:
apt-get -y install make \
autoconf \
build-essential \
autoconf \
automake \
dpkg-dev \
debhelper \
libtool \
make \
pkg-config \
Expand All @@ -65,24 +85,24 @@ jobs:
- run: make install
- run: make distcheck

centos-7:
name: CentOS 7
ubuntu-2204:
name: Ubuntu 22.04
runs-on: ubuntu-latest
container: centos:7
container: ubuntu:22.04
steps:
- uses: actions/[email protected]
- name: Install system dependencies
run: |
yum -y install \
apt update
apt-get upgrade -y
apt-get -y install make \
autoconf \
build-essential \
automake \
gcc \
gcc-c++ \
libtool \
make \
pkgconfig \
which \
zlib-devel
pkg-config \
zlib1g-dev
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
- run: make -j2
Expand Down
6 changes: 3 additions & 3 deletions htp/htp_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ void *htp_table_get(const htp_table_t *table, const bstr *key) {
// keys with the parameter, return data if found.
for (size_t i = 0, n = htp_list_size(&table->list); i < n; i += 2) {
bstr *key_candidate = htp_list_get(&table->list, i);
void *element = htp_list_get(&table->list, i + 1);
if (bstr_cmp_nocase(key_candidate, key) == 0) {
void *element = htp_list_get(&table->list, i + 1);
return element;
}
}
Expand All @@ -207,8 +207,8 @@ void *htp_table_get_c(const htp_table_t *table, const char *ckey) {
// keys with the parameter, return data if found.
for (size_t i = 0, n = htp_list_size(&table->list); i < n; i += 2) {
bstr *key_candidate = htp_list_get(&table->list, i);
void *element = htp_list_get(&table->list, i + 1);
if (bstr_cmp_c_nocasenorzero(key_candidate, ckey) == 0) {
void *element = htp_list_get(&table->list, i + 1);
return element;
}
}
Expand All @@ -235,8 +235,8 @@ void *htp_table_get_mem(const htp_table_t *table, const void *key, size_t key_le
// keys with the parameter, return data if found.
for (size_t i = 0, n = htp_list_size(&table->list); i < n; i += 2) {
bstr *key_candidate = htp_list_get(&table->list, i);
void *element = htp_list_get(&table->list, i + 1);
if (bstr_cmp_mem_nocase(key_candidate, key, key_len) == 0) {
void *element = htp_list_get(&table->list, i + 1);
return element;
}
}
Expand Down
Loading