ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/Changes
Revision: 1.224
Committed: Fri Mar 27 10:49:50 2009 UTC (15 years, 1 month ago) by root
Branch: MAIN
CVS Tags: rel-4_35
Changes since 1.223: +3 -3 lines
Log Message:
4.35

File Contents

# Content
1 Revision history for Perl extension AnyEvent.
2
3 4.35 Fri Mar 27 11:48:20 CET 2009
4 - event models relying on AnyEvent's signal watcher emulation did
5 invoke the callback asynchronously, contradicting documentation
6 and causing signals to get lost (this includes AnyEvent's own
7 event loop). AnyEvent now uses the standard pipe trick to make
8 callback execution synchronous to the event loop.
9 - AnyEvent::Handle didn't free TLS context data on DESTROY
10 (patch by Pavel Shaydo).
11 - work around the ever-incompatibly-changing API of MakeMaker.
12 - document that changing global variables without restoring them
13 is a bad idea in Perl (noted by Adam Rosenstein).
14 - AnyEvent::Strict now barfs if ->io is passed a file.
15
16 4.34 Thu Feb 12 18:32:45 CET 2009
17 - separately buffer TLS read data, as otherwise the read queue could
18 deadlock as receiving data is not expected while draining the
19 read queue (which cna only happen with TLS).
20 - raise EBADMSG error on JSON decoding errors.
21 - fix some minor manpage bugs (reported by Maximilian Gaß).
22 - speed up select bitmask parsing quite a bit in the pure perl
23 backend.
24 - use CORE::select instead of just select in AnyEvent::Impl::Perl.
25
26 4.331 Tue Jan 6 21:07:25 CET 2009
27 - socketpair fails on many vista machines because vista has
28 completely broken accept/getpeername and getsockname functions,
29 so we provide our own socketpair emulation that kind of works
30 (AnyEvent::Util::portable_pipe).
31 - new function: AnyEvent::Util::portable_socketpair.
32 - take advantage of the Guard module if it exists.
33
34 4.33 Fri Nov 21 02:35:40 CET 2008
35 - AnyEvent::Strict did errornously flag a fileno of 0 as
36 illegal.
37 - reduce memory usage and slightly speed up the pure perl backend
38 by only storing the file descriptor, not the file handle.
39 - add missing autocork method to AnyEvent::Handle (reported
40 by Adam Rosenstein).
41 - AnyEvent::DNS->resolve errornously documented an $rcode result
42 argument, but there isn't (spotted by Henrik Krohns).
43 - the naked truth about Tk - it's basically unmaintained.
44
45 4.32 Mon Nov 3 22:46:32 CET 2008
46 - fix AnyEvent::Socket::resolve_sockaddr to properly support
47 unix sockets again and choose a proper default for
48 the socket type.
49 - fix call to resolve_sockaddr in tcp_connect.
50
51 4.31 Thu Oct 30 04:41:48 CET 2008
52 - implemented AnyEvent::Handle->destroy method.
53 - hint about unexpected effects in TLS mode.
54 - speed up AnyEvent::Impl::Perl by using more arrays
55 instead of hashes without the slightest loss of readability :)
56 - work around a perl argument refcounting bug.
57 - with some perl patches applied, AnyEvent now seems leak-free.
58
59 4.3 Fri Oct 3 09:18:43 CEST 2008
60 - AnyEvent will now install a no-op signal handler for SIGPIPE,
61 unless one has been installed already.
62 - warn about not loaidng AnyEvent::Impl::POE early enough
63 (patch by Adam Rosenstein).
64 - fixed a great number of bugs and corner cases in AnyEvent::Handle:
65 - fix a bug in where in SSL connect mode, the
66 client would first wait for some data by the server and
67 otherwise hang. (reported and analyzed in an absolutely
68 exemplary manner by Adam Rosenstein).
69 - fix a bug in where SSL EOF would not be treated
70 as stream EOF, putting the connection into a hung state.
71 (reported and analyzed in an absolutely exemplary manner by Adam
72 Rosenstein).
73 - fix a potential segfault when the TLS context
74 would go missing in a read callback (e.g. due to stoptls) -
75 Net::SSLeay of course makes no type checking whatsoever.
76 - AnyEvent::Handle will not stop the read watcher in TLS mode.
77 - AnyEvent::Handle->stoptls will send a TLS close notify
78 instead of simply destroying the stream now.
79 - fix a bug where large blocks of data written in TLS mode
80 would not be sent unless triggered by receives.
81 - on_drain will now take the tls write buffer into account.
82 - SSL operations have been streamlined a bit and should be faster
83 now, more to come, though.
84 - added a FAQ section, will document nontrivial issues in there.
85
86 4.234 Mon Sep 29 04:08:13 CEST 2008
87 - fix child watcher documentation: only child exits will be reported,
88 no trace events.
89 - mention SIGPIPE in AnyEvent::Handle.
90 - perl backend will now use POSIX::times as monotonic clock
91 when available and the monotonic clock option is not.
92 - run even without Time::HiRes in some cases now, but do not
93 provide sub-second accuracy (all *supported* perl versions have
94 Time::HiRes).
95
96 4.233 Fri Aug 22 01:48:05 CEST 2008
97 - fix a bug in the testsuite, causing a hang.
98 - clarified lots of AnyEvent::Handle constructor arguments.
99
100 4.232 Thu Aug 21 20:44:25 CEST 2008
101 - fix a bug in AnyEvent::Handle that could cause two fatal error
102 callbacks on EOF, which caused AnyEvent::HTTP to signal success twice
103 (testcase by Leon Brocard).
104 - clarified on_eof/on_error documentation a bit.
105
106 4.231 Tue Jul 29 13:12:15 CEST 2008
107 - remove some debugging code left in AnyEvent::Util::fork_call
108 (and no, it's impossible to implement with the broken windows
109 perls without resource leaks or worse).
110
111 4.23 Tue Jul 29 12:19:59 CEST 2008
112 - document the first parameter passed to condvar callbacks to be
113 the callback.
114 - add AnyEvent::Socket::{ntoa,aton} aliases.
115 - optimize the AE::Handle->push_read (line) for the default
116 eol marker.
117 - optimize push_read (packstring|storable) for small packets.
118 - invoke on_error callback when no on_eof callback is set.
119 - fix a bug in push_read (storable) of unknown impact.
120
121 4.22 Sun Jul 20 16:34:13 CEST 2008
122 - new function AnyEvent::Socket::parse_hostport.
123 - as the bulkheads at microsoft can't even get getprotobyname reliably
124 working on their shitty fucking broken os we need to hardcode
125 some common protocol numbers in AnyEvent::Socket. How can
126 people even bother with such a pile of shit as windows.
127
128 4.21 Thu Jul 17 14:40:05 CEST 2008
129 - INCOMPATIBLE CHANGE: AnyEvent::Util::fork_call now has a prototype
130 which is incompatible to previous invocation syntax.
131 - work around more windows perl bugs in fork_call. I cannot imagine
132 why anybody would bother implementing fork in such an obviously
133 unusable way.
134 - avoid calling $do_retry if the request has already finished in
135 AnyEvent::DNS, thus avoiding an exception (reported by Anatoly
136 K. Sharifulin).
137
138 4.2 Sat Jul 12 22:42:11 CEST 2008
139 - support an "interval" argument for repeating timers.
140 - fix a bug in the pure perl event loop that caused timers to
141 be delayed under some circumstances.
142 - implement optional argument checking via PERL_ANYEVENT_STRICT.
143 - not importing anything from Event causes it to malfunction
144 and not use Time::HiRes, work around this bug.
145 - more bug workarounds against the endlessly broken Tk module,
146 seems to work now on 32 bit machines, but less so on 64 bit.
147 - minor optimisations applied to most backends.
148
149 4.161 Fri Jul 4 14:24:48 CEST 2008
150 - fixed the t/handle/02_write.t, it read after write, with the
151 assumption that all data could be written before read
152 (reported by Jim Razmus).
153
154 4.160 Thu Jul 3 04:02:21 CEST 2008
155 - re-registering signal watchers after unregistering one did
156 not work if a backend falls back on AnyEvent's default
157 implementation (also affected child watchers).
158 - new AnyEvent::Handle options: autocork and no_delay.
159
160 4.152 Sun Jun 22 14:15:44 CEST 2008
161 - allow for 32-bit perls that implement shifts differently
162 on different architectures in parse_ipv4 (reported and
163 analysed by Keiichi DAIBA).
164
165 4.151 Fri Jun 6 17:34:24 CEST 2008
166 - make sure specifying _only_ on_read and never pushing reads
167 works.
168
169 4.15 Fri Jun 6 13:00:46 CEST 2008
170 - the pure perl backend would keep some watchers alive when more than
171 one watcher was registered for the same fd.
172 - new "packstring" and "storable" read and write types
173 for AnyEvent::Handle.
174 - allow on_eof handler to be called after on_error with EPIPE returns.
175 - do not immediately call on_read callback in handle constructor.
176
177 4.14 Thu Jun 5 20:29:31 CEST 2008
178 - Fixed a bug in DNS SRV priority sorting.
179 - AnyEvent::Util::guard now reports runtime errors while
180 executing the guard block as warnings.
181 - handle 0-byte-reads just before EOF correctly in AnyEvent::Handle.
182
183 4.13 Thu Jun 5 00:47:59 CEST 2008
184 - AnyEvent::DNS only followed cname chains with length 2,
185 contrary to documentation. bumped it up to 10, thanks to
186 microsoft, the current broken-dns-config-king.
187 - AnyEvent::DNS didn't check for socket return status
188 but instead relied on perl not creating filehandles in that
189 case - too bad it gives you a bogus file handle (reported
190 and analysed by Vladimir Timofeev).
191 - fix queue management logic in AnyEvent::Handle:
192 when on_read was registered, the queue was empty
193 and no progress could be made AnyEvent::Handle would
194 enter an endless loop.
195 - correctly start reading again when the handle became
196 busy again after idling.
197 - correctly treat tls shut-downs as EOF condition
198 (for the time being, would be nice to have a callback for that).
199 - correctly call eof callback under all conditions
200 (hopefully).
201 - the timeout callback did not expect that $self can go
202 away any time.
203
204 4.12 Tue Jun 3 10:58:04 CEST 2008
205 - include AnyEvent::Intro, a tutorial for anyevent,
206 anyevent::socket and anyevent::handle.
207 - allow more options in on_error.
208
209 4.11 Fri May 30 23:42:25 CEST 2008
210 - INCOMPATIBLE CHANGE: replace ptr by real PTR lookup, provide
211 reverse_lookup and reverse_verify to replace it, support
212 v4mapped and v4compat addresses.
213 - provide more documentation for the resolver class.
214 - really replace longest run of :0: by :: in format_address,
215 also properly convert :: and ::1 again.
216 - support NAPTR record name and decode it.
217 - implement random weight sampling for SRV records, as per
218 rfc 2782.
219 - correctly abort on srv-record targets of ".".
220 - added AnyEvent::DNS::wait_for_slot.
221 - in the unlikely event of a virtual circuit connection
222 being invalidated by a delayed udp reply, AnyEvent::DNS
223 could die. this has been fixed.
224 - plug a probable memleak in the DNS vc code.
225 - use configured timeout also for VC request phase.
226 - implement timeout and max_outstanding methods
227 for resolver class.
228 - update version numbers in all modules.
229
230 4.1 Thu May 29 05:45:40 CEST 2008
231 - INCOMPATIBLE CHANGE: renamed xxx_ip functions to xxx_address
232 which mirrors their purpose better (old names still available
233 for a while). Also moved AnyEvent::DNS::addr to
234 AnyEvent::Socket::resolve_sockaddr.
235 - implement AnyEvent->time and AnyEvent->now.
236 - fix IPv6 support in pack_sockaddr.
237 - officially un-experimentalise all newly introduced code.
238 - support unix domain sockets everywhere by specifying
239 a host of "unix/" and the pathname as service.
240 - implement an activity timeout in AnyEvent::Handle.
241 - added a regex read type to AnyEvent::Handle.
242 - added a json read/write type to AnyEvent::Handle.
243 - always croak in on_error in AnyEvent::Handle.
244 - document how to subclass AnyEvent::Handle.
245 - implement AnyEvent::Util::fork_call.
246 - add support for IPv6 nameservers and nameserver statements.
247 - work around _yet_ _another_ windows perl bug in where empty
248 select masks cause errors in the pure perl backend (this
249 workaround cannot be implemented for the other event loops,
250 but EV also works around this).
251 - supply AnyEvent::Socket::address_type and make good use of it.
252 - clarify and fix the Handle documentation w.r.t $self vs. $handle
253 vs. callback arguments.
254 - add some recommends to the META.yml.
255
256 4.05 Mon May 26 19:44:06 CEST 2008
257 - some platforms ignore the rfc and prepend an extra sa_len member to
258 the sockaddr structure, cater for those. also use sockaddr_family,
259 didn't know it was there, but comes in handy for the workaround.
260 - undo the import WIN32 hack.
261
262 4.04 Mon May 26 08:03:31 CEST 2008
263 - try to work around yet another windows bug: failed connects are reported
264 as if it were out-of-band data. windows users: you suck. Only
265 EV, Glib, Event and the pure perl backend can handle this condition.
266 - optimize write algorithm in AnyEvent::Handle.
267 - properly parse PERL_ANYEVENT_PROTOCOLS and use the info correctly.
268 - tcp_connect now properly iterates through all targets.
269 - check wether IPv6 sockets can actually be created, otherwise, disable ipv6
270 support entirely. also hardcode some AF_INET6 constants for the
271 sake of perl 5.8.
272 - vastly improved nameserver/suffix detection algorithm for windows
273 (still a hack...)
274 - try to use a fallback dns server if no dns servers could be found.
275 - splatter around some local $SIG{__DIE__}'s to work around bad
276 die handlers.
277
278 4.03 Sun May 25 05:05:57 CEST 2008
279 - work around perl bugs on windows, where perl returns undocumented
280 error codes for sysread, syswrite etc.
281 - fix AnyEvent::Handle::unshift_read to really unshift and not push.
282 - AnyEvent::Handle could sometimes stumble over 0-byte writes.
283 - fix unpack_sockaddr, now works for AF_INET6 sockaddr's.
284 - updated documentation.
285 - lots of workarounds for perl 5.8 quirks.
286 - implement a more flexible type system for both reads and writes
287 in AnyEvent::Handle.
288 - support IPv6 in tcp_server.
289 - pass local hostname and port to the prepare callback in tcp_server.
290 - make types extendable in AnyEvent::Handle.
291 - croak, not die, in AnyEvent::Handle;
292
293 4.0 Sat May 24 19:58:08 CEST 2008
294 - added (experimental) AnyEvent::DNS module.
295 - added (experimental) AnyEvent::Socket module.
296 - added (experiemntal) support for TLS/SSL in AnyEvent::Handle.
297 - make condvar->end call ->send as documented.
298 - make condvar constructor support the documented cb => argument.
299 - overload condvars so you can use them instead of code references.
300 - support more of the POSIX forms instead of a pure dotted quad for
301 verbatim ip addresses.
302 - AnyEvent::Socket::inet_aton will use AnyEvent::DNS now and not fork anymore.
303 - try very hard not to freeze on broken windows perls.
304 - make on_eof optional in AnyEvent::Handle.
305 - support service names in tcp_connect and tcp_server.
306 - work around netbsd/openbsd bug causing unix sockets not to
307 become writable until empty.
308 - only make a dummy read for error detection when getpeername
309 returns ENOTCONN.
310 - defend AnyEvent::Util::inet_aton against Coro::LWP's brutal
311 override.
312 - new AnyEvent::Guard::cancel.
313
314 3.5 Sat May 17 23:17:14 CEST 2008
315 - gracefully deal with systems not defining CLOCK_MONOTONIC
316 (as opposed to not supporting the clock itself, which worked in 3.41).
317 - added AnyEvent::Util::tcp_connect and AnyEvent::Util::tcp_server
318 helpers, to replace the ill-designed AnyEvent::Socket class.
319 - added some examples (eg/connect, eg/handle).
320 - added AnyEvent::Util::guard.
321 - AnyEvent::Util now exports most of its functions.
322 - fixed a bug in *_read_chunk, where the callback was called with $self as
323 first and second argument.
324 - simplified and fixed regex handling in AnyEvent::Handle::*_read_line.
325 - fix manpage condvars examples to use new syntax.
326 - considerably improve inet_aton with EV::ADNS backend to support
327 cname chains (common dns configuration bug, e.g. with www.google.de)
328 and aaaa records if no a record could be found.
329
330 3.41 Sun May 11 19:53:13 CEST 2008
331 - work around a bug in perl 5.8.8's local. Reported by Yi Ma Mao.
332
333 3.4 Sun May 11 00:29:25 CEST 2008
334 - complete re-implementation of condvars with a hopefully much more useful
335 API (backward compatible functions exist but are undocumented).
336 - AnyEvent::Handle fully rewritten with a hopefully more powerful API
337 (still subject to change).
338 - take advantage of CLOCK_MONOTONIC, if available, in AnyEvent::Impl::Perl.
339 - provide AnyEvent::post_detect and @AnyEvent::post_detect, which
340 allows module authors to avoid forcing event loop detection.
341 (used by Coro::AIO, Coro::BDB, Coro::AnyEvent for example).
342 - remove coro backends: Coro now provides generic support for AnyEvent
343 via Coro::AnyEvent.
344
345 3.3 Mon Apr 28 09:51:06 CEST 2008
346 - added AnyEvent::Handle, AnyEvent::Socket and AnyEvent::Util modules.
347 - fix a bug in the pure perl backend that kept watchers alive
348 when multiple watchers were registered for the same fh/poll combo.
349 - add a benchmark section showing AnyEvent overhead and comparing
350 the different event loops with each other.
351 - prefer pure perl over tk when autoprobing, as it's about as fast,
352 but doesn't crash with many watchers.
353 - declare Qt support non-experimental.
354 - clarify the confusing section about the file descriptor being
355 kept alive.
356 - document the race between loading of an event module and
357 child processes exiting.
358 - support POE as "backend" (with some caveats, POE is not generic
359 enough, and darn slow).
360 - support Wx and Prima through POE.
361 - optimise perl backend to use 20% less memory and take advantage
362 of typical timeout behaviour. It can now compete with
363 select/poll-based C event loops in most cases (it is usually
364 faster than Event and Glib :).
365 - roughly cut EV memory use in half and increase its speed by 30%,
366 by removing undocumented functionality. Did something similar
367 to other event loops where possible.
368
369 3.2 Thu Apr 24 10:10:40 CEST 2008
370 - do not die when anyevent watchers are destroyed while running callbacks
371 in the pureperl backend (could only happen when two watchers are registered
372 for the same fh/poll combo).
373 - support autoloading for child watchers, was broken in all versions.
374 - implement PERL_ANYEVENT_MODEL env variable.
375 - (experimental) implement interface to the (very crashy/buggy) Event::Lib module.
376 - (experimental) implement interface to the Qt module (cannot be autoprobed).
377 - this release is IO:AnyEvent-proof.
378
379 3.12 Tue Apr 22 07:11:46 CEST 2008
380 - reinstate AUTHOR section that got lost somehow.
381 - do not hang in the testsuite with badly broken perls (activestate,
382 strawberry...), but instead diagnose the problem and continue.
383 - use INT instead of CHLD in an attempt to support broken windows perls
384 better (this decreases the test quality, unfortunately).
385 - do not send the signal to the process group
386 (no problem for CHLD, bad for INT :).
387
388 3.11 Sat Apr 19 06:57:31 CEST 2008
389 - major documentation rework.
390 - document the fact that child watchers only watch for zombies.
391 - fix the child watcher example.
392
393 3.1 Wed Apr 16 17:09:01 CEST 2008
394 - work around recurring bugs in Tk by dup'ing filehandles, the
395 only method with good success chances on Tk (the bugs apparently
396 don't get fixed anytime soon).
397 - lift the restriction of only one watcher per fh direction
398 (as the Tk bug workaround also lifts it and only Tk imposed
399 such strong limits).
400 - changed probe order to prefer coro adaptors.
401 - explain why recursion into the event loop is not supported
402 unless the backend supports it (only Coro::EV does without
403 any restrictions...).
404 - add simple manpages for all backend modules.
405
406 3.0 Mon Apr 7 21:30:23 CEST 2008
407 - Coro::Signal changed semantics, roll our own, also cleaning
408 up the Coro implementation in general.
409 - rename Coro backend to CoroEvent.
410 - add some decision helping paragraph to the manpage that should
411 help people to decide whether AnyEvent is the right thing for them.
412
413 2.9 Mon Jan 28 13:31:54 CET 2008
414 - update for EV 3.0 API changes.
415
416 2.8 Sun Nov 25 15:06:03 CET 2007
417 - waitpid can validly return 0. accept this fact of life
418 instead of reporting it to any watchers.
419
420 2.7 Fri Nov 23 11:41:14 CET 2007
421 - force use of AnyEvent::Impl::Perl in testsuite, there is
422 too much breakage outside AnyEvent.
423 - deliver signals synchronously in AnyEvent::Impl::Perl
424 or any other event loop that relies on AnyEvents child
425 watcher emulation. *Could* help with hanging testsuite
426 (except when Event or EV are installed).
427
428 2.6 Fri Nov 9 20:36:35 CET 2007
429 - fix bug in testsuite.
430 - move EV adaptor modules to AnyEvent.
431 - add Coro+EV adaptor module.
432
433 2.55 Tue Nov 6 17:41:32 CET 2007
434 - add EV to the list of supported event models.
435 - do not auto-reset pid watchers, pass pid and status to them.
436 - allow a pid of zero to watch for all children in child watchers.
437
438 2.54 Wed Jul 18 17:36:23 CEST 2007
439 - work around a perl bug that results in
440 BEGIN not safe after errors--compilation aborted without
441 any discernible reason or error message by once
442 again not use'ing strict.
443
444 2.53 Sun Jul 8 10:51:53 CEST 2007
445 - make Glib interface work again (spotted by elmex).
446
447 2.52 Wed Mar 7 18:36:16 CET 2007
448 - child watchers stopped working permanently when
449 all current child watchers were destroyed.
450
451 2.51 Mon Dec 11 21:33:24 CET 2006
452 - work around bugs in perl where eval "require Module" returns
453 true even if the module couldn't be loaded :/.
454
455 2.5 Mon Dec 11 02:15:28 CET 2006
456 - avoid $AUTOLOAD because many perls corrupt it.
457 - AnyEvent::detect forces autodetection.
458 - implement signal watchers (experimental)
459 (Tk does not support async signals (<= 804.027 at least),
460 so they might get delayed indefinitely on Tk).
461 - implement child watchers (experimental).
462 - moved default condvar implementation into base module, simplifying
463 most implementation modules.
464
465 2.1 Fri Nov 24 15:50:48 CET 2006
466 - better docs.
467 - simple testsuite.
468 - added AnyEvent->one_event method for special purposes.
469
470 2.0 Wed Nov 1 02:21:30 CET 2006
471 - INCOMPATIBLE CHANGE: poll can now either be "r" or "w" but not both.
472 - INCOMPATIBLE CHANGE: io watcher callbacks have no arguments anymore.
473 - EXPERIMENTAL:
474 new pure-perl model added, AnyEvent now always finds a suitable
475 event model.
476 - improved documentation.
477 - reduced cpu overhead.
478
479 1.02 Fri Jan 13 14:15:40 CET 2006
480 - add COPYING to clarify license.
481
482 1.01 Sun Jan 8 05:48:09 CET 2006
483 - correctly cancel Event timers, avoid memory leaks.
484
485 1.0 Sun Jan 8 05:40:58 CET 2006
486 - allow third-party interfaces to be added at runtime.
487 - fix version number.
488
489 0.9 Fri Dec 30 02:25:41 CET 2005
490 - fixed errors in the documentation.
491 - going back to using $VERSION as "load check",
492 as suggested by Jörn Reder. Let's see why I stopped using
493 this method.
494 - add 'hup' to the list of events to receive for glib
495 and generate 'rw' events for it, as some versions of
496 glib seem to require this, while this breaks other
497 (older) versions of glib.
498 - implemented PERL_ANYEVENT_VERBOSE env variable.
499
500 0.3 Sun Dec 4 10:43:33 CET 2005
501 - no changes to the code.
502 - fixed documentation.
503 - clarified some corner cases.
504 - vastly improved documentation with a long example.
505
506 0.2 Thu Dec 1 22:18:49 CET 2005
507 - check whether a valid method was called, to avoid endless loops.
508 - move condvars into their own class (cleaner, safer).
509 - don't die when some modules are not available.
510 - Tk is too broken to allow for words. Will work once Tk works.
511
512 0.1 Thu Dec 1 19:44:57 CET 2005
513 - spiced up and cleaned up for release.
514
515 0.01 Tue Sep 21 18:12:09 CEST 2004
516 - original version; copied from Convert::Scalar.
517