*/
static int httpchk_expect(struct server *s, int done)
{
- static char status_msg[] = "HTTP status check returned code <000>";
+ static THREAD_LOCAL char status_msg[] = "HTTP status check returned code <000>";
char status_code[] = "000";
char *contentptr;
int crlf;
"";
-static char *dynamic_usage_msg = NULL;
+static THREAD_LOCAL char *dynamic_usage_msg = NULL;
/* List head of cli keywords */
static struct cli_kw_list cli_keywords = {
struct chunk http_err_chunks[HTTP_ERR_SIZE];
/* this struct is used between calls to smp_fetch_hdr() or smp_fetch_cookie() */
-static struct hdr_ctx static_hdr_ctx;
+static THREAD_LOCAL struct hdr_ctx static_hdr_ctx;
#define FD_SETS_ARE_BITFIELDS
#ifdef FD_SETS_ARE_BITFIELDS
/* Default TCP parameters, got by opening a temporary TCP socket. */
#ifdef TCP_MAXSEG
-static int default_tcp_maxseg = -1;
-static int default_tcp6_maxseg = -1;
+static THREAD_LOCAL int default_tcp_maxseg = -1;
+static THREAD_LOCAL int default_tcp6_maxseg = -1;
#endif
/* Binds ipv4/ipv6 address <local> to socket <fd>, unless <flags> is set, in which
struct sockaddr_storage bind_addr;
int foreign_ok = 0;
int ret;
- static int ip_transp_working = 1;
- static int ip6_transp_working = 1;
+ static THREAD_LOCAL int ip_transp_working = 1;
+ static THREAD_LOCAL int ip6_transp_working = 1;
switch (local->ss_family) {
case AF_INET:
}
else {
#ifdef IP_BIND_ADDRESS_NO_PORT
- static int bind_address_no_port = 1;
+ static THREAD_LOCAL int bind_address_no_port = 1;
setsockopt(fd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, (const void *) &bind_address_no_port, sizeof(int));
#endif
ret = tcp_bind_socket(fd, flags, &src->source_addr, &conn->addr.from);
int raw_sock_to_pipe(struct connection *conn, struct pipe *pipe, unsigned int count)
{
#ifndef ASSUME_SPLICE_WORKS
- static int splice_detects_close;
+ static THREAD_LOCAL int splice_detects_close;
#endif
int ret;
int retval = 0;
*/
struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int *high, char **err, const char *pfx, char **fqdn, int resolve)
{
- static struct sockaddr_storage ss;
+ static THREAD_LOCAL struct sockaddr_storage ss;
struct sockaddr_storage *ret = NULL;
char *back, *str2;
char *port1, *port2;
*/
const char *quote_arg(const char *ptr)
{
- static char val[32];
+ static THREAD_LOCAL char val[32];
int i;
if (!ptr || !*ptr)
const char *get_gmt_offset(time_t t, struct tm *tm)
{
/* Cache offsets from GMT (depending on whether DST is active or not) */
- static char gmt_offsets[2][5+1] = { "", "" };
+ static THREAD_LOCAL char gmt_offsets[2][5+1] = { "", "" };
char *gmt_offset;
struct tm tm_gmt;
};
/* one line of info */
-static struct field info[INF_TOTAL_FIELDS];
+static THREAD_LOCAL struct field info[INF_TOTAL_FIELDS];
/* one line of stats */
-static struct field stats[ST_F_TOTAL_FIELDS];
+static THREAD_LOCAL struct field stats[ST_F_TOTAL_FIELDS];