]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorXinchen Hui <laruence@gmail.com>
Thu, 10 Sep 2015 11:56:18 +0000 (19:56 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 10 Sep 2015 11:56:18 +0000 (19:56 +0800)
1  2 
ext/ldap/ldap.c

diff --cc ext/ldap/ldap.c
index c717e63982ec8f04540fa1eca1818d3a93ebcf08,ab663b156be320c3bba8a7267187105adc47361a..1514025db5dc5d63c38416f014ee496ac9f96d49
@@@ -2115,9 -2066,28 +2118,28 @@@ PHP_FUNCTION(ldap_get_option
                        if (ldap_get_option(ld->link, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) {
                                RETURN_FALSE;
                        }
 -                      zval_dtor(retval);
 +                      zval_ptr_dtor(retval);
                        ZVAL_LONG(retval, (timeout / 1000));
                } break;
+ #endif
+ #ifdef LDAP_OPT_TIMEOUT
+       case LDAP_OPT_TIMEOUT:
+               {
+                       struct timeval *timeout = NULL;
+                       if (ldap_get_option(ld->link, LDAP_OPT_TIMEOUT, (void *) &timeout)) {
+                               if (timeout) {
+                                       ldap_memfree(timeout);
+                               }
+                               RETURN_FALSE;
+                       }
+                       if (!timeout) {
+                               RETURN_FALSE;
+                       }
+                       zval_dtor(retval);
+                       ZVAL_LONG(retval, timeout->tv_sec);
+                       ldap_memfree(timeout);
+               } break;
  #endif
        /* options with string value */
        case LDAP_OPT_ERROR_STRING: