iliaa           Sun Nov  5 18:31:42 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/imap   php_imap.c 
    /php-src    NEWS 
  Log:
  Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the 
  number of connection retries).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.7&r2=1.208.2.7.2.8&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.7 
php-src/ext/imap/php_imap.c:1.208.2.7.2.8
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.7   Thu Oct  5 14:25:41 2006
+++ php-src/ext/imap/php_imap.c Sun Nov  5 18:31:41 2006
@@ -26,7 +26,7 @@
    | PHP 4.0 updates:  Zeev Suraski <[EMAIL PROTECTED]>                       |
    +----------------------------------------------------------------------+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.7 2006/10/05 14:25:41 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.8 2006/11/05 18:31:41 iliaa Exp $ */
 
 #define IMAP41
 
@@ -736,21 +736,21 @@
  */
 static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
-       zval **mailbox, **user, **passwd, **options;
+       zval **mailbox, **user, **passwd, **options, **retries;
        MAILSTREAM *imap_stream;
        pils *imap_le_struct;
        long flags=NIL;
        long cl_flags=NIL;
        int myargc = ZEND_NUM_ARGS();
        
-       if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, 
&mailbox, &user, &passwd, &options) == FAILURE) {
+       if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, 
&mailbox, &user, &passwd, &options, &retries) == FAILURE) {
                ZEND_WRONG_PARAM_COUNT();
        }
 
        convert_to_string_ex(mailbox);
        convert_to_string_ex(user);
        convert_to_string_ex(passwd);
-       if (myargc ==4) {
+       if (myargc >= 4) {
                convert_to_long_ex(options);
                flags = Z_LVAL_PP(options);
                if (flags & PHP_EXPUNGE) {
@@ -777,6 +777,13 @@
        IMAPG(imap_user)     = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user));
        IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), 
Z_STRLEN_PP(passwd));
 
+#ifdef SET_MAXLOGINTRIALS
+       if (myargc == 5) {
+               convert_to_long_ex(retries);
+               mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+       }
+#endif
+
        imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags);
 
        if (imap_stream == NIL) {
@@ -794,7 +801,7 @@
 }
 /* }}} */
 
-/* {{{ proto resource imap_open(string mailbox, string user, string password 
[, int options])
+/* {{{ proto resource imap_open(string mailbox, string user, string password 
[, int options [, int n_retries]])
    Open an IMAP stream to a mailbox */
 PHP_FUNCTION(imap_open)
 {
@@ -802,18 +809,18 @@
 }
 /* }}} */
 
-/* {{{ proto bool imap_reopen(resource stream_id, string mailbox [, int 
options])
+/* {{{ proto bool imap_reopen(resource stream_id, string mailbox [, int 
options [, int n_retries]])
    Reopen an IMAP stream to a new mailbox */
 PHP_FUNCTION(imap_reopen)
 {
-       zval **streamind, **mailbox, **options;
+       zval **streamind, **mailbox, **options, **retries;
        pils *imap_le_struct; 
        MAILSTREAM *imap_stream;
        long flags=NIL;
        long cl_flags=NIL;
        int myargc=ZEND_NUM_ARGS();
 
-       if (myargc < 2 || myargc > 3 || zend_get_parameters_ex(myargc, 
&streamind, &mailbox, &options) == FAILURE) {
+       if (myargc < 2 || myargc > 4 || zend_get_parameters_ex(myargc, 
&streamind, &mailbox, &options, &retries) == FAILURE) {
                ZEND_WRONG_PARAM_COUNT();
        }
 
@@ -821,7 +828,7 @@
 
        convert_to_string_ex(mailbox);
 
-       if (myargc == 3) {
+       if (myargc >= 3) {
                convert_to_long_ex(options);
                flags = Z_LVAL_PP(options);
                if (flags & PHP_EXPUNGE) {
@@ -830,7 +837,12 @@
                }
                imap_le_struct->flags = cl_flags;       
        }
-
+#ifdef SET_MAXLOGINTRIALS
+       if (myargc == 4) {
+               convert_to_long_ex(retries);
+               mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+       }
+#endif
        /* local filename, need to perform open_basedir and safe_mode checks */
        if (Z_STRVAL_PP(mailbox)[0] != '{' && 
                        (php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC) 
|| 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.331&r2=1.2027.2.547.2.332&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.331 php-src/NEWS:1.2027.2.547.2.332
--- php-src/NEWS:1.2027.2.547.2.331     Sun Nov  5 15:08:50 2006
+++ php-src/NEWS        Sun Nov  5 18:31:41 2006
@@ -14,6 +14,8 @@
 - Fixed wrong signature initialization in imagepng (Takeshi Abe)
 - Added optimization for imageline with horizontal and vertial lines (Pierre)
 - Fixed bug #39366 (imagerotate does not use alpha with angle > 45°) (Pierre)
+- Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the 
+  number of connection retries). (Ilia)
 - Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre)
 - Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()).
   (Ilia)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to