[w3m-dev 03424] Content length

* file.c (loadGeneralFile): current_content_length before do_download
	(save2tmp): current_content_length move before return
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-11-13 15:47:12 +00:00
parent 3a0ae78f81
commit f15e6e885c
2 changed files with 13 additions and 7 deletions

View File

@@ -1,3 +1,9 @@
2002-11-14 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03424] Content length
* file.c (loadGeneralFile): current_content_length before do_download
(save2tmp): current_content_length move before return
2002-11-12 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 03422] Re: setting form on loading
@@ -4595,4 +4601,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
$Id: ChangeLog,v 1.506 2002/11/12 13:06:14 ukai Exp $
$Id: ChangeLog,v 1.507 2002/11/13 15:47:12 ukai Exp $

12
file.c
View File

@@ -1,4 +1,4 @@
/* $Id: file.c,v 1.114 2002/11/09 21:55:24 ukai Exp $ */
/* $Id: file.c,v 1.115 2002/11/13 15:47:12 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -1856,6 +1856,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
copyParsedURL(cur_baseURL, &pu);
#endif
current_content_length = 0;
if ((p = checkHeader(t_buf, "Content-Length:")) != NULL)
current_content_length = strtoclen(p);
if (do_download) {
/* download only */
char *file;
@@ -1954,10 +1958,6 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
}
}
current_content_length = 0;
if ((p = checkHeader(t_buf, "Content-Length:")) != NULL)
current_content_length = strtoclen(p);
if (flag & RG_FRAME) {
t_buf = newBuffer(INIT_BUFFER_WIDTH);
t_buf->bufferprop |= BP_FRAME;
@@ -7008,7 +7008,6 @@ save2tmp(URLFile uf, char *tmpf)
if (fmInitialized)
term_cbreak();
check = 0;
current_content_length = 0;
#ifdef USE_NNTP
if (uf.scheme == SCM_NEWS) {
char c;
@@ -7048,6 +7047,7 @@ save2tmp(URLFile uf, char *tmpf)
fclose(ff);
if (uf.scheme == SCM_FTP)
FTPhalfclose(uf.stream);
current_content_length = 0;
return 0;
}