Skip to content

Commit

Permalink
Make QoS and retain optional on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Oct 20, 2013
1 parent 4ea1124 commit adac167
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ disconnection from the broker. Must be called before connect().
| --- | --- | ---- |
| topic | string | The topic on which to publish the will. |
| payload | string | The data to send. |
| qos | int | Integer 0, 1, or 2 indicating the Quality of Service to be used. |
| retain | boolean | If true, the message will be retained. |
| qos | int | Optional. Default 0. Integer 0, 1, or 2 indicating the Quality of Service to be used. |
| retain | boolean | Optional. Default false. If true, the message will be retained. |

#### clearWill

Expand Down
6 changes: 3 additions & 3 deletions mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ PHP_METHOD(Mosquitto_Client, publish)
{
mosquitto_client_object *object;
int mid, topic_len, payload_len, retval;
long qos;
zend_bool retain;
long qos = 0;
zend_bool retain = 0;
char *topic, *payload;

PHP_MOSQUITTO_ERROR_HANDLING();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sslb",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|lb",
&topic, &topic_len, &payload, &payload_len, &qos, &retain) == FAILURE) {
PHP_MOSQUITTO_RESTORE_ERRORS();
return;
Expand Down

0 comments on commit adac167

Please sign in to comment.