Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 239966 Details for
Bug 427760
Set socket timeout when connecting to cloud foundry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix to set socket timeout
org.eclipse.orion.server.patch (text/plain), 1.55 KB, created by
John Arthorne
on 2014-02-14 15:53:01 EST
(
hide
)
Description:
Fix to set socket timeout
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2014-02-14 15:53:01 EST
Size:
1.55 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/utils/HttpUtil.java b/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/utils/HttpUtil.java >index 636fdb9..d8c996b 100644 >--- a/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/utils/HttpUtil.java >+++ b/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/utils/HttpUtil.java >@@ -13,6 +13,7 @@ > import java.io.IOException; > import javax.servlet.http.HttpServletResponse; > import org.apache.commons.httpclient.*; >+import org.apache.commons.httpclient.params.HttpMethodParams; > import org.eclipse.core.runtime.Status; > import org.eclipse.orion.server.cf.CFActivator; > import org.eclipse.orion.server.cf.CFProtocolConstants; >@@ -22,9 +23,18 @@ > import org.json.JSONObject; > > public class HttpUtil { >+ /** >+ * Default socket connection timeout. >+ */ >+ private static final int DEFAULT_SOCKET_TIMEOUT = 300000;//five minutes >+ > public static void configureHttpMethod(HttpMethod method, Target target) throws JSONException { > method.addRequestHeader(new Header("Accept", "application/json")); > method.addRequestHeader(new Header("Content-Type", "application/json")); >+ //set default socket timeout for connection >+ HttpMethodParams params = method.getParams(); >+ params.setSoTimeout(DEFAULT_SOCKET_TIMEOUT); >+ method.setParams(params); > if (target.getCloud().getAccessToken() != null) > method.addRequestHeader(new Header("Authorization", "bearer " + target.getCloud().getAccessToken().getString("access_token"))); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
john.arthorne
:
review?
Actions:
View
|
Diff
Attachments on
bug 427760
: 239966