~ubuntu-branches/ubuntu/utopic/haproxy/utopic-proposed

« back to all changes in this revision

Viewing changes to src/session.c

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2010-06-18 00:42:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100618004253-ygka2bh6nblkhfj2
Tags: 1.4.8-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        struct http_txn *txn = &s->txn;
51
51
        struct proxy *fe = s->fe;
52
52
        struct bref *bref, *back;
 
53
        int i;
53
54
 
54
55
        if (s->pend_pos)
55
56
                pendconn_free(s->pend_pos);
82
83
 
83
84
        http_end_txn(s);
84
85
 
 
86
        for (i = 0; i < s->store_count; i++) {
 
87
                if (!s->store[i].ts)
 
88
                        continue;
 
89
                stksess_free(s->store[i].table, s->store[i].ts);
 
90
                s->store[i].ts = NULL;
 
91
        }
 
92
 
85
93
        if (fe) {
86
94
                pool_free2(fe->hdr_idx_pool, txn->hdr_idx.v);
87
95
                pool_free2(fe->rsp_cap_pool, txn->rsp.cap);
551
559
 */
552
560
int process_switching_rules(struct session *s, struct buffer *req, int an_bit)
553
561
{
554
 
        struct force_persist_rule *prst_rule;
 
562
        struct persist_rule *prst_rule;
555
563
 
556
564
        req->analysers &= ~an_bit;
557
565
        req->analyse_exp = TICK_ETERNITY;
598
606
        if (s->fe == s->be)
599
607
                s->req->analysers &= ~AN_REQ_HTTP_PROCESS_BE;
600
608
 
601
 
        /* as soon as we know the backend, we must check if we have a matching forced
 
609
        /* as soon as we know the backend, we must check if we have a matching forced or ignored
602
610
         * persistence rule, and report that in the session.
603
611
         */
604
 
        list_for_each_entry(prst_rule, &s->be->force_persist_rules, list) {
 
612
        list_for_each_entry(prst_rule, &s->be->persist_rules, list) {
605
613
                int ret = 1;
606
614
 
607
615
                if (prst_rule->cond) {
613
621
 
614
622
                if (ret) {
615
623
                        /* no rule, or the rule matches */
616
 
                        s->flags |= SN_FORCE_PRST;
 
624
                        if (prst_rule->type == PERSIST_TYPE_FORCE) {
 
625
                                s->flags |= SN_FORCE_PRST;
 
626
                        } else {
 
627
                                s->flags |= SN_IGNORE_PRST;
 
628
                        }
617
629
                        break;
618
630
                }
619
631
        }
790
802
 
791
803
        /* process store request and store response */
792
804
        for (i = 0; i < s->store_count; i++) {
793
 
                if (stktable_store(s->store[i].table, s->store[i].ts, s->srv->puid) > 0) {
 
805
                if (stktable_store(s->store[i].table, s->store[i].ts, s->srv->puid) > 0)
794
806
                        stksess_free(s->store[i].table, s->store[i].ts);
795
 
                        s->store[i].ts = NULL;
796
 
                }
 
807
                /* always remove pointer to session to ensure we won't free it again */
 
808
                s->store[i].ts = NULL;
797
809
        }
 
810
        s->store_count = 0; /* everything is stored */
798
811
 
799
812
        rep->analysers &= ~an_bit;
800
813
        rep->analyse_exp = TICK_ETERNITY;