1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Committed my patch from <dpd7mj3sap.fsf@mraz.iskon.hr>.

This commit is contained in:
hniksic 2000-05-19 00:37:22 -07:00
parent f7c83b6ee3
commit ee6065f581
3 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2000-05-18 Hrvoje Niksic <hniksic@iskon.hr>
* ftp.c (getftp): Ditto.
* http.c (gethttp): Check for return value of fclose/fflush.
2000-04-12 Hrvoje Niksic <hniksic@iskon.hr> 2000-04-12 Hrvoje Niksic <hniksic@iskon.hr>
* host.c (store_hostaddress): Instead of shifting ADDR, start * host.c (store_hostaddress): Instead of shifting ADDR, start

View File

@ -711,10 +711,18 @@ Error in server response, closing control connection.\n"));
/* Close data connection socket. */ /* Close data connection socket. */
closeport (dtsock); closeport (dtsock);
/* Close the local file. */ /* Close the local file. */
if (!opt.dfp || con->cmd & DO_LIST) {
fclose (fp); /* Close or flush the file. We have to be careful to check for
else error here. Checking the result of fwrite() is not enough --
fflush (fp); errors could go unnoticed! */
int flush_res;
if (!opt.dfp || con->cmd & DO_LIST)
flush_res = fclose (fp);
else
flush_res = fflush (fp);
if (flush_res == EOF)
res = -2;
}
/* If get_contents couldn't write to fp, bail out. */ /* If get_contents couldn't write to fp, bail out. */
if (res == -2) if (res == -2)
{ {

View File

@ -835,10 +835,18 @@ Accept: %s\r\n\
(contlen != -1 ? contlen : 0), (contlen != -1 ? contlen : 0),
&rbuf); &rbuf);
hs->dltime = elapsed_time (); hs->dltime = elapsed_time ();
if (!opt.dfp) {
fclose (fp); /* Close or flush the file. We have to be careful to check for
else error here. Checking the result of fwrite() is not enough --
fflush (fp); errors could go unnoticed! */
int flush_res;
if (!opt.dfp)
flush_res = fclose (fp);
else
flush_res = fflush (fp);
if (flush_res == EOF)
hs->res = -2;
}
FREE_MAYBE (all_headers); FREE_MAYBE (all_headers);
CLOSE (sock); CLOSE (sock);
if (hs->res == -2) if (hs->res == -2)