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

Ensure compiles on Fedora with GCC 12 #3132

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion src/turnrest.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ janus_turnrest_response *janus_turnrest_request(const char *user) {
JANUS_LOG(LOG_VERB, "Sending request: %s\n", request_uri);
janus_mutex_unlock(&api_mutex);
curl_easy_setopt(curl, CURLOPT_URL, request_uri);
curl_easy_setopt(curl, api_http_get ? CURLOPT_HTTPGET : CURLOPT_POST, 1);
if(api_http_get){
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
}else{
curl_easy_setopt(curl, CURLOPT_POST, 1L);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small editorial notes: per our code style, you need a space between parentheses, so

if(api_http_get) {

and the else needs spaces too:

} else {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review and suggestions. Probably no longer needed.

if(!api_http_get) {
/* FIXME Some servers don't like a POST with no data */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, query_string);
Expand Down