[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-05-04 Thread Jani Taskinen
janiTue May  5 01:21:10 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - sync with HEAD
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.45r2=1.208.2.7.2.26.2.46diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.45 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.46
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.45 Sat May  2 17:59:46 2009
+++ php-src/ext/imap/php_imap.c Tue May  5 01:21:10 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.45 2009/05/02 17:59:46 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.46 2009/05/05 01:21:10 jani Exp $ */
 
 #define IMAP41
 
@@ -860,7 +860,7 @@
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);
 
/* plug in our gets */
-   mail_parameters(NIL, SET_GETS, (void *) NULL);
+   mail_parameters(NIL, SET_GETS, (void *) NIL);
 
/* set default timeout values */
mail_parameters(NIL, SET_OPENTIMEOUT, (void *) 
FG(default_socket_timeout));
@@ -2342,7 +2342,7 @@
IMAPG(gets_stream) = writer;
mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
mail_fetchbody_full(imap_ptr-imap_stream, msgno, section, NULL, flags);
-   mail_parameters(NIL, SET_GETS, (void *) NULL);
+   mail_parameters(NIL, SET_GETS, (void *) NIL);
IMAPG(gets_stream) = NULL;
 
if (close_stream) {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c php_imap.h /ext/imap/tests imap_mutf7_to_utf8.phpt imap_utf8_to_mutf7_basic.phpt

2009-05-02 Thread Pierre-Alain Joye
pajoye  Sat May  2 17:59:46 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/imap/tests imap_mutf7_to_utf8.phpt 
imap_utf8_to_mutf7_basic.phpt 

  Modified files:  
/php-src/ext/imap   php_imap.c php_imap.h 
  Log:
  - [DOC] MFH: add imap_mutf7_to_utf8 and imap_utf8_to_mutf7
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.44r2=1.208.2.7.2.26.2.45diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.44 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.45
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.44 Thu Apr 30 18:56:25 2009
+++ php-src/ext/imap/php_imap.c Sat May  2 17:59:46 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.44 2009/04/30 18:56:25 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.45 2009/05/02 17:59:46 pajoye Exp $ */
 
 #define IMAP41
 
@@ -351,6 +351,14 @@
ZEND_ARG_INFO(0, buf)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8_to_mutf7, 0, 0, 1)
+   ZEND_ARG_INFO(0, in)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mutf7_to_utf8, 0, 0, 1)
+   ZEND_ARG_INFO(0, in)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setflag_full, 0, 0, 3)
ZEND_ARG_INFO(0, stream_id)
ZEND_ARG_INFO(0, sequence)
@@ -509,6 +517,8 @@
PHP_FE(imap_search, 
arginfo_imap_search)
PHP_FE(imap_utf7_decode,
arginfo_imap_utf7_decode)
PHP_FE(imap_utf7_encode,
arginfo_imap_utf7_encode)
+   PHP_FE(imap_utf8_to_mutf7,  
arginfo_imap_utf8_to_mutf7)
+   PHP_FE(imap_mutf7_to_utf8,  
arginfo_imap_mutf7_to_utf8)
PHP_FE(imap_mime_header_decode, 
arginfo_imap_mime_header_decode)
PHP_FE(imap_thread, 
arginfo_imap_thread)
PHP_FE(imap_timeout,
arginfo_imap_timeout)
@@ -2885,6 +2895,47 @@
 #undef B64
 #undef UNB64
 
+static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode)
+{
+   char *in;
+   int in_len;
+   unsigned char *out;
+   
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, in, in_len) 
== FAILURE) {
+   return;
+   }
+
+   if (in_len  1) {
+   RETURN_EMPTY_STRING();
+   }
+
+   if (mode == 0) {
+   out = utf8_to_mutf7((unsigned char *) in);
+   } else {
+   out = utf8_from_mutf7((unsigned char *) in);
+   }
+
+   if (out == NIL) {
+   RETURN_FALSE;
+   } else {
+   RETURN_STRING((char *)out, 1);
+   }
+}
+
+/* {{{ proto string imap_utf8_to_mutf7(string in)
+   Encode a UTF-8 string to modified UTF-7 */
+PHP_FUNCTION(imap_utf8_to_mutf7)
+{
+   php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+
+/* {{{ proto string imap_mutf7_to_utf8(string in)
+   Decode a modified UTF-7 string to UTF-8 */
+PHP_FUNCTION(imap_mutf7_to_utf8)
+{
+   php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+
 /* {{{ proto bool imap_setflag_full(resource stream_id, string sequence, 
string flag [, int options])
Sets flags on messages */
 PHP_FUNCTION(imap_setflag_full)
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.h?r1=1.32.2.2.2.1.2.3r2=1.32.2.2.2.1.2.4diff_format=u
Index: php-src/ext/imap/php_imap.h
diff -u php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.3 
php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.4
--- php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.3Tue Apr 28 08:22:57 2009
+++ php-src/ext/imap/php_imap.h Sat May  2 17:59:46 2009
@@ -27,7 +27,7 @@
+--+
  */
 
-/* $Id: php_imap.h,v 1.32.2.2.2.1.2.3 2009/04/28 08:22:57 pajoye Exp $ */
+/* $Id: php_imap.h,v 1.32.2.2.2.1.2.4 2009/05/02 17:59:46 pajoye Exp $ */
 
 #ifndef PHP_IMAP_H
 #define PHP_IMAP_H
@@ -165,6 +165,8 @@
 PHP_FUNCTION(imap_utf8);
 PHP_FUNCTION(imap_utf7_decode);
 PHP_FUNCTION(imap_utf7_encode);
+PHP_FUNCTION(imap_utf8_to_mutf7);
+PHP_FUNCTION(imap_mutf7_to_utf8);
 PHP_FUNCTION(imap_mime_header_decode);
 PHP_FUNCTION(imap_thread);
 PHP_FUNCTION(imap_timeout);

http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_mutf7_to_utf8.phpt?view=markuprev=1.1
Index: php-src/ext/imap/tests/imap_mutf7_to_utf8.phpt
+++ php-src/ext/imap/tests/imap_mutf7_to_utf8.phpt
--TEST--
imap_mutf7_to_utf8
--SKIPIF--
?php if (!extension_loaded(imap)) print skip; ?
--FILE--
?php


[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-30 Thread Pierre-Alain Joye
pajoye  Thu Apr 30 18:56:25 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFB: #47940, memory leaks in imap_body
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.43r2=1.208.2.7.2.26.2.44diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.43 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.44
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.43 Tue Apr 28 08:29:55 2009
+++ php-src/ext/imap/php_imap.c Thu Apr 30 18:56:25 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.43 2009/04/28 08:29:55 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.44 2009/04/30 18:56:25 pajoye Exp $ */
 
 #define IMAP41
 
@@ -850,7 +850,7 @@
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);
 
/* plug in our gets */
-   mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
+   mail_parameters(NIL, SET_GETS, (void *) NULL);
 
/* set default timeout values */
mail_parameters(NIL, SET_OPENTIMEOUT, (void *) 
FG(default_socket_timeout));
@@ -2330,7 +2330,9 @@
}
 
IMAPG(gets_stream) = writer;
+   mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
mail_fetchbody_full(imap_ptr-imap_stream, msgno, section, NULL, flags);
+   mail_parameters(NIL, SET_GETS, (void *) NULL);
IMAPG(gets_stream) = NULL;
 
if (close_stream) {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c php_imap.h

2009-04-28 Thread Pierre-Alain Joye
pajoye  Tue Apr 28 08:22:57 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c php_imap.h 
  Log:
  - [DOC] add imap_gc (purge cache(s) and constants IMAP_GC_ELT, IMAP_GC_ENV 
and IMAP_GC_TEXTS to control imap_gc behavior
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.41r2=1.208.2.7.2.26.2.42diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.41 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.42
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.41 Mon Apr 27 00:00:42 2009
+++ php-src/ext/imap/php_imap.c Tue Apr 28 08:22:56 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.41 2009/04/27 00:00:42 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.42 2009/04/28 08:22:56 pajoye Exp $ */
 
 #define IMAP41
 
@@ -167,6 +167,11 @@
ZEND_ARG_INFO(0, stream_id)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_gc, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_close, 0, 0, 1)
ZEND_ARG_INFO(0, stream_id)
ZEND_ARG_INFO(0, options)
@@ -468,6 +473,7 @@
PHP_FE(imap_savebody,   
arginfo_imap_savebody)
PHP_FE(imap_fetchheader,
arginfo_imap_fetchheader)
PHP_FE(imap_fetchstructure, 
arginfo_imap_fetchstructure)
+   PHP_FE(imap_gc, 
arginfo_imap_gc)
PHP_FE(imap_expunge,
arginfo_imap_expunge)
PHP_FE(imap_delete, 
arginfo_imap_delete)
PHP_FE(imap_undelete,   
arginfo_imap_undelete)
@@ -1025,6 +1031,15 @@
ENCOTHERunknown
*/
 
+   REGISTER_LONG_CONSTANT(IMAP_GC_ELT, GC_ELT , CONST_PERSISTENT | 
CONST_CS);
+   REGISTER_LONG_CONSTANT(IMAP_GC_ENV, GC_ENV , CONST_PERSISTENT | 
CONST_CS);
+   REGISTER_LONG_CONSTANT(IMAP_GC_TEXTS, GC_TEXTS , CONST_PERSISTENT | 
CONST_CS);
+   /*
+   GC_ELT message cache elements
+   GC_ENV ENVELOPEs and BODYs
+   GC_TEXTS   texts
+   */
+
le_imap = zend_register_list_destructors_ex(mail_close_it, NULL, 
imap, module_number);
return SUCCESS;
 }
@@ -1472,6 +1487,31 @@
 }
 /* }}} */
 
+/* {{{ proto bool imap_gc(resource stream_id, int flags)
+   This function garbage collects (purges) the cache of entries of a specific 
type. */
+PHP_FUNCTION(imap_gc)
+{
+   zval *streamind;
+   pils *imap_le_struct;
+   long flags;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, streamind, 
flags) == FAILURE) {
+   return;
+   }
+
+   if (flags  ((flags  ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the flags parameter);
+   RETURN_FALSE;
+   }
+
+   ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
+
+   mail_gc(imap_le_struct-imap_stream, flags);
+
+   RETURN_TRUE;
+}
+/* }}} */
+
 /* {{{ proto bool imap_close(resource stream_id [, int options])
Close an IMAP stream */
 PHP_FUNCTION(imap_close)
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.h?r1=1.32.2.2.2.1.2.2r2=1.32.2.2.2.1.2.3diff_format=u
Index: php-src/ext/imap/php_imap.h
diff -u php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.2 
php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.3
--- php-src/ext/imap/php_imap.h:1.32.2.2.2.1.2.2Wed Dec 31 11:15:37 2008
+++ php-src/ext/imap/php_imap.h Tue Apr 28 08:22:57 2009
@@ -27,7 +27,7 @@
+--+
  */
 
-/* $Id: php_imap.h,v 1.32.2.2.2.1.2.2 2008/12/31 11:15:37 sebastian Exp $ */
+/* $Id: php_imap.h,v 1.32.2.2.2.1.2.3 2009/04/28 08:22:57 pajoye Exp $ */
 
 #ifndef PHP_IMAP_H
 #define PHP_IMAP_H
@@ -115,6 +115,7 @@
 PHP_FUNCTION(imap_fetchstructure);
 PHP_FUNCTION(imap_fetchbody);
 PHP_FUNCTION(imap_savebody);
+PHP_FUNCTION(imap_gc);
 PHP_FUNCTION(imap_expunge);
 PHP_FUNCTION(imap_delete);
 PHP_FUNCTION(imap_undelete);



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-28 Thread Pierre-Alain Joye
pajoye  Tue Apr 28 08:29:55 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - space to tabs
  - CS
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.42r2=1.208.2.7.2.26.2.43diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.42 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.43
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.42 Tue Apr 28 08:22:56 2009
+++ php-src/ext/imap/php_imap.c Tue Apr 28 08:29:55 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.42 2009/04/28 08:22:56 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.43 2009/04/28 08:29:55 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1530,11 +1530,11 @@
if (argc == 2) {
flags = options;
 
-/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
-if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
- RETURN_FALSE;
-}
+   /* Check that flags is exactly equal to PHP_EXPUNGE or zero */
+   if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
+   RETURN_FALSE;
+   }
 
/* Do the translation from PHP's internal PHP_EXPUNGE define to 
c-client's CL_EXPUNGE */
if (flags  PHP_EXPUNGE) {



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-26 Thread Paul Biggar
HI Pierre,

This looks wrong.

On Sat, Apr 25, 2009 at 4:12 PM, Pierre-Alain Joye paj...@php.net wrote:
 pajoye          Sat Apr 25 15:12:45 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/imap   php_imap.c
  Log:
  - #elif

 @@ -1079,9 +1079,9 @@
  #if HAVE_IMAP2007e
  #define CCLIENTVERSION 2007e
 -#if HAVE_IMAP2007e
 +#elif HAVE_IMAP2007e
  #define CCLIENTVERSION 2007d


Paul

-- 
Paul Biggar
paul.big...@gmail.com

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-26 Thread Pierre-Alain Joye
pajoye  Sun Apr 26 09:42:47 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - correct clause
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.39r2=1.208.2.7.2.26.2.40diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.39 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.40
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.39 Sat Apr 25 16:33:51 2009
+++ php-src/ext/imap/php_imap.c Sun Apr 26 09:42:46 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.39 2009/04/25 16:33:51 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.40 2009/04/26 09:42:46 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1079,7 +1079,7 @@
 #if !defined(CCLIENTVERSION)
 #if HAVE_IMAP2007e
 #define CCLIENTVERSION 2007e
-#elif HAVE_IMAP2007e
+#elif HAVE_IMAP2007d
 #define CCLIENTVERSION 2007d
 #elif HAVE_IMAP2007b
 #define CCLIENTVERSION 2007b



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-26 Thread Pierre-Alain Joye
pajoye  Mon Apr 27 00:00:43 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - remove duplicate definition
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.40r2=1.208.2.7.2.26.2.41diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.40 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.41
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.40 Sun Apr 26 09:42:46 2009
+++ php-src/ext/imap/php_imap.c Mon Apr 27 00:00:42 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.40 2009/04/26 09:42:46 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.41 2009/04/27 00:00:42 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1104,25 +1104,6 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
-#if HAVE_IMAP2007e
-   php_info_print_table_row(2, IMAP c-Client Version, 2007e);
-#elif HAVE_IMAP2007d
-   php_info_print_table_row(2, IMAP c-Client Version, 2007d);
-#elif HAVE_IMAP2007b
-   php_info_print_table_row(2, IMAP c-Client Version, 2007b);
-#elif HAVE_IMAP2007a
-   php_info_print_table_row(2, IMAP c-Client Version, 2007a);
-#elif HAVE_IMAP2004
-   php_info_print_table_row(2, IMAP c-Client Version, 2004);
-#elif HAVE_IMAP2001
-   php_info_print_table_row(2, IMAP c-Client Version, 2001);
-#elif HAVE_IMAP2000
-   php_info_print_table_row(2, IMAP c-Client Version, 2000);
-#elif defined(IMAP41)
-   php_info_print_table_row(2, IMAP c-Client Version, 4.1);
-#else
-   php_info_print_table_row(2, IMAP c-Client Version, 4.0);
-#endif
 #if HAVE_IMAP_SSL
php_info_print_table_row(2, SSL Support, enabled);
 #endif



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 11:21:15 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - bad idea to free body
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.32r2=1.208.2.7.2.26.2.33diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.32 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.33
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.32 Thu Apr 23 22:25:13 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 11:21:14 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.32 2009/04/23 22:25:13 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.33 2009/04/25 11:21:14 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1608,7 +1608,6 @@
} else {
RETVAL_STRINGL(body, body_len, 1);
}
-   free(body);
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 14:59:21 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - silent warning, NULL is not 0
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.33r2=1.208.2.7.2.26.2.34diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.33 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.33 Sat Apr 25 11:21:14 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 14:59:21 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.33 2009/04/25 11:21:14 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1204,7 +1204,7 @@
zval *streamind;
char *mailbox;
int mailbox_len;
-   long options = NULL, retries = NULL;
+   long options = 0, retries = 0;
pils *imap_le_struct; 
MAILSTREAM *imap_stream;
long flags=NIL;
@@ -2857,7 +2857,7 @@
zval *streamind;
char *sequence, *flag;
int sequence_len, flag_len;
-   long flags = NULL;
+   long flags = 0;
pils *imap_le_struct;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|l, 
streamind, sequence, sequence_len, flag, flag_len, flags) == FAILURE) {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:02:36 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFH:  SEARCHPGM struct has to be freed
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.34r2=1.208.2.7.2.26.2.35diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34 Sat Apr 25 14:59:21 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:36 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp $ */
 
 #define IMAP41
 
@@ -3902,6 +3902,7 @@
char *search_criteria;
MESSAGELIST *cur;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
if (zend_parse_parameters(argc TSRMLS_CC, rs|ls, streamind, 
criteria, criteria_len, flags, charset, charset_len) == FAILURE) {
return;
@@ -3912,7 +3913,14 @@
search_criteria = estrndup(criteria, criteria_len);

IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
-   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), mail_criteria(search_criteria), flags);
+   pgm = mail_criteria(search_criteria);
+
+   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), pgm, flags);
+
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
+
if (IMAPG(imap_messages) == NIL) {
efree(search_criteria);
RETURN_FALSE;
@@ -4518,6 +4526,7 @@
char criteria[] = ALL;
THREADNODE *top;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
if (zend_parse_parameters(argc TSRMLS_CC, r|l, streamind, flags) == 
FAILURE) {
return;
@@ -4525,7 +4534,11 @@

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);

-   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, 
mail_criteria(criteria), flags);
+   pgm = mail_criteria(criteria);
+   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, pgm, 
flags);
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
 
if(top == NIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Function returned 
an empty tree);



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:06:34 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - add 2007d and e
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.35r2=1.208.2.7.2.26.2.36diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.36
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35 Sat Apr 25 15:02:36 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:06:34 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.36 2009/04/25 15:06:34 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1077,7 +1077,15 @@
 /* }}} */
 
 #if !defined(CCLIENTVERSION)
-#if HAVE_IMAP2004
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007e
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007d
+#if HAVE_IMAP2007d
+#define CCLIENTVERSION 2007b
+#elif HAVE_IMAP2007a
+#define CCLIENTVERSION 2007a
+#elif HAVE_IMAP2004
 #define CCLIENTVERSION 2004
 #elif HAVE_IMAP2001
 #define CCLIENTVERSION 2001
@@ -1096,6 +1104,10 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
+#if HAVE_IMAP2007e
+   php_info_print_table_row(2, IMAP c-Client Version, 2007e);
+#if HAVE_IMAP2007d
+   php_info_print_table_row(2, IMAP c-Client Version, 2007d);
 #if HAVE_IMAP2007b
php_info_print_table_row(2, IMAP c-Client Version, 2007b);
 #elif HAVE_IMAP2007a



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:08:10 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - ws
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.36r2=1.208.2.7.2.26.2.37diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.36 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.37
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.36 Sat Apr 25 15:06:34 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:08:10 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.36 2009/04/25 15:06:34 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.37 2009/04/25 15:08:10 pajoye Exp $ */
 
 #define IMAP41
 
@@ -2200,7 +2200,7 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
RETURN_FALSE;
}
-   
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if (msgno  1) {



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Jani Taskinen


Isn't this necessary in PHP_5_2? Sounds like a bug fix to me..

--Jani


Pierre-Alain Joye kirjoitti:

pajoye  Sat Apr 25 15:02:36 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap	php_imap.c 
  Log:

  - MFH:  SEARCHPGM struct has to be freed
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.34r2=1.208.2.7.2.26.2.35diff_format=u

Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34 Sat Apr 25 14:59:21 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:36 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp $ */
 
 #define IMAP41
 
@@ -3902,6 +3902,7 @@

char *search_criteria;
MESSAGELIST *cur;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
 	if (zend_parse_parameters(argc TSRMLS_CC, rs|ls, streamind, criteria, criteria_len, flags, charset, charset_len) == FAILURE) {

return;
@@ -3912,7 +3913,14 @@
search_criteria = estrndup(criteria, criteria_len);

IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
-   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), mail_criteria(search_criteria), flags);
+   pgm = mail_criteria(search_criteria);
+
+   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), pgm, flags);
+
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
+
if (IMAPG(imap_messages) == NIL) {
efree(search_criteria);
RETURN_FALSE;
@@ -4518,6 +4526,7 @@
char criteria[] = ALL;
THREADNODE *top;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
 	if (zend_parse_parameters(argc TSRMLS_CC, r|l, streamind, flags) == FAILURE) {

return;
@@ -4525,7 +4534,11 @@

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);

-   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, 
mail_criteria(criteria), flags);
+   pgm = mail_criteria(criteria);
+   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, pgm, 
flags);
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
 
 	if(top == NIL) {

php_error_docref(NULL TSRMLS_CC, E_WARNING, Function returned an 
empty tree);






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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Jani Taskinen


Again, this should be MFH'd to PHP_5_2 as well.

Pierre-Alain Joye kirjoitti:

pajoye  Sat Apr 25 15:06:34 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap	php_imap.c 
  Log:

  - add 2007d and e
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.35r2=1.208.2.7.2.26.2.36diff_format=u

Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.36
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35 Sat Apr 25 15:02:36 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:06:34 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.36 2009/04/25 15:06:34 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1077,7 +1077,15 @@

 /* }}} */
 
 #if !defined(CCLIENTVERSION)

-#if HAVE_IMAP2004
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007e
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007d
+#if HAVE_IMAP2007d
+#define CCLIENTVERSION 2007b
+#elif HAVE_IMAP2007a
+#define CCLIENTVERSION 2007a
+#elif HAVE_IMAP2004
 #define CCLIENTVERSION 2004
 #elif HAVE_IMAP2001
 #define CCLIENTVERSION 2001
@@ -1096,6 +1104,10 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
+#if HAVE_IMAP2007e
+   php_info_print_table_row(2, IMAP c-Client Version, 2007e);
+#if HAVE_IMAP2007d
+   php_info_print_table_row(2, IMAP c-Client Version, 2007d);
 #if HAVE_IMAP2007b
php_info_print_table_row(2, IMAP c-Client Version, 2007b);
 #elif HAVE_IMAP2007a






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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:12:45 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - #elif
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.37r2=1.208.2.7.2.26.2.38diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.37 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.38
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.37 Sat Apr 25 15:08:10 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:12:45 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.37 2009/04/25 15:08:10 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.38 2009/04/25 15:12:45 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1079,9 +1079,9 @@
 #if !defined(CCLIENTVERSION)
 #if HAVE_IMAP2007e
 #define CCLIENTVERSION 2007e
-#if HAVE_IMAP2007e
+#elif HAVE_IMAP2007e
 #define CCLIENTVERSION 2007d
-#if HAVE_IMAP2007d
+#elif HAVE_IMAP2007b
 #define CCLIENTVERSION 2007b
 #elif HAVE_IMAP2007a
 #define CCLIENTVERSION 2007a
@@ -1106,9 +1106,9 @@
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
 #if HAVE_IMAP2007e
php_info_print_table_row(2, IMAP c-Client Version, 2007e);
-#if HAVE_IMAP2007d
+#elif HAVE_IMAP2007d
php_info_print_table_row(2, IMAP c-Client Version, 2007d);
-#if HAVE_IMAP2007b
+#elif HAVE_IMAP2007b
php_info_print_table_row(2, IMAP c-Client Version, 2007b);
 #elif HAVE_IMAP2007a
php_info_print_table_row(2, IMAP c-Client Version, 2007a);



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre Joye
hi Jani,

Yes, I will MFH it as well.

I also like to add mail_gc to 5.2 (coming to 5.3+) to allow one to
purge the cache while processing a large amount of mails (or large
mail) without having to call mail_close. But have to ask Ilia first :)

Cheers,

On Sat, Apr 25, 2009 at 5:11 PM, Jani Taskinen jani.taski...@sci.fi wrote:

 Isn't this necessary in PHP_5_2? Sounds like a bug fix to me..

 --Jani


 Pierre-Alain Joye kirjoitti:

 pajoye          Sat Apr 25 15:02:36 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/imap   php_imap.c  Log:
  - MFH:  SEARCHPGM struct has to be freed

  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.34r2=1.208.2.7.2.26.2.35diff_format=u
 Index: php-src/ext/imap/php_imap.c
 diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34
 php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35
 --- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34     Sat Apr 25
 14:59:21 2009
 +++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:36 2009
 @@ -26,7 +26,7 @@
    | PHP 4.0 updates:  Zeev Suraski z...@zend.com
 |

  +--+
  */
 -/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21 pajoye Exp $
 */
 +/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp $
 */
   #define IMAP41
  @@ -3902,6 +3902,7 @@
        char *search_criteria;
        MESSAGELIST *cur;
        int argc = ZEND_NUM_ARGS();
 +       SEARCHPGM *pgm = NIL;
          if (zend_parse_parameters(argc TSRMLS_CC, rs|ls, streamind,
 criteria, criteria_len, flags, charset, charset_len) == FAILURE) {
                return;
 @@ -3912,7 +3913,14 @@
        search_criteria = estrndup(criteria, criteria_len);

        IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
 -       mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset
 : NIL), mail_criteria(search_criteria), flags);
 +       pgm = mail_criteria(search_criteria);
 +
 +       mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset
 : NIL), pgm, flags);
 +
 +       if (pgm) {
 +               mail_free_searchpgm(pgm);
 +       }
 +
        if (IMAPG(imap_messages) == NIL) {
                efree(search_criteria);
                RETURN_FALSE;
 @@ -4518,6 +4526,7 @@
        char criteria[] = ALL;
        THREADNODE *top;
        int argc = ZEND_NUM_ARGS();
 +       SEARCHPGM *pgm = NIL;
          if (zend_parse_parameters(argc TSRMLS_CC, r|l, streamind,
 flags) == FAILURE) {
                return;
 @@ -4525,7 +4534,11 @@

        ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap,
 le_imap);

 -       top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL,
 mail_criteria(criteria), flags);
 +       pgm = mail_criteria(criteria);
 +       top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL,
 pgm, flags);
 +       if (pgm) {
 +               mail_free_searchpgm(pgm);
 +       }
          if(top == NIL) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, Function
 returned an empty tree);





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





-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Ilia Alshanetsky
I'd prefer to avoid introducing new functionality into 5.2 at this  
point.



Ilia Alshanetsky




On 25-Apr-09, at 11:14 AM, Pierre Joye wrote:


hi Jani,

Yes, I will MFH it as well.

I also like to add mail_gc to 5.2 (coming to 5.3+) to allow one to
purge the cache while processing a large amount of mails (or large
mail) without having to call mail_close. But have to ask Ilia first :)

Cheers,

On Sat, Apr 25, 2009 at 5:11 PM, Jani Taskinen  
jani.taski...@sci.fi wrote:


Isn't this necessary in PHP_5_2? Sounds like a bug fix to me..

--Jani


Pierre-Alain Joye kirjoitti:


pajoye  Sat Apr 25 15:02:36 2009 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/imap   php_imap.c  Log:
 - MFH:  SEARCHPGM struct has to be freed

 
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.34r2=1.208.2.7.2.26.2.35diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34 Sat Apr 25
14:59:21 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:36 2009
@@ -26,7 +26,7 @@
   | PHP 4.0 updates:  Zeev Suraski z...@zend.com
|

  
+ 
--+

 */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21  
pajoye Exp $

*/
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36  
pajoye Exp $

*/
  #define IMAP41
 @@ -3902,6 +3902,7 @@
   char *search_criteria;
   MESSAGELIST *cur;
   int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 if (zend_parse_parameters(argc TSRMLS_CC, rs|ls,  
streamind,
criteria, criteria_len, flags, charset, charset_len) ==  
FAILURE) {

   return;
@@ -3912,7 +3913,14 @@
   search_criteria = estrndup(criteria, criteria_len);

   IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
-   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ?  
charset

: NIL), mail_criteria(search_criteria), flags);
+   pgm = mail_criteria(search_criteria);
+
+   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ?  
charset

: NIL), pgm, flags);
+
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
+
   if (IMAPG(imap_messages) == NIL) {
   efree(search_criteria);
   RETURN_FALSE;
@@ -4518,6 +4526,7 @@
   char criteria[] = ALL;
   THREADNODE *top;
   int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 if (zend_parse_parameters(argc TSRMLS_CC, r|l,  
streamind,

flags) == FAILURE) {
   return;
@@ -4525,7 +4534,11 @@

   ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1,  
imap,

le_imap);

-   top = mail_thread(imap_le_struct-imap_stream,  
REFERENCES, NIL,

mail_criteria(criteria), flags);
+   pgm = mail_criteria(criteria);
+   top = mail_thread(imap_le_struct-imap_stream,  
REFERENCES, NIL,

pgm, flags);
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
 if(top == NIL) {
   php_error_docref(NULL TSRMLS_CC, E_WARNING, Function
returned an empty tree);






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






--
Pierre

http://blog.thepimp.net | http://www.libgd.org

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




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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 16:33:51 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - ws
  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.38r2=1.208.2.7.2.26.2.39diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.38 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.39
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.38 Sat Apr 25 15:12:45 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 16:33:51 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.38 2009/04/25 15:12:45 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.39 2009/04/25 16:33:51 pajoye Exp $ */
 
 #define IMAP41
 
@@ -598,7 +598,7 @@
 static int add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
 {
HashTable *symtable;
-   
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
@@ -613,14 +613,14 @@
 static inline int add_next_index_object(zval *arg, zval *tmp TSRMLS_DC)
 {
HashTable *symtable;
-   
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
symtable = Z_ARRVAL_P(arg);
}
 
-   return zend_hash_next_index_insert(symtable, (void *) tmp, sizeof(zval 
*), NULL); 
+   return zend_hash_next_index_insert(symtable, (void *) tmp, sizeof(zval 
*), NULL);
 }
 /* }}} */
 
@@ -691,7 +691,7 @@
 /* }}} */
 
 /* {{{ mail_newmessagelist
- * 
+ *
  * Mail instantiate MESSAGELIST
  * Returns: new MESSAGELIST list
  * Author: CJH
@@ -722,8 +722,8 @@
 }
 /* }}} */
 
-#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) 
-/* {{{ mail_getquota 
+#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+/* {{{ mail_getquota
  *
  * Mail GET_QUOTA callback
  * Called via the mail_parameter function in c-client:src/c-client/mail.c
@@ -734,7 +734,7 @@
 {
zval *t_map, *return_value;
TSRMLS_FETCH();
-   
+
return_value = *IMAPG(quota_return);
 
 /* put parsing code here */
@@ -829,7 +829,7 @@
 
 #ifndef PHP_WIN32
auth_link(auth_log);   /* link in the log authenticator */
-   auth_link(auth_md5);   /* link in the cram-md5 authenticator */ 
+   auth_link(auth_md5);   /* link in the cram-md5 authenticator */
 #if HAVE_IMAP_KRB  defined(HAVE_IMAP_AUTH_GSS)
auth_link(auth_gss);   /* link in the gss authenticator */
 #endif
@@ -879,13 +879,13 @@
REGISTER_LONG_CONSTANT(OP_SECURE, OP_SECURE, CONST_PERSISTENT | 
CONST_CS);
/* don't do non-secure authentication */
 
-   /* 
+   /*
PHP re-assigns CL_EXPUNGE a custom value that can be used as part of 
the imap_open() bitfield
-   because it seems like a good idea to be able to indicate that the 
mailbox should be 
+   because it seems like a good idea to be able to indicate that the 
mailbox should be
automatically expunged during imap_open in case the script get 
interrupted and it doesn't get
to the imap_close() where this option is normally placed.  If the 
c-client library adds other
-   options and the value for this one conflicts, simply make PHP_EXPUNGE 
higher at the top of 
-   this file 
+   options and the value for this one conflicts, simply make PHP_EXPUNGE 
higher at the top of
+   this file
*/
REGISTER_LONG_CONSTANT(CL_EXPUNGE, PHP_EXPUNGE, CONST_PERSISTENT | 
CONST_CS);
/* expunge silently */
@@ -1143,8 +1143,8 @@
MAILSTREAM *imap_stream;
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
-   
-   if (zend_parse_parameters(argc TSRMLS_CC, sss|ll, mailbox, 
mailbox_len, user, user_len, 
+
+   if (zend_parse_parameters(argc TSRMLS_CC, sss|ll, mailbox, 
mailbox_len, user, user_len,
passwd, passwd_len, flags, retries) == FAILURE) {
return;
}
@@ -1156,17 +1156,17 @@
}
}
 
-   if (IMAPG(imap_user)) { 
+   if (IMAPG(imap_user)) {
efree(IMAPG(imap_user));
}
 
-   if (IMAPG(imap_password)) { 
+   if (IMAPG(imap_password)) {
efree(IMAPG(imap_password));
}
 
/* local filename, need to perform open_basedir and safe_mode checks */
-   if (mailbox[0] != '{'  
-   (php_check_open_basedir(mailbox TSRMLS_CC) || 
+   if (mailbox[0] != '{' 
+   (php_check_open_basedir(mailbox TSRMLS_CC) ||
(PG(safe_mode)  !php_checkuid(mailbox, NULL, 
CHECKUID_CHECK_FILE_AND_DIR {
RETURN_FALSE;
}
@@ -1195,7 +1195,7 @@
 
imap_le_struct = emalloc(sizeof(pils));
imap_le_struct-imap_stream = imap_stream;
-   imap_le_struct-flags 

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-25 Thread Pierre Joye
k :)

On Sat, Apr 25, 2009 at 6:03 PM, Ilia Alshanetsky i...@prohost.org wrote:
 I'd prefer to avoid introducing new functionality into 5.2 at this point.


 Ilia Alshanetsky




 On 25-Apr-09, at 11:14 AM, Pierre Joye wrote:

 hi Jani,

 Yes, I will MFH it as well.

 I also like to add mail_gc to 5.2 (coming to 5.3+) to allow one to
 purge the cache while processing a large amount of mails (or large
 mail) without having to call mail_close. But have to ask Ilia first :)

 Cheers,

 On Sat, Apr 25, 2009 at 5:11 PM, Jani Taskinen jani.taski...@sci.fi
 wrote:

 Isn't this necessary in PHP_5_2? Sounds like a bug fix to me..

 --Jani


 Pierre-Alain Joye kirjoitti:

 pajoye          Sat Apr 25 15:02:36 2009 UTC

  Modified files:              (Branch: PHP_5_3)
   /php-src/ext/imap   php_imap.c  Log:
  - MFH:  SEARCHPGM struct has to be freed


  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.34r2=1.208.2.7.2.26.2.35diff_format=u
 Index: php-src/ext/imap/php_imap.c
 diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34
 php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.35
 --- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.34     Sat Apr 25
 14:59:21 2009
 +++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:36 2009
 @@ -26,7 +26,7 @@
   | PHP 4.0 updates:  Zeev Suraski z...@zend.com
 |


  +--+
  */
 -/* $Id: php_imap.c,v 1.208.2.7.2.26.2.34 2009/04/25 14:59:21 pajoye Exp
 $
 */
 +/* $Id: php_imap.c,v 1.208.2.7.2.26.2.35 2009/04/25 15:02:36 pajoye Exp
 $
 */
  #define IMAP41
  @@ -3902,6 +3902,7 @@
       char *search_criteria;
       MESSAGELIST *cur;
       int argc = ZEND_NUM_ARGS();
 +       SEARCHPGM *pgm = NIL;
         if (zend_parse_parameters(argc TSRMLS_CC, rs|ls, streamind,
 criteria, criteria_len, flags, charset, charset_len) == FAILURE) {
               return;
 @@ -3912,7 +3913,14 @@
       search_criteria = estrndup(criteria, criteria_len);

       IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
 -       mail_search_full(imap_le_struct-imap_stream, (argc == 4 ?
 charset
 : NIL), mail_criteria(search_criteria), flags);
 +       pgm = mail_criteria(search_criteria);
 +
 +       mail_search_full(imap_le_struct-imap_stream, (argc == 4 ?
 charset
 : NIL), pgm, flags);
 +
 +       if (pgm) {
 +               mail_free_searchpgm(pgm);
 +       }
 +
       if (IMAPG(imap_messages) == NIL) {
               efree(search_criteria);
               RETURN_FALSE;
 @@ -4518,6 +4526,7 @@
       char criteria[] = ALL;
       THREADNODE *top;
       int argc = ZEND_NUM_ARGS();
 +       SEARCHPGM *pgm = NIL;
         if (zend_parse_parameters(argc TSRMLS_CC, r|l, streamind,
 flags) == FAILURE) {
               return;
 @@ -4525,7 +4534,11 @@

       ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1,
 imap,
 le_imap);

 -       top = mail_thread(imap_le_struct-imap_stream, REFERENCES,
 NIL,
 mail_criteria(criteria), flags);
 +       pgm = mail_criteria(criteria);
 +       top = mail_thread(imap_le_struct-imap_stream, REFERENCES,
 NIL,
 pgm, flags);
 +       if (pgm) {
 +               mail_free_searchpgm(pgm);
 +       }
         if(top == NIL) {
               php_error_docref(NULL TSRMLS_CC, E_WARNING, Function
 returned an empty tree);





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





 --
 Pierre

 http://blog.thepimp.net | http://www.libgd.org

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






-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-04-23 Thread Pierre-Alain Joye
pajoye  Thu Apr 23 22:25:13 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFH: #47940,  leaks in imap_body()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.31r2=1.208.2.7.2.26.2.32diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.31 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.32
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.31 Thu Jan  8 16:13:51 2009
+++ php-src/ext/imap/php_imap.c Thu Apr 23 22:25:13 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.31 2009/01/08 16:13:51 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.32 2009/04/23 22:25:13 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1575,6 +1575,8 @@
long msgno, flags = 0;
pils *imap_le_struct; 
int msgindex, argc = ZEND_NUM_ARGS();
+   char *body;
+   unsigned long body_len = 0;
 
if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
@@ -1600,7 +1602,13 @@
RETURN_FALSE;
}
 
-   RETVAL_STRING(mail_fetchtext_full(imap_le_struct-imap_stream, msgno, 
NIL, (argc == 3 ? flags : NIL)), 1);
+   body = mail_fetchtext_full (imap_le_struct-imap_stream, msgno, 
body_len, (argc == 3 ? flags : NIL));
+   if (body_len == 0) {
+   RETVAL_EMPTY_STRING();
+   } else {
+   RETVAL_STRINGL(body, body_len, 1);
+   }
+   free(body);
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-01-08 Thread Ilia Alshanetsky
iliaa   Thu Jan  8 16:13:52 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  
  Improved parameter fixing  address a compiler warning
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.30r2=1.208.2.7.2.26.2.31diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.30 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.31
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.30 Wed Jan  7 18:26:27 2009
+++ php-src/ext/imap/php_imap.c Thu Jan  8 16:13:51 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.30 2009/01/07 18:26:27 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.31 2009/01/08 16:13:51 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1204,20 +1204,19 @@
zval *streamind;
char *mailbox;
int mailbox_len;
-   long options, retries;
+   long options = NULL, retries = NULL;
pils *imap_le_struct; 
MAILSTREAM *imap_stream;
long flags=NIL;
long cl_flags=NIL;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rs|ll, streamind, 
mailbox, mailbox_len, options, retries) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|ll, 
streamind, mailbox, mailbox_len, options, retries) == FAILURE) {
return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
-   if (argc = 3) {
+   if (options) {
flags = options;
if (flags  PHP_EXPUNGE) {
cl_flags = CL_EXPUNGE;
@@ -1226,7 +1225,7 @@
imap_le_struct-flags = cl_flags;   
}
 #ifdef SET_MAXLOGINTRIALS
-   if (argc == 4) {
+   if (retries) {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries);
}
 #endif
@@ -1256,9 +1255,8 @@
int folder_len, message_len, flags_len = 0;
pils *imap_le_struct;
STRING st;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rss|s, streamind, folder, 
folder_len, message, message_len, flags, flags_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|s, 
streamind, folder, folder_len, message, message_len, flags, flags_len) 
== FAILURE) {
return;
}
   
@@ -1266,7 +1264,7 @@
 
INIT (st, mail_string, (void *) message, message_len);
 
-   if (mail_append_full(imap_le_struct-imap_stream, folder, (argc == 4 ? 
flags : NIL), NIL, st)) {
+   if (mail_append_full(imap_le_struct-imap_stream, folder, (flags ? 
flags : NIL), NIL, st)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2852,17 +2850,16 @@
zval *streamind;
char *sequence, *flag;
int sequence_len, flag_len;
-   long flags;
+   long flags = NULL;
pils *imap_le_struct;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rss|l, streamind, 
sequence, sequence_len, flag, flag_len, flags) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|l, 
streamind, sequence, sequence_len, flag, flag_len, flags) == FAILURE) {
return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
-   mail_setflag_full(imap_le_struct-imap_stream, sequence, flag, (argc == 
4 ? flags : NIL));
+   mail_setflag_full(imap_le_struct-imap_stream, sequence, flag, (flags ? 
flags : NIL));
RETURN_TRUE;
 }
 /* }}} */
@@ -4103,34 +4100,6 @@
 }
 /* }}} */
 
-/* {{{ _php_rfc822_len
- * Calculate string length based on imap's rfc822_cat function.
- */
-static int _php_rfc822_len(char *str)
-{
-   int len;
-   char *p;
-
-   if (!str || !*str) {
-   return 0;
-   }
-
-   /* strings with special characters will need to be quoted, as a safety 
measure we
-* add 2 bytes for the quotes just in case.
-*/
-   len = strlen(str) + 2;
-   p = str;
-   /* rfc822_cat() will escape all  and \ characters, therefor we need to 
increase
-* our buffer length to account for these characters.
-*/
-   while ((p = strpbrk(p, \\\))) {
-   p++;
-   len++;
-   }
-
-   return len;
-}
-/* }}} */
 
 /* Support Functions */
 
@@ -4170,6 +4139,35 @@
 
 #else
 
+/* {{{ _php_rfc822_len
+ * Calculate string length based on imap's rfc822_cat function.
+ */
+static int _php_rfc822_len(char *str)
+{
+   int len;
+   char *p;
+
+   if (!str || !*str) {
+   return 0;
+   }
+
+   /* strings with special characters will need to be quoted, as a safety 
measure we
+* add 2 bytes for 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2009-01-07 Thread Felipe Pena
felipe  Wed Jan  7 18:26:27 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFH: Fixed duplicate errmsg
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.29r2=1.208.2.7.2.26.2.30diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.29 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.30
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.29 Wed Dec 31 11:15:37 2008
+++ php-src/ext/imap/php_imap.c Wed Jan  7 18:26:27 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.29 2008/12/31 11:15:37 sebastian Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.30 2009/01/07 18:26:27 felipe Exp $ */
 
 #define IMAP41
 
@@ -1212,7 +1212,7 @@
int argc = ZEND_NUM_ARGS();
 
if (zend_parse_parameters(argc TSRMLS_CC, rs|ll, streamind, 
mailbox, mailbox_len, options, retries) == FAILURE) {
-   ZEND_WRONG_PARAM_COUNT();
+   return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-12-24 Thread Felipe Pena
felipe  Wed Dec 24 13:31:17 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFH: Fixed memory leak in imap_rfc822_parse_adrlist
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.27r2=1.208.2.7.2.26.2.28diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.27 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.28
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.27 Tue Dec 16 21:35:01 2008
+++ php-src/ext/imap/php_imap.c Wed Dec 24 13:31:16 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.27 2008/12/16 21:35:01 zoe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.28 2008/12/24 13:31:16 felipe Exp $ */
 
 #define IMAP41
 
@@ -2524,6 +2524,8 @@
}
add_next_index_object(return_value, tovals TSRMLS_CC);
} while ((addresstmp = addresstmp-next));
+   
+   mail_free_envelope(env);
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-12-16 Thread Zoe Slattery
zoe Tue Dec 16 21:10:16 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46884 fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.25r2=1.208.2.7.2.26.2.26diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.25 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.26
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.25 Wed Dec  3 16:52:04 2008
+++ php-src/ext/imap/php_imap.c Tue Dec 16 21:10:16 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.25 2008/12/03 16:52:04 zoe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.26 2008/12/16 21:10:16 zoe Exp $ */
 
 #define IMAP41
 
@@ -1575,6 +1575,11 @@
return;
}
 
+   if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if ((argc == 3)  (flags  FT_UID)) {
@@ -2166,6 +2171,11 @@
if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
}
+
+   if (flags  ((flags  ~FT_UID) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2211,6 +2221,11 @@
if (zend_parse_parameters(argc TSRMLS_CC, rls|l, streamind, msgno, 
sec, sec_len, flags) == FAILURE) {
return;
}
+   
+   if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2930,13 +2945,18 @@
 PHP_FUNCTION(imap_fetchheader)
 {
zval *streamind;
-   long msgno, flags;
+   long msgno, flags=0L;
pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();

if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
}
+
+   if (flags  ((flags  ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);




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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-12-16 Thread Zoe Slattery
zoe Tue Dec 16 21:35:01 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46837 fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.26r2=1.208.2.7.2.26.2.27diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.26 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.27
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.26 Tue Dec 16 21:10:16 2008
+++ php-src/ext/imap/php_imap.c Tue Dec 16 21:35:01 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.26 2008/12/16 21:10:16 zoe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.27 2008/12/16 21:35:01 zoe Exp $ */
 
 #define IMAP41
 
@@ -1498,6 +1498,13 @@
 
if (argc == 2) {
flags = options;
+
+/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
+if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
+ RETURN_FALSE;
+} 
+
/* Do the translation from PHP's internal PHP_EXPUNGE define to 
c-client's CL_EXPUNGE */
if (flags  PHP_EXPUNGE) {
flags ^= PHP_EXPUNGE;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-12-03 Thread Zoe Slattery
zoe Wed Dec  3 16:52:05 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46731 modification to previous fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.24r2=1.208.2.7.2.26.2.25diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.24 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.25
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.24 Wed Dec  3 01:04:13 2008
+++ php-src/ext/imap/php_imap.c Wed Dec  3 16:52:04 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.24 2008/12/03 01:04:13 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.25 2008/12/03 16:52:04 zoe Exp $ */
 
 #define IMAP41
 
@@ -3174,7 +3174,7 @@
return;
}
 
-   if (flags  !(flags  FT_UID)) {
+   if (flags  ((flags  ~FT_UID) !=0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
RETURN_FALSE;
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-10-05 Thread Ilia Alshanetsky
iliaa   Mon Oct  6 01:18:54 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed a few signedness warnings
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.18r2=1.208.2.7.2.26.2.19diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.18 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.19
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.18 Mon Aug  4 21:14:28 2008
+++ php-src/ext/imap/php_imap.c Mon Oct  6 01:18:54 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.18 2008/08/04 21:14:28 jani Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.19 2008/10/06 01:18:54 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2753,7 +2753,7 @@
 #if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%d] != 
outlen [%d], outp - out, outlen);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%ld] 
!= outlen [%d], outp - out, outlen);
}
 #endif
 
@@ -2870,7 +2870,7 @@
 #if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%d] != 
outlen [%d], outp - out, outlen);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%ld] 
!= outlen [%d], outp - out, outlen);
}
 #endif
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-08-04 Thread Jani Taskinen
janiMon Aug  4 20:51:46 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  MFH: Add proper version check (new c-clients have this)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.16r2=1.208.2.7.2.26.2.17diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.16 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.17
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.16 Fri Jul 11 11:27:32 2008
+++ php-src/ext/imap/php_imap.c Mon Aug  4 20:51:46 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.16 2008/07/11 11:27:32 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.17 2008/08/04 20:51:46 jani Exp $ */
 
 #define IMAP41
 
@@ -1137,12 +1137,26 @@
 }
 /* }}} */
 
+#if !defined(CCLIENTVERSION)
+#if HAVE_IMAP2004
+#define CCLIENTVERSION 2004
+#elif HAVE_IMAP2001
+#define CCLIENTVERSION 2001
+#elif HAVE_IMAP2000
+#define CCLIENTVERSION 2000
+#elif defined(IMAP41)
+#define CCLIENTVERSION 4.1
+#else
+#define CCLIENTVERSION 4.0
+#endif
+#endif
 
 /* {{{ PHP_MINFO_FUNCTION
  */
 PHP_MINFO_FUNCTION(imap)
 {
php_info_print_table_start();
+   php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
 #if HAVE_IMAP2007b
php_info_print_table_row(2, IMAP c-Client Version, 2007b);
 #elif HAVE_IMAP2007a



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c /ext/imap/tests bug45705_1.phpt bug45705_2.phpt

2008-08-04 Thread Jani Taskinen
janiMon Aug  4 21:14:28 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/imap/tests bug45705_1.phpt bug45705_2.phpt 

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFH:- Fixed bug #45705 (rfc822_parse_adrlist() modifies passed address 
parameter)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.17r2=1.208.2.7.2.26.2.18diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.17 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.18
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.17 Mon Aug  4 20:51:46 2008
+++ php-src/ext/imap/php_imap.c Mon Aug  4 21:14:28 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.17 2008/08/04 20:51:46 jani Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.18 2008/08/04 21:14:28 jani Exp $ */
 
 #define IMAP41
 
@@ -2527,7 +2527,7 @@
 PHP_FUNCTION(imap_rfc822_parse_adrlist)
 {
zval *tovals;
-   char *str, *defaulthost;
+   char *str, *defaulthost, *str_copy;
int str_len, defaulthost_len;
ADDRESS *addresstmp;
ENVELOPE *env;
@@ -2538,7 +2538,10 @@
 
env = mail_newenvelope();
 
-   rfc822_parse_adrlist(env-to, str, defaulthost);
+   /* rfc822_parse_adrlist() modifies passed string. Copy it. */
+   str_copy = estrndup(str, str_len);
+   rfc822_parse_adrlist(env-to, str_copy, defaulthost);
+   efree(str_copy);
 
array_init(return_value);
 
@@ -3307,53 +3310,58 @@
BODY *bod=NULL, *topbod=NULL;
PART *mypart=NULL, *part;
PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, 
*tmp_param = NULL;
-   char *tmp=NULL, *mystring=NULL, *t=NULL, *tempstring=NULL;
+   char *tmp=NULL, *mystring=NULL, *t=NULL, *tempstring=NULL, *str_copy = 
NULL;
int toppart = 0;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, aa, envelope, 
body) == FAILURE) {
return;
}
 
+#define PHP_RFC822_PARSE_ADRLIST(target, value) \
+   str_copy = estrndup(Z_STRVAL_PP(value), Z_STRLEN_PP(value)); \
+   rfc822_parse_adrlist(target, str_copy, NO HOST); \
+   efree(str_copy);
+
env = mail_newenvelope();
if (zend_hash_find(Z_ARRVAL_P(envelope), remail, sizeof(remail), 
(void **) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   env-remail=cpystr(Z_STRVAL_PP(pvalue));
+   env-remail = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_P(envelope), return_path, 
sizeof(return_path), (void **) pvalue)== SUCCESS) {
-   convert_to_string_ex(pvalue)
-   rfc822_parse_adrlist(env-return_path, Z_STRVAL_PP(pvalue), 
NO HOST);
+   convert_to_string_ex(pvalue);
+   PHP_RFC822_PARSE_ADRLIST(env-return_path, pvalue);
}
if (zend_hash_find(Z_ARRVAL_P(envelope), date, sizeof(date), (void 
**) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   env-date=cpystr(Z_STRVAL_PP(pvalue));
+   env-date = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_P(envelope), from, sizeof(from), (void 
**) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   rfc822_parse_adrlist (env-from, Z_STRVAL_PP(pvalue), NO 
HOST);
+   PHP_RFC822_PARSE_ADRLIST(env-from, pvalue);
}
if (zend_hash_find(Z_ARRVAL_P(envelope), reply_to, 
sizeof(reply_to), (void **) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   rfc822_parse_adrlist (env-reply_to, Z_STRVAL_PP(pvalue), NO 
HOST);
+   PHP_RFC822_PARSE_ADRLIST(env-reply_to, pvalue);
}
if (zend_hash_find(Z_ARRVAL_P(envelope), in_reply_to, 
sizeof(in_reply_to), (void **) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   env-in_reply_to=cpystr(Z_STRVAL_PP(pvalue));
+   env-in_reply_to = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_P(envelope), subject, sizeof(subject), 
(void **) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   env-subject=cpystr(Z_STRVAL_PP(pvalue));
+   env-subject = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_P(envelope), to, sizeof(to), (void **) 
pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   rfc822_parse_adrlist (env-to, Z_STRVAL_PP(pvalue), NO HOST);
+   PHP_RFC822_PARSE_ADRLIST(env-to, pvalue);
}
if (zend_hash_find(Z_ARRVAL_P(envelope), cc, sizeof(cc), (void **) 
pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
-   rfc822_parse_adrlist (env-cc, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-07-11 Thread Felipe Pena
felipe  Fri Jul 11 11:27:32 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: - Fixed the strings size in imap_headerinfo
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.15r2=1.208.2.7.2.26.2.16diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.15 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.16
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.15 Thu Jul 10 17:50:51 2008
+++ php-src/ext/imap/php_imap.c Fri Jul 11 11:27:32 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.15 2008/07/10 17:50:51 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.16 2008/07/11 11:27:32 felipe Exp $ */
 
 #define IMAP41
 
@@ -1968,7 +1968,7 @@
pils *imap_le_struct;
MESSAGECACHE *cache;
ENVELOPE *en;
-   char dummy[2000], fulladdress[MAILTMPLEN];
+   char dummy[2000], fulladdress[MAILTMPLEN + 1];

if (zend_parse_parameters(argc TSRMLS_CC, rl|lls, streamind, msgno, 
fromlength, subjectlength, defaulthost, defaulthost_len) == FAILURE) {
return;



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-07-10 Thread Felipe Pena
felipe  Thu Jul 10 17:50:51 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - MFB: Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo 
doesn't accept lengths of 1024)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.14r2=1.208.2.7.2.26.2.15diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.14 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.15
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.14 Mon Jul  7 17:18:43 2008
+++ php-src/ext/imap/php_imap.c Thu Jul 10 17:50:51 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.14 2008/07/07 17:18:43 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.15 2008/07/10 17:50:51 felipe Exp $ */
 
 #define IMAP41
 
@@ -1977,16 +1977,16 @@
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if (argc = 3) {
-   if (fromlength  0 || fromlength = MAILTMPLEN) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be between 1 and %i, MAILTMPLEN);
+   if (fromlength  0 || fromlength  MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be between 0 and %d, MAILTMPLEN);
RETURN_FALSE;
}
} else {
fromlength = 0x00;
}
if (argc = 4) {
-   if (subjectlength  0 || subjectlength = MAILTMPLEN) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be between 1 and %i, MAILTMPLEN);
+   if (subjectlength  0 || subjectlength  MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be between 0 and %d, MAILTMPLEN);
RETURN_FALSE;
}
} else {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-07-07 Thread Felipe Pena
felipe  Mon Jul  7 17:18:43 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - Added arginfo
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.13r2=1.208.2.7.2.26.2.14diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.13 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.14
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.13 Wed Jul  2 17:56:19 2008
+++ php-src/ext/imap/php_imap.c Mon Jul  7 17:18:43 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.13 2008/07/02 17:56:19 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.14 2008/07/07 17:18:43 felipe Exp $ */
 
 #define IMAP41
 
@@ -96,84 +96,498 @@
 ZEND_DECLARE_MODULE_GLOBALS(imap)
 static PHP_GINIT_FUNCTION(imap);
 
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, user)
+   ZEND_ARG_INFO(0, password)
+   ZEND_ARG_INFO(0, options)
+   ZEND_ARG_INFO(0, n_retries)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_reopen, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+   ZEND_ARG_INFO(0, n_retries)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_append, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, folder)
+   ZEND_ARG_INFO(0, message)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_msg, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_ping, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_recent, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quota, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, qroot)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quotaroot, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_set_quota, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, qroot)
+   ZEND_ARG_INFO(0, mailbox_size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setacl, 0, 0, 4)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, id)
+   ZEND_ARG_INFO(0, rights)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getacl, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_close, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_headers, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_body, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, msg_no)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_copy, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, msglist)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_move, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, sequence)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_createmailbox, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_renamemailbox, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, old_name)
+   ZEND_ARG_INFO(0, new_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_deletemailbox, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_list, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, ref)
+   ZEND_ARG_INFO(0, pattern)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getmailboxes, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, ref)
+   ZEND_ARG_INFO(0, pattern)
+ZEND_END_ARG_INFO()
+
+static

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-06-10 Thread Philip Olson
philip  Wed Jun 11 02:32:22 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  MFH: fixed imap_listscan() proto
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.10r2=1.208.2.7.2.26.2.11diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.10 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.11
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.10 Thu Apr 17 11:08:13 2008
+++ php-src/ext/imap/php_imap.c Wed Jun 11 02:32:22 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.10 2008/04/17 11:08:13 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.11 2008/06/11 02:32:22 philip Exp $ */
 
 #define IMAP41
 
@@ -1457,7 +1457,7 @@
 }
 /* }}} */
 
-/* {{{ proto array imap_scan(resource stream_id, string ref, string pattern, 
string content)
+/* {{{ proto array imap_listscan(resource stream_id, string ref, string 
pattern, string content)
Read list of mailboxes containing a certain string */
 PHP_FUNCTION(imap_listscan)
 {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-04-17 Thread Felipe Pena
felipe  Thu Apr 17 11:08:13 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed typo
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.9r2=1.208.2.7.2.26.2.10diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.9 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.10
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.9  Tue Apr  8 00:01:48 2008
+++ php-src/ext/imap/php_imap.c Thu Apr 17 11:08:13 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.9 2008/04/08 00:01:48 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.10 2008/04/17 11:08:13 felipe Exp $ */
 
 #define IMAP41
 
@@ -798,7 +798,7 @@
 #ifdef SET_MAXLOGINTRIALS
if (myargc == 5) {
convert_to_long_ex(retries);
-   if (retries  0) {
+   if (Z_LVAL_PP(retries)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or equal to 0);
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-04-07 Thread Ilia Alshanetsky
iliaa   Tue Apr  8 00:01:48 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  
  Fixed bug #44663 (Crash in imap_mail_compose if body parameter invalid)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.8r2=1.208.2.7.2.26.2.9diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.8 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.9
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.8  Wed Apr  2 16:26:39 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  8 00:01:48 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.8 2008/04/02 16:26:39 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.9 2008/04/08 00:01:48 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3047,8 +3047,8 @@
}
 
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body));
-   if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) data) != 
SUCCESS) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, body parameter 
cannot be empty);
+   if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) data) != 
SUCCESS || Z_TYPE_PP(data) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, body parameter 
must be a non-empty array);
RETURN_FALSE;
}
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-04-01 Thread Ilia Alshanetsky
iliaa   Tue Apr  1 18:28:45 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #44594 (imap_open() does not validate # of retries parameter)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.5r2=1.208.2.7.2.26.2.6diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.5 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.6
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.5  Fri Mar 28 16:45:05 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  1 18:28:45 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.5 2008/03/28 16:45:05 felipe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.6 2008/04/01 18:28:45 iliaa Exp $ */
 
 #define IMAP41
 
@@ -798,7 +798,11 @@
 #ifdef SET_MAXLOGINTRIALS
if (myargc == 5) {
convert_to_long_ex(retries);
-   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   if (retries  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or eqaul to 0);
+   } else {
+   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   }
}
 #endif
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-04-01 Thread Felipe Pena
felipe  Tue Apr  1 18:48:11 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  Typo
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.6r2=1.208.2.7.2.26.2.7diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.6 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.7
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.6  Tue Apr  1 18:28:45 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  1 18:48:11 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.6 2008/04/01 18:28:45 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.7 2008/04/01 18:48:11 felipe Exp $ */
 
 #define IMAP41
 
@@ -799,7 +799,7 @@
if (myargc == 5) {
convert_to_long_ex(retries);
if (retries  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or eqaul to 0);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or equal to 0);
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/imap php_imap.c

2008-01-31 Thread Nuno Lopes
nlopess Thu Jan 31 18:46:03 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/imap   php_imap.c 
  Log:
  try to fix build with gcc 4: take #2
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.2r2=1.208.2.7.2.26.2.3diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.2 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.3
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.2  Mon Dec 31 07:17:09 2007
+++ php-src/ext/imap/php_imap.c Thu Jan 31 18:46:03 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.2 2007/12/31 07:17:09 sebastian Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.3 2008/01/31 18:46:03 nlopess Exp $ */
 
 #define IMAP41
 
@@ -66,6 +66,12 @@
 #define SENDBUFLEN 16385
 #endif
 
+#if defined(__GNUC__)  __GNUC__ = 4
+# define PHP_IMAP_EXPORT __attribute__ ((visibility(default)))
+#else
+# define PHP_IMAP_EXPORT
+#endif
+
 static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC);
 static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC);
 static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, 
zval *paddress TSRMLS_DC);
@@ -4332,7 +4338,7 @@
 
 /* {{{ Interfaces to C-client 
  */
-void mm_searched(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number)
 {
MESSAGELIST *cur = NIL;
TSRMLS_FETCH();
@@ -4352,20 +4358,20 @@
}
 }
 
-void mm_exists(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_exists(MAILSTREAM *stream, unsigned long number)
 {
 }
 
-void mm_expunged(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_expunged(MAILSTREAM *stream, unsigned long number)
 {
 }
 
-void mm_flags(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number)
 {
 }
 
 /* Author: CJH */
-void mm_notify(MAILSTREAM *stream, char *str, long errflg)
+PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg)
 {
STRINGLIST *cur = NIL;
TSRMLS_FETCH();
@@ -4388,7 +4394,7 @@
}
 }
 
-void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long 
attributes)
+PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char 
*mailbox, long attributes)
 {
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
@@ -4435,7 +4441,7 @@
}
 }
 
-void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long 
attributes)
+PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char 
*mailbox, long attributes)
 {
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
@@ -4479,7 +4485,7 @@
}
 }
 
-void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
+PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS 
*status)
 {
TSRMLS_FETCH();
 
@@ -4501,7 +4507,7 @@
}
 }
 
-void mm_log(char *str, long errflg)
+PHP_IMAP_EXPORT void mm_log(char *str, long errflg)
 {
ERRORLIST *cur = NIL;
TSRMLS_FETCH();
@@ -4527,14 +4533,14 @@
}
 }
 
-void mm_dlog(char *str)
+PHP_IMAP_EXPORT void mm_dlog(char *str)
 {
/* CJH: this is for debugging; it might be useful to allow setting
   the stream to debug mode and capturing this somewhere - syslog?
   php debugger? */
 }
 
-void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
+PHP_IMAP_EXPORT void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
 {
TSRMLS_FETCH();
 
@@ -4546,20 +4552,20 @@
strlcpy (pwd, IMAPG(imap_password), MAILTMPLEN);
 }
 
-void mm_critical(MAILSTREAM *stream)
+PHP_IMAP_EXPORT void mm_critical(MAILSTREAM *stream)
 {
 }
 
-void mm_nocritical(MAILSTREAM *stream)
+PHP_IMAP_EXPORT void mm_nocritical(MAILSTREAM *stream)
 {
 }
 
-long mm_diskerror(MAILSTREAM *stream, long errcode, long serious)
+PHP_IMAP_EXPORT long mm_diskerror(MAILSTREAM *stream, long errcode, long 
serious)
 {
return 1;
 }
 
-void mm_fatal(char *str)
+PHP_IMAP_EXPORT void mm_fatal(char *str)
 {
 }
 /* }}} */

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