Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-15 07:06:35 +0000
committerEike Stepper2012-08-15 07:06:35 +0000
commit7eb4acd2f91f852946fb40ad647740dc69e8b69b (patch)
treec41bce7ac0ad531ecd3b8fa77420b8ae88f03deb /plugins/org.eclipse.net4j.http.common
parent7cc89ae0efe2ab1fd6d4ed071b4a6f96852ff336 (diff)
downloadcdo-7eb4acd2f91f852946fb40ad647740dc69e8b69b.tar.gz
cdo-7eb4acd2f91f852946fb40ad647740dc69e8b69b.tar.xz
cdo-7eb4acd2f91f852946fb40ad647740dc69e8b69b.zip
[259086] Protocol versions should be checked
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259086
Diffstat (limited to 'plugins/org.eclipse.net4j.http.common')
-rw-r--r--plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java17
2 files changed, 18 insertions, 9 deletions
diff --git a/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
index f70b5ff6b3..56ff33a571 100644
--- a/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.http.common
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.0.200.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,11 +11,11 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.net4j.http.common;version="4.0.100";uses:="org.eclipse.net4j.connector",
- org.eclipse.net4j.http.internal.common;version="4.0.100";
+Export-Package: org.eclipse.net4j.http.common;version="4.0.200";uses:="org.eclipse.net4j.connector",
+ org.eclipse.net4j.http.internal.common;version="4.0.200";
x-friends:="org.eclipse.net4j.http,
org.eclipse.net4j.http.server,
org.eclipse.net4j.http.tests,
org.eclipse.net4j.defs",
- org.eclipse.net4j.http.internal.common.bundle;version="4.0.100";x-friends:="org.eclipse.net4j.http,org.eclipse.net4j.http.server,org.eclipse.net4j.http.tests",
- org.eclipse.net4j.http.internal.common.messages;version="4.0.100";x-internal:=true
+ org.eclipse.net4j.http.internal.common.bundle;version="4.0.200";x-friends:="org.eclipse.net4j.http,org.eclipse.net4j.http.server,org.eclipse.net4j.http.tests",
+ org.eclipse.net4j.http.internal.common.messages;version="4.0.200";x-internal:=true
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
index ce521cd7de..c0ab99e630 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.net4j.http.internal.common;
+import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.channel.ChannelException;
import org.eclipse.net4j.connector.ConnectorException;
@@ -114,7 +115,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
/**
* Writes operations from the {@link #outputOperations} to the passed stream. After each written operation
* {@link #writeMoreOperations()} is asked whether to send more operations.
- *
+ *
* @return <code>true</code> if more operations are in the {@link #outputOperations}, <code>false</code> otherwise.
*/
public boolean writeOutputOperations(ExtendedDataOutputStream out) throws IOException
@@ -191,7 +192,10 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
@Override
protected void registerChannelWithPeer(short channelID, long timeout, IProtocol<?> protocol) throws ChannelException
{
- ChannelOperation operation = new OpenChannelOperation(channelID, protocol.getType());
+ String protocolID = Net4jUtil.getProtocolID(protocol);
+ int protocolVersion = Net4jUtil.getProtocolVersion(protocol);
+
+ ChannelOperation operation = new OpenChannelOperation(channelID, protocolID, protocolVersion);
outputOperations.add(operation);
HTTPChannel channel = (HTTPChannel)getChannel(channelID);
@@ -322,16 +326,20 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
{
private String protocolID;
- public OpenChannelOperation(short channelID, String protocolID)
+ private int protocolVersion;
+
+ public OpenChannelOperation(short channelID, String protocolID, int protocolVersion)
{
super(channelID, 0);
this.protocolID = protocolID;
+ this.protocolVersion = protocolVersion;
}
public OpenChannelOperation(ExtendedDataInputStream in) throws IOException
{
super(in);
protocolID = in.readString();
+ protocolVersion = in.readInt();
}
@Override
@@ -339,6 +347,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
{
super.write(out);
out.writeString(protocolID);
+ out.writeInt(protocolVersion);
}
@Override
@@ -350,7 +359,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
@Override
public void execute()
{
- HTTPChannel channel = (HTTPChannel)inverseOpenChannel(getChannelID(), protocolID);
+ HTTPChannel channel = (HTTPChannel)inverseOpenChannel(getChannelID(), protocolID, protocolVersion);
if (channel == null)
{
throw new ConnectorException(Messages.getString("HTTPConnector.0")); //$NON-NLS-1$

Back to the top