summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-02-20 22:36:11 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-02-20 22:36:11 +0000
commit0bc1e3f3a53fe61bda96d94572e5c460f57ddf7e (patch)
tree1710e3fcbe2eafb1a4721436eb04a3fc971a6b4d /TAO/tao/GIOP_Message_Generator_Parser_10.cpp
parent6da8a25823b769c42e7a16cfe76018c8cd759515 (diff)
downloadATCD-0bc1e3f3a53fe61bda96d94572e5c460f57ddf7e.tar.gz
ChangeLogTag: Thu Feb 20 17:14:46 2004 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/tao/GIOP_Message_Generator_Parser_10.cpp')
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser_10.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
index 414f38da0c9..074713c0799 100644
--- a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
+++ b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
@@ -72,12 +72,40 @@ TAO_GIOP_Message_Generator_Parser_10::write_request_header (
// this message, then patched shortly before it's sent).
/***** This has been deprecated in the 2.4 spec ******/
- //static CORBA::Principal_ptr principal = 0;
- //msg << principal;
- // This is now introduced in 2.4 spec
+#if defined (TAO_PEER_REQUIRES_PRINCIPAL)
+
+ char username[BUFSIZ];
+ char *result =
+ ACE_OS::cuserid (username,
+ BUFSIZ);
+
+ if (result != 0)
+ {
+ CORBA::ULong username_size =
+ ACE_static_cast (CORBA::ULong,
+ ACE_OS::strlen (username));
+
+ CORBA::Octet *buffer =
+ CORBA::OctetSeq::allocbuf (username_size + 1);
+
+ ACE_OS::memcpy (buffer,
+ username,
+ username_size + 1);
+
+ req_principal.replace (username_size + 1,
+ username_size + 1,
+ buffer,
+ 1);
+ }
+
+#else
+
CORBA::OctetSeq req_principal (0);
req_principal.length (0);
+
+#endif /* TAO_PEER_REQUIRES_PRINCIPAL */
+
msg << req_principal;
return 1;