fix bugID 24.. Use stringstream instead of strstream
authorwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 9 Oct 2002 02:53:23 +0000 (02:53 +0000)
committerwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 9 Oct 2002 02:53:23 +0000 (02:53 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@146 cb58f699-b61c-0410-a6fe-9272a202ed29

mod_shibrm/mod_shibrm.cpp
mod_shire/mod_shire.cpp
shib-target/shib-ccache.cpp
shib-target/shib-ini.cpp
shib-target/shib-mlp.cpp
shib-target/shib-rm.cpp
shib-target/shib-rpcerror.cpp
shib-target/shibrpc-server.cpp

index e2def92..fed688b 100644 (file)
@@ -22,7 +22,7 @@
 #include <shib-target/shib-target.h>
 
 #include <fstream>
-#include <strstream>
+#include <sstream>
 #include <stdexcept>
 
 using namespace std;
@@ -292,9 +292,9 @@ static const char* get_target(request_rec* r, const char* target)
 
 extern "C" int shibrm_check_auth(request_rec* r)
 {
-    ostrstream threadid;
+    ostringstream threadid;
     threadid << "[" << getpid() << "] shibrm" << '\0';
-    saml::NDC ndc(threadid.str());
+    saml::NDC ndc(threadid.str().c_str());
 
     ShibINI& ini = g_szConfig->getINI();
     const char* serverName = get_service_name (r);
index c56fb4e..4ceb26b 100644 (file)
@@ -25,7 +25,7 @@
 #include <shib-target/shib-target.h>
 
 #include <fstream>
-#include <strstream>
+#include <sstream>
 #include <stdexcept>
 
 using namespace std;
@@ -329,9 +329,9 @@ static int shire_error_page(request_rec* r, const char* filename, ShibMLP& mlp)
 
 extern "C" int shire_check_user(request_rec* r)
 {
-    ostrstream threadid;
+    ostringstream threadid;
     threadid << "[" << getpid() << "] shire" << '\0';
-    saml::NDC ndc(threadid.str());
+    saml::NDC ndc(threadid.str().c_str());
 
     ShibINI& ini = g_szConfig->getINI();
     ShibMLP markupProcessor;
@@ -484,9 +484,9 @@ extern "C" int shire_check_user(request_rec* r)
 
 extern "C" int shire_post_handler (request_rec* r)
 {
-  ostrstream threadid;
+  ostringstream threadid;
   threadid << "[" << getpid() << "] shire" << '\0';
-  saml::NDC ndc(threadid.str());
+  saml::NDC ndc(threadid.str().c_str());
 
   ShibINI& ini = g_szConfig->getINI();
   ShibMLP markupProcessor;
index d1fd0aa..264ac26 100644 (file)
@@ -63,7 +63,7 @@
 
 #include <log4cpp/Category.hh>
 
-#include <strstream>
+#include <sstream>
 #include <stdexcept>
 
 using namespace std;
index 65c5c02..4c862b1 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "shib-target.h"
-#include <strstream>
+#include <sstream>
 #include <iostream>
 #include <fstream>
 #include <ctype.h>
index 36482fa..5edc46d 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "shib-target.h"
-#include <strstream>
+#include <sstream>
 #include <ctype.h>
 #include <xercesc/util/XercesDefs.hpp>
 
index 21485b7..6f59173 100644 (file)
@@ -13,7 +13,7 @@
 #include <xercesc/util/Base64.hpp>
 #include <log4cpp/Category.hh>
 
-#include <strstream>
+#include <sstream>
 #include <stdexcept>
 
 using namespace std;
@@ -111,7 +111,7 @@ RPCError* RM::getAssertions(const char* cookie, const char* ip,
     retval = new RPCError(ret.status, ret.error_msg);
   else {
     for (u_int i = 0; i < ret.assertions.assertions_len; i++) {
-      istrstream attrstream(ret.assertions.assertions_val[i].assertion);
+      istringstream attrstream(ret.assertions.assertions_val[i].assertion);
       SAMLAssertion *as = NULL;
       try {
        m_priv->log->debug("Trying to decode assertion %d: %s", i,
@@ -143,11 +143,12 @@ void RM::serialize(SAMLAssertion &assertion, string &result)
 {
   saml::NDC ndc("RM::serialize");
 
-  ostrstream os;
+  ostringstream os;
   os << assertion;
   unsigned int outlen;
-  XMLByte* serialized = Base64::encode(reinterpret_cast<XMLByte*>(os.str()),
-                                      os.pcount(), &outlen);
+  char* assn = (char*) os.str().c_str();
+  XMLByte* serialized = Base64::encode(reinterpret_cast<XMLByte*>(assn),
+                                      os.str().length(), &outlen);
   result = (char*) serialized;
 }
 
index fa2de7d..39e5c18 100644 (file)
@@ -11,7 +11,7 @@
 #include "shib-target.h"
 
 #include <stdexcept>
-#include <strstream>
+#include <sstream>
 
 #include <log4cpp/Category.hh>
 
@@ -27,7 +27,7 @@ void RPCError::init(int stat, char const* msg)
   log4cpp::Category& log = log4cpp::Category::getInstance(ctx);
 
   if (status == SHIBRPC_SAML_EXCEPTION) {
-    istrstream estr(msg);
+    istringstream estr(msg);
     try { 
       m_except = NULL;
       m_except = new SAMLException(estr);
index 0137e93..a3a5afd 100644 (file)
@@ -12,7 +12,7 @@
 #include "shib-target.h"
 
 #include <log4cpp/Category.hh>
-#include <strstream>
+#include <sstream>
 
 using namespace std;
 using namespace saml;