yup.
Thank you very much...
no need to make any changes in API ?
because option for frequent accept is made false by default in TSNetAccept(),
and i had to give it true to make it work.


On Wed, Jun 26, 2013 at 9:59 PM, James Peach <jpeach@apache.org> wrote:
On Jun 26, 2013, at 4:05 AM, Avinash Uttav <uttav.avinash99@gmail.com> wrote:

> Thank you very much sir ,
> Can u please tell me what are the correct arguments i need to pass with TSNetAccept
> to make the plugin work with it or any changes in that api (TSNetAccept)??


Something like this?

    TSNetAccept(
        TSContCreate(spdy_accept_io, TSMutexCreate()),
        9000 /* port */, AF_INET, 2 /* threads */);
    debug_plugin("listening on port %d", 9000);

>
> by default that opt.frequent_accept is set as False and fd as -1
> do i need to change that  ??
>
>
> On Wed, Jun 26, 2013 at 5:42 AM, James Peach <jpeach@apache.org> wrote:
> On Jun 25, 2013, at 4:34 AM, Avinash Uttav <uttav.avinash99@gmail.com> wrote:
>
> > Hi,
> > I m trying to get the SPDY plugin working .  Kindly help ,I have been stuck at this for very long .
> > After debugging I found out everytime the continuation handler is set as HttpAccept::main event
> > and the event passed to it is 202 but is NET_EVENT_ACCEPT.
> > Why both the functions TSNetAccept and TSNetAcceptNamed Protocol not getting the EVENT ....
> > TS_EVENT_NET_ACCEPT and connection data ..
>
> I hacked up the spdy plugin to use TSNetAccept and the TSNetAccept API appeared to work correctly. You are correct, there was a regression in TSNetAcceptNamed. I've fixed this in master <https://issues.apache.org/jira/browse/TS-1972>.
>
> thanks,
> James
>
> > While I tried with TSHttpTxnIntercept its sending the correct event and data to the Spdy plugin but is not usable for  this case ...
> > Kindly Help me I have been stuck at this point for too long . Is there any configuration settings that I m missing or its about something else .
> >
> > The situation is same when I use TSNetAccept  in spdy plugin instead of TSNetAcceptNamedProtocol to avoid any possible ssl problems.
> >
> > Running chrome in use-spdy=no-ssl  mode .
> >
> > Here is the log upto initialization of connection to see that plugin got loaded perfectly . (please ignore the comments added by me for debugging under my_tag and some printf statements )
> >
> >
> > Layout configuration
> >           --prefix = '/home/avinash/ats'
> >      --exec_prefix = '/home/avinash/ats'
> >           --bindir = '/home/avinash/ats/bin'
> >          --sbindir = '/home/avinash/ats/bin'
> >       --sysconfdir = '/home/avinash/ats/etc/trafficserver'
> >          --datadir = '/home/avinash/ats/share/trafficserver'
> >       --includedir = '/home/avinash/ats/include'
> >           --libdir = '/home/avinash/ats/lib'
> >       --libexecdir = '/home/avinash/ats/libexec/trafficserver'
> >    --localstatedir = '/home/avinash/ats/var'
> >       --runtimedir = '/home/avinash/ats/var/trafficserver'
> >           --logdir = '/home/avinash/ats/var/log/trafficserver'
> >           --mandir = '/home/avinash/ats/man'
> >          --infodir = '/home/avinash/ats/info'
> >         --cachedir = '/home/avinash/ats/var/trafficserver'
> > [TrafficServer] using root directory '/home/avinash/ats'
> > [New Thread 0x7ffff5289700 (LWP 5799)]
> > [Jun 25 17:02:08.628] Server {0x7ffff7fd1720} DEBUG: (http_init) proxy.config.http.redirection_enabled = 0
> > [Jun 25 17:02:08.628] Server {0x7ffff7fd1720} DEBUG: (http_init) proxy.config.http.number_of_redirections = 1
> > [Jun 25 17:02:08.628] Server {0x7ffff7fd1720} DEBUG: (http_init) proxy.config.http.post_copy_size = 2048
> > [Jun 25 17:02:08.633] Server {0x7ffff7fd1720} DEBUG: (dns) ink_dns_init: called with init_called = 0
> > [New Thread 0x7ffff3e61700 (LWP 5800)]
> > [New Thread 0x7ffff3d60700 (LWP 5801)]
> > [New Thread 0x7ffff3c5f700 (LWP 5802)]
> > [New Thread 0x7ffff3b5e700 (LWP 5803)]
> > [New Thread 0x7ffff3a5d700 (LWP 5804)]
> > [New Thread 0x7ffff385b700 (LWP 5805)]
> > [New Thread 0x7ffff3659700 (LWP 5806)]
> > [New Thread 0x7ffff3457700 (LWP 5807)]
> > [Jun 25 17:02:08.650] Server {0x7ffff7fd1720} DEBUG: (dns) localhost=Proxy1
> > [Jun 25 17:02:08.650] Server {0x7ffff7fd1720} DEBUG: (dns) Round-robin nameservers = 0
> > [New Thread 0x7ffff2e4e700 (LWP 5808)]
> > [New Thread 0x7ffff2c4c700 (LWP 5809)]
> > [New Thread 0x7ffff2a4a700 (LWP 5810)]
> > [New Thread 0x7ffff2848700 (LWP 5811)]
> > [New Thread 0x7ffff2646700 (LWP 5812)]
> > [New Thread 0x7ffff2444700 (LWP 5813)]
> > [New Thread 0x7ffff2242700 (LWP 5814)]
> > [New Thread 0x7ffff2040700 (LWP 5815)]
> > [Jun 25 17:02:08.674] Server {0x7ffff7fd1720} DEBUG: (ssl) setting SNI callbacks with for ctx 0x7fffec0c9d20
> > [Jun 25 17:02:08.674] Server {0x7ffff7fd1720} DEBUG: (ssl) indexed '*' with SSL_CTX 0x7fffec0c9d20
> > [New Thread 0x7ffff1e3e700 (LWP 5816)]
> > [New Thread 0x7ffff1b9b700 (LWP 5817)]
> > do listen function[New Thread 0x7ffff1999700 (LWP 5818)]
> > accepting loop eventdoing blocking acceptdo listen function[New Thread 0x7ffff1797700 (LWP 5819)]
> > accepting loop eventdoing blocking accept[Jun 25 17:02:08.690] Server {0x7ffff7fd1720} DIAG: (http) plugin loading = 1
> > [Jun 25 17:02:08.690] Server {0x7ffff7fd1720} DIAG: (my_tag) plugin path = /home/avinash/ats/libexec/trafficserver/spdy.so
> > [Jun 25 17:02:08.690] Server {0x7ffff7fd1720} DIAG: (my_tag) dll open path = /home/avinash/ats/libexec/trafficserver/spdy.so
> > [Jun 25 17:02:08.690] Server {0x7ffff7fd1720} DIAG: (my_tag) dll open RTLD_NOW = 2
> > [Jun 25 17:02:08.713] Server {0x7ffff7fd1720} DIAG: (spdy.plugin) TSPluginInit:392 initializing
> > [Jun 25 17:02:08.713] Server {0x7ffff7fd1720} DIAG: (spdy.plugin) TSPluginInit:418 registered named protocol endpoint for spdy/2
> > [Jun 25 17:02:08.713] Server {0x7ffff7fd1720} DIAG: (my_tag) the accept port is 18100
> > [New Thread 0x7ffff0c61700 (LWP 5820)]
> > [New Thread 0x7ffff0b60700 (LWP 5821)]
> > do listen function[New Thread 0x7ffff091a700 (LWP 5822)]
> > accepting loop eventdoing blocking accept[Jun 25 17:02:08.758] Server {0x7ffff7fd1720} DEBUG: (dns) DNSHandler::startEvent: on thread 0
> > [Jun 25 17:02:08.758] Server {0x7ffff7fd1720} DEBUG: (dns) open_con: opening connection107.108.3.17:53
> > [Jun 25 17:02:08.758] Server {0x7ffff7fd1720} DEBUG: (dns) random port = 0.0.0.0:40438
> > [Jun 25 17:02:08.758] Server {0x7ffff7fd1720} DEBUG: (dns) opening connection 107.108.3.17:53SUCCEEDED for 0
> > [Switching to Thread 0x7ffff3e61700 (LWP 5800)]
> >
> >
> >
> >
> >
> >
> > Here is the backtrace when the event 202 is passed to HttpAccept and not Plugin(SPDY plugin)
> >
> >
> >
> > (gdb) bt
> > #0  HttpAccept::mainEvent (this=0x7fffec139220, event=202, data=0x10c9e10) at HttpAccept.cc:43
> > #1  0x00000000004e1c28 in Continuation::handleEvent (this=0x7fffec139220, event=202, data=0x10c9e10) at ../iocore/eventsystem/I_Continuation.h:146
> > #2  0x00000000006bd5f5 in UnixNetVConnection::acceptEvent (this=0x10c9e10, event=1, e=0x10a3a50) at UnixNetVConnection.cc:974
> > #3  0x00000000004e1c28 in Continuation::handleEvent (this=0x10c9e10, event=1, data=0x10a3a50) at ../iocore/eventsystem/I_Continuation.h:146
> > #4  0x00000000006dbc51 in EThread::process_event (this=0x7ffff4266010, e=0x10a3a50, calling_code=1) at UnixEThread.cc:142
> > #5  0x00000000006dbea5 in EThread::execute (this=0x7ffff4266010) at UnixEThread.cc:194
> > #6  0x00000000006dae60 in spawn_thread_internal (a=0x105cf60) at Thread.cc:88
> > #7  0x00007ffff76789ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
> > #8  0x00007ffff557821d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
> > #9  0x0000000000000000 in ?? ()
> >
> > Thank You .