@@ -1174,7 +1174,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
11741174 return ctx .sdl ;
11751175}
11761176
1177- #define WSDL_CACHE_VERSION 0x0f
1177+ #define WSDL_CACHE_VERSION 0x10
11781178
11791179#define WSDL_CACHE_GET (ret ,type ,buf ) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type);
11801180#define WSDL_CACHE_GET_INT (ret ,buf ) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4;
@@ -1189,13 +1189,15 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
11891189#define WSDL_CACHE_PUT_1 (val ,buf ) smart_str_appendc(buf,val);
11901190#define WSDL_CACHE_PUT_N (val ,n ,buf ) smart_str_appendl(buf,(char*)val,n);
11911191
1192+ #define WSDL_NO_STRING_MARKER 0x7fffffff
1193+
11921194static char * sdl_deserialize_string (char * * in )
11931195{
11941196 char * s ;
11951197 int len ;
11961198
11971199 WSDL_CACHE_GET_INT (len , in );
1198- if (len == 0x7fffffff ) {
1200+ if (len == WSDL_NO_STRING_MARKER ) {
11991201 return NULL ;
12001202 } else {
12011203 s = emalloc (len + 1 );
@@ -1210,7 +1212,7 @@ static void sdl_deserialize_key(HashTable* ht, void* data, char **in)
12101212 int len ;
12111213
12121214 WSDL_CACHE_GET_INT (len , in );
1213- if (len == 0 ) {
1215+ if (len == WSDL_NO_STRING_MARKER ) {
12141216 zend_hash_next_index_insert_ptr (ht , data );
12151217 } else {
12161218 zend_hash_str_add_ptr (ht , * in , len , data );
@@ -1778,16 +1780,14 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time
17781780
17791781static void sdl_serialize_string (const char * str , smart_str * out )
17801782{
1781- int i ;
1782-
17831783 if (str ) {
1784- i = strlen (str );
1784+ int i = strlen (str );
17851785 WSDL_CACHE_PUT_INT (i , out );
17861786 if (i > 0 ) {
17871787 WSDL_CACHE_PUT_N (str , i , out );
17881788 }
17891789 } else {
1790- WSDL_CACHE_PUT_INT (0x7fffffff , out );
1790+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
17911791 }
17921792}
17931793
@@ -1798,7 +1798,7 @@ static void sdl_serialize_key(zend_string *key, smart_str *out)
17981798 WSDL_CACHE_PUT_INT (ZSTR_LEN (key ), out );
17991799 WSDL_CACHE_PUT_N (ZSTR_VAL (key ), ZSTR_LEN (key ), out );
18001800 } else {
1801- WSDL_CACHE_PUT_INT (0 , out );
1801+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
18021802 }
18031803}
18041804
0 commit comments