Skip to content

Commit

Permalink
Merge pull request #90 from bjia56/whip-fixes
Browse files Browse the repository at this point in the history
whip: fix segfault on no-auth, call connect in join_channel
  • Loading branch information
sepfy authored Aug 19, 2024
2 parents 0d33bbe + e013de0 commit d436303
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/peer_signaling.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static void peer_signaling_onicecandidate(char *description, void *userdata) {
LOGD("Basic Auth: %s", cred_base64);
peer_signaling_http_post(g_ps.http_host, g_ps.http_path, g_ps.http_port, cred_base64, description);
} else {
peer_signaling_http_post(g_ps.http_host, g_ps.http_path, g_ps.http_port, NULL, description);
peer_signaling_http_post(g_ps.http_host, g_ps.http_path, g_ps.http_port, "", description);
}
}
}
Expand Down Expand Up @@ -458,7 +458,11 @@ int peer_signaling_join_channel() {
return -1;
} else if (g_ps.mqtt_port <= 0) {
LOGW("Invalid MQTT port number: %d", g_ps.mqtt_port);
return -1;
if (peer_signaling_whip_connect() < 0) {
LOGW("Tried MQTT and WHIP, connect failed");
return -1;
}
return 0;
}

if (peer_signaling_mqtt_connect(g_ps.mqtt_host, g_ps.mqtt_port) < 0) {
Expand Down

0 comments on commit d436303

Please sign in to comment.