hyanantha               Thu Oct 24 05:58:28 2002 EDT

  Modified files:              (Branch: PHP_4_2_0)
    /php4/ext/session   session.c 
  Log:
  NetWare related changes/modifications.
  
  
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.292.2.3 php4/ext/session/session.c:1.292.2.4
--- php4/ext/session/session.c:1.292.2.3        Fri Aug 23 05:14:42 2002
+++ php4/ext/session/session.c  Thu Oct 24 05:58:28 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.292.2.3 2002/08/23 09:14:42 zeev Exp $ */
+/* $Id: session.c,v 1.292.2.4 2002/10/24 09:58:28 hyanantha Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -509,7 +509,8 @@
        PHP_MD5Init(&context);
        
        sprintf(buf, "%ld%ld%0.8f", tv.tv_sec, tv.tv_usec, php_combined_lcg(TSRMLS_C) 
* 10);
-       PHP_MD5Update(&context, buf, strlen(buf));
+       /*PHP_MD5Update(&context, buf, strlen(buf));*/
+       PHP_MD5Update(&context, (const unsigned char*)buf, strlen(buf));
 
        if (PS(entropy_length) > 0) {
                int fd;
@@ -523,7 +524,8 @@
                        while (to_read > 0) {
                                n = read(fd, buf, MIN(to_read, sizeof(buf)));
                                if (n <= 0) break;
-                               PHP_MD5Update(&context, buf, n);
+                               /*PHP_MD5Update(&context, buf, n);*/
+                               PHP_MD5Update(&context, (const unsigned char*)buf, n);
                                to_read -= n;
                        }
                        close(fd);
@@ -635,7 +637,11 @@
 static void last_modified(TSRMLS_D)
 {
        const char *path;
+#if (defined(NETWARE) && defined(CLIB_STAT_PATCH))
+    struct stat_libc sb;
+#else
        struct stat sb;
+#endif
        char buf[MAX_STR + 1];
        
        path = SG(request_info).path_translated;
@@ -646,7 +652,11 @@
 
 #define LAST_MODIFIED "Last-Modified: "
                memcpy(buf, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1);
-               strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime);
+#if (defined(NETWARE) && defined(NEW_LIBC))
+               strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &(sb.st_mtime.tv_nsec));
+#else
+        strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime);
+#endif
                ADD_COOKIE(buf);
        }
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to