]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
13 years agoMEDIUM: acl: support IPv6 address matching
Willy Tarreau [Fri, 27 Apr 2012 22:41:46 +0000 (00:41 +0200)] 
MEDIUM: acl: support IPv6 address matching

Make use of the new IPv6 pattern type so that acl_match_ip() knows how to
compare pattern and sample.

IPv6 may be entered in their usual form, with or without a netmask appended.
Only bit counts are accepted for IPv6 netmasks. In order to avoid any risk of
trouble with randomly resolved IP addresses, host names are never allowed in
IPv6 patterns.

HAProxy is also able to match IPv4 addresses with IPv6 addresses in the
following situations :
  - tested address is IPv4, pattern address is IPv4, the match applies
    in IPv4 using the supplied mask if any.
  - tested address is IPv6, pattern address is IPv6, the match applies
    in IPv6 using the supplied mask if any.
  - tested address is IPv6, pattern address is IPv4, the match applies in IPv4
    using the pattern's mask if the IPv6 address matches with 2002:IPV4::,
    ::IPV4 or ::ffff:IPV4, otherwise it fails.
  - tested address is IPv4, pattern address is IPv6, the IPv4 address is first
    converted to IPv6 by prefixing ::ffff: in front of it, then the match is
    applied in IPv6 using the supplied IPv6 mask.

13 years agoMINOR: standard: add an IPv6 parsing function (str62net)
Willy Tarreau [Fri, 27 Apr 2012 20:49:47 +0000 (22:49 +0200)] 
MINOR: standard: add an IPv6 parsing function (str62net)

str62net returns an address and a netmask in number of bits.

13 years agoMINOR: acl: add types to ACL patterns
Willy Tarreau [Fri, 27 Apr 2012 20:10:57 +0000 (22:10 +0200)] 
MINOR: acl: add types to ACL patterns

We cannot currently match IPv6 addresses in ACL simply because we don't
support types on the patterns. Let's introduce this notion. For now, we
rely on the SMP_TYPES though it doesn't seem like it will last forever
given that some types are not present there (eg: regex, meth). Still it
should be enough to support mixed matchings for most types.

We use the special impossible value SMP_TYPES for types that don't exist
in the SMP_T_* space.

13 years agoREORG: rename "pattern" files
Willy Tarreau [Fri, 27 Apr 2012 19:52:18 +0000 (21:52 +0200)] 
REORG: rename "pattern" files

They're now called "sample" everywhere to match their description.

13 years agoREORG: use the name "sample" instead of "pattern" to designate extracted data
Willy Tarreau [Fri, 27 Apr 2012 19:37:17 +0000 (21:37 +0200)] 
REORG: use the name "sample" instead of "pattern" to designate extracted data

This is mainly a massive renaming in the code to get it in line with the
calling convention. Next patch will rename a few files to complete this
operation.

13 years agoMEDIUM: acl: extend the pattern parsers to report meaningful errors
Willy Tarreau [Fri, 27 Apr 2012 15:52:25 +0000 (17:52 +0200)] 
MEDIUM: acl: extend the pattern parsers to report meaningful errors

By passing the error pointer to all ACL parsers, we can make them report
useful errors and not simply fail.

13 years agoMINOR: acl: report errors encountered when loading patterns from files
Willy Tarreau [Fri, 27 Apr 2012 15:25:24 +0000 (17:25 +0200)] 
MINOR: acl: report errors encountered when loading patterns from files

This happens in acl_read_patterns_from_file(). Errors are still incomplete,
parsing functions must be improved to report parsing errors.

13 years agoMINOR: arg: improve error reporting on invalid arguments
Willy Tarreau [Fri, 27 Apr 2012 14:32:26 +0000 (16:32 +0200)] 
MINOR: arg: improve error reporting on invalid arguments

It's important to report the faulty argument position and to distinguish
between empty arguments and wrong ones.

Integers were not properly tested either, now their parsing has been improved
to report use of incorrect characters.

13 years agoMEDIUM: acl: report parsing errors to the caller
Willy Tarreau [Fri, 27 Apr 2012 10:38:15 +0000 (12:38 +0200)] 
MEDIUM: acl: report parsing errors to the caller

All parsing errors were known but impossible to return. Now by making use
of memprintf(), we're able to build meaningful error messages that the
caller can display.

13 years agoMEDIUM: http: merge ACL and pattern cookie fetches into a single one
Willy Tarreau [Thu, 26 Apr 2012 19:26:10 +0000 (21:26 +0200)] 
MEDIUM: http: merge ACL and pattern cookie fetches into a single one

It's easy to merge pattern and ACL fetches of cookies. It allows us
to remove two distinct fetch functions. The new function internally
uses an occurrence number to serve both purposes, but it didn't appear
worth exposing it outside so there is no keyword argument to set it.
However one of the benefits is that the "cookie" fetch for stick tables
now automatically adapts to requests and responses, so there is no more
need for set-cookie().

13 years agoMEDIUM: http: merge acl and pattern header fetch functions
Willy Tarreau [Thu, 26 Apr 2012 13:11:51 +0000 (15:11 +0200)] 
MEDIUM: http: merge acl and pattern header fetch functions

HTTP header fetch is now done using smp_fetch_hdr() for both ACLs and
patterns. This one also supports an occurrence number, making it possible
to specify explicit occurrences for ACLs and patterns.

13 years agoMINOR: proto_tcp: validate arguments of payload and payload_lv ACLs
Willy Tarreau [Thu, 26 Apr 2012 10:24:45 +0000 (12:24 +0200)] 
MINOR: proto_tcp: validate arguments of payload and payload_lv ACLs

Now it's possible to control arguments, so let's do it.

13 years agoMINOR: acl: add a val_args field to keywords
Willy Tarreau [Thu, 26 Apr 2012 10:13:35 +0000 (12:13 +0200)] 
MINOR: acl: add a val_args field to keywords

This will make it possible to delegate argument validating to functions
shared with smp_fetch_*.

13 years agoMINOR: acl: set SMP_OPT_ITERATE on fetch functions
Willy Tarreau [Thu, 26 Apr 2012 09:44:02 +0000 (11:44 +0200)] 
MINOR: acl: set SMP_OPT_ITERATE on fetch functions

This way, fetch functions will be able to tell if they're called for a single
request or as part of a loop. This is important for instance when we use
hdr(foo), because in an ACL this means that all hdr(foo) occurrences must
be checked while in a pattern it means only one of them (eg: last one).

13 years agoMEDIUM: pattern: use smp_fetch_rdp_cookie instead of the pattern specific version
Willy Tarreau [Thu, 26 Apr 2012 09:23:39 +0000 (11:23 +0200)] 
MEDIUM: pattern: use smp_fetch_rdp_cookie instead of the pattern specific version

pattern_fetch_rdp_cookie() is useless now since it only used to add controls
on top of smp_fetch_rdp_cookie() which have now been integrated into the
pattern subsystem. Let's remove it.

13 years agoMINOR: pattern: centralize handling of unstable data in pattern_process()
Willy Tarreau [Thu, 26 Apr 2012 09:05:50 +0000 (11:05 +0200)] 
MINOR: pattern: centralize handling of unstable data in pattern_process()

Pattern fetch functions currently check for unstable data and return 0
when SMP_F_MAY_CHANGE is set. Instead of doing this everywhere and having
to support specific fetch functions, better do that in pattern_process()
which is the one interested in having stable data.

13 years agoMINOR: stick_table: centralize the handling of empty keys
Willy Tarreau [Thu, 26 Apr 2012 09:03:17 +0000 (11:03 +0200)] 
MINOR: stick_table: centralize the handling of empty keys

Right now, it's up to each pattern fetch method to return NULL when an
empty string is returned, which is neither correct nor desirable as it
is only stick tables which need to ignore empty patterns. Let's perform
this check in stktable_fetch_key() instead.

13 years agoCLEANUP: pattern: ensure that payload and payload_lv always stay in the buffer
Willy Tarreau [Wed, 25 Apr 2012 17:19:43 +0000 (19:19 +0200)] 
CLEANUP: pattern: ensure that payload and payload_lv always stay in the buffer

A test was already performed which worked by pure luck due to integer types,
otherwise it would have been possible to start checking for an offset out of
the buffer's bounds if the buffer size was large enough to allow an integer
wrap. Let's perform explicit checks and use unsigned ints for offsets instead
of risking being hit later.

13 years agoMEDIUM: acl: implement payload and payload_lv
Willy Tarreau [Wed, 25 Apr 2012 16:46:33 +0000 (18:46 +0200)] 
MEDIUM: acl: implement payload and payload_lv

These ones were easy to adapt to ACL usage and may really be useful,
so let's make them available right now. It's likely that some extension
such as regex, string-to-IP and raw IP matching will be implemented in
the near future.

13 years agoMEDIUM: acl/pattern: factor out the src/dst address fetches
Willy Tarreau [Wed, 25 Apr 2012 15:31:42 +0000 (17:31 +0200)] 
MEDIUM: acl/pattern: factor out the src/dst address fetches

Since pattern_process() is able to automatically cast returned types
into expected types, we can safely use the sample functions to fetch
addresses whatever their family. The lowest castable type must be
declared with the keyword so that config checks pass.

Right now this means that src/dst use the same fetch function for ACLs
and patterns. src6/dst6 have been kept so that configs which explicitly
rely on v6 are properly checked.

13 years agoMEDIUM: pattern: ensure that sample types always cast into other types.
Willy Tarreau [Wed, 25 Apr 2012 15:21:49 +0000 (17:21 +0200)] 
MEDIUM: pattern: ensure that sample types always cast into other types.

We want to ensure that a dynamically returned type will always have a
cast before calling the cast function. This is done in pattern_process()
and in stktable_fetch_key().

13 years agoMEDIUM: acl/pattern: start merging common sample fetch functions
Willy Tarreau [Wed, 25 Apr 2012 14:21:44 +0000 (16:21 +0200)] 
MEDIUM: acl/pattern: start merging common sample fetch functions

src_port, dst_port and url_param have converged between ACLs and patterns.
This means that src_port is now available in patterns and that urlp_* has
been added to ACLs. Some code has moved to accommodate for static function
definitions, but there were little changes.

13 years agoMEDIUM: acl/pattern: use the same direction scheme
Willy Tarreau [Wed, 25 Apr 2012 08:13:36 +0000 (10:13 +0200)] 
MEDIUM: acl/pattern: use the same direction scheme

Patterns were using a bitmask to indicate if request or response was desired
in fetch functions and keywords. ACLs were using a bitmask in fetch keywords
and a single bit in fetch functions. ACLs were also using an ACL_PARTIAL bit
in fetch functions indicating that a non-final fetch was performed, which was
an abuse of the existing direction flag.

The change now consists in using :
  - a capabilities field for fetch keywords => SMP_CAP_REQ/RES to indicate
    if a keyword supports requests, responses, both, etc...
  - an option field for fetch functions to indicate what the caller expects
    (request/response, final/non-final)

The ACL_PARTIAL bit was reversed to get SMP_OPT_FINAL as it's more explicit
to know we're working on a final buffer than on a non-final one.

ACL_DIR_* were removed, as well as PATTERN_FETCH_*. L4 fetches were improved
to support being called on responses too since they're still available.

The <dir> field of all fetch functions was changed to <opt> which is now
unsigned.

The patch is large but mostly made of cosmetic changes to accomodate this, as
almost no logic change happened.

13 years agoMINOR: tcp: replace acl_fetch_rdp_cookie with smp_fetch_rdp_cookie
Willy Tarreau [Mon, 23 Apr 2012 22:09:26 +0000 (00:09 +0200)] 
MINOR: tcp: replace acl_fetch_rdp_cookie with smp_fetch_rdp_cookie

The former was only a wrapper to the second, let's remove it now that
the calling convention is exactly the same. This is the first function
to be unified between ACLs and samples.

13 years agoMEDIUM: acl: replace acl_expr with args in acl fetch_* functions
Willy Tarreau [Mon, 23 Apr 2012 21:55:44 +0000 (23:55 +0200)] 
MEDIUM: acl: replace acl_expr with args in acl fetch_* functions

Having the args everywhere will make it easier to share fetch functions
between patterns and ACLs. The only place where we could have needed
the expr was in the http_prefetch function which can do well without.

13 years agoMEDIUM: acl/pattern: switch rdp_cookie functions stack up-down
Willy Tarreau [Mon, 23 Apr 2012 21:13:20 +0000 (23:13 +0200)] 
MEDIUM: acl/pattern: switch rdp_cookie functions stack up-down

Previously, both pattern, backend and persist_rdp_cookie would build fake
ACL expressions to fetch an RDP cookie by calling acl_fetch_rdp_cookie().

Now we switch roles. The RDP cookie fetch function is provided as a sample
fetch function that all others rely on, including ACL. The code is exactly
the same, only the args handling moved from expr->args to args. The code
was moved to proto_tcp.c, but probably that a dedicated file would be more
suited to content handling.

13 years agoMEDIUM: pattern: retrieve the sample type in the sample, not in the keyword description
Willy Tarreau [Mon, 23 Apr 2012 20:38:26 +0000 (22:38 +0200)] 
MEDIUM: pattern: retrieve the sample type in the sample, not in the keyword description

We need the pattern fetchers and converters to correctly set the output type
so that they can be used by ACL fetchers. By using the sample type instead of
the keyword type, we also open the possibility to create some multi-type
pattern fetch methods later (eg: "src" being v4/v6). Right now the type in
the keyword is used to validate the configuration.

13 years agoMEDIUM: pattern: integrate pattern_data into sample and use sample everywhere
Willy Tarreau [Mon, 23 Apr 2012 20:03:39 +0000 (22:03 +0200)] 
MEDIUM: pattern: integrate pattern_data into sample and use sample everywhere

Now there is no more reference to union pattern_data. All pattern fetch and
conversion functions now make use of the common sample type. Note: none of
them adjust the type right now so it's important to do it next otherwise
we would risk sharing such functions with ACLs and seeing them fail.

13 years agoMINOR: pattern: replace struct pattern with struct sample
Willy Tarreau [Mon, 23 Apr 2012 19:35:11 +0000 (21:35 +0200)] 
MINOR: pattern: replace struct pattern with struct sample

This change is pretty minor. Struct pattern is only used for
pattern_process() now so changing it to use the common type is
quite obvious. It's worth noting that the last argument of
pattern_process() is never used so the function is self-sufficient.

Note that pattern_process() does not initialize the pattern at all
before calling fetch->process(), and that minimal initialization
will be required when we later change the argument for the sample.

13 years agoMEDIUM: get rid of SMP_F_READ_ONLY and SMP_F_MUST_FREE
Willy Tarreau [Mon, 23 Apr 2012 17:25:44 +0000 (19:25 +0200)] 
MEDIUM: get rid of SMP_F_READ_ONLY and SMP_F_MUST_FREE

These ones were either unused or improperly used. Some integers were marked
read-only, which does not make much sense. Buffers are not read-only, they're
"constant" in that they must be kept intact after any possible change.

13 years agoMEDIUM: acl: get rid of the SET_RES flags
Willy Tarreau [Mon, 23 Apr 2012 17:18:42 +0000 (19:18 +0200)] 
MEDIUM: acl: get rid of the SET_RES flags

We now simply rely on a boolean result from a fetch to declare a match.
Booleans are not compared against patterns, they fix the result.

13 years agoMEDIUM: pattern/acl: get rid of temp_pattern in ACLs
Willy Tarreau [Mon, 23 Apr 2012 16:53:56 +0000 (18:53 +0200)] 
MEDIUM: pattern/acl: get rid of temp_pattern in ACLs

This one is not needed anymore as we can return the data and its type in the
sample provided by the caller. ACLs now always return the proper type. BOOL
is already returned when the result is expected to be processed as a boolean.

temp_pattern has been unexported now.

13 years agoMAJOR: acl: make use of the new sample struct and get rid of acl_test
Willy Tarreau [Mon, 23 Apr 2012 14:16:37 +0000 (16:16 +0200)] 
MAJOR: acl: make use of the new sample struct and get rid of acl_test

This change is invasive in lines of code but not much in terms of
functionalities as it's mainly a replacement of struct acl_test
with struct sample.

13 years agoMEDIUM: pattern: add new sample types to replace pattern types
Willy Tarreau [Fri, 20 Apr 2012 18:49:27 +0000 (20:49 +0200)] 
MEDIUM: pattern: add new sample types to replace pattern types

The new sample types are necessary for the acl-pattern convergence.
These types are boolean and signed int. Some types were renamed for
less ambiguity (ip->ipv4, integer->uint).

13 years agoMINOR: pattern: add a new 'sample' type to store fetched data
Willy Tarreau [Mon, 23 Apr 2012 12:24:58 +0000 (14:24 +0200)] 
MINOR: pattern: add a new 'sample' type to store fetched data

The pattern type is ambiguous because a pattern is only a type and a data
part, and is normally used to match against samples. Currently, patterns
cannot hold information related to the life of the data which was extracted.
We don't want to overload patterns either, so let's add a new "sample" type
which will progressively supersede the acl_test and maybe the pattern at most
places. The sample shares similar information with patterns and also has flags
describing the data volatility and protection.

13 years agoMEDIUM: acl: remove the ACL_TEST_F_NULL_MATCH flag
Willy Tarreau [Fri, 20 Apr 2012 16:16:26 +0000 (18:16 +0200)] 
MEDIUM: acl: remove the ACL_TEST_F_NULL_MATCH flag

This flag was used to force a boolean match even if there was no pattern
to match. It was used only by http_auth() and designed only for this one.
It's easier and cleaner to make the fetch function perform the test and
report the boolean result as a few other functions already do. It simplifies
the acl_exec_cond() logic and will help merging ACLs and patterns.

13 years agoMEDIUM: pattern: report the precise argument parsing error when known.
Willy Tarreau [Fri, 20 Apr 2012 14:04:47 +0000 (16:04 +0200)] 
MEDIUM: pattern: report the precise argument parsing error when known.

The argument parser knows what exact error it has faced, and the pattern
parser is able to report errors, so let's make use of it. From now on, it
becomes possible to detect such things :

$ ./haproxy -db -f echo5.cfg
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:38] : 'stick': invalid arg 2 in fetch method 'payload' : Missing arguments (got 1/2), type 'unsigned integer' expected.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:39] : 'stick': invalid args in fetch method 'payload' : payload length must be > 0.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:40] : 'stick': invalid arg 3 in fetch method 'payload_lv' : Failed to parse 'x' as type 'signed integer'.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:41] : 'stick': invalid arg 4 in fetch method 'payload_lv' : End of arguments expected at ',13'.
[ALERT] 110/160344 (4791) : Error(s) found in configuration file : echo5.cfg
[ALERT] 110/160344 (4791) : Fatal errors found in configuration.

13 years agoMEDIUM: pattern: add an argument validation callback to pattern descriptors
Willy Tarreau [Fri, 20 Apr 2012 13:52:36 +0000 (15:52 +0200)] 
MEDIUM: pattern: add an argument validation callback to pattern descriptors

This is used to validate that arguments are coherent. For instance,
payload_lv expects that the last arg (if any) is not more negative
than the sum of the first two. The error is reported if any.

13 years agoMEDIUM: pattern: use the standard arg parser
Willy Tarreau [Fri, 20 Apr 2012 12:45:49 +0000 (14:45 +0200)] 
MEDIUM: pattern: use the standard arg parser

We don't need the pattern-specific args parsers anymore, make use of the
common parser instead. We still need to improve this by adding a validation
function to report abnormal argument values or combinations. We don't report
precise parsing errors yet but this was not previously done either.

13 years agoMEDIUM: pattern: get rid of arg_i in all functions making use of arguments
Willy Tarreau [Fri, 20 Apr 2012 12:03:29 +0000 (14:03 +0200)] 
MEDIUM: pattern: get rid of arg_i in all functions making use of arguments

arg_i was almost unused, and since we migrated to use struct arg everywhere,
the rare cases where arg_i was needed could be replaced by switching to
arg->type = ARGT_STOP.

13 years agoMEDIUM: pattern: replace type pattern_arg with type arg
Willy Tarreau [Fri, 20 Apr 2012 10:29:52 +0000 (12:29 +0200)] 
MEDIUM: pattern: replace type pattern_arg with type arg

arg is more complete than pattern_arg since it also covers ACL args,
so let's use this one instead.

13 years agoMEDIUM: acl: remove unused tests for missing args when args are mandatory
Willy Tarreau [Fri, 20 Apr 2012 09:37:56 +0000 (11:37 +0200)] 
MEDIUM: acl: remove unused tests for missing args when args are mandatory

A number of ACL fetch methods use mandatory arguments (eg: proxy names) so
it's pointless to test for the presence of this argument now.

13 years agoMAJOR: acl: ensure that implicit table and proxies are valid
Willy Tarreau [Thu, 19 Apr 2012 21:35:54 +0000 (23:35 +0200)] 
MAJOR: acl: ensure that implicit table and proxies are valid

A large number of ACLs make use of frontend, backend or table names in their
arguments, and fall back to the current proxy when no argument is passed. If
the expected capability is not available, the ACL silently fails at runtime.

Now we make all those names mandatory in the parser and we rely on
acl_find_targets() to replace the missing names with the holding proxy,
then to perform the appropriate tests, and to reject errors at parsing
time.

It is possible that some faulty configurations will get rejected from now
on, while they used to silently fail till now. This is the reason why this
change is marked as MAJOR.

13 years agoMAJOR: acl: make acl_find_targets also resolve proxy names at config time
Willy Tarreau [Thu, 19 Apr 2012 17:28:33 +0000 (19:28 +0200)] 
MAJOR: acl: make acl_find_targets also resolve proxy names at config time

Proxy names are now resolved when the config is parsed and not at runtime.
This means that errors will be caught for real instead of having an ACL
silently never match. Another benefit is that the fetch will be much faster
since the lookup will not have to be performed anymore, eg for all ACLs
based on explicitly named stick-tables.

However some buggy configurations which used to silently fail in the past
will now refuse to load, hence the MAJOR tag.

13 years agoMEDIUM: acl: acl_find_target() now resolves arguments based on their types
Willy Tarreau [Thu, 19 Apr 2012 17:11:13 +0000 (19:11 +0200)] 
MEDIUM: acl: acl_find_target() now resolves arguments based on their types

This function does not rely on the keyword anymore but just on its type.
It's much cleaner and much safer. It should be extended to do the same for
all PRX type arguments.

13 years agoMAJOR: acl: store the ACL argument types in the ACL keyword declaration
Willy Tarreau [Thu, 19 Apr 2012 16:42:05 +0000 (18:42 +0200)] 
MAJOR: acl: store the ACL argument types in the ACL keyword declaration

The types and minimal number of ACL keyword arguments are now stored in
their declaration. This will allow many more fantasies if some ACL use
several arguments or types.

Doing so required to rework all ACL keyword declarations to add two
parameters. So this was a good opportunity for a general cleanup and
to sort all entries in alphabetical order.

We still have two pending issues :
  - parse_acl_expr() checks for errors but has no way to report them to
    the user ;
  - the types of some arguments are still not resolved and kept as strings
    (eg: ARGT_FE/BE/TAB) for compatibility reasons, which must be resolved
    in acl_find_targets()

13 years agoMAJOR: acl: make use of the new argument parsing framework
Willy Tarreau [Thu, 19 Apr 2012 15:16:54 +0000 (17:16 +0200)] 
MAJOR: acl: make use of the new argument parsing framework

The ACL parser now uses the argument parser to build a typed argument list.
Right now arguments are all strings and only one argument is supported since
this is what ACLs currently support.

13 years agoMEDIUM: add a new typed argument list parsing framework
Willy Tarreau [Thu, 19 Apr 2012 13:24:50 +0000 (15:24 +0200)] 
MEDIUM: add a new typed argument list parsing framework

make_arg_list() builds an array of typed arguments with their values,
that the caller describes how to parse. This will be used to support
multiple arguments for ACLs and patterns, which is currently problematic
and prevents ACLs and patterns from being merged. Up to 7 arguments types
may be enumerated in a single 32-bit word, including their number of
mandatory parts.

At the moment, these files are not used yet, they're only built. Note that
the 4-bit encoding for the type has left only one unused type!

13 years agoMEDIUM: http/acl: make acl_fetch_hdr_{ip,val} rely on acl_fetch_hdr()
Willy Tarreau [Mon, 16 Apr 2012 15:21:11 +0000 (17:21 +0200)] 
MEDIUM: http/acl: make acl_fetch_hdr_{ip,val} rely on acl_fetch_hdr()

These two functions will now exploit the return of acl_fetch_hdr() instead
of doing the same work again and again.

13 years agoMEDIUM: http/acl: merge all request and response ACL fetches of headers and cookies
Willy Tarreau [Mon, 16 Apr 2012 14:26:40 +0000 (16:26 +0200)] 
MEDIUM: http/acl: merge all request and response ACL fetches of headers and cookies

Latest changes have made it possible to remove all differences between
request and response processing, making it worth merging request and
response ACL fetch functions to reduce code size.

Most likely with minor adaptation it will be possible to use the same hdr_*
functions to match in the response path, and cook_* for the response cookie
too.

13 years agoBUG/MINOR: http_auth: ACLs are volatile, not permanent
Willy Tarreau [Mon, 16 Apr 2012 13:00:51 +0000 (15:00 +0200)] 
BUG/MINOR: http_auth: ACLs are volatile, not permanent

ACLs are volatile since they require a fetch of request buffer data which is
then copied to a temporary shared place. The issue is minor though since auth
is generally checked very early.

13 years agoMEDIUM: http: make all ACL fetch function use acl_prefetch_http()
Willy Tarreau [Mon, 16 Apr 2012 12:42:55 +0000 (14:42 +0200)] 
MEDIUM: http: make all ACL fetch function use acl_prefetch_http()

All ACLs which need to process HTTP contents first call this function which
performs all the preliminary tests and also triggers the request parsing if
needed. A macro was written to simplify the code.

As a side effect, it's not required anymore to check for the HTTP ACL before
checking for HTTP contents.

13 years agoMEDIUM: http: add a prefetch function for ACL pattern fetch
Willy Tarreau [Mon, 16 Apr 2012 12:34:04 +0000 (14:34 +0200)] 
MEDIUM: http: add a prefetch function for ACL pattern fetch

This function will be called by all ACL fetch functions. Right now all ACL
fetch functions have to perform the exact same tests to check whether data
are available. Also, only one of them is able to actually parse an HTTP
request.

Using the prefetch function, it will be possible to try to parse a request
on the fly and to avoid the fetch if some data are missing. This will
significantly reduce the amount of tests in all ACL fetch functions.

13 years agoMEDIUM: buffers: rename a number of buffer management functions
Willy Tarreau [Mon, 7 May 2012 09:56:55 +0000 (11:56 +0200)] 
MEDIUM: buffers: rename a number of buffer management functions

The following renaming took place :
1) buffer input functions
  buffer_put_block => bi_putblk
  buffer_put_char => bi_putchr
  buffer_put_string => bi_putstr
  buffer_put_chunk => bi_putchk
  buffer_feed => bi_putstr
  buffer_feed_chunk => bi_putchk
  buffer_cut_tail => bi_erase
  buffer_ignore => bi_fast_delete

2) buffer output functions
  buffer_get_char => bo_getchr
  buffer_get_line => bo_getline
  buffer_get_block => bo_getblk
  buffer_skip => bo_skip
  buffer_write => bo_inject

3) buffer input avail/full functions were introduced :
  bi_avail
  bi_full

13 years agoMEDIUM: buffers: implement b_adv() to advance a buffer's pointer
Willy Tarreau [Sat, 5 May 2012 21:32:27 +0000 (23:32 +0200)] 
MEDIUM: buffers: implement b_adv() to advance a buffer's pointer

This is more convenient and efficient than buf->p = b_ptr(buf, n);
It simply advances the buffer's pointer by <n> and trasfers that
amount of bytes from <in> to <out>. The BF_OUT_EMPTY flag is updated
accordingly.

A few occurrences of such computations in buffers.c and stream_sock.c
were updated to use b_adv(), which resulted in a small code shrink.

13 years agoMEDIUM: buffers: add new pointer wrappers and get rid of almost all buffer_wrap_add...
Willy Tarreau [Fri, 4 May 2012 19:35:27 +0000 (21:35 +0200)] 
MEDIUM: buffers: add new pointer wrappers and get rid of almost all buffer_wrap_add calls

buffer_wrap_add was convenient for the migration but is not handy at all.
Let's have new wrappers that report input begin/end and output begin/end
instead.

It looks like we'll also need a b_adv(ofs) to advance a buffer's pointer.

13 years agoMEDIUM: buffers: fix unsafe use of buffer_ignore at some places
Willy Tarreau [Fri, 9 Mar 2012 14:03:30 +0000 (15:03 +0100)] 
MEDIUM: buffers: fix unsafe use of buffer_ignore at some places

buffer_ignore may only be used when the output of a buffer is empty,
but it's not granted it is always the case when sending HTTP error
responses. Better use buffer_cut_tail() instead, and use buffer_ignore
only on non-wrapping data.

13 years agoMINOR: http: remove useless wrapping checks in http_msg_analyzer
Willy Tarreau [Fri, 9 Mar 2012 13:46:19 +0000 (14:46 +0100)] 
MINOR: http: remove useless wrapping checks in http_msg_analyzer

The message cannot wrap here.

13 years agoMEDIUM: http: remove buffer arg in chunk parsing functions
Willy Tarreau [Fri, 9 Mar 2012 13:10:20 +0000 (14:10 +0100)] 
MEDIUM: http: remove buffer arg in chunk parsing functions

The buffer pointer is now taken from the http_msg in the following
functions :

http_parse_chunk_size
http_forward_trailers
http_skip_chunk_crlf

Most internal pointers were converted to const as the result of the
operation.

13 years agoMEDIUM: http: remove buffer arg in http_buffer_heavy_realign
Willy Tarreau [Fri, 9 Mar 2012 12:58:04 +0000 (13:58 +0100)] 
MEDIUM: http: remove buffer arg in http_buffer_heavy_realign

The buffer pointer is now taken from the http_msg. The function has also
been renamed "http_message_realign".

13 years agoMEDIUM: http: remove buffer arg in http_upgrade_v09_to_v10
Willy Tarreau [Fri, 9 Mar 2012 12:56:20 +0000 (13:56 +0100)] 
MEDIUM: http: remove buffer arg in http_upgrade_v09_to_v10

The buffer and http_msg pointers are now taken from the transaction.

13 years agoMEDIUM: http: remove buffer arg in http_msg_analyzer
Willy Tarreau [Fri, 9 Mar 2012 12:50:57 +0000 (13:50 +0100)] 
MEDIUM: http: remove buffer arg in http_msg_analyzer

The buffer pointer is now taken from the http_msg.

13 years agoMEDIUM: http: remove buffer arg in http_capture_bad_message
Willy Tarreau [Fri, 9 Mar 2012 12:39:23 +0000 (13:39 +0100)] 
MEDIUM: http: remove buffer arg in http_capture_bad_message

The buffer pointer is now taken from the http_msg.

13 years agoMEDIUM: http: remove buffer arg in a few header manipulation functions
Willy Tarreau [Fri, 9 Mar 2012 12:30:45 +0000 (13:30 +0100)] 
MEDIUM: http: remove buffer arg in a few header manipulation functions

The buffer pointer is now taken from the http_msg in the following functions :

 - http_remove_header2
 - http_header_add_tail
 - http_header_add_tail2
 - http_parse_connection_header
 - http_change_connection_header

13 years agoMEDIUM: http: http_send_name_header: remove references to msg and buffer
Willy Tarreau [Fri, 9 Mar 2012 11:11:57 +0000 (12:11 +0100)] 
MEDIUM: http: http_send_name_header: remove references to msg and buffer

They can be deduced from txn.

13 years agoMAJOR: http: make http_msg->sol relative to buffer's origin
Willy Tarreau [Fri, 9 Mar 2012 20:39:51 +0000 (21:39 +0100)] 
MAJOR: http: make http_msg->sol relative to buffer's origin

msg->sol is now a relative pointer just like all other ones. There is no
more absolute references to the buffer outside the struct buffer itself.

Next two cleanups should include removing buffer references to functions
which already have an msg, and removal of wrapping detection in request
and response parsing which cannot wrap by definition.

13 years agoMEDIUM: http: add a pointer to the buffer in http_msg
Willy Tarreau [Fri, 9 Mar 2012 10:32:30 +0000 (11:32 +0100)] 
MEDIUM: http: add a pointer to the buffer in http_msg

ACLs and patterns only rely on a struct http_msg and don't know the pointer
to the actual data. struct http_msg will soon only hold relative references
so that's not possible. We need http_msg to hold a reference to the struct
buffer before having relative pointers everywhere.

It is likely that doing so will also result in opportunities to simplify
a number of functions arguments. The following functions are already
candidate :

http_buffer_heavy_realign
http_capture_bad_message
http_change_connection_header
http_forward_trailers
http_header_add_tail
http_header_add_tail2
http_msg_analyzer
http_parse_chunk_size
http_parse_connection_header
http_remove_header2
http_send_name_header
http_skip_chunk_crlf
http_upgrade_v09_to_v10

13 years agoMAJOR: http: turn http_msg->eol to a buffer-relative offset
Willy Tarreau [Mon, 5 Mar 2012 15:57:34 +0000 (16:57 +0100)] 
MAJOR: http: turn http_msg->eol to a buffer-relative offset

It was an absolute pointer to the buffer's data, now it's a pointer relative
to the buffer's origin.

13 years agoCLEANUP: http: remove unused http_msg->col
Willy Tarreau [Fri, 9 Mar 2012 20:28:54 +0000 (21:28 +0100)] 
CLEANUP: http: remove unused http_msg->col

The <col> element of the struct http_msg has not been used for a long
time now, remove it.

13 years agoMAJOR: http: change msg->{som,col,sov,eoh} to be relative to buffer origin
Willy Tarreau [Mon, 5 Mar 2012 14:52:30 +0000 (15:52 +0100)] 
MAJOR: http: change msg->{som,col,sov,eoh} to be relative to buffer origin

These offsets were relative to the buffer itself. Now they're relative to
the buffer's origin (buf->p) which normally corresponds to the start of
current message.

This saves a big dependency between the HTTP message struct and the buffers.
It appeared during this change that ->col is not used anymore (it will have
to be removed). Next step is to turn ->eol and ->sol from absolute to relative.

13 years agoMAJOR: http: move buffer->lr to http_msg->next
Willy Tarreau [Mon, 5 Mar 2012 10:17:50 +0000 (11:17 +0100)] 
MAJOR: http: move buffer->lr to http_msg->next

The buffer's pointer <lr> was only used by HTTP parsers which also use a
struct http_msg to keep track of the parser's state. We've reached a point
where it makes no sense to keep ->lr in the buffer, as the split between
buffer and msg is only arbitrary for historical reasons.

This change ensures that touching buffers will not impact HTTP messages
anymore, making the buffers more content-agnostic. However, it becomes
very important not to forget to update msg->next when some data get
forwarded or moved (and in general each time buf->p is updated).

The new pointer in http_msg becomes relative to buffer->p so that
parsing multiple messages becomes easier. It is possible that at one
point ->som and ->next will be merged.

Note: http_parse_reqline() and http_parse_stsline() have been temporarily
modified to know the message starting point in the buffer (->p).

13 years agoMAJOR: buffers: replace buf->r with buf->p + buf->i
Willy Tarreau [Fri, 2 Mar 2012 19:14:45 +0000 (20:14 +0100)] 
MAJOR: buffers: replace buf->r with buf->p + buf->i

This change gets rid of buf->r which is always equal to buf->p + buf->i.
It removed some wrapping detection at a number of places, but required addition
of new relative offset computations at other locations. A large number of places
can be simplified now with extreme care, since most of the time, either the
pointer has to be computed once or we need a difference between the old ->w and
old ->r to compute free space. The cleanup will probably happen with the rewrite
of the buffer_input_* and buffer_output_* functions anyway.

buf->lr still has to move to the struct http_msg and be relative to buf->p
for the rework to be complete.

13 years agoMAJOR: buffers: replace buf->w with buf->p - buf->o
Willy Tarreau [Fri, 2 Mar 2012 15:13:16 +0000 (16:13 +0100)] 
MAJOR: buffers: replace buf->w with buf->p - buf->o

This change introduces the buffer's base pointer, which is the limit between
incoming and outgoing data. It's the point where the parsing should start
from. A number of computations have already been greatly simplified, but
more simplifications are expected to come from the removal of buf->r.

The changes appear good and have revealed occasional improper use of some
pointers. It is possible that this patch has introduced bugs or revealed
some, although preliminary testings tend to indicate that everything still
works as it should.

13 years agoMINOR: buffers: remove unused function buffer_contig_data()
Willy Tarreau [Fri, 2 Mar 2012 10:36:00 +0000 (11:36 +0100)] 
MINOR: buffers: remove unused function buffer_contig_data()

This one was never used and is buggy. It will be easier to rewrite
it when the buffer rework is complete.

13 years agoMINOR: buffers: provide simple pointer normalization functions
Willy Tarreau [Fri, 2 Mar 2012 09:38:01 +0000 (10:38 +0100)] 
MINOR: buffers: provide simple pointer normalization functions

Add buffer_wrap_sub() and buffer_wrap_add() to normalize buffer pointers
after an addition or subtract.

13 years agoMAJOR: buffer: replace buf->l with buf->{o+i}
Willy Tarreau [Thu, 1 Mar 2012 17:19:58 +0000 (18:19 +0100)] 
MAJOR: buffer: replace buf->l with buf->{o+i}

We don't have buf->l anymore. We have buf->i for pending data and
the total length is retrieved by adding buf->o. Some computation
already become simpler.

Despite extreme care, bugs are not excluded.

It's worth noting that msg->err_pos as set by HTTP request/response
analysers becomes relative to pending data and not to the beginning
of the buffer. This has not been completed yet so differences might
occur when outgoing data are left in the buffer.

13 years agoMAJOR: buffer rework: replace ->send_max with ->o
Willy Tarreau [Thu, 1 Mar 2012 15:08:30 +0000 (16:08 +0100)] 
MAJOR: buffer rework: replace ->send_max with ->o

This is the first minor step of the buffer rework. It's only renaming,
it should have no impact.

13 years agoDOC: add a diagram to explain how circular buffers work
Willy Tarreau [Mon, 27 Feb 2012 18:31:50 +0000 (19:31 +0100)] 
DOC: add a diagram to explain how circular buffers work

Also add some thoughts about the existing and new design.

Note: an earlier design used the names "head" and "tail" for both sides
of the buffer, but it appears awkward as these words may be understood
in two forms (feed by head, output by tail, or make the newcomers wait
at the tail of the queue). Also there were already a few functions in the
code making use of either terminology. So better avoid this terminology
and use "input" and "output" instead.

13 years agoMEDIUM: move message-related flags from transaction to message
Willy Tarreau [Fri, 17 Feb 2012 16:39:37 +0000 (17:39 +0100)] 
MEDIUM: move message-related flags from transaction to message

Too many flags are stored in the transaction structure. Some flags are
clearly message-specific and exist in two versions (request and response).
Move them to a new "flags" field in the http_message struct instead.

13 years agoCLEANUP: remove a few warning about unchecked return values in debug code
Willy Tarreau [Sun, 29 Apr 2012 12:11:38 +0000 (14:11 +0200)] 
CLEANUP: remove a few warning about unchecked return values in debug code

There were a few unchecked write() calls in the debug code that cause
gcc 4.x to emit warnings on recent libc. We don't want to check them
as we can't make anything from the result, let's simply surround them
with an empty if statement.

Note that one of the warnings was for chdir("/") which normally cannot
fail since it follows a successful chroot (which means the perms are
necessarily there). Anyway let's move the call uppe to protect it too.

13 years agoMINOR: standard: add a memprintf() function to build formatted error messages
Willy Tarreau [Fri, 27 Apr 2012 09:16:50 +0000 (11:16 +0200)] 
MINOR: standard: add a memprintf() function to build formatted error messages

memprintf() is just like snprintf() except that it always returns a properly
sized allocated string that the caller is responsible for freeing. NULL is
returned on serious errors. It also supports stackable calls over the same
pointer since it offers support for automatically freeing a previous one :

     memprintf(&err, "invalid argument: '%s'", arg);
     ...
     memprintf(&err, "keyword parser said: <%s>", *err);
     ...
     memprintf(&err, "line parser said: %s\n", *err);
     ...
     free(*err);

13 years agoCLEANUP: http: message parser must ignore HTTP_MSG_ERROR
Willy Tarreau [Mon, 16 Apr 2012 12:51:55 +0000 (14:51 +0200)] 
CLEANUP: http: message parser must ignore HTTP_MSG_ERROR

The issue only happens when DEBUG_FULL is enabled, which causes
http_msg_analyzer() to complain if it's called twice with an invalid
message, for instance because of two consecutive ACLs using req_proto_http.

The code is commented out when DEBUG_FULL is disabled, so this is not a bug,
just an annoyance for the developer.

13 years agoBUILD: http: stop gcc-4.1.2 from complaining about possibly uninitialized values
Willy Tarreau [Wed, 11 Apr 2012 15:28:40 +0000 (17:28 +0200)] 
BUILD: http: stop gcc-4.1.2 from complaining about possibly uninitialized values

The three warnings below are totally wrong since the variables depend on another
one which is only turned on when the variables are initialized. Still this gcc-4.1.2
isn't able to see this and prefers to complain wrongly. So let's initialize the
variables to shut it up since we're not in the fast path.

src/proto_http.c: In function 'acl_fetch_any_cookie_cnt':
src/proto_http.c:8393: warning: 'val_end' may be used uninitialized in this function

src/proto_http.c: In function 'http_process_req_stat_post':
src/proto_http.c:2577: warning: 'st_next_param' may be used uninitialized in this function
src/proto_http.c:2577: warning: 'st_cur_param' may be used uninitialized in this function

13 years agoBUILD: http: make extract_cookie_value() return an int not size_t
Willy Tarreau [Wed, 11 Apr 2012 15:21:08 +0000 (17:21 +0200)] 
BUILD: http: make extract_cookie_value() return an int not size_t

It's very annoying that we have to deal with the crappy size_t and with ints
at some places because these ones don't mix well. Patch 6f61b2 changed the
chunk len to int but its size remains size_t and some functions are having
trouble being used by several callers depending on the type of their arguments.

Let's turn extract_cookie_value() to int for now on, and plan a massive cleanup
later to remove all size_t.

13 years agoDOC: fix some keywords arguments documentation
Cyril Bonté [Sat, 21 Apr 2012 21:30:29 +0000 (23:30 +0200)] 
DOC: fix some keywords arguments documentation

- Typo on "dispatch" keyword arguments.
- Reindent some blocks for better parsing by automated tools.
- "option mysql-check" and "option pgsql-check" arguments were not documented
  as the others.

13 years agoMINOR: cli: display the 4 IP addresses and ports on "show sess XXX"
Daniel Schultze [Fri, 23 Mar 2012 17:53:36 +0000 (10:53 -0700)] 
MINOR: cli: display the 4 IP addresses and ports on "show sess XXX"

I have modified dumpstats.c to show additional information for the show
session <id> command on the statistics socket. This will dump the
public, frontend, backend, and server ip/tcp addresses and port. We
found it useful to have this information available in real time and
could not find another way of getting this information.

13 years agoBUG/MINOR: acl: req_ssl_sni would randomly fail if a session ID is present
Willy Tarreau [Mon, 9 Apr 2012 07:24:11 +0000 (09:24 +0200)] 
BUG/MINOR: acl: req_ssl_sni would randomly fail if a session ID is present

The wrong byte was checked for the session_id length in the payload. This
used to work when the session ID was absent because zero was found there,
but when a session ID is present, there is 1/256 chance that the inspected
data contains 0x20 (the actual session ID length), so it fails.

Thanks to Emmanuel Bézagu for reporting this bug.

This bug does not need backporting, it is 1.5 specific.

13 years agoDOC: cleanup indentation, alignment, columns and chapters
Cyril Bonté [Sun, 8 Apr 2012 19:57:39 +0000 (21:57 +0200)] 
DOC: cleanup indentation, alignment, columns and chapters

This patch is a group commit simplify the parsing of the documenation :
- remove remaining tabulations
- realign some lines
- break lines at 80 columns
- add missing chapters in the summary
- fix chapter numbering format

13 years agoMEDIUM: stream_sock: add a get_src and get_dst callback and remove SN_FRT_ADDR_SET
Willy Tarreau [Sat, 7 Apr 2012 16:03:52 +0000 (18:03 +0200)] 
MEDIUM: stream_sock: add a get_src and get_dst callback and remove SN_FRT_ADDR_SET

These callbacks are used to retrieve the source and destination address
of a socket. The address flags are not hold on the stream interface and
not on the session anymore. The addresses are collected when needed.

This still needs to be improved to store the IP and port separately so
that it is not needed to perform a getsockname() when only the IP address
is desired for outgoing traffic.

13 years agoMINOR: log: log-format: usable without httplog and tcplog
William Lallemand [Mon, 2 Apr 2012 14:22:10 +0000 (16:22 +0200)] 
MINOR: log: log-format: usable without httplog and tcplog

Options httplog and tcplog aren't mandatory anymore for the log-format.
The LW_ flags are now set during the log-format string parsing.

13 years agoMEDIUM: log: Unique ID
William Lallemand [Mon, 12 Mar 2012 11:48:57 +0000 (12:48 +0100)] 
MEDIUM: log: Unique ID

The Unique ID, is an ID generated with several informations. You can use
a log-format string to customize it, with the "unique-id-format" keyword,
and insert it in the request header, with the "unique-id-header" keyword.

13 years agoMEDIUM: log: New format-log flags: %Fi %Fp %Si %Sp %Ts %rt %H %pid
William Lallemand [Thu, 5 Apr 2012 16:02:55 +0000 (18:02 +0200)] 
MEDIUM: log: New format-log flags: %Fi %Fp %Si %Sp %Ts %rt %H %pid

%Fi: Frontend IP
%Fp: Frontend Port
%Si: Server IP
%Sp: Server Port
%Ts: Timestamp
%rt: HTTP request counter
%H: hostname
%pid: PID

+X: Hexadecimal represenation

The +X mode in logformat displays hexadecimal for the following flags
%Ci %Cp %Fi %Fp %Bi %Bp %Si %Sp %Ts %ct %pid

rename logformat_write_string() to lf_text()

Optimize size computation

13 years agoMEDIUM: log: split of log_format generation
William Lallemand [Mon, 12 Mar 2012 11:46:41 +0000 (12:46 +0100)] 
MEDIUM: log: split of log_format generation

* logformat functions now take a format linked list as argument
* build_logline() build a logline using a format linked list
* rename LOG_* by LOG_FMT_* in enum
* improve error management in build_logline()

13 years agoCLEANUP: Fix some minor whitespace issues
Aman Gupta [Sat, 7 Apr 2012 00:39:26 +0000 (17:39 -0700)] 
CLEANUP: Fix some minor whitespace issues

13 years agoMINOR: Add TO/FROM_SET flags to struct stream_interface
Aman Gupta [Tue, 3 Apr 2012 01:57:55 +0000 (18:57 -0700)] 
MINOR: Add TO/FROM_SET flags to struct stream_interface

[WT: it will make sense to remove SN_FRT_ADDR_SET and to use these
  flags everywhere instead ]

13 years agoCLEANUP: lb_first: add reference to a paper describing the original idea
Willy Tarreau [Sat, 7 Apr 2012 07:08:45 +0000 (09:08 +0200)] 
CLEANUP: lb_first: add reference to a paper describing the original idea

The original idea behind this implementation has been published in the
paper below :

   http://reports-archive.adm.cs.cmu.edu/anon/2012/CMU-CS-12-109.pdf

13 years agoMEDIUM: http: add cookie and scookie ACLs
Willy Tarreau [Fri, 6 Apr 2012 16:57:55 +0000 (18:57 +0200)] 
MEDIUM: http: add cookie and scookie ACLs

The ACL matches rely on the extract_cookie_value() function as used for
for patterns. This permits ACLs to match cookie values based on the cookie
name instead of having to perform substring matching on the cookie header.

13 years agoMEDIUM: http: make extract_cookie_value() iterate over cookie values
Willy Tarreau [Fri, 6 Apr 2012 16:20:06 +0000 (18:20 +0200)] 
MEDIUM: http: make extract_cookie_value() iterate over cookie values

This will make the function usable for ACLs.

13 years agoMEDIUM: log: add a new cookie flag 'U' to report situations where cookie is not used
Willy Tarreau [Thu, 5 Apr 2012 19:18:22 +0000 (21:18 +0200)] 
MEDIUM: log: add a new cookie flag 'U' to report situations where cookie is not used

This happens when a "use-server" rule sets the server instead.

13 years agoMEDIUM: session: implement the "use-server" directive
Willy Tarreau [Thu, 5 Apr 2012 19:09:48 +0000 (21:09 +0200)] 
MEDIUM: session: implement the "use-server" directive

Sometimes it is desirable to forward a particular request to a specific
server without having to declare a dedicated backend for this server. This
can be achieved using the "use-server" rules. These rules are evaluated after
the "redirect" rules and before evaluating cookies, and they have precedence
on them. There may be as many "use-server" rules as desired. All of these
rules are evaluated in their declaration order, and the first one which
matches will assign the server.