]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/HTTPRequest.hxx
Async lookup attempt #3 - use OpenThreads instead - I'm going to kill off SGThread...
[simgear.git] / simgear / io / HTTPRequest.hxx
index 1c7dc083b06b8c0e8f3b758144f53d08e5108a83..0e346419d12632abd535f99782e370120d149467 100644 (file)
@@ -50,6 +50,20 @@ public:
      */
     unsigned int responseBytesReceived() const
         { return _receivedBodyBytes; }
+        
+    enum HTTPVersion {
+        HTTP_VERSION_UNKNOWN = 0,
+        HTTP_0_x, // 0.9 or similar
+        HTTP_1_0,
+        HTTP_1_1
+    };
+    
+    HTTPVersion responseVersion() const
+        { return _responseVersion; }
+    
+    static HTTPVersion decodeVersion(const std::string& v);
+    
+    bool closeAfterComplete() const;
 protected:
     Request(const std::string& url, const std::string method = "GET");
 
@@ -68,10 +82,12 @@ private:
 
     std::string _method;
     std::string _url;
+    HTTPVersion _responseVersion;
     int _responseStatus;
     std::string _responseReason;
     unsigned int _responseLength;
     unsigned int _receivedBodyBytes;
+    bool _willClose;
     
     typedef std::map<std::string, std::string> HeaderDict;
     HeaderDict _responseHeaders;