Hi all,
  I'm an amateur with lua. I've been messing around with doing "something" when 
either an http or tcp request happens as a way of teaching myself how to do 
stuff.
Many examples use the "hello world" lua script, and call it via either :

http-request lua.script

or

tcp-request content lua.script

Which works fine; the script is called. My question though is around arguments 
.. I understand the txn <object> gets passed over, so one can use a script like 
this for example:

Function my_script(txn)
  ip=txn.f:src()
  core.Alert(ip)
end

core.register_action("my-script", {"tcp-req", "http-req"}, my_script)

.. and it works, but if we pass arguments, e.g.

http-request lua.script stuff
or
tcp-request content lua.script stuff

and in the script use

Function my_script(txn, arg)
  core.Alert(arg)
end
core.register_action("my-script", {"tcp-req", "http-req"}, my_script, 1)

.. http works as expected, and sends the string "stuff", but tcp just sends the 
word "content", not "stuff"

Am I missing something really obvious here!?

Thanks
Andy




********************************************************************************************************************

This message may contain confidential information. If you are not the intended 
recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take 
any action in relation to its contents. To do so is strictly prohibited and may 
be unlawful. Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff 
in England and Scotland. NHSmail is approved for exchanging patient data and 
other sensitive information with NHSmail and other accredited email services.

For more information and to find out how you can switch, 
https://portal.nhs.net/help/joiningnhsmail

  • Question re lua a... FRANKS, Andy (SHREWSBURY AND TELFORD HOSPITAL NHS TRUST)

Reply via email to