#31 Request/Response body alignment incorrectly added to GIOP 1.

v1.3
open
nobody
IIOP Engine (4)
5
2007-01-11
2007-01-11
No

Hi,
I ran into an interoperability problem between Fnorb and Sun Java 1.5 and upwards.
Some debugging showed that as of Java 1.5, the following bug is fixed:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4775833

From this bug report:
<<
When a GIOP 1.2 Request header is built it adds padding
bytes to the output stream to align the Request Body on an 8 byte boundary as per "CORBA formal 00-11-07 15.4.2.2" which states in the first paragraph that:

"GIOP 1.2 body must be aligned on an 8 octet boundary."

This is incorrect when there is no Request Body (ie: for
methods with no parameters). "CORBA formal 00-11-07 section 15.4.2.1", last paragraph, states:

"There is no padding after the request header when an
unfragmented request message body is empty."

This also applies to Response headers/bodies.
>>

Fnorb happens to contain this same bug, and throws an exception when a correct message is offered.

Workaround to make it work for me are:
in GIOPClient.py, extra tests for the padding:
def __process_reply(self, request, (reply_header, cursor)):
""" Process a GIOP reply. """

# Align on the next 8-byte boundary for GIOP 1.2
if self.__giop_version.minor == 2 :
if len(request.outputs()) > 0 or reply_header.reply_status == GIOP.SYSTEM_EXCEPTION or reply_header.reply_status == GIOP.USER_EXCEPTION:
....

in GIOPServer.py, also see if more is coming:
def process_giop_message(self, message):
""" Process a GIOP message.
.....
# Align on the next 8-byte boundary for GIOP 1.2
if giop_header.GIOP_version.minor == 2 and giop_header.message_size + 12> cursor.offset() + 1 :
.....

regards,
Lieven

Discussion


Log in to post a comment.