#include <string.h>
#include <time.h>
#include <cstdlib>
+#include <cstdio>
+
+#include <boost/algorithm/string.hpp>
#include <simgear/debug/logstream.hxx>
#include <simgear/environment/metar.hxx>
#include <simgear/io/HTTPClient.hxx>
#include <simgear/io/HTTPRequest.hxx>
+#include <simgear/io/raw_socket.hxx>
#include <simgear/timing/timestamp.hxx>
using namespace std;
bool fromProxy;
MetarRequest(const std::string& stationId) :
- HTTP::Request("http://weather.noaa.gov/pub/data/observations/metar/stations/" + stationId + ".TXT"),
+ HTTP::Request("http://weather.noaa.gov/pub/data/observations/metar/stations/" + boost::to_upper_copy(stationId) + ".TXT"),
complete(false),
failed(false)
{
surface.push_back(buf);
}
- if (surface.size()) {
+ if (! surface.empty()) {
vector<string>::iterator rwysurf = surface.begin();
for (i = 0; rwysurf != surface.end(); rwysurf++, i++) {
if (i)
string proxy_host, proxy_port;
getproxy(proxy_host, proxy_port);
+ Socket::initSockets();
+
HTTP::Client http;
http.setProxy(proxy_host, atoi(proxy_port.c_str()));