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

« back to all changes in this revision

Viewing changes to src/backend.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:
1232
1232
        return 1;
1233
1233
}
1234
1234
 
 
1235
/* report in test->flags a success or failure depending on the designated
 
1236
 * server's state. There is no match function involved since there's no pattern.
 
1237
 */
 
1238
static int
 
1239
acl_fetch_srv_is_up(struct proxy *px, struct session *l4, void *l7, int dir,
 
1240
                    struct acl_expr *expr, struct acl_test *test)
 
1241
{
 
1242
        struct server *srv = expr->arg.srv;
 
1243
 
 
1244
        test->flags = ACL_TEST_F_VOL_TEST;
 
1245
        if (!(srv->state & SRV_MAINTAIN) &&
 
1246
            (!(srv->state & SRV_CHECKED) || (srv->state & SRV_RUNNING)))
 
1247
                test->flags |= ACL_TEST_F_SET_RES_PASS;
 
1248
        else
 
1249
                test->flags |= ACL_TEST_F_SET_RES_FAIL;
 
1250
        return 1;
 
1251
}
 
1252
 
1235
1253
/* set test->i to the number of enabled servers on the proxy */
1236
1254
static int
1237
1255
acl_fetch_connslots(struct proxy *px, struct session *l4, void *l7, int dir,
1410
1428
        { "be_conn", acl_parse_int, acl_fetch_be_conn, acl_match_int, ACL_USE_NOTHING },
1411
1429
        { "queue", acl_parse_int, acl_fetch_queue_size, acl_match_int, ACL_USE_NOTHING },
1412
1430
        { "avg_queue", acl_parse_int, acl_fetch_avg_queue_size, acl_match_int, ACL_USE_NOTHING },
 
1431
        { "srv_is_up",    acl_parse_nothing,   acl_fetch_srv_is_up,  acl_match_nothing, ACL_USE_NOTHING },
1413
1432
        { NULL, NULL, NULL, NULL },
1414
1433
}};
1415
1434