1
0
Fork 0

METAR fix

This commit is contained in:
Scott Giese 2019-02-07 01:26:05 -06:00
parent df7988fb49
commit 2fdc24c109
3 changed files with 5 additions and 5 deletions

View file

@ -426,7 +426,7 @@ void NoaaMetarRealWxController::requestMetar
)
{
static const std::string NOAA_BASE_URL =
"http://tgftp.nws.noaa.gov/data/observations/metar/stations/";
"https://tgftp.nws.noaa.gov/data/observations/metar/stations/";
class NoaaMetarGetRequest:
public simgear::HTTP::MemoryRequest
{
@ -443,7 +443,7 @@ void NoaaMetarRealWxController::requestMetar
virtual void onDone()
{
if( responseCode() != 200 )
if( responseCode() >= 400 )
{
SG_LOG
(

View file

@ -539,7 +539,7 @@ int main(int argc, char *argv[])
try
{
static const std::string NOAA_BASE_URL =
"http://tgftp.nws.noaa.gov/data/observations/metar/stations/";
"https://tgftp.nws.noaa.gov/data/observations/metar/stations/";
HTTP::MemoryRequest* mr = new HTTP::MemoryRequest
(
NOAA_BASE_URL + strutils::uppercase(argv[i]) + ".TXT"
@ -558,7 +558,7 @@ int main(int argc, char *argv[])
if( !mr->isComplete() )
throw sg_io_exception("metar download timed out");
if( mr->responseCode() != 200 )
if( mr->responseCode() >= 400 )
{
std::cerr << "metar download failed: "
<< mr->url()

View file

@ -6,7 +6,7 @@ APTNAV_DATA="http://dev.x-plane.com/update/data/AptNav201304XP1000.zip"
DAHDI_SRC="http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz"
LOGSEP="###########################################"
GETMETAR_SCRIPT="#!/bin/bash
#curl http://tgftp.nws.noaa.gov/data/observations/metar/stations/$1.TXT
#curl https://tgftp.nws.noaa.gov/data/observations/metar/stations/$1.TXT
echo \"Hello World !\""
ROOT=$PWD