]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/ctdlclient.c
change to db-open flags
[citadel.git] / webcit-ng / ctdlclient.c
index b6f204aad49b2fefb2dc34be703210dc0edbf265..decb31adba036ada8d0554d3d8626e0cba544289 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Functions that handle communication with a Citadel Server
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -28,7 +28,7 @@ int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes)
        int len = 0;
        int c = 0;
 
-       if (buf == NULL) return;
+       if (buf == NULL) return(-1);
 
        while (len < maxbytes) {
                c = read(ctdl->sock, &buf[len], 1);
@@ -41,12 +41,12 @@ int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes)
                                --len;
                        }
                        buf[len] = 0;
-                       // syslog(LOG_DEBUG, "[ %s", buf);
+                       // syslog(LOG_DEBUG, "\033[33m[ %s\033[0m", buf);
                        return(len);
                }
                ++len;
        }
-       // syslog(LOG_DEBUG, "[ %s", buf);
+       // syslog(LOG_DEBUG, "\033[33m[ %s\033[0m", buf);
        return(len);
 }
 
@@ -93,7 +93,7 @@ void ctdl_printf(struct ctdlsession *ctdl, const char *format,...)
        StrBufVAppendPrintf(Buf, format, arg_ptr);
        va_end(arg_ptr);
 
-       // syslog(LOG_DEBUG, "] %s", ChrPtr(Buf));
+       syslog(LOG_DEBUG, "\033[32m] %s\033[0m", ChrPtr(Buf));
        ctdl_write(ctdl, (char *)ChrPtr(Buf), StrLength(Buf));
        ctdl_write(ctdl, "\n", 1);
        FreeStrBuf(&Buf);