Commit Graph

22 Commits

Author SHA1 Message Date
Willy Tarreau e09e0cef62 [MINOR] removed the ->h member in struct buffer
The buffer does not need the header pointer anymore, it has
been removed everywhere.
2007-03-18 16:31:29 +01:00
Willy Tarreau a15645d435 [MAJOR] completed the HTTP response processing.
Now the response is correctly processed in the backend first
then in the frontend. It has followed intensive tests to
catch regressions, and everything seems OK now, but the code
is young anyway.
2007-03-18 16:22:39 +01:00
Willy Tarreau 4b89ad4358 [MINOR] implement http_is_ver_token to fix response parsing
This new character map improves accuracy when parsing HTTP version,
which helps inspecting requests, and fixes response handling.
2007-03-04 18:13:58 +01:00
Willy Tarreau 8d5d7f20b9 [MAJOR] huge rework of the HTTP request FSM
The HTTP parser has been rewritten for better compliance to RFC2616.
The same parser is now usable for both requests and responses, and
it now supports HTTP/0.9 as well as multi-line headers. It has also
been improved for speed ; a typicial HTTP request is parsed in about
2 microseconds on a 1 GHz processor.

The monitor-uri check has been moved so that the requests are not
logged. The httpclose option now tries to change as little as
possible in the request, and does not affect the first header if
it is already set to 'close'. HTTP/0.9 requests are converted to
HTTP/1.0 before being forwarded.

Headers and request transformations are now distinct. The headers
list is updated after each insertion/removal/transformation. The
request is re-parsed and checked after each transformation. It is
not possible anymore to remove a request, and requests which lead
to invalid request lines are now rejected.
2007-01-21 19:16:41 +01:00
Willy Tarreau 964c936b04 [MAJOR] replace the wait-queue linked list with an rbtree.
This patch from Sin Yu makes use of an rbtree for the wait queue,
which will solve the slowdown problem encountered when timeouts
are heterogenous in the configuration. The next step will be to
turn maintain_proxies() into a per-proxy task so that we won't
have to scan them all after each poll() loop.
2007-01-07 02:14:23 +01:00
Willy Tarreau c0dde7a8ed [MAJOR] udpated the stats page to clearly distinguish FEs and BEs
The stats page could not tell the difference between a FE and a BE.
It has been revamped to indicate all relevant information. The font
is also slightly smaller in order for all the info to fit into small
screens. The data output path has been greatly simplified to use
string chunks.
2007-01-01 21:38:07 +01:00
Willy Tarreau 2b5652f9fa [MINOR] indicate the proxy type in the logs after a loss of servers
When the last server goes down in a backend, indicate 'backend' or
'listener' in the log message depending on the type of the backend.
2006-12-31 17:46:05 +01:00
Willy Tarreau 8058743d7a [MEDIUM] errorloc now checked first from backend then from frontend
It is now possible to define an errorloc in the backend as well as
in the frontend. The backend's will be used first, and if undefined,
then the frontend's will be used instead. If none is used, then the
original error messages will be used.
2006-12-24 17:47:20 +01:00
Willy Tarreau 0f77253a22 [MINOR] store HTTP error messages into a chunk array
HTTP error messages were all specific cases handled by an IF.
Now they are all in an array so that it will be easier to add
new ones. Also, the return functions now use chunks as inputs
so that it should be easier to provide alternative return
messages if needed.
2006-12-23 20:51:41 +01:00
Willy Tarreau 830ff458de [MAJOR] reworked ->be, ->fe and ->fi in sessions
There was a confusion about the way to find filters and backend
parameters from sessions. The chaining has been changed between
the session and the proxy.

Now, a session knows only two proxies : one frontend (->fe) and
one backend (->be). Each proxy has a link to the proxy providing
filters and to the proxy providing backend parameters (both self
by default).

The captures (cookies and headers) have been attached to the
frontend's filters for now.

The uri_auth and the statistics are attached to the backend's
filters so that the uri can depend on a hostname for instance.
2006-12-17 19:31:23 +01:00
Willy Tarreau b251390f7e [MEDIUM] moved uri_auth check to a separate function
The check of uri_auth is now in a separate function which is
checked after every backend switch, so that it will be possible
to have an uri_auth for the frontend and another one for the
backend.
2006-12-17 14:52:38 +01:00
Willy Tarreau 58f10d7478 [MAJOR] replaced the client-side HTTP parser with a new one
The new parser uses an FSM to strictly follow RFC2616.
Headers are indexed and parsed only once they're all available.
That way, complex regexes make more sense.

HTTP processing is now performed in several phases by calling
multiple functions, making the code cleaner and easier to read.

Note that req[i]pass does not work anymore because it would
require that we mark a header to be ignored. What is really
needed is to have the ability to add an exception to a matching
(match xx except yy).

Several bugs have been fixed in appsession during the conversion
to the new FSM (method length and recovery on malloc errors).

The code does build and work with the debug examples, but is
not usable yet to connect to anything as it does not forward
the requests yet.
2006-12-04 02:26:12 +01:00
Willy Tarreau b7eba10304 [BUG] files were missing for hdr_idx in previous commit 2006-12-04 02:20:02 +01:00
Willy Tarreau fddaec02ee [CLEANUP] fd.h : regparm was hardcoded. 2006-10-15 22:56:08 +02:00
Willy Tarreau b17916e89b [CLEANUP] add a few "const char *" where appropriate
As suggested by Markus Elfring, a few "const char *" have replaced
some "char *" declarations where a function is not expected to
modify a value. It does not change the code but it helps detecting
coding errors.
2006-10-15 15:17:57 +02:00
Willy Tarreau 2a429503e0 [MINOR] turn every FD_* into functions
On recent CPUs, functions are about twice as fast as inline FD_*, so
there is now a #define CONFIG_HAP_INLINE_FD_SET to choose between the
two modes.
2006-10-15 14:53:07 +02:00
Willy Tarreau f8306d5391 [MEDIUM] got rid of event_{cli,srv}_write() in favor of stream_sock_write()
The timeouts, expiration timers and results are now stored in the buffers.
The timers will have to change a bit to become more flexible, and when the
I/O completion functions will be written, the connect_complete() will have
to be extracted from the write() function.
2006-07-29 19:01:31 +02:00
Willy Tarreau d797128d6e [MEDIUM] got rid of event_{cli,srv}_read() in favor of stream_sock_read() 2006-07-29 18:36:34 +02:00
Willy Tarreau 5446940e37 [MEDIUM] started the changes towards I/O completion callbacks
Now the event_* functions find their buffer in the fdtab itself.
2006-07-29 16:59:06 +02:00
Willy Tarreau e3ba5f0aaa [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00
Willy Tarreau 2dd0d4799e [CLEANUP] renamed include/haproxy to include/common 2006-06-29 17:53:05 +02:00
Willy Tarreau baaee00406 [BIGMOVE] exploded the monolithic haproxy.c file into multiple files.
The files are now stored under :
  - include/haproxy for the generic includes
  - include/types.h for the structures needed within prototypes
  - include/proto.h for function prototypes and inline functions
  - src/*.c for the C files

Most include files are now covered by LGPL. A last move still needs
to be done to put inline functions under GPL and not LGPL.

Version has been set to 1.3.0 in the code but some control still
needs to be done before releasing.
2006-06-26 02:48:02 +02:00