Free location_struct, set user agent and don't log if no location has been acquired
This commit is contained in:
parent
794b9909a2
commit
e5acc54597
@ -44,6 +44,7 @@ int upload_location_data(struct location_data *location) {
|
|||||||
CURL *upload_request;
|
CURL *upload_request;
|
||||||
upload_request = curl_easy_init();
|
upload_request = curl_easy_init();
|
||||||
curl_easy_setopt(upload_request, CURLOPT_URL, location_url);
|
curl_easy_setopt(upload_request, CURLOPT_URL, location_url);
|
||||||
|
curl_easy_setopt(upload_request, CURLOPT_USERAGENT, "phonetrack-linux");
|
||||||
|
|
||||||
CURLcode response = curl_easy_perform(upload_request);
|
CURLcode response = curl_easy_perform(upload_request);
|
||||||
|
|
||||||
@ -79,7 +80,13 @@ void get_location(GClueSimple *simple) {
|
|||||||
location_struct->timestamp = timestamp_sec;
|
location_struct->timestamp = timestamp_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (location_struct->latitude == 0.0F && location_struct->longitude == 0.0F) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
upload_location_data(location_struct);
|
upload_location_data(location_struct);
|
||||||
|
|
||||||
|
free(location_struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_geoclue_client_active(GClueClient *geoclue_client, GParamSpec *parameter_spec, gpointer user_data) {
|
void on_geoclue_client_active(GClueClient *geoclue_client, GParamSpec *parameter_spec, gpointer user_data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user