From b347fec899815ec89b2738a0877880ee81e74b59 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 14 Sep 2011 17:49:51 -0400 Subject: [PATCH] Conditional_USER_HAS_PIC() was leaving the download file open, causing the actual download to fail. Fixed. --- webcit/downloads.c | 5 ++++- webcit/static/t/user/show.html | 2 +- webcit/static/t/who/bio.html | 2 +- webcit/useredit.c | 18 ++++++++++-------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/webcit/downloads.c b/webcit/downloads.c index 993b075b2..9c1050522 100644 --- a/webcit/downloads.c +++ b/webcit/downloads.c @@ -407,7 +407,10 @@ void output_image(void) } } /* hm... unknown mimetype? fallback to blank gif */ - } + } + else { + syslog(LOG_DEBUG, "OIMG failed: %s", ChrPtr(Buf)); + } /* diff --git a/webcit/static/t/user/show.html b/webcit/static/t/user/show.html index f25d231f0..b957bd252 100644 --- a/webcit/static/t/user/show.html +++ b/webcit/static/t/user/show.html @@ -15,7 +15,7 @@
diff --git a/webcit/static/t/who/bio.html b/webcit/static/t/who/bio.html index 127037af8..a1d599b7e 100644 --- a/webcit/static/t/who/bio.html +++ b/webcit/static/t/who/bio.html @@ -19,7 +19,7 @@
- "> + ">

diff --git a/webcit/useredit.c b/webcit/useredit.c index d6d3a41ec..ef72b6e20 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -481,6 +481,7 @@ int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP) StrBuf *Buf; const char *who; long len; + int r = 0; GetTemplateTokenString(Target, TP, 2, &who, &len); @@ -488,15 +489,16 @@ int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP) serv_printf("OIMG _userpic_|%s", who); StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, NULL) != 2) { - serv_puts("CLOS"); - StrBuf_ServGetln(Buf); - GetServerStatus(Buf, NULL); - FreeStrBuf(&Buf); - return 1; - } else { - FreeStrBuf(&Buf); - return 0; + r = 1; } + else { + r = 0; + } + serv_puts("CLOS"); + StrBuf_ServGetln(Buf); + GetServerStatus(Buf, NULL); + FreeStrBuf(&Buf); + return(r); } -- 2.30.2
- " alt=""> + " alt="">