]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
10 years agoBUG/MAJOR: lru: fix unconditional call to free due to unexpected semi-colon
Willy Tarreau [Wed, 17 Jun 2015 17:53:03 +0000 (19:53 +0200)] 
BUG/MAJOR: lru: fix unconditional call to free due to unexpected semi-colon

Dmitry Sivachenko reported the following build warning using Clang, which
is a real bug :

  src/lru.c:133:32: warning: if statement has empty body [-Wempty-body]
                                  if (old->data && old->free);
                                                             ^
It results in calling old->free(old->data) even when old->free is NULL,
hence crashing on cached patterns.

The same bug appears a few lines below in lru64_destroy() :

  src/lru.c:195:33: warning: if statement has empty body [-Wempty-body]
                          if (elem->data && elem->free);
                                                       ^
Both were introduced in 1.6-dev2 with commit f90ac55 ("MINOR: lru: Add the
possibility to free data when an item is removed"), so no backport is needed.

10 years agoBUILD/MINOR: stats: fix build warning due to condition always true
Willy Tarreau [Wed, 17 Jun 2015 17:49:52 +0000 (19:49 +0200)] 
BUILD/MINOR: stats: fix build warning due to condition always true

Dmitry Sivachenko reported the following harmless build warning using Clang :

  src/dumpstats.c:5196:48: warning: address of array 'strm_li(sess)->proto->name'
        will always evaluate to 'true' [-Wpointer-bool-conversion]
    ...strm_li(sess) && strm_li(sess)->proto->name ? strm_li(sess)->proto->nam...
                     ~~ ~~~~~~~~~~~~~~~~~~~~~~^~~~
proto->name cannot be null here as it's the protocol name which is stored
directly in the structure.

The same case is present in 1.5 though the code changed.

10 years agoBUILD/MINOR: lua: fix a harmless build warning
Willy Tarreau [Wed, 17 Jun 2015 17:43:49 +0000 (19:43 +0200)] 
BUILD/MINOR: lua: fix a harmless build warning

Dmitry Sivachenko reported the following build warning using Clang,
though it's harmless :

  src/hlua.c:1911:13: warning: variable '_socket_info_expanded_form' is not needed
        and will not be emitted [-Wunneeded-internal-declaration]
  static char _socket_info_expanded_form[] = SOCKET_INFO_EXPANDED_FORM;
              ^
Indeed, the variable is not used except to compute a sizeof which is
taken from the string it is initialized from. It probably is a leftover
after various code refactorings. Let's get rid of it now since it's not
used anymore.

No backport is needed.

10 years agoBUG/MINOR: ssl: fix smp_fetch_ssl_fc_session_id
Willy Tarreau [Wed, 17 Jun 2015 16:34:14 +0000 (18:34 +0200)] 
BUG/MINOR: ssl: fix smp_fetch_ssl_fc_session_id

Dmitry Sivachenko reported the following build warning using Clang
which is a real bug :

src/ssl_sock.c:4104:44: warning: address of 'smp->data.str.len' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
        if (!smp->data.str.str || !&smp->data.str.len)

The impact is very low however, it will return an empty session_id
instead of no session id when none is found.

The fix should be backported to 1.5.

10 years ago[RELEASE] Released version 1.6-dev2 v1.6-dev2
Willy Tarreau [Wed, 17 Jun 2015 13:53:25 +0000 (15:53 +0200)] 
[RELEASE] Released version 1.6-dev2

Released version 1.6-dev2 with the following main changes :
    - BUG/MINOR: ssl: Display correct filename in error message
    - MEDIUM: logs: Add HTTP request-line log format directives
    - BUG/MEDIUM: check: tcpcheck regression introduced by e16c1b3f
    - BUG/MINOR: check: fix tcpcheck error message
    - MINOR: use an int instead of calling tcpcheck_get_step_id
    - MINOR: tcpcheck_rule structure update
    - MINOR: include comment in tcpcheck error log
    - DOC: tcpcheck comment documentation
    - MEDIUM: server: add support for changing a server's address
    - MEDIUM: server: change server ip address from stats socket
    - MEDIUM: protocol: add minimalist UDP protocol client
    - MEDIUM: dns: implement a DNS resolver
    - MAJOR: server: add DNS-based server name resolution
    - DOC: server name resolution + proto DNS
    - MINOR: dns: add DNS statistics
    - MEDIUM: http: configurable http result codes for http-request deny
    - BUILD: Compile clean when debug options defined
    - MINOR: lru: Add the possibility to free data when an item is removed
    - MINOR: lru: Add lru64_lookup function
    - MEDIUM: ssl: Add options to forge SSL certificates
    - MINOR: ssl: Export functions to manipulate generated certificates
    - MEDIUM: config: add DeviceAtlas global keywords
    - MEDIUM: global: add the DeviceAtlas required elements to struct global
    - MEDIUM: sample: add the da-csv converter
    - MEDIUM: init: DeviceAtlas initialization
    - BUILD: Makefile: add options to build with DeviceAtlas
    - DOC: README: explain how to build with DeviceAtlas
    - BUG/MEDIUM: http: fix the url_param fetch
    - BUG/MEDIUM: init: segfault if global._51d_property_names is not initialized
    - MAJOR: peers: peers protocol version 2.0
    - MINOR: peers: avoid re-scheduling of pending stick-table's updates still not pushed.
    - MEDIUM: peers: re-schedule stick-table's entry for sync when data is modified.
    - MEDIUM: peers: support of any stick-table data-types for sync
    - BUG/MAJOR: sample: regression on sample cast to stick table types.
    - CLEANUP: deinit: remove codes for cleaning p->block_rules
    - DOC: Fix L4TOUT typo in documentation
    - DOC: set-log-level in Logging section preamble
    - BUG/MEDIUM: compat: fix segfault on FreeBSD
    - MEDIUM: check: include server address and port in the send-state header
    - MEDIUM: backend: Allow redispatch on retry intervals
    - MINOR: Add TLS ticket keys reference and use it in the listener struct
    - MEDIUM: Add support for updating TLS ticket keys via socket
    - DOC: Document new socket commands "show tls-keys" and "set ssl tls-key"
    - MINOR: Add sample fetch which identifies if the SSL session has been resumed
    - DOC: Update doc about weight, act and bck fields in the statistics
    - BUG/MEDIUM: ssl: fix tune.ssl.default-dh-param value being overwritten
    - MINOR: ssl: add a destructor to free allocated SSL ressources
    - MEDIUM: ssl: add the possibility to use a global DH parameters file
    - MEDIUM: ssl: replace standards DH groups with custom ones
    - MEDIUM: stats: Add enum srv_stats_state
    - MEDIUM: stats: Separate server state and colour in stats
    - MEDIUM: stats: Only report drain state in stats if server has SRV_ADMF_DRAIN set
    - MEDIUM: stats: Differentiate between DRAIN and DRAIN (agent)
    - MEDIUM: Lower priority of email alerts for log-health-checks messages
    - MEDIUM: Send email alerts when servers are marked as UP or enter the drain state
    - MEDIUM: Document when email-alerts are sent
    - BUG/MEDIUM: lua: bad argument number in analyser and in error message
    - MEDIUM: lua: automatically converts strings in proxy, tables, server and ip
    - BUG/MINOR: utf8: remove compilator warning
    - MEDIUM: map: uses HAProxy facilities to store default value
    - BUG/MINOR: lua: error in detection of mandatory arguments
    - BUG/MINOR: lua: set current proxy as default value if it is possible
    - BUG/MEDIUM: http: the action set-{method|path|query|uri} doesn't run.
    - BUG/MEDIUM: lua: undetected infinite loop
    - BUG/MAJOR: http: don't read past buffer's end in http_replace_value
    - BUG/MEDIUM: http: the function "(req|res)-replace-value" doesn't respect the HTTP syntax
    - MEDIUM/CLEANUP: http: rewrite and lighten http_transform_header() prototype
    - BUILD: lua: it miss the '-ldl' directive
    - MEDIUM: http: allows 'R' and 'S' in the protocol alphabet
    - MINOR: http: split the function http_action_set_req_line() in two parts
    - MINOR: http: split http_transform_header() function in two parts.
    - MINOR: http: export function inet_set_tos()
    - MINOR: lua: txn: add function set_(loglevel|tos|mark)
    - MINOR: lua: create and register HTTP class
    - DOC: lua: fix some typos
    - MINOR: lua: add log functions
    - BUG/MINOR: lua: Fix SSL initialisation
    - DOC: lua: some fixes
    - MINOR: lua: (req|res)_get_headers return more than one header value
    - MINOR: lua: map system integration in Lua
    - BUG/MEDIUM: http: functions set-{path,query,method,uri} breaks the HTTP parser
    - MINOR: sample: add url_dec converter
    - MEDIUM: sample: fill the struct sample with the session, proxy and stream pointers
    - MEDIUM: sample change the prototype of sample-fetches and converters functions
    - MINOR: sample: fill the struct sample with the options.
    - MEDIUM: sample: change the prototype of sample-fetches functions
    - MINOR: http: split the url_param in two parts
    - CLEANUP: http: bad indentation
    - MINOR: http: add body_param fetch
    - MEDIUM: http: url-encoded parsing function can run throught wrapped buffer
    - DOC: http: req.body_param documentation
    - MINOR: proxy: custom capture declaration
    - MINOR: capture: add two "capture" converters
    - MEDIUM: capture: Allow capture with slot identifier
    - MINOR: http: add array of generic pointers in http_res_rules
    - MEDIUM: capture: adds http-response capture
    - MINOR: common: escape CSV strings
    - MEDIUM: stats: escape some strings in the CSV dump
    - MINOR: tcp: add custom actions that can continue tcp-(request|response) processing
    - MINOR: lua: Lua tcp action are not final action
    - DOC: lua: schematics about lua socket organization
    - BUG/MINOR: debug: display (null) in place of "meth"
    - DOC: mention the "lua action" in documentation
    - MINOR: standard: add function that converts signed int to a string
    - BUG/MINOR: sample: wrong conversion of signed values
    - MEDIUM: sample: Add type any
    - MINOR: debug: add a special converter which display its input sample content.
    - MINOR: tcp: increase the opaque data array
    - MINOR: tcp/http/conf: extends the keyword registration options
    - MINOR: build: fix build dependency
    - MEDIUM: vars: adds support of variables
    - MINOR: vars: adds get and set functions
    - MINOR: lua: Variable access
    - MINOR: samples: add samples which returns constants
    - BUG/MINOR: vars/compil: fix some warnings
    - BUILD: add 51degrees options to makefile.
    - MINOR: global: add several 51Degrees members to global
    - MINOR: config: add 51Degrees config parsing.
    - MINOR: init: add 51Degrees initialisation code
    - MEDIUM: sample: add fiftyone_degrees converter.
    - MEDIUM: deinit: add cleanup for 51Degrees to deinit
    - MEDIUM: sample: add trie support to 51Degrees
    - DOC: add 51Degrees notes to configuration.txt.
    - DOC: add build indications for 51Degrees to README.
    - MEDIUM: cfgparse: introduce weak and strong quoting
    - BUG/MEDIUM: cfgparse: incorrect memmove in quotes management
    - MINOR: cfgparse: remove line size limitation
    - MEDIUM: cfgparse: expand environment variables
    - BUG/MINOR: cfgparse: fix typo in 'option httplog' error message
    - BUG/MEDIUM: cfgparse: segfault when userlist is misused
    - CLEANUP: cfgparse: remove reference to 'ruleset' section
    - MEDIUM: cfgparse: check section maximum number of arguments
    - MEDIUM: cfgparse: max arguments check in the global section
    - MEDIUM: cfgparse: check max arguments in the proxies sections
    - CLEANUP: stream-int: remove a redundant clearing of the linger_risk flag
    - MINOR: connection: make conn_sock_shutw() actually perform the shutdown() call
    - MINOR: stream-int: use conn_sock_shutw() to shutdown a connection
    - MINOR: connection: perform the call to xprt->shutw() in conn_data_shutw()
    - MEDIUM: stream-int: replace xprt->shutw calls with conn_data_shutw()
    - MINOR: checks: use conn_data_shutw_hard() instead of call via xprt
    - MINOR: connection: implement conn_sock_send()
    - MEDIUM: stream-int: make conn_si_send_proxy() use conn_sock_send()
    - MEDIUM: connection: make conn_drain() perform more controls
    - REORG: connection: move conn_drain() to connection.c and rename it
    - CLEANUP: stream-int: remove inclusion of fd.h that is not used anymore
    - MEDIUM: channel: don't always set CF_WAKE_WRITE on bi_put*
    - CLEANUP: lua: don't use si_ic/si_oc on known stream-ints
    - BUG/MEDIUM: peers: correctly configure the client timeout
    - MINOR: peers: centralize configuration of the peers frontend
    - MINOR: proxy: store the default target into the frontend's configuration
    - MEDIUM: stats: use frontend_accept() as the accept function
    - MEDIUM: peers: use frontend_accept() instead of peer_accept()
    - CLEANUP: listeners: remove unused timeout
    - MEDIUM: listener: store the default target per listener
    - BUILD: fix automatic inclusion of libdl.
    - MEDIUM: lua: implement a simple memory allocator
    - MEDIUM: compression: postpone buffer adjustments after compression
    - MEDIUM: compression: don't send leading zeroes with chunk size
    - BUG/MINOR: compression: consider the expansion factor in init
    - MINOR: http: check the algo name "identity" instead of the function pointer
    - CLEANUP: compression: statify all algo-specific functions
    - MEDIUM: compression: add a distinction between UA- and config- algorithms
    - MEDIUM: compression: add new "raw-deflate" compression algorithm
    - MEDIUM: compression: split deflate_flush() into flush and finish
    - CLEANUP: compression: remove unused reset functions
    - MAJOR: compression: integrate support for libslz
    - BUG/MEDIUM: http: hdr_cnt would not count any header when called without name
    - BUG/MAJOR: http: null-terminate the http actions keywords list
    - CLEANUP: lua: remove the unused hlua_sleep memory pool
    - BUG/MAJOR: lua: use correct object size when initializing a new converter
    - CLEANUP: lua: remove hard-coded sizeof() in object creations and mallocs
    - CLEANUP: lua: fix confusing local variable naming in hlua_txn_new()
    - CLEANUP: hlua: stop using variable name "s" alternately for hlua_txn and hlua_smp
    - CLEANUP: lua: get rid of the last "*ht" for struct hlua_txn.
    - CLEANUP: lua: rename last occurrences of "*s" to "*htxn" for hlua_txn
    - CLEANUP: lua: rename variable "sc" for struct hlua_smp
    - CLEANUP: lua: get rid of the last two "*hs" for hlua_smp
    - REORG/MAJOR: session: rename the "session" entity to "stream"
    - REORG/MEDIUM: stream: rename stream flags from SN_* to SF_*
    - MINOR: session: start to reintroduce struct session
    - MEDIUM: stream: allocate the session when a stream is created
    - MEDIUM: stream: move the listener's pointer to the session
    - MEDIUM: stream: move the frontend's pointer to the session
    - MINOR: session: add a pointer to the session's origin
    - MEDIUM: session: use the pointer to the origin instead of s->si[0].end
    - CLEANUP: sample: remove useless tests in fetch functions for l4 != NULL
    - MEDIUM: http: move header captures from http_txn to struct stream
    - MINOR: http: create a dedicated pool for http_txn
    - MAJOR: http: move http_txn out of struct stream
    - MAJOR: sample: don't pass l7 anymore to sample fetch functions
    - CLEANUP: lua: remove unused hlua_smp->l7 and hlua_txn->l7
    - MEDIUM: http: remove the now useless http_txn from {req/res} rules
    - CLEANUP: lua: don't pass http_txn anymore to hlua_request_act_wrapper()
    - MAJOR: sample: pass a pointer to the session to each sample fetch function
    - MINOR: stream: provide a few helpers to retrieve frontend, listener and origin
    - CLEANUP: stream: don't set ->target to the incoming connection anymore
    - MINOR: stream: move session initialization before the stream's
    - MINOR: session: store the session's accept date
    - MINOR: session: don't rely on s->logs.logwait in embryonic sessions
    - MINOR: session: implement session_free() and use it everywhere
    - MINOR: session: add stick counters to the struct session
    - REORG: stktable: move the stkctr_* functions from stream to sticktable
    - MEDIUM: streams: support looking up stkctr in the session
    - MEDIUM: session: update the session's stick counters upon session_free()
    - MEDIUM: proto_tcp: track the session's counters in the connection ruleset
    - MAJOR: tcp: make tcp_exec_req_rules() only rely on the session
    - MEDIUM: stream: don't call stream_store_counters() in kill_mini_session() nor session_accept()
    - MEDIUM: stream: move all the session-specific stuff of stream_accept() earlier
    - MAJOR: stream: don't initialize the stream anymore in stream_accept
    - MEDIUM: session: remove the task pointer from the session
    - REORG: session: move the session parts out of stream.c
    - MINOR: stream-int: make appctx_new() take the applet in argument
    - MEDIUM: peers: move the appctx initialization earlier
    - MINOR: session: introduce session_new()
    - MINOR: session: make use of session_new() when creating a new session
    - MINOR: peers: make use of session_new() when creating a new session
    - MEDIUM: peers: initialize the task before the stream
    - MINOR: session: set the CO_FL_CONNECTED flag on the connection once ready
    - CLEANUP: stream.c: do not re-attach the connection to the stream
    - MEDIUM: stream: isolate connection-specific initialization code
    - MEDIUM: stream: also accept appctx as origin in stream_accept_session()
    - MEDIUM: peers: make use of stream_accept_session()
    - MEDIUM: frontend: make ->accept only return +/-1
    - MEDIUM: stream: return the stream upon accept()
    - MEDIUM: frontend: move some stream initialisation to stream_new()
    - MEDIUM: frontend: move the fd-specific settings to session_accept_fd()
    - MEDIUM: frontend: don't restrict frontend_accept() to connections anymore
    - MEDIUM: frontend: move some remaining stream settings to stream_new()
    - CLEANUP: frontend: remove one useless local variable
    - MEDIUM: stream: don't rely on the session's listener anymore in stream_new()
    - MEDIUM: lua: make use of stream_new() to create an outgoing connection
    - MINOR: lua: minor cleanup in hlua_socket_new()
    - MINOR: lua: no need for setting timeouts / conn_retries in hlua_socket_new()
    - MINOR: peers: no need for setting timeouts / conn_retries in peer_session_create()
    - CLEANUP: stream-int: swap stream-int and appctx declarations
    - CLEANUP: namespaces: fix protection against multiple inclusions
    - MINOR: session: maintain the session count stats in the session, not the stream
    - MEDIUM: session: adjust the connection flags before stream_new()
    - MINOR: stream: pass the pointer to the origin explicitly to stream_new()
    - CLEANUP: poll: move the conditions for waiting out of the poll functions
    - BUG/MEDIUM: listener: don't report an error when resuming unbound listeners
    - BUG/MEDIUM: init: don't limit cpu-map to the first 32 processes only
    - BUG/MAJOR: tcp/http: fix current_rule assignment when restarting over a ruleset
    - BUG/MEDIUM: stream-int: always reset si->ops when si->end is nullified
    - DOC: update the entities diagrams
    - BUG/MEDIUM: http: properly retrieve the front connection
    - MINOR: applet: add a new "owner" pointer in the appctx
    - MEDIUM: applet: make the applet not depend on a stream interface anymore
    - REORG: applet: move the applet definitions out of stream_interface
    - CLEANUP: applet: rename struct si_applet to applet
    - REORG: stream-int: create si_applet_ops dedicated to applets
    - MEDIUM: applet: add basic support for an applet run queue
    - MEDIUM: applet: implement a run queue for active appctx
    - MEDIUM: stream-int: add a new function si_applet_done()
    - MAJOR: applet: now call si_applet_done() instead of si_update() in I/O handlers
    - MAJOR: stream: use a regular ->update for all stream interfaces
    - MEDIUM: dumpstats: don't unregister the applet anymore
    - MEDIUM: applet: centralize the call to si_applet_done() in the I/O handler
    - MAJOR: stream: do not allocate request buffers anymore when the left side is an applet
    - MINOR: stream-int: add two flags to indicate an applet's wishes regarding I/O
    - MEDIUM: applet: make the applets only use si_applet_{cant|want|stop}_{get|put}
    - MEDIUM: stream-int: pause the appctx if the task is woken up
    - BUG/MAJOR: tcp: only call registered actions when they're registered
    - BUG/MEDIUM: peers: fix applet scheduling
    - BUG/MEDIUM: peers: recent applet changes broke peers updates scheduling
    - MINOR: tools: provide an rdtsc() function for time comparisons
    - IMPORT: lru: import simple ebtree-based LRU functions
    - IMPORT: hash: import xxhash-r39
    - MEDIUM: pattern: add a revision to all pattern expressions
    - MAJOR: pattern: add LRU-based cache on pattern matching
    - BUG/MEDIUM: http: remove content-length from chunked messages
    - DOC: http: update the comments about the rules for determining transfer-length
    - BUG/MEDIUM: http: do not restrict parsing of transfer-encoding to HTTP/1.1
    - BUG/MEDIUM: http: incorrect transfer-coding in the request is a bad request
    - BUG/MEDIUM: http: remove content-length form responses with bad transfer-encoding
    - MEDIUM: http: restrict the HTTP version token to 1 digit as per RFC7230
    - MEDIUM: http: disable support for HTTP/0.9 by default
    - MEDIUM: http: add option-ignore-probes to get rid of the floods of 408
    - BUG/MINOR: config: clear proxy->table.peers.p for disabled proxies
    - MEDIUM: init: don't stop proxies in parent process when exiting
    - MINOR: stick-table: don't attach to peers in stopped state
    - MEDIUM: config: initialize stick-tables after peers, not before
    - MEDIUM: peers: add the ability to disable a peers section
    - MINOR: peers: store the pointer to the signal handler
    - MEDIUM: peers: unregister peers that were never started
    - MEDIUM: config: propagate the table's process list to the peers sections
    - MEDIUM: init: stop any peers section not bound to the correct process
    - MEDIUM: config: validate that peers sections are bound to exactly one process
    - MAJOR: peers: allow peers section to be used with nbproc > 1
    - DOC: relax the peers restriction to single-process
    - DOC: document option http-ignore-probes
    - DOC: fix the comments about the meaning of msg->sol in HTTP
    - BUG/MEDIUM: http: wait for the exact amount of body bytes in wait_for_request_body
    - BUG/MAJOR: http: prevent risk of reading past end with balance url_param
    - MEDIUM: stream: move HTTP request body analyser before process_common
    - MEDIUM: http: add a new option http-buffer-request
    - MEDIUM: http: provide 3 fetches for the body
    - DOC: update the doc on the proxy protocol
    - BUILD: pattern: fix build warnings introduced in the LRU cache
    - BUG/MEDIUM: stats: properly initialize the scope before dumping stats
    - CLEANUP: config: fix misleading information in error message.
    - MINOR: config: report the number of processes using a peers section in the error case
    - BUG/MEDIUM: config: properly compute the default number of processes for a proxy
    - MEDIUM: http: add new "capture" action for http-request
    - BUG/MEDIUM: http: fix the http-request capture parser
    - BUG/MEDIUM: http: don't forward client shutdown without NOLINGER except for tunnels
    - BUILD/MINOR: ssl: fix build failure introduced by recent patch
    - BUG/MAJOR: check: fix breakage of inverted tcp-check rules
    - CLEANUP: checks: fix double usage of cur / current_step in tcp-checks
    - BUG/MEDIUM: checks: do not dereference head of a tcp-check at the end
    - CLEANUP: checks: simplify the loop processing of tcp-checks
    - BUG/MAJOR: checks: always check for end of list before proceeding
    - BUG/MEDIUM: checks: do not dereference a list as a tcpcheck struct
    - BUG/MAJOR: checks: break infinite loops when tcp-checks starts with comment
    - MEDIUM: http: make url_param iterate over multiple occurrences
    - BUG/MEDIUM: peers: apply a random reconnection timeout
    - MEDIUM: config: reject invalid config with name duplicates
    - MEDIUM: config: reject conflicts in table names
    - CLEANUP: proxy: make the proxy lookup functions more user-friendly
    - MINOR: proxy: simply ignore duplicates in proxy name lookups
    - MINOR: config: don't open-code proxy name lookups
    - MEDIUM: config: clarify the conflicting modes detection for backend rules
    - CLEANUP: proxy: remove now unused function findproxy_mode()
    - MEDIUM: stick-table: remove the now duplicate find_stktable() function
    - MAJOR: config: remove the deprecated reqsetbe / reqisetbe actions
    - MINOR: proxy: add a new function proxy_find_by_id()
    - MINOR: proxy: add a flag to memorize that the proxy's ID was forced
    - MEDIUM: proxy: add a new proxy_find_best_match() function
    - CLEANUP: http: explicitly reference request in http_apply_redirect_rules()
    - MINOR: http: prepare support for parsing redirect actions on responses
    - MEDIUM: http: implement http-response redirect rules
    - MEDIUM: http: no need to close the request on redirect if data was parsed
    - BUG/MEDIUM: http: fix body processing for the stats applet
    - BUG/MINOR: da: fix log-level comparison to emove annoying warning
    - CLEANUP: global: remove one ifdef USE_DEVICEATLAS
    - CLEANUP: da: move the converter registration to da.c
    - CLEANUP: da: register the config keywords in da.c
    - CLEANUP: adjust the envelope name in da.h to reflect the file name
    - CLEANUP: da: remove ifdef USE_DEVICEATLAS from da.c
    - BUILD: make 51D easier to build by defaulting to 51DEGREES_SRC
    - BUILD: fix build warning when not using 51degrees
    - BUILD: make DeviceAtlas easier to build by defaulting to DEVICEATLAS_SRC
    - BUILD: ssl: fix recent build breakage on older SSL libs

10 years agoBUILD: ssl: fix recent build breakage on older SSL libs
Willy Tarreau [Wed, 17 Jun 2015 13:48:26 +0000 (15:48 +0200)] 
BUILD: ssl: fix recent build breakage on older SSL libs

Commit 31af49d ("MEDIUM: ssl: Add options to forge SSL certificates")
introduced some dependencies on SSL_CTRL_SET_TLSEXT_HOSTNAME for which
a few checks were missing, breaking the build on openssl 0.9.8.

10 years agoBUG/MINOR: vars/compil: fix some warnings
Thierry FOURNIER [Tue, 16 Jun 2015 21:52:47 +0000 (23:52 +0200)] 
BUG/MINOR: vars/compil: fix some warnings

A switch case doesn't have default entry, and the compilator sends
a warning about uninitilized var.

   warning: 'vars' may be used uninitialized in this function [-Wmaybe-uninitialized]

10 years agoBUG/MAJOR: sample: regression on sample cast to stick table types.
Emeric Brun [Tue, 16 Jun 2015 16:26:17 +0000 (18:26 +0200)] 
BUG/MAJOR: sample: regression on sample cast to stick table types.

This regression was introduce by commit
9c627e84b2 (MEDIUM: sample: Add type any)

New sample type 'any' was not handled in the matrix used to cast
to stick-tables types.

10 years agoMEDIUM: peers: support of any stick-table data-types for sync
Emeric Brun [Thu, 11 Jun 2015 16:25:54 +0000 (18:25 +0200)] 
MEDIUM: peers: support of any stick-table data-types for sync

It is possible to propagate entries of any data-types in stick-tables between
several haproxy instances over TCP connections in a multi-master fashion. Each
instance pushes its local updates and insertions to remote peers. The pushed
values overwrite remote ones without aggregation. Interrupted exchanges are
automatically detected and recovered from the last known point.

10 years agoMEDIUM: peers: re-schedule stick-table's entry for sync when data is modified.
Emeric Brun [Mon, 15 Jun 2015 16:29:57 +0000 (18:29 +0200)] 
MEDIUM: peers: re-schedule stick-table's entry for sync when data is modified.

This was correctly done for data of type 'serverid' but it is now
necessary for all stick-tables data-types if we want to perform their
sync.

10 years agoMINOR: peers: avoid re-scheduling of pending stick-table's updates still not pushed.
Emeric Brun [Mon, 15 Jun 2015 15:23:30 +0000 (17:23 +0200)] 
MINOR: peers: avoid re-scheduling of pending stick-table's updates still not pushed.

10 years agoMINOR: samples: add samples which returns constants
Thierry FOURNIER [Sat, 6 Jun 2015 17:30:17 +0000 (19:30 +0200)] 
MINOR: samples: add samples which returns constants

This patch adds sample which returns constants values. This is useful
for intialising variables.

10 years agoMINOR: lua: Variable access
Thierry FOURNIER [Mon, 8 Jun 2015 11:05:33 +0000 (13:05 +0200)] 
MINOR: lua: Variable access

This patch adds two Lua function for using HAPRoxy's
vraibles. The function are stored in the TXN class,
and her name is "set_var" and "get_var".

10 years agoMINOR: vars: adds get and set functions
Thierry FOURNIER [Tue, 9 Jun 2015 10:27:17 +0000 (12:27 +0200)] 
MINOR: vars: adds get and set functions

This patch adds two functions used for variable acces using the
variable full name. If the variable doesn't exists in the variable
pool name, it is created.

10 years agoMEDIUM: vars: adds support of variables
Thierry FOURNIER [Sat, 6 Jun 2015 17:29:07 +0000 (19:29 +0200)] 
MEDIUM: vars: adds support of variables

This patch adds support of variables during the processing of each stream. The
variables scope can be set as 'session', 'transaction', 'request' or 'response'.
The variable type is the type returned by the assignment expression. The type
can change while the processing.

The allocated memory can be controlled for each scope and each request, and for
the global process.

10 years agoMINOR: build: fix build dependency
Thierry FOURNIER [Tue, 9 Jun 2015 13:49:44 +0000 (15:49 +0200)] 
MINOR: build: fix build dependency

fix include dependency. The header file sample.h don't need to known
the content of the struct arg, so I remove the include, and replace
it by a simple pointer declaration.

This prevent an include dependecy issue with the next patch.

10 years agoMINOR: tcp/http/conf: extends the keyword registration options
Thierry FOURNIER [Thu, 4 Jun 2015 09:44:06 +0000 (11:44 +0200)] 
MINOR: tcp/http/conf: extends the keyword registration options

This patch permits to register a new keyword with the keyword "tcp-request content"
'tcp-request connection", tcp-response content", http-request" and "http-response"
which is identified only by matching the start of the keyword.

for example, we register the keyword "set-var" with the option "match_pfx"
and the configuration keyword "set-var(var_name)" matchs this entry.

10 years agoMINOR: tcp: increase the opaque data array
Thierry FOURNIER [Wed, 3 Jun 2015 17:32:04 +0000 (19:32 +0200)] 
MINOR: tcp: increase the opaque data array

This patch increase the opaque data array for the tcp_rules.
It is used by the "store" action (next commited) which deal
with variables.

10 years agoMINOR: debug: add a special converter which display its input sample content.
Thierry FOURNIER [Thu, 7 May 2015 13:46:29 +0000 (15:46 +0200)] 
MINOR: debug: add a special converter which display its input sample content.

This converter displays its input sample type and content. It is useful
for debugging some complex configurations.

10 years agoMEDIUM: sample: Add type any
Thierry FOURNIER [Wed, 3 Jun 2015 18:12:35 +0000 (20:12 +0200)] 
MEDIUM: sample: Add type any

This type is used to accept any type of sample as input, and prevent
any automatic "cast". It runs like the type "ADDR" which accept the
type "IPV4" and "IPV6".

10 years agoBUG/MINOR: sample: wrong conversion of signed values
Thierry FOURNIER [Sat, 6 Jun 2015 17:16:52 +0000 (19:16 +0200)] 
BUG/MINOR: sample: wrong conversion of signed values

The signed values are casted as unsigned before conversion. This patch
use the good converters according with the sample type.

Note: it depends on previous patch to parse signed ints.

10 years agoMINOR: standard: add function that converts signed int to a string
Thierry FOURNIER [Sat, 6 Jun 2015 17:14:59 +0000 (19:14 +0200)] 
MINOR: standard: add function that converts signed int to a string

This function is the same as "ultoa_r", but it takes a signed value
as input.

10 years agoDOC: mention the "lua action" in documentation
Thierry FOURNIER [Thu, 4 Jun 2015 10:23:41 +0000 (12:23 +0200)] 
DOC: mention the "lua action" in documentation

Fix some precision about lua.

10 years agoMINOR: dns: add DNS statistics
Baptiste Assmann [Sat, 16 May 2015 22:33:24 +0000 (00:33 +0200)] 
MINOR: dns: add DNS statistics

add a new command on the stats socket to print a DNS resolvers section
(including per server) statistics: "show stats resolvers <id>"

10 years agoDOC: server name resolution + proto DNS
Baptiste Assmann [Mon, 13 Apr 2015 22:28:47 +0000 (00:28 +0200)] 
DOC: server name resolution + proto DNS

10 years agoMAJOR: server: add DNS-based server name resolution
Baptiste Assmann [Mon, 13 Apr 2015 23:15:08 +0000 (01:15 +0200)] 
MAJOR: server: add DNS-based server name resolution

Relies on the DNS protocol freshly implemented in HAProxy.
It performs a server IP addr resolution based on a server hostname.

10 years agoMEDIUM: dns: implement a DNS resolver
Baptiste Assmann [Mon, 13 Apr 2015 21:40:55 +0000 (23:40 +0200)] 
MEDIUM: dns: implement a DNS resolver

Implementation of a DNS client in HAProxy to perform name resolution to
IP addresses.

It relies on the freshly created UDP client to perform the DNS
resolution. For now, all UDP socket calls are performed in the
DNS layer, but this might change later when the protocols are
extended to be more suited to datagram mode.

A new section called 'resolvers' is introduced thanks to this patch. It
is used to describe DNS servers IP address and also many parameters.

10 years agoMEDIUM: protocol: add minimalist UDP protocol client
Baptiste Assmann [Mon, 13 Apr 2015 21:08:16 +0000 (23:08 +0200)] 
MEDIUM: protocol: add minimalist UDP protocol client

Basic introduction of a UDP layer in HAProxy. It can be used as a
client only and manages UDP exchanges with servers.

It can't be used to load-balance UDP protocols, but only used by
internal features such as DNS resolution.

10 years agoMEDIUM: server: change server ip address from stats socket
Baptiste Assmann [Mon, 13 Apr 2015 20:54:33 +0000 (22:54 +0200)] 
MEDIUM: server: change server ip address from stats socket

New command available on the stats socket to change a server addr using
the command "set server <backend>/<server> addr <ip4|ip6>"

10 years agoMEDIUM: server: add support for changing a server's address
Baptiste Assmann [Mon, 13 Apr 2015 23:13:07 +0000 (01:13 +0200)] 
MEDIUM: server: add support for changing a server's address

Ability to change a server IP address during HAProxy run time.
For now this is provided via function update_server_addr() which
currently is not called.

A log is emitted on each change. For now we do it inconditionally,
but later we'll want to do it only on certain circumstances, which
explains why the logging block is enclosed in if(1).

10 years agoBUG/MEDIUM: compat: fix segfault on FreeBSD
Joris Dedieu [Fri, 12 Jun 2015 23:05:11 +0000 (01:05 +0200)] 
BUG/MEDIUM: compat: fix segfault on FreeBSD

Since commit 65d805fd witch removes standard.h from compat.h some
values were not properly set on FreeBSD. This caused a segfault
at startup when smp_resolve_args is called.

As FreeBSD have IP_BINDANY, CONFIG_HAP_TRANSPARENT is define. This
cause struct conn_src to be extended with some fields. The size of
this structure was incorrect. Including netinet/in.h fix this issue.

While diving in code preprocessing, I found that limits.h was require
to properly set MAX_HOSTNAME_LEN, ULONG_MAX, USHRT_MAX and others
system limits on FreeBSD.

10 years agoMINOR: ssl: Export functions to manipulate generated certificates
Christopher Faulet [Thu, 11 Jun 2015 11:39:32 +0000 (13:39 +0200)] 
MINOR: ssl: Export functions to manipulate generated certificates

Following functions are now available in the SSL public API:

  * ssl_sock_create_cert
  * ssl_sock_get_generated_cert
  * ssl_sock_set_generated_cert
  * ssl_sock_generated_cert_serial

These functions could be used to create a certificate by hand, set it in the
cache used to store generated certificates and retrieve it. Here is an example
(pseudo code):

  X509        *cacert     = ...;
  EVP_PKEY    *capkey     = ...;
  char        *servername = ...;
  unsigned int serial;

  serial = ssl_sock_generated_cert_serial(servername, strlen(servername));
  if (!ssl_sock_get_generated_cert(serial, cacert)) {
      SSL_CTX *ctx = ssl_sock_create_cert(servername, serial, cacert, capkey);
      ssl_sock_set_generated_cert(ctx, serial, cacert);
  }

10 years agoMEDIUM: ssl: Add options to forge SSL certificates
Christopher Faulet [Tue, 9 Jun 2015 15:29:50 +0000 (17:29 +0200)] 
MEDIUM: ssl: Add options to forge SSL certificates

With this patch, it is possible to configure HAProxy to forge the SSL
certificate sent to a client using the SNI servername. We do it in the SNI
callback.

To enable this feature, you must pass following BIND options:

 * ca-sign-file <FILE> : This is the PEM file containing the CA certitifacte and
   the CA private key to create and sign server's certificates.

 * (optionally) ca-sign-pass <PASS>: This is the CA private key passphrase, if
   any.

 * generate-certificates: Enable the dynamic generation of certificates for a
   listener.

Because generating certificates is expensive, there is a LRU cache to store
them. Its size can be customized by setting the global parameter
'tune.ssl.ssl-ctx-cache-size'.

10 years agoMINOR: lru: Add lru64_lookup function
Christopher Faulet [Thu, 11 Jun 2015 11:33:13 +0000 (13:33 +0200)] 
MINOR: lru: Add lru64_lookup function

It lookup a key in a LRU cache for use with specified domain and revision. It
differs from lru64_get as it does not create missing keys. The function returns
NULL if an error or a cache miss occurs.

10 years agoMINOR: lru: Add the possibility to free data when an item is removed
Christopher Faulet [Tue, 9 Jun 2015 15:06:17 +0000 (17:06 +0200)] 
MINOR: lru: Add the possibility to free data when an item is removed

Now, When a item is committed in an LRU tree, you can define a function to free
data owned by this item. This function will be called when the item is removed
from the LRU tree or when the tree is destroyed..

10 years agoBUG/MEDIUM: init: segfault if global._51d_property_names is not initialized
Dragan Dosen [Thu, 11 Jun 2015 19:36:33 +0000 (21:36 +0200)] 
BUG/MEDIUM: init: segfault if global._51d_property_names is not initialized

When using the "51d" converter without specifying the list of 51Degrees
properties to detect (see parameter "51degrees-property-name-list"), the
"global._51d_property_names" could be left uninitialized which will lead to
segfault during init.

10 years agoCLEANUP: deinit: remove codes for cleaning p->block_rules
Godbach [Tue, 9 Jun 2015 11:41:52 +0000 (19:41 +0800)] 
CLEANUP: deinit: remove codes for cleaning p->block_rules

Since all rules listed in p->block_rules have been moved to the beginning of
the http-request rules in check_config_validity(), there is no need to clean
p->block_rules in deinit().

Signed-off-by: Godbach <nylzhaowei@gmail.com>
10 years agoBUG/MINOR: debug: display (null) in place of "meth"
Thierry FOURNIER [Wed, 3 Jun 2015 18:12:04 +0000 (20:12 +0200)] 
BUG/MINOR: debug: display (null) in place of "meth"

The array which contains names of types, miss the METH entry.

[wt: should be backported to 1.5 as well]

10 years agoDOC: set-log-level in Logging section preamble
Jim Freeman [Tue, 26 May 2015 15:16:34 +0000 (09:16 -0600)] 
DOC: set-log-level in Logging section preamble

As best I can tell, no mention is made of "set-log-level" in the Logging
[Section 8] of the doc.

Something akin to the following in the doc would have saved a good chunk of
time/angst in addressing a logging issue I encountered :

10 years agoDOC: lua: schematics about lua socket organization
Thierry FOURNIER [Tue, 2 Jun 2015 20:51:09 +0000 (22:51 +0200)] 
DOC: lua: schematics about lua socket organization

This schema shows the structs and the connections between these structs
for implementing the socket systems.

10 years agoBUILD: make DeviceAtlas easier to build by defaulting to DEVICEATLAS_SRC
Willy Tarreau [Tue, 2 Jun 2015 12:10:28 +0000 (14:10 +0200)] 
BUILD: make DeviceAtlas easier to build by defaulting to DEVICEATLAS_SRC

Since both DEVICEATLAS_INC and DEVICEATLAS_LIB are set to the same path
when building from sources, simply allow DEVICEATLAS_SRC to be set alone
to simplify the build procedure.

10 years agoBUILD: fix build warning when not using 51degrees
Willy Tarreau [Tue, 2 Jun 2015 12:01:20 +0000 (14:01 +0200)] 
BUILD: fix build warning when not using 51degrees

An ifdef was missing to avoid declaring these variables :

src/haproxy.c: In function 'deinit':
src/haproxy.c:1253:47: warning: unused variable '_51d_prop_nameb' [-Wunused-variable]
src/haproxy.c:1253:30: warning: unused variable '_51d_prop_name' [-Wunused-variable]

10 years agoBUILD: make 51D easier to build by defaulting to 51DEGREES_SRC
Willy Tarreau [Mon, 1 Jun 2015 09:12:35 +0000 (11:12 +0200)] 
BUILD: make 51D easier to build by defaulting to 51DEGREES_SRC

Till now 3 paths were needed, 51DEGREES_SRC, 51DEGREES_INC, and
51DEGREES_LIB.  Let's make the last two default to 51DEGREES_SRC since
it's the same location, and fix the doc to reflect this (all three were
documented but inconsistently).

10 years agoDOC: add build indications for 51Degrees to README.
Thomas Holmes [Fri, 29 May 2015 14:21:42 +0000 (15:21 +0100)] 
DOC: add build indications for 51Degrees to README.

10 years agoDOC: add 51Degrees notes to configuration.txt.
Thomas Holmes [Mon, 18 May 2015 12:21:39 +0000 (13:21 +0100)] 
DOC: add 51Degrees notes to configuration.txt.

10 years agoMEDIUM: sample: add trie support to 51Degrees
Thomas Holmes [Fri, 29 May 2015 11:54:25 +0000 (12:54 +0100)] 
MEDIUM: sample: add trie support to 51Degrees

Trie or pattern algorithm is used depending on what 51Degrees source
files are provided to MAKE.

10 years agoMEDIUM: deinit: add cleanup for 51Degrees to deinit
Thomas Holmes [Thu, 14 May 2015 16:14:30 +0000 (17:14 +0100)] 
MEDIUM: deinit: add cleanup for 51Degrees to deinit

10 years agoMEDIUM: sample: add fiftyone_degrees converter.
Thomas Holmes [Wed, 13 May 2015 10:27:35 +0000 (11:27 +0100)] 
MEDIUM: sample: add fiftyone_degrees converter.

It takes up to 5 string arguments that are to be 51Degrees property names.
It will then create a chunk with values detected based on the request header
supplied (this should be the User-Agent).

10 years agoMINOR: init: add 51Degrees initialisation code
Thomas Holmes [Tue, 12 May 2015 15:23:58 +0000 (16:23 +0100)] 
MINOR: init: add 51Degrees initialisation code

This creates a dataset using the file given in global._51d_data_file_path.

10 years agoMINOR: config: add 51Degrees config parsing.
Thomas Holmes [Tue, 12 May 2015 14:50:47 +0000 (15:50 +0100)] 
MINOR: config: add 51Degrees config parsing.

10 years agoMINOR: global: add several 51Degrees members to global
Thomas Holmes [Tue, 12 May 2015 14:47:24 +0000 (15:47 +0100)] 
MINOR: global: add several 51Degrees members to global

These are :
  fiftyoneDegreesDataSet _51d_data_set
  char *_51d_data_file_path
  char _51d_property_seperator
  struct list _51d_property_names

10 years agoBUILD: add 51degrees options to makefile.
Thomas Holmes [Tue, 12 May 2015 14:06:21 +0000 (15:06 +0100)] 
BUILD: add 51degrees options to makefile.

To build with 51Degrees set USE_51DEGREES=1. 51DEGREES_INC, 51DEGREES_LIB,
and 51DEGREES_SRC will need to be set to the 51Degrees pattern header and
C file.

10 years agoCLEANUP: da: remove ifdef USE_DEVICEATLAS from da.c
Willy Tarreau [Tue, 2 Jun 2015 11:25:39 +0000 (13:25 +0200)] 
CLEANUP: da: remove ifdef USE_DEVICEATLAS from da.c

This file is only built when the macro is defined, there's no point
having it ifdefed here.

10 years agoCLEANUP: adjust the envelope name in da.h to reflect the file name
Willy Tarreau [Mon, 1 Jun 2015 13:52:54 +0000 (15:52 +0200)] 
CLEANUP: adjust the envelope name in da.h to reflect the file name

Since the file is import/da.h, the define should be _IMPORT_DA_H,
nor MOBI_DA_DAC_HAPROXY_H.

10 years agoCLEANUP: da: register the config keywords in da.c
Willy Tarreau [Mon, 1 Jun 2015 13:42:29 +0000 (15:42 +0200)] 
CLEANUP: da: register the config keywords in da.c

No need to export the registration to haproxy.c, it can be done
locally.

10 years agoCLEANUP: da: move the converter registration to da.c
Willy Tarreau [Mon, 1 Jun 2015 13:39:50 +0000 (15:39 +0200)] 
CLEANUP: da: move the converter registration to da.c

There's no reason to put it into sample.c, it's better to register it
locally in da.c, it removes a number of ifdefs and exports.

10 years agoCLEANUP: global: remove one ifdef USE_DEVICEATLAS
Willy Tarreau [Mon, 1 Jun 2015 13:38:33 +0000 (15:38 +0200)] 
CLEANUP: global: remove one ifdef USE_DEVICEATLAS

The include file already has the ifdef, let's remove it from the global
file.

10 years agoBUG/MINOR: da: fix log-level comparison to emove annoying warning
Willy Tarreau [Mon, 1 Jun 2015 13:25:46 +0000 (15:25 +0200)] 
BUG/MINOR: da: fix log-level comparison to emove annoying warning

When haproxy is run on the foreground with DeviceAtlas enabled, one
line of warning is seen for every test because the comparison is always
true even when loglevel is zero :

willy@wtap:haproxy$ ./haproxy  -db -f test-da.cfg
[WARNING] 151/150831 (25506) : deviceatlas : final memory image 7148029 bytes.
Deviceatlas module loaded.
[WARNING] 151/150832 (25506) : deviceatlas : .
[WARNING] 151/150833 (25506) : deviceatlas : .
[WARNING] 151/150833 (25506) : deviceatlas : .
^C

Don't emit a warning when loglevel is null.

10 years agoDOC: README: explain how to build with DeviceAtlas
David Carlier [Mon, 1 Jun 2015 12:21:47 +0000 (14:21 +0200)] 
DOC: README: explain how to build with DeviceAtlas

This diff is related to the additional documentation in
order to build the DeviceAtlas module and in addition with
an example of a basic configuration.

10 years agoBUILD: Makefile: add options to build with DeviceAtlas
David Carlier [Mon, 1 Jun 2015 12:00:07 +0000 (14:00 +0200)] 
BUILD: Makefile: add options to build with DeviceAtlas

This diff updates the Makefile to compile conditionally via
some new sets of flags, USE_DEVICEATLAS to enable the module
and the couple DEVICEATLAS_INC/DEVICEATLAS_LIB which needs to
point to the API root folder in order to compile the API and
the module.

10 years agoMEDIUM: init: DeviceAtlas initialization
David Carlier [Mon, 1 Jun 2015 11:57:22 +0000 (13:57 +0200)] 
MEDIUM: init: DeviceAtlas initialization

This diff initialises few DeviceAtlas struct fields member with
their inherent default values.
Furthermore, the specific DeviceAtlas configuration keywords are
registered and the module is initialised and all necessary
resources are freed during the deinit phase.

10 years agoMEDIUM: sample: add the da-csv converter
David Carlier [Mon, 1 Jun 2015 11:54:29 +0000 (13:54 +0200)] 
MEDIUM: sample: add the da-csv converter

This diff declares the deviceatlas module and can accept up to 5
property names for the API lookup.

[wt: this should probably be moved to its own file using the keyword
      registration mechanism]

10 years agoMEDIUM: global: add the DeviceAtlas required elements to struct global
David Carlier [Mon, 1 Jun 2015 11:53:01 +0000 (13:53 +0200)] 
MEDIUM: global: add the DeviceAtlas required elements to struct global

This diff is the raw C struct definition of all DeviceAtlas module
data needed added to the main global struct haproxy configuration.
The three first members are needed for both init and deinit phases
as some dynamic memory allocations are done.
The useragentid serves to hold during the whole lifecycle of the
module the User-Agent HTTP Header identifier from the DeviceAtlas
data during the init process.

10 years agoMEDIUM: config: add DeviceAtlas global keywords
David Carlier [Mon, 1 Jun 2015 11:50:06 +0000 (13:50 +0200)] 
MEDIUM: config: add DeviceAtlas global keywords

This diff is for the DeviceAtlas convertor.

This patch adds the following converters :
  deviceatlas-json-file
  deviceatlas-log-level
  deviceatlas-property-separator

First, the configuration keywords handling (only the log
level configuration part does not end the haproxy process
if it is wrongly set, it fallbacks to the default level).
Furthermore, init, deinit phases and the API lookup phase,
the da_haproxy function which is fed by the input provided
and set all necessary properties chosen via the configuration
to the output, separated by the separator.

10 years agoMEDIUM: ssl: replace standards DH groups with custom ones
Remi Gacogne [Fri, 29 May 2015 14:26:17 +0000 (16:26 +0200)] 
MEDIUM: ssl: replace standards DH groups with custom ones

It is likely that powerful adversaries have been pre-computing the
standardized DH groups, because being widely used have made them
valuable targets. While users are advised to generate their own
DH parameters, replace the ones we ship by values been randomly
generated for this product only.

[wt: replaced dh1024_p, dh2048_p, and dh4096_p with locally-generated
 ones as recommended by Rémi]

10 years agoMEDIUM: ssl: add the possibility to use a global DH parameters file
Remi Gacogne [Fri, 29 May 2015 13:53:22 +0000 (15:53 +0200)] 
MEDIUM: ssl: add the possibility to use a global DH parameters file

This patch adds the ssl-dh-param-file global setting. It sets the
default DH parameters that will be used during the SSL/TLS handshake when
ephemeral Diffie-Hellman (DHE) key exchange is used, for all "bind" lines
which do not explicitely define theirs.

10 years agoMINOR: lua: Lua tcp action are not final action
Thierry FOURNIER [Fri, 29 May 2015 15:31:12 +0000 (17:31 +0200)] 
MINOR: lua: Lua tcp action are not final action

Actually, the registered lua actions with "tcp-request lua" and
"tcp-response lua" are final actions. This patch change the action
type type and permit to continue the evaluation of tcp-* processing
after the evaluation of the lua actions.

10 years agoMINOR: tcp: add custom actions that can continue tcp-(request|response) processing
Thierry FOURNIER [Fri, 29 May 2015 15:29:14 +0000 (17:29 +0200)] 
MINOR: tcp: add custom actions that can continue tcp-(request|response) processing

Actually, the tcp-request and tcp-response custom ation are always final
actions. This patch create a new type of action that can permit to
continue the evaluation of tcp-request and tcp-response processing.

10 years agoMAJOR: peers: peers protocol version 2.0
Emeric Brun [Tue, 12 May 2015 16:49:09 +0000 (18:49 +0200)] 
MAJOR: peers: peers protocol version 2.0

This patch does'nt add any new feature: the functional behavior
is the same than version 1.0.

Technical differences:

In this version all updates on different stick tables are
multiplexed on the same tcp session. There is only one established
tcp session per peer whereas in first version there was one established
tcp session per peer and per stick table.

Messages format was reviewed to be more evolutive and to support
further types of data exchange such as SSL sessions or other sticktable's
data types (currently only the sticktable's server id is supported).

10 years agoBUG/MEDIUM: http: fix body processing for the stats applet
Willy Tarreau [Thu, 28 May 2015 23:09:15 +0000 (01:09 +0200)] 
BUG/MEDIUM: http: fix body processing for the stats applet

Commit 9fbe18e ("MEDIUM: http: add a new option http-buffer-request")
introduced a regression due to a misplaced check causing the admin
mode of the HTTP stats not to work anymore.

This patch tried to ensure that when we need a request body for the
stats applet, and we have already waited for this body, we don't wait
for it again, but the condition was applied too early causing a
disabling of the entire processing the body, and based on the wrong
HTTP state (MSG_BODY) resulting in the test never matching.

Thanks to Chad Lavoie for reporting the problem.

This bug is 1.6-only, no backport is needed.

10 years agoMEDIUM: cfgparse: check max arguments in the proxies sections
William Lallemand [Tue, 28 Apr 2015 18:17:49 +0000 (20:17 +0200)] 
MEDIUM: cfgparse: check max arguments in the proxies sections

Add checks on the maximum number of arguments in proxies sections.

10 years agoMEDIUM: cfgparse: max arguments check in the global section
William Lallemand [Tue, 19 May 2015 14:37:23 +0000 (16:37 +0200)] 
MEDIUM: cfgparse: max arguments check in the global section

Most of the keywords in the global section does not check the maximum
number of arguments. This leds sometines to unused and wrong arguments
in the configuration file. This patch add a maximum argument test in
many keywords of this section.

10 years agoMEDIUM: cfgparse: check section maximum number of arguments
William Lallemand [Tue, 28 Apr 2015 14:55:23 +0000 (16:55 +0200)] 
MEDIUM: cfgparse: check section maximum number of arguments

This patch checks the number of arguments of the keywords:
'global', 'defaults', 'listen', 'backend', 'frontend', 'peers' and
'userlist'

The 'global' section does not take any arguments.

Proxy sections does not support bind address as argument anymore.  Those
sections supports only an <id> argument.

The 'defaults' section didn't had any check on its arguments. It takes
an optional <name> argument.

'peers' section takes a <peersect> argument.

'userlist' section takes a <listname> argument.

10 years agoCLEANUP: cfgparse: remove reference to 'ruleset' section
William Lallemand [Tue, 14 Apr 2015 14:35:22 +0000 (16:35 +0200)] 
CLEANUP: cfgparse: remove reference to 'ruleset' section

The 'ruleset' section was never implemented. This patch remove
references and tests about this keyword.

10 years agoBUG/MEDIUM: cfgparse: segfault when userlist is misused
William Lallemand [Thu, 28 May 2015 16:03:51 +0000 (18:03 +0200)] 
BUG/MEDIUM: cfgparse: segfault when userlist is misused

If the 'userlist' keyword parsing returns an error and no userlist were
previously created. The parsing of 'user' and 'group' leads to NULL
derefence.

The userlist pointer is now tested to prevent this issue.

10 years agoBUG/MINOR: cfgparse: fix typo in 'option httplog' error message
William Lallemand [Thu, 28 May 2015 16:02:48 +0000 (18:02 +0200)] 
BUG/MINOR: cfgparse: fix typo in 'option httplog' error message

The error message was displaying the wrong argument when 'option
httplog' took a wrong argument.

10 years agoMINOR: ssl: add a destructor to free allocated SSL ressources
Remi Gacogne [Thu, 28 May 2015 14:39:47 +0000 (16:39 +0200)] 
MINOR: ssl: add a destructor to free allocated SSL ressources

Using valgrind or another memory leak tracking tool is easier
when the memory internally allocated by OpenSSL is cleanly released
at shutdown.

10 years agoBUG/MEDIUM: ssl: fix tune.ssl.default-dh-param value being overwritten
Remi Gacogne [Thu, 28 May 2015 14:23:00 +0000 (16:23 +0200)] 
BUG/MEDIUM: ssl: fix tune.ssl.default-dh-param value being overwritten

Hervé Commowick reported that the logic used to avoid complaining about
ssl-default-dh-param not being set when static DH params are present
in the certificate file was clearly wrong when more than one sni_ctx
is used.
This patch stores whether static DH params are being used for each
SSL_CTX individually, and does not overwrite the value of
tune.ssl.default-dh-param.

10 years agoMEDIUM: stats: escape some strings in the CSV dump
Thierry FOURNIER [Thu, 28 May 2015 14:02:01 +0000 (16:02 +0200)] 
MEDIUM: stats: escape some strings in the CSV dump

Some strings which must be dumped in the CSV output can contain one of
the following chars : <,>, <">, or CR/LF. This patch escapes these
strings if the case is encountered.

10 years agoMINOR: common: escape CSV strings
Thierry FOURNIER [Thu, 28 May 2015 14:00:28 +0000 (16:00 +0200)] 
MINOR: common: escape CSV strings

This function checks a string for using it in a CSV output format. If
the string contains one of the following four char <">, <,>, CR or LF,
the string is encapsulated between <"> and the <"> are escaped by a <"">
sequence.

The rounding by <"> is optionnal. It can be canceled, forced or the
function choose automatically the right way.

10 years agoMEDIUM: http: no need to close the request on redirect if data was parsed
Willy Tarreau [Thu, 28 May 2015 15:23:54 +0000 (17:23 +0200)] 
MEDIUM: http: no need to close the request on redirect if data was parsed

There are two reasons for not keeping the client connection alive upon a
redirect :
  - save the client from uploading all data
  - avoid keeping a connection alive if the redirect goes to another domain

The first case should consider an exception when all the data from the
client have been read already. This specifically happens on response
redirects after a POST to a server. This is an easy situation to detect.

It could later be improved to cover the cases where option
http-buffer-request is used.

10 years agoMEDIUM: http: implement http-response redirect rules
Willy Tarreau [Fri, 22 May 2015 15:30:48 +0000 (17:30 +0200)] 
MEDIUM: http: implement http-response redirect rules

Sometimes it's problematic not to have "http-response redirect" rules,
for example to perform a browser-based redirect based on certain server
conditions (eg: match of a header).

This patch adds "http-response redirect location <fmt>" which gives
enough flexibility for most imaginable operations. The connection to
the server is closed when this is performed so that we don't risk to
forward any pending data from the server.

Any pending response data are trimmed so that we don't risk to
forward anything pending to the client. It's harmless to also do that
for requests so we don't need to consider the direction.

10 years agoMINOR: http: prepare support for parsing redirect actions on responses
Willy Tarreau [Thu, 28 May 2015 13:26:58 +0000 (15:26 +0200)] 
MINOR: http: prepare support for parsing redirect actions on responses

In order to support http-response redirect, the parsing needs to be
adapted a little bit to only support the "location" type, and to
adjust the log-format parser so that it knows the direction of the
sample fetch calls.

10 years agoCLEANUP: http: explicitly reference request in http_apply_redirect_rules()
Willy Tarreau [Fri, 22 May 2015 14:27:37 +0000 (16:27 +0200)] 
CLEANUP: http: explicitly reference request in http_apply_redirect_rules()

This function was made to perform a redirect on requests only, it was
using a message or txn->req in an inconsistent way and did not consider
the possibility that it could be used for the other direction. Let's
clean it up to have both a request and a response messages.

10 years agoMEDIUM: capture: adds http-response capture
Thierry FOURNIER [Tue, 26 May 2015 16:06:31 +0000 (18:06 +0200)] 
MEDIUM: capture: adds http-response capture

This patch adds a http response capture keyword with the same behavior
as the previous patch called "MEDIUM: capture: Allow capture with slot
identifier".

10 years agoMINOR: http: add array of generic pointers in http_res_rules
Thierry FOURNIER [Tue, 26 May 2015 15:38:47 +0000 (17:38 +0200)] 
MINOR: http: add array of generic pointers in http_res_rules

This patch adds an array of generic pointers in the http_res_rules
struct. It is used later by the "response capture" functions.

10 years agoMEDIUM: capture: Allow capture with slot identifier
Thierry FOURNIER [Tue, 26 May 2015 15:58:29 +0000 (17:58 +0200)] 
MEDIUM: capture: Allow capture with slot identifier

This patch modifies the current http-request capture function
and adds a new keyword "id" that permits to identify a capture slot.
If the identified doesn't exists, the action fails silently.

Note that this patch removs an unused list initilisation, which seems
to be inherited from a copy/paste. It's harmless and does not need to
be backported.

   LIST_INIT((struct list *)&rule->arg.act.p[0]);

10 years agoMINOR: capture: add two "capture" converters
Thierry FOURNIER [Thu, 28 May 2015 11:22:03 +0000 (13:22 +0200)] 
MINOR: capture: add two "capture" converters

This patch adds "capture-req" and "capture-res". These two converters
capture their entry in the allocated slot given in argument and pass
the input on the output.

10 years agoMINOR: proxy: custom capture declaration
Thierry FOURNIER [Tue, 26 May 2015 15:44:32 +0000 (17:44 +0200)] 
MINOR: proxy: custom capture declaration

This patch adds a new keyword called "declare". This keyword
allow to declare some capture slots in requests and response.
It is useful for sharing capture between frontend and backends.

10 years agoMEDIUM: proxy: add a new proxy_find_best_match() function
Willy Tarreau [Wed, 27 May 2015 14:46:26 +0000 (16:46 +0200)] 
MEDIUM: proxy: add a new proxy_find_best_match() function

This function tries to spot a proxy by its name, ID and type, and
in case some elements don't match, it tries to determine which ones
could be ignored and reports which ones were ignored so that the
caller can decide whether or not it wants to pick this proxy. This
will be used for maintaining the status across reloads where the
config might have changed a bit.

10 years agoMINOR: proxy: add a flag to memorize that the proxy's ID was forced
Willy Tarreau [Wed, 27 May 2015 14:44:02 +0000 (16:44 +0200)] 
MINOR: proxy: add a flag to memorize that the proxy's ID was forced

This will be used to know if proxy's ID should be considered when names
mismatch upon check status reload.

10 years agoMINOR: proxy: add a new function proxy_find_by_id()
Willy Tarreau [Tue, 26 May 2015 13:25:32 +0000 (15:25 +0200)] 
MINOR: proxy: add a new function proxy_find_by_id()

It does the same as the other one except that it only focuses on the
numeric ID and the capabilities. It's used by proxy_find_by_name()
for numeric names.

10 years agoMAJOR: config: remove the deprecated reqsetbe / reqisetbe actions
Willy Tarreau [Tue, 26 May 2015 10:18:29 +0000 (12:18 +0200)] 
MAJOR: config: remove the deprecated reqsetbe / reqisetbe actions

These ones were already obsoleted in 1.4, marked for removal in 1.5,
and not documented anymore. They used to emit warnings, and do still
require quite some code to stay in place. Let's remove them now.

10 years agoMEDIUM: stick-table: remove the now duplicate find_stktable() function
Willy Tarreau [Tue, 26 May 2015 10:08:07 +0000 (12:08 +0200)] 
MEDIUM: stick-table: remove the now duplicate find_stktable() function

Since proxy_tbl_by_name() already does the same job, let's not keep
duplicate functions and use this one only.

10 years agoCLEANUP: proxy: remove now unused function findproxy_mode()
Willy Tarreau [Tue, 26 May 2015 10:05:53 +0000 (12:05 +0200)] 
CLEANUP: proxy: remove now unused function findproxy_mode()

It's not used anymore.

10 years agoMEDIUM: config: clarify the conflicting modes detection for backend rules
Willy Tarreau [Tue, 26 May 2015 10:04:09 +0000 (12:04 +0200)] 
MEDIUM: config: clarify the conflicting modes detection for backend rules

We don't use findproxy_mode() anymore so we can check the conflicting
modes and report the anomalies accordingly with line numbers and more
explicit details.

10 years agoMINOR: config: don't open-code proxy name lookups
Willy Tarreau [Tue, 26 May 2015 09:45:02 +0000 (11:45 +0200)] 
MINOR: config: don't open-code proxy name lookups

We can now safely use the standard functions to detect proxy name
duplicates.

10 years agoMINOR: proxy: simply ignore duplicates in proxy name lookups
Willy Tarreau [Tue, 26 May 2015 09:35:41 +0000 (11:35 +0200)] 
MINOR: proxy: simply ignore duplicates in proxy name lookups

Now that we can't have duplicate proxies with similar capabilities, we
can remove some painful check. The first one is the check that made the
lookup function return NULL when a duplicate is found, as it prevented
it from being used in the config parser to detect duplicates.

10 years agoCLEANUP: proxy: make the proxy lookup functions more user-friendly
Willy Tarreau [Tue, 26 May 2015 09:24:42 +0000 (11:24 +0200)] 
CLEANUP: proxy: make the proxy lookup functions more user-friendly

First, findproxy() was renamed proxy_find_by_name() so that its explicit
that a name is required for the lookup. Second, we give this function
the ability to search for tables if needed. Third we now provide inline
wrappers to pass the appropriate PR_CAP_* flags and to explicitly look
up a frontend, backend or table.

10 years agoMEDIUM: config: reject conflicts in table names
Willy Tarreau [Tue, 26 May 2015 08:49:46 +0000 (10:49 +0200)] 
MEDIUM: config: reject conflicts in table names

A nasty situation happens when two tables have the same name. Since it
is possible to declare a table in a frontend and another one in a backend,
this situation may happen and result in a random behaviour each time a
table is designated in a "stick" or "track" rule. Let's make sure this
is properly detected and stopped. Such a config will now report :

[ALERT] 145/104933 (31571) : parsing [prx.cfg:36] : stick-table name 't' conflicts with table declared in frontend 't' at prx.cfg:30.
[ALERT] 145/104933 (31571) : Error(s) found in configuration file : prx.cfg
[ALERT] 145/104933 (31571) : Fatal errors found in configuration.