]> code.citadel.org Git - citadel.git/blobdiff - webcit/webserver.c
* missing openssl ifdef here too...
[citadel.git] / webcit / webserver.c
index 2227d7fbab8896934515c42f53d7cda8660e9065..72d090c16485b21ed5460f24aea75588c2e1eb6c 100644 (file)
@@ -389,11 +389,12 @@ void graceful_shutdown_watcher(int signum) {
 }
 
 
-int ClientGetLine(int *sock, StrBuf *Target, StrBuf *CLineBuf)
+int ClientGetLine(int *sock, StrBuf *Target, StrBuf *CLineBuf, const char **Pos)
 {
        const char *Error, *pch, *pchs;
        int rlen, len, retval = 0;
 
+#ifdef HAVE_OPENSSL
        if (is_https) {
                int ntries = 0;
                if (StrLength(CLineBuf) > 0) {
@@ -441,12 +442,14 @@ int ClientGetLine(int *sock, StrBuf *Target, StrBuf *CLineBuf)
                        return -1;
        }
        else 
-               return StrBufTCP_read_buffered_line(Target, 
-                                                   CLineBuf,
-                                                   sock,
-                                                   5,
-                                                   1,
-                                                   &Error);
+#endif
+               return StrBufTCP_read_buffered_line_fast(Target, 
+                                                        CLineBuf,
+                                                        Pos,
+                                                        sock,
+                                                        5,
+                                                        1,
+                                                        &Error);
 }
 
 
@@ -642,7 +645,7 @@ int main(int argc, char **argv)
        char *mo = NULL;
 #endif /* ENABLE_NLS */
        char uds_listen_path[PATH_MAX]; /* listen on a unix domain socket? */
-       const char *I18nDumpFile;
+       const char *I18nDumpFile = NULL;
 
        WildFireInitBacktrace(argv[0], 2);
 
@@ -751,7 +754,7 @@ int main(int argc, char **argv)
                        break;
                case 'G':
                        DumpTemplateI18NStrings = 1;
-                       I18nDump = NewStrBufPlain(HKEY("int foo(void)\n{\n"));
+                       I18nDump = NewStrBufPlain(HKEY("int templatestrings(void)\n{\n"));
                        I18nDumpFile = optarg;
                        break;
                default:
@@ -793,6 +796,7 @@ int main(int argc, char **argv)
 #ifdef ENABLE_NLS
        initialize_locales();
 
+
        locale = setlocale(LC_ALL, "");
 
        mo = malloc(strlen(webcitdir) + 20);
@@ -800,7 +804,6 @@ int main(int argc, char **argv)
        free(mo);
        lprintf(9, "Text domain: %s\n", textdomain("webcit"));
        lprintf(9, "Text domain Charset: %s\n", bind_textdomain_codeset("webcit","UTF8"));
-       preset_locale();
 #endif
 
 
@@ -853,9 +856,17 @@ int main(int argc, char **argv)
        if (DumpTemplateI18NStrings) {
                FILE *fd;
                StrBufAppendBufPlain(I18nDump, HKEY("}\n"), 0);
+               if (StrLength(I18nDump) < 50) {
+                       lprintf(1, "********************************************************************************\n");
+                       lprintf(1, "*        No strings found in templates! are you shure they're there?           *\n");
+                       lprintf(1, "********************************************************************************\n");
+                       return -1;
+               }
                fd = fopen(I18nDumpFile, "w");
                if (fd == NULL) {
-                       lprintf(1, "unable to open I18N dumpfile [%s]\n", I18nDumpFile);
+                       lprintf(1, "********************************************************************************\n");
+                       lprintf(1, "*                  unable to open I18N dumpfile [%s]         *\n", I18nDumpFile);
+                       lprintf(1, "********************************************************************************\n");
                        return -1;
                }
                fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);