MEDIUM: session: disable lingering on the server when the client aborts

When abortonclose is used and an error is detected on the client side,
better force an RST to the server. That way we propagate to the server
the same vision we got from the client, and we ensure that we won't keep
TIME_WAITs.

(cherry picked from commit 8615c2af67dc2be07bdb246ed13130fe7d32e3d1)
BUG/MINOR: deinit: free fdinfo while doing cleanup

Both fdinfo and fdtab are allocated memory in init() while haproxy is starting,
but only fdtab is freed in deinit(), fdinfo should also be freed.

Signed-off-by: Godbach <nylzhaowei@gmail.com>
(cherry picked from commit 4cc1b0d4ef283b5ace5249483ec7eb3b1fc5d193)
BUG/MEDIUM: server: set the macro for server's max weight SRV_UWGHT_MAX to SRV_UWGHT_RANGE

The max weight of server is 256 now, but SRV_UWGHT_MAX is still 255. As a result,
FWRR will not work well when server's weight is 256. The description is as below:

There are some macros related to server's weight in include/types/server.h:
    #define SRV_UWGHT_RANGE 256
    #define SRV_UWGHT_MAX   (SRV_UWGHT_RANGE - 1)
    #define SRV_EWGHT_MAX   (SRV_UWGHT_MAX   * BE_WEIGHT_SCALE)

Since weight of server can be reach to 256 and BE_WEIGHT_SCALE equals to 16,
the max eweight of server should be 256*16 = 4096, it will exceed SRV_EWGHT_MAX
which equals to SRV_UWGHT_MAX*BE_WEIGHT_SCALE = 255*16 = 4080. When a server
with weight 256 is insterted into FWRR tree during initialization, the key value
of this server should be SRV_EWGHT_MAX - s->eweight = 4080 - 4096 = -16 which
is closed to UINT_MAX in unsigned type, so the server with highest weight will
be not elected as the first server to process request.

In addition, it is a better choice to compare with SRV_UWGHT_MAX than a magic
number 256 while doing check for the weight. The max number of servers for
round-robin algorithm is also updated.

Signed-off-by: Godbach <nylzhaowei@gmail.com>
(cherry picked from commit a34bdc0ea402ea5be1e9d7f80eaddec772b94393)
BUG/MINOR: use the same check condition for server as other algorithms

Such load balance algorithms as roundrobin, leastconn and first will check the
server after being selected with the following condition:
	if (!s->maxconn || (!s->nbpend && s->served < srv_dynamic_maxconn(s)))

But static-rr uses the different one in map_get_server_rr()  as below:
	if (!srv->maxconn || srv->cur_sess < srv_dynamic_maxconn(srv))
After viewing this difference, it is a better choice for static-rr to use the
same check condition as other algorithms.

This change will only affect static-rr. Though all hash algorithms with type
map-based will use the same server map as static-rr, they call another function
map_get_server_hash() to get server.

Signed-off-by: Godbach <nylzhaowei@gmail.com>
(cherry picked from commit 8f9fd2f0a0893761afeb6800c7b62a51d782af0e)
MINOR: config: warn when a server with no specific port uses rdp-cookie

Mathew Levett reported an issue which is a bit nasty and hard to track
down. RDP cookies contain both the IP and the port, and haproxy matches
them exactly. So if a server has no port specified (or a remapped port),
it will never match a port specified in a cookie. Better warn the user
when this is detected.
(cherry picked from commit 82ffa39bfd34e5680cb65cc0b7ef625c0a274856)
MEDIUM: increase chunk-size limit to 2GB-1

Since commit 115acb97, chunk size was limited to 256MB. There is no reason for
such a limit and the comment on the code suggests a missing zero. However,
increasing the limit past 2 GB causes trouble due to some 32-bit subtracts
in various computations becoming negative (eg: buffer_max_len). So let's limit
the chunk size to 2 GB - 1 max.
(cherry picked from commit 431946e9617572d2813bd5a8f5a51ce36f841ea3)
DOC: add a mention about the limited chunk size

We now indicate that PD flags can be returned for chunk sizes >= 2GB.
(cherry picked from commit f3a3e1389e40434da9e1fc295be6ff5a8037effb)