Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-11-23 Thread Florin Coras
Ow, so the issue is the reset. Could you try to call stream_session_disconnect 
instead of stream_session_cleanup in the handle?

Florin

> On Nov 22, 2018, at 6:51 AM, Andreas Schultz  
> wrote:
> 
> Hi,
> 
> Florin Coras mailto:fcoras.li...@gmail.com>> schrieb 
> am Mi., 21. Nov. 2018 um 18:33 Uhr:
> 
>> On Nov 21, 2018, at 8:55 AM, Andreas Schultz > > wrote:
>> 
>> Florin Coras mailto:fcoras.li...@gmail.com>> 
>> schrieb am Mi., 21. Nov. 2018 um 17:18 Uhr:
>> Hi Andreas, 
>> 
>> The trace lower suggests your tcp connection was freed but you still got 
>> data for it. tcp-input and the checks in established should prevent that 
>> from happening and the session layer should not receive any events after the 
>> transport notifies it that the session will cleaned up. 
> 
> I've found a way to reproduce the problem with a mostly unmodified vpp (see 
> attached patch for the changes).
> It turns that the crash is triggered when a tcp client is aborting 
> (resetting) the connection the hard way with a RST.
> 
> A normal connection close looks like this:
> 
> Client  Server (VPP)
> - [FIN,ACK] >
> < [FIN,ACK] - 
> --- [ACK] -->
> 
> The crash occurs when the connection is aborted like this:
> 
> Client  Server (VPP)
> - [RST,ACK] >
> 
> For the unmodified VPP the crash looks like this:
> 
> Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault.
> 0x776abda8 in tcp_handle_postponed_dequeues (wrk=0x7fffb7313b80) at 
> /usr/src/components/vpp/src/vnet/tcp/tcp_input.c:530
> 530 tc->flags &= ~TCP_CONN_DEQ_PENDING;
> (gdb) bt
> #0  0x776abda8 in tcp_handle_postponed_dequeues (wrk=0x7fffb7313b80) 
> at /usr/src/components/vpp/src/vnet/tcp/tcp_input.c:530
> #1  0x776b1a6c in tcp46_established_inline (vm=0x7708f340 
> , node=0x7fffb927a3c0, frame=0x7fffb7619800, is_ip4=1) at 
> /usr/src/components/vpp/src/vnet/tcp/tcp_input.c:2160
> #2  0x776b1b01 in tcp4_established (vm=0x7708f340 
> , node=0x7fffb927a3c0, from_frame=0x7fffb7619800) at 
> /usr/src/components/vpp/src/vnet/tcp/tcp_input.c:2171
> #3  0x770043ec in dispatch_node (vm=0x7708f340 
> , node=0x7fffb927a3c0, type=VLIB_NODE_TYPE_INTERNAL, 
> dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffb7619800, 
> last_time_stamp=67427903546971 )
> at /usr/src/components/vpp/src/vlib/main.c:1154
> #4  0x770049cc in dispatch_pending_node (vm=0x7708f340 
> , pending_frame_index=5, last_time_stamp=67427903546971 
> ) at /usr/src/components/vpp/src/vlib/main.c:1312
> #5  0x7700665f in vlib_main_or_worker_loop (vm=0x7708f340 
> , is_main=1) at /usr/src/components/vpp/src/vlib/main.c:1739
> #6  0x77006e38 in vlib_main_loop (vm=0x7708f340 
> ) at /usr/src/components/vpp/src/vlib/main.c:1813
> #7  0x77007be4 in vlib_main (vm=0x7708f340 , 
> input=0x7fffb6bfffb0) at /usr/src/components/vpp/src/vlib/main.c:2006
> #8  0x77062b90 in thread0 (arg=140737337946944) at 
> /usr/src/components/vpp/src/vlib/unix/main.c:606
> #9  0x76e73c98 in clib_calljmp () from 
> /usr/src/components/vpp/build-root/install-vpp_debug-native/vpp/lib/libvppinfra.so.19.01
> #10 0x7fffd230 in ?? ()
> #11 0x7706305d in vlib_unix_main (argc=34, argv=0x55694230) at 
> /usr/src/components/vpp/src/vlib/unix/main.c:675
> #12 0xd404 in main (argc=34, argv=0x55694230) at 
> /usr/src/components/vpp/src/vpp/vnet/main.c:272
> 
> The reason I discovered this is that my VPP HTTP server is sending a 302 
> redirect with a Location header. In this case wget is doing something with 
> the connection that leads to the RST instead of a normal FIN.
> 
> Regards
> Andreas
> 
> 
> -- 
> -- 
> Dipl.-Inform. Andreas Schultz
> 
> --- enabling your networks --
> Travelping GmbH Phone:  +49-391-81 90 99 0
> Roentgenstr. 13 Fax:+49-391-81 90 99 299
> 39108 Magdeburg Email:  i...@travelping.com 
> 
> GERMANY Web:http://www.travelping.com 
> 
> 
> Company Registration: Amtsgericht StendalReg No.:   HRB 10578
> Geschaeftsfuehrer: Holger Winkelmann  VAT ID No.: DE236673780
> -
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11391): https://lists.fd.io/g/vpp-dev/message/11391
Mute This Topic: https://lists.fd.io/mt/19343385/21656
Mute #vnet: https://lists.fd.io/mk?hashtag=vnet=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-11-21 Thread Florin Coras


> On Nov 21, 2018, at 8:55 AM, Andreas Schultz  
> wrote:
> 
> Florin Coras mailto:fcoras.li...@gmail.com>> schrieb 
> am Mi., 21. Nov. 2018 um 17:18 Uhr:
> Hi Andreas, 
> 
> The trace lower suggests your tcp connection was freed but you still got data 
> for it. tcp-input and the checks in established should prevent that from 
> happening and the session layer should not receive any events after the 
> transport notifies it that the session will cleaned up. 
> 
> So, apart from calling vnet_disconnect_session () on an rx event, have you 
> done anything else to the code?
> 
> Not to the session code. I got a bit creative when creating the listening 
> session and feeding the packets to ip-input.
> 
> The actual code for the session process is here: 
> https://gerrit.fd.io/r/c/15801/6/src/plugins/upf/upf_http_redirect_server.c#222
>  
> 
>  , I still need to address you comments there, but I don't think that this 
> has anything to do with the crash.
> 
> I'm going to test this a bit further with the http_server.

Ack. Do let me know what you find!

Cheers, 
Florin

> 
> Andreas
> 
> 
> Regards,
> Florin
> 
> 
>> On Nov 21, 2018, at 1:36 AM, Andreas Schultz > > wrote:
>> 
>> Florin Coras mailto:fcoras.li...@gmail.com>> 
>> schrieb am Fr., 18. Mai 2018 um 08:12 Uhr:
>> That http server is just example code that executes the contents of a get 
>> request as a cli commands within a spawned vpp process. So, if you want to 
>> disconnect _after_ the the reply is sent, call vnet_disconnect_session () at 
>> the end of http_cli_process.
>> 
>> Came across this when searching for a similar problem.
>> 
>> I tried exactly what Florin suggested in the rx_callback handle. Doing so 
>> result in segmentation in multiple places.
>> 
>> The first in tcp_input:
>> 
>> Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault.
>> 0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00) at 
>> /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
>> 530tc->flags &= ~TCP_CONN_DEQ_PENDING;
>> (gdb) print tc
>> $1 = (tcp_connection_t *) 0x0
>> (gdb) bt
>> #0  0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00) 
>> at /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
>> #1  0x770db8bb in tcp46_established_inline (vm=0x768f2340 
>> , node=0x7fffb6dc0600, frame=0x7fffb5e1afc0, is_ip4=1) at 
>> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2160
>> #2  0x770db951 in tcp4_established (vm=0x768f2340 
>> , node=0x7fffb6dc0600, from_frame=0x7fffb5e1afc0) at 
>> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2171
>> #3  0x76669ab2 in dispatch_node (vm=0x768f2340 
>> , node=0x7fffb6dc0600, type=VLIB_NODE_TYPE_INTERNAL, 
>> dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffb5e1afc0, 
>> last_time_stamp=6761417783745271)
>> at /usr/src/vpp/src/vlib/main.c:1109
>> #4  0x7666a092 in dispatch_pending_node (vm=0x768f2340 
>> , pending_frame_index=10, 
>> last_time_stamp=6761417783745271) at /usr/src/vpp/src/vlib/main.c:1267
>> #5  0x7666bd23 in vlib_main_or_worker_loop (vm=0x768f2340 
>> , is_main=1) at /usr/src/vpp/src/vlib/main.c:1694
>> #6  0x7666c4fc in vlib_main_loop (vm=0x768f2340 
>> ) at /usr/src/vpp/src/vlib/main.c:1768
>> #7  0x7666d2a9 in vlib_main (vm=0x768f2340 , 
>> input=0x7fffb53fffb0) at /usr/src/vpp/src/vlib/main.c:1961
>> #8  0x766c7d2d in thread0 (arg=140737329963840) at 
>> /usr/src/vpp/src/vlib/unix/main.c:606
>> #9  0x75ee2e04 in clib_calljmp () from 
>> /usr/src/vpp/build-root/install-vpp_debug-native/vpp/lib/libvppinfra.so.19.01
>> #10 0x7fffd0f0 in ?? ()
>> #11 0x766c81fa in vlib_unix_main (argc=44, argv=0x558939b0) at 
>> /usr/src/vpp/src/vlib/unix/main.c:675
>> #12 0xcce8 in main (argc=44, argv=0x558939b0) at 
>> /usr/src/vpp/src/vpp/vnet/main.c:272
>> 
>> After adding a check for tc == NULL, it crashes with
>> 
>> 0: /usr/src/vpp/src/vnet/session/session.h:394 (session_get_from_handle) 
>> assertion `! pool_is_free (smm->wrk[thread_index].sessions, _e)' fails
>> 
>> So it seems that is currently not possible to use vnet_disconnect_session () 
>> from a rx_callback directly.
>> 
>> Any hints on how to disconnect the tcp session from the rx callback?
>> 
>> Regards
>> Andreas
>> 
>> 
>> Florin
>> 
>> 
>>> On May 17, 2018, at 10:52 PM, muziding >> > wrote:
>>> 
>>> Hi
>>> 
>>> I want to make the example of http server  actively close the client 
>>> connection, instead of waiting for the client to close connection, after 
>>> http server has responded  to the client request. What should I do?
>> 
>> _._,_._,_
>> Links:
>> 
>> You receive all messages sent to this group.
>> 
>> 
>> View/Reply Online (#9328)  | 
>> Reply To Sender 
>> 

Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-11-21 Thread Andreas Schultz
Florin Coras  schrieb am Mi., 21. Nov. 2018 um
17:18 Uhr:

> Hi Andreas,
>
> The trace lower suggests your tcp connection was freed but you still got
> data for it. tcp-input and the checks in established should prevent that
> from happening and the session layer should not receive any events after
> the transport notifies it that the session will cleaned up.
>
> So, apart from calling vnet_disconnect_session () on an rx event, have you
> done anything else to the code?
>

Not to the session code. I got a bit creative when creating the listening
session and feeding the packets to ip-input.

The actual code for the session process is here:
https://gerrit.fd.io/r/c/15801/6/src/plugins/upf/upf_http_redirect_server.c#222
, I
still need to address you comments there, but I don't think that this has
anything to do with the crash.

I'm going to test this a bit further with the http_server.

Andreas


> Regards,
> Florin
>
>
> On Nov 21, 2018, at 1:36 AM, Andreas Schultz <
> andreas.schu...@travelping.com> wrote:
>
> Florin Coras  schrieb am Fr., 18. Mai 2018 um
> 08:12 Uhr:
>
>> That http server is just example code that executes the contents of a get
>> request as a cli commands within a spawned vpp process. So, if you want to
>> disconnect _after_ the the reply is sent, call vnet_disconnect_session ()
>> at the end of http_cli_process.
>>
>
> Came across this when searching for a similar problem.
>
> I tried exactly what Florin suggested in the rx_callback handle. Doing so
> result in segmentation in multiple places.
>
> The first in tcp_input:
>
> Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault.
> 0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00)
> at /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
> 530   tc->flags &= ~TCP_CONN_DEQ_PENDING;
> (gdb) print tc
> $1 = (tcp_connection_t *) 0x0
> (gdb) bt
> #0  0x770d5b25 in tcp_handle_postponed_dequeues
> (wrk=0x7fffb5ac5f00) at /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
> #1  0x770db8bb in tcp46_established_inline (vm=0x768f2340
> , node=0x7fffb6dc0600, frame=0x7fffb5e1afc0, is_ip4=1) at
> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2160
> #2  0x770db951 in tcp4_established (vm=0x768f2340
> , node=0x7fffb6dc0600, from_frame=0x7fffb5e1afc0) at
> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2171
> #3  0x76669ab2 in dispatch_node (vm=0x768f2340
> , node=0x7fffb6dc0600, type=VLIB_NODE_TYPE_INTERNAL,
> dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffb5e1afc0,
> last_time_stamp=6761417783745271)
> at /usr/src/vpp/src/vlib/main.c:1109
> #4  0x7666a092 in dispatch_pending_node (vm=0x768f2340
> , pending_frame_index=10,
> last_time_stamp=6761417783745271) at /usr/src/vpp/src/vlib/main.c:1267
> #5  0x7666bd23 in vlib_main_or_worker_loop (vm=0x768f2340
> , is_main=1) at /usr/src/vpp/src/vlib/main.c:1694
> #6  0x7666c4fc in vlib_main_loop (vm=0x768f2340
> ) at /usr/src/vpp/src/vlib/main.c:1768
> #7  0x7666d2a9 in vlib_main (vm=0x768f2340 ,
> input=0x7fffb53fffb0) at /usr/src/vpp/src/vlib/main.c:1961
> #8  0x766c7d2d in thread0 (arg=140737329963840) at
> /usr/src/vpp/src/vlib/unix/main.c:606
> #9  0x75ee2e04 in clib_calljmp () from
> /usr/src/vpp/build-root/install-vpp_debug-native/vpp/lib/libvppinfra.so.19.01
> #10 0x7fffd0f0 in ?? ()
> #11 0x766c81fa in vlib_unix_main (argc=44, argv=0x558939b0) at
> /usr/src/vpp/src/vlib/unix/main.c:675
> #12 0xcce8 in main (argc=44, argv=0x558939b0) at
> /usr/src/vpp/src/vpp/vnet/main.c:272
>
> After adding a check for tc == NULL, it crashes with
>
> 0: /usr/src/vpp/src/vnet/session/session.h:394 (session_get_from_handle)
> assertion `! pool_is_free (smm->wrk[thread_index].sessions, _e)' fails
>
> So it seems that is currently not possible to use vnet_disconnect_session
> () from a rx_callback directly.
>
> Any hints on how to disconnect the tcp session from the rx callback?
>
> Regards
> Andreas
>
>
>> Florin
>>
>>
>> On May 17, 2018, at 10:52 PM, muziding  wrote:
>>
>> Hi
>>
>> I want to make the example of http server  actively close the client
>> connection, instead of waiting for the client to close connection, after
>> http server has responded  to the client request. What should I do?
>>
>>
>> _._,_._,_
>> --
>> Links:
>>
>> You receive all messages sent to this group.
>>
>> View/Reply Online (#9328)  | 
>> Reply
>> To Sender
>> 
>>  | Reply To Group
>> 
>>  | Mute This Topic  | New Topic
>> 
>>
>>
>>
>> Mute #vnet 
>>
>> Change Your Subscription 
>> Group Home 
>> Contact Group Owner 
>> Terms Of Service 
>> Unsubscribe From This Group 

Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-11-21 Thread Florin Coras
Hi Andreas, 

The trace lower suggests your tcp connection was freed but you still got data 
for it. tcp-input and the checks in established should prevent that from 
happening and the session layer should not receive any events after the 
transport notifies it that the session will cleaned up. 

So, apart from calling vnet_disconnect_session () on an rx event, have you done 
anything else to the code?

Regards,
Florin

> On Nov 21, 2018, at 1:36 AM, Andreas Schultz  
> wrote:
> 
> Florin Coras mailto:fcoras.li...@gmail.com>> schrieb 
> am Fr., 18. Mai 2018 um 08:12 Uhr:
> That http server is just example code that executes the contents of a get 
> request as a cli commands within a spawned vpp process. So, if you want to 
> disconnect _after_ the the reply is sent, call vnet_disconnect_session () at 
> the end of http_cli_process.
> 
> Came across this when searching for a similar problem.
> 
> I tried exactly what Florin suggested in the rx_callback handle. Doing so 
> result in segmentation in multiple places.
> 
> The first in tcp_input:
> 
> Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault.
> 0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00) at 
> /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
> 530 tc->flags &= ~TCP_CONN_DEQ_PENDING;
> (gdb) print tc
> $1 = (tcp_connection_t *) 0x0
> (gdb) bt
> #0  0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00) 
> at /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
> #1  0x770db8bb in tcp46_established_inline (vm=0x768f2340 
> , node=0x7fffb6dc0600, frame=0x7fffb5e1afc0, is_ip4=1) at 
> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2160
> #2  0x770db951 in tcp4_established (vm=0x768f2340 
> , node=0x7fffb6dc0600, from_frame=0x7fffb5e1afc0) at 
> /usr/src/vpp/src/vnet/tcp/tcp_input.c:2171
> #3  0x76669ab2 in dispatch_node (vm=0x768f2340 
> , node=0x7fffb6dc0600, type=VLIB_NODE_TYPE_INTERNAL, 
> dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffb5e1afc0, 
> last_time_stamp=6761417783745271)
> at /usr/src/vpp/src/vlib/main.c:1109
> #4  0x7666a092 in dispatch_pending_node (vm=0x768f2340 
> , pending_frame_index=10, last_time_stamp=6761417783745271) 
> at /usr/src/vpp/src/vlib/main.c:1267
> #5  0x7666bd23 in vlib_main_or_worker_loop (vm=0x768f2340 
> , is_main=1) at /usr/src/vpp/src/vlib/main.c:1694
> #6  0x7666c4fc in vlib_main_loop (vm=0x768f2340 
> ) at /usr/src/vpp/src/vlib/main.c:1768
> #7  0x7666d2a9 in vlib_main (vm=0x768f2340 , 
> input=0x7fffb53fffb0) at /usr/src/vpp/src/vlib/main.c:1961
> #8  0x766c7d2d in thread0 (arg=140737329963840) at 
> /usr/src/vpp/src/vlib/unix/main.c:606
> #9  0x75ee2e04 in clib_calljmp () from 
> /usr/src/vpp/build-root/install-vpp_debug-native/vpp/lib/libvppinfra.so.19.01
> #10 0x7fffd0f0 in ?? ()
> #11 0x766c81fa in vlib_unix_main (argc=44, argv=0x558939b0) at 
> /usr/src/vpp/src/vlib/unix/main.c:675
> #12 0xcce8 in main (argc=44, argv=0x558939b0) at 
> /usr/src/vpp/src/vpp/vnet/main.c:272
> 
> After adding a check for tc == NULL, it crashes with
> 
> 0: /usr/src/vpp/src/vnet/session/session.h:394 (session_get_from_handle) 
> assertion `! pool_is_free (smm->wrk[thread_index].sessions, _e)' fails
> 
> So it seems that is currently not possible to use vnet_disconnect_session () 
> from a rx_callback directly.
> 
> Any hints on how to disconnect the tcp session from the rx callback?
> 
> Regards
> Andreas
> 
> 
> Florin
> 
> 
>> On May 17, 2018, at 10:52 PM, muziding > > wrote:
>> 
>> Hi
>> 
>> I want to make the example of http server  actively close the client 
>> connection, instead of waiting for the client to close connection, after 
>> http server has responded  to the client request. What should I do?
> 
> _._,_._,_
> Links:
> 
> You receive all messages sent to this group.
> 
> 
> View/Reply Online (#9328)  | 
> Reply To Sender 
> 
>  | Reply To Group 
> 
>  | Mute This Topic  | New Topic 
> 
> 
> 
> 
> Mute #vnet 
> 
> Change Your Subscription 
> Group Home 
> Contact Group Owner 
> Terms Of Service 
> Unsubscribe From This Group 
> _._,_._,_
> 
> 
> 
> 
> -- 
> -- 
> Dipl.-Inform. Andreas Schultz
> 
> --- enabling your networks 

Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-11-21 Thread Andreas Schultz
Florin Coras  schrieb am Fr., 18. Mai 2018 um
08:12 Uhr:

> That http server is just example code that executes the contents of a get
> request as a cli commands within a spawned vpp process. So, if you want to
> disconnect _after_ the the reply is sent, call vnet_disconnect_session ()
> at the end of http_cli_process.
>

Came across this when searching for a similar problem.

I tried exactly what Florin suggested in the rx_callback handle. Doing so
result in segmentation in multiple places.

The first in tcp_input:

Thread 1 "vpp_main" received signal SIGSEGV, Segmentation fault.
0x770d5b25 in tcp_handle_postponed_dequeues (wrk=0x7fffb5ac5f00) at
/usr/src/vpp/src/vnet/tcp/tcp_input.c:530
530   tc->flags &= ~TCP_CONN_DEQ_PENDING;
(gdb) print tc
$1 = (tcp_connection_t *) 0x0
(gdb) bt
#0  0x770d5b25 in tcp_handle_postponed_dequeues
(wrk=0x7fffb5ac5f00) at /usr/src/vpp/src/vnet/tcp/tcp_input.c:530
#1  0x770db8bb in tcp46_established_inline (vm=0x768f2340
, node=0x7fffb6dc0600, frame=0x7fffb5e1afc0, is_ip4=1) at
/usr/src/vpp/src/vnet/tcp/tcp_input.c:2160
#2  0x770db951 in tcp4_established (vm=0x768f2340
, node=0x7fffb6dc0600, from_frame=0x7fffb5e1afc0) at
/usr/src/vpp/src/vnet/tcp/tcp_input.c:2171
#3  0x76669ab2 in dispatch_node (vm=0x768f2340
, node=0x7fffb6dc0600, type=VLIB_NODE_TYPE_INTERNAL,
dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffb5e1afc0,
last_time_stamp=6761417783745271)
at /usr/src/vpp/src/vlib/main.c:1109
#4  0x7666a092 in dispatch_pending_node (vm=0x768f2340
, pending_frame_index=10,
last_time_stamp=6761417783745271) at /usr/src/vpp/src/vlib/main.c:1267
#5  0x7666bd23 in vlib_main_or_worker_loop (vm=0x768f2340
, is_main=1) at /usr/src/vpp/src/vlib/main.c:1694
#6  0x7666c4fc in vlib_main_loop (vm=0x768f2340
) at /usr/src/vpp/src/vlib/main.c:1768
#7  0x7666d2a9 in vlib_main (vm=0x768f2340 ,
input=0x7fffb53fffb0) at /usr/src/vpp/src/vlib/main.c:1961
#8  0x766c7d2d in thread0 (arg=140737329963840) at
/usr/src/vpp/src/vlib/unix/main.c:606
#9  0x75ee2e04 in clib_calljmp () from
/usr/src/vpp/build-root/install-vpp_debug-native/vpp/lib/libvppinfra.so.19.01
#10 0x7fffd0f0 in ?? ()
#11 0x766c81fa in vlib_unix_main (argc=44, argv=0x558939b0) at
/usr/src/vpp/src/vlib/unix/main.c:675
#12 0xcce8 in main (argc=44, argv=0x558939b0) at
/usr/src/vpp/src/vpp/vnet/main.c:272

After adding a check for tc == NULL, it crashes with

0: /usr/src/vpp/src/vnet/session/session.h:394 (session_get_from_handle)
assertion `! pool_is_free (smm->wrk[thread_index].sessions, _e)' fails

So it seems that is currently not possible to use vnet_disconnect_session
() from a rx_callback directly.

Any hints on how to disconnect the tcp session from the rx callback?

Regards
Andreas


> Florin
>
>
> On May 17, 2018, at 10:52 PM, muziding  wrote:
>
> Hi
>
> I want to make the example of http server  actively close the client
> connection, instead of waiting for the client to close connection, after
> http server has responded  to the client request. What should I do?
>
>
> _._,_._,_
> --
> Links:
>
> You receive all messages sent to this group.
>
> View/Reply Online (#9328)  | Reply
> To Sender
> 
> | Reply To Group
> 
> | Mute This Topic  | New Topic
> 
>
>
> Mute #vnet 
>
> Change Your Subscription 
> Group Home 
> Contact Group Owner 
> Terms Of Service 
> Unsubscribe From This Group 
> _._,_._,_
>
> --
-- 
Dipl.-Inform. Andreas Schultz

--- enabling your networks --
Travelping GmbH Phone:  +49-391-81 90 99 0
Roentgenstr. 13 Fax:+49-391-81 90 99 299
39108 Magdeburg Email:  i...@travelping.com
GERMANY Web:http://www.travelping.com

Company Registration: Amtsgericht StendalReg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann  VAT ID No.: DE236673780
-
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11346): https://lists.fd.io/g/vpp-dev/message/11346
Mute This Topic: https://lists.fd.io/mt/19343385/21656
Mute #vnet: https://lists.fd.io/mk?hashtag=vnet=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-05-20 Thread Burt Silverman
I was amused to read this on VPP simply because I have been spending less
time with VPP than previously because I am spending a bunch of time with
Arduino stuff -- and most of my time there is spent trying to figure out
why "read" or "recv" on a socket (using lwip stack) is not properly
propagating information about the far end server closing. So it was funny
to see issues about connections closing here.

Burt

On Fri, May 18, 2018 at 1:52 AM, muziding  wrote:

> Hi
>
> I want to make the example of http server  actively close the client
> connection, instead of waiting for the client to close connection, after
> http server has responded  to the client request. What should I do?
> 
>
>


Re: [vpp-dev] How to actively close the client connections in http server? #vnet

2018-05-18 Thread Florin Coras
That http server is just example code that executes the contents of a get 
request as a cli commands within a spawned vpp process. So, if you want to 
disconnect _after_ the the reply is sent, call vnet_disconnect_session () at 
the end of http_cli_process.

Florin

> On May 17, 2018, at 10:52 PM, muziding  wrote:
> 
> Hi
> 
> I want to make the example of http server  actively close the client 
> connection, instead of waiting for the client to close connection, after http 
> server has responded  to the client request. What should I do?
>