Remove the intermediate buffer in serv_puts()
authorArt Cancro <ajc@citadel.org>
Thu, 5 Jul 2007 20:59:27 +0000 (20:59 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 5 Jul 2007 20:59:27 +0000 (20:59 +0000)
webcit/crypto.c
webcit/tcp_sockets.c
webcit/webcit.c

index 022b64ef05c03b0cd0df1ef18f8e04d6572fc84c..c3d80e3ab6707cbaf1eab7f7c411f56775425820 100644 (file)
@@ -356,9 +356,7 @@ int starttls(int sock) {
                return(4);
        }
        BIO_set_close(newssl->rbio, BIO_NOCLOSE);
-       bits =
-           SSL_CIPHER_get_bits(SSL_get_current_cipher(newssl),
-                               &alg_bits);
+       bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(newssl), &alg_bits);
        lprintf(5, "SSL/TLS using %s on %s (%d of %d bits)\n",
                SSL_CIPHER_get_name(SSL_get_current_cipher(newssl)),
                SSL_CIPHER_get_version(SSL_get_current_cipher(newssl)),
index 2d5d985d8397c38ccc6936487b6b3b1463019f5d..ed5ab54af16bd3dc8a0a3742154a19ad554807a3 100644 (file)
@@ -202,13 +202,11 @@ void serv_write(char *buf, int nbytes)
  */
 void serv_puts(char *string)
 {
-       char buf[SIZ];
-
 #ifdef SERV_TRACE
        lprintf(9, "%3d<%s\n", WC->serv_sock, string);
 #endif
-       sprintf(buf, "%s\n", string);
-       serv_write(buf, strlen(buf));
+       serv_write(string, strlen(string));
+       serv_write("\n", 1);
 }
 
 
index c6677b285e1d0f8d24ac59ca7238fb56dae1fc22..0368e6429cc27bfde7db3f3c00b6a7425906ad39 100644 (file)
@@ -1209,7 +1209,7 @@ void session_loop(struct httprequest *req)
        }
 
        /* If the client sent a nonce that is incorrect, kill the request. */
-       if (!strcasecmp(request_method, "POST")) {
+       if (strlen(bstr("nonce")) > 0) {
                lprintf(9, "Comparing supplied nonce %s to session nonce %ld\n", 
                        bstr("nonce"), WC->nonce);
                if (atoi(bstr("nonce")) != WC->nonce) {