Skip to content
Merged
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
20 changes: 10 additions & 10 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Install libmicrohttpd dependency
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.64.tar.gz -o libmicrohttpd-0.9.64.tar.gz ;
tar -xzf libmicrohttpd-0.9.64.tar.gz ;
cd libmicrohttpd-0.9.64 ;
./configure --disable-examples ;
make ;
sudo make install ;

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand All @@ -54,20 +63,11 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

- name: Install libmicrohttpd dependency
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz ;
tar -xzf libmicrohttpd-0.9.59.tar.gz ;
cd libmicrohttpd-0.9.59 ;
./configure --disable-examples ;
make ;
sudo make install ;

- name: Manual steps to build the library
run: |
./bootstrap ;
./configure --enable-same-directory-build;
make ;

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
10 changes: 5 additions & 5 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,20 +396,20 @@ jobs:
id: cache-libmicrohttpd
uses: actions/cache@v2
with:
path: libmicrohttpd-0.9.59
path: libmicrohttpd-0.9.64
key: ${{ matrix.os }}-${{ matrix.c-compiler }}-libmicrohttpd-pre-built

- name: Build libmicrohttpd dependency (if not cached)
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz ;
tar -xzf libmicrohttpd-0.9.59.tar.gz ;
cd libmicrohttpd-0.9.59 ;
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.64.tar.gz -o libmicrohttpd-0.9.64.tar.gz ;
tar -xzf libmicrohttpd-0.9.64.tar.gz ;
cd libmicrohttpd-0.9.64 ;
./configure --disable-examples ;
make ;
if: steps.cache-libmicrohttpd.outputs.cache-hit != 'true'

- name: Install libmicrohttpd
run: cd libmicrohttpd-0.9.59 ; sudo make install ;
run: cd libmicrohttpd-0.9.64 ; sudo make install ;

- name: Refresh links to shared libs
run: sudo ldconfig ;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ libhttpserver can be used without any dependencies aside from libmicrohttpd.

The minimum versions required are:
* g++ >= 5.5.0 or clang-3.6
* libmicrohttpd >= 0.9.53
* libmicrohttpd >= 0.9.64
* [Optionally]: for TLS (HTTPS) support, you'll need [libgnutls](http://www.gnutls.org/).
* [Optionally]: to compile the code-reference, you'll need [doxygen](http://www.doxygen.nl/).

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ init:
install:
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -msys2 -c "pacman --noconfirm -S --needed mingw-w64-$MSYS2_ARCH-{libtool,make,pkg-config,libsystre,doxygen,gnutls,graphviz,curl}"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -msys2 -c "pacman --noconfirm -S --needed autotools"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && tar -xzf libmicrohttpd-0.9.59.tar.gz"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER/libmicrohttpd-0.9.59 && ./configure --disable-examples --enable-poll=no --prefix /C/msys64 && make && make install"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.64.tar.gz -o libmicrohttpd-0.9.64.tar.gz"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && tar -xzf libmicrohttpd-0.9.64.tar.gz"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER/libmicrohttpd-0.9.64 && ./configure --disable-examples --enable-poll=no --prefix /C/msys64 && make && make install"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && ./bootstrap"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER && mkdir build && cd build && MANIFEST_TOOL=no; ../configure --disable-fastopen --prefix /C/msys64 CXXFLAGS=-I/C/msys64/include LDFLAGS=-L/C/msys64/lib; make"'
build_script:
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ AC_CHECK_HEADER([gnutls/gnutls.h],[have_gnutls="yes"],[AC_MSG_WARN("gnutls/gnutl
if test x"$host" = x"$build"; then
AC_CHECK_HEADER([microhttpd.h],
AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
[AC_MSG_CHECKING([for libmicrohttpd >= 0.9.53])
[AC_MSG_CHECKING([for libmicrohttpd >= 0.9.64])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
#include <microhttpd.h>
#if (MHD_VERSION < 0x00095300)
#error needs at least version 0.9.53
#if (MHD_VERSION < 0x00096400)
#error needs at least version 0.9.64
#endif
int main () { return 0; }
])],
[],
[AC_MSG_ERROR("libmicrohttpd is too old - install libmicrohttpd >= 0.9.53")]
[AC_MSG_ERROR("libmicrohttpd is too old - install libmicrohttpd >= 0.9.64")]
)
],
[AC_MSG_ERROR(["libmicrohttpd not found"])]
Expand Down
11 changes: 8 additions & 3 deletions src/http_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ typedef unsigned char u_char;

#endif // CYGWIN

// libmicrohttpd deprecated some definitions with v0.9.74, and introduced new ones
#if MHD_VERSION < 0x00097314
#define MHD_HTTP_CONTENT_TOO_LARGE MHD_HTTP_PAYLOAD_TOO_LARGE
#define MHD_HTTP_UNPROCESSABLE_CONTENT MHD_HTTP_UNPROCESSABLE_ENTITY
#endif

namespace httpserver {
namespace http {

Expand Down Expand Up @@ -101,15 +107,14 @@ const int http_utils::http_conflict = MHD_HTTP_CONFLICT;
const int http_utils::http_gone = MHD_HTTP_GONE;
const int http_utils::http_length_required = MHD_HTTP_LENGTH_REQUIRED;
const int http_utils::http_precondition_failed = MHD_HTTP_PRECONDITION_FAILED;
const int http_utils::http_request_entity_too_large = MHD_HTTP_PAYLOAD_TOO_LARGE;
const int http_utils::http_request_entity_too_large = MHD_HTTP_CONTENT_TOO_LARGE;
const int http_utils::http_request_uri_too_long = MHD_HTTP_URI_TOO_LONG;
const int http_utils::http_unsupported_media_type = MHD_HTTP_UNSUPPORTED_MEDIA_TYPE;
const int http_utils::http_requested_range_not_satisfiable = MHD_HTTP_RANGE_NOT_SATISFIABLE;
const int http_utils::http_expectation_failed = MHD_HTTP_EXPECTATION_FAILED;
const int http_utils::http_unprocessable_entity = MHD_HTTP_UNPROCESSABLE_ENTITY;
const int http_utils::http_unprocessable_entity = MHD_HTTP_UNPROCESSABLE_CONTENT;
const int http_utils::http_locked = MHD_HTTP_LOCKED;
const int http_utils::http_failed_dependency = MHD_HTTP_FAILED_DEPENDENCY;
const int http_utils::http_unordered_collection = MHD_HTTP_UNORDERED_COLLECTION;
const int http_utils::http_upgrade_required = MHD_HTTP_UPGRADE_REQUIRED;
const int http_utils::http_retry_with = MHD_HTTP_RETRY_WITH;

Expand Down
1 change: 0 additions & 1 deletion src/httpserver/http_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class http_utils {
static const int http_unprocessable_entity;
static const int http_locked;
static const int http_failed_dependency;
static const int http_unordered_collection;
static const int http_upgrade_required;
static const int http_retry_with;

Expand Down