Commit Graph

5357 Commits

Author SHA1 Message Date
Dragan Dosen
17def46e10 BUG/MEDIUM: logs: fix time zone offset format in RFC5424
The time zone offset format used in function update_log_hdr_rfc5424() was
missing ":" as a separator.
2015-10-10 00:07:03 +02:00
Christopher Faulet
85b5a1a781 MINOR: ssl: Add callbacks to set DH/ECDH params for generated certificates
Now, A callback is defined for generated certificates to set DH parameters for
ephemeral key exchange when required.
In same way, when possible, we also defined Elliptic Curve DH (ECDH) parameters.
2015-10-09 12:13:17 +02:00
Christopher Faulet
7969a33a01 MINOR: ssl: Add support for EC for the CA used to sign generated certificates
This is done by adding EVP_PKEY_EC type in supported types for the CA private
key when we get the message digest used to sign a generated X509 certificate.
So now, we support DSA, RSA and EC private keys.

And to be sure, when the type of the private key is not directly supported, we
get its default message digest using the function
'EVP_PKEY_get_default_digest_nid'.

We also use the key of the default certificate instead of generated it. So we
are sure to use the same key type instead of always using a RSA key.
2015-10-09 12:13:12 +02:00
Christopher Faulet
c6f02fb929 MINOR: ssl: Read the file used to generate certificates in any order
the file specified by the SSL option 'ca-sign-file' can now contain the CA
certificate used to dynamically generate certificates and its private key in any
order.
2015-10-09 12:13:08 +02:00
Willy Tarreau
a84c267522 BUILD: ssl: fix build error introduced by recent commit
Commit d2cab92 ("BUG/MINOR: ssl: fix management of the cache where forged
certificates are stored") removed some needed #ifdefs resulting in ssl not
building on older openssl versions where SSL_CTRL_SET_TLSEXT_HOSTNAME is
not defined :

src/ssl_sock.c: In function 'ssl_sock_load_ca':
src/ssl_sock.c:2504: error: 'ssl_ctx_lru_tree' undeclared (first use in this function)
src/ssl_sock.c:2504: error: (Each undeclared identifier is reported only once
src/ssl_sock.c:2504: error: for each function it appears in.)
src/ssl_sock.c:2505: error: 'ssl_ctx_lru_seed' undeclared (first use in this function)
src/ssl_sock.c: In function 'ssl_sock_close':
src/ssl_sock.c:3095: error: 'ssl_ctx_lru_tree' undeclared (first use in this function)
src/ssl_sock.c: In function '__ssl_sock_deinit':
src/ssl_sock.c:5367: error: 'ssl_ctx_lru_tree' undeclared (first use in this function)
make: *** [src/ssl_sock.o] Error 1

Reintroduce the ifdefs around the faulty areas.
2015-10-09 12:13:07 +02:00
Christopher Faulet
77fe80c0b4 MINOR: ssl: Release Servers SSL context when HAProxy is shut down
[wt: could be backported to 1.5 as well]
2015-10-09 10:33:00 +02:00
Christopher Faulet
d2cab92e75 BUG/MINOR: ssl: fix management of the cache where forged certificates are stored
First, the LRU cache must be initialized after the configuration parsing to
correctly set its size.
Next, the function 'ssl_sock_set_generated_cert' returns -1 when an error occurs
(0 if success). In that case, the caller is responsible to free the memory
allocated for the certificate.
Finally, when a SSL certificate is generated by HAProxy but cannot be inserted
in the cache, it must be freed when the SSL connection is closed. This happens
when 'tune.ssl.ssl-ctx-cache-size' is set to 0.
2015-10-09 10:20:53 +02:00
Christopher Faulet
d57ad64873 BUG/MINOR: http: Add OPTIONS in supported http methods (found by find_http_meth)
The 'OPTIONS' method was not in the list of supported HTTP methods and
find_http_meth return HTTP_METH_OTHER instead of HTTP_METH_OPTIONS.

[wt: this fix needs to be backported at least to 1.5, 1.4 and 1.3]
2015-10-09 10:18:09 +02:00
Christopher Faulet
3c3a035be0 MINOR: lru: do not allocate useless memory in lru64_lookup
lru64_lookup function was added in a previous patch of mine. This one
just remove a useless memory allocation.
2015-10-09 10:13:18 +02:00
Joseph Lynch
ffaf30b689 BUILD: Fix the build on OSX (htonll/ntohll)
htonll and ntohll were defined in 5b4dd683cb but on osx they are already
defined in sys/_endian.h. So, we check if they are defined before
declaring them.

[wt: no backport needed]
2015-10-09 10:11:59 +02:00
Willy Tarreau
067ac9f4b6 MINOR: debug: enable memory poisonning to use byte 0
When debugging an issue, sometimes it can be useful to be able to use
byte 0 to poison memory areas, resulting in the same effect as a calloc().
This patch changes the default mem_poison_byte to -1 to disable it so that
all positive values are usable.
2015-10-08 14:12:13 +02:00
Willy Tarreau
a088d316b7 MEDIUM: init: support a list of files on the command line
HAProxy could already support being passed a file list on the command
line, by passing multiple times "-f" followed by a file name. People
have been complaining that it made it hard to pass file lists from init
scripts.

This patch introduces an end of arguments using the common "--" tag,
after which only file names may appear. These files are then added to
the existing list of other files specified using -f and are loaded in
their declaration order. Thus it becomes possible to do something like
this :

    haproxy -sf $(pidof haproxy) -- /etc/haproxy/global.cfg /etc/haproxy/customers/*.cfg
2015-10-08 11:58:48 +02:00
Willy Tarreau
c6ca1aa34d MEDIUM: init: support more command line arguments after pid list
Given that all command line arguments start with a '-' and that
no pid number can start with this character, there's no constraint
to make the pid list the last argument. Let's relax this rule.
2015-10-08 11:32:32 +02:00
Willy Tarreau
0078bfcb43 BUG/MEDIUM: lua: force server-close mode on Lua services
Thierry reported that keep-alive still didn't cope well with Lua
services. The reason is that for now applets have to be closed at
the end of a transaction so we want to work in server-close mode,
which isn't noticeable by the client since it still sees keep-alive.
Additionally we want to enable the request body transfer analyser
which will be needed to synchronize with the response analyser to
indicate the end of the transfer.
2015-10-07 20:24:05 +02:00
Willy Tarreau
6457d0fac3 CLEANUP: cli: ensure we can never double-free error messages
The release handler used to be called twice for some time and just by
pure luck we never ended up double-freeing the data there. Add a NULL
to ensure this can never happen should a future change permit this
situation again.
2015-10-07 20:00:24 +02:00
Willy Tarreau
8c1ad716df [RELEASE] Released version 1.6-dev7
Released version 1.6-dev7 with the following main changes :
    - MINOR: cli: Dump all resolvers stats if no resolver section is given
    - BUG: config: external-check command validation is checking for incorrect arguments.
    - DOC: documentation format cleanups
    - DOC: lua: few typos.
    - BUG/MEDIUM: str2ip: make getaddrinfo() consider local address selection policy
    - BUG/MEDIUM: logs: segfault writing to log from Lua
    - DOC: fix lua use-service example
    - MINOR: payload: add support for tls session ticket ext
    - MINOR: lua: remove the run flag
    - MEDIUM: lua: change the timeout execution
    - MINOR: lua: rename the tune.lua.applet-timeout
    - DOC: lua: update Lua doc
    - DOC: lua: update doc according with the last Lua changes
    - MINOR: http/tcp: fill the avalaible actions
    - DOC: reorder misplaced res.ssl_hello_type in the doc
    - BUG/MINOR: tcp: make silent-drop always force a TCP reset
    - CLEANUP: tcp: silent-drop: only drain the connection when quick-ack is disabled
    - BUILD: tcp: use IPPROTO_IP when SOL_IP is not available
    - BUILD: server: fix build warnings introduced by load-server-state
    - BUG/MEDIUM: server: fix misuse of format string in load-server-state's warnings
2015-10-06 12:13:56 +02:00
Andrew Hayworth
68d0534885 MINOR: cli: Dump all resolvers stats if no resolver section is given
This commit adds support for dumping all resolver stats. Specifically
if a command 'show stats resolvers' is issued withOUT a resolver section
id, we dump all known resolver sections. If none are configured, a
message is displayed indicating that.
2015-10-06 07:08:09 +02:00
Ben Cabot
49795eb00c BUG: config: external-check command validation is checking for incorrect arguments.
When using the external-check command option HAProxy was failing to
start with a fatal error "'external-check' cannot handle unexpected
argument". When looking at the code it was looking for an incorrect
argument. Also correcting an Alert message text as spotted by by
PiBa-NL.
2015-10-02 23:11:49 +02:00
David Carlier
61fdf8baa4 DOC: lua: few typos. 2015-10-02 23:06:42 +02:00
Thierry FOURNIER
ab95e656ea MINOR: http/tcp: fill the avalaible actions
This patch adds a function that generates the list of avalaible actions
for the error message.
2015-10-02 22:56:11 +02:00
Thierry FOURNIER
a2d02253cf DOC: lua: update doc according with the last Lua changes
The impact of the register_action() was not repported.
2015-10-02 22:56:11 +02:00
Thierry FOURNIER
7dd784b525 DOC: lua: update Lua doc
- Removes the Lua action reference
 - Update the tune.lu.service-timeout
2015-10-02 22:56:10 +02:00
Thierry FOURNIER
56da1012d2 MINOR: lua: rename the tune.lua.applet-timeout
The name of applet is "service", so this patch renames the
tune.lua.applet-timeout to tune.lua.service-timeout
2015-10-02 22:56:10 +02:00
Dmitry Sivachenko
eab7f3996f BUG/MEDIUM: str2ip: make getaddrinfo() consider local address selection policy
When first parameter to getaddrinfo() is not NULL (it is always not NULL
in str2ip()), on Linux AI_PASSIVE value for ai_flags is ignored. On
FreeBSD, when AI_PASSIVE is specified and hostname parameter is not NULL,
getaddrinfo() ignores local address selection policy, always returning
AAAA record. Pass zero ai_flags to behave correctly on FreeBSD, this
change should be no-op for Linux.

This fix should be backported to 1.5 as well, after some observation
period.
2015-10-02 01:01:58 +02:00
Dragan Dosen
43885c728e BUG/MEDIUM: logs: segfault writing to log from Lua
Michael Ezzell reported a bug causing haproxy to segfault during startup
when trying to send syslog message from Lua. The function __send_log() can
be called with *p that is NULL and/or when the configuration is not fully
parsed, as is the case with Lua.

This patch fixes this problem by using individual vectors instead of the
pre-generated strings log_htp and log_htp_rfc5424.

Also, this patch fixes a problem causing haproxy to write the wrong pid in
the logs -- the log_htp(_rfc5424) strings were generated at the haproxy
start, but "pid" value would be changed after haproxy is started in
daemon/systemd mode.
2015-10-02 00:57:45 +02:00
Pieter Baauw
2dcb9bc5bf DOC: fix lua use-service example 2015-10-02 00:53:57 +02:00
Thierry FOURNIER
10770faf8e MEDIUM: lua: change the timeout execution
Now, the Lua timeout is relative to the effective run time.
When the Lua is waiting for I/O, this time is not took in
lua run time account.
2015-09-29 19:13:49 +02:00
Thierry FOURNIER
bee90aeda1 MINOR: lua: remove the run flag
Only the main execution function can set the run flag, because it is
the last function before the execution time.

This patch removes the flag set by another function. It will be used
by the new lua timeout counter.
2015-09-29 18:57:03 +02:00
Willy Tarreau
31138fae9f BUG/MEDIUM: server: fix misuse of format string in load-server-state's warnings
Commit e11cfcd ("MINOR: config: new backend directives:
load-server-state-from-file and server-state-file-name") introduced a bug
which can cause haproxy to crash upon startup by sending user-controlled
data in a format string when emitting a warning. Fix the way the warning
message is built to avoid this.

No backport is needed, this was introduced in 1.6-dev6 only.
2015-09-29 18:51:40 +02:00
Willy Tarreau
e1aebb2994 BUILD: server: fix build warnings introduced by load-server-state
Commit e11cfcd ("MINOR: config: new backend directives:
load-server-state-from-file and server-state-file-name") caused these
warnings when building with Clang :

src/server.c:1972:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                            (srv_uweight < 0) || (srv_uweight > SRV_UWGHT_MAX))
                             ~~~~~~~~~~~ ^ ~
src/server.c:1980:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                            (srv_iweight < 0) || (srv_iweight > SRV_UWGHT_MAX))
                             ~~~~~~~~~~~ ^ ~

Indeed, srv_iweight and srv_uweight are unsigned. Just drop the offending test.
2015-09-29 18:32:57 +02:00
Willy Tarreau
ae459f3b9f BUILD: tcp: use IPPROTO_IP when SOL_IP is not available
Dmitry Sivachenko reported a build failure on FreeBSD due to SOL_IP not
being defined. IPPROTO_IP must be used there instead.
2015-09-29 18:19:32 +02:00
Willy Tarreau
fc2a2d97d6 CLEANUP: tcp: silent-drop: only drain the connection when quick-ack is disabled
The conn_sock_drain() call is only there to force the system to ACK
pending data in case of TCP_QUICKACK so that the client doesn't retransmit,
otherwise it leads to a real RST making the feature useless. There's no
point in draining the connection when quick ack cannot be disabled, so
let's move the call inside the ifdef part.
2015-09-29 18:15:01 +02:00
Willy Tarreau
f50ec0fdbc BUG/MINOR: tcp: make silent-drop always force a TCP reset
The silent-drop action is supposed to close with a TCP reset that is
either not sent or not too far. But since it's on the client-facing
side, the socket's lingering is enabled by default and the RST only
occurs if some pending unread data remain in the queue when closing.
This causes some clean shutdowns to occur with retransmits, which is
not good at all. Force linger_risk on the socket to flush all data
and destroy the socket.

No backport is needed, this was introduced in 1.6-dev6.
2015-09-29 18:11:32 +02:00
Willy Tarreau
971f7b6bb4 DOC: reorder misplaced res.ssl_hello_type in the doc
Entries are supposed to be in alphabetical order.
2015-09-29 14:07:32 +02:00
Pradeep Jindal
bb2acf589f MINOR: payload: add support for tls session ticket ext
req.ssl_st_ext : integer
  Returns 0 if the client didn't send a SessionTicket TLS Extension (RFC5077)
  Returns 1 if the client sent SessionTicket TLS Extension
  Returns 2 if the client also sent non-zero length TLS SessionTicket
2015-09-29 14:07:32 +02:00
Cyril Bont
307ee1e01b DOC: documentation format cleanups
Chapter "Mailers" was missing from the summary, tabulations were used and
several lines exceeded 80 columns : some lines still exceeds the 80 columns
limit but are left as is, as it mostly concerns syntax and configuration
examples.
2015-09-29 00:34:36 +02:00
Willy Tarreau
e7ae656cf7 [RELEASE] Released version 1.6-dev6
Released version 1.6-dev6 with the following main changes :
    - BUG/MAJOR: can't enable a server through the stat socket
    - MINOR: server: Macro definition for server-state
    - MINOR: cli: new stats socket command: show servers state
    - DOC: stats socket command: show servers state
    - MINOR: config: new global directive server-state-base
    - DOC: global directive server-state-base
    - MINOR: config: new global section directive: server-state-file
    - DOC: new global directive: server-state-file
    - MINOR: config: new backend directives: load-server-state-from-file and server-state-file-name
    - DOC: load-server-state-from-file
    - MINOR: init: server state loaded from file
    - MINOR: server: startup slowstart task when using seamless reload of HAProxy
    - MINOR: cli: new stats socket command: show backend
    - DOC: servers state seamless reload example
    - BUG: dns: can't connect UDP socket on FreeBSD
    - MINOR: cfgparse: New function cfg_unregister_sections()
    - MINOR: chunk: New function free_trash_buffers()
    - BUG/MEDIUM: main: Freeing a bunch of static pointers
    - MINOR: proto_http: Externalisation of previously internal functions
    - MINOR: global: Few new struct fields for da module
    - MAJOR: da: Update of the DeviceAtlas API module
    - DOC: DeviceAtlas new keywords
    - DOC: README: DeviceAtlas sample configuration updates
    - MEDIUM: log: replace sendto() with sendmsg() in __send_log()
    - MEDIUM: log: use a separate buffer for the header and for the message
    - MEDIUM: logs: remove the hostname, tag and pid part from the logheader
    - MEDIUM: logs: add support for RFC5424 header format per logger
    - MEDIUM: logs: add a new RFC5424 log-format for the structured-data
    - DOC: mention support for the RFC5424 syslog message format
    - MEDIUM: logs: have global.log_send_hostname not contain the trailing space
    - MEDIUM: logs: pass the trailing "\n" as an iovec
    - BUG/MEDIUM: peers: some table updates are randomly not pushed.
    - BUG/MEDIUM: peers: same table updates re-pushed after a re-connect
    - BUG/MINOR: fct peer_prepare_ackmsg should not use trash.
    - MINOR: http: made CHECK_HTTP_MESSAGE_FIRST accessible to other functions
    - MINOR: global: Added new fields for 51Degrees device detection
    - DOC: Added more explanation for 51Degrees V3.2
    - BUILD: Changed 51Degrees option to support V3.2
    - MAJOR: 51d: Upgraded to support 51Degrees V3.2 and new features
    - MINOR: 51d: Improved string handling for LRU cache
    - DOC: add references to rise/fall for the fastinter explanation
    - MINOR: support cpu-map feature through the compile option USE_CPU_AFFINITY on FreeBSD
    - BUG/MAJOR: lua: potential unexpected aborts()
    - BUG/MINOR: lua: breaks the log message if his size exceed one buffer
    - MINOR: action: add private configuration
    - MINOR: action: add reference to the original keywork matched for the called parser.
    - MINOR: lua: change actions registration
    - MEDIUM: proto_http: smp_prefetch_http initialize txn
    - MINOR: channel: rename function chn_sess to chn_strm
    - CLEANUP: lua: align defines
    - MINOR: http: export http_get_path() function
    - MINOR: http: export the get_reason() function
    - MINOR: http: export function http_msg_analyzer()
    - MINOR: http: split initialization
    - MINOR: lua: reset pointer after use
    - MINOR: lua: identify userdata objects
    - MEDIUM: lua: use the function lua_rawset in place of lua_settable
    - BUG/MAJOR: lua: segfault after the channel data is modified by some Lua action.
    - CLEANUP: lua: use calloc in place of malloc
    - BUG/MEDIUM: lua: longjmp function must be unregistered
    - BUG/MEDIUM: lua: forces a garbage collection
    - BUG/MEDIUM: lua: wakeup task on bad conditions
    - MINOR: standard: avoid DNS resolution from the function str2sa_range()
    - MINOR: lua: extend socket address to support non-IP families
    - MINOR: lua/applet: the cosocket applet should use appctx_wakeup in place of task_wakeup
    - BUG/MEDIUM: lua: socket destroy before reading pending data
    - MEDIUM: lua: change the GC policy
    - OPTIM/MEDIUM: lua: executes the garbage collector only when using cosocket
    - BUG/MEDIUM: lua: don't reset undesired flags in hlua_ctx_resume
    - MINOR: applet: add init function
    - MINOR: applet: add an execution timeout
    - MINOR: stream/applet: add use-service action
    - MINOR: lua: add AppletTCP class and service
    - MINOR: lua: add AppletHTTP class and service
    - DOC: lua: some documentation update
    - DOC: add the documentation about internal circular lists
    - DOC: add a CONTRIBUTING file
    - DOC: add a MAINTAINERS file
    - BUG/MAJOR: peers: fix a crash when stopping peers on unbound processes
    - DOC: update coding-style to reference checkpatch.pl
    - BUG/MEDIUM: stick-tables: fix double-decrement of tracked entries
    - BUG/MINOR: args: add name for ARGT_VAR
    - DOC: add more entries to MAINTAINERS
    - DOC: add more entries to MAINTAINERS
    - CLEANUP: stream-int: remove obsolete function si_applet_call()
    - BUG/MAJOR: cli: do not dereference strm_li()->proto->name
    - BUG/MEDIUM: http: do not dereference strm_li(stream)
    - BUG/MEDIUM: proxy: do not dereference strm_li(stream)
    - BUG/MEDIUM: stream: do not dereference strm_li(stream)
    - MINOR: stream-int: use si_release_endpoint() to close idle conns
    - BUG/MEDIUM: payload: make req.payload and payload_lv aware of dynamic buffers
    - BUG/MEDIUM: acl: always accept match "found"
    - MINOR: applet: rename applet_runq to applet_active_queue
    - BUG/MAJOR: applet: use a separate run queue to maintain list integrity
    - MEDIUM: stream-int: split stream_int_update_conn() into si- and conn-specific parts
    - MINOR: stream-int: implement a new stream_int_update() function
    - MEDIUM: stream-int: factor out the stream update functions
    - MEDIUM: stream-int: call stream_int_update() from si_update()
    - MINOR: stream-int: export stream_int_update_*
    - MINOR: stream-int: move the applet_pause call out of the stream updates
    - MEDIUM: stream-int: clean up the conditions to enable reading in si_conn_wake_cb
    - MINOR: stream-int: implement the stream_int_notify() function
    - MEDIUM: stream-int: use the same stream notification function for applets and conns
    - MEDIUM: stream-int: completely remove stream_int_update_embedded()
    - MINOR: stream-int: rename si_applet_done() to si_applet_wake_cb()
    - BUG/MEDIUM: applet: fix reporting of broken write situation
    - BUG/MINOR: stats: do not call cli_release_handler 3 times
    - BUG/MEDIUM: cli: properly handle closed output
    - MINOR: cli: do not call the release handler on internal error.
    - BUG/MEDIUM: stream-int: avoid double-call to applet->release
    - DEBUG: add p_malloc() to return a poisonned memory area
    - CLEANUP: lua: remove unneeded memset(0) after calloc()
    - MINOR: lua: use the proper applet wakeup mechanism
    - BUG/MEDIUM: lua: better fix for the protocol check
    - BUG/MEDIUM: lua: properly set the target on the connection
    - MEDIUM: actions: pass a new "flags" argument to custom actions
    - MEDIUM: actions: add new flag ACT_FLAG_FINAL to notify about last call
    - MEDIUM: http: pass ACT_FLAG_FINAL to custom actions
    - MEDIUM: lua: only allow actions to yield if not in a final call
    - DOC: clarify how to make use of abstract sockets in socat
    - CLEANUP: config: make the errorloc/errorfile messages less confusing
    - MEDIUM: action: add a new flag ACT_FLAG_FIRST
    - BUG/MINOR: config: check that tune.bufsize is always positive
    - MEDIUM: config: set tune.maxrewrite to 1024 by default
    - DOC: add David Carlier as maintainer of da.c
    - DOC: fix some broken unexpected unicode chars in the Lua doc.
    - BUG/MEDIUM: proxy: ignore stopped peers
    - BUG/MEDIUM: proxy: do not wake stopped proxies' tasks during soft_stop()
    - MEDIUM: init: completely deallocate unused peers
    - BUG/MEDIUM: tcp: fix inverted condition to call custom actions
    - DOC: remove outdated actions lists on tcp-request/response
    - MEDIUM: tcp: add new tcp action "silent-drop"
    - DOC: add URLs to optional libraries in the README
2015-09-28 23:46:27 +02:00
Willy Tarreau
a8fc8a2529 DOC: add URLs to optional libraries in the README
It's nice to suggest people how to build with certain libraries but
it's nicer to tell them where to fetch them.
2015-09-28 22:36:21 +02:00
Willy Tarreau
2d392c2c2f MEDIUM: tcp: add new tcp action "silent-drop"
This stops the evaluation of the rules and makes the client-facing
connection suddenly disappear using a system-dependant way that tries
to prevent the client from being notified. The effect it then that the
client still sees an established connection while there's none on
HAProxy. The purpose is to achieve a comparable effect to "tarpit"
except that it doesn't use any local resource at all on the machine
running HAProxy. It can resist much higher loads than "tarpit", and
slow down stronger attackers. It is important to undestand the impact
of using this mechanism. All stateful equipments placed between the
client and HAProxy (firewalls, proxies, load balancers) will also keep
the established connection for a long time and may suffer from this
action. On modern Linux systems running with enough privileges, the
TCP_REPAIR socket option is used to block the emission of a TCP
reset. On other systems, the socket's TTL is reduced to 1 so that the
TCP reset doesn't pass the first router, though it's still delivered to
local networks.
2015-09-28 22:14:57 +02:00
Willy Tarreau
c870bfd0e9 DOC: remove outdated actions lists on tcp-request/response
The valid actions are enumerated in the text, and the small set listed
in the definition is not accurate.
2015-09-28 18:58:55 +02:00
Willy Tarreau
45059e9b98 BUG/MEDIUM: tcp: fix inverted condition to call custom actions
tcp-request connection had an inverted condition on action_ptr, resulting
in no registered actions to be usable since commit 4214873 ("MEDIUM: actions:
remove ACTION_STOP") merged in 1.6-dev5. Very few new actions were impacted.
No backport is needed.
2015-09-28 18:32:41 +02:00
Dragan Dosen
5b78d9b437 MEDIUM: logs: pass the trailing "\n" as an iovec
This patch passes the trailing "\n" as an iovec in the function
__send_log(), so that we don't need to modify the original log message.
2015-09-28 18:31:09 +02:00
Dragan Dosen
c8cfa7b4f3 MEDIUM: logs: have global.log_send_hostname not contain the trailing space
This patch unifies global.log_send_hostname addition in the log header
processing.
2015-09-28 18:27:45 +02:00
Dragan Dosen
7ad3154cb8 DOC: mention support for the RFC5424 syslog message format
Document the new log "format" argument and the "log-format-sd" statement.
2015-09-28 18:27:22 +02:00
Willy Tarreau
47c8c029db MEDIUM: init: completely deallocate unused peers
When peers are stopped due to not being running on the appropriate
process, we want to completely release them and unregister their signals
and task in order to ensure there's no way they may be called in the
future.

Note: ideally we should have a list of all tables attached to a peers
section being disabled in order to unregister them and void their
sync_task. It doesn't appear to be *that* easy for now.
2015-09-28 16:43:48 +02:00
Willy Tarreau
20b7afbc14 BUG/MEDIUM: proxy: do not wake stopped proxies' tasks during soft_stop()
When performing a soft stop, we used to wake up every proxy's task and
each of their table's task. The problem is that since we're able to stop
proxies and peers not bound to a specific process, we may end up calling
random junk by doing so of the proxy we're waking up is already stopped.
This causes a segfault to appear during soft reloads for old processes
not bound to a peers section if such a section exists in other processes.

Let's only consider proxies that are not stopped when doing this.

This fix must be backported to 1.5 which also has the same issue.
2015-09-28 16:35:04 +02:00
Willy Tarreau
337a666572 BUG/MEDIUM: proxy: ignore stopped peers
Since commit f83d3fe ("MEDIUM: init: stop any peers section not bound
to the correct process"), it is possible to stop unused peers on certain
processes. The problem is that the pause/resume/stop functions are not
aware of this and will pass a NULL proxy pointer to the respective
functions, resulting in segfaults in unbound processes during soft
restarts.

Properly check that the peers' frontend is still valid before calling
them.

This bug also affects 1.5 so the fix must be backported. Note that this
fix is not enough to completely get rid of the segfault, the next one
is needed as well.
2015-09-28 16:27:44 +02:00
Willy Tarreau
61add3c064 DOC: fix some broken unexpected unicode chars in the Lua doc.
A few chars didn't render properly in some terminals and had no
reason for being there.
2015-09-28 15:39:10 +02:00
Thierry FOURNIER
a3bc513a23 DOC: lua: some documentation update
this update embbeds some fix of existing function, and the applet documentation.
2015-09-28 15:23:57 +02:00
Willy Tarreau
e4b3127d61 DOC: add David Carlier as maintainer of da.c
David is willing to handle any issue related to da.c.
2015-09-28 14:01:27 +02:00