ParentProxySet
--------------

                 Key: TS-836
                 URL: https://issues.apache.org/jira/browse/TS-836
             Project: Traffic Server
          Issue Type: Bug
          Components: TS API
    Affects Versions: 2.1.9
            Reporter: M. Nunberg


The following code will result in a socket connection being made to the OS:54321

#include <sys/socket.h>
typedef struct sockaddr_storage sockaddr_storage; /*And i need to do this 
because of another bug*/
#include <ts/ts.h>
#include <assert.h>
#include <stdlib.h>
#include <netinet/in.h>


static int hook_os_dns(TSCont contp, TSEvent event, void *edata)
{
        TSHttpTxn txnp = edata;
        TSHttpTxnParentProxySet(txnp, "172.29.70.140", 54321);
        TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
        return 0;
}

void TSPluginInit(int arg, const char *argv[])
{
        TSPluginRegistrationInfo info = { "foo", "bar", "baz" };
        TSPluginRegister(TS_SDK_VERSION_3_0, &info);
        TSCont os_dns_cont = TSContCreate(hook_os_dns, NULL);
        TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, os_dns_cont);
}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to