Return-Path: X-Original-To: apmail-trafficserver-dev-archive@www.apache.org Delivered-To: apmail-trafficserver-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAC871041C for ; Thu, 3 Apr 2014 00:20:36 +0000 (UTC) Received: (qmail 63325 invoked by uid 500); 3 Apr 2014 00:20:34 -0000 Delivered-To: apmail-trafficserver-dev-archive@trafficserver.apache.org Received: (qmail 63188 invoked by uid 500); 3 Apr 2014 00:20:33 -0000 Mailing-List: contact dev-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list dev@trafficserver.apache.org Received: (qmail 63173 invoked by uid 99); 3 Apr 2014 00:20:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2014 00:20:33 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [17.151.62.51] (HELO mail-out.apple.com) (17.151.62.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2014 00:20:26 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from relay4.apple.com ([17.128.113.87]) by mail-out.apple.com (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22 2013)) with ESMTP id <0N3F00KKMI8NDHW1@mail-out.apple.com>; Wed, 02 Apr 2014 17:20:03 -0700 (PDT) X-AuditID: 11807157-f79aa6d0000017b2-71-533ca9333919 Received: from orrisroot.apple.com (orrisroot.apple.com [17.128.115.106]) (using TLS with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by relay4.apple.com (Apple SCV relay) with SMTP id 58.A8.06066.339AC335; Wed, 2 Apr 2014 17:20:03 -0700 (PDT) Received: from [17.149.236.99] (unknown [17.149.236.99]) by orrisroot.apple.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPSA id <0N3F00KI8I9F6Y20@orrisroot.apple.com>; Wed, 02 Apr 2014 17:20:03 -0700 (PDT) Subject: Re: [4/5] git commit: TS-2612: Indroduce TSHttpConnectWithProtoStack() API From: James Peach In-reply-to: Date: Wed, 02 Apr 2014 17:20:03 -0700 Cc: "commits@trafficserver.apache.org" Message-id: <560CD6FF-7520-4278-BBAE-BCEE3163862C@apache.org> References: <2161335069f640058b5aba180d8374d9@git.apache.org> <2907E26C-B44C-40F2-B1BA-F0805B8ADBFD@apache.org> <0353D2DB-FBF8-4986-8D92-D9B388C661C1@apache.org> To: dev@trafficserver.apache.org X-Mailer: Apple Mail (2.1874) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsUi2FCcpWu80ibYoHu1ssXJfRuYLG40zmd2 YPJ4vvUfWwBjFJdNSmpOZllqkb5dAlfG8kc72Ap2i1d872tnbmD8KdTFyMkhIWAiMe3hdiYI W0ziwr31bF2MXBxCAlOYJO5NP8kC4fQzSZxfOpsNpIpZQEei9/s3ZhCbV0BP4szZX+wgtrBA qMTXOxvAatgEVCV27zvCCGJzCgRL3PzVB7aBBSg+5fg91i5GDqA5nhKnFxlDjNSWePLuAivE SFuJO60g5SB7FwDtXd8MlhARUJD4+X4CO8SlshKPPjSxTGAUmIXkpFlITpqFZO4CRuZVjAJF qTmJlSZ6iQUFOal6yfm5mxjBQVgYvoPx3zKrQ4wCHIxKPLwPxG2ChVgTy4orcw8xSnAwK4nw qkQBhXhTEiurUovy44tKc1KLDzFKc7AoifNu1bIKFhJITyxJzU5NLUgtgskycXBKNTDmJVi+ PaNaLBA948gLfuaijYc0lp7zTXv7SdniiMz/whmzdzXvfRtm6PSKwUjh2771FhN8Ahc1xnx5 +8vubep2k6UrCxYd2r9xZ3hc7bbvTM4bNO+Kdca17jixcfoklvWPGXv/P/VzEs/oaDTYMuux XPSC6tzPSv6fWILbE2aYL5rIzjDdbWqoEktxRqKhFnNRcSIA2Ny/6z4CAAA= X-Virus-Checked: Checked by ClamAV on apache.org On Mar 27, 2014, at 8:35 PM, Yunkai Zhang wrote: > On Fri, Mar 28, 2014 at 8:00 AM, James Peach wrote: > >> On Mar 13, 2014, at 2:56 PM, James Peach wrote: >> >>> On Mar 11, 2014, at 8:12 PM, yunkai@apache.org wrote: >>> >>>> 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 >>> >>> This needs API review since the final form of the API was not reviewed >> on dev@. I'll try to review this next week. Everyone else who reviewed >> the original proposal should also review :) >> >> I like the name "TSClientProtoStack". I don't like that it is tied to >> TSHttpConnect; since it is a property of the VConn, doesn't it make more >> sense to be able to get and set it on a TSVConn? >> > > It seems not easy to do that, before a new VConn returned by > TSHttpConnect() API, the connection might have been established > asynchronously. That is say, unexpected client proto stack whould be passed > to HttpSM before it was set, and HttpSM will copy the unexpected value to > its internal HttpSM->proto_stack variable -- IIUC, logging module should > not read VConn->proto_stack directly as VConn might have been released in > logging phase. Pretty sure that this would affect TSHttpConnectTransparent, TSFetchUrl and TSFetchPages. If that's the case, I guess we can lump this with the other issues for needing a new HTTP request API. I guess TSNetConnect does not get logged anyway, right? >> I don't think that users should have to deal with the bitmask >> representation directly. It would be better to separate this into 2 types >> (transport protocol and application protocol), and then do the bitshifting >> internally. We should have internal helper functions to unpack the >> bitfields. >> > > I just worry about that there may exist some clients contain more than 2 > types in its proto stack in the future. TSClientProtoStack TSClientProtoStackCreate(TSProtoType, ...) // Websockets over SPDY over TLS ... protostack = TSClientProtoStackCreate(TS_PROTO_TCP, TS_PROTO_TLS, TS_PROTO_SPDY, TS_PROTO_WBSK, TS_PROTO_MAX); What do you think? J