[w3m-dev 03617] sourcefile when Content-Encoding: is specified.
* file.c (uncompress_stream): add src arg (examineFile): change uncompress_stream (loadGeneralFile): change uncompress_stream (doExternal): src (uncompress_stream): ext tmpfile with same ext From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
1 parent
235e9ca295
commit
f8ea236868
2 files changed
+36
-13
No files matched your search
@@ -1,3 +1,13 @@
|
|||||||
|
2003-01-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03617] sourcefile when Content-Encoding: is specified.
|
||||||
|
* file.c (uncompress_stream): add src arg
|
||||||
|
(examineFile): change uncompress_stream
|
||||||
|
(loadGeneralFile): change uncompress_stream
|
||||||
|
(doExternal): src
|
||||||
|
(uncompress_stream): ext
|
||||||
|
tmpfile with same ext
|
||||||
|
|
||||||
2003-01-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
2003-01-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03616] Re: data: URL scheme
|
* [w3m-dev 03616] Re: data: URL scheme
|
||||||
@@ -6218,4 +6228,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.659 2003/01/08 17:24:11 ukai Exp $
|
$Id: ChangeLog,v 1.660 2003/01/08 17:32:36 ukai Exp $
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: file.c,v 1.176 2003/01/08 17:24:12 ukai Exp $ */
|
/* $Id: file.c,v 1.177 2003/01/08 17:32:54 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -30,7 +30,7 @@ static int frame_source = 0;
|
|||||||
|
|
||||||
static void FTPhalfclose(InputStream stream);
|
static void FTPhalfclose(InputStream stream);
|
||||||
static int _MoveFile(char *path1, char *path2);
|
static int _MoveFile(char *path1, char *path2);
|
||||||
static void uncompress_stream(URLFile *uf);
|
static void uncompress_stream(URLFile *uf, char **src);
|
||||||
static FILE *lessopen_stream(char *path);
|
static FILE *lessopen_stream(char *path);
|
||||||
static Buffer *loadcmdout(char *cmd,
|
static Buffer *loadcmdout(char *cmd,
|
||||||
Buffer *(*loadproc) (URLFile *, Buffer *),
|
Buffer *(*loadproc) (URLFile *, Buffer *),
|
||||||
@@ -381,7 +381,7 @@ examineFile(char *path, URLFile *uf)
|
|||||||
char *t0 = uncompressed_file_type(path, &ext);
|
char *t0 = uncompressed_file_type(path, &ext);
|
||||||
uf->guess_type = t0;
|
uf->guess_type = t0;
|
||||||
uf->ext = ext;
|
uf->ext = ext;
|
||||||
uncompress_stream(uf);
|
uncompress_stream(uf, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1947,7 +1947,9 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
|
|||||||
if (!(w3m_dump & DUMP_SOURCE) &&
|
if (!(w3m_dump & DUMP_SOURCE) &&
|
||||||
(w3m_dump & ~DUMP_FRAME || is_text_type(t)
|
(w3m_dump & ~DUMP_FRAME || is_text_type(t)
|
||||||
|| searchExtViewer(t))) {
|
|| searchExtViewer(t))) {
|
||||||
uncompress_stream(&f);
|
if (t_buf == NULL)
|
||||||
|
t_buf = newBuffer(INIT_BUFFER_WIDTH);
|
||||||
|
uncompress_stream(&f, &t_buf->sourcefile);
|
||||||
uncompressed_file_type(pu.file, &f.ext);
|
uncompressed_file_type(pu.file, &f.ext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2029,7 +2031,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag & RG_FRAME) {
|
if (flag & RG_FRAME) {
|
||||||
t_buf = newBuffer(INIT_BUFFER_WIDTH);
|
if (t_buf == NULL)
|
||||||
|
t_buf = newBuffer(INIT_BUFFER_WIDTH);
|
||||||
t_buf->bufferprop |= BP_FRAME;
|
t_buf->bufferprop |= BP_FRAME;
|
||||||
}
|
}
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
@@ -7325,7 +7328,7 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
|
|||||||
struct mailcap *mcap;
|
struct mailcap *mcap;
|
||||||
int mc_stat;
|
int mc_stat;
|
||||||
Buffer *buf = NULL;
|
Buffer *buf = NULL;
|
||||||
char *header;
|
char *header, *src = NULL;
|
||||||
|
|
||||||
if (!(mcap = searchExtViewer(type)))
|
if (!(mcap = searchExtViewer(type)))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -7387,6 +7390,11 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
|
|||||||
if (mcap->flags & (MAILCAP_HTMLOUTPUT | MAILCAP_COPIOUSOUTPUT)) {
|
if (mcap->flags & (MAILCAP_HTMLOUTPUT | MAILCAP_COPIOUSOUTPUT)) {
|
||||||
if (defaultbuf == NULL)
|
if (defaultbuf == NULL)
|
||||||
defaultbuf = newBuffer(INIT_BUFFER_WIDTH);
|
defaultbuf = newBuffer(INIT_BUFFER_WIDTH);
|
||||||
|
if (defaultbuf->sourcefile)
|
||||||
|
src = defaultbuf->sourcefile;
|
||||||
|
else
|
||||||
|
src = tmpf->ptr;
|
||||||
|
defaultbuf->sourcefile = NULL;
|
||||||
defaultbuf->mailcap = mcap;
|
defaultbuf->mailcap = mcap;
|
||||||
}
|
}
|
||||||
if (mcap->flags & MAILCAP_HTMLOUTPUT) {
|
if (mcap->flags & MAILCAP_HTMLOUTPUT) {
|
||||||
@@ -7394,7 +7402,7 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
|
|||||||
if (buf && buf != NO_BUFFER) {
|
if (buf && buf != NO_BUFFER) {
|
||||||
buf->type = "text/html";
|
buf->type = "text/html";
|
||||||
buf->mailcap_source = buf->sourcefile;
|
buf->mailcap_source = buf->sourcefile;
|
||||||
buf->sourcefile = tmpf->ptr;
|
buf->sourcefile = src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mcap->flags & MAILCAP_COPIOUSOUTPUT) {
|
else if (mcap->flags & MAILCAP_COPIOUSOUTPUT) {
|
||||||
@@ -7402,7 +7410,7 @@ doExternal(URLFile uf, char *path, char *type, Buffer **bufp,
|
|||||||
if (buf && buf != NO_BUFFER) {
|
if (buf && buf != NO_BUFFER) {
|
||||||
buf->type = "text/plain";
|
buf->type = "text/plain";
|
||||||
buf->mailcap_source = buf->sourcefile;
|
buf->mailcap_source = buf->sourcefile;
|
||||||
buf->sourcefile = tmpf->ptr;
|
buf->sourcefile = src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -7737,13 +7745,14 @@ inputAnswer(char *prompt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
uncompress_stream(URLFile *uf)
|
uncompress_stream(URLFile *uf, char **src)
|
||||||
{
|
{
|
||||||
int pid1;
|
int pid1;
|
||||||
int fd1[2];
|
int fd1[2];
|
||||||
char *expand_cmd = GUNZIP_CMDNAME;
|
char *expand_cmd = GUNZIP_CMDNAME;
|
||||||
char *expand_name = GUNZIP_NAME;
|
char *expand_name = GUNZIP_NAME;
|
||||||
char *tmpf = NULL;
|
char *tmpf = NULL;
|
||||||
|
char *ext = NULL;
|
||||||
struct compression_decoder *d;
|
struct compression_decoder *d;
|
||||||
|
|
||||||
if (IStype(uf->stream) != IST_ENCODED) {
|
if (IStype(uf->stream) != IST_ENCODED) {
|
||||||
@@ -7757,6 +7766,7 @@ uncompress_stream(URLFile *uf)
|
|||||||
else
|
else
|
||||||
expand_cmd = d->cmd;
|
expand_cmd = d->cmd;
|
||||||
expand_name = d->name;
|
expand_name = d->name;
|
||||||
|
ext = d->ext;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7767,8 +7777,8 @@ uncompress_stream(URLFile *uf)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uf->scheme != SCM_HTTP && uf->scheme != SCM_LOCAL) {
|
if (uf->scheme != SCM_LOCAL) {
|
||||||
tmpf = tmpfname(TMPF_DFL, NULL)->ptr;
|
tmpf = tmpfname(TMPF_DFL, ext)->ptr;
|
||||||
if (save2tmp(*uf, tmpf) < 0) {
|
if (save2tmp(*uf, tmpf) < 0) {
|
||||||
UFclose(uf);
|
UFclose(uf);
|
||||||
return;
|
return;
|
||||||
@@ -7777,7 +7787,10 @@ uncompress_stream(URLFile *uf)
|
|||||||
if (uf->scheme != SCM_FTP)
|
if (uf->scheme != SCM_FTP)
|
||||||
#endif
|
#endif
|
||||||
UFclose(uf);
|
UFclose(uf);
|
||||||
uf->scheme = SCM_LOCAL;
|
if (src)
|
||||||
|
*src = tmpf;
|
||||||
|
else
|
||||||
|
uf->scheme = SCM_LOCAL;
|
||||||
pushText(fileToDelete, tmpf);
|
pushText(fileToDelete, tmpf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user