@@ -1173,7 +1173,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
1173
1173
return ctx .sdl ;
1174
1174
}
1175
1175
1176
- #define WSDL_CACHE_VERSION 0x0f
1176
+ #define WSDL_CACHE_VERSION 0x10
1177
1177
1178
1178
#define WSDL_CACHE_GET (ret ,type ,buf ) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type);
1179
1179
#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)
1188
1188
#define WSDL_CACHE_PUT_1 (val ,buf ) smart_str_appendc(buf,val);
1189
1189
#define WSDL_CACHE_PUT_N (val ,n ,buf ) smart_str_appendl(buf,(char*)val,n);
1190
1190
1191
+ #define WSDL_NO_STRING_MARKER 0x7fffffff
1192
+
1191
1193
static char * sdl_deserialize_string (char * * in )
1192
1194
{
1193
1195
char * s ;
1194
1196
int len ;
1195
1197
1196
1198
WSDL_CACHE_GET_INT (len , in );
1197
- if (len == 0x7fffffff ) {
1199
+ if (len == WSDL_NO_STRING_MARKER ) {
1198
1200
return NULL ;
1199
1201
} else {
1200
1202
s = emalloc (len + 1 );
@@ -1209,7 +1211,7 @@ static void sdl_deserialize_key(HashTable* ht, void* data, char **in)
1209
1211
int len ;
1210
1212
1211
1213
WSDL_CACHE_GET_INT (len , in );
1212
- if (len == 0 ) {
1214
+ if (len == WSDL_NO_STRING_MARKER ) {
1213
1215
zend_hash_next_index_insert_ptr (ht , data );
1214
1216
} else {
1215
1217
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
1777
1779
1778
1780
static void sdl_serialize_string (const char * str , smart_str * out )
1779
1781
{
1780
- int i ;
1781
-
1782
1782
if (str ) {
1783
- i = strlen (str );
1783
+ int i = strlen (str );
1784
1784
WSDL_CACHE_PUT_INT (i , out );
1785
1785
if (i > 0 ) {
1786
1786
WSDL_CACHE_PUT_N (str , i , out );
1787
1787
}
1788
1788
} else {
1789
- WSDL_CACHE_PUT_INT (0x7fffffff , out );
1789
+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
1790
1790
}
1791
1791
}
1792
1792
@@ -1797,7 +1797,7 @@ static void sdl_serialize_key(zend_string *key, smart_str *out)
1797
1797
WSDL_CACHE_PUT_INT (ZSTR_LEN (key ), out );
1798
1798
WSDL_CACHE_PUT_N (ZSTR_VAL (key ), ZSTR_LEN (key ), out );
1799
1799
} else {
1800
- WSDL_CACHE_PUT_INT (0 , out );
1800
+ WSDL_CACHE_PUT_INT (WSDL_NO_STRING_MARKER , out );
1801
1801
}
1802
1802
}
1803
1803
0 commit comments