You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by fr...@apache.org on 2017/03/15 15:09:30 UTC

[1/2] incubator-trafficcontrol git commit: fix potential null pointer exception

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/2.0.x 680d9e458 -> b366bebb8


fix potential null pointer exception


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/bdfb6cfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/bdfb6cfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/bdfb6cfe

Branch: refs/heads/2.0.x
Commit: bdfb6cfed6da7276829738bb510725a9ef2868a7
Parents: 680d9e4
Author: Dave Neuman <ne...@apache.org>
Authored: Mon Mar 13 20:30:28 2017 -0600
Committer: Dave Neuman <ne...@apache.org>
Committed: Mon Mar 13 20:30:28 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/UI/ConfigFiles.pm | 34 ++++++++++++++++--------------
 1 file changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/bdfb6cfe/traffic_ops/app/lib/UI/ConfigFiles.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/ConfigFiles.pm b/traffic_ops/app/lib/UI/ConfigFiles.pm
index 78a19b2..47eb702 100644
--- a/traffic_ops/app/lib/UI/ConfigFiles.pm
+++ b/traffic_ops/app/lib/UI/ConfigFiles.pm
@@ -1508,22 +1508,24 @@ sub ssl_multicert_dot_config {
 		{ join => { deliveryservice_servers => { server => undef } }, } );
 	#get the domain_name from the first result since it should all be the same CDN
 	#TODO, the domain_name param needs to be a field on the CDN and not a param
-	my $domain_name  = UI::DeliveryService::get_cdn_domain( $self, $ds_list[0]->id );
-	foreach my $ds (@ds_list) {
-		my $ds_id        = $ds->id;
-		my $xml_id       = $ds->xml_id;
-		my $ds_regexes   = UI::DeliveryService::get_regexp_set( $self, $ds_id );
-		my @example_urls = UI::DeliveryService::get_example_urls( $self, $ds_id, $ds_regexes, $ds, $domain_name, $ds->protocol );
-
-		#first one is the one we want
-		my $hostname = $example_urls[0];
-		$hostname =~ /(https?:\/\/)(.*)/;
-		my $new_host = $2;
-		my $key_name = "$new_host.key";
-		$new_host =~ tr/./_/;
-		my $cer_name = $new_host . "_cert.cer";
-
-		$text .= "ssl_cert_name=$cer_name\t ssl_key_name=$key_name\n";
+	if (@ds_list > 0) {
+		my $domain_name  = UI::DeliveryService::get_cdn_domain( $self, $ds_list[0]->id );
+		foreach my $ds (@ds_list) {
+			my $ds_id        = $ds->id;
+			my $xml_id       = $ds->xml_id;
+			my $ds_regexes   = UI::DeliveryService::get_regexp_set( $self, $ds_id );
+			my @example_urls = UI::DeliveryService::get_example_urls( $self, $ds_id, $ds_regexes, $ds, $domain_name, $ds->protocol );
+
+			#first one is the one we want
+			my $hostname = $example_urls[0];
+			$hostname =~ /(https?:\/\/)(.*)/;
+			my $new_host = $2;
+			my $key_name = "$new_host.key";
+			$new_host =~ tr/./_/;
+			my $cer_name = $new_host . "_cert.cer";
+
+			$text .= "ssl_cert_name=$cer_name\t ssl_key_name=$key_name\n";
+		}
 	}
 	return $text;
 }


[2/2] incubator-trafficcontrol git commit: This fixes #358

Posted by fr...@apache.org.
This fixes #358


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b366bebb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b366bebb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b366bebb

Branch: refs/heads/2.0.x
Commit: b366bebb8e7a71318e23d23052c176dac7b088c7
Parents: bdfb6cf
Author: Eric Friedrich <fr...@apache.org>
Authored: Wed Mar 15 11:09:13 2017 -0400
Committer: Eric Friedrich <fr...@apache.org>
Committed: Wed Mar 15 11:09:13 2017 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------