On 08/04/2012, at 9:12 AM, Igor Galić wrote: > > ----- Original Message ----- >> TS-1147: Implement default certificate fallback. >> >> [snip] >> - // Index this certificate by the specified IP(v6) address; >> - this->ssl_storage->insert(ctx, strAddr); >> + // Index this certificate by the specified IP(v6) address. If >> the address is "*", make it the default context. > > What happens if more than one such line occurs?
The last one wins. > >> + if (strAddr) { >> + if (strcmp(strAddr, "*") == 0) { >> + this->ssl_default = ctx; >> + } else { >> + this->ssl_storage->insert(ctx, strAddr); >> + } >> + } >> >> // Insert additional mappings. Note that this maps multiple keys >> to the same value, so when >> // this code is updated to reconfigure the SSL certificates, it >> will need some sort of >> >> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cadc9b6c/iocore/net/SSLNetVConnection.cc >> ---------------------------------------------------------------------- >> diff --git a/iocore/net/SSLNetVConnection.cc >> b/iocore/net/SSLNetVConnection.cc >> index 0fd34a3..e9372e9 100644 >> --- a/iocore/net/SSLNetVConnection.cc >> +++ b/iocore/net/SSLNetVConnection.cc >> @@ -51,13 +51,20 @@ ClassAllocator<SSLNetVConnection> >> sslNetVCAllocator("sslNetVCAllocator"); >> static int >> ssl_servername_callback(SSL * ssl, int * ad, void * arg) >> { >> - SSL_CTX * ctx; >> + SSL_CTX * ctx = NULL; >> SSLCertLookup * lookup = (SSLCertLookup *) arg; >> - const char * servername = SSL_get_servername(ssl, >> TLSEXT_NAMETYPE_host_name); >> + const char * servername = SSL_get_servername(ssl, >> TLSEXT_NAMETYPE_host_name); > > This is some really funky style. > Please don't do that. > > https://cwiki.apache.org/confluence/display/TS/Coding+Style Aligning local declarations for readability is perfectly conventional and not mentioned in the coding style afaict :) J