Changeset e2906f
- Timestamp:
- 04/03/10 20:25:09 (2 years ago)
- Branches:
- master
- Children:
- 81d6e9
- Parents:
- ddc0ed
- git-author:
- Tomash Brechko <tomash.brechko@…> (04/03/10 19:28:34)
- git-committer:
- Tomash Brechko <tomash.brechko@…> (04/03/10 20:25:09)
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Changes
rddc0ed re2906f 6 6 7 7 Changes since 0.17: 8 9 Fix RT#56142: handle Perl magic. 8 10 9 11 Fix SIGPIPE handling, make it thread-safe. Now we use -
Fast.xs
r50ab04 re2906f 1 1 /* 2 Copyright (C) 2007-20 09Tomash Brechko. All rights reserved.2 Copyright (C) 2007-2010 Tomash Brechko. All rights reserved. 3 3 4 4 This library is free software; you can redistribute it and/or modify … … 99 99 100 100 addr_sv = hv_fetch(hv, "address", 7, 0); 101 if (! addr_sv) 101 if (addr_sv) 102 SvGETMAGIC(*addr_sv); 103 else 102 104 croak("server should have { address => $addr }"); 103 105 ps = hv_fetch(hv, "weight", 6, 0); 106 if (ps) 107 SvGETMAGIC(*ps); 104 108 if (ps && SvOK(*ps)) 105 109 weight = SvNV(*ps); 106 110 ps = hv_fetch(hv, "noreply", 7, 0); 111 if (ps) 112 SvGETMAGIC(*ps); 107 113 if (ps && SvOK(*ps)) 108 114 noreply = SvTRUE(*ps); … … 118 124 119 125 addr_sv = av_fetch(av, 0, 0); 120 if (! addr_sv) 126 if (addr_sv) 127 SvGETMAGIC(*addr_sv); 128 else 121 129 croak("server should be [$addr, $weight]"); 122 130 weight_sv = av_fetch(av, 1, 0); … … 146 154 147 155 ps = hv_fetch(conf, "utf8", 4, 0); 156 if (ps) 157 SvGETMAGIC(*ps); 148 158 if (ps && SvOK(*ps)) 149 159 memd->utf8 = SvTRUE(*ps); 150 160 151 161 ps = hv_fetch(conf, "serialize_methods", 17, 0); 162 if (ps) 163 SvGETMAGIC(*ps); 152 164 if (ps && SvOK(*ps)) 153 165 { … … 177 189 178 190 ps = hv_fetch(conf, "compress_threshold", 18, 0); 191 if (ps) 192 SvGETMAGIC(*ps); 179 193 if (ps && SvOK(*ps)) 180 194 memd->compress_threshold = SvIV(*ps); 181 195 182 196 ps = hv_fetch(conf, "compress_ratio", 14, 0); 197 if (ps) 198 SvGETMAGIC(*ps); 183 199 if (ps && SvOK(*ps)) 184 200 memd->compress_ratio = SvNV(*ps); 185 201 186 202 ps = hv_fetch(conf, "compress_methods", 16, 0); 203 if (ps) 204 SvGETMAGIC(*ps); 187 205 if (ps && SvOK(*ps)) 188 206 { … … 209 227 210 228 ps = hv_fetch(conf, "ketama_points", 13, 0); 229 if (ps) 230 SvGETMAGIC(*ps); 211 231 if (ps && SvOK(*ps)) 212 232 { … … 217 237 218 238 ps = hv_fetch(conf, "hash_namespace", 14, 0); 239 if (ps) 240 SvGETMAGIC(*ps); 219 241 if (ps && SvOK(*ps)) 220 242 client_set_hash_namespace(c, SvTRUE(*ps)); 221 243 222 244 ps = hv_fetch(conf, "servers", 7, 0); 245 if (ps) 246 SvGETMAGIC(*ps); 223 247 if (ps && SvOK(*ps)) 224 248 { … … 236 260 continue; 237 261 262 SvGETMAGIC(*ps); 238 263 parse_server(memd, *ps); 239 264 } … … 241 266 242 267 ps = hv_fetch(conf, "namespace", 9, 0); 268 if (ps) 269 SvGETMAGIC(*ps); 243 270 if (ps && SvOK(*ps)) 244 271 { … … 251 278 252 279 ps = hv_fetch(conf, "connect_timeout", 15, 0); 280 if (ps) 281 SvGETMAGIC(*ps); 253 282 if (ps && SvOK(*ps)) 254 283 client_set_connect_timeout(c, SvNV(*ps) * 1000.0); 255 284 256 285 ps = hv_fetch(conf, "io_timeout", 10, 0); 286 if (ps) 287 SvGETMAGIC(*ps); 257 288 if (ps && SvOK(*ps)) 258 289 client_set_io_timeout(c, SvNV(*ps) * 1000.0); … … 260 291 /* For compatibility with Cache::Memcached. */ 261 292 ps = hv_fetch(conf, "select_timeout", 14, 0); 293 if (ps) 294 SvGETMAGIC(*ps); 262 295 if (ps && SvOK(*ps)) 263 296 client_set_io_timeout(c, SvNV(*ps) * 1000.0); 264 297 265 298 ps = hv_fetch(conf, "max_failures", 12, 0); 299 if (ps) 300 SvGETMAGIC(*ps); 266 301 if (ps && SvOK(*ps)) 267 302 client_set_max_failures(c, SvIV(*ps)); 268 303 269 304 ps = hv_fetch(conf, "failure_timeout", 15, 0); 305 if (ps) 306 SvGETMAGIC(*ps); 270 307 if (ps && SvOK(*ps)) 271 308 client_set_failure_timeout(c, SvIV(*ps)); 272 309 273 310 ps = hv_fetch(conf, "close_on_error", 14, 0); 311 if (ps) 312 SvGETMAGIC(*ps); 274 313 if (ps && SvOK(*ps)) 275 314 client_set_close_on_error(c, SvTRUE(*ps)); 276 315 277 316 ps = hv_fetch(conf, "nowait", 6, 0); 317 if (ps) 318 SvGETMAGIC(*ps); 278 319 if (ps && SvOK(*ps)) 279 320 client_set_nowait(c, SvTRUE(*ps)); 280 321 281 322 ps = hv_fetch(conf, "max_size", 8, 0); 323 if (ps) 324 SvGETMAGIC(*ps); 282 325 if (ps && SvOK(*ps)) 283 326 memd->max_size = SvUV(*ps); … … 690 733 /* exptime doesn't have to be defined. */ 691 734 sv = ST(arg); 735 SvGETMAGIC(sv); 692 736 if (SvOK(sv)) 693 737 exptime = SvIV(sv); … … 778 822 /* exptime doesn't have to be defined. */ 779 823 SV **ps = av_fetch(av, arg, 0); 824 if (ps) 825 SvGETMAGIC(*ps); 780 826 if (ps && SvOK(*ps)) 781 827 exptime = SvIV(*ps); … … 925 971 /* increment doesn't have to be defined. */ 926 972 SV *sv = ST(2); 973 SvGETMAGIC(sv); 927 974 if (SvOK(sv)) 928 975 arg = SvUV(sv); … … 984 1031 /* increment doesn't have to be defined. */ 985 1032 SV **ps = av_fetch(av, 1, 0); 1033 if (ps) 1034 SvGETMAGIC(*ps); 986 1035 if (ps && SvOK(*ps)) 987 1036 arg = SvUV(*ps); … … 1056 1105 /* delay doesn't have to be defined. */ 1057 1106 SV *sv = ST(2); 1107 SvGETMAGIC(sv); 1058 1108 if (SvOK(sv) && SvUV(sv) != 0) 1059 1109 warn("non-zero delete expiration time is ignored"); … … 1115 1165 /* delay doesn't have to be defined. */ 1116 1166 SV **ps = av_fetch(av, 1, 0); 1167 if (ps) 1168 SvGETMAGIC(*ps); 1117 1169 if (ps && SvOK(*ps) && SvUV(*ps) != 0) 1118 1170 warn("non-zero delete expiration time is ignored"); … … 1179 1231 sv_2mortal((SV *) RETVAL); 1180 1232 object.arg = sv_2mortal((SV *) newAV()); 1181 if (items > 1 && SvOK(ST(1))) 1182 delay = SvUV(ST(1)); 1233 if (items > 1) 1234 { 1235 SV *sv = ST(1); 1236 SvGETMAGIC(sv); 1237 if (SvOK(sv)) 1238 delay = SvUV(sv); 1239 } 1183 1240 noreply = (GIMME_V == G_VOID); 1184 1241 client_flush_all(memd->c, delay, &object, noreply); -
MANIFEST
r50ab04 re2906f 16 16 t/commands.t 17 17 t/key_ref.t 18 t/magic.t 18 19 t/namespace.t 19 20 t/nowait.t
Note: See TracChangeset
for help on using the changeset viewer.
