Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreak mosquito_connect_async() #2966

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/linux-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Linux

on:
pull_request:
paths:
- '**.c'
- '**.h'
- '**.sh'
- .github/workflows/linux-build-test.yml
push:

permissions:
contents: read

jobs:
build-ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y libcjson-dev libsqlite3-dev libssl-dev uthash-dev xsltproc docbook-xsl libcunit1-ncurses-dev python3-psutil
- run: make
- run: make test

build-ubuntu-20:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y libcjson-dev libsqlite3-dev libssl-dev uthash-dev xsltproc docbook-xsl libcunit1-ncurses-dev python3-psutil
- run: make
- run: make test
6 changes: 6 additions & 0 deletions lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ static int mosquitto__reconnect(struct mosquitto *mosq, bool blocking)
{
mosquitto__set_state(mosq, mosq_cs_connected);
rc = send__connect(mosq, mosq->keepalive, mosq->clean_start, outgoing_properties);
/* for non blocking connect - mosquito_connect_async(), the send__connectsend__connect()
function may fail, we ignore this error (send will be repeated).
*/
if(rc == EFAULT && blocking == 0)
return 0;

if(rc){
packet__cleanup_all(mosq);
net__socket_close(mosq);
Expand Down