From 792482b497dff678728237e66bf333ad29cb088e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 5 Jul 2007 20:59:27 +0000 Subject: [PATCH] Remove the intermediate buffer in serv_puts() --- webcit/crypto.c | 4 +--- webcit/tcp_sockets.c | 6 ++---- webcit/webcit.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/webcit/crypto.c b/webcit/crypto.c index 022b64ef0..c3d80e3ab 100644 --- a/webcit/crypto.c +++ b/webcit/crypto.c @@ -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)), diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 2d5d985d8..ed5ab54af 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -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); } diff --git a/webcit/webcit.c b/webcit/webcit.c index c6677b285..0368e6429 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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) { -- 2.30.2