Avoid too many call to php_pollfd_for_ms (this fix SSL connection problem)

v1.1
Pierrick Charron 2010-08-12 03:21:53 +00:00
parent cc688cd647
commit e4b0c389d6
1 changed files with 6 additions and 11 deletions

17
stomp.c
View File

@ -294,17 +294,7 @@ int stomp_send(stomp_t *stomp, stomp_frame_t *frame TSRMLS_DC)
*/
int stomp_recv(stomp_t *stomp, char *msg, size_t length)
{
int n, len;
n = php_pollfd_for_ms(stomp->fd, PHP_POLLREADABLE, stomp->options.read_timeout_sec * 1000 + stomp->options.read_timeout_usec);
if (n < 1) {
#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}
#endif
return -1;
}
int len;
#if HAVE_STOMP_SSL
if(stomp->options.use_ssl) {
@ -460,6 +450,11 @@ stomp_frame_t *stomp_read_frame(stomp_t *stomp)
char *cmd = NULL, *length_str = NULL;
int length = 0;
if (!stomp_select(stomp))
{
return NULL;
}
INIT_STOMP_FRAME(f);
if (NULL == f) {