[ https://issues.apache.org/jira/browse/TS-2612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931342#comment-13931342 ]
ASF subversion and git services commented on TS-2612: ----------------------------------------------------- Commit 25555f8f43439c890811b1b9776e485d5a5d3349 in trafficserver's branch refs/heads/master from [~yunkai] [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=25555f8 ] TS-2612: Indroduce TSHttpConnectWithProtoStack() API 1) Firstly, add a bitmask, *proto_stack*, in NetVConnection/HttpSM, and set it properly. 2) For some plugins that using TSHttpConnect() API to do request, the Logging module can't know what protocol stack is used, so I add a new API: TSHttpConnectWithProtoStack(struct sockaddr const* addr, TSClientProtoStack proto_stack); After introducing TSHttpConnectWithProtoStack() API, TSHttpConnect() API would be a special case of it: TSVConn TSHttpConnect(sockaddr const* addr) { return TSHttpConnectWithProtoStack(addr, (1u << TS_PROTO_HTTP)); } Signed-off-by: Yunkai Zhang <qiushu....@taobao.com> > Introduce TSHttpConnectWithProtoStack() API > ------------------------------------------- > > Key: TS-2612 > URL: https://issues.apache.org/jira/browse/TS-2612 > Project: Traffic Server > Issue Type: New Feature > Components: TS API > Reporter: Yunkai Zhang > Assignee: Yunkai Zhang > Labels: api-addition, review > Fix For: 5.0.0 > > Attachments: > 0004-TS-2612-Indroduce-TSHttpConnectWithProtoStack-API.patch > > > This ticket was split from SPDY ticket(TS-2431), and it based on extended > FetchSM ticket(TS-1062); > For some plugins that using TSHttpConnect() API to do request, the Logging > module can't know which protocol type is used, so I add a new API and > relatived tyeps: > {code} > /** > TSClientProtoStack represents what protocols are used by > the client. It may be composed by several TSProtoType. > The value of TSProtoType indicates bit-offset that can > be mapped to TSClientProtoStack by bit shifting. > For example, TLS+SPDY can be mapped to protocol stack: > proto_stack = (1u << TS_PROTO_TLS) | (1u << TS_PROTO_SPDY) > For the sake of brevity, TS_PROTO_TCP is usually omitted in > protocol stack. > */ > typedef enum { > /* Transport protocols (0~11) */ > TS_PROTO_UDP = 0, > TS_PROTO_TCP = 1, > TS_PROTO_TLS = 2, /* TLS/SSL */ > > /* Application protocols (12~31) */ > TS_PROTO_HTTP = 12, > TS_PROTO_SPDY = 13, > TS_PROTO_RTMP = 14, > TS_PROTO_WBSK = 15, /* WebSocket */ > } TSProtoType; > typedef uint32_t TSClientProtoStack; > tsapi TSVConn TSHttpConnectWithProtoStack(struct sockaddr const* addr, > TSClientProtoStack proto_stack); > {code} > After introducing TSHttpConnectWithProtoStack() API, TSHttpConnect() API > would be a special case of it: > {code} > TSVConn > TSHttpConnect(sockaddr const* addr) > { > return TSHttpConnectWithProtoStack(addr, (1u << TS_PROTO_HTTP)); > } > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)