version 1.4.2.2, 2022/09/15 15:13:31
|
version 1.4.2.3, 2022/09/15 15:48:41
|
Line 109 mqtt_KeepAlive(int sock, u_short ka, u_char tries)
|
Line 109 mqtt_KeepAlive(int sock, u_short ka, u_char tries)
|
} |
} |
/* receive & decode packet */ |
/* receive & decode packet */ |
msg = mqtt_msgAlloc(BUFSIZ); |
msg = mqtt_msgAlloc(BUFSIZ); |
|
if (!msg) { |
|
ret = -1; |
|
break; |
|
} |
if ((ret = recv(sock, msg->msg_base, msg->msg_len, 0)) == -1) { |
if ((ret = recv(sock, msg->msg_base, msg->msg_len, 0)) == -1) { |
LOGERR; |
LOGERR; |
break; |
break; |
Line 118 mqtt_KeepAlive(int sock, u_short ka, u_char tries)
|
Line 122 mqtt_KeepAlive(int sock, u_short ka, u_char tries)
|
break; |
break; |
} else |
} else |
ret = 2; /* Session is broken ... must be disconnect! */ |
ret = 2; /* Session is broken ... must be disconnect! */ |
|
mqtt_msgFree(&msg, 0); |
} |
} |
end: |
end: |
mqtt_msgFree(&msg, 0); |
mqtt_msgFree(&msg, 0); |
Line 160 mqtt_WillMessage(int sock, u_short ka, const char *top
|
Line 165 mqtt_WillMessage(int sock, u_short ka, const char *top
|
return ret; |
return ret; |
/* receive & decode packet */ |
/* receive & decode packet */ |
msg = mqtt_msgAlloc(BUFSIZ); |
msg = mqtt_msgAlloc(BUFSIZ); |
|
if (!msg) |
|
return -1; |
if ((ret = recv(sock, msg->msg_base, msg->msg_len, 0)) == -1) { |
if ((ret = recv(sock, msg->msg_base, msg->msg_len, 0)) == -1) { |
LOGERR; |
LOGERR; |
mqtt_msgFree(&msg, 0); |
mqtt_msgFree(&msg, 0); |
Line 169 mqtt_WillMessage(int sock, u_short ka, const char *top
|
Line 176 mqtt_WillMessage(int sock, u_short ka, const char *top
|
ret = 0; /* ok */ |
ret = 0; /* ok */ |
else |
else |
ret = 2; /* semi-error */ |
ret = 2; /* semi-error */ |
|
|
mqtt_msgFree(&msg, 0); |
mqtt_msgFree(&msg, 0); |
|
|
return ret; |
return ret; |
} |
} |