Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (59 sloc) 1.743 kb
0813b5b4 »
2011-09-16 flash policy
1 diff -Naur haproxy-1.5-dev7.orig/src/acl.c haproxy-1.5-dev7/src/acl.c
2 --- haproxy-1.5-dev7.orig/src/acl.c 2011-09-11 01:43:11.000000000 +0400
3 +++ haproxy-1.5-dev7/src/acl.c 2011-09-16 18:38:40.576660268 +0400
4 @@ -389,6 +389,47 @@
5 }
6
7
8 +//DVV
9 +/* Look if <policy-file-request/>\0 string is in request buffer.
10 + * Use to route Flash socket policy requests.
11 + */
12 +int
13 +acl_fetch_flash_policy(struct proxy *px, struct session *l4, void *l7, int dir,
14 + struct acl_expr *expr, struct acl_test *test)
15 +{
16 + const unsigned char *data;
17 +
18 + if (!l4 || !l4->req)
19 + return 0;
20 +
21 + test->flags = 0;
22 +
23 + if (l4->req->l < 1)
24 + goto too_short;
25 +
26 + data = (const unsigned char *)l4->req->w;
27 +
28 + if (data[0] != '<')
29 + goto not_policy;
30 +
31 + if (l4->req->l < 23)
32 + goto too_short;
33 +
34 + if (memcmp("<policy-file-request/>\0", (const char *)data, 23) != 0)
35 + goto not_policy;
36 +
37 +//fprintf(stderr, "POLICY!!!\n");
38 +
39 + test->flags = ACL_TEST_F_SET_RES_PASS;
40 + return 1;
41 +
42 + too_short:
43 + test->flags = ACL_TEST_F_MAY_CHANGE;
44 + not_policy:
45 + return 0;
46 +}
47 +//DVV
48 +
49 /*
50 * These functions are exported and may be used by any other component.
51 */
52 @@ -1875,6 +1916,9 @@
53 { "req_ssl_ver", acl_parse_dotted_ver, acl_fetch_req_ssl_ver, acl_match_int, ACL_USE_L6REQ_VOLATILE },
54 { "req_rdp_cookie", acl_parse_str, acl_fetch_rdp_cookie, acl_match_str, ACL_USE_L6REQ_VOLATILE|ACL_MAY_LOOKUP },
55 { "req_rdp_cookie_cnt", acl_parse_int, acl_fetch_rdp_cookie_cnt, acl_match_int, ACL_USE_L6REQ_VOLATILE },
56 +//DVV
57 + { "req_flash_policy", acl_parse_nothing, acl_fetch_flash_policy, acl_match_nothing, ACL_USE_L6REQ_VOLATILE },
58 +//DVV
59 #if 0
60 { "time", acl_parse_time, acl_fetch_time, acl_match_time },
61 #endif
Something went wrong with that request. Please try again.