Skip to content

Commit

Permalink
Merge pull request #78 from weibocom/fix/directUrlParse
Browse files Browse the repository at this point in the history
fix parsing multi directurl
  • Loading branch information
qdaxb committed May 27, 2016
2 parents f9f75ce + f0d6ad7 commit 70a0a17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private List<URL> parseDirectUrls(String directUrlStr) {
String[] durlArr = MotanConstants.COMMA_SPLIT_PATTERN.split(directUrlStr);
List<URL> directUrls = new ArrayList<URL>();
for (String dus : durlArr) {
URL du = URL.valueOf(dus);
URL du = URL.valueOf(StringTools.urlDecode(dus));
if (du != null) {
directUrls.add(du);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private ClusterSupport<T> createClusterSupport(URL refUrl, ConfigHandler configH
durl.setHost(hostPort[0].trim());
durl.setPort(Integer.parseInt(hostPort[1].trim()));
durl.addParameter(URLParamType.nodeType.getName(), MotanConstants.NODE_TYPE_SERVICE);
duBuf.append(StringTools.urlDecode(durl.toFullStr())).append(MotanConstants.COMMA_SEPARATOR);
duBuf.append(StringTools.urlEncode(durl.toFullStr())).append(MotanConstants.COMMA_SEPARATOR);
}
}
if (duBuf.length() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private <T> Referer<T> decorateWithFilter(Referer<T> referer, URL url) {
lastRef = new Referer<T>() {
@Override
public Response call(Request request) {
if (!f.getClass().getAnnotation(Activation.class).retry() && request.getRetries() != 0) {
Activation activation = f.getClass().getAnnotation(Activation.class);
if (activation != null && !activation.retry() && request.getRetries() != 0) {
return lf.call(request);
}
return f.filter(lf, request);
Expand Down

0 comments on commit 70a0a17

Please sign in to comment.