Changes with Apache 2.0.28-dev
+ *) When no port is given in a "ServerName host" directive, the
+ server_rec->port is now set to zero, not 80. That allows for
+ run-time deduction of the correct server port (depending on
+ SSL/plain, and depending also on the current setting of
+ UseCanonicalName). This change makes redirections
+ work, even with https:// connections. [Martin Kraemer]
+
*) Add a '%{note-name}e' argument to mod-headers, which works in
the same way as mod_log_confg. [Ian Holsman]
if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
|| d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
- if (r->hostname) {
+ if (r->connection && r->connection->client_socket) {
apr_sockaddr_t *localsa;
apr_socket_addr_get(&localsa, APR_LOCAL, r->connection->client_socket);
portstr - arg);
portstr++;
port = atoi(portstr);
+ if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */
+ return apr_pstrcat(cmd->temp_pool, "The port number \"", arg,
+ "\" is outside the appropriate range "
+ "(i.e., 1..65535).", NULL);
+ }
}
else {
cmd->server->server_hostname = apr_pstrdup(cmd->pool, arg);
- port = 80;
- }
- if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */
- return apr_pstrcat(cmd->temp_pool, "The port number \"", arg,
- "\" is outside the appropriate range "
- "(i.e., 1..65535).", NULL);
+ port = 0;
}
cmd->server->port = port;
return NULL;