+
+my $protocol = utf8paramTrim($r, "protocol");
+my $host = utf8paramTrim($r, "host");
+my $port = utf8paramTrim($r, "port");
+my $dbname = utf8paramTrim($r, "dbname");
+my $title = utf8paramTrim($r, "title");
+
+if ((!defined $port || $port eq "") &&
+ (defined $protocol && $protocol ne "")) {
+ # Port-guessing based on defaults for each protocol
+ $port = $protocol eq "Z39.50" ? 210 : 80;
+ warn "guessed port $port";
+ &utf8param($r, port => $port);
+}
+
+my $newid;
+if (defined $protocol && $protocol ne "" &&
+ defined $host && $host ne "" &&
+ defined $port && $port ne "" &&
+ defined $title && $title ne "" &&
+ defined $dbname && $dbname ne "") {
+ $newid = irspy_make_identifier($protocol, $host, $port, $dbname);
+}
+