@@ -1173,7 +1173,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
11731173 return ctx .sdl ;
11741174}
11751175
1176- #define WSDL_CACHE_VERSION 0x0f
1176+ #define WSDL_CACHE_VERSION 0x10
11771177
11781178#define WSDL_CACHE_GET (ret ,type ,buf ) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type);
11791179#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;
@@ -1188,13 +1188,15 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
11881188#define WSDL_CACHE_PUT_1 (val ,buf ) smart_str_appendc(buf,val);
11891189#define WSDL_CACHE_PUT_N (val ,n ,buf ) smart_str_appendl(buf,(char*)val,n);
11901190
1191+ #define WSDL_NO_STRING_MARKER 0x7fffffff
1192+
11911193static char * sdl_deserialize_string (char * * in )
11921194{
11931195 char * s ;
11941196 int len ;
11951197
11961198 WSDL_CACHE_GET_INT (len , in );
1197- if (len == 0x7fffffff ) {
1199+ if (len == WSDL_NO_STRING_MARKER ) {
11981200 return NULL ;
11991201 } else {
12001202 s = emalloc (len + 1 );
@@ -1209,7 +1211,7 @@ static void sdl_deserialize_key(HashTable* ht, void* data, char **in)
12091211 int len ;
12101212
12111213 WSDL_CACHE_GET_INT (len , in );
1212- if (len == 0 ) {
1214+ if (len == WSDL_NO_STRING_MARKER ) {
12131215 zend_hash_next_index_insert_ptr (ht , data );
12141216 } else {
12151217 zend_hash_str_add_ptr (ht , * in , len , data );
@@ -1777,16 +1779,14 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time
17771779
17781780static void sdl_serialize_string (const char * str , smart_str * out )
17791781{
1780- int i ;
1781-
17821782 if (str ) {
1783- i = strlen (str );
1783+ int i = strlen (str );
17841784 WSDL_CACHE_PUT_INT (i , out );
17851785 if (i > 0 ) {
17861786 WSDL_CACHE_PUT_N (str , i , out );
17871787 }
17881788 } else {
1789- WSDL_CACHE_PUT_INT (0x7fffffff , out );
1789+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
17901790 }
17911791}
17921792
@@ -1797,7 +1797,7 @@ static void sdl_serialize_key(zend_string *key, smart_str *out)
17971797 WSDL_CACHE_PUT_INT (ZSTR_LEN (key ), out );
17981798 WSDL_CACHE_PUT_N (ZSTR_VAL (key ), ZSTR_LEN (key ), out );
17991799 } else {
1800- WSDL_CACHE_PUT_INT (0 , out );
1800+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
18011801 }
18021802}
18031803
0 commit comments