2.0.0-rc (#9)
Some checks failed
BlockStorage/repertory_osx/pipeline/head This commit looks good
BlockStorage/repertory_windows/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good
BlockStorage/repertory_osx_builds/pipeline/head There was a failure building this commit

### Issues

* \#1 \[bug\] Unable to mount S3 due to 'item_not_found' exception
* \#2 Require bucket name for S3 mounts
* \#3 \[bug\] File size is not being updated in S3 mount
* \#4 Upgrade to libfuse-3.x.x
* \#5 Switch to renterd for Sia support
* \#6 Switch to cpp-httplib to further reduce dependencies
* \#7 Remove global_data and calculate used disk space per provider
* \#8 Switch to libcurl for S3 mount support

### Changes from v1.x.x

* Added read-only encrypt provider
  * Pass-through mount point that transparently encrypts source data using `XChaCha20-Poly1305`
* Added S3 encryption support via `XChaCha20-Poly1305`
* Added replay protection to remote mounts
* Added support base64 writes in remote FUSE
* Created static linked Linux binaries for `amd64` and `aarch64` using `musl-libc`
* Removed legacy Sia renter support
* Removed Skynet support
* Fixed multiple remote mount WinFSP API issues on \*NIX servers
* Implemented chunked read and write
  * Writes for non-cached files are performed in chunks of 8Mib
* Removed `repertory-ui` support
* Removed `FreeBSD` support
* Switched to `libsodium` over `CryptoPP`
* Switched to `XChaCha20-Poly1305` for remote mounts
* Updated `GoogleTest` to v1.14.0
* Updated `JSON for Modern C++` to v3.11.2
* Updated `OpenSSL` to v1.1.1w
* Updated `RocksDB` to v8.5.3
* Updated `WinFSP` to 2023
* Updated `boost` to v1.78.0
* Updated `cURL` to v8.3.0
* Updated `zlib` to v1.3
* Use `upload_manager` for all providers
  * Adds a delay to uploads to prevent excessive API calls
  * Supports re-upload after mount restart for incomplete uploads
  * NOTE: Uploads for all providers are full file (no resume support)
    * Multipart upload support is planned for S3

Reviewed-on: #9
This commit is contained in:
Scott E. Graves 2023-10-29 06:55:59 +00:00
parent 3ff46723b8
commit f43c41f88a
839 changed files with 98214 additions and 92959 deletions

View File

@ -50,7 +50,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true

View File

@ -1,5 +1,5 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*'
Checks: 'clang-*,misc-unused-*,llvm-header-guard,llvm-include-order,modernize-*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false

260
.cspell/words.txt Normal file
View File

@ -0,0 +1,260 @@
-dboost_asio_has_std_string_view
-ddebug
-dndebug
-drepertory
-fvisibility
-gdwarf-4
-mtune
-wextra
-wpedantic
-wpedantic-ddebug
_sh_denyrd
_sh_denyrw
aarch
advapi32
armv8-a
awscpp
awss
bcrypt
bdmv
bignum
bigobj
bodhi
cawss
centos
chrono
cmake_minimum_required
comdlg32
cond
cpp
cppdbg
cpptools
cppvsdbg
cring
crypto_aead_xchacha20poly1305_ietf_npubbytes
csrf
ctim
curlopt_aws_sigv4
cxxflags
cxxstd
d_silence_cxx17_codecvt_header_deprecation_warning
dacl
dbackward_has_libunwind
dbackward_system_linux
dbuild_only
dbuild_shared_libs
dcmake
dcmake_use_winssl
dcpp_standard
dcurl_library
dcurl_staticlib
dcurl_use_libpsl
dcurl_use_libssh2
denable_testing
denyno
dfail_on_warnings
dfuse_use_version
dgtest_force_shared_crt
dhas_std_optional
dirdb
directorydb
dirh
dnominmax
dopenssl_root_dir
dportable
drocksdb_build_shared
dsodium_static
dstatic_linking
dttmath_noasm
duse_libidn2
dwith_gflags
dwith_liburing
dwith_tools
dylib
endfunction
endmacro
fallocate
fgetattr
filebase
flarge
folderid
fsetattr
fsopen
fusefs
fusermount
futimens
gfortran
gmock
gnucc
googlemock
googletest
gpath
gtest_filter
has_setxattr
hkey
httpapi
httplib
hwnd
iarchive
icomm
idownload
idownloadmanager
ifusedrive
iprovider
iremotejsoninstance
isystem
iwinfspdrive
jsonrp
jsonrpcpp
kldload
kratos
libaws
libbfb
libbfd
libboost_system
libc
libcrypto
libcurl
libdl_library
libfuse
libgcc
libgmock
libgtest
libhttpserver
libiberty
libmicrohttpd
libosxfuse
libpthread_library
librepertory
librocksdb
libsframe_library
libsodium
libstdc
libuuid
libz
libzlibstatic
libzstd
linkflags
linux_distro
localappdata
lpbyte
lpdword
lpstr
lptr
lpwstr
lzma
makefiles
mbig
mockwinfspdrive
mqtt
msbuild
msvc
mswsock
ncrypt
netdev
nlohmann
nmake
noappledouble
nocache
nocloseprocess
nopath
npubbytes
ntfs
ntstatus
nvimrc_cfg
nypadymka
oleaut32
oleg
ondisk
openssldir
ossp
osxfuse
osxfuse-notfound
pfsi
pkgconfig
plex
psecurity
pthread
pugi
pugixml
puint
pvoid
pwstr
redistributable
remotewinfsp
remotewinfspdrive
renterd
repertory_ver_companyname_str
repertory_ver_filedescription_str
repertory_ver_fileversion
repertory_ver_legalcopyright_str
repertory_ver_productversion
retrydb
reventsp
rocksdb
rpath
rpcrt4
runas
schaefer
sddl
sdkutils
secur32
shlwapi
siadir
siapath
siaprovider
skylink
skynet
smatch
sopen
stbuf
stdc
stod
stoi
stoll
stoul
stoull
strcaseeq
streq
strequal
strne
struct
sympath
szlib_libpath
target_precompile_headers
teventsystem
tolower
toolset
ttmath
ularge
unittests
unmount
userenv
usermount
userprofile
utimens
utimensat
wcast
wconversion
wdouble
wduplicated
wformat
windres
winfsp
winfsp_drive
winfspdrive
winhttp
wininet
winspool
wlogical
wmisleading
wnon
wnull
woverloaded
wpedantic
wshadow
wsign
wunused
wuseless
xattr
zlibstatic

View File

@ -1 +0,0 @@
{"breakpoints": {"line": {"/data/src/repertory/src/main.cpp": [{"state": "ENABLED", "line": 59, "options": {}}]}, "function": [], "exception": null}, "session": {"user_choices": {}}, "variables": {}}

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ tags
/arm64_debian*/
.cache/
src/common.cpp
cspell.json
dviml

View File

@ -1,282 +1,94 @@
#!groovy
pipeline {
agent none
environment {
BUILD_ARGS = '--build . -j 8'
CONFIGURE_ARGS = '../.. -DCMAKE_BUILD_TYPE=Release -DREPERTORY_ENABLE_S3=ON'
CONFIGURE_MINGW64_ARGS = '../.. -DCMAKE_BUILD_TYPE=Release -DREPERTORY_ENABLE_S3=ON -DCMAKE_TOOLCHAIN_FILE=../../cmake/mingw-w64-x86_64.cmake'
REPERTORY_TEST_DIR = "${HOME}/.ci/cfg"
}
options {
disableConcurrentBuilds()
retry(2)
}
stages {
stage('arch') {
agent {
dockerfile {
filename 'arch'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/arch'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/arch'
}
}
stage('centos7') {
agent {
dockerfile {
filename 'centos7'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/centos7'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/centos7'
}
}
stage('debian9') {
agent {
dockerfile {
filename 'debian9'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian9'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian9'
}
}
stage('debian10') {
agent {
dockerfile {
filename 'debian10'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian10'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian10'
}
}
stage('debian11') {
agent {
dockerfile {
filename 'debian11'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian11'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/debian11'
}
}
stage('fedora29') {
agent {
dockerfile {
filename 'fedora29'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora29'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora29'
}
}
stage('fedora30') {
agent {
dockerfile {
filename 'fedora30'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora30'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora30'
}
}
stage('fedora31') {
agent {
dockerfile {
filename 'fedora31'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora31'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora31'
}
}
stage('fedora32') {
agent {
dockerfile {
filename 'fedora32'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora32'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora32'
}
}
stage('fedora33') {
agent {
dockerfile {
filename 'fedora33'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora33'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora33'
}
}
stage('fedora34') {
agent {
dockerfile {
filename 'fedora34'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora34'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora34'
}
}
stage('fedora35') {
agent {
dockerfile {
filename 'fedora35'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora35'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/fedora35'
}
}
stage('opensuse15') {
agent {
dockerfile {
filename 'opensuse15'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15'
}
}
stage('opensuse15.1') {
agent {
dockerfile {
filename 'opensuse15.1'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.1'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.1'
}
}
stage('opensuse15.2') {
agent {
dockerfile {
filename 'opensuse15.2'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.2'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.2'
}
}
stage('opensuse15.3') {
agent {
dockerfile {
filename 'opensuse15.3'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.3'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/opensuse15.3'
}
}
stage('solus') {
stage('clean') {
agent any
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/solus'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/solus'
sh 'mkdir -p build/'
sh 'rm -f build/*/librepertory.a'
sh 'rm -f build/*/repertory'
sh 'rm -f build/*/unittests'
}
}
stage('tumbleweed') {
stage('alpine') {
agent {
dockerfile {
filename 'tumbleweed'
filename 'alpine'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/tumbleweed'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/tumbleweed'
retry(2) {
sleep time: 5, unit: 'SECONDS'
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/alpine'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/alpine'
sh 'strip build/alpine/repertory'
}
}
}
stage('ubuntu18.04') {
stage('alpine_arm64') {
agent {
dockerfile {
filename 'ubuntu18.04'
dir 'docker/64_bit'
filename 'alpine'
dir 'docker/aarch64'
args '-v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu18.04'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu18.04'
retry(2) {
sleep time: 5, unit: 'SECONDS'
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/alpine_arm64'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/alpine_arm64'
sh 'strip build/alpine_arm64/repertory'
}
}
}
stage('ubuntu20.04') {
stage('mingw64') {
agent {
dockerfile {
filename 'ubuntu20.04'
filename 'mingw64'
dir 'docker/64_bit'
}
}
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu20.04'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu20.04'
retry(2) {
sleep time: 5, unit: 'SECONDS'
cmake arguments: "${env.CONFIGURE_MINGW64_ARGS}", installation: 'InSearchPath', workingDir: 'build/mingw64'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/mingw64'
sh 'strip build/mingw64/repertory.exe'
}
}
}
stage('ubuntu21.10') {
agent {
dockerfile {
filename 'ubuntu21.10'
dir 'docker/64_bit'
}
}
stage('deliver') {
agent any
steps {
cmake arguments: "${env.CONFIGURE_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu21.10'
cmake arguments: "${env.BUILD_ARGS}", installation: 'InSearchPath', workingDir: 'build/ubuntu21.10'
sh 'scripts/make_package.sh alpine /home/sgraves/cert build/alpine_arm64 . /mnt/filebase 1'
sh 'scripts/make_package.sh alpine /home/sgraves/cert build/alpine . /mnt/filebase'
sh 'scripts/make_package.sh mingw64 /home/sgraves/cert build/mingw64 . /mnt/filebase'
}
}
}

View File

@ -3,11 +3,25 @@
pipeline {
agent any
environment {
REPERTORY_TEST_DIR = "${HOME}/.ci/cfg"
}
options {
disableConcurrentBuilds()
retry(2)
}
stages {
stage('clean') {
steps {
sh 'mkdir -p build/'
sh 'rm -f build/librepertory.a'
sh 'rm -f build/repertory'
sh 'rm -f build/unittests'
}
}
stage('configure') {
steps {
cmake arguments: '.. -DCMAKE_BUILD_TYPE=Release -DREPERTORY_ENABLE_S3=ON', installation: 'InSearchPath', workingDir: 'build'
@ -20,7 +34,20 @@ pipeline {
}
steps {
cmake arguments: '--build . -j 8', installation: 'InSearchPath', workingDir: 'build'
retry(2) {
sleep time: 5, unit: 'SECONDS'
cmake arguments: '--build . -j 4', installation: 'InSearchPath', workingDir: 'build'
}
}
}
stage('deliver') {
environment {
PATH = "/usr/local/bin:${env.PATH}"
}
steps {
sh 'scripts/make_package.sh darwin /Users/sgraves/cert build . /Users/sgraves/mnt/filebase'
}
}
}

View File

@ -3,11 +3,24 @@
pipeline {
agent any
environment {
REPERTORY_TEST_DIR = "C:\\.ci\\cfg"
}
options {
disableConcurrentBuilds()
retry(2)
}
stages {
stage('clean') {
steps {
bat 'del /q build\\Release\\librepertory.lib || exit 0'
bat 'del /q build\\Release\\unittests.exe || exit 0'
bat 'del /q build\\Release\\repertory.exe || exit 0'
}
}
stage('configure') {
steps {
cmake arguments: '.. -DCMAKE_BUILD_TYPE=Release -DREPERTORY_ENABLE_S3=ON', installation: 'InSearchPath', workingDir: 'build'
@ -16,7 +29,10 @@ pipeline {
stage('build') {
steps {
cmake arguments: '--build . --target ALL_BUILD --config Release -j 4', installation: 'InSearchPath', workingDir: 'build'
retry(2) {
sleep time: 5, unit: 'SECONDS'
cmake arguments: '--build . --target ALL_BUILD --config Release -j 4', installation: 'InSearchPath', workingDir: 'build'
}
}
}
}

55
.nvimrc
View File

@ -1,9 +1,62 @@
if has('win32') || has('win64')
let &makeprg=".\\scripts\\make_win32.cmd $*"
let g:nmakeprg=".\\scripts\\make_win32.cmd"
let g:gtest#gtest_command = "cd build2 && .\\unittests"
else
let &makeprg="./scripts/make_unix.sh $*"
let g:nmakeprg="./scripts/make_unix.sh"
let g:gtest#gtest_command = "cd build && ./unittests"
endif
set path+=.,include/**,src/**,tests/**,3rd_party/json/**,3rd_party/jsonrpcpp-1.1.1/lib/**,3rd_party/ttmath-0.9.3/ttmath/**
autocmd! VimEnter * :VimspectorLoadSession .default_session
lua << EOF
if vim.env.NV_DARCULA_ENABLE_DAP then
local dap = require("dap")
local g = require("nvim-goodies")
local gos = require("nvim-goodies.os")
local gpath = require("nvim-goodies.path")
local externalConsole = gos.is_windows
local type = g.iff(gos.is_windows, "cppvsdbg", "cppdbg")
local cwd = gpath.create_path(".", g.iff(gos.is_windows, "build2//debug", "build"))
local mount_args = {"-f", g.iff(gos.is_windows, "T:", "~/mnt") }
local test_args = {"--gtest_filter=encrypt*"}
dap.configurations.cpp = {
{
name = "Mount",
type = type,
request = "launch",
program = function()
return gpath.create_path(cwd, "repertory")
end,
args=mount_args,
cwd = cwd,
stopAtEntry = true,
externalConsole=externalConsole,
},
{
name = "Test",
type = type,
request = "launch",
program = function()
return gpath.create_path(cwd, "unittests")
end,
args=test_args,
cwd = cwd,
stopAtEntry = true,
externalConsole=externalConsole,
}
}
else
vim.api.nvim_create_autocmd(
"VimEnter",
{
group = vim.api.nvim_create_augroup("nvimrc_cfg", {clear = true}),
pattern = "*",
callback = function()
vim.api.nvim_command("VimspectorLoadSession .default_session")
end
}
)
end
EOF

View File

@ -1,101 +0,0 @@
{
"cSpell.words": [
"AWSS",
"BDMV",
"Bignum",
"Bodhi",
"CAWSS",
"CRing",
"DACL",
"DCMAKE",
"DENYNO",
"DIRDB",
"DIRECTORYDB",
"DISTRO",
"FOLDERID",
"HKEY",
"ICOMM",
"IDOWNLOAD",
"IDOWNLOADMANAGER",
"IFUSEDRIVE",
"IPROVIDER",
"IREMOTEJSONINSTANCE",
"IWINFSPDRIVE",
"LOCALAPPDATA",
"LPBYTE",
"LPDWORD",
"LPSTR",
"LPTR",
"LPWSTR",
"MOCKWINFSPDRIVE",
"NOCLOSEPROCESS",
"NTFS",
"NTSTATUS",
"OSSP",
"PSECURITY",
"PUINT",
"PVOID",
"PWSTR",
"Plex",
"REMOTEWINFSP",
"REMOTEWINFSPDRIVE",
"RETRYDB",
"Redistributable",
"SDDL",
"SIAPROVIDER",
"STRCASEEQ",
"STREQ",
"STRNE",
"Skynet",
"TEVENTSYSTEM",
"ULARGE",
"WINFSP",
"WINFSPDRIVE",
"aarch",
"centos",
"cmake",
"cpptools",
"csrf",
"ctim",
"dirh",
"dylib",
"fallocate",
"fgetattr",
"fsetattr",
"fsopen",
"fusefs",
"fusermount",
"futimens",
"gtest",
"hwnd",
"iarchive",
"jsonrpcpp",
"kldload",
"kratos",
"libfuse",
"libhttpserver",
"libmicrohttpd",
"libosxfuse",
"netdev",
"nlohmann",
"noappledouble",
"nopath",
"pfsi",
"reventsp",
"rocksdb",
"runas",
"siadir",
"siapath",
"siasky",
"skylink",
"smatch",
"sopen",
"stbuf",
"struct",
"ttmath",
"unmount",
"usermount",
"utimens",
"utimensat"
]
}

View File

@ -1,20 +1,36 @@
{
"configurations": {
"UnixDebug": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/repertory",
"args": ["-f", "-sk", "./skynet_mount"],
"cwd": "${workspaceRoot}/build/debug",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
"configurations": {
"UnixDebug": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/repertory",
"args": ["-f", "/home/sgraves/mnt"],
"cwd": "${workspaceRoot}/build/debug",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
},
"UnixDebugTest": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/unittests",
"args": ["--gtest_filter=file_manager.can_close_after_download_timeout"],
"cwd": "${workspaceRoot}/build",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
}
}
}
}
}

630
3rd_party/cacert.pem vendored
View File

@ -1,7 +1,7 @@
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Tue Feb 1 04:12:05 2022 GMT
## Certificate data from Mozilla as of: Tue Aug 22 03:12:04 2023 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
@ -13,8 +13,8 @@
## an Apache+mod_ssl webserver for SSL client authentication.
## Just configure this file as the SSLCACertificateFile.
##
## Conversion done with mk-ca-bundle.pl version 1.28.
## SHA256: 187ef9dc231135324fe78830cf4462f1ecdeab3e6c9d5e38d623391e88dc5d3c
## Conversion done with mk-ca-bundle.pl version 1.29.
## SHA256: 0ff137babc6a5561a9cfbe9f29558972e5b528202681b7d3803d03a3e82922bd
##
@ -489,29 +489,6 @@ IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN
+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==
-----END CERTIFICATE-----
Network Solutions Certificate Authority
=======================================
-----BEGIN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Xe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q
4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/
GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
-----END CERTIFICATE-----
COMODO ECC Certification Authority
==================================
-----BEGIN CERTIFICATE-----
@ -626,26 +603,6 @@ NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu
dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
-----END CERTIFICATE-----
Hongkong Post Root CA 1
=======================
-----BEGIN CERTIFICATE-----
MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT
DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx
NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n
IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1
ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr
auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh
qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY
V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV
HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i
h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio
l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei
IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps
T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT
c4afU9hDDl3WY4JxHYB0yvbiAmvZWg==
-----END CERTIFICATE-----
SecureSign RootCA11
===================
-----BEGIN CERTIFICATE-----
@ -993,60 +950,6 @@ tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29
mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03
-----END CERTIFICATE-----
EC-ACC
======
-----BEGIN CERTIFICATE-----
MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE
BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w
ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD
VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZX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0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0
Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l
dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ
lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa
Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe
l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2
E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D
5EI=
-----END CERTIFICATE-----
Hellenic Academic and Research Institutions RootCA 2011
=======================================================
-----BEGIN CERTIFICATE-----
MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT
O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y
aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT
AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo
IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI
1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa
71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u
8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH
3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/
MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8
MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu
b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt
XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8
TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD
/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N
7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4
-----END CERTIFICATE-----
Actalis Authentication Root CA
==============================
-----BEGIN CERTIFICATE-----
@ -1338,40 +1241,6 @@ Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems
WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
-----END CERTIFICATE-----
E-Tugra Certification Authority
===============================
-----BEGIN CERTIFICATE-----
MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w
DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls
ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN
ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw
NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx
QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl
cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD
DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd
hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K
CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g
ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e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axLL5Mq+ux0orJ23gT
Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0
8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G
C7TbO6Orb1wdtn7os4I07QZcJA==
-----END CERTIFICATE-----
T-TeleSec GlobalRoot Class 2
============================
-----BEGIN CERTIFICATE-----
@ -1708,36 +1577,6 @@ uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7
yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3
-----END CERTIFICATE-----
Staat der Nederlanden EV Root CA
================================
-----BEGIN CERTIFICATE-----
MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE
CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M
MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl
cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk
SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW
O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r
0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpC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UCjuTaPPoIaGl6I6lD4
WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK
DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy
eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg==
-----END CERTIFICATE-----
IdenTrust Commercial Root CA 1
==============================
-----BEGIN CERTIFICATE-----
@ -2189,87 +2028,6 @@ F8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV09tL7ECQ
aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g==
-----END CERTIFICATE-----
TrustCor RootCert CA-1
======================
-----BEGIN CERTIFICATE-----
MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQQTEP
MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig
U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp
dHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkx
MjMxMTcyMzE2WjCBpDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFu
YW1hIENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUGA1UECwwe
VHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZUcnVzdENvciBSb290Q2Vy
dCBDQS0xMIIBIjANBgkqhkiG9w0BAQ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c2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u
/ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F
hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs
J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC
jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g==
-----END CERTIFICATE-----
SSL.com Root Certification Authority RSA
========================================
-----BEGIN CERTIFICATE-----
@ -3309,3 +3067,385 @@ PsVq8JQdjDAKBggqhkjOPQQDAwNpADBmAjEA6ED/g94D9J+uHXqnLrmvT/aDHQ4thQEd0dlq7A/C
r8deVl5c1RxYIigL9zC2L7F8AjEA8GE8p/SgguMh1YQdc4acLa/KNJvxn7kjNuK8YAOdgLOaVsjh
4rsUecrNIdSUtUlD
-----END CERTIFICATE-----
Telia Root CA v2
================
-----BEGIN CERTIFICATE-----
MIIFdDCCA1ygAwIBAgIPAWdfJ9b+euPkrL4JWwWeMA0GCSqGSIb3DQEBCwUAMEQxCzAJBgNVBAYT
AkZJMRowGAYDVQQKDBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UEAwwQVGVsaWEgUm9vdCBDQSB2
MjAeFw0xODExMjkxMTU1NTRaFw00MzExMjkxMTU1NTRaMEQxCzAJBgNVBAYTAkZJMRowGAYDVQQK
DBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UEAwwQVGVsaWEgUm9vdCBDQSB2MjCCAiIwDQYJKoZI
hvcNAQEBBQADggIPADCCAgoCggIBALLQPwe84nvQa5n44ndp586dpAO8gm2h/oFlH0wnrI4AuhZ7
6zBqAMCzdGh+sq/H1WKzej9Qyow2RCRj0jbpDIX2Q3bVTKFgcmfiKDOlyz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GeXVtt8YVMJAygC
QMez2P2ccGrGKMOF6eLtGpOg3kuYooQ+BXcBlj37tCAPnHICehIv1aO6UXivKitEZU61/Qrowc15
h2Er3oBXRb9n8ZuRXqWk7FlIEA04x7D6w0RtBPV4UBySllva9bguulvP5fBqnUsvWHMtTy3EHD70
sz+rFQ47GUGKpMFXEmZxTPpT41frYpUJnlTd0cI8Vzy9OK2YZLe4A5pTVmBds9hCG1xLEooc6+t9
xnppxyd/pPiL8uSUZodL6ZQHCRJ5irLrdATczvREWeAWysUsWNc8e89ihmpQfTU2Zqf7N+cox9jQ
raVplI/owd8k+BsHMYeB2F326CjYSlKArBPuUBQemMc=
-----END CERTIFICATE-----
D-TRUST BR Root CA 1 2020
=========================
-----BEGIN CERTIFICATE-----
MIIC2zCCAmCgAwIBAgIQfMmPK4TX3+oPyWWa00tNljAKBggqhkjOPQQDAzBIMQswCQYDVQQGEwJE
RTEVMBMGA1UEChMMRC1UcnVzdCBHbWJIMSIwIAYDVQQDExlELVRSVVNUIEJSIFJvb3QgQ0EgMSAy
MDIwMB4XDTIwMDIxMTA5NDUwMFoXDTM1MDIxMTA5NDQ1OVowSDELMAkGA1UEBhMCREUxFTATBgNV
BAoTDEQtVHJ1c3QgR21iSDEiMCAGA1UEAxMZRC1UUlVTVCBCUiBSb290IENBIDEgMjAyMDB2MBAG
ByqGSM49AgEGBSuBBAAiA2IABMbLxyjR+4T1mu9CFCDhQ2tuda38KwOE1HaTJddZO0Flax7mNCq7
dPYSzuht56vkPE4/RAiLzRZxy7+SmfSk1zxQVFKQhYN4lGdnoxwJGT11NIXe7WB9xwy0QVK5buXu
QqOCAQ0wggEJMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFHOREKv/VbNafAkl1bK6CKBrqx9t
MA4GA1UdDwEB/wQEAwIBBjCBxgYDVR0fBIG+MIG7MD6gPKA6hjhodHRwOi8vY3JsLmQtdHJ1c3Qu
bmV0L2NybC9kLXRydXN0X2JyX3Jvb3RfY2FfMV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GZSZOoPHzoRgaLLPIx
AJSdYsiJvRmEFOml+wG4DXZDjC5Ty3zfDBeWUA==
-----END CERTIFICATE-----
DigiCert TLS RSA4096 Root G5
============================
-----BEGIN CERTIFICATE-----
MIIFZjCCA06gAwIBAgIQCPm0eKj6ftpqMzeJ3nzPijANBgkqhkiG9w0BAQwFADBNMQswCQYDVQQG
EwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERpZ2lDZXJ0IFRMUyBSU0E0
MDk2IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcNNDYwMTE0MjM1OTU5WjBNMQswCQYDVQQGEwJV
UzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERpZ2lDZXJ0IFRMUyBSU0E0MDk2
IFJvb3QgRzUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz0PTJeRGd/fxmgefM1eS8
7IE+ajWOLrfn3q/5B03PMJ3qCQuZvWxX2hhKuHisOjmopkisLnLlvevxGs3npAOpPxG02C+JFvuU
AT27L/gTBaF4HI4o4EXgg/RZG5Wzrn4DReW+wkL+7vI8toUTmDKdFqgpwgscONyfMXdcvyej/Ces
tyu9dJsXLfKB2l2w4SMXPohKEiPQ6s+d3gMXsUJKoBZMpG2T6T867jp8nVid9E6P/DsjyG244gXa
zOvswzH016cpVIDPRFtMbzCe88zdH5RDnU1/cHAN1DrRN/BsnZvAFJNY781BOHW8EwOVfH/jXOnV
DdXifBBiqmvwPXbzP6PosMH976pXTayGpxi0KcEsDr9kvimM2AItzVwv8n/vFfQMFawKsPHTDU9q
TXeXAaDxZre3zu/O7Oyldcqs4+Fj97ihBMi8ez9dLRYiVu1ISf6nL3kwJZu6ay0/nTvEF+cdLvvy
z6b84xQslpghjLSR6Rlgg/IwKwZzUNWYOwbpx4oMYIwo+FKbbuH2TbsGJJvXKyY//SovcfXWJL5/
MZ4PbeiPT02jP/816t9JXkGPhvnxd3lLG7SjX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ybHGWCA6TS9
YBk2QNYphwk8kXr2vBMj3VlOBF7PyAIcGFPBMdjaIOlEjeR2o0IwQDAOBgNVHQ8BAf8EBAMCAQYw
DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8ygYy2R17ikq6+2uI1g4hevIIgcwCgYIKoZIzj0E
AwMDaAAwZQIxALGOWiDDshliTd6wT99u0nCK8Z9+aozmut6Dacpps6kFtZaSF4fC0urQe87YQVt8
rgIwRt7qy12a7DLCZRawTDBcMPPaTnOGBtjOiQRINzf43TNRnXCve1XYAS59BWQOhriR
-----END CERTIFICATE-----
Security Communication RootCA3
==============================
-----BEGIN CERTIFICATE-----
MIIFfzCCA2egAwIBAgIJAOF8N0D9G/5nMA0GCSqGSIb3DQEBDAUAMF0xCzAJBgNVBAYTAkpQMSUw
IwYDVQQKExxTRUNPTSBUcnVzdCBTeXN0ZW1zIENPLixMVEQuMScwJQYDVQQDEx5TZWN1cml0eSBD
b21tdW5pY2F0aW9uIFJvb3RDQTMwHhcNMTYwNjE2MDYxNzE2WhcNMzgwMTE4MDYxNzE2WjBdMQsw
CQYDVQQGEwJKUDElMCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UE
AxMeU2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
MIICCgKCAgEA48lySfcw3gl8qUCBWNO0Ot26YQ+TUG5pPDXC7ltzkBtnTCHsXzW7OT4rCmDvu20r
hvtxosis5FaU+cmvsXLUIKx00rgVrVH+hXShuRD+BYD5UpOzQD11EKzAlrenfna84xtSGc4RHwsE
NPXY9Wk8d/Nk9A2qhd7gCVAEF5aEt8iKvE1y/By7z/MGTfmfZPd+pmaGNXHIEYBMwXFAWB6+oHP2
/D5Q4eAvJj1+XCO1eXDe+uDRpdYMQXF79+qMHIjH7Iv10S9VlkZ8WjtYO/u62C21Jdp6Ts9EriGm
npjKIG58u4iFW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nUM/0Umud1RvCPHX9jYhxBAEg09ODfnRDwYwFMJZI//1ZqmfHAuc1Uh6N//g7kdPjIe1qZ9LPFm
6Vwdp6POXiUyK+OVrCoHzrQoeIY8LaadTdJ0MN1kURXbg4NR16/9M51NZg==
-----END CERTIFICATE-----
Security Communication ECC RootCA1
==================================
-----BEGIN CERTIFICATE-----
MIICODCCAb6gAwIBAgIJANZdm7N4gS7rMAoGCCqGSM49BAMDMGExCzAJBgNVBAYTAkpQMSUwIwYD
VQQKExxTRUNPTSBUcnVzdCBTeXN0ZW1zIENPLixMVEQuMSswKQYDVQQDEyJTZWN1cml0eSBDb21t
dW5pY2F0aW9uIEVDQyBSb290Q0ExMB4XDTE2MDYxNjA1MTUyOFoXDTM4MDExODA1MTUyOFowYTEL
MAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKzApBgNV
BAMTIlNlY3VyaXR5IENvbW11bmljYXRpb24gRUNDIFJvb3RDQTEwdjAQBgcqhkjOPQIBBgUrgQQA
IgNiAASkpW9gAwPDvTH00xecK4R1rOX9PVdu12O/5gSJko6BnOPpR27KkBLIE+CnnfdldB9sELLo
5OnvbYUymUSxXv3MdhDYW72ixvnWQuRXdtyQwjWpS4g8EkdtXP9JTxpKULGjQjBAMB0GA1UdDgQW
BBSGHOf+LaVKiwj+KBH6vqNm+GBZLzAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAK
BggqhkjOPQQDAwNoADBlAjAVXUI9/Lbu9zuxNuie9sRGKEkz0FhDKmMpzE2xtHqiuQ04pV1IKv3L
snNdo4gIxwwCMQDAqy0Obe0YottT6SXbVQjgUMzfRGEWgqtJsLKB7HOHeLRMsmIbEvoWTSVLY70e
N9k=
-----END CERTIFICATE-----
BJCA Global Root CA1
====================
-----BEGIN CERTIFICATE-----
MIIFdDCCA1ygAwIBAgIQVW9l47TZkGobCdFsPsBsIDANBgkqhkiG9w0BAQsFAD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NVBAoMHUJFSUpJTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZMR0wGwYDVQQDDBRC
SkNBIEdsb2JhbCBSb290IENBMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABJ3LgJGNU2e1uVCxA/jl
SR9BIgmwUVJY1is0j8USRhTFiy8shP8sbqjV8QnjAyEUxEM9fMEsxEtqSs3ph+B99iK++kpRuDCK
/eHeGBIK9ke35xe/J4rUQUyWPGCWwf0VHKNCMEAwHQYDVR0OBBYEFNJKsVF/BvDRgh9Obl+rg/xI
1LCRMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2gAMGUCMBq8
W9f+qdJUDkpd0m2xQNz0Q9XSSpkZElaA94M04TVOSG0ED1cxMDAtsaqdAzjbBgIxAMvMh1PLet8g
UXOQwKhbYdDFUDn9hf7B43j4ptZLvZuHjw/l1lOWqzzIQNph91Oj9w==
-----END CERTIFICATE-----
Sectigo Public Server Authentication Root E46
=============================================
-----BEGIN CERTIFICATE-----
MIICOjCCAcGgAwIBAgIQQvLM2htpN0RfFf51KBC49DAKBggqhkjOPQQDAzBfMQswCQYDVQQGEwJH
QjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1TZWN0aWdvIFB1YmxpYyBTZXJ2
ZXIgQXV0aGVudGljYXRpb24gUm9vdCBFNDYwHhcNMjEwMzIyMDAwMDAwWhcNNDYwMzIxMjM1OTU5
WjBfMQswCQYDVQQGEwJHQjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1TZWN0
aWdvIFB1YmxpYyBTZXJ2ZXIgQXV0aGVudGljYXRpb24gUm9vdCBFNDYwdjAQBgcqhkjOPQIBBgUr
gQQAIgNiAAR2+pmpbiDt+dd34wc7qNs9Xzjoq1WmVk/WSOrsfy2qw7LFeeyZYX8QeccCWvkEN/U0
NSt3zn8gj1KjAIns1aeibVvjS5KToID1AZTc8GgHHs3u/iVStSBDHBv+6xnOQ6OjQjBAMB0GA1Ud
DgQWBBTRItpMWfFLXyY4qp3W7usNw/upYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB
/zAKBggqhkjOPQQDAwNnADBkAjAn7qRaqCG76UeXlImldCBteU/IvZNeWBj7LRoAasm4PdCkT0RH
lAFWovgzJQxC36oCMB3q4S6ILuH5px0CMk7yn2xVdOOurvulGu7t0vzCAxHrRVxgED1cf5kDW21U
SAGKcw==
-----END CERTIFICATE-----
Sectigo Public Server Authentication Root R46
=============================================
-----BEGIN CERTIFICATE-----
MIIFijCCA3KgAwIBAgIQdY39i658BwD6qSWn4cetFDANBgkqhkiG9w0BAQwFADBfMQswCQYDVQQG
EwJHQjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1TZWN0aWdvIFB1YmxpYyBT
ZXJ2ZXIgQXV0aGVudGljYXRpb24gUm9vdCBSNDYwHhcNMjEwMzIyMDAwMDAwWhcNNDYwMzIxMjM1
OTU5WjBfMQswCQYDVQQGEwJHQjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1T
ZWN0aWdvIFB1YmxpYyBTZXJ2ZXIgQXV0aGVudGljYXRpb24gUm9vdCBSNDYwggIiMA0GCSqGSIb3
DQEBAQUAA4ICDwAwggIKAoICAQCTvtU2UnXYASOgHEdCSe5jtrch/cSV1UgrJnwUUxDaef0rty2k
1Cz66jLdScK5vQ9IPXtamFSvnl0xdE8H/FAh3aTPaE8bEmNtJZlMKpnzSDBh+oF8HqcIStw+Kxwf
GExxqjWMrfhu6DtK2eWUAtaJhBOqbchPM8xQljeSM9xfiOefVNlI8JhD1mb9nxc4Q8UBUQvX4yMP
FF1bFOdLvt30yNoDN9HWOaEhUTCDsG3XME6WW5HwcCSrv0WBZEMNvSE6Lzzpng3LILVCJ8zab5vu
ZDCQOc2TZYEhMbUjUDM3IuM47fgxMMxF/mL50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rp0XZ60Vzk50lJLVU3aPAaOpg+VBeHVOmm
J1CJeyAvP/+/oYtKR5j/K3tJPsMpRmAYQqszKbrAKbkTidOIijlBO8n9pu0f9GBj39ItVQGL
-----END CERTIFICATE-----
SSL.com TLS RSA Root CA 2022
============================
-----BEGIN CERTIFICATE-----
MIIFiTCCA3GgAwIBAgIQb77arXO9CEDii02+1PdbkTANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQG
EwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQDDBxTU0wuY29tIFRMUyBSU0Eg
Um9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzQyMloXDTQ2MDgxOTE2MzQyMVowTjELMAkGA1UEBhMC
VVMxGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgUlNBIFJv
b3QgQ0EgMjAyMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANCkCXJPQIgSYT41I57u
9nTPL3tYPc48DRAokC+X94xI2KDYJbFMsBFMF3NQ0CJKY7uB0ylu1bUJPiYYf7ISf5OYt6/wNr/y
7hienDtSxUcZXXTzZGbVXcdotL8bHAajvI9AI7YexoS9UcQbOcGV0insS657Lb85/bRi3pZ7Qcac
oOAGcvvwB5cJOYF0r/c0WRFXCsJbwST0MXMwgsadugL3PnxEX4MN8/HdIGkWCVDi1FW24IBydm5M
R7d1VVm0U3TZlMZBrViKMWYPHqIbKUBOL9975hYsLfy/7PO0+r4Y9ptJ1O4Fbtk085zx7AGL0SDG
D6C1vBdOSHtRwvzpXGk3R2azaPgVKPC506QVzFpPulJwoxJF3ca6TvvC0PeoUidtbnm1jPx7jMEW
TO6Af77wdr5BUxIzrlo4QqvXDz5BjXYHMtWrifZOZ9mxQnUjbvPNQrL8VfVThxc7wDNY8VLS+YCk
8OjwO4s4zKTGkH8PnP2L0aPP2oOnaclQNtVcBdIKQXTbYxE3waWglksejBYSd66UNH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OjCCAcCgAwIBAgIQFAP1q/s3ixdAW+JDsqXRxDAKBggqhkjOPQQDAzBOMQswCQYDVQQGEwJV
UzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQDDBxTU0wuY29tIFRMUyBFQ0MgUm9v
dCBDQSAyMDIyMB4XDTIyMDgyNTE2MzM0OFoXDTQ2MDgxOTE2MzM0N1owTjELMAkGA1UEBhMCVVMx
GDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgRUNDIFJvb3Qg
Q0EgMjAyMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABEUpNXP6wrgjzhR9qLFNoFs27iosU8NgCTWy
JGYmacCzldZdkkAZDsalE3D07xJRKF3nzL35PIXBz5SQySvOkkJYWWf9lCcQZIxPBLFNSeR7T5v1
5wj4A4j3p8OSSxlUgaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBSJjy+j6CugFFR7
81a4Jl9nOAuc0DAdBgNVHQ4EFgQUiY8vo+groBRUe/NWuCZfZzgLnNAwDgYDVR0PAQH/BAQDAgGG
MAoGCCqGSM49BAMDA2gAMGUCMFXjIlbp15IkWE8elDIPDAI2wv2sdDJO4fscgIijzPvX6yv/N33w
7deedWo1dlJF4AIxAMeNb0Igj762TVntd00pxCAgRWSGOlDGxK0tk/UYfXLtqc/ErFc2KAhl3zx5
Zn6g6g==
-----END CERTIFICATE-----
Atos TrustedRoot Root CA ECC TLS 2021
=====================================
-----BEGIN CERTIFICATE-----
MIICFTCCAZugAwIBAgIQPZg7pmY9kGP3fiZXOATvADAKBggqhkjOPQQDAzBMMS4wLAYDVQQDDCVB
dG9zIFRydXN0ZWRSb290IFJvb3QgQ0EgRUNDIFRMUyAyMDIxMQ0wCwYDVQQKDARBdG9zMQswCQYD
VQQGEwJERTAeFw0yMTA0MjIwOTI2MjNaFw00MTA0MTcwOTI2MjJaMEwxLjAsBgNVBAMMJUF0b3Mg
VHJ1c3RlZFJvb3QgUm9vdCBDQSBFQ0MgVExTIDIwMjExDTALBgNVBAoMBEF0b3MxCzAJBgNVBAYT
AkRFMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEloZYKDcKZ9Cg3iQZGeHkBQcfl+3oZIK59sRxUM6K
DP/XtXa7oWyTbIOiaG6l2b4siJVBzV3dscqDY4PMwL502eCdpO5KTlbgmClBk1IQ1SQ4AjJn8ZQS
b+/Xxd4u/RmAo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR2KCXWfeBmmnoJsmo7jjPX
NtNPojAOBgNVHQ8BAf8EBAMCAYYwCgYIKoZIzj0EAwMDaAAwZQIwW5kp85wxtolrbNa9d+F851F+
uDrNozZffPc8dz7kUK2o59JZDCaOMDtuCCrCp1rIAjEAmeMM56PDr9NJLkaCI2ZdyQAUEv049OGY
a3cpetskz2VAv9LcjBHo9H1/IISpQuQo
-----END CERTIFICATE-----
Atos TrustedRoot Root CA RSA TLS 2021
=====================================
-----BEGIN CERTIFICATE-----
MIIFZDCCA0ygAwIBAgIQU9XP5hmTC/srBRLYwiqipDANBgkqhkiG9w0BAQwFADBMMS4wLAYDVQQD
DCVBdG9zIFRydXN0ZWRSb290IFJvb3QgQ0EgUlNBIFRMUyAyMDIxMQ0wCwYDVQQKDARBdG9zMQsw
CQYDVQQGEwJERTAeFw0yMTA0MjIwOTIxMTBaFw00MTA0MTcwOTIxMDlaMEwxLjAsBgNVBAMMJUF0
b3MgVHJ1c3RlZFJvb3QgUm9vdCBDQSBSU0EgVExTIDIwMjExDTALBgNVBAoMBEF0b3MxCzAJBgNV
BAYTAkRFMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtoAOxHm9BYx9sKOdTSJNy/BB
l01Z4NH+VoyX8te9j2y3I49f1cTYQcvyAh5x5en2XssIKl4w8i1mx4QbZFc4nXUtVsYvYe+W/CBG
vevUez8/fEc4BKkbqlLfEzfTFRVOvV98r61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XrMPIWo6iFqO9taPKU0nprALN+AnCng33eU0aKAQv9q
TFsR0PXNor6uzFFcw9VUewyu1rkGd4Di7wcaaMxZUa1+XGdrudviB0JbuAEFWDlN5LuYo7Ey7Nmj
1m+UI/87tyll5gfp77YZ6ufCOB0yiJA8EytuzO+rdwY0d4RPcuSBhPm5dDTedk+SKlOxJTnbPP/l
PqYO5Wue/9vsL3SD3460s6neFE3/MaNFcyT6lSnMEpcEoji2jbDwN/zIIX8/syQbPYtuzE2wFg2W
HYMfRsCbvUOZ58SWLs5fyQ==
-----END CERTIFICATE-----

9262
3rd_party/cpp-httplib/httplib.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
#ifndef REPERTORY_PTHREAD_H
#define REPERTORY_PTHREAD_H
#ifdef _WIN32
#include <mutex>
#include <condition_variable>
#define pthread_mutex_t std::mutex *
#define pthread_cond_t std::condition_variable *
static void pthread_mutex_init(pthread_mutex_t *mtx, void *) { *mtx = new std::mutex(); }
static void pthread_mutex_destroy(pthread_mutex_t *mtx) {
delete *mtx;
*mtx = nullptr;
}
static void pthread_mutex_lock(pthread_mutex_t *mtx) { (*mtx)->lock(); }
static void pthread_mutex_unlock(pthread_mutex_t *mtx) { (*mtx)->unlock(); }
static void pthread_cond_init(pthread_cond_t *cond, void *) {
*cond = new std::condition_variable();
}
static void pthread_cond_destroy(pthread_cond_t *cond) {
delete *cond;
*cond = nullptr;
}
static void pthread_cond_signal(pthread_cond_t *cond) { (*cond)->notify_one(); }
static void pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mtx) {
std::unique_lock<std::mutex> l(**mtx);
(*cond)->wait(l);
}
#endif // _WIN32
#endif // REPERTORY_PTHREAD_H

View File

@ -1,9 +0,0 @@
#ifndef REPERTORY_STRINGS_H
#define REPERTORY_STRINGS_H
#ifdef _WIN32
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif // _WIN32
#endif // REPERTORY_STRINGS_H

View File

@ -1,6 +0,0 @@
#ifndef REPERTORY_SOCKET_H
#define REPERTORY_SOCKET_H
#ifdef _WIN32
#endif // _WIN32
#endif // REPERTORY_SOCKET_H

View File

@ -1,8 +0,0 @@
#ifndef REPERTORY_TIME_H
#define REPERTORY_TIME_H
#ifdef _WIN32
#endif // _WIN32
#endif // REPERTORY_TIME_H

View File

@ -1,8 +0,0 @@
#ifndef REPERTORY_UNISTD_H
#define REPERTORY_UNISTD_H
#ifdef _WIN32
#endif // _WIN32
#endif // REPERTORY_UNISTD_H

5219
3rd_party/json/json.hpp vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +0,0 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
jsonrpctest
.vscode
build

View File

@ -1,29 +0,0 @@
language: cpp
dist: trusty
sudo: required
group: edge
compiler:
- gcc
matrix:
include:
# build on ubuntu
- os: linux
compiler: gcc
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
# build on osx
- os: osx
osx_image: xcode9.1
before_install:
- eval "${MATRIX_EVAL}"
script:
- mkdir build
- cd build
- cmake .. && make

View File

@ -1,65 +0,0 @@
cmake_minimum_required(VERSION 3.0.0)
project(jsonrpcpp VERSION 1.1.1 LANGUAGES CXX)
set(PROJECT_DESCRIPTION "C++ JSON-RPC 2.0 library")
set(PROJECT_URL "https://github.com/badaix/jsonrpcpp")
option(BUILD_SHARED_LIBS "Build jsonrpcpp as a shared library" ON)
option(BUILD_STATIC_LIBS "Build jsonrpcpp as a static library" ON)
option(BUILD_TESTS "Build tests (run tests with make test)" ON)
if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
message(FATAL_ERROR "One or both of BUILD_SHARED_LIBS or BUILD_STATIC_LIBS"
"must be set to ON to build")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
endif()
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
SET(CMAKE_INSTALL_INCLUDEDIR include CACHE
PATH "Output directory for header files")
endif()
include_directories(lib)
set(JSONRPCPP_SOURCES lib/jsonrp.cpp)
if (BUILD_SHARED_LIBS)
add_library(jsonrpcpp SHARED "${JSONRPCPP_SOURCES}")
target_compile_features(jsonrpcpp PUBLIC cxx_std_11)
if(WIN32)
install(TARGETS jsonrpcpp RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}")
else()
install(TARGETS jsonrpcpp LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()
endif (BUILD_SHARED_LIBS)
if (BUILD_STATIC_LIBS)
add_library(jsonrpcpp-static STATIC "${JSONRPCPP_SOURCES}")
set_target_properties(jsonrpcpp-static PROPERTIES OUTPUT_NAME jsonrpcpp)
target_compile_features(jsonrpcpp-static PUBLIC cxx_std_11)
install(TARGETS jsonrpcpp-static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif (BUILD_STATIC_LIBS)
if (BUILD_TESTS)
if (NOT BUILD_STATIC_LIBS)
message(FATAL_ERROR "Tests can only be built against static libraries "
"(set BUILD_STATIC_LIBS=ON)")
endif (NOT BUILD_STATIC_LIBS)
add_executable(jsonrpctest jsonrpctest.cpp)
target_link_libraries(jsonrpctest jsonrpcpp-static)
target_compile_features(jsonrpctest PUBLIC cxx_std_11)
endif (BUILD_TESTS)
install(FILES lib/jsonrp.hpp lib/json.hpp
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/jsonrpcpp")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/jsonrpcpp.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/jsonrpcpp.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/jsonrpcpp.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 Johannes Pohl
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,19 +0,0 @@
BIN = jsonrpctest
CXX = clang++
STRIP = strip
CXXFLAGS = -std=c++0x -Wall -O3 -Ilib -isystem lib/externals
OBJ = jsonrpctest.o lib/jsonrp.o
all: $(OBJ)
$(CXX) $(CXXFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS)
$(STRIP) $(BIN)
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf $(BIN) $(OBJ) *~

View File

@ -1,75 +0,0 @@
# jsonrpc++
C++ [JSON-RPC 2.0](http://www.jsonrpc.org/specification) library
[![Build Status](https://travis-ci.org/badaix/jsonrpcpp.svg?branch=master)](https://travis-ci.org/badaix/jsonrpcpp)
[![Github Releases](https://img.shields.io/github/release/badaix/jsonrpcpp.svg)](https://github.com/badaix/jsonrpcpp/releases)
When grown up, this will be a leightweight JSON-RPC 2.0 C++ library.
### What it is
jsonrpc++ parses and constructs JSON RPC 2.0 objects, like
* [Request](http://www.jsonrpc.org/specification#request_object)
* [Notification](http://www.jsonrpc.org/specification#notification)
* [Parameter](http://www.jsonrpc.org/specification#parameter_structures)
* [Response](http://www.jsonrpc.org/specification#response_object)
* [Error](http://www.jsonrpc.org/specification#error_object)
* [Batch](http://www.jsonrpc.org/specification#batch)
#### Example: Parsing a request
````c++
jsonrpcpp::entity_ptr entity = jsonrpcpp::Parser::parse(R"({"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 23, "minuend": 42}, "id": 3})");
if (entity->is_request())
{
jsonrpcpp::request_ptr request = dynamic_pointer_cast<jsonrpcpp::Request>(entity);
if (request->method == "subtract")
{
int result = request->params.get<int>("minuend") - request->params.get<int>("subtrahend");
jsonrpcpp::Response response(*request, result);
cout << " Response: " << response.to_json().dump() << "\n";
//will print: {"jsonrpc": "2.0", "result": 19, "id": 3}
}
else
throw jsonrpcpp::MethodNotFoundException(*request);
}
````
### What it not is
jsonrpc++ is completely transport agnostic, i.e. it doesn't care about transportation of the messages and there are no TCP client or server components shipped with this lib.
As JSON backbone [JSON for Modern C++](https://nlohmann.github.io/json/) is used.
## Some code
````c++
jsonrpcpp::entity_ptr entity = jsonrpcpp::Parser::parse(R"({"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 23, "minuend": 42}, "id": 3})");
if (entity && entity->is_request())
{
jsonrpcpp::request_ptr request = dynamic_pointer_cast<jsonrpcpp::Request>(entity);
cout << " Request: " << request->method << ", id: " << request->id << ", has params: " << !request->params.is_null() << "\n";
if (request->method == "subtract")
{
int result;
if (request->params.is_array())
result = request->params.get<int>(0) - request->params.get<int>(1);
else
result = request->params.get<int>("minuend") - request->params.get<int>("subtrahend");
jsonrpcpp::Response response(*request, result);
cout << " Response: " << response.to_json().dump() << "\n";
}
else if (request->method == "sum")
{
int result = 0;
for (const auto& summand: request->params.param_array)
result += summand.get<int>();
jsonrpcpp::Response response(*request, result);
cout << " Response: " << response.to_json().dump() << "\n";
}
else
{
throw jsonrpcpp::MethodNotFoundException(*request);
}
}
````

View File

@ -1,12 +0,0 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
URL: @PROJECT_URL@
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ljsonrpcpp
Cflags: -I${includedir}

View File

@ -1,244 +0,0 @@
/***
This file is part of jsonrpc++
Copyright (C) 2017 Johannes Pohl
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
***/
#include <iostream>
#include "jsonrp.hpp"
using namespace std;
jsonrpcpp::Parser parser;
jsonrpcpp::Response getRespone(jsonrpcpp::request_ptr request)
{
//cout << " Request: " << request->method << ", id: " << request->id << ", has params: " << !request->params.is_null() << "\n";
if (request->method == "subtract")
{
if (request->params)
{
int result;
if (request->params.is_array())
result = request->params.get<int>(0) - request->params.get<int>(1);
else
result = request->params.get<int>("minuend") - request->params.get<int>("subtrahend");
return jsonrpcpp::Response(*request, result);
}
else
throw jsonrpcpp::InvalidParamsException(*request);
}
else if (request->method == "sum")
{
int result = 0;
for (const auto& summand: request->params.param_array)
result += summand.get<int>();
return jsonrpcpp::Response(*request, result);
}
else if (request->method == "get_data")
{
return jsonrpcpp::Response(*request, Json({"hello", 5}));
}
else
{
throw jsonrpcpp::MethodNotFoundException(*request);
}
}
void test(const std::string& json_str)
{
try
{
cout << "--> " << json_str << "\n";
jsonrpcpp::entity_ptr entity = parser.parse(json_str);
if (entity)
{
//cout << " Json: " << entity->to_json().dump() << "\n";
if (entity->is_response())
{
cout << "<-- " << entity->to_json().dump() << "\n";
}
if (entity->is_request())
{
jsonrpcpp::Response response = getRespone(dynamic_pointer_cast<jsonrpcpp::Request>(entity));
cout << "<-- " << response.to_json().dump() << "\n";
}
else if (entity->is_notification())
{
jsonrpcpp::notification_ptr notification = dynamic_pointer_cast<jsonrpcpp::Notification>(entity);
cout << "Notification: " << notification->method << ", has params: " << !notification->params.is_null() << "\n";
}
else if (entity->is_batch())
{
jsonrpcpp::batch_ptr batch = dynamic_pointer_cast<jsonrpcpp::Batch>(entity);
jsonrpcpp::Batch responseBatch;
//cout << " Batch\n";
for (const auto& batch_entity: batch->entities)
{
//cout << batch_entity->type_str() << ": \t" << batch_entity->to_json() << "\n";
if (batch_entity->is_request())
{
try
{
jsonrpcpp::Response response = getRespone(dynamic_pointer_cast<jsonrpcpp::Request>(batch_entity));
responseBatch.add(response); //<jsonrpcpp::Response>
}
catch(const jsonrpcpp::RequestException& e)
{
responseBatch.add(e); //<jsonrpcpp::RequestException>
}
}
else if (batch_entity->is_exception())
{
responseBatch.add_ptr(batch_entity);
}
else if (batch_entity->is_error())
{
jsonrpcpp::error_ptr error = dynamic_pointer_cast<jsonrpcpp::Error>(batch_entity);
responseBatch.add(jsonrpcpp::RequestException(*error));
}
}
if (!responseBatch.entities.empty())
cout << "<-- " << responseBatch.to_json().dump() << "\n";
}
}
}
catch(const jsonrpcpp::RequestException& e)
{
cout << "<-- " << e.to_json().dump() << "\n";
//cout << " Response: " << jsonrpcpp::Response(e).to_json().dump() << "\n";
//cerr << "RequestException: " << e.what() << "\n";
}
catch(const jsonrpcpp::ParseErrorException& e)
{
cout << "<-- " << e.to_json().dump() << "\n";
}
catch(const jsonrpcpp::RpcException& e)
{
cerr << "RpcException: " << e.what() << "\n";
cout << "<-- " << jsonrpcpp::ParseErrorException(e.what()).to_json().dump() << "\n";
}
catch(const std::exception& e)
{
cerr << "Exception: " << e.what() << "\n";
}
cout << "\n";
}
void test(const jsonrpcpp::Entity& entity)
{
test(entity.to_json().dump());
}
void update(const jsonrpcpp::Parameter& params)
{
cout << "Notification callback: update, has params: " << !params.is_null() << "\n";
}
/*
void foobar(const jsonrpcpp::Notification& notification, const jsonrpcpp::Parameter& params)
{
cout << "Notification callback: " << notification.method << ", has params: " << !notification.params.is_null() << "\n";
}
*/
void foobar(const jsonrpcpp::Parameter& params)
{
cout << "Notification callback: foobar, has params: " << !params.is_null() << "\n";
}
jsonrpcpp::response_ptr sum(const jsonrpcpp::Id& id, const jsonrpcpp::Parameter& params)
{
int result = 0;
for (const auto& summand: params.param_array)
result += summand.get<int>();
cout << "Request callback: sum, result: " << result << "\n";
return make_shared<jsonrpcpp::Response>(id, result);
}
//examples taken from: http://www.jsonrpc.org/specification#examples
int main(int argc, char* argv[])
{
parser.register_notification_callback("update", update);
parser.register_notification_callback("foobar", foobar);
parser.register_request_callback("sum", sum);
cout << "rpc call with positional parameters:\n\n";
test(R"({"jsonrpc": "2.0", "method": "sum", "params": [1, 2, 3, 4, 5], "id": 1})");
test(jsonrpcpp::Request(1, "sum", Json({1, 2, 3, 4, 5})));
test(R"({"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": 1})");
test(jsonrpcpp::Request(1, "subtract", Json({42, 23})));
test(R"({"jsonrpc": "2.0", "method": "subtract", "params": [23, 42], "id": 2})");
test(jsonrpcpp::Request(2, "subtract", Json({23, 42})));
cout << "\n\nrpc call with named parameters:\n\n";
test(R"({"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 23, "minuend": 42}, "id": 3})");
test(jsonrpcpp::Request(3, "subtract", Json({{"subtrahend", 23}, {"minuend", 42}})));
test(R"({"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 4})");
test(jsonrpcpp::Request(4, "subtract", Json({{"minuend", 42}, {"subtrahend", 23}})));
cout << "\n\na Notification:\n\n";
test(R"({"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]})");
test(jsonrpcpp::Notification("update", Json({1, 2, 3, 4, 5})));
test(R"({"jsonrpc": "2.0", "method": "foobar"})");
test(jsonrpcpp::Notification("foobar"));
cout << "\n\nrpc call of non-existent method:\n\n";
test(R"({"jsonrpc": "2.0", "method": "foobar", "id": "1"})");
test(jsonrpcpp::Request("1", "foobar"));
cout << "\n\nrpc call with invalid JSON:\n\n";
test(R"({"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz])");
cout << "\n\nrpc call with invalid Request object:\n\n";
test(R"({"jsonrpc": "2.0", "method": 1, "params": "bar"})");
cout << "\n\nrpc call Batch, invalid JSON:\n\n";
test(R"( [
{"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"},
{"jsonrpc": "2.0", "method"
])");
cout << "\n\nrpc call with an empty Array:\n\n";
test(R"([])");
cout << "\n\nrpc call with an invalid Batch (but not empty):\n\n";
test(R"([1])");
cout << "\n\nrpc call with invalid Batch:\n\n";
test(R"([1,2,3])");
cout << "\n\nrpc call Batch:\n\n";
test(R"( [
{"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"},
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
{"jsonrpc": "2.0", "method": "subtract", "params": [42,23], "id": "2"},
{"foo": "boo"},
{"jsonrpc": "2.0", "method": 1, "params": "bar"},
{"jsonrpc": "2.0", "method": 1, "params": "bar", "id": 4},
{"jsonrpc": "2.0", "method": "foo.get", "params": {"name": "myself"}, "id": "5"},
{"jsonrpc": "2.0", "method": "get_data", "id": "9"}
])");
cout << "\n\nrpc call Batch (all notifications):\n\n";
test(R"( [
{"jsonrpc": "2.0", "method": "notify_sum", "params": [1,2,4]},
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}
])");
}

File diff suppressed because it is too large Load Diff

View File

@ -1,461 +0,0 @@
/***
__ ____ __ __ _ ____ ____ ___ _ _
_( )/ ___) / \ ( ( \( _ \( _ \ / __)( ) ( )
/ \) \\___ \( O )/ / ) / ) __/( (__(_ _)(_ _)
\____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_)
version 1.1.1
https://github.com/badaix/jsonrpcpp
This file is part of jsonrpc++
Copyright (C) 2017 Johannes Pohl
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
***/
/// http://patorjk.com/software/taag/#p=display&f=Graceful&t=JSONRPC%2B%2B
#ifndef JSON_RPC_H
#define JSON_RPC_H
#include <string>
#include <cstring>
#include <vector>
#include <exception>
#include "json.hpp"
using Json = nlohmann::json;
namespace jsonrpcpp
{
class Entity;
class Request;
class Notification;
class Parameter;
class Response;
class Error;
class Batch;
typedef std::shared_ptr<Entity> entity_ptr;
typedef std::shared_ptr<Request> request_ptr;
typedef std::shared_ptr<Notification> notification_ptr;
typedef std::shared_ptr<Parameter> parameter_ptr;
typedef std::shared_ptr<Response> response_ptr;
typedef std::shared_ptr<Error> error_ptr;
typedef std::shared_ptr<Batch> batch_ptr;
class Entity
{
public:
enum class entity_t : uint8_t
{
unknown,
exception,
id,
error,
response,
request,
notification,
batch
};
Entity(entity_t type);
virtual ~Entity();
bool is_exception();
bool is_id();
bool is_error();
bool is_response();
bool is_request();
bool is_notification();
bool is_batch();
virtual std::string type_str() const;
virtual Json to_json() const = 0;
virtual void parse_json(const Json& json) = 0;
virtual void parse(const std::string& json_str);
virtual void parse(const char* json_str);
protected:
entity_t entity;
};
class NullableEntity : public Entity
{
public:
NullableEntity(entity_t type);
NullableEntity(entity_t type, std::nullptr_t);
virtual ~NullableEntity();
#ifdef _MSC_VER
virtual operator bool() const
#else
virtual explicit operator bool() const
#endif
{
return !isNull;
}
protected:
bool isNull;
};
class Id : public Entity
{
public:
enum class value_t : uint8_t
{
null,
string,
integer
};
Id();
Id(int id);
Id(const char* id);
Id(const std::string& id);
Id(const Json& json_id);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
friend std::ostream& operator<< (std::ostream &out, const Id &id)
{
out << id.to_json();
return out;
}
value_t type;
int int_id;
std::string string_id;
};
class Parameter : public NullableEntity
{
public:
enum class value_t : uint8_t
{
null,
array,
map
};
Parameter(std::nullptr_t);
Parameter(const Json& json = nullptr);
Parameter(const std::string& key1, const Json& value1,
const std::string& key2 = "", const Json& value2 = nullptr,
const std::string& key3 = "", const Json& value3 = nullptr,
const std::string& key4 = "", const Json& value4 = nullptr);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
bool is_array() const;
bool is_map() const;
bool is_null() const;
Json get(const std::string& key) const;
Json get(size_t idx) const;
bool has(const std::string& key) const;
bool has(size_t idx) const;
template<typename T>
T get(const std::string& key) const
{
return get(key).get<T>();
}
template<typename T>
T get(size_t idx) const
{
return get(idx).get<T>();
}
template<typename T>
T get(const std::string& key, const T& default_value) const
{
if (!has(key))
return default_value;
else
return get<T>(key);
}
template<typename T>
T get(size_t idx, const T& default_value) const
{
if (!has(idx))
return default_value;
else
return get<T>(idx);
}
value_t type;
std::vector<Json> param_array;
std::map<std::string, Json> param_map;
};
class Error : public NullableEntity
{
public:
Error(const Json& json = nullptr);
Error(std::nullptr_t);
Error(const std::string& message, int code, const Json& data = nullptr);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
int code;
std::string message;
Json data;
};
/// JSON-RPC 2.0 request
/**
* Simple jsonrpc 2.0 parser with getters
* Currently no named parameters are supported, but only array parameters
*/
class Request : public Entity
{
public:
Request(const Json& json = nullptr);
Request(const Id& id, const std::string& method, const Parameter& params = nullptr);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
std::string method;
Parameter params;
Id id;
};
class RpcException : public std::exception
{
char* text_;
public:
RpcException(const char* text);
RpcException(const std::string& text);
RpcException(const RpcException& e);
virtual ~RpcException() throw();
virtual const char* what() const noexcept;
};
class ParseErrorException : public RpcException, public Entity
{
public:
Error error;
ParseErrorException(const Error& error);
ParseErrorException(const ParseErrorException& e);
ParseErrorException(const std::string& data);
virtual Json to_json() const;
protected:
virtual void parse_json(const Json& json);
};
// -32600 Invalid Request The JSON sent is not a valid Request object.
// -32601 Method not found The method does not exist / is not available.
// -32602 Invalid params Invalid method parameter(s).
// -32603 Internal error Internal JSON-RPC error.
class RequestException : public RpcException, public Entity
{
public:
Error error;
Id id;
RequestException(const Error& error, const Id& requestId = Id());
RequestException(const RequestException& e);
virtual Json to_json() const;
protected:
virtual void parse_json(const Json& json);
};
class InvalidRequestException : public RequestException
{
public:
InvalidRequestException(const Id& requestId = Id());
InvalidRequestException(const Request& request);
InvalidRequestException(const char* data, const Id& requestId = Id());
InvalidRequestException(const std::string& data, const Id& requestId = Id());
};
class MethodNotFoundException : public RequestException
{
public:
MethodNotFoundException(const Id& requestId = Id());
MethodNotFoundException(const Request& request);
MethodNotFoundException(const char* data, const Id& requestId = Id());
MethodNotFoundException(const std::string& data, const Id& requestId = Id());
};
class InvalidParamsException : public RequestException
{
public:
InvalidParamsException(const Id& requestId = Id());
InvalidParamsException(const Request& request);
InvalidParamsException(const char* data, const Id& requestId = Id());
InvalidParamsException(const std::string& data, const Id& requestId = Id());
};
class InternalErrorException : public RequestException
{
public:
InternalErrorException(const Id& requestId = Id());
InternalErrorException(const Request& request);
InternalErrorException(const char* data, const Id& requestId = Id());
InternalErrorException(const std::string& data, const Id& requestId = Id());
};
class Response : public Entity
{
public:
Id id;
Json result;
Error error;
Response(const Json& json = nullptr);
Response(const Id& id, const Json& result);
Response(const Id& id, const Error& error);
Response(const Request& request, const Json& result);
Response(const Request& request, const Error& error);
Response(const RequestException& exception);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
};
class Notification : public Entity
{
public:
std::string method;
Parameter params;
Notification(const Json& json = nullptr);
Notification(const char* method, const Parameter& params = nullptr);
Notification(const std::string& method, const Parameter& params);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
};
typedef std::function<void(const Parameter& params)> notification_callback;
typedef std::function<jsonrpcpp::response_ptr(const Id& id, const Parameter& params)> request_callback;
class Parser
{
public:
Parser();
virtual ~Parser();
entity_ptr parse(const std::string& json_str);
entity_ptr parse_json(const Json& json);
void register_notification_callback(const std::string& notification, notification_callback callback);
void register_request_callback(const std::string& request, request_callback callback);
static entity_ptr do_parse(const std::string& json_str);
static entity_ptr do_parse_json(const Json& json);
static bool is_request(const std::string& json_str);
static bool is_request(const Json& json);
static bool is_notification(const std::string& json_str);
static bool is_notification(const Json& json);
static bool is_response(const std::string& json_str);
static bool is_response(const Json& json);
static bool is_batch(const std::string& json_str);
static bool is_batch(const Json& json);
private:
std::map<std::string, notification_callback> notification_callbacks_;
std::map<std::string, request_callback> request_callbacks_;
};
class Batch : public Entity
{
public:
std::vector<entity_ptr> entities;
Batch(const Json& json = nullptr);
virtual Json to_json() const;
virtual void parse_json(const Json& json);
template<typename T>
void add(const T& entity)
{
entities.push_back(std::make_shared<T>(entity));
}
void add_ptr(const entity_ptr& entity)
{
entities.push_back(entity);
}
};
} //namespace jsonrpc
#endif

View File

@ -1,56 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] Title"
labels: bug
assignees: etr
---
<!--
Have you read Atom's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/etr/libhttpserver/blob/master/CODE_OF_CONDUCT.md
Do you want to ask a question? Are you looking for support? Our message board is the best place for getting support: https://gitter.im/libhttpserver/community
-->
### Prerequisites
* [ ] Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues
### Description
[Description of the issue]
### Steps to Reproduce
1. [First Step]
2. [Second Step]
3. [and so on...]
**Expected behavior:** [What you expect to happen]
**Actual behavior:** [What actually happens]
**Reproduces how often:** [What percentage of the time does it reproduce?]
### Versions
* OS version (if on linux, the output of "uname -a")
* libhttpserver version (please specify whether compiled or packaged)
* libmicrohttpd version (please specify whether compiled or packaged)
If you have problems during build:
* Compiler version
* autotools version
### Additional Information
Any additional information, configuration (especially build configuration flags if you compiled the libraries) or data that might be necessary to reproduce the issue.
If you have problems during build, please attach your config.log and the full scope of your error from make.
If you have problems at execution, please:
* attach the stacktrace in case of crash (a coredump would be even better).
* provide a main that reproduces the error.

View File

@ -1,23 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature-request
assignees: etr
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe why the feature or enhancement you are proposing fits the library.**
A clear and concise explanation of the reason it fits into the library's mission.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -1,59 +0,0 @@
### Requirements for Contributing a Bug Fix
* Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
* The pull request must only fix an existing bug. To contribute other changes, you must use a different template. You can see all templates at https://github.com/etr/libhttpserver/tree/master/.github/PULL_REQUEST_TEMPLATE.
* The pull request must update the test suite to demonstrate the changed functionality.
* After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see https://github.com/etr/libhttpserver/tree/master/CONTRIBUTING.md#pull-requests.
### Identify the Bug
<!--
Link to the issue describing the bug that you're fixing.
If there is not yet an issue for your bug, please open a new issue and then link to that issue in your pull request.
Note: In some cases, one person's "bug" is another person's "feature." If the pull request does not address an existing issue with the "bug" label, the maintainers have the final say on whether the current behavior is a bug.
-->
### Description of the Change
<!--
We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.
-->
### Alternate Designs
<!-- Explain what other alternates were considered and why the proposed version was selected -->
### Possible Drawbacks
<!-- What are the possible side-effects or negative impacts of the code change? -->
### Verification Process
<!--
What process did you follow to verify that the change has not introduced any regressions?
-->
### Release Notes
<!--
Please describe the changes in a single line that explains this improvement in
terms that a user can understand. This text will be used in libhttpserver's release notes.
If this change is not user-facing or notable enough to be included in release notes
you may use the strings "Not applicable" or "N/A" here.
Examples:
- The GitHub package now allows you to add co-authors to commits.
- Fixed an issue where multiple cursors did not work in a file with a single line.
- Increased the performance of searching and replacing across a whole project.
-->

View File

@ -1,30 +0,0 @@
### Requirements for Contributing Documentation
* Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
* The pull request must only contribute documentation (for example, markdown files or API docs). To contribute other changes, you must use a different template. You can see all templates at https://github.com/etr/libhttpserver/tree/master/.github/PULL_REQUEST_TEMPLATE.
### Description of the Change
<!--
We must be able to understand the purpose of your change from this description. If we can't get a good idea of the benefits of the change from the description here, the pull request may be closed at the maintainers' discretion.
-->
### Release Notes
<!--
Please describe the changes in a single line that explains this improvement in
terms that a user can understand. This text will be used in libhttpserver's release notes.
If this change is not user-facing or notable enough to be included in release notes
you may use the strings "Not applicable" or "N/A" here.
Examples:
- The GitHub package now allows you to add co-authors to commits.
- Fixed an issue where multiple cursors did not work in a file with a single line.
- Increased the performance of searching and replacing across a whole project.
-->

View File

@ -1,62 +0,0 @@
### Requirements for Adding, Changing, or Removing a Feature
* Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
* The pull request must contribute a change that has been endorsed by the maintainer team. See details in the template below.
* The pull request must update the test suite to exercise the updated functionality.
* After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see https://github.com/etr/libhttpserver/tree/master/CONTRIBUTING.md#pull-requests.
### Issue or RFC Endorsed by Maintainers
<!--
If any, link to the issue your change relates to:
-->
### Description of the Change
<!--
We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.
-->
### Alternate Designs
<!-- Explain what other alternates were considered and why the proposed version was selected -->
### Possible Drawbacks
<!-- What are the possible side-effects or negative impacts of the code change? -->
### Verification Process
<!--
What process did you follow to verify that your change has the desired effects?
- How did you verify that all new functionality works as expected?
- How did you verify that all changed functionality works as expected?
- How did you verify that the change has not introduced any regressions?
Describe the actions you performed.
-->
### Release Notes
<!--
Please describe the changes in a single line that explains this improvement in
terms that a user can understand. This text will be used in libhttpserver's release notes.
If this change is not user-facing or notable enough to be included in release notes
you may use the strings "Not applicable" or "N/A" here.
Examples:
- The GitHub package now allows you to add co-authors to commits.
- Fixed an issue where multiple cursors did not work in a file with a single line.
- Increased the performance of searching and replacing across a whole project.
-->

View File

@ -1,55 +0,0 @@
### Requirements for Contributing a Performance Improvement
* Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
* The pull request must only affect performance of existing functionality. To contribute other changes, you must use a different template. You can see all templates at https://github.com/etr/libhttpserver/tree/master/.github/PULL_REQUEST_TEMPLATE.
* After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see https://github.com/etr/libhttpserver/tree/master/CONTRIBUTING.md#pull-requests.
### Description of the Change
<!--
We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.
-->
### Quantitative Performance Benefits
<!--
Describe the exact performance improvement observed. Describe how you measured this change. Bonus points for including graphs that demonstrate the improvement or attached dumps from the built-in profiling tools.
-->
### Possible Drawbacks
<!-- What are the possible side-effects or negative impacts of the code change? -->
### Verification Process
<!--
What process did you follow to verify that the change has not introduced any regressions?
-->
### Applicable Issues
<!-- Enter any applicable Issues here -->
### Release Notes
<!--
Please describe the changes in a single line that explains this improvement in
terms that a user can understand. This text will be used in libhttpserver's release notes.
If this change is not user-facing or notable enough to be included in release notes
you may use the strings "Not applicable" or "N/A" here.
Examples:
- The GitHub package now allows you to add co-authors to commits.
- Fixed an issue where multiple cursors did not work in a file with a single line.
- Increased the performance of searching and replacing across a whole project.
-->

View File

@ -1,73 +0,0 @@
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 4 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# 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

View File

@ -1,59 +0,0 @@
*.sw*
*.*~
*.in
*.php
*.pm
*.py
*_wrap.*
*.gcov
*.gcno
*.gcda
*.o
*.lo
*.la
.idea
libhttpserver.iml
build/*
aclocal.m4
autom4te.cache/
config.guess
config.sub
configure
depcomp
install-sh
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
src/core
src/http_request_builder.cpp
src/httpserver/core
src/httpserver/http_request_builder.hpp
src/.deps/
src/.libs/
test/Test
test/core
test/err
test/test.txt
Makefile
src/Makefile
stamp-h1
test-driver
test/.deps/
test/Makefile
compile
config.h
config.log
config.status
debian/changelog
debian/control
debian/copyright
debian/libhttpserver-dev.install
debian/libhttpserver.install
debian/rules
redhat/libhttpserver.SPEC
libhttpserver.pc
libtool

View File

@ -1,358 +0,0 @@
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
env:
- DEBUG="debug" COVERAGE="coverage"
- DEBUG="nodebug" COVERAGE="nocoverage"
- LINKING="static"
before_install:
- eval "${MATRIX_EVAL}"
# Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise.
- if [ "$IWYU" = "iwyu" ]; then
CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ;
CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'`
CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ;
CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ;
git clone https://github.com/include-what-you-use/include-what-you-use.git ;
cd include-what-you-use ;
echo "$CLANG_PKG_VERSION" | grep '\.[0-9]$' ;
if [ $? -eq 0 ]; then
git checkout clang_${CLANG_PKG_VERSION} ;
else
git checkout clang_${CLANG_PKG_VERSION}.0 ;
fi;
cd .. ;
mkdir build_iwyu ;
cd build_iwyu ;
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ;
make ;
sudo make install ;
cd .. ;
fi
- export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"
- export PATH=$PATH:/usr/local/lib
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install info install-info; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install codecov; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install gcovr; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cppcheck; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS='-mtune=generic'; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export IPV6_TESTS_ENABLED="true"; fi
- 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
- cd ..
- if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi
- if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi
- if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi
- if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi
- if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi
install:
- ./bootstrap
- mkdir build
- cd build
- |
if [ "$LINKING" = "static" ]; then
../configure --enable-static --disable-fastopen;
elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then
../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen;
elif [ "$DEBUG" = "debug" ]; then
../configure --enable-debug --disable-shared --disable-fastopen;
elif [ "$VALGRIND" = "valgrind" ]; then
../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
elif [ "$IWYU" = "iwyu" ]; then
../configure --disable-examples;
else
../configure --disable-fastopen;
fi
# Make or run iwyu. If running iwyu, check for the result code to be 2 (IWYU always returns an error code, if it is 2, no corrections are necessary).
- |
if [ "$IWYU" = "iwyu" ]; then
make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ;
if [ $? -ne 2 ]; then
return 1;
fi
else
make;
fi
script:
- if [ "$IWYU" != "iwyu" ]; then make check; cat test/test-suite.log; fi
- if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi;
- if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi;
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi
- |
if [ "$PERFORMANCE" = "select" ]; then
cd examples
./benchmark_select 8080 $(nproc) &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
- |
if [ "$PERFORMANCE" = "nodelay" ]; then
cd examples
./benchmark_nodelay 8080 $(nproc) &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
- |
if [ "$PERFORMANCE" = "threads" ]; then
cd examples
./benchmark_threads 8080 &
sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
fi
after_success:
- if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then bash <(curl -s https://codecov.io/bash); fi
matrix:
exclude:
- compiler: clang
env: DEBUG="debug" COVERAGE="coverage"
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- valgrind
- valgrind-dbg
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- apache2-utils
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
env:
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
env:
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
# works on Trusty
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
# works on Trusty
- os: linux
addons:
apt:
packages:
- clang-4.0
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
# works on Trusty
- os: linux
addons:
apt:
packages:
- clang-5.0
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: linux
addons:
apt:
packages:
- clang-6.0
env:
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-7
- ubuntu-toolchain-r-test
packages:
- clang-7
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-8
- ubuntu-toolchain-r-test
packages:
- clang-8
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-9
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-9
env:
- MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
- os: linux
compiler: clang
addons:
apt:
sources:
- llvm-toolchain-xenial-7
- ubuntu-toolchain-r-test
packages:
- iwyu
- cmake
- llvm-dev
- libclang-dev
env:
- MATRIX_EVAL="IWYU=iwyu"

View File

@ -1,44 +0,0 @@
- Primary developer:
Sebastiano Merlino <electrictwister2000@gmail.com> (maintainer)
- Code contributions also came from:
Dario Mazza <dariomzz@gmail.com>
Andrea Nicotra <nicotra.andrea@gmail.com>
Jeff Waller <truthset@gmail.com>
Craig Minihan <craig@ripcordsoftware.com>
Guo Xiao <guoxiao08@gmail.com>
Philipp Claßen <philipp.classen@gmx.net>
Vitaut Bajaryn <vitaut.bayaryn@gmail.com>
Felipe Zipitría <fzipi@fing.edu.uy>
Steven 'Steve' Kendall <skendall@neverware.com>
G. Mercat <guillaume.mercat@gmail.com>
Thomas Schätzlein <schaetzleinT@minimax.de>
- Support for building on MinGW/Cygwin systems
Shane Peelar <lookatyouhacker@gmail.com>
Dean M. Sands, III <dsands@taloncontrols.com>
- Support for building on MaxOsX
Jan Klimke <jan.klimke@hpi.uni-potsdam.de>
- Example of SSL usage and operator<< on http_request and http_response
Chris Love <cjlove@san.rr.com>
- Added proper error handling to tcp socket creation and binding
Marcel Pursche <marcel.pursche@3dcontentlogistics.com>
- Fixed error management and regex handling
Julian Picht <julian.picht@4Com.de>
- Fix string termination when loading files in memory
martamoreton (Github: https://github.com/martamoreton)
- Memory leaks
rdiazmartin <rdiazmartin@gmail.com>
- Cleanup of multiple parts of the code
bcsgh (Github: https://github.com/bcsgh)
- Management of large uploads
Walter Landry <wlandry@caltech.edu>
Jagat <pellucide@yahoo.com>

View File

@ -1,76 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at merlino.sebastiano@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@ -1,229 +0,0 @@
# Contributing to libhttpserver
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
The following is a set of guidelines for contributing to libhttpserver. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
#### Table Of Contents
[Code of Conduct](#code-of-conduct)
[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
[How Can I Contribute?](#how-can-i-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Enhancements](#suggesting-enhancements)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)
[Styleguides](#styleguides)
* [Git Commit Messages](#git-commit-messages)
* [Documentation Styleguide](#documentation-styleguide)
[Additional Notes](#additional-notes)
* [Issue and Pull Request Labels](#issue-and-pull-request-labels)
## Code of Conduct
This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [merlino.sebastiano@gmail.com](mailto:merlino.sebastiano@gmail.com).
## I don't want to read this whole thing I just have a question!!!
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
We have an official community board where the community chimes in with helpful advice if you have questions.
* [libhttpserver on Gitter](https://gitter.im/libhttpserver/community)
## How Can I Contribute?
### Reporting Bugs
This section guides you through submitting a bug report for libhttpserver. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](https://github.com/etr/libhttpserver/blob/master/.github/ISSUE_TEMPLATE/bug_report.md), the information it asks for helps us resolve issues faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before Submitting A Bug Report
* **Try to debug the problem** You might be able to find the cause of the problem and fix things yourself. Most importantly, check if you can reproduce the problem in the latest version of libhttpserver (head on github).
* **Perform a [cursory search](https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Bug Report?
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you followed the steps above, create an issue and provide the following information by filling in [the template](https://github.com/etr/libhttpserver/blob/master/.github/ISSUE_TEMPLATE/bug_report.md).
Explain the problem and include additional details to help maintainers reproduce the problem:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**.
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected instead and why.**
* **If you're reporting a crash**, include a crash report with a stack trace from the operating system. Include these in the issue in a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines), a [file attachment](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), or put it in a [gist](https://gist.github.com/) and provide link to that gist.
* **Consider attaching a simple snipped reproducing the problem. **
* **If the problem is related to performance or memory**, include a CPU profile capture with your report.
Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of libhttpserver) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of libhttpserver?** What's the most recent version in which the problem doesn't happen? You can download older versions of libhttpserver from [the releases page](https://github.com/etr/libhttpserver/releases).
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
* **Which version of libhttpserver are you using?**
* **What's the name and version of the OS you're using (e.g. "uname -a" on linux) **?
* **What's the version of libmicrohttpd that you have installed? **
* **Have you installed the libraries (both libhttpserver and libmicrohttpd) manually or through package manager? **
* **Which options did you use when compiling? **
* **What compiler version and version of autotools did you use? **
### Feature Requests and Enhancements
This section guides you through submitting an enhancement suggestion for libhttpserver, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](https://github.com/etr/libhttpserver/blob/master/.github/ISSUE_TEMPLATE/feature_request.md).
#### Before Submitting An Enhancement Suggestion or a Feature Request
* **Perform a [cursory search](https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Feature Request / Enhancement Suggestion?
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on that repository and provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide a specific example to demonstrate the new feature**.
* **Describe the current behavior** and **explain which behavior you expected instead** and why.
* **Describe which alternatives you have considered**.
* **Explain why this enhancement would be useful** to most users and **why it fits the mission of the library**.
### Your First Code Contribution
Unsure where to begin contributing to libhttpserver? You can start by looking through these `beginner` and `help-wanted` issues:
* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two.
* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues.
Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have.
### Pull Requests
The process described here has several goals:
- Maintain libhttpserver's quality
- Fix problems that are important to users
- Engage the community in working toward the best possible solution
- Enable a sustainable system for maintainers to review contributions
Please follow these steps to have your contribution considered by the maintainers:
1. Follow all instructions in [the template](https://github.com/etr/libhttpserver/blob/master/PULL_REQUEST_TEMPLATE.md)
2. Follow the [styleguides](#styleguides)
3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details>
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
## Styleguides
### Git Commit Messages
* Limit the first line to 80 characters or less.
* Add a concise description of what your change does.
* Reference issues and pull requests liberally after the first line.
### Documentation Styleguide
* Use [Markdown](https://daringfireball.net/projects/markdown).
## Additional Notes
### Issue and Pull Request Labels
This section lists the labels we use to help us track and manage issues and pull requests.
[GitHub search](https://help.github.com/articles/searching-issues/) makes it easy to use labels for finding groups of issues or pull requests you're interested in. We encourage you to read about [other search filters](https://help.github.com/articles/searching-issues/) which will help you write more focused queries.
The labels are loosely grouped by their purpose, but it's not required that every issue have a label from every group or that an issue can't have more than one label from the same group.
Please open an issue on `etr/libhttpserver` if you have suggestions for new labels.
#### Type of Issue and Issue State
| Label name | `etr/libhttpserver` :mag_right: | Description |
| --- | --- | --- |
| `feature-request` | [search][search-libhttpserver-repo-label-feature-request] | Feature requests or enhancements. |
| `bug` | [search][search-libhttpserver-repo-label-bug] | Confirmed bugs or reports that are very likely to be bugs. |
| `question` | [search][search-libhttpserver-repo-label-question] | Questions more than bug reports or feature requests (e.g. how do I do X). |
| `feedback` | [search][search-libhttpserver-repo-label-feedback] | General feedback more than bug reports or feature requests. |
| `help-wanted` | [search][search-libhttpserver-repo-label-help-wanted] | The maintainer would appreciate help from the community in resolving these issues. |
| `beginner` | [search][search-libhttpserver-repo-label-beginner] | Less complex issues which would be good first issues to work on for users who want to contribute to libhttpserver. |
| `more-information-needed` | [search][search-libhttpserver-repo-label-more-information-needed] | More information needs to be collected about these problems or feature requests (e.g. steps to reproduce). |
| `needs-reproduction` | [search][search-libhttpserver-repo-label-needs-reproduction] | Likely bugs, but haven't been reliably reproduced. |
| `blocked` | [search][search-libhttpserver-repo-label-blocked] | Issues blocked on other issues. |
| `duplicate` | [search][search-libhttpserver-repo-label-duplicate] | Issues which are duplicates of other issues, i.e. they have been reported before. |
| `wontfix` | [search][search-libhttpserver-repo-label-wontfix] | The maintainers have decided not to fix these issues for now, either because they're working as intended or for some other reason. |
| `invalid` | [search][search-libhttpserver-repo-label-invalid] | Issues which aren't valid (e.g. user errors). |
#### Topic Categories
| Label name | `etr/libhttpserver` :mag_right: | Description |
| --- | --- | --- |
| `windows` | [search][search-libhttpserver-repo-label-windows] | Related to Windows. |
| `linux` | [search][search-libhttpserver-repo-label-linux] | Related to Linux. |
| `mac` | [search][search-libhttpserver-repo-label-mac] | Related to macOS. |
| `travis` | [search][search-libhttpserver-repo-label-travis] | Related to travis and CI in general. |
| `tests` | [search][search-libhttpserver-repo-label-tests] | Related to tests (add tests, fix tests, etc...). |
| `documentation` | [search][search-libhttpserver-repo-label-documentation] | Related to any type of documentation. |
| `performance` | [search][search-libhttpserver-repo-label-performance] | Related to performance. |
| `security` | [search][search-libhttpserver-repo-label-security] | Related to security. |
| `api` | [search][search-libhttpserver-repo-label-api] | Related to libhttpserver's public APIs. |
| `git` | [search][search-libhttpserver-repo-label-git] | Related to Git functionality (e.g. problems with gitignore files or with showing the correct file status). |
#### Pull Request Labels
| Label name | `etr/libhttpserver` :mag_right: | Description |
| --- | --- | --- |
| `work-in-progress` | [search][search-libhttpserver-repo-label-work-in-progress] | Pull requests which are still being worked on, more changes will follow. |
| `needs-review` | [search][search-libhttpserver-repo-label-needs-review] | Pull requests which need code review, and approval from maintainers. |
| `under-review` | [search][search-libhttpserver-repo-label-under-review] | Pull requests being reviewed by maintainers. |
| `requires-changes` | [search][search-libhttpserver-repo-label-requires-changes] | Pull requests which need to be updated based on review comments and then reviewed again. |
| `needs-testing` | [search][search-libhttpserver-repo-label-needs-testing] | Pull requests which need manual testing. |
[search-libhttpserver-repo-label-feature-request]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Afeature-request
[search-libhttpserver-repo-label-bug]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Abug
[search-libhttpserver-repo-label-question]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Aquestion
[search-libhttpserver-repo-label-feedback]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Afeedback
[search-libhttpserver-repo-label-help-wanted]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Ahelp-wanted
[search-libhttpserver-repo-label-beginner]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Abeginner
[search-libhttpserver-repo-label-more-information-needed]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Amore-information-needed
[search-libhttpserver-repo-label-needs-reproduction]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Aneeds-reproduction
[search-libhttpserver-repo-label-triage-help-needed]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Atriage-help-needed
[search-libhttpserver-repo-label-windows]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Awindows
[search-libhttpserver-repo-label-linux]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Alinux
[search-libhttpserver-repo-label-mac]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Amac
[search-libhttpserver-repo-label-travis]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Atravis
[search-libhttpserver-repo-label-tests]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Atests
[search-libhttpserver-repo-label-documentation]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Adocumentation
[search-libhttpserver-repo-label-performance]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Aperformance
[search-libhttpserver-repo-label-security]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Asecurity
[search-libhttpserver-repo-label-api]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Aapi
[search-libhttpserver-repo-label-git]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Agit
[search-libhttpserver-repo-label-blocked]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Ablocked
[search-libhttpserver-repo-label-duplicate]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Aduplicate
[search-libhttpserver-repo-label-wontfix]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Awontfix
[search-libhttpserver-repo-label-invalid]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Ainvalid
[search-libhttpserver-repo-label-build-error]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Abuild-error
[search-libhttpserver-repo-label-installer]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Ainstaller
[search-libhttpserver-repo-label-deprecation-help]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3Aetr%23Flibhttpserver+label%3Adeprecation-help
[search-libhttpserver-repo-label-work-in-progress]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aetr%23Flibhttpserver+label%3Awork-in-progress
[search-libhttpserver-repo-label-needs-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aetr%23Flibhttpserver+label%3Aneeds-review
[search-libhttpserver-repo-label-under-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aetr%23Flibhttpserver+label%3Aunder-review
[search-libhttpserver-repo-label-requires-changes]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aetr%23Flibhttpserver+label%3Arequires-changes
[search-libhttpserver-repo-label-needs-testing]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3Aetr%23Flibhttpserver+label%3Aneeds-testing
[beginner]:https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3Ahelp-wanted+user%3Aetr+sort%3Acomments-desc
[help-wanted]:https://github.com/search?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted+user%3Aetr+sort%3Acomments-desc+-label%3Abeginner

View File

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,290 +0,0 @@
Sat Jun 6 10:21:05 2020 -0800
Prevent use of regex in http_endpoint outside of registration which could
allow DOS attacks.
Sat May 16 07:20:00 2020 -0800
General performance improvements (reduced use of regex, lazy-building of
post-processor)
General code cleanup
General fixes to the documentation
Fixed support on FreeBSD (added missing headers)
Fixed support for Cygwin
Removed depedency on C regex - now using C++11 regex
Sat Aug 10 18:34:07 2019 -0800
Added support for TCP-NODELAY
Changed set_path on http_request to have lazy behavior
Tue Aug 06 22:22:14 2019 -0800
Added support for body parsing in DELETE requests.
Added support for PATCH method
Sat Jan 27 21:59:11 2019 -0800
libhttpserver now includes set of examples to demonstrate the main capabilities of the library
"examples" are now optionally disabled.
Adds valgrind memcheck to the build system on travis
Travis now tests performance with apache benchmark
Reduced the CPU time spent in normalizing URLs (thus saving ~15% on average per request).
All classes now implement move constructor and move assignment operator
The library now avoids collecting connection properties (headers, arguments, footers, cookies, etc...) unless explicitly asked by the client code.
Sat Jan 12 00:51:00 2019 -0800
Removed the support for integrated COMET logic.
Removed the support for caching logic.
Added integ tests.
Changed http_resource interface to use shared_ptr.
Improved interface of the http_response object.
Deprecated http_response_builder object.
Thu Dec 26 10:00:30 2018 -0800
Fixed IPV6 parsing logic.
Added tests to support IP parsing, URL parsing and utilities
Thu Nov 22 20:58:00 2018 -0800
Solved problem with the server not being able to start on mac os
Sun Nov 04 19:28:00 2018 -0800
Moved http_endpoint as a sub-class of webserver. This avoids usage of friends.
Wed Feb 26 21:31:00 2017 +0000
Fixed problem with segfault when copying http_response object
Wed Feb 12 13:14:01 2017 +0000
Updated to libmicrohttpd 0.9.52
Wed Jul 13 02:23:11 2016 +0100
Fixed problems with large payloads
Fixed memory leak in http_response_ptr
Tue Dec 29 18:56:31 2015 +0100
Removed support for event supplier (badly defined, complicated and almost useless)
Eliminated custom selection logic (simplified overall code in webserver.cpp)
Changed comet to use a lock-free implementation
Sun Dec 27 19:39:01 2015 +0100
Removed POLL start configuration (THREAD now defaults to POLL or EPOLL on Linux)
Use TCP_FASTOPEN on linux >= 3.6
Sat Dec 26 15:08:22 2015 +0100
Changed http_resource to use classic C++ polymorphism using virtual instead of CRTP
Fri Jul 17 21:38:54 2015 +0000
Removed build dependency on pkg-config
Wed Apr 15 01:40:11 2015 +0000
Support build on MacOsX
Improved support for CI on travis
Solved bug on event_supplier registering
Solved bug on standardize_url to avoid removing root
Change cycle_callback_ptr so that buffer can be modified
Moved to version 0.9.0
Sun Jul 23 02:46:20 2014 +0100
Support for building on MinGW/Cygwin systems
min libmicrohttpd version moved to 0.9.37
Moved to version 0.8.0
Sat Mar 23 15:22:40 2014 +0100
Continue the cleanup reducing webserver.cpp responsibilities
Deep work on documentation
Moved to version 0.7.2
Sat Jan 25 16:31:03 2014 +0100
Cleaned-up webserver.cpp code to extract secondary classes
Enforced immutability of webserver class
Enabled library to compile on g++ 4.1.2
Wed Oct 31 17:59:40 2012 +0100
Added parameter in http_response to specify if it needs to be deleted by
WS - Sebastiano Merlino
Wed Oct 31 14:23:57 2012 +0100
Changed dependency download method - Sebastiano Merlino
Wed Oct 31 14:13:49 2012 +0100
Added dependency to travis - Sebastiano Merlino
Wed Oct 31 14:07:30 2012 +0100
Changed travis build path - Sebastiano Merlino
Wed Oct 31 14:02:59 2012 +0100
Added travis conf to repo - Sebastiano Merlino
Tue Oct 30 16:13:10 2012 +0100
Changed the buggy debian changelog - Sebastiano Merlino
Tue Oct 30 16:06:26 2012 +0100
Changed version to v0.5.4 - Sebastiano Merlino
Tue Oct 30 15:59:45 2012 +0100
Adjusted debian build rules - Sebastiano Merlino
Tue Oct 30 12:52:04 2012 +0100
Changed version to 0.5.3
Added grow method to http_request - Sebastiano Merlino
Tue Oct 23 12:46:48 2012 +0200
Changed version from 0.5.1 to 0.5.2 - Sebastiano Merlino
Tue Oct 23 12:46:07 2012 +0200
Changed default log behaviour to print nothing
Added getters and setters for dynamic components of WS - Sebastiano Merlino
Mon Oct 22 12:13:11 2012 +0200
Modified version number and changelog in order to prepare tag - Sebastiano Merlino
Fri Oct 19 17:11:21 2012 +0200
Added response constructor with byte - Sebastiano Merlino
Mon Oct 15 11:16:22 2012 +0200
Removed unuseful dependency from libuuid - Sebastiano Merlino
Fri Oct 12 15:42:21 2012 +0200
Solved a bug that made impossible to parse post data - Sebastiano Merlino
Wed Oct 10 17:19:25 2012 +0200
Moved to version 0.5.1 - Sebastiano Merlino
Wed Oct 10 17:16:26 2012 +0200
Added querystring to request attributes - Sebastiano Merlino
Fri Oct 5 18:00:38 2012 +0200
Merge branch 'master' of https://github.com/etr/libhttpserver
Conflicts:
src/webserver.cpp - Sebastiano Merlino
Fri Oct 5 17:55:42 2012 +0200
Added -D_REENTRANT to configuration.
Aligned debian changelog.
Added comet capabilities to the server. - Sebastiano Merlino
Tue Sep 25 00:50:45 2012 +0200
Solved a bug with print in debug mode - Sebastiano Merlino
Mon Sep 24 15:29:28 2012 +0200
Modified webserver in order to accept comet calls
Added ignored patters in gitignore - Sebastiano Merlino
Sun Sep 23 19:10:28 2012 +0200
Partially solved undefined symbol in wrappers - Sebastiano Merlino
Sun Sep 23 19:09:54 2012 +0200
Avoided the usage of the sole option MHD_USE_POLL - Sebastiano Merlino
Thu Sep 20 08:47:24 2012 +0200
Added forgotten modded_request.hpp file - Sebastiano Merlino
Thu Sep 20 08:46:33 2012 +0200
Added .gitignore file - Sebastiano Merlino
Sat Sep 15 13:02:52 2012 +0200
Moved http_endpoint to details namespace - Sebastiano Merlino
Sat Sep 15 02:39:47 2012 -0700
Merge pull request #35 from etr/cflags_for_swig_in_pcfile
add -I${includedir}/httpserver to CFLAGS - Sebastiano Merlino
Tue Aug 28 16:33:45 2012 +0200
add -I${includedir}/httpserver to CFLAGS
This make swig file generation easier because HTTPSERVER_CFLAGS can be
directly used in swig file generation.
This fix affect only clients that use swing on their code. - Dario Mazza
Sun Aug 26 19:03:44 2012 +0200
Changed version.
Aligned version and dependencies in pc and debian files
Updated debian changelog. - Sebastiano Merlino
Sun Aug 26 18:55:05 2012 +0200
Changed visibility of http_endpoint methods to avoid them to be called
by external applications.
Avoided explicit usage of MHD constants in classes interface.
Changed http_resource interface in order to avoid copy-constructor calls
and improve performances.
Changed answer_to_connection method in order to avoid multiple checking
on methods and thus improve performances.
Added a way to register personalized error pages. - Sebastiano Merlino
Wed Aug 8 17:33:39 2012 +0200
Removed code repetition in handle_request method - Sebastiano Merlino
Wed Aug 8 12:31:44 2012 +0200
Added capability to compile with gcov
Changed infinite loop in ws to use wait conditions
Removed a bug from GET-like method handling - Sebastiano Merlino
Sun Aug 5 18:26:25 2012 +0200
Modified in order to parse qs in POST/PUT cases - Sebastiano Merlino
Fri Aug 3 23:36:14 2012 +0200
Avoid inclusion of internal headers - Sebastiano Merlino
Thu Aug 2 00:43:02 2012 +0200
Changed in order to find libmicrohttpd in system - Sebastiano Merlino
Thu Jul 26 14:08:47 2012 +0200
Solved some performance and style issues - Sebastiano Merlino
Wed Jul 25 18:42:48 2012 +0200
Merge branch 'master' of github.com:etr/libhttpserver - Sebastiano Merlino
Wed Jul 25 18:41:45 2012 +0200
Added some comments to http_endpoint and http_request - Sebastiano Merlino
Wed Jul 25 08:58:04 2012 -0700
Merge pull request #29 from etr/libtool_version_number
using m4 to define major,minor and revision number in configure.ac - Sebastiano Merlino
Wed Jul 25 17:50:05 2012 +0200
using m4 to define major,minor and revision number in configure.ac and send version number to libtool and AC_INIT - Dario Mazza
Wed Jul 25 17:10:49 2012 +0200
Changed in order to solve some problems with deb package and rpm package - Sebastiano Merlino
Tue Jul 24 16:55:51 2012 -0700
Merge pull request #28 from etr/debpkg_patch_deps
added parameter used to ignore dependecies during debpkg creation - Sebastiano Merlino
Wed Jul 25 01:51:52 2012 +0200
added parameter used to ignore dependecies during debpkg creation - Dario Mazza
Wed Jul 25 00:42:25 2012 +0200
Adjusted errors in debian rules - Sebastiano Merlino
Tue Jul 24 16:37:07 2012 +0200
Modified rpm build in order to compile it
Lowered required version of libmicrohttpd to 0.9.7 - Sebastiano Merlino
Tue Jul 24 13:28:38 2012 +0200
Changed also build default directory for debs - Sebastiano Merlino
Tue Jul 24 13:22:59 2012 +0200
Changed rules.in in order to avoid relative paths in deb compile - Sebastiano Merlino
Mon Jul 23 15:42:33 2012 +0200
Solved a logical error in http_resource route
Added some debug prints - Sebastiano Merlino
Sun Jul 22 00:24:04 2012 +0200
Changed in order to add optional optimizations on ws - Sebastiano Merlino
Sat Jul 21 17:46:03 2012 +0200
Changed in order to enhance deb packages generation
Added rpm packages generation - Sebastiano Merlino
Sat Jul 21 00:43:39 2012 +0200
adjusted error in changelog - Sebastiano Merlino
Sat Jul 21 00:41:43 2012 +0200
Changed in order to include debian package creation to makefile - Sebastiano Merlino
Fri Jul 20 12:11:30 2012 -0700
Merge pull request #26 from etr/debpackage
project debianized - Sebastiano Merlino
Fri Jul 20 21:03:43 2012 +0200
Merge branch 'master' of github.com:etr/libhttpserver - Sebastiano Merlino
Fri Jul 20 21:03:24 2012 +0200
Changed version - Sebastiano Merlino

View File

@ -1,367 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
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 warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`make -f Makefile.cvs` to create configure file.
2. `./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
3. Type `make' to compile the package.
4. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
5. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
6. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
7. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
8. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
9. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,61 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# not a GNU package. You can remove this line, if
# have all needed files, that a GNU package needs
LIBTOOL_DEPS = @LIBTOOL_DEPS@
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
DIST_SUBDIRS = src
if !COND_CROSS_COMPILE
SUBDIRS += test
DIST_SUBDIRS += test
if BUILD_EXAMPLES
SUBDIRS += examples
DIST_SUBDIRS += examples
endif
endif
EXTRA_DIST = libhttpserver.pc.in $(DX_CONFIG)
MOSTLYCLEANFILES = $(DX_CLEANFILES) *.gcda *.gcno *.gcov
DISTCLEANFILES = DIST_REVISION
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libhttpserver.pc
cmakemoduledir = $(datadir)/cmake/Modules
cmakemodule_DATA = cmakemodule/FindLibHttpServer.cmake
include $(top_srcdir)/aminclude.am
# Update libtool, if needed.
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
dist-hook:
date >DIST_REVISION
git branch -vv >>DIST_REVISION
cp DIST_REVISION $(distdir)/

View File

@ -1,27 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
default: all
all:
aclocal -I m4
autoheader
libtoolize --automake
automake --add-missing
autoconf

View File

View File

@ -1,10 +0,0 @@
Hello there! Welcome. Please follow the steps below to tell us about your contribution.
1. Copy the correct template for your contribution
- Are you fixing a bug? Copy the template from https://raw.githubusercontent.com/etr/libhttpserver/master/.github/PULL_REQUEST_TEMPLATE/bug_fix.md
- Are you improving performance? Copy the template https://raw.githubusercontent.com/etr/libhttpserver/master/.github/PULL_REQUEST_TEMPLATE/performance_improvement.md
- Are you updating documentation? Copy the template from https://raw.githubusercontent.com/etr/libhttpserver/master/.github/PULL_REQUEST_TEMPLATE/documentation.md
- Are you changing functionality? Copy the template from https://raw.githubusercontent.com/etr/libhttpserver/master/.github/PULL_REQUEST_TEMPLATE/feature_change.md
2. Replace this text with the contents of the template
3. Fill in all sections of the template
4. Click "Create pull request"

View File

@ -1,7 +0,0 @@
## Cent OS 7 / RHEL 7
CentOS 7 has a lower version of gcc (4.8.7) that is barely C++11 capable and this library
needs a better compiler. We recommend at least gcc 5+
We recommend installing devtoolset-8
https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/

View File

@ -1,9 +0,0 @@
## Building on FreeBSD (Tested on 12.0)
# Due to the differences in the directory structures on BSD systems some minor tweaks need to occur
# Also, FreeBSD and AIX "make" command is not compatible with gmake, like Linux and Mingw are
export MAKE=gmake
bootstrap
configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
gmake

File diff suppressed because it is too large Load Diff

View File

@ -1,321 +0,0 @@
# This file is part of Autoconf. -*- Autoconf -*-
# Copyright (C) 2004 Oren Ben-Kiki
# This file is distributed under the same terms as the Autoconf macro files.
########## CHANGELOG ##################
# 2009-01-14 Martin Mann
# * DX_ARG_ABLE : new variable 'DX_FLAG_DX_CURRENT_FEATURE'
# * DX_CLEAR_DEPEND : use of explicit variable 'DX_FLAG_DX_CURRENT_FEATURE'
# in AC_SUBST instead of 'DX_FLAG[]DX_CURRENT_FEATURE' which is rejected by
# newer autotools
# Generate automatic documentation using Doxygen. Works in concert with the
# aminclude.m4 file and a compatible doxygen configuration file. Defines the
# following public macros:
#
# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
# paper size.
#
# By default, HTML, PDF and PS documentation is generated as this seems to be
# the most popular and portable combination. MAN pages created by Doxygen are
# usually problematic, though by picking an appropriate subset and doing some
# massaging they might be better than nothing. CHM and RTF are specific for MS
# (note that you can't generate both HTML and CHM at the same time). The XML is
# rather useless unless you apply specialized post-processing to it.
#
# The macro mainly controls the default state of the feature. The use can
# override the default by specifying --enable or --disable. The macros ensure
# that contradictory flags are not given (e.g., --enable-doxygen-html and
# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
# Finally, each feature will be automatically disabled (with a warning) if the
# required programs are missing.
#
# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
# the following parameters: a one-word name for the project for use as a
# filename base etc., an optional configuration file name (the default is
# 'Doxyfile', the same as Doxygen's default), and an optional output directory
# name (the default is 'doxygen-doc').
## ----------##
## Defaults. ##
## ----------##
DX_ENV=""
AC_DEFUN([DX_FEATURE_doc], ON)
AC_DEFUN([DX_FEATURE_dot], ON)
AC_DEFUN([DX_FEATURE_man], OFF)
AC_DEFUN([DX_FEATURE_html], ON)
AC_DEFUN([DX_FEATURE_chm], OFF)
AC_DEFUN([DX_FEATURE_chi], OFF)
AC_DEFUN([DX_FEATURE_rtf], OFF)
AC_DEFUN([DX_FEATURE_xml], OFF)
AC_DEFUN([DX_FEATURE_pdf], ON)
AC_DEFUN([DX_FEATURE_ps], ON)
## --------------- ##
## Private macros. ##
## --------------- ##
# DX_ENV_APPEND(VARIABLE, VALUE)
# ------------------------------
# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
# DX_DIRNAME_EXPR
# ---------------
# Expand into a shell expression prints the directory part of a path.
AC_DEFUN([DX_DIRNAME_EXPR],
[[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
# -------------------------------------
# Expands according to the M4 (static) status of the feature.
AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
# ----------------------------------
# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
AC_DEFUN([DX_REQUIRE_PROG], [
AC_PATH_TOOL([$1], [$2])
if test "$DX_FLAG_DX_CURRENT_FEATURE$$1" = 1; then
AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
fi
])
# DX_TEST_FEATURE(FEATURE)
# ------------------------
# Expand to a shell expression testing whether the feature is active.
AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
# -------------------------------------------------
# Verify that a required features has the right state before trying to turn on
# the DX_CURRENT_FEATURE.
AC_DEFUN([DX_CHECK_DEPEND], [
test "$DX_FLAG_$1" = "$2" \
|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
requires, contradicts) doxygen-DX_CURRENT_FEATURE])
])
# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
# ----------------------------------------------------------
# Turn off the DX_CURRENT_FEATURE if the required feature is off.
AC_DEFUN([DX_CLEAR_DEPEND], [
test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
])
# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
# CHECK_DEPEND, CLEAR_DEPEND,
# REQUIRE, DO-IF-ON, DO-IF-OFF)
# --------------------------------------------
# Parse the command-line option controlling a feature. CHECK_DEPEND is called
# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
# otherwise CLEAR_DEPEND is called to turn off the default state if a required
# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
AC_DEFUN([DX_ARG_ABLE], [
AC_DEFUN([DX_CURRENT_FEATURE], [$1])
AC_DEFUN([DX_FLAG_DX_CURRENT_FEATURE], [DX_FLAG_$1])
AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
AC_ARG_ENABLE(doxygen-$1,
[AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
[--enable-doxygen-$1]),
DX_IF_FEATURE([$1], [don't $2], [$2]))],
[
case "$enableval" in
#(
y|Y|yes|Yes|YES)
AC_SUBST([DX_FLAG_$1], 1)
$3
;; #(
n|N|no|No|NO)
AC_SUBST([DX_FLAG_$1], 0)
;; #(
*)
AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
;;
esac
], [
AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
$4
])
if DX_TEST_FEATURE([$1]); then
$5
:
fi
if DX_TEST_FEATURE([$1]); then
AM_CONDITIONAL(DX_COND_$1, :)
$6
:
else
AM_CONDITIONAL(DX_COND_$1, false)
$7
:
fi
])
## -------------- ##
## Public macros. ##
## -------------- ##
# DX_XXX_FEATURE(DEFAULT_STATE)
# -----------------------------
AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
# ---------------------------------------------------------
# PROJECT also serves as the base name for the documentation files.
# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
AC_DEFUN([DX_INIT_DOXYGEN], [
# Files:
AC_SUBST([DX_PROJECT], [$1])
AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
# Environment variables used inside doxygen.cfg:
DX_ENV_APPEND(SRCDIR, $srcdir)
DX_ENV_APPEND(PROJECT, $DX_PROJECT)
DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
# Doxygen itself:
DX_ARG_ABLE(doc, [generate any doxygen documentation],
[],
[],
[DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
DX_REQUIRE_PROG([DX_PERL], perl)],
[DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
# Dot for graphics:
DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_DOT], dot)],
[DX_ENV_APPEND(HAVE_DOT, YES)
DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
[DX_ENV_APPEND(HAVE_DOT, NO)])
# Man pages generation:
DX_ARG_ABLE(man, [generate doxygen manual pages],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_MAN, YES)],
[DX_ENV_APPEND(GENERATE_MAN, NO)])
# RTF file generation:
DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_RTF, YES)],
[DX_ENV_APPEND(GENERATE_RTF, NO)])
# XML file generation:
DX_ARG_ABLE(xml, [generate doxygen XML documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_XML, YES)],
[DX_ENV_APPEND(GENERATE_XML, NO)])
# (Compressed) HTML help generation:
DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_HHC], hhc)],
[DX_ENV_APPEND(HHC_PATH, $DX_HHC)
DX_ENV_APPEND(GENERATE_HTML, YES)
DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
[DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
# Seperate CHI file generation.
DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
[DX_CHECK_DEPEND(chm, 1)],
[DX_CLEAR_DEPEND(chm, 1)],
[],
[DX_ENV_APPEND(GENERATE_CHI, YES)],
[DX_ENV_APPEND(GENERATE_CHI, NO)])
# Plain HTML pages generation:
DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
[DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
[DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
[],
[DX_ENV_APPEND(GENERATE_HTML, YES)],
[DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
# PostScript file generation:
DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_LATEX], latex)
DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
DX_REQUIRE_PROG([DX_DVIPS], dvips)
DX_REQUIRE_PROG([DX_EGREP], egrep)])
# PDF file generation:
DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
DX_REQUIRE_PROG([DX_EGREP], egrep)])
# LaTeX generation for PS and/or PDF:
if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
AM_CONDITIONAL(DX_COND_latex, :)
DX_ENV_APPEND(GENERATE_LATEX, YES)
else
AM_CONDITIONAL(DX_COND_latex, false)
DX_ENV_APPEND(GENERATE_LATEX, NO)
fi
# Paper size for PS and/or PDF:
AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
[a4wide (default), a4, letter, legal or executive])
case "$DOXYGEN_PAPER_SIZE" in
#(
"")
AC_SUBST(DOXYGEN_PAPER_SIZE, "")
;; #(
a4wide|a4|letter|legal|executive)
DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
;; #(
*)
AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
;;
esac
#For debugging:
#echo DX_FLAG_doc=$DX_FLAG_doc
#echo DX_FLAG_dot=$DX_FLAG_dot
#echo DX_FLAG_man=$DX_FLAG_man
#echo DX_FLAG_html=$DX_FLAG_html
#echo DX_FLAG_chm=$DX_FLAG_chm
#echo DX_FLAG_chi=$DX_FLAG_chi
#echo DX_FLAG_rtf=$DX_FLAG_rtf
#echo DX_FLAG_xml=$DX_FLAG_xml
#echo DX_FLAG_pdf=$DX_FLAG_pdf
#echo DX_FLAG_ps=$DX_FLAG_ps
#echo DX_ENV=$DX_ENV
])

View File

@ -1,186 +0,0 @@
# Copyright (C) 2004 Oren Ben-Kiki
# This file is distributed under the same terms as the Automake macro files.
# Generate automatic documentation using Doxygen. Goals and variables values
# are controlled by the various DX_COND_??? conditionals set by autoconf.
#
# The provided goals are:
# doxygen-doc: Generate all doxygen documentation.
# doxygen-run: Run doxygen, which will generate some of the documentation
# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
# processing required for the rest of it (PS, PDF, and some MAN).
# doxygen-man: Rename some doxygen generated man pages.
# doxygen-ps: Generate doxygen PostScript documentation.
# doxygen-pdf: Generate doxygen PDF documentation.
#
# Note that by default these are not integrated into the automake goals. If
# doxygen is used to generate man pages, you can achieve this integration by
# setting man3_MANS to the list of man pages generated and then adding the
# dependency:
#
# $(man3_MANS): doxygen-doc
#
# This will cause make to run doxygen and generate all the documentation.
#
# The following variable is intended for use in Makefile.am:
#
# DX_CLEANFILES = everything to clean.
#
# This is usually added to MOSTLYCLEANFILES.
## --------------------------------- ##
## Format-independent Doxygen rules. ##
## --------------------------------- ##
if DX_COND_doc
## ------------------------------- ##
## Rules specific for HTML output. ##
## ------------------------------- ##
if DX_COND_html
DX_CLEAN_HTML = @DX_DOCDIR@/html
endif DX_COND_html
## ------------------------------ ##
## Rules specific for CHM output. ##
## ------------------------------ ##
if DX_COND_chm
DX_CLEAN_CHM = @DX_DOCDIR@/chm
if DX_COND_chi
DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
endif DX_COND_chi
endif DX_COND_chm
## ------------------------------ ##
## Rules specific for MAN output. ##
## ------------------------------ ##
if DX_COND_man
DX_CLEAN_MAN = @DX_DOCDIR@/man
endif DX_COND_man
## ------------------------------ ##
## Rules specific for RTF output. ##
## ------------------------------ ##
if DX_COND_rtf
DX_CLEAN_RTF = @DX_DOCDIR@/rtf
endif DX_COND_rtf
## ------------------------------ ##
## Rules specific for XML output. ##
## ------------------------------ ##
if DX_COND_xml
DX_CLEAN_XML = @DX_DOCDIR@/xml
endif DX_COND_xml
## ----------------------------- ##
## Rules specific for PS output. ##
## ----------------------------- ##
if DX_COND_ps
DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
DX_PS_GOAL = doxygen-ps
doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
cd @DX_DOCDIR@/latex; \
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
$(DX_LATEX) refman.tex; \
$(MAKEINDEX_PATH) refman.idx; \
$(DX_LATEX) refman.tex; \
countdown=5; \
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
refman.log > /dev/null 2>&1 \
&& test $$countdown -gt 0; do \
$(DX_LATEX) refman.tex; \
countdown=`expr $$countdown - 1`; \
done; \
$(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
endif DX_COND_ps
## ------------------------------ ##
## Rules specific for PDF output. ##
## ------------------------------ ##
if DX_COND_pdf
DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
DX_PDF_GOAL = doxygen-pdf
doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
cd @DX_DOCDIR@/latex; \
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
$(DX_PDFLATEX) refman.tex; \
$(DX_MAKEINDEX) refman.idx; \
$(DX_PDFLATEX) refman.tex; \
countdown=5; \
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
refman.log > /dev/null 2>&1 \
&& test $$countdown -gt 0; do \
$(DX_PDFLATEX) refman.tex; \
countdown=`expr $$countdown - 1`; \
done; \
mv refman.pdf ../@PACKAGE@.pdf
endif DX_COND_pdf
## ------------------------------------------------- ##
## Rules specific for LaTeX (shared for PS and PDF). ##
## ------------------------------------------------- ##
if DX_COND_latex
DX_CLEAN_LATEX = @DX_DOCDIR@/latex
endif DX_COND_latex
.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
rm -rf @DX_DOCDIR@
$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
DX_CLEANFILES = \
@DX_DOCDIR@/@PACKAGE@.tag \
-r \
$(DX_CLEAN_HTML) \
$(DX_CLEAN_CHM) \
$(DX_CLEAN_CHI) \
$(DX_CLEAN_MAN) \
$(DX_CLEAN_RTF) \
$(DX_CLEAN_XML) \
$(DX_CLEAN_PS) \
$(DX_CLEAN_PDF) \
$(DX_CLEAN_LATEX)
endif DX_COND_doc

View File

@ -1,24 +0,0 @@
platform: x64
environment:
matrix:
- compiler: msys2
MINGW_CHOST: x86_64-w64-mingw32
MSYS2_ARCH: x86_64
init:
- 'echo Building libhttpserver %version% for Windows'
- 'echo System architecture: %PLATFORM%'
- 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
- 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
- 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
- 'echo Cygwin root is: %CYG_ROOT%'
install:
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -msys2 -c "pacman --noconfirm --force -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 -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 && ./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:
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER/build && make check"'
- 'if "%compiler%"=="msys2" C:\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "cd $APPVEYOR_BUILD_FOLDER/build && cat test/test-suite.log"'

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
aclocal -I m4
autoheader
if [[ "$OSTYPE" == "darwin"* ]]; then
glibtoolize --automake
else
libtoolize --automake
fi
automake --add-missing
autoconf
# Optionally do the build as well.
if [ "$1" = "-build" -o "$1" = "--build" ] ; then
shift
./configure "$@"
make
make check
fi

View File

@ -1,19 +0,0 @@
#!/bin/bash
find ../ -name *.gcda
echo "Copying files to the correct locations for correct gcov analysis"
cp -R ../src/* ./src/
cp -R ../src/details/* ./src/details/
cp -R ../src/httpserver/* ./src/httpserver/
cp -R ../test/* ./test/
cp -R ../test/integ/* ./test/integ/
cp -R ../test/unit/* ./test/unit/
echo "Sending json report"
for filename in `find . | egrep '\.cpp'`;
do
gcov -n -o . $filename > /dev/null;
done
codecov

View File

@ -1,31 +0,0 @@
# - Find LibHttpServer
if(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
set(LIBHTTPSERVER_FOUND TRUE)
else(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
find_path(LIBHTTPSERVER_INCLUDE_DIRS httpserverpp
/usr/include
/usr/include/httpserver
/usr/local/include/
/usr/local/include/httpserver
)
find_library(LIBHTTPSERVER_LIBRARIES NAMES httpserver
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
)
if(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
set(LIBHTTPSERVER_FOUND TRUE)
message(STATUS "Found libhttpserver: ${LIBHTTPSERVER_INCLUDE_DIRS}, ${LIBHTTPSERVER_LIBRARIES}")
else(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
set(LIBHTTPSERVER_FOUND FALSE)
message(STATUS "libhttpserver not found.")
endif(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
mark_as_advanced(LIBHTTPSERVER_INCLUDE_DIRS LIBHTTPSERVER_LIBRARIES)
endif(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)

View File

@ -1,378 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
m4_define([libhttpserver_MAJOR_VERSION],[0])dnl
m4_define([libhttpserver_MINOR_VERSION],[18])dnl
m4_define([libhttpserver_REVISION],[1])dnl
m4_define([libhttpserver_PKG_VERSION],[libhttpserver_MAJOR_VERSION.libhttpserver_MINOR_VERSION.libhttpserver_REVISION])dnl
m4_define([libhttpserver_LDF_VERSION],[libhttpserver_MAJOR_VERSION:libhttpserver_MINOR_VERSION:libhttpserver_REVISION])dnl
AC_INIT([libhttpserver], libhttpserver_PKG_VERSION, [electrictwister2000@gmail.com])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AX_VALGRIND_DFLT
AX_VALGRIND_CHECK
OLD_CXXFLAGS=$CXXFLAGS
LT_INIT
AC_PROG_CC
AC_PROG_CXX()
AC_PROG_LN_S
CXXFLAGS=$OLD_CXXFLAGS
AC_LANG([C++])
AC_SYS_LARGEFILE
native_srcdir=$srcdir
AC_MSG_CHECKING([whether it is possible to compile in the same directory])
AC_ARG_ENABLE([same-directory-build],
[AS_HELP_STRING([--enable-same-directory-build],
[enable to compile in the same directory. This is heavily discouraged. (def=no)])],
[samedirectory="$enableval"],
[samedirectory=no])
AC_MSG_RESULT([$samedirectory])
if test x"$samedirectory" = x"no"; then
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
AC_MSG_ERROR("you must configure in a separate build directory")
fi
fi
is_windows=yes;
NETWORK_LIBS=""
case "$host" in
*-mingw*)
NETWORK_HEADER="winsock2.h"
ADDITIONAL_LIBS="-lpthread -no-undefined"
NETWORK_LIBS="-lws2_32"
native_srcdir=$(cd $srcdir; pwd -W)
;;
*-cygwin*)
NETWORK_HEADER="arpa/inet.h"
ADDITIONAL_LIBS="-lpthread -no-undefined"
;;
*)
NETWORK_HEADER="arpa/inet.h"
ADDITIONAL_LIBS=""
is_windows=no
;;
esac
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER([stdint.h],[],[AC_MSG_ERROR("stdint.h not found")])
AC_CHECK_HEADER([inttypes.h],[],[AC_MSG_ERROR("inttypes.h not found")])
AC_CHECK_HEADER([errno.h],[],[AC_MSG_ERROR("errno.h not found")])
AC_CHECK_HEADER([unistd.h],[],[AC_MSG_ERROR("unistd.h not found")])
AC_CHECK_HEADER([ctype.h],[],[AC_MSG_ERROR("cctype not found")])
AC_CHECK_HEADER([sys/stat.h],[],[AC_MSG_ERROR("sys/stat.h not found")])
AC_CHECK_HEADER([sys/types.h],[],[AC_MSG_ERROR("sys/types.h not found")])
AC_CHECK_HEADER([$NETWORK_HEADER],[],[AC_MSG_ERROR("$NETWORK_HEADER not found")])
AC_CHECK_HEADER([signal.h],[],[AC_MSG_ERROR("signal.h not found")])
AC_CHECK_HEADER([gnutls/gnutls.h],[have_gnutls="yes"],[AC_MSG_WARN("gnutls/gnutls.h not found. TLS will be disabled"); have_gnutls="no"])
# Checks for libmicrohttpd
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.52])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
#include <microhttpd.h>
#if (MHD_VERSION < 0x00095102)
#error needs at least version 0.9.52
#endif
int main () { return 0; }
])],
[],
[AC_MSG_ERROR("libmicrohttpd is too old - install libmicrohttpd >= 0.9.52")]
)
],
[AC_MSG_ERROR(["libmicrohttpd not found"])]
),
[AC_MSG_ERROR(["microhttpd.h not found"])]
)
CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $LIBMICROHTTPD_CFLAGS $CXXFLAGS"
LDFLAGS="$LIBMICROHTTPD_LIBS $NETWORK_LIBS $ADDITIONAL_LIBS $LDFLAGS"
cond_cross_compile="no"
else
AC_CHECK_HEADER([microhttpd.h],
AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
[],
[AC_MSG_ERROR(["libmicrohttpd not found"])]
),
[AC_MSG_ERROR(["microhttpd.h not found"])]
)
CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"
LDFLAGS="$NETWORK_LIBS $ADDITIONAL_LIBS $LDFLAGS"
cond_cross_compile="yes"
fi
AM_CONDITIONAL([COND_CROSS_COMPILE],[test x"$cond_cross_compile" = x"yes"])
AC_SUBST(COND_CROSS_COMPILE)
AC_MSG_CHECKING([whether to build with TCP_FASTOPEN support])
AC_ARG_ENABLE([fastopen],
[AS_HELP_STRING([--enable-fastopen],
[enable use of TCP_FASTOPEN (def=yes)])],
[fastopen="$enableval"],
[fastopen=yes])
AC_MSG_RESULT([$fastopen])
is_fastopen_supported=no;
if test x"$fastopen" = x"yes"; then
if test x"$is_windows" = x"no"; then
if test `uname -r |cut -d. -f1` -ge 3; then
if test `uname -r |cut -d. -f2` -ge 7; then
CXXFLAGS="-DUSE_FASTOPEN $CXXFLAGS";
is_fastopen_supported=yes;
fi
fi
fi
fi
AC_ARG_ENABLE([[poll]],
[AS_HELP_STRING([[--enable-poll[=ARG]]], [enable poll support (yes, no, auto) [auto]])],
[enable_poll=${enableval}],
[enable_poll='auto']
)
if test "$enable_poll" != "no"; then
if test "$os_is_native_w32" != "yes"; then
AC_CHECK_HEADERS([poll.h],
[
AC_CHECK_FUNCS([poll], [have_poll='yes'], [have_poll='no'])
], [], [AC_INCLUDES_DEFAULT])
else
AC_MSG_CHECKING([for WSAPoll()])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <winsock2.h>
]], [[
WSAPOLLFD fda[2];
WSAPoll(fda, 2, 0);]])],
[
have_poll='yes'
AC_DEFINE([HAVE_POLL],[1])
], [have_poll='no'])
AC_MSG_RESULT([$have_poll])
fi
if test "$enable_poll" = "yes" && test "$have_poll" != "yes"; then
AC_MSG_ERROR([[Support for poll was explicitly requested but cannot be enabled on this platform.]])
fi
enable_poll="$have_poll"
fi
if test x"$enable_poll" = x"yes"; then
AM_CXXFLAGS="$AM_CXXFLAGS -DENABLE_POLL"
AM_CFLAGS="$AM_CXXFLAGS -DENABLE_POLL"
fi
AC_ARG_ENABLE([[epoll]],
[AS_HELP_STRING([[--enable-epoll[=ARG]]], [enable epoll support (yes, no, auto) [auto]])],
[enable_epoll=${enableval}],
[enable_epoll='auto']
)
if test "$enable_epoll" != "no"; then
AX_HAVE_EPOLL
if test "${ax_cv_have_epoll}" = "yes"; then
AC_DEFINE([[EPOLL_SUPPORT]],[[1]],[Define to 1 to enable epoll support])
enable_epoll='yes'
else
if test "$enable_epoll" = "yes"; then
AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be enabled on this platform.]])
fi
enable_epoll='no'
fi
fi
AM_CONDITIONAL([MHD_HAVE_EPOLL], [[test "x$enable_epoll" = xyes]])
if test "x$enable_epoll" = "xyes"; then
AC_CACHE_CHECK([for epoll_create1()], [mhd_cv_have_epoll_create1], [
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/epoll.h>
]], [[
int fd;
fd = epoll_create1(EPOLL_CLOEXEC);]])],
[mhd_cv_have_epoll_create1=yes],
[mhd_cv_have_epoll_create1=no])])
AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[
AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])])
fi
if test x"$enable_epoll" = x"yes"; then
AM_CXXFLAGS="$AM_CXXFLAGS -DENABLE_EPOLL"
AM_CFLAGS="$AM_CXXFLAGS -DENABLE_EPOLL"
fi
AC_MSG_CHECKING([whether to link statically])
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static],
[enable use static linking (def=yes)])],
[static="$enableval"],
[static=yes])
AC_MSG_RESULT([$static])
if test x"$static" = x"$yes"; then
LDFLAGS="-static $LDFLAGS";
fi
m4_pattern_allow([AC_TYPE_SIZE_T])
m4_pattern_allow([AC_TYPE_UINT16_T])
m4_pattern_allow([AC_TYPE_UINT32_T])
m4_pattern_allow([AC_TYPE_UINT64_T])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
LHT_LIBDEPS="-lmicrohttpd"
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])
AM_LDFLAGS="-lstdc++"
if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG -g -Wall -Wno-uninitialized -O0"
AM_CFLAGS="$AM_CXXFLAGS -DDEBUG -g -Wall -Wno-uninitialized -O0"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -O3"
AM_CFLAGS="$AM_CXXFLAGS -O3"
fi
case $host_os in
darwin* )
AM_CXXFLAGS="$AM_CXXFLAGS -DDARWIN"
AM_CFLAGS="$AM_CFLAGS -DDARWIN"
;;
freebsd* )
AM_LDFLAGS=""
;;
esac
AC_MSG_CHECKING([whether to build with coverage information])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[enable coverage data generation (def=no)])],
[coverit="$enableval"],
[coverit=no])
AC_MSG_RESULT([$coverit])
if test x"$coverit" = x"yes"; then
case $host_os in
darwin* )
echo "Coverage not supported on OSX"
cond_gcov="no"
;;
*)
AC_CHECK_PROG(GCOV, gcov, gcov)
cond_gcov="yes"
;;
esac
fi
AC_ARG_ENABLE([[examples]],
[AS_HELP_STRING([[--disable-examples]], [do not build any examples])], ,
[enable_examples=yes])
test "x$enable_examples" = "xno" || enable_examples=yes
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$enable_examples" = "xyes"])
AM_CONDITIONAL([COND_GCOV],[test x"$cond_gcov" = x"yes"])
AC_SUBST(COND_GCOV)
if test x"have_gnutls" = x"yes"; then
AM_CXXFLAGS="$AM_CXXFLAGS -DHAVE_GNUTLS"
AM_CFLAGS="$AM_CXXFLAGS -DHAVE_GNUTLS"
fi
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(ON)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([$PACKAGE_NAME],[doxyconfig.in])
LDFLAGS="$LDFLAGS -version-number libhttpserver_LDF_VERSION"
AC_SUBST(LHT_LIBDEPS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LDFLAGS)
AC_SUBST(EXT_LIB_PATH)
AC_SUBST(EXT_LIBS)
AC_CONFIG_FILES([test/test_content:test/test_content])
AC_CONFIG_FILES([test/cert.pem:test/cert.pem])
AC_CONFIG_FILES([test/key.pem:test/key.pem])
AC_CONFIG_FILES([test/test_root_ca.pem:test/test_root_ca.pem])
AC_CONFIG_FILES([test/libhttpserver.supp:test/libhttpserver.supp])
AC_CONFIG_FILES([examples/cert.pem:examples/cert.pem])
AC_CONFIG_FILES([examples/key.pem:examples/key.pem])
AC_CONFIG_FILES([examples/test_content:examples/test_content])
AC_OUTPUT(
libhttpserver.pc
Makefile
doc/Makefile
src/Makefile
test/Makefile
examples/Makefile
)
AC_MSG_NOTICE([Configuration Summary:
Operating System: ${host_os}
Target directory: ${prefix}
License : LGPL only
Debug : ${debugit}
TLS Enabled : ${have_gnutls}
TCP_FASTOPEN : ${is_fastopen_supported}
poll support : ${enable_poll=no}
epoll support : ${enable_epoll=no}
Static : ${static}
Build examples : ${enable_examples}
])

View File

@ -1,17 +0,0 @@
[
{ include: ["\"microhttpd.h\"", "private", "<microhttpd.h>", "public"] },
{ include: ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },
{ symbol: ["std::exception", "private", "<exception>", "public"]},
{ symbol: ["std::shared_ptr", "private", "<memory>", "public"]},
{ symbol: ["std::uint16_t", "private", "<cstdint>", "public"]},
{ symbol: ["std::uint64_t", "private", "<cstdint>", "public"]},
{ symbol: ["std::istringstream", "private", "<sstream>", "public"]},
{ symbol: ["std::stringstream", "private", "<sstream>", "public"]},
{ symbol: ["std::ifstream", "private", "<fstream>", "public"]},
{ symbol: ["uint16_t", "private", "<stdint.h>", "public"]},
{ symbol: ["uint64_t", "private", "<stdint.h>", "public"]},
{ symbol: ["MHD_Connection", "private", "<microhttpd.h>", "public"]},
]

View File

@ -1,20 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
man_MANS = libhttpserver.3
EXTRA_DIST = $(man_MANS)

View File

@ -1,59 +0,0 @@
.\" Copyright (c) 2014, Sebastiano Merlino
.\"
.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of
.\" a permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume.
.\" no responsibility for errors or omissions, or for damages resulting.
.\" from the use of the information contained herein. The author(s) may.
.\" not have taken the same level of care in the production of this.
.\" manual, which is licensed free of charge, as they might when working.
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.TH LIBHTTPSERVER "3" "02 Mar 2013 "libhttpserver"
.SH "NAME"
libhttpserver \- C++ library for creating an embedded Rest HTTP server (and more)
.SH "SYNOPSIS"
\fB#include <httpserver.hpp>
.SH "DESCRIPTION"
.P
libhttpserver is an api made with the intent to allow to easily realize Rest based webservers.
.P
The details of the API are described in a detailed documentation and in doxygen generated code reference.
.P
.SH "SEE ALSO"
\fBcurl\fP(1), \fBlibcurl\fP(3), \fBlibmicrohttpd\fP(3)
.SH "LEGAL NOTICE"
libhttpserver is released under the LGPL Version 2.1 or higher. For details on the license please read the appendix in the manual.
.SH "FILES"
.TP
httpserver.hpp
libhttpserver include file
.TP
libhttpserver.so
libhttpserver library
.SH "REPORTING BUGS"
Report bugs by using github issue tracker <https://github.com/etr/libhttpserver/issues>.
.SH "AUTHORS"
GNU libhttpserver is designed and realized by Sebastiano Merlino <electrictwister2000@gmail.com>.
.SH "AVAILABILITY"
You can obtain the latest version from https://github.com/etr/libhttpserver .

View File

@ -1,43 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
LDADD = $(top_builddir)/src/libhttpserver.la
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/httpserver/
METASOURCES = AUTO
noinst_PROGRAMS = hello_world service minimal_hello_world custom_error allowing_disallowing_methods handlers hello_with_get_arg setting_headers custom_access_log basic_authentication digest_authentication minimal_https minimal_file_response minimal_deferred url_registration minimal_ip_ban benchmark_select benchmark_threads benchmark_nodelay deferred_with_accumulator
hello_world_SOURCES = hello_world.cpp
service_SOURCES = service.cpp
minimal_hello_world_SOURCES = minimal_hello_world.cpp
custom_error_SOURCES = custom_error.cpp
allowing_disallowing_methods_SOURCES = allowing_disallowing_methods.cpp
handlers_SOURCES = handlers.cpp
hello_with_get_arg_SOURCES = hello_with_get_arg.cpp
setting_headers_SOURCES = setting_headers.cpp
custom_access_log_SOURCES = custom_access_log.cpp
basic_authentication_SOURCES = basic_authentication.cpp
digest_authentication_SOURCES = digest_authentication.cpp
minimal_https_SOURCES = minimal_https.cpp
minimal_file_response_SOURCES = minimal_file_response.cpp
minimal_deferred_SOURCES = minimal_deferred.cpp
deferred_with_accumulator_SOURCES = deferred_with_accumulator.cpp
url_registration_SOURCES = url_registration.cpp
minimal_ip_ban_SOURCES = minimal_ip_ban.cpp
benchmark_select_SOURCES = benchmark_select.cpp
benchmark_threads_SOURCES = benchmark_threads.cpp
benchmark_nodelay_SOURCES = benchmark_nodelay.cpp

View File

@ -1,58 +0,0 @@
Example Programs
================
hello_world.cpp - a very simple example of using libhttpserver to
create a Rest server capable of receiving and processing
HTTP requests. The server will be listening on port
8080.
service.cpp - an example using more of the libhttpserver API.
This creates a Rest server capable of running with
HTTP or HTTPS (provided that libhttpserver and
libmicrohttpd have been compiled with SSL support.
The server can be configured via command line
arguments:
-p <port> - port number to listen on (default 8080)
-s - enable HTTPS
-k - server key filename (default "key.pem")
-c - server certificate filename (default "cert.pem")
Creating Certificates
=====================
Self-signed certificates can be created using OpenSSL using the
following steps:
$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
$ openssl rsa -passin pass:x -in server.pass.key -out server.key
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
On the last step when prompted for a challenge password it can be left
empty.
Thanks to https://devcenter.heroku.com/articles/ssl-certificate-self
for these instructions.
Keystore configuration
======================
If using a local client such as RestClient
(https://github.com/wiztools/rest-client) for testing the Rest server
then a keystore needs to be established. These commands should be
bundled with your Java installation.
$ keytool -noprompt -import -keystore /path/to/restclient.store -alias
restclient -file /path/to/server.crt
The keys in the store can be listed as follows:
$ keytool -list -v -keystore /path/to/restclient.store
The client can then be configured to use this keystore. Thanks to
http://rubensgomes.blogspot.com/2012/01/how-to-set-up-restclient-for-ssl.html
for instructions on configuring RestClient.

View File

@ -1,42 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
hwr.disallow_all();
hwr.set_allowing("GET", true);
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,46 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class user_pass_resource : public httpserver::http_resource
{
public:
const std::shared_ptr<http_response> render_GET(const http_request& req)
{
if (req.get_user() != "myuser" || req.get_pass() != "mypass")
{
return std::shared_ptr<basic_auth_fail_response>(new basic_auth_fail_response("FAIL", "test@example.com"));
}
return std::shared_ptr<string_response>(new string_response(req.get_user() + " " + req.get_pass(), 200, "text/plain"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
user_pass_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,42 +0,0 @@
#include <cstdlib>
#include <memory>
#include <httpserver.hpp>
#define PATH "/plaintext"
#define BODY "Hello, World!"
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
hello_world_resource(const std::shared_ptr<http_response>& resp):
resp(resp)
{
}
const std::shared_ptr<http_response> render(const http_request&) {
return resp;
}
private:
std::shared_ptr<http_response> resp;
};
int main(int argc, char** argv)
{
webserver ws = create_webserver(atoi(argv[1]))
.start_method(http::http_utils::INTERNAL_SELECT)
.tcp_nodelay()
.max_threads(atoi(argv[2]));
std::shared_ptr<http_response> hello = std::shared_ptr<http_response>(new string_response(BODY, 200));
hello->with_header("Server", "libhttpserver");
hello_world_resource hwr(hello);
ws.register_resource(PATH, &hwr, false);
ws.start(true);
return 0;
}

View File

@ -1,41 +0,0 @@
#include <cstdlib>
#include <memory>
#include <httpserver.hpp>
#define PATH "/plaintext"
#define BODY "Hello, World!"
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
hello_world_resource(const std::shared_ptr<http_response>& resp):
resp(resp)
{
}
const std::shared_ptr<http_response> render(const http_request&) {
return resp;
}
private:
std::shared_ptr<http_response> resp;
};
int main(int argc, char** argv)
{
webserver ws = create_webserver(atoi(argv[1]))
.start_method(http::http_utils::INTERNAL_SELECT)
.max_threads(atoi(argv[2]));
std::shared_ptr<http_response> hello = std::shared_ptr<http_response>(new string_response(BODY, 200));
hello->with_header("Server", "libhttpserver");
hello_world_resource hwr(hello);
ws.register_resource(PATH, &hwr, false);
ws.start(true);
return 0;
}

View File

@ -1,40 +0,0 @@
#include <cstdlib>
#include <memory>
#include <httpserver.hpp>
#define PATH "/plaintext"
#define BODY "Hello, World!"
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
hello_world_resource(const std::shared_ptr<http_response>& resp):
resp(resp)
{
}
const std::shared_ptr<http_response> render(const http_request&) {
return resp;
}
private:
std::shared_ptr<http_response> resp;
};
int main(int argc, char** argv)
{
webserver ws = create_webserver(atoi(argv[1]))
.start_method(http::http_utils::THREAD_PER_CONNECTION);
std::shared_ptr<http_response> hello = std::shared_ptr<http_response>(new string_response(BODY, 200));
hello->with_header("Server", "libhttpserver");
hello_world_resource hwr(hello);
ws.register_resource(PATH, &hwr, false);
ws.start(true);
return 0;
}

View File

@ -1,17 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICpjCCAZCgAwIBAgIESEPtjjALBgkqhkiG9w0BAQUwADAeFw0wODA2MDIxMjU0
MzhaFw0wOTA2MDIxMjU0NDZaMAAwggEfMAsGCSqGSIb3DQEBAQOCAQ4AMIIBCQKC
AQC03TyUvK5HmUAirRp067taIEO4bibh5nqolUoUdo/LeblMQV+qnrv/RNAMTx5X
fNLZ45/kbM9geF8qY0vsPyQvP4jumzK0LOJYuIwmHaUm9vbXnYieILiwCuTgjaud
3VkZDoQ9fteIo+6we9UTpVqZpxpbLulBMh/VsvX0cPJ1VFC7rT59o9hAUlFf9jX/
GmKdYI79MtgVx0OPBjmmSD6kicBBfmfgkO7bIGwlRtsIyMznxbHu6VuoX/eVxrTv
rmCwgEXLWRZ6ru8MQl5YfqeGXXRVwMeXU961KefbuvmEPccgCxm8FZ1C1cnDHFXh
siSgAzMBjC/b6KVhNQ4KnUdZAgMBAAGjLzAtMAwGA1UdEwEB/wQCMAAwHQYDVR0O
BBYEFJcUvpjvE5fF/yzUshkWDpdYiQh/MAsGCSqGSIb3DQEBBQOCAQEARP7eKSB2
RNd6XjEjK0SrxtoTnxS3nw9sfcS7/qD1+XHdObtDFqGNSjGYFB3Gpx8fpQhCXdoN
8QUs3/5ZVa5yjZMQewWBgz8kNbnbH40F2y81MHITxxCe1Y+qqHWwVaYLsiOTqj2/
0S3QjEJ9tvklmg7JX09HC4m5QRYfWBeQLD1u8ZjA1Sf1xJriomFVyRLI2VPO2bNe
JDMXWuP+8kMC7gEvUnJ7A92Y2yrhu3QI3bjPk8uSpHea19Q77tul1UVBJ5g+zpH3
OsF5p0MyaVf09GTzcLds5nE/osTdXGUyHJapWReVmPm3Zn6gqYlnzD99z+DPIgIV
RhZvQx74NQnS6g==
-----END CERTIFICATE-----

View File

@ -1,47 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <iostream>
#include <httpserver.hpp>
using namespace httpserver;
void custom_access_log(const std::string& url) {
std::cout << "ACCESSING: " << url << std::endl;
}
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080)
.log_access(custom_access_log);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,54 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
const std::shared_ptr<http_response> not_found_custom(const http_request& req)
{
return std::shared_ptr<string_response>(new string_response("Not found custom", 404, "text/plain"));
}
const std::shared_ptr<http_response> not_allowed_custom(const http_request& req)
{
return std::shared_ptr<string_response>(new string_response("Not allowed custom", 405, "text/plain"));
}
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080)
.not_found_resource(not_found_custom)
.method_not_allowed_resource(not_allowed_custom);
hello_world_resource hwr;
hwr.disallow_all();
hwr.set_allowing("GET", true);
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,74 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <atomic>
#include <chrono>
#include <thread>
#include <httpserver.hpp>
using namespace httpserver;
std::atomic<int> counter;
ssize_t test_callback (std::shared_ptr<std::atomic<int> > closure_data, char* buf, size_t max) {
int reqid;
if (closure_data == nullptr) {
reqid = -1;
} else {
reqid = *closure_data;
}
// only first 5 connections can be established
if (reqid >= 5) {
return -1;
} else {
// respond corresponding request IDs to the clients
std::string str = "";
str += std::to_string(reqid) + " ";
memset(buf, 0, max);
std::copy(str.begin(), str.end(), buf);
// keep sending reqid
// sleep(1); ==> adapted for C++11 on non-*Nix systems
std::this_thread::sleep_for(std::chrono::seconds(1));
return (ssize_t)max;
}
}
class deferred_resource : public http_resource {
public:
const std::shared_ptr<http_response> render_GET(const http_request& req) {
std::shared_ptr<std::atomic<int> > closure_data(new std::atomic<int>(counter++));
return std::shared_ptr<deferred_response<std::atomic<int> > >(new deferred_response<std::atomic<int> >(test_callback, closure_data, "cycle callback response"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
deferred_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,51 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
#define MY_OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"
using namespace httpserver;
class digest_resource : public httpserver::http_resource {
public:
const std::shared_ptr<http_response> render_GET(const http_request& req) {
if (req.get_digested_user() == "") {
return std::shared_ptr<digest_auth_fail_response>(new digest_auth_fail_response("FAIL", "test@example.com", MY_OPAQUE, true));
}
else {
bool reload_nonce = false;
if(!req.check_digest_auth("test@example.com", "mypass", 300, reload_nonce)) {
return std::shared_ptr<digest_auth_fail_response>(new digest_auth_fail_response("FAIL", "test@example.com", MY_OPAQUE, reload_nonce));
}
}
return std::shared_ptr<string_response>(new string_response("SUCCESS", 200, "text/plain"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
digest_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,45 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render_GET(const http_request&) {
return std::shared_ptr<http_response>(new string_response("GET: Hello, World!"));
}
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("OTHER: Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,40 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request& req) {
return std::shared_ptr<http_response>(new string_response("Hello: " + req.get_arg("name")));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,67 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <iostream>
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&);
void set_some_data(const std::string &s) {data = s;}
std::string data;
};
//using the render method you are able to catch each type of request you receive
const std::shared_ptr<http_response> hello_world_resource::render(const http_request& req)
{
//it is possible to store data inside the resource object that can be altered
//through the requests
std::cout << "Data was: " << data << std::endl;
std::string datapar = req.get_arg("data");
set_some_data(datapar == "" ? "no data passed!!!" : datapar);
std::cout << "Now data is:" << data << std::endl;
//it is possible to send a response initializing an http_string_response
//that reads the content to send in response from a string.
return std::shared_ptr<http_response>(new string_response("Hello World!!!", 200));
}
int main()
{
//it is possible to create a webserver passing a great number of parameters.
//In this case we are just passing the port and the number of thread running.
webserver ws = create_webserver(8080).start_method(http::http_utils::INTERNAL_SELECT).max_threads(5);
hello_world_resource hwr;
//this way we are registering the hello_world_resource to answer for the endpoint
//"/hello". The requested method is called (if the request is a GET we call the render_GET
//method. In case that the specific render method is not implemented, the generic "render"
//method is called.
ws.register_resource("/hello", &hwr, true);
//This way we are putting the created webserver in listen. We pass true in order to have
//a blocking call; if we want the call to be non-blocking we can just pass false to the
//method.
ws.start(true);
return 0;
}

View File

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAtN08lLyuR5lAIq0adOu7WiBDuG4m4eZ6qJVKFHaPy3m5TEFf
qp67/0TQDE8eV3zS2eOf5GzPYHhfKmNL7D8kLz+I7psytCziWLiMJh2lJvb2152I
niC4sArk4I2rnd1ZGQ6EPX7XiKPusHvVE6VamacaWy7pQTIf1bL19HDydVRQu60+
faPYQFJRX/Y1/xpinWCO/TLYFcdDjwY5pkg+pInAQX5n4JDu2yBsJUbbCMjM58Wx
7ulbqF/3lca0765gsIBFy1kWeq7vDEJeWH6nhl10VcDHl1PetSnn27r5hD3HIAsZ
vBWdQtXJwxxV4bIkoAMzAYwv2+ilYTUOCp1HWQI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j
P3gXeQKBgBusb8Rbd+KgxSA0hwY6aoRTPRt8LNvXdsB9vRcKKHUFQvxUWiUSS+L9
/Qu1sJbrUquKOHqksV5wCnWnAKyJNJlhHuBToqQTgKXjuNmVdYSe631saiI7PHyC
eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx
-----END RSA PRIVATE KEY-----

View File

@ -1,55 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
static int counter = 0;
ssize_t test_callback (std::shared_ptr<void> closure_data, char* buf, size_t max) {
if (counter == 2) {
return -1;
}
else {
memset(buf, 0, max);
strcat(buf, " test ");
counter++;
return std::string(buf).size();
}
}
class deferred_resource : public http_resource {
public:
const std::shared_ptr<http_response> render_GET(const http_request& req) {
return std::shared_ptr<deferred_response<void> >(new deferred_response<void>(test_callback, nullptr, "cycle callback response"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
deferred_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,42 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class file_response_resource : public http_resource
{
public:
const std::shared_ptr<http_response> render_GET(const http_request& req)
{
return std::shared_ptr<file_response>(new file_response("test_content", 200, "text/plain"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
file_response_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,40 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,43 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080)
.use_ssl()
.https_mem_key("key.pem")
.https_mem_cert("cert.pem");
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,43 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080)
.default_policy(http::http_utils::REJECT);
ws.allow_ip("127.0.0.1");
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1,242 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2014 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <unistd.h>
#include <cstdio>
#include <iostream>
#include <httpserver.hpp>
using namespace httpserver;
bool verbose=false;
class service_resource: public http_resource {
public:
service_resource();
~service_resource();
const std::shared_ptr<http_response> render_GET(const http_request &req);
const std::shared_ptr<http_response> render_PUT(const http_request &req);
const std::shared_ptr<http_response> render_POST(const http_request &req);
const std::shared_ptr<http_response> render(const http_request &req);
const std::shared_ptr<http_response> render_HEAD(const http_request &req);
const std::shared_ptr<http_response> render_OPTIONS(const http_request &req);
const std::shared_ptr<http_response> render_CONNECT(const http_request &req);
const std::shared_ptr<http_response> render_DELETE(const http_request &req);
private:
};
service_resource::service_resource()
{}
service_resource::~service_resource()
{}
const std::shared_ptr<http_response>
service_resource::render_GET(const http_request &req)
{
std::cout << "service_resource::render_GET()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("GET response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_PUT(const http_request &req)
{
std::cout << "service_resource::render_PUT()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("PUT response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_POST(const http_request &req)
{
std::cout << "service_resource::render_POST()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("POST response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render(const http_request &req)
{
std::cout << "service_resource::render()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("generic response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_HEAD(const http_request &req)
{
std::cout << "service_resource::render_HEAD()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("HEAD response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_OPTIONS(const http_request &req)
{
std::cout << "service_resource::render_OPTIONS()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("OPTIONS response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_CONNECT(const http_request &req)
{
std::cout << "service_resource::render_CONNECT()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("CONNECT response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
const std::shared_ptr<http_response>
service_resource::render_DELETE(const http_request &req)
{
std::cout << "service_resource::render_DELETE()" << std::endl;
if (verbose) std::cout << req;
string_response* res = new string_response("DELETE response", 200);
if (verbose) std::cout << *res;
return std::shared_ptr<http_response>(res);
}
void usage()
{
std::cout << "Usage:" << std::endl
<< "service [-p <port>][-s [-k <keyFileName>][-c <certFileName>]][-v]" << std::endl;
}
int main(int argc, char **argv)
{
uint16_t port=8080;
int c;
const char *key="key.pem";
const char *cert="cert.pem";
bool secure=false;
while ((c = getopt(argc,argv,"p:k:c:sv?")) != EOF) {
switch (c) {
case 'p':
port=strtoul(optarg,NULL,10);
break;
case 'k':
key = optarg;
break;
case 'c':
cert=optarg;
break;
case 's':
secure=true;
break;
case 'v':
verbose=true;
break;
default:
usage();
exit(1);
break;
}
}
std::cout << "Using port " << port << std::endl;
if (secure) {
std::cout << "Key: " << key << " Certificate: " << cert
<< std::endl;
}
//
// Use builder to define webserver configuration options
//
create_webserver cw = create_webserver(port).max_threads(5);
if (secure) {
cw.use_ssl().https_mem_key(key).https_mem_cert(cert);
}
//
// Create webserver using the configured options
//
webserver ws = cw;
//
// Create and register service resource available at /service
//
service_resource res;
ws.register_resource("/service",&res,true);
//
// Start and block the webserver
//
ws.start(true);
return 0;
}

View File

@ -1,42 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
std::shared_ptr<http_response> response = std::shared_ptr<http_response>(new string_response("Hello, World!"));
response->with_header("MyHeader", "MyValue");
return response;
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
ws.start(true);
return 0;
}

View File

@ -1 +0,0 @@
test content of file

View File

@ -1,63 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <httpserver.hpp>
using namespace httpserver;
class hello_world_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request&) {
return std::shared_ptr<http_response>(new string_response("Hello, World!"));
}
};
class handling_multiple_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request& req) {
return std::shared_ptr<http_response>(new string_response("Your URL: " + req.get_path()));
}
};
class url_args_resource : public http_resource {
public:
const std::shared_ptr<http_response> render(const http_request& req) {
return std::shared_ptr<http_response>(new string_response("ARGS: " + req.get_arg("arg1") + " and " + req.get_arg("arg2")));
}
};
int main(int argc, char** argv) {
webserver ws = create_webserver(8080);
hello_world_resource hwr;
ws.register_resource("/hello", &hwr);
handling_multiple_resource hmr;
ws.register_resource("/family", &hmr, true);
ws.register_resource("/with_regex_[0-9]+", &hmr);
url_args_resource uar;
ws.register_resource("/url/with/{arg1}/and/{arg2}", &uar);
ws.register_resource("/url/with/parametric/args/{arg1|[0-9]+}/and/{arg2|[A-Z]+}", &uar);
ws.start(true);
return 0;
}

View File

@ -1,104 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_have_epoll.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_HAVE_EPOLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# AX_HAVE_EPOLL_PWAIT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
# This macro determines whether the system supports the epoll I/O event
# interface. A neat usage example would be:
#
# AX_HAVE_EPOLL(
# [AX_CONFIG_FEATURE_ENABLE(epoll)],
# [AX_CONFIG_FEATURE_DISABLE(epoll)])
# AX_CONFIG_FEATURE(
# [epoll], [This platform supports epoll(7)],
# [HAVE_EPOLL], [This platform supports epoll(7).])
#
# The epoll interface was added to the Linux kernel in version 2.5.45, and
# the macro verifies that a kernel newer than this is installed. This
# check is somewhat unreliable if <linux/version.h> doesn't match the
# running kernel, but it is necessary regardless, because glibc comes with
# stubs for the epoll_create(), epoll_wait(), etc. that allow programs to
# compile and link even if the kernel is too old; the problem would then
# be detected only at runtime.
#
# Linux kernel version 2.6.19 adds the epoll_pwait() call in addition to
# epoll_wait(). The availability of that function can be tested with the
# second macro. Generally speaking, it is safe to assume that
# AX_HAVE_EPOLL would succeed if AX_HAVE_EPOLL_PWAIT has, but not the
# other way round.
#
# LICENSE
#
# Copyright (c) 2008 Peter Simons <simons@cryp.to>
#
# 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.
#serial 11
AC_DEFUN([AX_HAVE_EPOLL], [dnl
ax_have_epoll_cppflags="${CPPFLAGS}"
AC_CHECK_HEADER([linux/version.h], [CPPFLAGS="${CPPFLAGS} -DHAVE_LINUX_VERSION_H"])
AC_MSG_CHECKING([for Linux epoll(7) interface])
AC_CACHE_VAL([ax_cv_have_epoll], [dnl
AC_LINK_IFELSE([dnl
AC_LANG_PROGRAM([dnl
#include <sys/epoll.h>
#ifdef HAVE_LINUX_VERSION_H
# include <linux/version.h>
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45)
# error linux kernel version is too old to have epoll
# endif
#endif
], [dnl
int fd, rc;
struct epoll_event ev;
fd = epoll_create(128);
rc = epoll_wait(fd, &ev, 1, 0);])],
[ax_cv_have_epoll=yes],
[ax_cv_have_epoll=no])])
CPPFLAGS="${ax_have_epoll_cppflags}"
AS_IF([test "${ax_cv_have_epoll}" = "yes"],
[AC_MSG_RESULT([yes])
$1],[AC_MSG_RESULT([no])
$2])
])dnl
AC_DEFUN([AX_HAVE_EPOLL_PWAIT], [dnl
ax_have_epoll_cppflags="${CPPFLAGS}"
AC_CHECK_HEADER([linux/version.h],
[CPPFLAGS="${CPPFLAGS} -DHAVE_LINUX_VERSION_H"])
AC_MSG_CHECKING([for Linux epoll(7) interface with signals extension])
AC_CACHE_VAL([ax_cv_have_epoll_pwait], [dnl
AC_LINK_IFELSE([dnl
AC_LANG_PROGRAM([dnl
#ifdef HAVE_LINUX_VERSION_H
# include <linux/version.h>
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
# error linux kernel version is too old to have epoll_pwait
# endif
#endif
#include <sys/epoll.h>
#include <signal.h>
], [dnl
int fd, rc;
struct epoll_event ev;
fd = epoll_create(128);
rc = epoll_wait(fd, &ev, 1, 0);
rc = epoll_pwait(fd, &ev, 1, 0, (sigset_t const *)(0));])],
[ax_cv_have_epoll_pwait=yes],
[ax_cv_have_epoll_pwait=no])])
CPPFLAGS="${ax_have_epoll_cppflags}"
AS_IF([test "${ax_cv_have_epoll_pwait}" = "yes"],
[AC_MSG_RESULT([yes])
$1],[AC_MSG_RESULT([no])
$2])
])dnl

View File

@ -1,239 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_VALGRIND_DFLT(memcheck|helgrind|drd|sgcheck, on|off)
# AX_VALGRIND_CHECK()
#
# DESCRIPTION
#
# AX_VALGRIND_CHECK checks whether Valgrind is present and, if so, allows
# running `make check` under a variety of Valgrind tools to check for
# memory and threading errors.
#
# Defines VALGRIND_CHECK_RULES which should be substituted in your
# Makefile; and $enable_valgrind which can be used in subsequent configure
# output. VALGRIND_ENABLED is defined and substituted, and corresponds to
# the value of the --enable-valgrind option, which defaults to being
# enabled if Valgrind is installed and disabled otherwise. Individual
# Valgrind tools can be disabled via --disable-valgrind-<tool>, the
# default is configurable via the AX_VALGRIND_DFLT command or is to use
# all commands not disabled via AX_VALGRIND_DFLT. All AX_VALGRIND_DFLT
# calls must be made before the call to AX_VALGRIND_CHECK.
#
# If unit tests are written using a shell script and automake's
# LOG_COMPILER system, the $(VALGRIND) variable can be used within the
# shell scripts to enable Valgrind, as described here:
#
# https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html
#
# Usage example:
#
# configure.ac:
#
# AX_VALGRIND_DFLT([sgcheck], [off])
# AX_VALGRIND_CHECK
#
# in each Makefile.am with tests:
#
# @VALGRIND_CHECK_RULES@
# VALGRIND_SUPPRESSIONS_FILES = my-project.supp
# EXTRA_DIST = my-project.supp
#
# This results in a "check-valgrind" rule being added. Running `make
# check-valgrind` in that directory will recursively run the module's test
# suite (`make check`) once for each of the available Valgrind tools (out
# of memcheck, helgrind and drd) while the sgcheck will be skipped unless
# enabled again on the commandline with --enable-valgrind-sgcheck. The
# results for each check will be output to test-suite-$toolname.log. The
# target will succeed if there are zero errors and fail otherwise.
#
# Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in
# memcheck, helgrind, drd and sgcheck. These are useful because often only
# some of those tools can be ran cleanly on a codebase.
#
# The macro supports running with and without libtool.
#
# LICENSE
#
# Copyright (c) 2014, 2015, 2016 Philip Withnall <philip.withnall@collabora.co.uk>
#
# 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.
#serial 17
dnl Configured tools
m4_define([valgrind_tool_list], [[memcheck], [helgrind], [drd], [sgcheck]])
m4_set_add_all([valgrind_exp_tool_set], [sgcheck])
m4_foreach([vgtool], [valgrind_tool_list],
[m4_define([en_dflt_valgrind_]vgtool, [on])])
AC_DEFUN([AX_VALGRIND_DFLT],[
m4_define([en_dflt_valgrind_$1], [$2])
])dnl
AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
m4_foreach([vgtool], [valgrind_tool_list],
[AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool)])
AC_DEFUN([AX_VALGRIND_CHECK],[
dnl Check for --enable-valgrind
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])],
[enable_valgrind=$enableval],[enable_valgrind=])
AS_IF([test "$enable_valgrind" != "no"],[
# Check for Valgrind.
AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind])
AS_IF([test "$VALGRIND" = ""],[
AS_IF([test "$enable_valgrind" = "yes"],[
AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind])
],[
enable_valgrind=no
])
],[
enable_valgrind=yes
])
])
AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind])
# Check for Valgrind tools we care about.
[valgrind_enabled_tools=]
m4_foreach([vgtool],[valgrind_tool_list],[
AC_ARG_ENABLE([valgrind-]vgtool,
m4_if(m4_defn([en_dflt_valgrind_]vgtool),[off],dnl
[AS_HELP_STRING([--enable-valgrind-]vgtool, [Whether to use ]vgtool[ during the Valgrind tests])],dnl
[AS_HELP_STRING([--disable-valgrind-]vgtool, [Whether to skip ]vgtool[ during the Valgrind tests])]),
[enable_valgrind_]vgtool[=$enableval],
[enable_valgrind_]vgtool[=])
AS_IF([test "$enable_valgrind" = "no"],[
enable_valgrind_]vgtool[=no],
[test "$enable_valgrind_]vgtool[" ]dnl
m4_if(m4_defn([en_dflt_valgrind_]vgtool), [off], [= "yes"], [!= "no"]),[
AC_CACHE_CHECK([for Valgrind tool ]vgtool,
[ax_cv_valgrind_tool_]vgtool,[
ax_cv_valgrind_tool_]vgtool[=no
m4_set_contains([valgrind_exp_tool_set],vgtool,
[m4_define([vgtoolx],[exp-]vgtool)],
[m4_define([vgtoolx],vgtool)])
AS_IF([`$VALGRIND --tool=]vgtoolx[ --help >/dev/null 2>&1`],[
ax_cv_valgrind_tool_]vgtool[=yes
])
])
AS_IF([test "$ax_cv_valgrind_tool_]vgtool[" = "no"],[
AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[
AC_MSG_ERROR([Valgrind does not support ]vgtool[; reconfigure with --disable-valgrind-]vgtool)
],[
enable_valgrind_]vgtool[=no
])
],[
enable_valgrind_]vgtool[=yes
])
])
AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[
valgrind_enabled_tools="$valgrind_enabled_tools ]m4_bpatsubst(vgtool,[^exp-])["
])
AC_SUBST([ENABLE_VALGRIND_]vgtool,[$enable_valgrind_]vgtool)
])
AC_SUBST([valgrind_tools],["]m4_join([ ], valgrind_tool_list)["])
AC_SUBST([valgrind_enabled_tools],[$valgrind_enabled_tools])
[VALGRIND_CHECK_RULES='
# Valgrind check
#
# Optional:
# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions
# files to load. (Default: empty)
# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools.
# (Default: --num-callers=30)
# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of:
# memcheck, helgrind, drd, sgcheck). (Default: various)
# Optional variables
VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES))
VALGRIND_FLAGS ?= --num-callers=30
VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no
VALGRIND_helgrind_FLAGS ?= --history-level=approx
VALGRIND_drd_FLAGS ?=
VALGRIND_sgcheck_FLAGS ?=
# Internal use
valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools)))
valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS)
valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS)
valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS)
valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS)
valgrind_quiet = $(valgrind_quiet_$(V))
valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY))
valgrind_quiet_0 = --quiet
valgrind_v_use = $(valgrind_v_use_$(V))
valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY))
valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%-am,%,$''@):;
# Support running with and without libtool.
ifneq ($(LIBTOOL),)
valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute
else
valgrind_lt =
endif
# Use recursive makes in order to ignore errors during check
check-valgrind-am:
ifeq ($(VALGRIND_ENABLED),yes)
$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \
$(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool))
else
@echo "Need to reconfigure with --enable-valgrind"
endif
# Valgrind running
VALGRIND_TESTS_ENVIRONMENT = \
$(TESTS_ENVIRONMENT) \
env VALGRIND=$(VALGRIND) \
G_SLICE=always-malloc,debug-blocks \
G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly
VALGRIND_LOG_COMPILER = \
$(valgrind_lt) \
$(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS)
define valgrind_tool_rule
check-valgrind-$(1)-am:
ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes)
ifneq ($$(TESTS),)
$$(valgrind_v_use)$$(MAKE) check-TESTS \
TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \
LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \
LOG_FLAGS="$$(valgrind_$(1)_flags)" \
TEST_SUITE_LOG=test-suite-$(1).log
endif
else ifeq ($$(VALGRIND_ENABLED),yes)
@echo "Need to reconfigure with --enable-valgrind-$(1)"
else
@echo "Need to reconfigure with --enable-valgrind"
endif
endef
$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool))))
A''M_DISTCHECK_CONFIGURE_FLAGS ?=
A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind
MOSTLYCLEANFILES ?=
MOSTLYCLEANFILES += $(valgrind_log_files)
.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools))
']
AC_SUBST([VALGRIND_CHECK_RULES])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])])
])

View File

@ -1,168 +0,0 @@
## ------------------------ -*- Autoconf -*-
## Python file handling
## From Andrew Dalke
## Updated by James Henstridge
## ------------------------
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
# Adds support for distributing Python modules and packages. To
# install modules, copy them to $(pythondir), using the python_PYTHON
# automake variable. To install a package with the same name as the
# automake package, install to $(pkgpythondir), or use the
# pkgpython_PYTHON automake variable.
#
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
# locations to install python extension modules (shared libraries).
# Another macro is required to find the appropriate flags to compile
# extension modules.
#
# If your package is configured with a different prefix to python,
# users will have to add the install directory to the PYTHONPATH
# environment variable, or create a .pth file (see the python
# documentation for details).
#
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
# cause an error if the version of python installed on the system
# doesn't meet the requirement. MINIMUM-VERSION should consist of
# numbers and dots only.
AC_DEFUN([AM_PATH_PYTHON],
[
dnl Find a Python interpreter. Python versions prior to 1.5 are not
dnl supported because the default installation locations changed from
dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
dnl in 1.5.
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
[python python2 python2.5 python2.4 python2.3 python2.2 dnl
python2.1 python2.0 python1.6 python1.5])
m4_if([$1],[],[
dnl No version check is needed.
# Find any Python interpreter.
if test -z "$PYTHON"; then
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
fi
am_display_PYTHON=python
], [
dnl A version check is needed.
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
AC_MSG_CHECKING([whether $PYTHON version >= $1])
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR(too old)])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
[am_cv_pathless_PYTHON],[
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
test "$am_cv_pathless_PYTHON" = none && break
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
done])
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
if test "$am_cv_pathless_PYTHON" = none; then
PYTHON=:
else
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
fi
am_display_PYTHON=$am_cv_pathless_PYTHON
fi
])
if test "$PYTHON" = :; then
dnl Run any user-specified action, or abort.
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
dnl Query Python for its version number. Getting [:3] seems to be
dnl the best way to do this; it's what "site.py" does in the standard
dnl library.
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
[am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl Use the values of $prefix and $exec_prefix for the corresponding
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
dnl distinct variables so they can be overridden if need be. However,
dnl general consensus is that you shouldn't need this ability.
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
dnl At times (like when building shared libraries) you may want
dnl to know which OS platform Python thinks this is.
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
[am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
dnl Set up 4 directories:
dnl pythondir -- where to install python scripts. This is the
dnl site-packages directory, not the python standard library
dnl directory like in previous automake betas. This behavior
dnl is more consistent with lispdir.m4 for example.
dnl Query distutils for this directory. distutils does not exist in
dnl Python 1.5, so we fall back to the hardcoded directory if it
dnl doesn't work.
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
[am_cv_python_pythondir],
[am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
AC_SUBST([pythondir], [$am_cv_python_pythondir])
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
dnl more consistent with the rest of automake.
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
dnl pyexecdir -- directory for installing python extension modules
dnl (shared libraries)
dnl Query distutils for this directory. distutils does not exist in
dnl Python 1.5, so we fall back to the hardcoded directory if it
dnl doesn't work.
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
[am_cv_python_pyexecdir],
[am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
dnl Run any user-specified action.
$2
fi
])
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ---------------------------------------------------------------------------
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
# Run ACTION-IF-FALSE otherwise.
# This test uses sys.hexversion instead of the string equivalent (first
# word of sys.version), in order to cope with versions such as 2.2c1.
# hexversion has been introduced in Python 1.5.2; it's probably not
# worth to support older versions (1.5.1 was released on October 31, 1998).
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
[prog="import sys, string
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
minverhex = 0
for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
sys.exit(sys.hexversion < minverhex)"
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])

View File

@ -1,46 +0,0 @@
#
# This file is part of libhttpserver
# Copyright (C) 2011-2019 Sebastiano Merlino
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
AM_CPPFLAGS = -I../ -I$(srcdir)/httpserver/
METASOURCES = AUTO
lib_LTLIBRARIES = libhttpserver.la
libhttpserver_la_SOURCES = string_utilities.cpp webserver.cpp http_utils.cpp http_request.cpp http_response.cpp string_response.cpp basic_auth_fail_response.cpp digest_auth_fail_response.cpp deferred_response.cpp file_response.cpp http_resource.cpp details/http_endpoint.cpp
noinst_HEADERS = httpserver/string_utilities.hpp httpserver/details/modded_request.hpp gettext.h
nobase_include_HEADERS = httpserver.hpp httpserver/create_webserver.hpp httpserver/webserver.hpp httpserver/http_utils.hpp httpserver/details/http_endpoint.hpp httpserver/http_request.hpp httpserver/http_response.hpp httpserver/http_resource.hpp httpserver/string_response.hpp httpserver/basic_auth_fail_response.hpp httpserver/digest_auth_fail_response.hpp httpserver/deferred_response.hpp httpserver/file_response.hpp
AM_CXXFLAGS += -fPIC -Wall
if COND_GCOV
AM_CFLAGS += -O0 --coverage --no-inline
AM_CXXFLAGS += -O0 --coverage --no-inline
AM_LDFLAGS += -O0 --coverage -lgcov --no-inline
endif
if !COND_CROSS_COMPILE
libhttpserver_la_LIBADD = -lmicrohttpd
endif
libhttpserver_la_CFLAGS = $(AM_CFLAGS)
libhttpserver_la_CXXFLAGS = $(AM_CXXFLAGS)
libhttpserver_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined
install-data-hook:
(mkdir -p $(DESTDIR)$(includedir) && cd $(DESTDIR)$(includedir) && $(LN_S) -f httpserver.hpp httpserverpp)
uninstall-hook:
(cd $(DESTDIR)$(includedir) && rm -f httpserverpp)

View File

@ -1,41 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/basic_auth_fail_response.hpp"
#include <microhttpd.h>
struct MHD_Connection;
struct MHD_Response;
using namespace std;
namespace httpserver
{
int basic_auth_fail_response::enqueue_response(MHD_Connection* connection, MHD_Response* response)
{
return MHD_queue_basic_auth_fail_response(
connection,
realm.c_str(),
response
);
}
}

View File

@ -1,41 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/deferred_response.hpp"
#include <microhttpd.h>
struct MHD_Response;
using namespace std;
namespace httpserver
{
namespace details
{
MHD_Response* get_raw_response_helper(void* cls, ssize_t (*cb)(void*, uint64_t, char*, size_t))
{
return MHD_create_response_from_callback(MHD_SIZE_UNKNOWN, 1024, cb, cls, NULL);
}
}
}

View File

@ -1,194 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include <ctype.h>
#include <map>
#include <memory>
#include <regex>
#include <sstream>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "httpserver/details/http_endpoint.hpp"
#include "httpserver/http_utils.hpp"
using namespace std;
namespace httpserver
{
namespace details
{
using namespace http;
http_endpoint::~http_endpoint()
{
}
http_endpoint::http_endpoint
(
const string& url,
bool family,
bool registration,
bool use_regex
):
family_url(family),
reg_compiled(false)
{
if (use_regex && !registration)
{
throw std::invalid_argument("Cannot use regex if not during registration");
}
url_normalized = use_regex ? "^/" : "/";
vector<string> parts;
#ifdef CASE_INSENSITIVE
string_utilities::to_lower_copy(url, url_complete);
#else
url_complete = url;
#endif
if (url_complete[url_complete.size() - 1] == '/')
{
url_complete = url_complete.substr(0, url_complete.size() - 1);
}
if (url_complete[0] != '/')
{
url_complete = "/" + url_complete;
}
parts = http_utils::tokenize_url(url);
string buffered;
bool first = true;
for (unsigned int i = 0; i < parts.size(); i++)
{
if(!registration)
{
url_normalized += (first ? "" : "/") + parts[i];
first = false;
url_pieces.push_back(parts[i]);
continue;
}
if((parts[i] != "") && (parts[i][0] != '{'))
{
if(first)
{
url_normalized = (parts[i][0] == '^' ? "" : url_normalized) + parts[i];
first = false;
}
else
{
url_normalized += "/" + parts[i];
}
url_pieces.push_back(parts[i]);
continue;
}
if((parts[i].size() < 3) || (parts[i][0] != '{') || (parts[i][parts[i].size() - 1] != '}'))
throw std::invalid_argument("Bad URL format");
std::string::size_type bar = parts[i].find_first_of('|');
url_pars.push_back(parts[i].substr(1, bar != string::npos ? bar - 1 : parts[i].size() - 2));
url_normalized += (first ? "" : "/") + (bar != string::npos ? parts[i].substr(bar + 1, parts[i].size() - bar - 2) : "([^\\/]+)");
first = false;
chunk_positions.push_back(i);
url_pieces.push_back(parts[i]);
}
if(use_regex)
{
url_normalized += "$";
try
{
re_url_normalized = std::regex(url_normalized, std::regex::extended | std::regex::icase | std::regex::nosubs);
}
catch (std::regex_error& e)
{
throw std::invalid_argument("Not a valid regex in URL: " + url_normalized);
}
reg_compiled = true;
}
}
http_endpoint::http_endpoint(const http_endpoint& h):
url_complete(h.url_complete),
url_normalized(h.url_normalized),
url_pars(h.url_pars),
url_pieces(h.url_pieces),
chunk_positions(h.chunk_positions),
re_url_normalized(h.re_url_normalized),
family_url(h.family_url),
reg_compiled(h.reg_compiled)
{
}
http_endpoint& http_endpoint::operator =(const http_endpoint& h)
{
url_complete = h.url_complete;
url_normalized = h.url_normalized;
family_url = h.family_url;
reg_compiled = h.reg_compiled;
re_url_normalized = h.re_url_normalized;
url_pars = h.url_pars;
url_pieces = h.url_pieces;
chunk_positions = h.chunk_positions;
return *this;
}
bool http_endpoint::operator <(const http_endpoint& b) const
{
COMPARATOR(url_normalized, b.url_normalized, std::toupper);
}
bool http_endpoint::match(const http_endpoint& url) const
{
if (!reg_compiled) throw std::invalid_argument("Cannot run match. Regex suppressed.");
if(!family_url || url.url_pieces.size() < url_pieces.size())
{
return regex_match(url.url_complete, re_url_normalized);
}
string nn = "/";
bool first = true;
for(unsigned int i = 0; i < url_pieces.size(); i++)
{
nn += (first ? "" : "/") + url.url_pieces[i];
first = false;
}
return regex_match(nn, re_url_normalized);
}
};
};

View File

@ -1,43 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/digest_auth_fail_response.hpp"
#include <microhttpd.h>
struct MHD_Connection;
struct MHD_Response;
using namespace std;
namespace httpserver
{
int digest_auth_fail_response::enqueue_response(MHD_Connection* connection, MHD_Response* response)
{
return MHD_queue_auth_fail_response(
connection,
realm.c_str(),
opaque.c_str(),
response,
reload_nonce ? MHD_YES : MHD_NO
);
}
}

View File

@ -1,52 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/file_response.hpp"
#include <fcntl.h>
#include <microhttpd.h>
#include <stddef.h>
#include <unistd.h>
struct MHD_Response;
using namespace std;
namespace httpserver
{
MHD_Response* file_response::get_raw_response()
{
int fd = open(filename.c_str(), O_RDONLY);
size_t size = lseek(fd, 0, SEEK_END);
if(size)
{
return MHD_create_response_from_fd(size, fd);
}
else
{
return MHD_create_response_from_buffer(
0,
(void*) "",
MHD_RESPMEM_PERSISTENT
);
}
}
}

View File

@ -1,111 +0,0 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 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 3, 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, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
the gettext() and ngettext() macros. This is an alternative to calling
textdomain(), and is useful for libraries. */
# ifdef DEFAULT_TEXT_DOMAIN
# undef gettext
# define gettext(Msgid) \
dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
# endif
#else
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
chokes if dcgettext is defined as a macro. So include it now, to make
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
as well because people using "gettext.h" will not include <libintl.h>,
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
is OK. */
#if defined(__sun)
# include <locale.h>
#endif
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
<libintl.h>, which chokes if dcgettext is defined as a macro. So include
it now, to make later inclusions of <libintl.h> a NOP. */
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
# include <cstdlib>
# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
# include <libintl.h>
# endif
#endif
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# undef gettext
# define gettext(Msgid) ((const char *) (Msgid))
# undef dgettext
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
# undef dcgettext
# define dcgettext(Domainname, Msgid, Category) \
((void) (Category), dgettext (Domainname, Msgid))
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 \
? ((void) (Msgid2), (const char *) (Msgid1)) \
: ((void) (Msgid1), (const char *) (Msgid2)))
# undef dngettext
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
# undef dcngettext
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
# undef textdomain
# define textdomain(Domainname) ((const char *) (Domainname))
# undef bindtextdomain
# define bindtextdomain(Domainname, Dirname) \
((void) (Domainname), (const char *) (Dirname))
# undef bind_textdomain_codeset
# define bind_textdomain_codeset(Domainname, Codeset) \
((void) (Domainname), (const char *) (Codeset))
#endif
/* Prefer gnulib's setlocale override over libintl's setlocale override. */
#ifdef GNULIB_defined_setlocale
# undef setlocale
# define setlocale rpl_setlocale
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
#endif /* _LIBGETTEXT_H */

View File

@ -1,316 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/http_request.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "httpserver/http_utils.hpp"
#include "httpserver/string_utilities.hpp"
using namespace std;
namespace httpserver
{
const std::string http_request::EMPTY = "";
struct arguments_accumulator
{
unescaper_ptr unescaper;
std::map<std::string, std::string, http::arg_comparator>* arguments;
};
void http_request::set_method(const std::string& method)
{
this->method = string_utilities::to_upper_copy(method);
}
bool http_request::check_digest_auth(
const std::string& realm,
const std::string& password,
int nonce_timeout,
bool& reload_nonce
) const
{
std::string digested_user = get_digested_user();
int val = MHD_digest_auth_check(
underlying_connection,
realm.c_str(),
digested_user.c_str(),
password.c_str(),
nonce_timeout
);
if(val == MHD_INVALID_NONCE)
{
reload_nonce = true;
return false;
}
else if(val == MHD_NO)
{
reload_nonce = false;
return false;
}
reload_nonce = false;
return true;
}
const std::string http_request::get_connection_value(const std::string& key, enum MHD_ValueKind kind) const
{
const char* header_c = MHD_lookup_connection_value(
underlying_connection,
kind,
key.c_str()
);
if (header_c == NULL) return EMPTY;
return header_c;
}
MHD_Result http_request::build_request_header(
void *cls,
enum MHD_ValueKind kind,
const char *key,
const char *value
)
{
std::map<std::string, std::string, http::header_comparator>* dhr = static_cast<std::map<std::string, std::string, http::header_comparator>*>(cls);
(*dhr)[key] = value;
return MHD_YES;
}
const std::map<std::string, std::string, http::header_comparator> http_request::get_headerlike_values(enum MHD_ValueKind kind) const
{
std::map<std::string, std::string, http::header_comparator> headers;
MHD_get_connection_values(
underlying_connection,
kind,
&build_request_header,
(void*) &headers
);
return headers;
}
const std::string http_request::get_header(const std::string& key) const
{
return get_connection_value(key, MHD_HEADER_KIND);
}
const std::map<std::string, std::string, http::header_comparator> http_request::get_headers() const
{
return get_headerlike_values(MHD_HEADER_KIND);
}
const std::string http_request::get_footer(const std::string& key) const
{
return get_connection_value(key, MHD_FOOTER_KIND);
}
const std::map<std::string, std::string, http::header_comparator> http_request::get_footers() const
{
return get_headerlike_values(MHD_FOOTER_KIND);
}
const std::string http_request::get_cookie(const std::string& key) const
{
return get_connection_value(key, MHD_COOKIE_KIND);
}
const std::map<std::string, std::string, http::header_comparator> http_request::get_cookies() const
{
return get_headerlike_values(MHD_COOKIE_KIND);
}
const std::string http_request::get_arg(const std::string& key) const
{
std::map<std::string, std::string>::const_iterator it = args.find(key);
if(it != args.end())
{
return it->second;
}
return get_connection_value(key, MHD_GET_ARGUMENT_KIND);
}
const std::map<std::string, std::string, http::arg_comparator> http_request::get_args() const
{
std::map<std::string, std::string, http::arg_comparator> arguments;
arguments.insert(args.begin(), args.end());
arguments_accumulator aa;
aa.unescaper = unescaper;
aa.arguments = &arguments;
MHD_get_connection_values(
underlying_connection,
MHD_GET_ARGUMENT_KIND,
&build_request_args,
(void*) &aa
);
return arguments;
}
const std::string http_request::get_querystring() const
{
std::string querystring = "";
MHD_get_connection_values(
underlying_connection,
MHD_GET_ARGUMENT_KIND,
&build_request_querystring,
(void*) &querystring
);
return querystring;
}
MHD_Result http_request::build_request_args(
void *cls,
enum MHD_ValueKind kind,
const char *key,
const char *arg_value
)
{
arguments_accumulator* aa = static_cast<arguments_accumulator*>(cls);
std::string value = ((arg_value == NULL) ? "" : arg_value);
http::base_unescaper(value, aa->unescaper);
(*aa->arguments)[key] = value;
return MHD_YES;
}
MHD_Result http_request::build_request_querystring(
void *cls,
enum MHD_ValueKind kind,
const char *key,
const char *arg_value
)
{
std::string* querystring = static_cast<std::string*>(cls);
std::string value = ((arg_value == NULL) ? "" : arg_value);
{
std::vector<char> buf(std::string(key).size() + value.size() + 3);
if(*querystring == "")
{
snprintf(&buf[0], buf.size(), "?%s=%s", key, value.c_str());
*querystring = &buf[0];
}
else
{
snprintf(&buf[0], buf.size(), "&%s=%s", key, value.c_str());
*querystring += string(&buf[0]);
}
}
return MHD_YES;
}
const std::string http_request::get_user() const
{
char* username = 0x0;
char* password = 0x0;
username = MHD_basic_auth_get_username_password(underlying_connection, &password);
if (password != 0x0) free(password);
std::string user;
if (username != 0x0) user = username;
free(username);
return user;
}
const std::string http_request::get_pass() const
{
char* username = 0x0;
char* password = 0x0;
username = MHD_basic_auth_get_username_password(underlying_connection, &password);
if (username != 0x0) free(username);
std::string pass;
if (password != 0x0) pass = password;
free(password);
return pass;
}
const std::string http_request::get_digested_user() const
{
char* digested_user_c = 0x0;
digested_user_c = MHD_digest_auth_get_username(underlying_connection);
std::string digested_user = EMPTY;
if (digested_user_c != 0x0)
{
digested_user = digested_user_c;
free(digested_user_c);
}
return digested_user;
}
const std::string http_request::get_requestor() const
{
const MHD_ConnectionInfo * conninfo = MHD_get_connection_info(
underlying_connection,
MHD_CONNECTION_INFO_CLIENT_ADDRESS
);
return http::get_ip_str(conninfo->client_addr);
}
unsigned short http_request::get_requestor_port() const
{
const MHD_ConnectionInfo * conninfo = MHD_get_connection_info(
underlying_connection,
MHD_CONNECTION_INFO_CLIENT_ADDRESS
);
return http::get_port(conninfo->client_addr);
}
std::ostream &operator<< (std::ostream &os, const http_request &r)
{
os << r.get_method() << " Request [user:\"" << r.get_user() << "\" pass:\"" << r.get_pass() << "\"] path:\""
<< r.get_path() << "\"" << std::endl;
http::dump_header_map(os,"Headers",r.get_headers());
http::dump_header_map(os,"Footers",r.get_footers());
http::dump_header_map(os,"Cookies",r.get_cookies());
http::dump_arg_map(os,"Query Args",r.get_args());
os << " Version [ " << r.get_version() << " ] Requestor [ " << r.get_requestor()
<< " ] Port [ " << r.get_requestor_port() << " ]" << std::endl;
return os;
}
}

View File

@ -1,55 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "httpserver/http_resource.hpp"
#include <microhttpd.h>
#include "httpserver/string_response.hpp"
namespace httpserver { class http_response; }
using namespace std;
namespace httpserver
{
//RESOURCE
void resource_init(map<string, bool>& allowed_methods)
{
allowed_methods[MHD_HTTP_METHOD_GET] = true;
allowed_methods[MHD_HTTP_METHOD_POST] = true;
allowed_methods[MHD_HTTP_METHOD_PUT] = true;
allowed_methods[MHD_HTTP_METHOD_HEAD] = true;
allowed_methods[MHD_HTTP_METHOD_DELETE] = true;
allowed_methods[MHD_HTTP_METHOD_TRACE] = true;
allowed_methods[MHD_HTTP_METHOD_CONNECT] = true;
allowed_methods[MHD_HTTP_METHOD_OPTIONS] = true;
allowed_methods[MHD_HTTP_METHOD_PATCH] = true;
}
namespace details
{
shared_ptr<http_response> empty_render(const http_request& r)
{
return shared_ptr<http_response>(new string_response());
}
};
};

View File

@ -1,83 +0,0 @@
/*
This file is part of libhttpserver
Copyright (C) 2011-2019 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "httpserver/http_response.hpp"
#include <microhttpd.h>
#include <iostream>
#include <utility>
#include "httpserver/http_utils.hpp"
using namespace std;
namespace httpserver
{
MHD_Response* http_response::get_raw_response()
{
return MHD_create_response_from_buffer(0, (void*) "", MHD_RESPMEM_PERSISTENT);
}
void http_response::decorate_response(MHD_Response* response)
{
map<string, string, http::header_comparator>::iterator it;
for (it=headers.begin() ; it != headers.end(); ++it)
MHD_add_response_header(
response,
(*it).first.c_str(),
(*it).second.c_str()
);
for (it=footers.begin() ; it != footers.end(); ++it)
MHD_add_response_footer(response,
(*it).first.c_str(),
(*it).second.c_str()
);
for (it=cookies.begin(); it != cookies.end(); ++it)
MHD_add_response_header(
response,
"Set-Cookie",
((*it).first + "=" + (*it).second).c_str()
);
}
int http_response::enqueue_response(MHD_Connection* connection, MHD_Response* response)
{
return MHD_queue_response(connection, response_code, response);
}
void http_response::shoutCAST()
{
response_code |= http::http_utils::shoutcast_response;
}
std::ostream &operator<< (std::ostream &os, const http_response &r)
{
os << "Response [response_code:" << r.response_code << "]" << std::endl;
http::dump_header_map(os,"Headers",r.headers);
http::dump_header_map(os,"Footers",r.footers);
http::dump_header_map(os,"Cookies",r.cookies);
return os;
}
}

Some files were not shown because too many files have changed in this diff Show More