Skip to content

Commit 13403cd

Browse files
authored
Merge pull request #767 from joe-chacko/fix/specify-charset-when-getting-bytes-for-op-name
fix(giop): use Latin-1 charset to encode op name
2 parents f820b1c + 0c2c486 commit 13403cd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package org.apache.yoko.orb.OB;
1919

2020
import org.apache.yoko.io.Buffer;
21-
import org.apache.yoko.orb.CORBA.YokoOutputStream;
2221
import org.apache.yoko.orb.CORBA.OutputStreamHolder;
22+
import org.apache.yoko.orb.CORBA.YokoOutputStream;
2323
import org.apache.yoko.orb.IOP.ServiceContexts;
2424
import org.apache.yoko.orb.OBPortableServer.POAManager_impl;
2525
import org.apache.yoko.orb.OCI.Connector;
@@ -49,7 +49,6 @@
4949
import static java.util.logging.Level.FINE;
5050
import static java.util.logging.Level.FINEST;
5151
import static org.apache.yoko.logging.VerboseLogging.CONN_OUT_LOG;
52-
import static org.apache.yoko.orb.OB.CodeSetInfo.ISO_LATIN_1;
5352
import static org.apache.yoko.orb.OB.CodeSetUtil.getNegotiatedCodecs;
5453
import static org.apache.yoko.orb.OB.SendingContextRuntimes.SENDING_CONTEXT_RUNTIME;
5554
import static org.apache.yoko.orb.exceptions.Transients.ACTIVE_CONNECTION_MANAGEMENT;

yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPOutgoingMessage.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
import org.omg.IOP.ServiceContext;
3535
import org.omg.IOP.TaggedProfile;
3636
import org.omg.IOP.TaggedProfileHelper;
37+
import sun.nio.cs.ISO_8859_1;
38+
39+
import java.nio.charset.StandardCharsets;
40+
41+
import static java.nio.charset.StandardCharsets.ISO_8859_1;
3742

3843
public final class GIOPOutgoingMessage {
3944
private static int maxMessageSize_ = 0; // TODO: pick a default
@@ -171,7 +176,7 @@ void writeRequestHeader(int id, String op, boolean response, ServiceContexts con
171176
//
172177
int opLen = op.length();
173178
out_.write_ulong(opLen + 1);
174-
out_.write_octet_array(op.getBytes(), 0, opLen);
179+
out_.write_octet_array(op.getBytes(ISO_8859_1), 0, opLen);
175180
out_.write_octet((byte) 0); // nul terminator
176181

177182
out_.write_ulong(0); // requesting_principal
@@ -209,7 +214,7 @@ void writeRequestHeader(int id, String op, boolean response, ServiceContexts con
209214
//
210215
int opLen = op.length();
211216
out_.write_ulong(opLen + 1);
212-
out_.write_octet_array(op.getBytes(), 0, opLen);
217+
out_.write_octet_array(op.getBytes(ISO_8859_1), 0, opLen);
213218
out_.write_octet((byte) 0); // nul terminator
214219

215220
writeServiceContextList(contexts); // service_context

0 commit comments

Comments
 (0)