Author: dumindu
Date: Tue Dec  4 05:54:33 2007
New Revision: 10487

Log:

Code cleanup.

Modified:
   
trunk/solutions/identity/modules/mod-cspace/build/win32/vc/apache2/mod_cspace/mod_cspace.vcproj
   trunk/solutions/identity/modules/mod-cspace/cspace_utils.c
   trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
   trunk/solutions/identity/modules/mod-cspace/process_request.c
   trunk/solutions/identity/modules/mod-cspace/process_request.h
   trunk/solutions/identity/modules/mod-cspace/process_request_defines.h

Modified: 
trunk/solutions/identity/modules/mod-cspace/build/win32/vc/apache2/mod_cspace/mod_cspace.vcproj
==============================================================================
--- 
trunk/solutions/identity/modules/mod-cspace/build/win32/vc/apache2/mod_cspace/mod_cspace.vcproj
     (original)
+++ 
trunk/solutions/identity/modules/mod-cspace/build/win32/vc/apache2/mod_cspace/mod_cspace.vcproj
     Tue Dec  4 05:54:33 2007
@@ -42,14 +42,14 @@
                                AdditionalOptions="/D 
"APU_DECLARE_EXPORT""
                                Optimization="0"
                                
AdditionalIncludeDirectories=""E:\packages\libxml2-2.6.30.win32\include";"E:\packages\libxmlsec-1.2.10.win32\include";"E:\packages\libxslt-1.1.22.win32\include";"C:\Program
 Files\Apache Software 
Foundation\Apache2.2\include";"E:\packages\iconv-1.9.2.win32\include""
-                               
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_CSPACE_EXPORTS;XMLSEC_CRYPTO_DYNAMIC_LOADING;XMLSEC_CRYPTO=\"openssl\""
+                               
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_CSPACE_EXPORTS;XMLSEC_CRYPTO_DYNAMIC_LOADING;XMLSEC_CRYPTO=\"openssl\";CSPACE_DEBUG"
                                MinimalRebuild="true"
-                               BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                UsePrecompiledHeader="0"
-                               WarningLevel="3"
+                               WarningLevel="4"
                                Detect64BitPortabilityProblems="true"
                                DebugInformationFormat="4"
+                               CompileAs="1"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
@@ -92,6 +92,7 @@
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
+                               CommandLine=""
                        />
                </Configuration>
                <Configuration
@@ -120,11 +121,12 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                
AdditionalIncludeDirectories="D:\apache2\include;&quot;E:\packages\libxml2-2.6.30.win32\include&quot;;&quot;E:\packages\libxmlsec-1.2.10.win32\include&quot;;&quot;E:\packages\libxslt-1.1.22.win32\include&quot;"
-                               
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_CSPACE_EXPORTS;XMLSEC_CRYPTO_DYNAMIC_LOADING"
+                               
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_CSPACE_EXPORTS;XMLSEC_CRYPTO_DYNAMIC_LOADING;XMLSEC_CRYPTO=\&quot;openssl\&quot;"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               Detect64BitPortabilityProblems="true"
+                               WarningLevel="0"
+                               Detect64BitPortabilityProblems="false"
+                               CompileAs="1"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"

Modified: trunk/solutions/identity/modules/mod-cspace/cspace_utils.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/cspace_utils.c  (original)
+++ trunk/solutions/identity/modules/mod-cspace/cspace_utils.c  Tue Dec  4 
05:54:33 2007
@@ -45,8 +45,8 @@
         if (*s == '+') { /*this should come first:
                            we don't want to mess with the url encoded '+'s */
             *d = ' ';
-        } else if ((*s == '%') && (isxdigit(*(s+1))) && (isxdigit(*(s+2)))) {
-            *d = ((hex2dec(*(s+1))) * 16) + hex2dec(*(s+2));
+        } else if ((*s == '%') && (isxdigit(*(s + 1))) && (isxdigit(*(s + 
2)))) {
+            *d = (char)(((hex2dec(*(s + 1))) * 16) + hex2dec(*(s + 2)));
             s += 2;
         } else {
             *d = *s;

Modified: trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/mod_cspace.c    (original)
+++ trunk/solutions/identity/modules/mod-cspace/mod_cspace.c    Tue Dec  4 
05:54:33 2007
@@ -389,7 +389,7 @@
     cspace_process_context_set_header_callback_context(ctx, (void *)(r->pool));
 
     /*MAGIC: 9 == strlen("xmlToken=")*/
-    state = cspace_process_request(ctx, buf + 9, NULL, NULL);
+    state = cspace_process_request(ctx, buf + 9);
 
     /* should not be necessary...
      * when only only pool allocators are used*/
@@ -567,7 +567,8 @@
         }
     }
     
-    return UNAUTHORIZED_REDIRECT(r, NULL);
+       /* unreachable code*/
+    /* return UNAUTHORIZED_REDIRECT(r, NULL); */
 }
 
 static int cspace_post_config(apr_pool_t *pconf, apr_pool_t *plog,

Modified: trunk/solutions/identity/modules/mod-cspace/process_request.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request.c       
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request.c       Tue Dec 
 4 05:54:33 2007
@@ -76,14 +76,13 @@
 static int extract_info(process_context_t *ctx, xmlDoc *doc);
 
 /*TODO: remove the last two params*/
-int cspace_process_request(process_context_t *ctx, const char *req,
-                           void *ret_hash, set_header_cb_t cb)
+int cspace_process_request(process_context_t *ctx, const char *req)
 {
     int res = FAIL;
     xmlDoc *doc = NULL;
     
     /* Load XML document */
-    doc = xmlReadMemory(req, strlen(req), NULL, NULL, 0);
+    doc = xmlReadMemory(req, (int)strlen(req), NULL, NULL, 0);
     
     if (!decrypt_token(doc, ctx)) {
         /*log*/
@@ -501,7 +500,7 @@
     if (!ctx->key_file)
         return FAIL;
     
-    strcpy(ctx->key_file, key_file);
+    cspace_strcpy(ctx->key_file, key_file);
     return SUCC;
 }
 

Modified: trunk/solutions/identity/modules/mod-cspace/process_request.h
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request.h       
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request.h       Tue Dec 
 4 05:54:33 2007
@@ -46,8 +46,7 @@
 void cspace_process_context_set_header_callback_context(process_context_t *ctx,
                                                 void *cb_ctx);
 
-int cspace_process_request(process_context_t *ctx, const char *req,
-                           void *ret_hash, set_header_cb_t cb);
+int cspace_process_request(process_context_t *ctx, const char *req);
 
 
 

Modified: trunk/solutions/identity/modules/mod-cspace/process_request_defines.h
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request_defines.h       
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request_defines.h       
Tue Dec  4 05:54:33 2007
@@ -98,7 +98,7 @@
 static char* cspace_strcpy(char *to, const char *from)
 {
     char *tmp = to;
-    while ((*to = *from) != (char)NULL) {
+       while ((*to = *from) != '\0') {
         ++from;
         ++to;
     }

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to