summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* BUILD: reorder objects in the Makefile for faster builds20200605-rework-include-finalWilly Tarreau2020-06-051-25/+29
| | | | | | | | Splitting large files and changing includes has changed the per-file build time. After a careful reordering based on build time, we're now down to 5.8s at -O0 on the PC at -j8 and 2.4-2.6s on the farm at -j120. Some room for at least one file name was left on each line to ease future additions.
* REORG: include: move the error reporting functions to from log.h to errors.hWilly Tarreau2020-06-0546-53/+78
| | | | | | | | | | | | | | Most of the files dealing with error reports have to include log.h in order to access ha_alert(), ha_warning() etc. But while these functions don't depend on anything, log.h depends on a lot of stuff because it deals with log-formats and samples. As a result it's impossible not to embark long dependencies when using ha_warning() or qfprintf(). This patch moves these low-level functions to errors.h, which already defines the error codes used at the same places. About half of the users of log.h could be adjusted, sometimes revealing other issues such as missing tools.h. Interestingly the total preprocessed size shrunk by 4%.
* CLEANUP: include: move sample_data out of sample-t.hWilly Tarreau2020-06-056-35/+60
| | | | | | | | The struct sample_data is used by pattern, map and vars, and currently requires to include sample-t which comes with many other dependencies. Let's move sample_data into its own file to shorten the dependency tree. This revealed a number of issues in adjacent files which were hidden by the fact that sample-t.h brought everything that was missing.
* CLEANUP: include: don't include proxy-t.h in global-t.hWilly Tarreau2020-06-051-2/+2
| | | | | We only need a forward declaration here to avoid embarking lots of files, and by just doing this we reduce the build size by 3.5%.
* CLEANUP: include: don't include stddef.h directlyWilly Tarreau2020-06-054-4/+4
| | | | | | | Directly including stddef.h in many files results in it being processed multiple times while it can be centralized in types.h and be guarded against multiple inclusions. Doing so reduces the number of preprocessed lines by 1200!
* REORG: check: extract the external checks from check.{c,h}Willy Tarreau2020-06-056-632/+727
| | | | | The health check code is ugly enough, let's take the external checks out of it to simplify the code and shrink the file a little bit.
* REORG: check: move email_alert* from proxy-t.h to mailers-t.hWilly Tarreau2020-06-052-17/+20
| | | | These ones are specific to mailers and have nothing to do in proxy-t.h.
* REORG: check: move tcpchecks away from check.cWilly Tarreau2020-06-0513-3953/+4153
| | | | | | | | | | Checks.c remains one of the largest file of the project and it contains too many things. The tcpchecks code represents half of this file, and both parts are relatively isolated, so let's move it away into its own file. We now have tcpcheck.c, tcpcheck{,-t}.h. Doing so required to export quite a number of functions because check.c has almost everything made static, which really doesn't help to split!
* REORG: check: move the e-mail alerting code to mailers.cWilly Tarreau2020-06-056-334/+360
| | | | | | | check.c is one of the largest file and contains too many things. The e-mail alerting code is stored there while nothing is in mailers.c. Let's move this code out. That's only 4% of the code but a good start. In order to do so, a few tcp-check functions had to be exported.
* CLEANUP: hpack: export debug functions and move inlines to .hWilly Tarreau2020-06-052-12/+17
| | | | | | | | When building contrib/hpack there is a warning about an unused static function. Actually it makes no sense to make it static, instead it must be regularly exported. Similarly there is hpack_dht_get_tail() which is inlined in the C file and which would make more sense with all other ones in the H file.
* REORG: include: move cfgparse.h to haproxy/cfgparse.hWilly Tarreau2020-06-0542-48/+48
| | | | | | | | | There's no point splitting the file in two since only cfgparse uses the types defined there. A few call places were updated and cleaned up. All of them were in C files which register keywords. There is nothing left in common/ now so this directory must not be used anymore.
* REORG: include: move stream.h to haproxy/stream{,-t}.hWilly Tarreau2020-06-0565-124/+111
| | | | | | | | | | | | | | This one was not easy because it was embarking many includes with it, which other files would automatically find. At least global.h, arg.h and tools.h were identified. 93 total locations were identified, 8 additional includes had to be added. In the rare files where it was possible to finalize the sorting of includes by adjusting only one or two extra lines, it was done. But all files would need to be rechecked and cleaned up now. It was the last set of files in types/ and proto/ and these directories must not be reused anymore.
* REORG: include: move server.h to haproxy/server{,-t}.hWilly Tarreau2020-06-0542-115/+106
| | | | | | | extern struct dict server_name_dict was moved from the type file to the main file. A handful of inlined functions were moved at the bottom of the file. Call places were updated to use server-t.h when relevant, or to simply drop the entry when not needed.
* REORG: include: move queue.h to haproxy/queue{,-t}.hWilly Tarreau2020-06-0519-74/+68
| | | | | Nothing outstanding here. A number of call places were not justified and removed.
* REORG: include: move backend.h to haproxy/backend{,-t}.hWilly Tarreau2020-06-0522-36/+26
| | | | | | | The files remained mostly unchanged since they were OK. However, half of the users didn't need to include them, and about as many actually needed to have it and used to find functions like srv_currently_usable() through a long chain that broke when moving the file.
* REORG: include: move spoe.h to haproxy/spoe{,-t}.hWilly Tarreau2020-06-057-63/+57
| | | | | Only minor change was to make sure all defines were before the structs in spoe-t.h, everything else went smoothly.
* REORG: include: move proxy.h to haproxy/proxy{,-t}.hWilly Tarreau2020-06-0560-89/+78
| | | | | | | | | This one is particularly difficult to split because it provides all the functions used to manipulate a proxy state and to retrieve names or IDs for error reporting, and as such, it was included in 73 files (down to 68 after cleanup). It would deserve a small cleanup though the cut points are not obvious at the moment given the number of structs involved in the struct proxy itself.
* REORG: include: move log.h to haproxy/log{,-t}.hWilly Tarreau2020-06-0565-172/+163
| | | | | | | | | | | | | | | | | | | | The current state of the logging is a real mess. The main problem is that almost all files include log.h just in order to have access to the alert/warning functions like ha_alert() etc, and don't care about logs. But log.h also deals with real logging as well as log-format and depends on stream.h and various other things. As such it forces a few heavy files like stream.h to be loaded early and to hide missing dependencies depending where it's loaded. Among the missing ones is syslog.h which was often automatically included resulting in no less than 3 users missing it. Among 76 users, only 5 could be removed, and probably 70 don't need the full set of dependencies. A good approach would consist in splitting that file in 3 parts: - one for error output ("errors" ?). - one for log_format processing - and one for actual logging.
* REORG: include: move fcgi-app.h to haproxy/fcgi-app{,-t}.hWilly Tarreau2020-06-054-17/+16
| | | | Only arg-t.h was missing from the types to get arg_list.
* REORG: include: move filters.h to haproxy/filters{,-t}.hWilly Tarreau2020-06-0517-47/+36
| | | | | Just a minor change, moved the macro definitions upwards. A few caller files were updated since they didn't need to include it.
* REORG: include: move http_ana.h to haproxy/http_ana{,-t}.hWilly Tarreau2020-06-0532-45/+33
| | | | | | It was moved without any change, however many callers didn't need it at all. This was a consequence of the split of proto_http.c into several parts that resulted in many locations to still reference it.
* REORG: include: move channel.h to haproxy/channel{,-t}.hWilly Tarreau2020-06-0537-62/+44
| | | | | The files were moved with no change. The callers were cleaned up a bit and a few of them had channel.h removed since not needed.
* REORG: include: move stream_interface.h to haproxy/stream_interface{,-t}.hWilly Tarreau2020-06-0547-57/+57
| | | | | Almost no changes, removed stdlib and added buf-t and connection-t to the types to avoid a warning.
* REORG: include: move ssl_sock.h to haproxy/ssl_sock{,-t}.hWilly Tarreau2020-06-0518-74/+60
| | | | | Almost nothing changed, just moved a static inline at the end and moved an export from the types to the main file.
* REORG: include: move lb_map.h to haproxy/lb_map{,-t}.hWilly Tarreau2020-06-056-12/+12
| | | | Nothing was changed.
* REORG: include: move cli.h to haproxy/cli{,-t}.hWilly Tarreau2020-06-0527-71/+52
| | | | | | | Almost no change except moving the cli_kw struct definition after the defines. Almost all users had both types&proto included, which is not surprizing since this code is old and it used to be the norm a decade ago. These places were cleaned.
* REORG: include: move stats.h to haproxy/stats{,-t}.hWilly Tarreau2020-06-0521-80/+74
| | | | | | Just some minor reordering, and the usual cleanup of call places for those which didn't need it. We don't include the whole tools.h into stats-t anymore but just tools-t.h.
* REORG: move applet.h to haproxy/applet{,-t}.hWilly Tarreau2020-06-0527-48/+44
| | | | | | | The type file was slightly tidied. The cli-specific APPCTX_CLI_ST1_* flag definitions were moved to cli.h. The type file was adjusted to include buf-t.h and not the huge buf.h. A few call places were fixed because they did not need this include.
* REORG: include: split common/uri_auth.h into haproxy/uri_auth{,-t}.hWilly Tarreau2020-06-0513-36/+60
| | | | | | | | Initially it looked like this could have been placed into auth.h or stats.h but it's not the case as it's what makes the link between them and the HTTP layer. However the file needed to be split in two. Quite a number of call places were dropped because these were mostly leftovers from the early days where the stats and cli were packed together.
* REORG: include: move acl.h to haproxy/acl.h{,-t}.hWilly Tarreau2020-06-0525-42/+36
| | | | | | | | The files were moved almost as-is, just dropping arg-t and auth-t from acl-t but keeping arg-t in acl.h. It was useful to revisit the call places since a handful of files used to continue to include acl.h while they did not need it at all. Struct stream was only made a forward declaration since not otherwise needed.
* REORG: include: move trace.h to haproxy/trace{,-t}.hWilly Tarreau2020-06-057-18/+19
| | | | Only thread-t was added to satisfy THREAD_LOCAL but the rest was OK.
* REORG: include: move session.h to haproxy/session{,-t}.hWilly Tarreau2020-06-0520-49/+42
| | | | | | Almost no change was needed beyond a little bit of reordering of the types file and adjustments to use session-t instead of session at a few places.
* REORG: include: move stick_table.h to haproxy/stick_table{,-t}.hWilly Tarreau2020-06-0522-56/+60
| | | | | | | | The stktable_types[] array declaration was moved to the main file as it had nothing to do in the types. A few declarations were reordered in the types file so that defines were before the structs. Thread-t was added since there are a few __decl_thread(). The loss of peers.h revealed that cfgparse-listen needed it.
* REORG: include: move peers.h to haproxy/peers{,-t}.hWilly Tarreau2020-06-0510-27/+32
| | | | | | The cfg_peers external declaration was moved to the main file instead of the type one. A few types were still missing from the proto, causing warnings in the functions prototypes (proxy, stick_table).
* REORG: include: move http_fetch.h to haproxy/http_fetch.hWilly Tarreau2020-06-058-15/+13
| | | | | There's no type file for this trivial one. The unneeded dependency on htx.h was dropped.
* REORG: include: move checks.h to haproxy/check{,-t}.hWilly Tarreau2020-06-0518-144/+152
| | | | | | | | | | | | | All includes that were not absolutely necessary were removed because checks.h happens to very often be part of dependency loops. A warning was added about this in check-t.h. The fields, enums and structs were a bit tidied because it's particularly tedious to find anything there. It would make sense to split this in two or more files (at least extract tcp-checks). The file was renamed to the singular because it was one of the rare exceptions to have an "s" appended to its name compared to the struct name.
* REORG: include: move connection.h to haproxy/connection{,-t}.hWilly Tarreau2020-06-0537-132/+135
| | | | | | | | The type file is becoming a mess, half of it is for the proxy protocol, another good part describes conn_streams and mux ops, it would deserve being split again. At least it was reordered so that elements are easier to find, with the PP-stuff left at the end. The MAX_SEND_FD macro was moved to compat.h as it's said to be the value for Linux.
* REORG: include: move tcp_rules.h to haproxy/tcp_rules.hWilly Tarreau2020-06-0512-16/+17
| | | | There's no type file on this one which is pretty simple.
* REORG: include: move signal.h to haproxy/signal{,-t}.hWilly Tarreau2020-06-0518-25/+22
| | | | No change was necessary. Include from wdt.c was dropped since unneeded.
* REORG: include: move proto_tcp.h to haproxy/proto_tcp.hWilly Tarreau2020-06-059-13/+16
| | | | | There was no type file. This one really is trivial. A few missing includes were added to satisfy the exported functions prototypes.
* REORG: include: move task.h to haproxy/task{,-t}.hWilly Tarreau2020-06-0548-168/+164
| | | | | | | | The TASK_IS_TASKLET() macro was moved to the proto file instead of the type one. The proto part was a bit reordered to remove a number of ugly forward declaration of static inline functions. About a tens of C and H files had their dependency dropped since they were not using anything from task.h.
* REORG: include: split global.h into haproxy/global{,-t}.hWilly Tarreau2020-06-0584-235/+245
| | | | | | | | | | | | | | global.h was one of the messiest files, it has accumulated tons of implicit dependencies and declares many globals that make almost all other file include it. It managed to silence a dependency loop between server.h and proxy.h by being well placed to pre-define the required structs, forcing struct proxy and struct server to be forward-declared in a significant number of files. It was split in to, one which is the global struct definition and the few macros and flags, and the rest containing the functions prototypes. The UNIX_MAX_PATH definition was moved to compat.h.
* REORG: include: move vars.h to haproxy/vars{,-t}.hWilly Tarreau2020-06-0519-70/+112
| | | | | A few includes (sessions.h, stream.h, types.h) were added for arguments that were first declared in function prototypes.
* REORG: include: move protocol_buffers.h to haproxy/protobuf{,-t}.hWilly Tarreau2020-06-054-12/+14
| | | | | | There is no C file for this one, the code was placed into sample.c which thus has a dependency on this file which itself includes sample.h. Probably that it would be wise to split that later.
* REORG: include: move sample.h to haproxy/sample{,-t}.hWilly Tarreau2020-06-0556-67/+66
| | | | | | | | This one is particularly tricky to move because everyone uses it and it depends on a lot of other types. For example it cannot include arg-t.h and must absolutely only rely on forward declarations to avoid dependency loops between vars -> sample_data -> arg. In order to address this one, it would be nice to split the sample_data part out of sample.h.
* REORG: include: move payload.h to haproxy/payload.hWilly Tarreau2020-06-054-7/+7
| | | | | | There's no type file, it only contains fetch_rdp_cookie_name() and val_payload_lv() which probably ought to move somewhere else instead of staying there.
* REORG: include: move map to haproxy/map{,-t}.hWilly Tarreau2020-06-056-14/+13
| | | | | Only small cleanups, and removal of a few includes from files that didn't need them.
* REORG: include: move pattern.h to haproxy/pattern{,-t}.hWilly Tarreau2020-06-0517-32/+32
| | | | | | It was moved as-is, except for extern declaration of pattern_reference. A few C files used to include it but didn't need it anymore after having been split apart so this was cleaned.
* REORG: include: move listener.h to haproxy/listener{,-t}.hWilly Tarreau2020-06-0529-39/+38
| | | | stdlib and list were missing from listener.h, otherwise it was OK.
* REORG: include: move lb_fwrr.h to haproxy/lb_fwrr{,-t}.hWilly Tarreau2020-06-055-12/+12
| | | | | Nothing fancy, includes were already OK. The proto didn't reference the type, this was fixed. Still references proxy.h and server.h from types/.