Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
http:client: Rename variable on connection_finish
Browse files Browse the repository at this point in the history
The response variable was called 'param' making harder to
understand/read the code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
ceolin committed Sep 25, 2015
1 parent cc34b7e commit 197cdf2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/comms/sol-http-client-impl-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ sol_http_client_shutdown(void)
static void
call_connection_finish_cb(struct sol_http_client_connection *connection)
{
struct sol_http_response *param;
struct sol_http_response *response;
CURLcode r;
long response_code;
char *tmp;
Expand All @@ -131,39 +131,39 @@ call_connection_finish_cb(struct sol_http_client_connection *connection)
return;

if (connection->error) {
param = NULL;
response = NULL;
goto out;
}

param = &(struct sol_http_response) {
response = &(struct sol_http_response) {
.api_version = SOL_HTTP_RESPONSE_API_VERSION,
.content = connection->buffer
};

r = curl_easy_getinfo(connection->curl, CURLINFO_CONTENT_TYPE, &tmp);
if (r != CURLE_OK) {
param = NULL;
response = NULL;
goto out;
}
param->content_type = tmp ? strdupa(tmp) : "application/octet-stream";
response->content_type = tmp ? strdupa(tmp) : "application/octet-stream";

r = curl_easy_getinfo(connection->curl, CURLINFO_EFFECTIVE_URL, &tmp);
if (r != CURLE_OK || !tmp) {
param = NULL;
response = NULL;
goto out;
}
param->url = strdupa(tmp);
response->url = strdupa(tmp);

r = curl_easy_getinfo(connection->curl, CURLINFO_RESPONSE_CODE,
&response_code);
if (r != CURLE_OK) {
param = NULL;
response = NULL;
goto out;
}
param->response_code = (int)response_code;
response->response_code = (int)response_code;

out:
connection->cb((void *)connection->data, connection, param);
connection->cb((void *)connection->data, connection, response);
destroy_connection(connection);
}

Expand Down

0 comments on commit 197cdf2

Please sign in to comment.