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:
parent
f7c83b6ee3
commit
ee6065f581
@ -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>
|
||||
|
||||
* host.c (store_hostaddress): Instead of shifting ADDR, start
|
||||
|
12
src/ftp.c
12
src/ftp.c
@ -711,10 +711,18 @@ Error in server response, closing control connection.\n"));
|
||||
/* Close data connection socket. */
|
||||
closeport (dtsock);
|
||||
/* Close the local file. */
|
||||
{
|
||||
/* Close or flush the file. We have to be careful to check for
|
||||
error here. Checking the result of fwrite() is not enough --
|
||||
errors could go unnoticed! */
|
||||
int flush_res;
|
||||
if (!opt.dfp || con->cmd & DO_LIST)
|
||||
fclose (fp);
|
||||
flush_res = fclose (fp);
|
||||
else
|
||||
fflush (fp);
|
||||
flush_res = fflush (fp);
|
||||
if (flush_res == EOF)
|
||||
res = -2;
|
||||
}
|
||||
/* If get_contents couldn't write to fp, bail out. */
|
||||
if (res == -2)
|
||||
{
|
||||
|
12
src/http.c
12
src/http.c
@ -835,10 +835,18 @@ Accept: %s\r\n\
|
||||
(contlen != -1 ? contlen : 0),
|
||||
&rbuf);
|
||||
hs->dltime = elapsed_time ();
|
||||
{
|
||||
/* Close or flush the file. We have to be careful to check for
|
||||
error here. Checking the result of fwrite() is not enough --
|
||||
errors could go unnoticed! */
|
||||
int flush_res;
|
||||
if (!opt.dfp)
|
||||
fclose (fp);
|
||||
flush_res = fclose (fp);
|
||||
else
|
||||
fflush (fp);
|
||||
flush_res = fflush (fp);
|
||||
if (flush_res == EOF)
|
||||
hs->res = -2;
|
||||
}
|
||||
FREE_MAYBE (all_headers);
|
||||
CLOSE (sock);
|
||||
if (hs->res == -2)
|
||||
|
Loading…
Reference in New Issue
Block a user