From f271753e1b8867cb70940f69736ea7f6da4f61a1 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 22 Sep 2008 14:06:54 +0000 Subject: [PATCH] /static/webcit.css was being grabbed by the code that checks for '/webcit' and therefore this file was failing to load. Fixed it by checking for '/webcit/' instead. --- webcit/context_loop.c | 7 ++++--- webcit/crypto.c | 4 ++-- webcit/webcit.c | 9 ++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 932bb7c27..f6dc44e80 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -319,7 +319,8 @@ void context_loop(int *sock) int nLine = 0; int LineLen; void *vLine; - StrBuf *Buf, *Line, *LastLine, *HeaderName, *ReqLine, *accept_language, *ReqType, *HTTPVersion; + StrBuf *Buf, *Line, *LastLine, *HeaderName, *ReqLine, *ReqType, *HTTPVersion; + StrBuf *accept_language = NULL; const char *pch, *pchs, *pche; HashList *HTTPHeaders; @@ -446,8 +447,8 @@ void context_loop(int *sock) StrBufCutLeft(ReqLine, StrLength(ReqType) + 1); StrBufCutRight(ReqLine, StrLength(HTTPVersion) + 1); - if ((StrLength(ReqLine) >= 7) && - (ptr = strstr(ChrPtr(ReqLine), "/webcit"), /*< Handle "/webcit" */ + if ((StrLength(ReqLine) >= 8) && + (ptr = strstr(ChrPtr(ReqLine), "/webcit/"), /*< Handle "/webcit/" */ (ptr != NULL))) { StrBufCutLeft(ReqLine, 7); } diff --git a/webcit/crypto.c b/webcit/crypto.c index ffa628aea..fef2c6dcc 100644 --- a/webcit/crypto.c +++ b/webcit/crypto.c @@ -360,7 +360,7 @@ void init_ssl(void) * \return Zero if the SSL/TLS handshake succeeded, non-zero otherwise. */ int starttls(int sock) { - int retval, bits, alg_bits; + int retval, bits, alg_bits, r; SSL *newssl; pthread_setspecific(ThreadSSL, NULL); @@ -412,7 +412,7 @@ int starttls(int sock) { newssl = NULL; return(4); } else lprintf(15, "SSL_accept success\n"); - BIO_set_close(newssl->rbio, BIO_NOCLOSE); + r = BIO_set_close(newssl->rbio, BIO_NOCLOSE); bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(newssl), &alg_bits); lprintf(15, "SSL/TLS using %s on %s (%d of %d bits)\n", SSL_CIPHER_get_name(SSL_get_current_cipher(newssl)), diff --git a/webcit/webcit.c b/webcit/webcit.c index 422f580da..b52c1a13d 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -767,6 +767,10 @@ void http_redirect(const char *whichpage) { void http_transmit_thing(const char *content_type, int is_static) { + lprintf(9, "http_transmit_thing(%s)%s\n", + content_type, + (is_static ? " (static)" : "") + ); output_headers(0, 0, 0, 0, 0, is_static); hprintf("Content-type: %s\r\n" @@ -861,9 +865,7 @@ void output_static(char *what) close(fd); -#ifndef TECH_PREVIEW lprintf(9, "output_static('%s') %s\n", what, content_type); -#endif http_transmit_thing(content_type, 1); } if (yesbstr("force_close_session")) { @@ -1331,7 +1333,8 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method char buf[SIZ]; int a, nBackDots, nEmpty; int ContentLength = 0; - StrBuf *ContentType, *UrlLine; + StrBuf *ContentType = NULL; + StrBuf *UrlLine = NULL; StrBuf *content = NULL; const char *content_end = NULL; char browser_host[256]; -- 2.30.2