@@ -228,7 +228,6 @@ zend_bool s_memc_valid_key_ascii(zend_string *key)
228
228
}
229
229
230
230
#ifdef HAVE_MEMCACHED_PROTOCOL
231
-
232
231
typedef struct {
233
232
php_memc_proto_handler_t * handler ;
234
233
zend_object zo ;
@@ -1235,34 +1234,25 @@ static PHP_METHOD(Memcached, __construct)
1235
1234
memcached_set_user_data (intern -> memc , memc_user_data );
1236
1235
1237
1236
/* Set default behaviors */
1238
- {
1239
- #ifdef mikko_0
1240
- fprintf (stderr , "consistent_hash_enabled=%d binary_protocol_enabled=%d connect_timeout=%ld\n" ,
1241
- MEMC_G (default_behavior .consistent_hash_enabled ), MEMC_G (default_behavior .binary_protocol_enabled ), MEMC_G (default_behavior .connect_timeout ));
1242
- #endif
1243
-
1244
- memcached_return rc ;
1237
+ if (MEMC_G (default_behavior .consistent_hash_enabled )) {
1245
1238
1246
- if (MEMC_G (default_behavior .consistent_hash_enabled )) {
1247
-
1248
- rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_DISTRIBUTION , MEMCACHED_DISTRIBUTION_CONSISTENT );
1249
- if (rc != MEMCACHED_SUCCESS ) {
1250
- php_error_docref (NULL , E_WARNING , "Failed to turn on consistent hash: %s" , memcached_strerror (intern -> memc , rc ));
1251
- }
1239
+ memcached_return rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_DISTRIBUTION , MEMCACHED_DISTRIBUTION_CONSISTENT );
1240
+ if (rc != MEMCACHED_SUCCESS ) {
1241
+ php_error_docref (NULL , E_WARNING , "Failed to turn on consistent hash: %s" , memcached_strerror (intern -> memc , rc ));
1252
1242
}
1243
+ }
1253
1244
1254
- if (MEMC_G (default_behavior .binary_protocol_enabled )) {
1255
- rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_BINARY_PROTOCOL , 1 );
1256
- if (rc != MEMCACHED_SUCCESS ) {
1257
- php_error_docref (NULL , E_WARNING , "Failed to turn on binary protocol: %s" , memcached_strerror (intern -> memc , rc ));
1258
- }
1245
+ if (MEMC_G (default_behavior .binary_protocol_enabled )) {
1246
+ memcached_return rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_BINARY_PROTOCOL , 1 );
1247
+ if (rc != MEMCACHED_SUCCESS ) {
1248
+ php_error_docref (NULL , E_WARNING , "Failed to turn on binary protocol: %s" , memcached_strerror (intern -> memc , rc ));
1259
1249
}
1250
+ }
1260
1251
1261
- if (MEMC_G (default_behavior .connect_timeout )) {
1262
- rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT , MEMC_G (default_behavior .connect_timeout ));
1263
- if (rc != MEMCACHED_SUCCESS ) {
1264
- php_error_docref (NULL , E_WARNING , "Failed to set connect timeout: %s" , memcached_strerror (intern -> memc , rc ));
1265
- }
1252
+ if (MEMC_G (default_behavior .connect_timeout )) {
1253
+ memcached_return rc = memcached_behavior_set (intern -> memc , MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT , MEMC_G (default_behavior .connect_timeout ));
1254
+ if (rc != MEMCACHED_SUCCESS ) {
1255
+ php_error_docref (NULL , E_WARNING , "Failed to set connect timeout: %s" , memcached_strerror (intern -> memc , rc ));
1266
1256
}
1267
1257
}
1268
1258
0 commit comments