~ubuntu-branches/ubuntu/vivid/haproxy/vivid

« back to all changes in this revision

Viewing changes to src/appsession.c

  • Committer: Package Import Robot
  • Author(s): Apollon Oikonomopoulos
  • Date: 2014-06-20 11:05:17 UTC
  • mfrom: (1.1.15) (15.1.12 experimental)
  • Revision ID: package-import@ubuntu.com-20140620110517-u6q5p9kyy2f3ozw9
Tags: 1.5.0-1
* New upstream stable series. Notable changes since the 1.4 series:
  + Native SSL support on both sides with SNI/NPN/ALPN and OCSP stapling.
  + IPv6 and UNIX sockets are supported everywhere
  + End-to-end HTTP keep-alive for better support of NTLM and improved
    efficiency in static farms
  + HTTP/1.1 response compression (deflate, gzip) to save bandwidth
  + PROXY protocol versions 1 and 2 on both sides
  + Data sampling on everything in request or response, including payload
  + ACLs can use any matching method with any input sample
  + Maps and dynamic ACLs updatable from the CLI
  + Stick-tables support counters to track activity on any input sample
  + Custom format for logs, unique-id, header rewriting, and redirects
  + Improved health checks (SSL, scripted TCP, check agent, ...)
  + Much more scalable configuration supports hundreds of thousands of
    backends and certificates without sweating

* Upload to unstable, merge all 1.5 work from experimental. Most important
  packaging changes since 1.4.25-1 include:
  + systemd support.
  + A more sane default config file.
  + Zero-downtime upgrades between 1.5 releases by gracefully reloading
    HAProxy during upgrades.
  + HTML documentation shipped in the haproxy-doc package.
  + kqueue support for kfreebsd.

* Packaging changes since 1.5~dev26-2:
  + Drop patches merged upstream:
    o Fix-reference-location-in-manpage.patch
    o 0001-BUILD-stats-workaround-stupid-and-bogus-Werror-forma.patch
  + d/watch: look for stable 1.5 releases
  + systemd: respect CONFIG and EXTRAOPTS when specified in
    /etc/default/haproxy.
  + initscript: test the configuration before start or reload.
  + initscript: remove the ENABLED flag and logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        return 0;
84
84
}
85
85
 
86
 
int appsession_task_init(void)
87
 
{
88
 
        static int initialized = 0;
89
 
        if (!initialized) {
90
 
                if ((appsess_refresh = task_new()) == NULL)
91
 
                        return -1;
92
 
 
93
 
                appsess_refresh->context = NULL;
94
 
                appsess_refresh->expire = tick_add(now_ms, MS_TO_TICKS(TBLCHKINT));
95
 
                appsess_refresh->process = appsession_refresh;
96
 
                task_queue(appsess_refresh);
97
 
                initialized ++;
98
 
        }
99
 
        return 0;
100
 
}
101
 
 
102
 
struct task *appsession_refresh(struct task *t)
 
86
static struct task *appsession_refresh(struct task *t)
103
87
{
104
88
        struct proxy           *p = proxy;
105
89
        struct appsession_hash *htbl;
113
97
                                if (tick_is_expired(element->expire, now_ms)) {
114
98
                                        if ((global.mode & MODE_DEBUG) &&
115
99
                                            (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
116
 
                                                int len;
117
 
                                                /*
118
 
                                                  on Linux NULL pointers are caught by sprintf, on solaris -> segfault 
119
 
                                                */
120
 
                                                len = sprintf(trash, "appsession_refresh: cleaning up expired Session '%s' on Server %s\n", 
121
 
                                                              element->sessid, element->serverid?element->serverid:"(null)");
122
 
                                                if (write(1, trash, len) < 0) /* shut gcc warning */;
 
100
                                                chunk_printf(&trash, "appsession_refresh: cleaning up expired Session '%s' on Server %s\n", 
 
101
                                                             element->sessid, element->serverid?element->serverid:"(null)");
 
102
                                                shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
123
103
                                        }
124
104
                                        /* delete the expired element from within the hash table */
125
105
                                        LIST_DEL(&element->hash_list);
133
113
        return t;
134
114
} /* end appsession_refresh */
135
115
 
 
116
int appsession_task_init(void)
 
117
{
 
118
        static int initialized = 0;
 
119
        if (!initialized) {
 
120
                if ((appsess_refresh = task_new()) == NULL)
 
121
                        return -1;
 
122
 
 
123
                appsess_refresh->context = NULL;
 
124
                appsess_refresh->expire = tick_add(now_ms, MS_TO_TICKS(TBLCHKINT));
 
125
                appsess_refresh->process = appsession_refresh;
 
126
                task_queue(appsess_refresh);
 
127
                initialized ++;
 
128
        }
 
129
        return 0;
 
130
}
 
131
 
136
132
int match_str(const void *key1, const void *key2)
137
133
{
138
134
    appsess *temp1,*temp2;