~ubuntu-branches/debian/stretch/haproxy/stretch

« back to all changes in this revision

Viewing changes to src/client.c

  • Committer: Bazaar Package Importer
  • Author(s): Christo Buschek
  • Date: 2011-03-11 12:41:59 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110311124159-9foyp4juf1ilqipo
Tags: 1.4.13-1
* New maintainer upload (Closes: #615246)
* New upstream release
* Standards-version goes 3.9.1 (no change)
* Added patch bashism (Closes: #581109)
* Added a README.source file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Client-side variables and functions.
3
3
 *
4
 
 * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
 
4
 * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU General Public License
33
33
#include <proto/log.h>
34
34
#include <proto/hdr_idx.h>
35
35
#include <proto/pattern.h>
 
36
#include <proto/protocols.h>
36
37
#include <proto/proto_tcp.h>
37
38
#include <proto/proto_http.h>
38
39
#include <proto/proxy.h>
121
122
 
122
123
                if ((s = pool_alloc2(pool2_session)) == NULL) { /* disable this proxy for a while */
123
124
                        Alert("out of memory in event_accept().\n");
124
 
                        EV_FD_CLR(fd, DIR_RD);
 
125
                        disable_listener(l);
125
126
                        p->state = PR_STIDLE;
126
127
                        goto out_close;
127
128
                }
149
150
 
150
151
                if ((t = task_new()) == NULL) { /* disable this proxy for a while */
151
152
                        Alert("out of memory in event_accept().\n");
152
 
                        EV_FD_CLR(fd, DIR_RD);
 
153
                        disable_listener(l);
153
154
                        p->state = PR_STIDLE;
154
155
                        goto out_free_session;
155
156
                }
580
581
pattern_fetch_dst(struct proxy *px, struct session *l4, void *l7, int dir,
581
582
                  const char *arg, int arg_len, union pattern_data *data)
582
583
{
 
584
        if (!(l4->flags & SN_FRT_ADDR_SET))
 
585
                get_frt_addr(l4);
 
586
 
583
587
        data->ip.s_addr = ((struct sockaddr_in *)&l4->frt_addr)->sin_addr.s_addr;
584
588
        return 1;
585
589
}
605
609
                    const char *arg, int arg_len, union pattern_data *data)
606
610
 
607
611
{
 
612
        if (!(l4->flags & SN_FRT_ADDR_SET))
 
613
                get_frt_addr(l4);
 
614
 
608
615
        data->integer = ntohs(((struct sockaddr_in *)&l4->frt_addr)->sin_port);
609
616
        return 1;
610
617
}