[w3m-dev 03632] cleanup (don't close connection of news server)

* file.c (loadSomething): remove UFclose nntp:,news:
	(loadFile): UFclose
	(loadGeneralFile): always UFclose
* html.h (UFclose): only reset when ISclose ==0
* istream.c (ISclose): return int
	(ISfileno): flag IST_UNCLOSE
* istream.h (ISclose): return int
	(IST_UNCLOSE): added
* news.c (news_close): reset IST_UNCLOSE
	(news_open): set IST_UNCLOSE
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-10 17:06:17 +00:00
parent dfc317f6ab
commit f4d6305bdd
6 changed files with 38 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: istream.c,v 1.17 2003/01/10 16:58:31 ukai Exp $ */
/* $Id: istream.c,v 1.18 2003/01/10 17:06:23 ukai Exp $ */
#include "fm.h"
#include "myctype.h"
#include "istream.h"
@@ -176,15 +176,17 @@ newEncodedStream(InputStream is, char encoding)
return stream;
}
void
int
ISclose(InputStream stream)
{
MySignalHandler(*prevtrap) ();
if (stream == NULL || stream->base.close == NULL)
return;
if (stream == NULL || stream->base.close == NULL ||
stream->base.type & IST_UNCLOSE)
return -1;
prevtrap = signal(SIGINT, SIG_IGN);
stream->base.close(stream->base.handle);
signal(SIGINT, prevtrap);
return 0;
}
int
@@ -336,7 +338,7 @@ ISfileno(InputStream stream)
{
if (stream == NULL)
return -1;
switch (IStype(stream)) {
switch (IStype(stream) & ~IST_UNCLOSE) {
case IST_BASIC:
return *(int *)stream->base.handle;
case IST_FILE: