Auth: handle socket read errors in Dovecot authenticator
[exim.git] / src / src / auths / dovecot.c
index 8c5b411de59c9a7551d4adbf2dae9edc345698c3..b1c2c6f85bd12d368ec9222814dcad962695bcb8 100644 (file)
@@ -78,8 +78,8 @@ auth_dovecot_options_block auth_dovecot_option_defaults = {
 /* Dummy values */
 void auth_dovecot_init(auth_instance *ablock) {}
 int auth_dovecot_server(auth_instance *ablock, uschar *data) {return 0;}
-int auth_dovecot_client(auth_instance *ablock, smtp_inblock *inblock,
-  smtp_outblock *outblock, int timeout, uschar *buffer, int buffsize) {return 0;}
+int auth_dovecot_client(auth_instance *ablock, void * sx,
+  int timeout, uschar *buffer, int buffsize) {return 0;}
 
 #else   /*!MACRO_PREDEF*/
 
@@ -212,8 +212,8 @@ for (;;)
   {
   if (socket_buffer_left == 0)
     {
-    socket_buffer_left = read(fd, sbuffer, sizeof(sbuffer));
-    if (socket_buffer_left == 0) { if (count == 0) return NULL; else break; }
+    if ((socket_buffer_left = read(fd, sbuffer, sizeof(sbuffer))) <= 0)
+      if (count == 0) return NULL; else break;
     p = 0;
     }