]> git.sur5r.net Git - openldap/commitdiff
ITS#2490 - allow retry for incomplete reads of BER tag & len
authorHoward Chu <hyc@openldap.org>
Mon, 19 May 2003 10:33:18 +0000 (10:33 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 19 May 2003 10:33:18 +0000 (10:33 +0000)
libraries/liblber/io.c

index 921363177b4a13b9515ea3016971e1ed18d1235a..bab1fbe91c904e2d0502b4f9a385e586c3f0090a 100644 (file)
@@ -543,10 +543,10 @@ ber_get_next(
                                        return LBER_DEFAULT;
                                }
                        }
+                       if (sblen == 1) continue;
+
                        ber->ber_tag = tag;
                        ber->ber_ptr = (char *)p;
-
-                       if (sblen == 1) continue;
                }
 
                /* Now look for the length */
@@ -559,6 +559,11 @@ ber_get_next(
                        }
                        /* Not enough bytes? */
                        if (ber->ber_rwptr - ber->ber_ptr < llen) {
+#if defined( EWOULDBLOCK )
+                               errno = EWOULDBLOCK;
+#elif defined( EAGAIN )
+                               errno = EAGAIN;
+#endif                 
                                return LBER_DEFAULT;
                        }
                        for (i=0;