cvs: php-src(PHP_5_1) /ext/imap php_imap.c
| From: | Michael Wallner | Date: | Fri, 27 Jan 2006 20:18:03 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/imap php_imap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-36648@lists.php.net to get a copy of this message | ||
mike Fri Jan 27 20:18:03 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/imap php_imap.c
Log:
- fix imap_fetchbody(); there is no default mailgets()
http://cvs.php.net/viewcvs.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.5&r2=1.208.2.6&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.5 php-src/ext/imap/php_imap.c:1.208.2.6
--- php-src/ext/imap/php_imap.c:1.208.2.5 Fri Jan 27 19:46:11 2006
+++ php-src/ext/imap/php_imap.c Fri Jan 27 20:18:03 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.208.2.5 2006/01/27 19:46:11 mike Exp $ */
+/* $Id: php_imap.c,v 1.208.2.6 2006/01/27 20:18:03 mike Exp $ */
#define IMAP41
@@ -68,8 +68,6 @@
static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, zval *paddress
TSRMLS_DC);
static int _php_imap_address_size(ADDRESS *addresslist);
-/* c-clients gets */
-static mailgets_t old_mail_gets;
/* the gets we use */
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md);
@@ -469,7 +467,6 @@
REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_CS);
/* plug in our gets */
- old_mail_gets = mail_parameters(NIL, GET_GETS, NIL);
mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
/* set default timeout values */
@@ -4243,7 +4240,16 @@
}
return NULL;
} else {
- return old_mail_gets(f, stream, size, md);
+ char *buf = malloc(size + 1);
+
+ if (f(stream, size, buf)) {
+ buf[size] = '\0';
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
+ efree(buf);
+ buf = NULL;
+ }
+ return buf;
}
}
/* }}} */