From 9d1f7f5ed31a44ee6ab2600e2d70dec68c0407a9 Mon Sep 17 00:00:00 2001 From: Bob Jamison Date: Fri, 30 May 2008 20:15:16 +0000 Subject: remove warnings (bzr r5765) --- src/dom/io/socket.cpp | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'src/dom/io/socket.cpp') diff --git a/src/dom/io/socket.cpp b/src/dom/io/socket.cpp index 22b03b8b3..b800d7453 100644 --- a/src/dom/io/socket.cpp +++ b/src/dom/io/socket.cpp @@ -10,7 +10,7 @@ * Authors: * Bob Jamison * - * Copyright (C) 2005 Bob Jamison + * Copyright (C) 2005-2008 Bob Jamison * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -207,15 +207,15 @@ void TcpSocket::init() WSAStartup( wVersionRequested, &wsaData ); #endif #ifdef HAVE_SSL - if (libssl_is_present) - { + if (libssl_is_present) + { sslStream = NULL; sslContext = NULL; - CRYPTO_set_locking_callback(cryptoLockCallback); + CRYPTO_set_locking_callback(cryptoLockCallback); CRYPTO_set_id_callback(cryptoIdCallback); SSL_library_init(); SSL_load_error_strings(); - } + } #endif tcp_socket_inited = true; } @@ -471,10 +471,10 @@ long TcpSocket::available() if (count<=0 && sslEnabled) { #ifdef HAVE_SSL - if (libssl_is_present) - { + if (libssl_is_present) + { return SSL_pending(sslStream); - } + } #endif } return count; @@ -494,19 +494,19 @@ bool TcpSocket::write(int ch) if (sslEnabled) { #ifdef HAVE_SSL - if (libssl_is_present) - { - int r = SSL_write(sslStream, &c, 1); - if (r<=0) + if (libssl_is_present) { - switch(SSL_get_error(sslStream, r)) + int r = SSL_write(sslStream, &c, 1); + if (r<=0) { - default: + switch(SSL_get_error(sslStream, r)) + { + default: printf("SSL write problem"); return -1; + } } } - } #endif } else @@ -535,19 +535,19 @@ bool TcpSocket::write(const DOMString &strArg) if (sslEnabled) { #ifdef HAVE_SSL - if (libssl_is_present) - { - int r = SSL_write(sslStream, (unsigned char *)str.c_str(), len); - if (r<=0) + if (libssl_is_present) { - switch(SSL_get_error(sslStream, r)) + int r = SSL_write(sslStream, (unsigned char *)str.c_str(), len); + if (r<=0) { - default: - printf("SSL write problem"); - return -1; + switch(SSL_get_error(sslStream, r)) + { + default: + printf("SSL write problem"); + return -1; + } } } - } #endif } else @@ -592,28 +592,28 @@ int TcpSocket::read() if (sslEnabled) { #ifdef HAVE_SSL - if (libssl_is_present) - { - if (!sslStream) - return -1; - int r = SSL_read(sslStream, &ch, 1); - unsigned long err = SSL_get_error(sslStream, r); - switch (err) + if (libssl_is_present) { - case SSL_ERROR_NONE: - break; - case SSL_ERROR_ZERO_RETURN: - return -1; - case SSL_ERROR_SYSCALL: - printf("SSL read problem(syscall) %s\n", - ERR_error_string(ERR_get_error(), NULL)); - return -1; - default: - printf("SSL read problem %s\n", - ERR_error_string(ERR_get_error(), NULL)); + if (!sslStream) return -1; + int r = SSL_read(sslStream, &ch, 1); + unsigned long err = SSL_get_error(sslStream, r); + switch (err) + { + case SSL_ERROR_NONE: + break; + case SSL_ERROR_ZERO_RETURN: + return -1; + case SSL_ERROR_SYSCALL: + printf("SSL read problem(syscall) %s\n", + ERR_error_string(ERR_get_error(), NULL)); + return -1; + default: + printf("SSL read problem %s\n", + ERR_error_string(ERR_get_error(), NULL)); + return -1; + } } - } #endif } else -- cgit v1.2.3