:see: :js:func:`TXN.reply`, :js:class:`Reply`
+.. js:function:: TXN.set_fc_tos(txn, tos)
+
+ Is used to set the TOS or DSCP field value of packets sent to the client to
+ the value passed in "tos" on platforms which support this.
+
+ :param class_txn txn: The class txn object containing the data.
+ :param integer tos: The new TOS os DSCP.
+
+.. js:function:: TXN.set_fc_mark(txn, mark)
+
+ Is used to set the Netfilter MARK on all packets sent to the client to the
+ value passed in "mark" on platforms which support it.
+
+ :param class_txn txn: The class txn object containing the data.
+ :param integer mark: The mark value.
+
.. js:function:: TXN.set_loglevel(txn, loglevel)
Is used to change the log level of the current request. The "loglevel" must
:js:attr:`core.err`, :js:attr:`core.warning`, :js:attr:`core.notice`,
:js:attr:`core.info`, :js:attr:`core.debug` (log level definitions)
-.. js:function:: TXN.set_tos(txn, tos)
+.. js:function:: TXN.set_mark(txn, mark)
- Is used to set the TOS or DSCP field value of packets sent to the client to
- the value passed in "tos" on platforms which support this.
+ Alias for :js:func:`TXN.set_fc_mark()`.
- :param class_txn txn: The class txn object containing the data.
- :param integer tos: The new TOS os DSCP.
+ .. warning::
+ This function is deprecated. :js:func:`TXN.set_fc_mark()` must be used
+ instead.
-.. js:function:: TXN.set_mark(txn, mark)
+.. js:function:: TXN.set_tos(txn, tos)
- Is used to set the Netfilter MARK on all packets sent to the client to the
- value passed in "mark" on platforms which support it.
+ Alias for :js:func:`TXN.set_fc_tos()`.
- :param class_txn txn: The class txn object containing the data.
- :param integer mark: The mark value.
+ .. warning::
+ This function is deprecated. :js:func:`TXN.set_fc_tos()` must be used
+ instead.
.. js:function:: TXN.set_priority_class(txn, prio)
return 0;
}
-__LJMP static int hlua_txn_set_loglevel(lua_State *L)
+__LJMP static int hlua_txn_set_fc_mark(lua_State *L)
{
struct hlua_txn *htxn;
- int ll;
+ int mark;
- MAY_LJMP(check_args(L, 2, "set_loglevel"));
+ MAY_LJMP(check_args(L, 2, "set_fc_mark"));
htxn = MAY_LJMP(hlua_checktxn(L, 1));
- ll = MAY_LJMP(luaL_checkinteger(L, 2));
-
- if (ll < 0 || ll > 7)
- WILL_LJMP(luaL_argerror(L, 2, "Bad log level. It must be between 0 and 7"));
+ mark = MAY_LJMP(luaL_checkinteger(L, 2));
- htxn->s->logs.level = ll;
+ conn_set_mark(objt_conn(htxn->s->sess->origin), mark);
return 0;
}
-__LJMP static int hlua_txn_set_tos(lua_State *L)
+__LJMP static int hlua_txn_set_fc_tos(lua_State *L)
{
struct hlua_txn *htxn;
int tos;
- MAY_LJMP(check_args(L, 2, "set_tos"));
+ MAY_LJMP(check_args(L, 2, "set_fc_tos"));
htxn = MAY_LJMP(hlua_checktxn(L, 1));
tos = MAY_LJMP(luaL_checkinteger(L, 2));
return 0;
}
-__LJMP static int hlua_txn_set_mark(lua_State *L)
+__LJMP static int hlua_txn_set_loglevel(lua_State *L)
{
struct hlua_txn *htxn;
- int mark;
+ int ll;
- MAY_LJMP(check_args(L, 2, "set_mark"));
+ MAY_LJMP(check_args(L, 2, "set_loglevel"));
htxn = MAY_LJMP(hlua_checktxn(L, 1));
- mark = MAY_LJMP(luaL_checkinteger(L, 2));
+ ll = MAY_LJMP(luaL_checkinteger(L, 2));
- conn_set_mark(objt_conn(htxn->s->sess->origin), mark);
+ if (ll < 0 || ll > 7)
+ WILL_LJMP(luaL_argerror(L, 2, "Bad log level. It must be between 0 and 7"));
+
+ htxn->s->logs.level = ll;
return 0;
}
hlua_class_function(L, "get_var", hlua_get_var);
hlua_class_function(L, "done", hlua_txn_done);
hlua_class_function(L, "reply", hlua_txn_reply_new);
+ hlua_class_function(L, "set_fc_mark", hlua_txn_set_fc_mark);
+ hlua_class_function(L, "set_fc_tos", hlua_txn_set_fc_tos);
hlua_class_function(L, "set_loglevel", hlua_txn_set_loglevel);
- hlua_class_function(L, "set_tos", hlua_txn_set_tos);
- hlua_class_function(L, "set_mark", hlua_txn_set_mark);
+ hlua_class_function(L, "set_mark", hlua_txn_set_fc_mark); // DEPRECATED, use set_fc_mark
+ hlua_class_function(L, "set_tos", hlua_txn_set_fc_tos); // DEPRECATED, use set_fc_tos
hlua_class_function(L, "set_priority_class", hlua_txn_set_priority_class);
hlua_class_function(L, "set_priority_offset", hlua_txn_set_priority_offset);
hlua_class_function(L, "deflog", hlua_txn_deflog);