Skip to content

Commit

Permalink
Max packets must be >1, and don't use hard-coded values
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Oct 4, 2013
1 parent e32a65e commit 6729ea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ PHP_METHOD(Mosquitto_Client, unsubscribe)
PHP_METHOD(Mosquitto_Client, loop)
{
mosquitto_client_object *object;
long timeout = 1000, max_packets = 0, retval = 0;
long timeout = 1000, max_packets = 1, retval = 0;
char *message = NULL;

PHP_MOSQUITTO_ERROR_HANDLING();
Expand All @@ -337,7 +337,7 @@ PHP_METHOD(Mosquitto_Client, loop)
PHP_MOSQUITTO_RESTORE_ERRORS();

object = (mosquitto_client_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
retval = mosquitto_loop(object->client, 1000, 1);
retval = mosquitto_loop(object->client, timeout, max_packets);
php_mosquitto_handle_errno(retval, errno);
}
/* }}} */
Expand Down

0 comments on commit 6729ea5

Please sign in to comment.