Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,16 @@ public boolean enableContext(String hostName, String contextPath) {
public Map<InetSocketAddress, String> getProxyConfiguration() {
return this.service.getProxyConfiguration();
}
public String getProxyConfigurationString() {
String result = null;

Map<InetSocketAddress, String> map = this.service.getProxyConfiguration();
if (map.isEmpty())
return null;
Object results[] = map.values().toArray();
result = (String) results[0];
return result;
}

/**
* {@inhericDoc}
Expand All @@ -371,6 +381,16 @@ public Map<InetSocketAddress, String> getProxyConfiguration() {
public Map<InetSocketAddress, String> getProxyInfo() {
return this.service.getProxyInfo();
}
public String getProxyInfoString() {
String result = null;

Map<InetSocketAddress, String> map = this.service.getProxyInfo();
if (map.isEmpty())
return null;
Object results[] = map.values().toArray();
result = (String) results[0];
return result;
}

/**
* {@inhericDoc}
Expand Down Expand Up @@ -411,6 +431,9 @@ public void reset() {
public boolean stop(long timeout, TimeUnit unit) {
return this.service.stop(timeout, unit);
}
public boolean stop(long timeout) {
return this.service.stop(timeout, TimeUnit.SECONDS);
}

/**
* {@inhericDoc}
Expand All @@ -422,4 +445,7 @@ public boolean stop(long timeout, TimeUnit unit) {
public boolean stopContext(String host, String path, long timeout, TimeUnit unit) {
return this.service.stopContext(host, path, timeout, unit);
}
public boolean stopContext(String host, String path, long timeout) {
return this.service.stopContext(host, path, timeout, TimeUnit.SECONDS);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ public class MulticastSocketFactoryImpl implements MulticastSocketFactory {

public MulticastSocketFactoryImpl() {
String value = this.getSystemProperty("os.name");
this.linuxlike = (value != null) && (value.toLowerCase().startsWith("linux") || value.toLowerCase().startsWith("mac") || value.toLowerCase().startsWith("hp"));
boolean linuxlike = (value != null) && (value.toLowerCase().startsWith("linux") || value.toLowerCase().startsWith("hp"));
if (value != null && value.toLowerCase().startsWith("mac")) {
value = this.getSystemProperty("os.version");
if (value != null) {
String[] subs = value.split("\\." );
if (Integer.parseInt(subs[0]) > 10) {
linuxlike = false;
} else if (Integer.parseInt(subs[0]) == 10 && Integer.parseInt(subs[1]) > 9) {
linuxlike = false;
} else if (Integer.parseInt(subs[0]) == 10 && Integer.parseInt(subs[1]) == 9 && Integer.parseInt(subs[2]) >=5 ) {
linuxlike = false;
}
}
}
this.linuxlike = linuxlike;
}

private String getSystemProperty(final String key) {
Expand Down
13 changes: 13 additions & 0 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
#define TEXT_PLAIN 1
#define TEXT_XML 2

static int use_ws = 0;

/* shared memory */
static mem_t *contextstatsmem = NULL;
static mem_t *nodestatsmem = NULL;
Expand Down Expand Up @@ -499,6 +501,11 @@ static int manager_init(apr_pool_t *p, apr_pool_t *plog,
/* first call do nothing */
apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool);
return OK;
} else {
/* check if we should use ws or http */
if (ap_find_linked_module("mod_proxy_wstunnel.c") != NULL) {
use_ws = -1;
}
}

if (mconf->basefilename) {
Expand Down Expand Up @@ -975,6 +982,12 @@ static char * process_config(request_rec *r, char **ptr, int *errtype)
return SROUBAD;
}

if (use_ws && strcmp(nodeinfo.mess.Type, "ajp")) {
if (!strcmp(nodeinfo.mess.Type, "http"))
strcpy(nodeinfo.mess.Type, "ws");
if (!strcmp(nodeinfo.mess.Type, "https"))
strcpy(nodeinfo.mess.Type, "wss");
}
/* Insert or update balancer description */
if (insert_update_balancer(balancerstatsmem, &balancerinfo) != APR_SUCCESS) {
*errtype = TYPEMEM;
Expand Down