Commit Graph

375 Commits

Author SHA1 Message Date
Willy Tarreau
b3107b9383 [MINOR] pollers should not use MY_FD_* 2007-04-08 09:32:47 +02:00
Willy Tarreau
42c7659669 [RELEASE] Released version 1.3.8.2 with the following changes :
- rewriting either the status line or request line could crash the
      process due to a pointer which ought to be reset before parsing.
    - rewriting the status line in the response did not work, it caused
      a 502 Bad Gateway due to an erroneous state during parsing
2007-04-03 20:30:13 +02:00
Willy Tarreau
a9bd19853e [BUG] initialize msg->sol before parsing first line
Before calling http_parse_{sts,req}line(), it is necessary
to make msg->sol point to the beginning of the line. This
was not done, resulting in the proxy sometimes crashing when
URI rewriting or result rewriting was used.
2007-04-03 20:03:18 +02:00
Willy Tarreau
02785764a4 [BUG] Status line in HTTP response could not be rewritten
Typo implied use of HTTP_MSG_RQMETH state instead of HTTP_MSG_RPVER.
2007-04-03 14:45:44 +02:00
Willy Tarreau
1e443e9084 [CONTRIB] the URLs in the SPEC files were obsolete 2007-04-01 11:37:02 +02:00
Willy Tarreau
ef6d7612d6 [RELEASE] Released version 1.3.8.1 with the following changes :
- fix reqadd when no option httpclose is used.
    - removed now unused fiprm and beprm from proxies
    - split logs into two versions : TCP and HTTP
    - added some docs about http headers storage and acls
    - added a VIM script for syntax color highlighting (Bruno Michel)
2007-04-01 11:06:22 +02:00
Willy Tarreau
f40110248b [CONTRIB] added the 'except' keyword to haproxy.vim 2007-04-01 11:05:06 +02:00
Willy Tarreau
5e47a72f34 [CONTRIB] added a VIM script for syntax coloring 2007-04-01 10:09:10 +02:00
Willy Tarreau
985fc56734 [DOC] added some docs about http headers storage and acls 2007-04-01 09:44:10 +02:00
Willy Tarreau
422505801f [MEDIUM] splitted logs into two versions : TCP and HTTP
logs are handled better with dedicated functions. The HTTP implementation
moved to proto_http.c. It has been cleaned up a bit. Now a frontend with
option httplog and no log will not call the function anymore.
2007-04-01 01:30:43 +02:00
Willy Tarreau
e2e27a5c8d [MEDIUM] removed now unused fiprm and beprm from proxies
The fiprm and beprm were added to ease the transition between
a single listener mode to frontends+backends. They are no longer
needed and make the code a bit more complicated. Remove them.
2007-04-01 00:01:37 +02:00
Willy Tarreau
f2f0ee81ad [BUG] fix reqadd when no option httpclose is used.
Due to a code indentation mismatch, the rspadd headers were only
added if option httpclose was not set.
2007-03-30 12:02:43 +02:00
Willy Tarreau
d661cc06af [RELEASE] Released version 1.3.8 with the following changes :
- fixed several bugs which might have caused a crash with bad configs
    - several optimizations in header processing
    - many progresses towards transaction-based processing
    - option forwardfor may be used in frontends
    - completed HTTP response processing
    - some code refactoring between request and response processing
    - new HTTP header manipulation functions
    - optimizations on the recv() patch to reduce CPU usage under very
      high data rates.
    - more user-friendly help about the 'usesrc' keyword (CTTPROXY)
    - username/groupname support from Marcus Rueckert
    - added the "except" keyword to the "forwardfor" option (Bryan German)
    - support for health-checks on other addresses (Fabrice Dulaunoy)
    - makefile for MacOS 10.4 / Darwin (Dan Zinngrabe)
    - do not insert "Connection: close" in HTTP/1.0 messages
2007-03-26 00:24:56 +02:00
Willy Tarreau
0b4ed90de4 [BUILD] cfgparse requires errno.h on OpenBSD. 2007-03-26 00:18:40 +02:00
Willy Tarreau
2807efdb02 [MEDIUM] do not add Connection: close in HTTP/1.0 mode
If we already are in HTTP/1.0 and if no connection: has been seen,
it is not necessary to add Connection: close.
2007-03-25 23:47:23 +02:00
Willy Tarreau
5eb0917954 [DOC] added a CONTRIB file
Most useful contributions are acknowledged in this file.
2007-03-25 22:56:04 +02:00
Willy Tarreau
f2b74c26c5 [CLEANUP] added a few missing newlines to the HTML report
Sometimes it is preferable that the HTML output can be parsed.
Ensure better use of the newlines for this.
2007-03-25 22:44:08 +02:00
Willy Tarreau
417fae0e60 [MINOR] changed server weight storage from char to unsigned int
This change does not affect memory usage much, but it simplifies the
code a lot by removing many +1/-1 operations on weights.
2007-03-25 21:16:40 +02:00
Willy Tarreau
91b6f329eb [CLEANUP] slightly reorganized the struct server
Struct server has gathered lots of informations over the time, but
it's better for clarity and performance to group those information
by usage, the most common ones at the top and the least ones at the
bottom.
2007-03-25 21:03:01 +02:00
Willy Tarreau
0f03c6f60b [MINOR] cleaned up the check_addr patch a bit
removed useless set_check_addr entry and rely on check_addr itself.
2007-03-25 20:46:19 +02:00
Willy Tarreau
cec2e7ad1c [BUILD] makefile for MacOS 10.4 / Darwin
Contribution from Dan Zinngrabe :

Here is a Makefile based on that for BSD that builds HAProxy 1.3.7 on
MacOS 10.4 and Darwin. I haven't tested it extensively yet, but it
does seem to work so far.
2007-03-25 16:55:56 +02:00
Willy Tarreau
2ea3abb7bf [MEDIUM] add support for health-checks on other addresses
Patch from Fabrice Dulaunoy. Explanation below, and script
merged in examples/.

This patch allow to put a different address in the check part for each
server (and not only a specific port)

I need this feature because I've a complex settings where, when a specific
farm goes down, I need to switch a set of other farm either if these other
farm behave perfectly well.

For that purpose, I've made a small PERL daemon with some REGEX or PORT
test which allow me to test a bunch of thing.
2007-03-25 16:45:16 +02:00
Willy Tarreau
4fb20ff1cc [DOC] update architecture guide
Many useful updates to the architecture guide.
2007-03-25 16:01:14 +02:00
Willy Tarreau
7ac51f61f5 [MEDIUM] add the "except" keyword to the "forwardfor" option
Patch from Bryan Germann for 1.2.17.
In some circumstances, it is useful not to add the X-Forwarded-For
header, for instance when the client is another reverse-proxy or
stunnel running on the same machine and which already adds it. This
patch adds the "except" keyword to the "forwardfor" option, allowing
to specify an address or network which will not be added to this
header.
2007-03-25 16:00:04 +02:00
Willy Tarreau
95c20aca35 [MEDIUM] add user/groupname support
Patch from Marcus Rueckert for 1.2.17 :
 "I added the attached patch to haproxy. I don't have a static uid/gid for
  haproxy so i need to specify the username/groupname to run it as non
  root user."
2007-03-25 15:39:23 +02:00
Willy Tarreau
b38651a435 [MEDIUM] check for cttproxy support when required
Previously, use of the "usesrc" keyword could silently fail if
either the module was not loaded, or the user did not have enough
permissions. Now the errors are better diagnosed and more appropriate
advices are given.
2007-03-24 17:24:39 +01:00
Willy Tarreau
8d9246d282 [MINOR] more friendly reports of wrong uses of the usesrc keyword
It was difficult to find how to enter the "usesrc" keyword. Now the
configuration checker is a bit more friendly and tries to identify
most mistakes and gives some hints back.
2007-03-24 12:47:24 +01:00
Willy Tarreau
9641e8f6ee [MINOR] read optimizations based on the MSS
Generally, if a recv() returns less bytes than the MSS, it means that
there is nothing left in the system's buffers, and that it's not worth
trying to read again because we are very likely to get nothing. A
default read low limit has been set to 1460 bytes below which we stop
reading.

This has brought a little speed boost on small objects while maintaining
the same speed on large objects.
2007-03-23 23:02:09 +01:00
Willy Tarreau
b8949f1ed0 [MEDIUM] re-implemented the multiple read polling
Multiple read polling was temporarily disabled, which had the side
effect of burning huge amounts of CPU on large objects. It has now
been re-implemented with a limit of 8 calls per wake-up, which seems
to provide best results at least on Linux.
2007-03-23 22:39:59 +01:00
Willy Tarreau
042cc79e59 [BUG] fix pointer initializations for TCP connections.
Very recent changes consisting in moving some pointers to the
transaction instead of the session have lead to a bug because
those pointers were only initialized if the protocol was HTTP,
but they were freed based on their value. In some cases, it
was possible to cause double frees.
2007-03-19 16:20:06 +01:00
Willy Tarreau
aa9dce3bd6 [MINOR] added new function http_header_match2()
HTTP header matching is now made easier with http_header_match2().
Various locations have been adapted to use it. A small bug was also
fixed causing empty headers to be matched till next one.
2007-03-18 23:50:16 +01:00
Willy Tarreau
4af6f3a9ea [MINOR] HTTP: factorize all the header insertions
Two new functions http_header_add_tail() and http_header_add_tail2()
make it easier to append headers, and also reduce the number of
sprintf() calls and perform stricter checks.
2007-03-18 22:36:26 +01:00
Willy Tarreau
a5e65754e6 [MINOR] used http_flush_cookie_flags() instead of a dirty code block 2007-03-18 20:53:22 +01:00
Willy Tarreau
3d300596bb [MINOR] move some flags from session.h to proto_http.h
Some session flags were clearly related to HTTP transactions.
A new 'flags' field has been added to http_txn, and the
associated flags moved to proto_http.h.
2007-03-18 18:34:41 +01:00
Willy Tarreau
3bac9ffe20 [CLEANUP] move http_txn out of session.h
The http_txn structure definitions moved to proto_http.h
2007-03-18 17:31:28 +01:00
Willy Tarreau
5416b36b43 [CLEANUP] removed useless includes from streamsock.c 2007-03-18 17:03:19 +01:00
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
b49871738e [MINOR] fix accounting for response bytes
A remaining reference to rep->h was replaced.
2007-03-18 16:28:03 +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
117f59e282 [MINOR] code factoring : capture_headers() serves requests and responses
Both request and response captures will have to parse headers following
the same methods. It's better to factorize the code, hence the new
capture_headers() function.
2007-03-04 18:17:17 +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
6911fa484c [MINOR] added new str2i* functions
Those functions provide faster and more flexible alternatives to atoi(),
some of which are able to work on sub-strings.
2007-03-04 18:06:08 +01:00
Willy Tarreau
bb046ac8c5 [MINOR] option forwardfor is for frontends too
Finally, if the "option forwardfor" is specified in the frontend
and not in the backend, apply it.
2007-03-03 20:54:01 +01:00
Willy Tarreau
c2168d3ccb [CLEANUP] replaced occurrences of 'hreq' with 'txn' (bis)
Did the same in client.c
2007-03-03 20:53:23 +01:00
Willy Tarreau
4dbc4a2ee4 [CLEANUP] replaced occurrences of 'hreq' with 'txn'
In many places, the variable "hreq" designated a transaction more than
a request. This has been changed to avoid confusion.
2007-03-03 16:23:22 +01:00
Willy Tarreau
b326fcc46a [CLEANUP] renamed several HTTP structures
Some parts of HTTP processing were incorrectly called "request" while
they are messages or transactions. The following structure members
have changed :

  http_msg.hdr_state => msg_state
  http_msg.sor => som
  http_req.req_state => removed
  http_req => http_txn
2007-03-03 13:54:32 +01:00
Willy Tarreau
244b47beef [DOC] add some doc about internal naming rules 2007-03-03 11:46:27 +01:00
Willy Tarreau
5e8f066961 [MINOR] slightly optimize time calculation for rbtree
The new rbtree-based scheduler makes heavy use of tv_cmp2(), and
this function becomes a huge CPU eater. Refine it a little bit in
order to slightly reduce CPU usage.
2007-02-12 00:59:08 +01:00
Willy Tarreau
b1b8272a54 [MINOR] uninline rb_insert_task_queue()
rb_insert_task_queue() was inlined and is quite large. Uninlining
it reduces code size by about 2 kB and slightly improves performance.
2007-02-11 13:52:16 +01:00
Willy Tarreau
92f2ab1b1f [BUG] fix crash when no cookie is set on server
In cookie prefix or rewrite modes, if the elected server had no
cookie, a NULL pointer was passed to the rewrite function, causing
a SIGSEGV.
2007-02-02 22:14:47 +01:00