imclient_input

Patrick Welche prlw1 at newn.cam.ac.uk
Fri Apr 4 14:47:20 EST 2003


This just moves the plainlen==0 test, if it's needed at all - the
rest is just formatting.

Cheers,

Patrick

Index: imclient.c
===================================================================
RCS file: /cvs/src/cyrus/lib/imclient.c,v
retrieving revision 1.77
diff -u -r1.77 imclient.c
--- imclient.c	13 Feb 2003 20:15:40 -0000	1.77
+++ imclient.c	4 Apr 2003 19:43:50 -0000
@@ -685,18 +693,18 @@
     assert(buf);
     
     if (imclient->saslcompleted == 1) {
-	/* decrypt what we have */
-	if ((result = sasl_decode(imclient->saslconn, buf, len,
-			&plainbuf, &plainlen)) != SASL_OK) {
-	    (void) shutdown(imclient->fd, 0);
-	}
-
-	if (plainlen == 0) return;
+		/* decrypt what we have */
+		if ((result = sasl_decode(imclient->saslconn, buf, len,
+				&plainbuf, &plainlen)) != SASL_OK) {
+	    	(void) shutdown(imclient->fd, 0);
+		}
     } else {
-	plainbuf = buf;
-	plainlen = len;
+		plainbuf = buf;
+		plainlen = len;
     }
 
+	if (plainlen == 0) return;
+
     /* Ensure replybuf has enough space to take the input */
     if (imclient->replylen + plainlen >= imclient->alloc_replybuf) {
 	/* If there is unused space at the front, move the plaintext there */




More information about the Info-cyrus mailing list