* made *bstr things const
[citadel.git] / webcit / tcp_sockets.c
index fa5429d32b8099f4381af5d51e4863fe9b5ece04..6c9b34f3564732ca1df7ebf8b97ab20942682c8a 100644 (file)
@@ -218,7 +218,7 @@ int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize)
  * \param buf the buffer to write to citadel server
  * \param nbytes how many bytes to send to citadel server
  */
-void serv_write(char *buf, int nbytes)
+void serv_write(const char *buf, int nbytes)
 {
        int bytes_written = 0;
        int retval;
@@ -243,7 +243,7 @@ void serv_write(char *buf, int nbytes)
  * \brief send line to server
  * \param string the line to send to the citadel server
  */
-void serv_puts(char *string)
+void serv_puts(const char *string)
 {
 #ifdef SERV_TRACE
        lprintf(9, "%3d<%s\n", WC->serv_sock, string);
@@ -252,6 +252,19 @@ void serv_puts(char *string)
        serv_write("\n", 1);
 }
 
+/**
+ * \brief send line to server
+ * \param string the line to send to the citadel server
+ */
+void serv_putbuf(const StrBuf *string)
+{
+#ifdef SERV_TRACE
+       lprintf(9, "%3d<%s\n", WC->serv_sock, ChrPtr(string));
+#endif
+       serv_write(ChrPtr(string), StrLength(string));
+       serv_write("\n", 1);
+}
+
 
 /**
  * \brief convenience function to send stuff to the server