Re: Using sockets from Lua

2015-08-26 Thread Marc-Antoine
Great, no more segfault !
Tx a lot ;)

On Tue, 25 Aug 2015 18:28:31 +0200,
Willy Tarreau w...@1wt.eu wrote :

 On Tue, Aug 25, 2015 at 05:27:59PM +0200, Thierry FOURNIER wrote:
  Hello,
  
  Thank you for the bug repport. It is fixed in the current developpment
  version. You must compile from sources or wait for the next dev release.
  
  Actually, the function txn.close() causes a segfault, it will be
  fixed in a few time.
 
 I just merged your temporary fix, Thierry, so the segfault is supposed
 to be gone. CCing Marc-Antoine and Cyril on this. In the mean time, guys,
 please don't add code after txn.close(), as it more or less expects to be
 final. In all your examples it was already fine, but if we manage to enforce
 it to be final, you'll get less surprizes later :-)
 
 Thanks,
 Willy
 


-- 
Marc-Antoine



Re: Using sockets from Lua

2015-08-25 Thread Willy Tarreau
On Tue, Aug 25, 2015 at 05:27:59PM +0200, Thierry FOURNIER wrote:
 Hello,
 
 Thank you for the bug repport. It is fixed in the current developpment
 version. You must compile from sources or wait for the next dev release.
 
 Actually, the function txn.close() causes a segfault, it will be
 fixed in a few time.

I just merged your temporary fix, Thierry, so the segfault is supposed
to be gone. CCing Marc-Antoine and Cyril on this. In the mean time, guys,
please don't add code after txn.close(), as it more or less expects to be
final. In all your examples it was already fine, but if we manage to enforce
it to be final, you'll get less surprizes later :-)

Thanks,
Willy




Re: Using sockets from Lua

2015-08-25 Thread Thierry FOURNIER
Hello,

Thank you for the bug repport. It is fixed in the current developpment
version. You must compile from sources or wait for the next dev release.

Actually, the function txn.close() causes a segfault, it will be
fixed in a few time.

Thierry



On Thu, 20 Aug 2015 15:09:10 +0300
Tsvetan Tsvetanov cpi.ce...@gmail.com wrote:

 Hello,
 
 I'm trying to make HAProxy work as a router for certain requests. What I
 have is a very simple configuration which sends every tcp request to a
 Lua script. The script then is responsible to parse the request, see for
 which server it is and forward it there. It then waits for a response
 and forwards the response back to the requester.
 
 The code is kind of the following:
 
 function hello(txn)
 local request_msg = txn.req:dup()
 
 local tsm_sock = core.tcp()
 
 tsm_sock:connect(127.0.0.1, )
 
 local res = tsm_sock:send(request_msg)
 
 local response = tsm_sock:receive('*l')
 
 txn.res:send(response)
 txn:close()
 end
 
 The problem is that in versions 1.6-dev2 and 1.6-dev3, socket.connect 
 timeouts.
 The server to which we connect is a simple echo server. I've telneted numerous
 times directly to it and experienced no problems, so I assume that the error 
 ain't
 there. Also, on version 1.6-dev1, the connect doesn't timeout and everything 
 works 
 okay.
 
 What could be the issue?
 
 Thanks!
 --
 Tsvetan
 
 



Re: Using sockets from Lua

2015-08-25 Thread Tsvetan Tsvetanov
On Tue, 2015-08-25 at 18:28 +0200, Willy Tarreau wrote:
 On Tue, Aug 25, 2015 at 05:27:59PM +0200, Thierry FOURNIER wrote:
  Hello,
  
  Thank you for the bug repport. It is fixed in the current developpment
  version. You must compile from sources or wait for the next dev release.
  
  Actually, the function txn.close() causes a segfault, it will be
  fixed in a few time.
 
 I just merged your temporary fix, Thierry, so the segfault is supposed
 to be gone. CCing Marc-Antoine and Cyril on this. In the mean time, guys,
 please don't add code after txn.close(), as it more or less expects to be
 final. In all your examples it was already fine, but if we manage to enforce
 it to be final, you'll get less surprizes later :-)
 
 Thanks,
 Willy
 

Wow, thanks guys! I really appreciate the fast reaction :)

Have fun,
Tsvetan