+ fwrite (dlbuf, 1, res, out);
+ /* Always flush the contents of the network packet.
+ This should not hinder performance: fast downloads
+ will be received in 16K chunks (which stdio would
+ write out anyway), and slow downloads won't be
+ limited by disk performance. */
+ fflush (out);
+ if (ferror (out))
+ {
+ res = -2;
+ goto out;
+ }