]> code.citadel.org Git - citadel.git/commitdiff
* sysdep.c: in client_write(), handle redirect_fp and redirect_sock *before*
authorArt Cancro <ajc@citadel.org>
Sun, 6 Jan 2002 21:25:27 +0000 (21:25 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 6 Jan 2002 21:25:27 +0000 (21:25 +0000)
  handling redirect_ssl, because these need to be done the same way regardless
  of client session crypto
* serv_crypto.c: pasted a bunch of Nathan's #ifdef blocks from sysdep.c in
  order to gain greater portability (or even to get it to compile on splorph)

citadel/ChangeLog
citadel/serv_crypto.c
citadel/sysdep.c

index 1882dea7e639a868f1ede202924f883ed3ce18c8..38dd4bab9817651127bc5b13e498535f941dc220 100644 (file)
@@ -1,4 +1,11 @@
  $Log$
+ Revision 590.46  2002/01/06 21:25:26  ajc
+ * sysdep.c: in client_write(), handle redirect_fp and redirect_sock *before*
+   handling redirect_ssl, because these need to be done the same way regardless
+   of client session crypto
+ * serv_crypto.c: pasted a bunch of Nathan's #ifdef blocks from sysdep.c in
+   order to gain greater portability (or even to get it to compile on splorph)
+
  Revision 590.45  2002/01/06 11:13:33  error
  * Enable SSL/TLS support in the client (again)
 
@@ -3098,4 +3105,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index b4e25f1a9828b9d6b2bfbd746cfbd7f5a750c194..5adcc6a7e83b5d6886567653e5207ac222c32364 100644 (file)
@@ -3,14 +3,32 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include "sysdep.h"
+
 #ifdef HAVE_OPENSSL
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #endif
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include <stdio.h>
 #include "server.h"
 #include "serv_crypto.h"
index fdb38cc277675fc5e1f11bc8aa5f1a8fd65892a7..e8d741c598591e18cda066b27d544bcc69d19aea 100644 (file)
@@ -478,14 +478,6 @@ void client_write(char *buf, int nbytes)
        int retval;
        int sock;
 
-
-#ifdef HAVE_OPENSSL
-       if (CC->redirect_ssl) {
-               client_write_ssl(buf, nbytes);
-               return;
-       }
-#endif
-
        if (CC->redirect_fp != NULL) {
                fwrite(buf, nbytes, 1, CC->redirect_fp);
                return;
@@ -498,6 +490,13 @@ void client_write(char *buf, int nbytes)
                sock = CC->client_socket;
        }
 
+#ifdef HAVE_OPENSSL
+       if (CC->redirect_ssl) {
+               client_write_ssl(buf, nbytes);
+               return;
+       }
+#endif
+
        while (bytes_written < nbytes) {
                retval = write(sock, &buf[bytes_written],
                        nbytes - bytes_written);