[xdebug-dev] xdebug xdebug/xdebug.c - fix cookie name length

From: Shane Caraveo <shane[@]caraveo.com>
Date: Wed, 21 Apr 2004 20:30:29 +0200

Date: Wed Apr 21 20:30:28 CEST 2004
User: Shane Caraveo
Directory: xdebug

Log Message:
[0.1]
- fix cookie name length
- remove usage of XDEBUG_SESSION from environment
Modified files:
           xdebug/xdebug.c (version: 1.213)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -r1.212 -r1.213
--- xdebug/xdebug.c:1.212 Wed Apr 21 16:19:31 2004 GMT
+++ xdebug/xdebug.c Wed Apr 21 16:30:28 2004 GMT
@@ -845,19 +845,16 @@
                 ) {
                         convert_to_string_ex(dummy);
                         magic_cookie = xdstrdup(Z_STRVAL_PP(dummy));
- php_setcookie("XDEBUG_SESSION", 10, Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 } else if (
                         PG(http_globals)[TRACK_VARS_COOKIE] &&
                         zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), (void **) &dummy) == SUCCESS
                 ) {
                         convert_to_string_ex(dummy);
                         magic_cookie = xdstrdup(Z_STRVAL_PP(dummy));
- } else if (getenv("XDEBUG_SESSION")) {
- magic_cookie = xdstrdup(getenv("XDEBUG_SESSION"));
- php_setcookie("XDEBUG_SESSION", 10, magic_cookie, strlen(magic_cookie), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 } else if (getenv("XDEBUG_CONFIG")) {
                         magic_cookie = xdstrdup(getenv("XDEBUG_CONFIG"));
- php_setcookie("XDEBUG_SESSION", 10, magic_cookie, strlen(magic_cookie), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), magic_cookie, strlen(magic_cookie), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 }
                         
 
@@ -871,7 +868,7 @@
                                 zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS
                         )
                 ) {
- php_setcookie("XDEBUG_SESSION", 10, "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 }
 
                 /* Start remote context if requested */
Received on Wed Apr 21 2004 - 20:30:29 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST