You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. commit 5a8549e68225070d0b79cbbb9c5f791e103685e7
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Mon Jun 17 13:36:06 2019 +0200
  4. BUG/MINOR: lua/htx: Make txn.req_req_* and txn.res_rep_* HTX aware
  5. These bindings were not updated to support HTX streams.
  6. This patch must be backported to 2.0 and 1.9. It fixes the issue #124.
  7. (cherry picked from commit ea418748dd22331e9798cfd8f5e25b436cd577e3)
  8. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  9. diff --git a/src/hlua.c b/src/hlua.c
  10. index 28abd083..32f0e8db 100644
  11. --- a/src/hlua.c
  12. +++ b/src/hlua.c
  13. @@ -5375,7 +5375,13 @@ __LJMP static inline int hlua_http_rep_hdr(lua_State *L, struct hlua_txn *htxn,
  14. if (!(re = regex_comp(reg, 1, 1, NULL)))
  15. WILL_LJMP(luaL_argerror(L, 3, "invalid regex"));
  16. - http_transform_header_str(htxn->s, msg, name, name_len, value, re, action);
  17. + if (IS_HTX_STRM(htxn->s)) {
  18. + struct htx *htx = htxbuf(&msg->chn->buf);
  19. +
  20. + htx_transform_header_str(htxn->s, msg->chn, htx, ist2(name, name_len), value, re, action);
  21. + }
  22. + else
  23. + http_transform_header_str(htxn->s, msg, name, name_len, value, re, action);
  24. regex_free(re);
  25. return 0;
  26. }