Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Merge #4

Merged
merged 210 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
a6b1111
network: fix type mismatch with format string (#2866)
l2dy Dec 15, 2020
93aab4e
in_tail: remove unused variables
l2dy Dec 15, 2020
6378833
in_tail: add missing return
l2dy Dec 15, 2020
4138b63
out_s3: fix '\0' assignment
l2dy Dec 15, 2020
3119a2d
tls: new TLS abstraction layer
edsiper Dec 16, 2020
bbbc2ac
tls: mbedtls: new mbedtls backend (default for now)
edsiper Dec 16, 2020
97e8257
config: remove tls header
edsiper Dec 16, 2020
23c554a
io: use new 'tls' api
edsiper Dec 16, 2020
45e6019
upstream: use new 'tls' api
edsiper Dec 16, 2020
aefd26a
output: use new 'tls' api
edsiper Dec 16, 2020
d5e0083
oauth2: use new 'tls' api
edsiper Dec 16, 2020
b0c6ca9
upstream: fix api prototype for new tls
edsiper Dec 16, 2020
9a4cd58
filter_kubernetes: use new 'tls' interface
edsiper Dec 16, 2020
1bf6106
out_cloudwatch_logs: use new 'tls' interface
edsiper Dec 16, 2020
7bf569f
out_tcp: use new upstream prototype for tls handling
edsiper Dec 16, 2020
e7bcf14
out_loki: use new upstream prototype for tls handling
edsiper Dec 16, 2020
cdc784e
out_datadog: use new upstream prototype for tls handling
edsiper Dec 16, 2020
bc59480
out_gelf: use new upstream prototype for tls handling
edsiper Dec 16, 2020
ae3fba7
out_syslog: use new upstream prototype for tls handling
edsiper Dec 16, 2020
eebd3be
out_influxdb: use new upstream prototype for tls handling
edsiper Dec 16, 2020
7a05e72
out_kafka_rest: use new upstream prototype for tls handling
edsiper Dec 16, 2020
be59718
out_splunk: use new upstream prototype for tls handling
edsiper Dec 16, 2020
fc6ce46
out_logdna: use new upstream prototype for tls handling
edsiper Dec 16, 2020
b6e9b6c
out_azure: use new upstream prototype for tls handling
edsiper Dec 16, 2020
9e4c1fc
out_azure_blob: use new upstream prototype for tls handling
edsiper Dec 16, 2020
ce0afd8
out_slack: use new upstream prototype for tls handling
edsiper Dec 16, 2020
36b2635
out_nrlogs: use new upstream prototype for tls handling
edsiper Dec 16, 2020
8eb67e8
out_bigquery: use new upstream prototype for tls handling
edsiper Dec 16, 2020
1de7035
out_forward: use new upstream prototype for tls handling
edsiper Dec 16, 2020
9232344
out_es: use new upstream prototype for tls handling
edsiper Dec 16, 2020
c7065b2
out_td: use new upstream prototype for tls handling
edsiper Dec 16, 2020
c74c406
out_http: use new upstream prototype for tls handling
edsiper Dec 16, 2020
9b7a9b4
out_kinesis_firehose: use new upstream prototype for tls handling
edsiper Dec 16, 2020
fc2ac37
out_s3: use new upstream prototype for tls handling
edsiper Dec 16, 2020
1497f81
out_stackdriver: use new upstream prototype for tls handling
edsiper Dec 16, 2020
586b09a
upstream: node: fix tls context
edsiper Dec 18, 2020
43c47b6
tls: openssl: new openssl backend (default)
edsiper Dec 18, 2020
f030bc2
build: link to openssl
edsiper Dec 18, 2020
1d81856
lib: avro: add new avro library
xmcqueen Sep 28, 2020
1e05b60
avro: new avro interface and unit tests
xmcqueen Oct 2, 2020
27fd753
out_kafka: adds avro support into out_kafka without tests
xmcqueen Oct 5, 2020
a632863
tests: runtime: avro: link avro tests
xmcqueen Oct 7, 2020
700ff28
build: build jansson before avro
edsiper Oct 8, 2020
f23ae4b
tests: runtime: in_tail: fix variable declaration
xmcqueen Dec 13, 2020
ca1a039
lib: avro: fix headers management
xmcqueen Dec 13, 2020
89817b8
lib: jansson: upgrade to fd3e9e3
edsiper Dec 13, 2020
8276271
lib: avro: link to 'jansson' instead of 'jansson-static'
edsiper Dec 13, 2020
fd1067b
cmake: headers: update jansson path
edsiper Dec 13, 2020
0f892cc
build: use option() macro to set jansson options
edsiper Dec 13, 2020
d930fcf
build: link jansson instead of jansson-static
edsiper Dec 13, 2020
9054674
out_kafka: fix merge conflict
edsiper Dec 13, 2020
e3a9b42
tests: internal: link against jansson
edsiper Dec 13, 2020
33222de
tests: runtime: link against jansson
edsiper Dec 13, 2020
144f6e4
doc: added fuzzing report
DavidKorczynski Dec 10, 2020
d300962
network: net_connect_*() is broken on Windows
fujimotos Dec 11, 2020
f86df47
out_kafka: check only for first val.via.str.size chars (#2845)
GiedriusS Dec 13, 2020
28fb555
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Dec 18, 2020
ad66a2a
filter_kubernetes: fix 'tls' context reference
edsiper Dec 18, 2020
4913edb
out_cloudwatch_logs: use new tls prototype for upstream creation
edsiper Dec 18, 2020
c6cccd6
lib: chunkio: sync windows build fixes
edsiper Dec 21, 2020
3785f8a
filter_geoip2: Add a new filter plugin for GeoIP2
okkez Sep 17, 2019
d549dc6
coro: deprecate old 'thread' naming for coroutines
edsiper Dec 24, 2020
5d13761
worker: use flb_errno() for memory allocation error
edsiper Dec 24, 2020
e78e670
tp: new 'thread pool' interface
edsiper Dec 26, 2020
66303f8
worker: move worker destroy routine to a new function
edsiper Dec 26, 2020
136b4fb
network: use renamed 'thread/coro' interface
edsiper Dec 26, 2020
7ffc1e4
lib: use renamed 'thread/coro' interface
edsiper Dec 26, 2020
54f4075
upstream: add a 'thread safe' feature
edsiper Dec 26, 2020
8b332ca
scheduler: use new 'coro' header
edsiper Dec 26, 2020
7ee1d07
io: use renamed 'thread/coro' interface
edsiper Dec 26, 2020
7337606
log: rename interfaces
edsiper Dec 26, 2020
df825e8
input: use new coro data type
edsiper Dec 26, 2020
0474eed
task: use new 'coro' naming
edsiper Dec 26, 2020
22f56f6
engine: expose configurable event loop
edsiper Dec 26, 2020
98e88d5
output thread: add new output thread interface (multiple workers supp…
edsiper Dec 26, 2020
5c749a0
output: split interface to perform a 'flush'
edsiper Dec 26, 2020
eabadac
config: use new 'coro' and 'log' prototype
edsiper Dec 26, 2020
9608d08
engine_dispatch: use new output interface to flush tasks
edsiper Dec 26, 2020
fae8154
tls: use new 'coro; interface and custom event loop
edsiper Dec 26, 2020
ca01094
build: adjust new source files
edsiper Dec 26, 2020
fdbc95f
upstream: adjust upstream connection
edsiper Dec 26, 2020
a6ebdc1
time: utils: use new 'coro' namespace
edsiper Dec 26, 2020
4f3d92e
tls: adjust headers
edsiper Dec 26, 2020
263a161
output thread: handle custom events
edsiper Dec 28, 2020
8b47dce
task: use new 'coro' naming
edsiper Dec 28, 2020
ef01094
engine: use new 'coro' naming
edsiper Dec 28, 2020
0e451a7
output: use new 'coro' naming
edsiper Dec 28, 2020
ea4c2e0
out_splunk: set instance flags into upstream context
edsiper Dec 30, 2020
e0143a0
scheduler: make context agnostic and add TLS api
edsiper Dec 30, 2020
67d8665
config: on exit pass scheduler context
edsiper Dec 30, 2020
fc4ef98
upstream: make connection lists thread safe
edsiper Dec 30, 2020
c9f92c6
storage: use proper sched context
edsiper Dec 30, 2020
0ff54fe
output: instance now handle list of upstream contexts
edsiper Dec 30, 2020
feb65d2
engine: use new scheduler api
edsiper Dec 30, 2020
c1b0bba
time: utils: update sched context usage
edsiper Dec 30, 2020
01d5074
output thread: use new scheduler context
edsiper Dec 30, 2020
a79a264
coro: adjust interface naming
edsiper Dec 30, 2020
fd02868
output: use proper 'coro' interface
edsiper Dec 30, 2020
0ef14ee
input: use new coro naming
edsiper Dec 30, 2020
f579dee
engine_dispatch: use new 'coro' interface name
edsiper Dec 30, 2020
17bb0b4
tp: fix thread 'id' storage
edsiper Dec 31, 2020
22c5f71
sched: change api name from _exit() to _destroy()
edsiper Dec 31, 2020
154f81b
engine: update metrics on return value processing, not output
edsiper Dec 31, 2020
0ad8ea1
output: do not update metrics (it's done in the engine now)
edsiper Dec 31, 2020
f8be634
task: rename 'thread' to 'coro'
edsiper Dec 31, 2020
0bee745
config: use proper scheduler api name
edsiper Dec 31, 2020
16536ca
engine: dispath: use proper task api name
edsiper Dec 31, 2020
53a64db
output: use proper task api name
edsiper Dec 31, 2020
55a1e88
tp: remove comments
edsiper Jan 4, 2021
dbf0d8b
coro: simplify coroutine interface
edsiper Jan 4, 2021
98c568f
output: coroutines are now linked to output instance, not task
edsiper Jan 4, 2021
37e9e99
output thread: manage TLS instance and pending events
edsiper Jan 4, 2021
eb91ee6
task: remove 'coroutine' association, just link to the instance
edsiper Jan 4, 2021
4eff2c6
engine: use new 'task' api to manage return statuses
edsiper Jan 4, 2021
59734e6
engine dispatch: use new task and output coro api
edsiper Jan 4, 2021
f04b4e7
input: use new 'coroutine' mechanisms
edsiper Jan 4, 2021
ee33b86
sosreport: adjust flag
edsiper Jan 4, 2021
b8efba8
in_health: use new input flag
edsiper Jan 4, 2021
4da8f18
coro: move TLS handling to proper interface
edsiper Jan 5, 2021
d7ec647
worker: do not initialize 'logger' twice
edsiper Jan 5, 2021
bbbc13a
io: use new coro TLS api
edsiper Jan 5, 2021
ca9ae67
lib: use new coro init api
edsiper Jan 5, 2021
082fb9f
upstream: use new coro api
edsiper Jan 5, 2021
d2e9631
log: use worker data type
edsiper Jan 5, 2021
d003877
engine: dispath: use new output api for retries
edsiper Jan 5, 2021
3e90105
time: utils: use new coro api
edsiper Jan 5, 2021
67871f8
output: rename coro context
edsiper Jan 5, 2021
d93cf60
input: use new coro api
edsiper Jan 5, 2021
ec1a5ac
valgrind: suppress multi-thread (false positive) condition
edsiper Jan 5, 2021
0e5feca
worker: add missing function declaration
edsiper Jan 5, 2021
db6a2d8
lib: chunkio: sync windows build fixes
edsiper Dec 21, 2020
bd05419
filter_geoip2: Add a new filter plugin for GeoIP2
okkez Sep 17, 2019
b9857db
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 5, 2021
d06571a
filter_geoip2: Tweak CMakeList.txt to fix CI builds
fujimotos Jan 5, 2021
6adbd8c
tp: Make the header file compilable on Windows
fujimotos Jan 5, 2021
95c2ec6
core: Include winpthreads.h on Windows
fujimotos Jan 5, 2021
e3c22c0
ci: Define OPENSSL_ROOT_DIR on AppVeyor
fujimotos Jan 5, 2021
feefb91
out_kafka: fix flb_time_sleep() args
edsiper Jan 5, 2021
530866b
out_kafka: unblock engine after retries (#2894)
GiedriusS Jan 5, 2021
f53b488
lib: chunkio: sync fix for Windows CRC32 header
edsiper Jan 7, 2021
7898481
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 7, 2021
0903371
fstore: force usage of stream name (#2909)
edsiper Jan 8, 2021
3a6c6d5
tests: internal: fstore: new fstore unit test
edsiper Jan 8, 2021
b099664
fstore: fix wrong data type and missing initialization of structure (…
PettitWesley Jan 8, 2021
f9720bb
out_s3: fix multipart upload cache parsing (#2912)
PettitWesley Jan 8, 2021
9365975
out_s3: s3_store: only store upload metadata once (#2903)
PettitWesley Jan 8, 2021
9318160
out_kafka: prevent segfault in error path (#2890)
GiedriusS Jan 8, 2021
a87eff3
build: Adjust warning level for MSVC
fujimotos Dec 14, 2020
55095be
pack: Avoid floating point arithmetic
fujimotos Dec 14, 2020
d87ee18
in_winlog: fix warnings about Windows Event Log plugin
fujimotos Dec 21, 2020
1902083
strptime: fix data type size
edsiper Jan 8, 2021
e445363
tests: internal: fstore: enable win compatibility
edsiper Jan 8, 2021
0d9b0dc
tests: internal: fstore: disable windows test
edsiper Jan 8, 2021
55dc9ac
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 8, 2021
9699daf
tls: Add the first cut at OpenSSL v1.0.2 support
fujimotos Jan 8, 2021
253433b
lib: Call flb_tls_init() to initialize OpenSSL
fujimotos Jan 8, 2021
f22b584
tls: Handle tls.ca_path and tls.ca_file correcty
fujimotos Jan 8, 2021
78b0f6d
output thread: fix race condition on event loop creation (#2908)
edsiper Jan 8, 2021
d2696ed
in_http: add HTTP input plugin (#18)
edsiper Jan 8, 2021
e0ea560
build: remove old comments about flushing methods
edsiper Jan 8, 2021
7bf5d8b
lib: luajit: upgrade to commit 1e66d0f
edsiper Jan 8, 2021
92e5e9f
build: link to new Luajit verrsion
edsiper Jan 8, 2021
7704b6d
in_http: build requires FLB_HTTP_SERVER=on
edsiper Jan 8, 2021
f95d400
build: new FLB_RELEASE mode for release with debug symbols
edsiper Jan 8, 2021
9f2c452
tls: openssl: only try to shutdown active connection
edsiper Jan 8, 2021
178b424
http_client: reset first byte of response payload buffer
edsiper Jan 8, 2021
a49708d
out_splunk: use config map for configuration properties
edsiper Jan 8, 2021
c8d433f
tls: move init declaration
edsiper Jan 8, 2021
29bc6c6
upstream: protect connection get on threaded mode
edsiper Jan 8, 2021
9677413
tls: openssl: move tls session destroy on pending destroy
edsiper Jan 8, 2021
086639c
socket: fix error message
edsiper Jan 8, 2021
2cc50ba
upstream: move counters update inside protected section
edsiper Jan 8, 2021
dae2967
http_client: validate errno before printing the message
edsiper Jan 8, 2021
6991509
filter_geoip2: Add support for older Ubuntu systems
fujimotos Jan 8, 2021
ae7e8d5
hash: fix broken hash computation due to incoherent types
fujimotos Jan 13, 2021
dad1bee
engine: dispatch: remove unused variables
edsiper Jan 13, 2021
99dd8d2
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 13, 2021
31063eb
output: move 'coros' to it own thread storage
edsiper Jan 14, 2021
dab2b43
output_thread: create a mapping of instance upstream contexts
edsiper Jan 14, 2021
319ec12
upstream: new 'upstream queues' concepts, aware of multi-threading
edsiper Jan 14, 2021
41dec1c
coro: reset coro on init
edsiper Jan 14, 2021
302a3af
out_splunk: remove config property on exit
edsiper Jan 14, 2021
a49ef9b
lib: initialize upstream context
edsiper Jan 14, 2021
4e684fa
upstream: add upstream queue header
edsiper Jan 14, 2021
f430d96
tls: adjust prototype
edsiper Jan 16, 2021
18c4aee
tls: openssl: invoke a second shutdown
edsiper Jan 16, 2021
e2ad54a
upstream: re-work cleanup interface for active connections
edsiper Jan 16, 2021
753e652
engine: report finished coroutine only if is not threaded mode
edsiper Jan 16, 2021
1913e33
output_thread: rework event loop exit and cleanup
edsiper Jan 16, 2021
2efea76
lib: monkey: sync scheduler changes and remove unused old-uclib header
edsiper Jan 16, 2021
134524d
tls: expose config map for helper
edsiper Jan 18, 2021
521c375
config_map: initialize description
edsiper Jan 18, 2021
ac3667b
output: link a tls configmap for helper
edsiper Jan 18, 2021
13938cc
help: new helper interface
edsiper Jan 18, 2021
0c7d879
bin: new '-J' option to print plugin help in JSON format
edsiper Jan 18, 2021
5057b5a
bin: destroy json helper after usage
edsiper Jan 18, 2021
809db23
help: destroy config maps lists after usage
edsiper Jan 18, 2021
593df29
http_client_debug: detect GZIP payload
edsiper Jan 18, 2021
6d47b7b
http_client: expose debug interface through new API
edsiper Jan 18, 2021
76bee66
out_splunk: add new 'compress' option (allows 'gzip' value)
edsiper Jan 18, 2021
896c55b
output: destroy tls configmap on exit
edsiper Jan 18, 2021
9dca00b
out_es: add support for Elastic Cloud (#2834)
ChrsMark Jan 20, 2021
286fda5
out_azure_blob: new 'compress' and 'compress_blob' options (gzip feat…
edsiper Jan 20, 2021
e29d3b1
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 20, 2021
5888f78
pack: fix missing scientific notation in JSON parser (#2746)
edsiper Jan 21, 2021
a0924d3
out_loki: fix memory leak on init exception (#2958)
ihsinme Jan 21, 2021
89aa3ed
build: fix compilation in latest MacOS (#2954)
rofafor Jan 21, 2021
0540387
utils: fix data type to avoid overflow (oss-fuzz 26595)
edsiper Jan 21, 2021
8f05fcc
Merge branch 'master' of github.com:fluent/fluent-bit
edsiper Jan 21, 2021
b69a379
out_websocket: new 'websocket' output plugin (#1476)
ginobiliwang Jan 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 23 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@ endif()
# Update CFLAGS
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)

# Use custom CFLAGS for MSVC
#
# /W3 ...... Show up to 'production quality' msgs.
# /Zi ...... Generate pdb files.
# /MT ...... Static link C runtimes.
# /wd4711 .. C4711 (function selected for inline expansion)
# /wd4100 .. C4100 (unreferenced formal parameter)
# /wd5045 .. C5045 (Spectre mitigation)
#
set(CMAKE_C_FLAGS "/DWIN32 /D_WINDOWS /DNDEBUG /W3 /O2 /Zi")
set(CMAKE_C_FLAGS "/DWIN32 /D_WINDOWS /DNDEBUG /O2 /Zi /wd4100 /wd4711 /wd5045")
set(CMAKE_EXE_LINKER_FLAGS "/Debug /INCREMENTAL:NO")
set(CMAKE_BUILD_TYPE None)

# Use add_compile_options() to set /MT since Visual Studio
# Generator does not notice /MT in CMAKE_C_FLAGS.
add_compile_options(/MT)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fno-common")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
endif()
Expand All @@ -60,14 +61,15 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/library")

# Build Options
option(FLB_ALL "Enable all features" No)
option(FLB_DEBUG "Build with debug symbols" No)
option(FLB_DEBUG "Build with debug symbols" Yes)
option(FLB_RELEASE "Build with debug symbols" No)
option(FLB_SMALL "Optimise for small size" No)
option(FLB_COVERAGE "Build with code-coverage" No)
option(FLB_JEMALLOC "Build with Jemalloc support" No)
option(FLB_REGEX "Build with Regex support" Yes)
option(FLB_UTF8_ENCODER "Build with UTF8 encoding support" Yes)
option(FLB_PARSER "Build with Parser support" Yes)
option(FLB_TLS "Build with SSL/TLS support" No)
option(FLB_TLS "Build with SSL/TLS support" Yes)
option(FLB_BINARY "Build executable binary" Yes)
option(FLB_EXAMPLES "Build examples" Yes)
option(FLB_SHARED_LIB "Build shared library" Yes)
Expand All @@ -81,7 +83,7 @@ option(FLB_MTRACE "Enable mtrace support" No)
option(FLB_POSIX_TLS "Force POSIX thread storage" No)
option(FLB_INOTIFY "Enable inotify support" Yes)
option(FLB_SQLDB "Enable SQL embedded DB" Yes)
option(FLB_HTTP_SERVER "Enable HTTP Server" No)
option(FLB_HTTP_SERVER "Enable HTTP Server" Yes)
option(FLB_BACKTRACE "Enable stacktrace support" Yes)
option(FLB_LUAJIT "Enable Lua Scripting support" Yes)
option(FLB_RECORD_ACCESSOR "Enable record accessor" Yes)
Expand All @@ -100,20 +102,6 @@ option(FLB_METRICS "Enable metrics support" No)
# Proxy Plugins
option(FLB_PROXY_GO "Enable Go plugins support" Yes)

# Advanced options for Flushing methods
# =====================================
# Flush methods defines under what kind of context/environment the plugins
# flush callback is invoked. Since this is done through co-routines
# there are two options available:
#
# FLB_FLUSH_LIBCO: set by default, use lib/flb_libco implementation which
# supports amd64, arm, x86 and ppc.
#
# FLB_FLUSH_UCONTEXT (DEPRECATED): It uses POSIX ucontext for co-routines
# implementation.
# Despites this is POSIX deprecated, it's supported on Linux and BSD
# systems, but specific old-toolchains do not implement it.

# Build-in Plugins
option(FLB_IN_CPU "Enable CPU input plugin" Yes)
option(FLB_IN_THERMAL "Enable Thermal plugin" Yes)
Expand All @@ -123,7 +111,7 @@ option(FLB_IN_DOCKER_EVENTS "Enable Docker events input plugin" Yes)
option(FLB_IN_EXEC "Enable Exec input plugin" Yes)
option(FLB_IN_FORWARD "Enable Forward input plugin" Yes)
option(FLB_IN_HEALTH "Enable Health input plugin" Yes)
option(FLB_IN_HTTP "Enable HTTP input plugin" No)
option(FLB_IN_HTTP "Enable HTTP input plugin" Yes)
option(FLB_IN_MEM "Enable Memory input plugin" Yes)
option(FLB_IN_KMSG "Enable Kernel log input plugin" Yes)
option(FLB_IN_LIB "Enable library mode input plugin" Yes)
Expand Down Expand Up @@ -178,6 +166,7 @@ option(FLB_OUT_KAFKA_REST "Enable Kafka Rest output plugin" Yes)
option(FLB_OUT_CLOUDWATCH_LOGS "Enable AWS CloudWatch output plugin" Yes)
option(FLB_OUT_KINESIS_FIREHOSE "Enable AWS Firehose output plugin" Yes)
option(FLB_OUT_S3 "Enable AWS S3 output plugin" Yes)
option(FLB_OUT_WEBSOCKET "Enable Websocket output plugin" Yes)
option(FLB_FILTER_ALTER_SIZE "Enable alter_size filter" Yes)
option(FLB_FILTER_AWS "Enable aws filter" Yes)
option(FLB_FILTER_EXPECT "Enable expect filter" Yes)
Expand All @@ -193,6 +182,7 @@ option(FLB_FILTER_NEST "Enable nest filter" Yes)
option(FLB_FILTER_LUA "Enable Lua scripting filter" Yes)
option(FLB_FILTER_RECORD_MODIFIER "Enable record_modifier filter" Yes)
option(FLB_FILTER_TENSORFLOW "Enable tensorflow filter" No)
option(FLB_FILTER_GEOIP2 "Enable geoip2 filter" Yes)

# Debug callbacks
option(FLB_HTTP_CLIENT_DEBUG "Enable HTTP Client debug callbacks" No)
Expand Down Expand Up @@ -233,6 +223,7 @@ if(FLB_ALL)
set(FLB_OUT_SYSLOG 1)
set(FLB_OUT_LIB 1)
set(FLB_OUT_FLOWCOUNTER 1)
set(FLB_OUT_WEBSOCKET 1)
endif()

if(FLB_DEV)
Expand Down Expand Up @@ -308,6 +299,8 @@ endif()
# Enable Debug symbols if specified
if(FLB_DEBUG)
set(CMAKE_BUILD_TYPE "Debug")
elseif(FLB_RELEASE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

if(FLB_PARSER)
Expand Down Expand Up @@ -421,10 +414,18 @@ endif()

if(FLB_TLS)
FLB_DEFINITION(FLB_HAVE_TLS)

# Build mbedtls: yes, in this transition period we always enable it
option(ENABLE_TESTING OFF)
option(ENABLE_PROGRAMS OFF)
option(INSTALL_MBEDTLS_HEADERS OFF)
add_subdirectory(${FLB_PATH_LIB_MBEDTLS} EXCLUDE_FROM_ALL)

# find OpenSSL (our preferred choice now)
find_package(OpenSSL)
if(OPENSSL_FOUND)
FLB_DEFINITION(FLB_HAVE_OPENSSL)
endif()
endif()

# Metrics
Expand Down
9 changes: 9 additions & 0 deletions ci/do-ut.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
cd build

if ( "x64" -eq $env:PLATFORM ) {
$OPENSSL_DIR = "C:\OpenSSL-v11-Win64"
}
else {
$OPENSSL_DIR = "C:\OpenSSL-v11-Win32"
}


# CACHE GENERATION
cmake -G "NMake Makefiles" `
-D FLB_TESTS_INTERNAL=On `
-D OPENSSL_ROOT_DIR=$OPENSSL_DIR `
-D FLB_WITHOUT_flb-rt-out_elasticsearch=On `
-D FLB_WITHOUT_flb-rt-out_td=On `
-D FLB_WITHOUT_flb-rt-out_forward=On `
Expand Down
2 changes: 1 addition & 1 deletion cmake/libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(FLB_PATH_LIB_RBTREE "lib/rbtree")
set(FLB_PATH_LIB_MSGPACK "lib/msgpack-c")
set(FLB_PATH_LIB_AVRO "lib/avro")
set(FLB_PATH_LIB_CHUNKIO "lib/chunkio")
set(FLB_PATH_LIB_LUAJIT "lib/luajit-2.1.0-dd5032e")
set(FLB_PATH_LIB_LUAJIT "lib/luajit-2.1.0-1e66d0f")
set(FLB_PATH_LIB_MONKEY "lib/monkey")
set(FLB_PATH_LIB_JSMN "lib/jsmn")
set(FLB_PATH_LIB_MBEDTLS "lib/mbedtls-2.24.0")
Expand Down
1 change: 1 addition & 0 deletions cmake/windows-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ set(FLB_FILTER_NEST Yes)
set(FLB_FILTER_LUA Yes)
set(FLB_FILTER_RECORD_MODIFIER Yes)
set(FLB_FILTER_REWRITE_TAG Yes)
set(FLB_FILTER_GEOIP2 Yes)

# Search bison and flex executables
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
Expand Down
4 changes: 0 additions & 4 deletions include/fluent-bit/flb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@

#include <monkey/mk_core.h>

#ifdef FLB_HAVE_TLS
#include <fluent-bit/flb_io_tls.h>
#endif

#define FLB_CONFIG_FLUSH_SECS 5
#define FLB_CONFIG_HTTP_LISTEN "0.0.0.0"
#define FLB_CONFIG_HTTP_PORT "2020"
Expand Down
122 changes: 122 additions & 0 deletions include/fluent-bit/flb_coro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* Fluent Bit
* ==========
* Copyright (C) 2019-2020 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef FLB_CORO_H
#define FLB_CORO_H

/* Required by OSX */
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif

#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_macros.h>
#include <fluent-bit/flb_log.h>
#include <fluent-bit/flb_mem.h>

#include <monkey/mk_core.h>

#include <stdlib.h>
#include <limits.h>
#include <libco.h>

#ifdef FLB_HAVE_VALGRIND
#include <valgrind/valgrind.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

struct flb_coro {

#ifdef FLB_HAVE_VALGRIND
unsigned int valgrind_stack_id;
#endif

/* libco 'contexts' */
cothread_t caller;
cothread_t callee;

void *data;
};

#ifdef FLB_CORO_STACK_SIZE
#define FLB_CORO_STACK_SIZE FLB_CORO_STACK_SIZE
#else
#define FLB_CORO_STACK_SIZE ((3 * PTHREAD_STACK_MIN) / 2)
#endif

#define FLB_CORO_DATA(coro) (((char *) coro) + sizeof(struct flb_coro))

static FLB_INLINE void flb_coro_yield(struct flb_coro *coro, int ended)
{
co_switch(coro->caller);
}

static FLB_INLINE void flb_coro_destroy(struct flb_coro *coro)
{
flb_trace("[coro] destroy coroutine=%p data=%p", coro,
FLB_CORO_DATA(coro));

#ifdef FLB_HAVE_VALGRIND
VALGRIND_STACK_DEREGISTER(coro->valgrind_stack_id);
#endif

co_delete(coro->callee);
flb_free(coro);
}

#define flb_coro_return(th) co_switch(th->caller)

void flb_coro_init();
struct flb_coro *flb_coro_get();
void flb_coro_set(struct flb_coro *coro);

static FLB_INLINE void flb_coro_resume(struct flb_coro *coro)
{
flb_coro_set(coro);
coro->caller = co_active();
co_switch(coro->callee);
}

static FLB_INLINE struct flb_coro *flb_coro_create(void *data)
{
struct flb_coro *coro;

/* Create a thread context and initialize */
coro = (struct flb_coro *) flb_calloc(1, sizeof(struct flb_coro));
if (!coro) {
flb_errno();
return NULL;
}
coro->data = data;
return coro;
}

#ifdef __cplusplus
}
#endif

#endif /* !FLB_CORO_H */
7 changes: 7 additions & 0 deletions include/fluent-bit/flb_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <fluent-bit/flb_config.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_output.h>
#include <fluent-bit/flb_thread_storage.h>

/* Types of events handled by the Server engine */
#define FLB_ENGINE_EV_CORE MK_EVENT_NOTIFICATION
Expand All @@ -34,6 +35,7 @@
#define FLB_ENGINE_EV_SCHED 2048
#define FLB_ENGINE_EV_SCHED_FRAME (FLB_ENGINE_EV_SCHED + 4096)
#define FLB_ENGINE_EV_OUTPUT 8192
#define FLB_ENGINE_EV_THREAD_OUTPUT 16384

/* Engine events: all engine events set the left 32 bits to '1' */
#define FLB_ENGINE_EV_STARTED FLB_BITS_U64_SET(1, 1) /* Engine started */
Expand All @@ -60,4 +62,9 @@ int flb_engine_exit_status(struct flb_config *config, int status);
int flb_engine_shutdown(struct flb_config *config);
int flb_engine_destroy_tasks(struct mk_list *tasks);

/* Engine event loop */
void flb_engine_evl_init();
struct mk_event_loop *flb_engine_evl_get();
void flb_engine_evl_set(struct mk_event_loop *evl);

#endif
2 changes: 1 addition & 1 deletion include/fluent-bit/flb_fstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct flb_fstore_file {
size_t meta_size; /* metadata size */
void *data; /* opaque data type for user/caller context */
struct cio_chunk *chunk; /* chunk context */
struct cio_chunk *stream; /* parent stream that owns this file */
struct cio_stream *stream; /* parent stream that owns this file */
struct mk_list _head; /* link to parent flb_fstore->files */
};

Expand Down
32 changes: 8 additions & 24 deletions include/fluent-bit/flb_thread.h → include/fluent-bit/flb_help.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,16 @@
* limitations under the License.
*/

#ifndef FLB_THREAD_H
#define FLB_THREAD_H

/* Required by OSX */
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif

#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
#ifndef FLB_HELP_H
#define FLB_HELP_H

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_macros.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_filter.h>
#include <fluent-bit/flb_output.h>

#ifdef __cplusplus
extern "C" {
#endif

extern FLB_EXPORT pthread_key_t flb_thread_key;
int flb_help_input(struct flb_input_instance *ins, void **out_buf, size_t *out_size);
int flb_help_filter(struct flb_filter_instance *ins, void **out_buf, size_t *out_size);
int flb_help_output(struct flb_output_instance *ins, void **out_buf, size_t *out_size);

/* Use 'libco' backend for co-routines handling */
#include <fluent-bit/flb_thread_libco.h>

#ifdef __cplusplus
}
#endif

#endif /* !FLB_THREAD_H */
3 changes: 3 additions & 0 deletions include/fluent-bit/flb_http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ struct flb_http_client {
void *cb_ctx;
};

void flb_http_client_debug(struct flb_http_client *c,
struct flb_callback *cb_ctx);

struct flb_http_client *flb_http_client(struct flb_upstream_conn *u_conn,
int method, const char *uri,
const char *body, size_t body_len,
Expand Down
Loading