}
else {
struct sockaddr_in *snsi;
- char *host;
+ char *host, *pos;
int port;
- host = "127.0.0.1";
- port = atoi(cfg->appPort);
-
- //ap_log_error(__FILE__, __LINE__, APLOG_INFO, 0, r->server,
- // "appPort: '%s', cfg 0x%08X", cfg->appPort, cfg);
+ if ((pos = index(cfg->appPort, ':'))) {
+ host = apr_palloc(r->pool, (pos - cfg->appPort) + 3);
+ strncpy(host, cfg->appPort, (pos - cfg->appPort));
+ host[pos - cfg->appPort] = '\0';
+
+ port = atoi(pos + 1);
+ }
+ else {
+ host = "127.0.0.1";
+ port = atoi(cfg->appPort);
+ }
+
+#if HEAVY_LOG
+ ap_log_error(__FILE__, __LINE__, APLOG_INFO, 0, r->server,
+ "appPort: '%s' host: %s port %d, cfg 0x%p",
+ cfg->appPort, host, port, cfg);
+#endif
addressLen = sizeof(struct sockaddr_in);
address = apr_palloc(r->pool, sizeof(struct sockaddr_in));
if (snsi->sin_addr.s_addr == -1) {
ap_log_error(__FILE__, __LINE__, APLOG_ERR, 0, r->server,
- "couldn't convert snsd IP address: %s", host);
+ "could not convert IP address: %s", host);
}
if (HEAVY_LOG && 0) {
ap_log_error(__FILE__, __LINE__, APLOG_ERR, 0, r->server,