+
+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);
+}
+