diff options
| author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-08-22 09:17:59 +0000 |
|---|---|---|
| committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-08-22 09:17:59 +0000 |
| commit | a803e26dcdc6652b12d05f29bbd1b23c4b4239ed (patch) | |
| tree | bc22d2a3d883c86bb5fce947e402cbb2b2c7aede /WWW/Library | |
| parent | 5cda0e8cde6b4ebb16f2968edf3734af7d9524ac (diff) | |
| download | lynx-snapshots-a803e26dcdc6652b12d05f29bbd1b23c4b4239ed.tar.gz | |
snapshot of project "lynx", label v2-9-0dev_2b
Diffstat (limited to 'WWW/Library')
| -rw-r--r-- | WWW/Library/Implementation/HTNews.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 75b7001e..3cd1b791 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTNews.c,v 1.73 2018/02/26 00:28:40 tom Exp $ + * $LynxId: HTNews.c,v 1.74 2019/08/20 09:03:18 tom Exp $ * * NEWS ACCESS HTNews.c * =========== @@ -56,9 +56,19 @@ static SSL *Handle = NULL; static int channel_s = 1; #define NEWS_NETWRITE(sock, buff, size) \ - (Handle ? SSL_write(Handle, buff, size) : NETWRITE(sock, buff, size)) + ((Handle != NULL) \ + ? SSL_write(Handle, buff, size) \ + : NETWRITE(sock, buff, size)) #define NEWS_NETCLOSE(sock) \ - { (void)NETCLOSE(sock); if (Handle) { SSL_free(Handle); Handle = NULL; } } + { \ + if ((int)(sock) >= 0) { \ + (void)NETCLOSE(sock); \ + } \ + if (Handle != NULL) { \ + SSL_free(Handle); \ + Handle = NULL; \ + } \ + } static int HTNewsGetCharacter(void); #define NEXT_CHAR HTNewsGetCharacter() |