]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/HTTPRequest.cxx
Drop explicit SDK setting on Mac
[simgear.git] / simgear / io / HTTPRequest.cxx
index 900b7fc29f9178ea9d2a572752e8af0b2bbe9bc5..b9466ebf36d11a3938365f9f035e7830a36add6c 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2011  James Turner <zakalawe@mac.com>
+// Copyright (C) 2013  Thomas Geymayer <tomgey@gmail.com>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
+
 #include "HTTPRequest.hxx"
 
 #include <simgear/compiler.h>
@@ -39,7 +56,7 @@ Request* Request::done(const Callback& cb)
   if( _ready_state == DONE )
     cb(this);
   else
-    _cb_done = cb;
+    _cb_done.push_back(cb);
 
   return this;
 }
@@ -50,7 +67,7 @@ Request* Request::fail(const Callback& cb)
   if( _ready_state == FAILED )
     cb(this);
   else
-    _cb_fail = cb;
+    _cb_fail.push_back(cb);
 
   return this;
 }
@@ -61,7 +78,7 @@ Request* Request::always(const Callback& cb)
   if( isComplete() )
     cb(this);
   else
-    _cb_always = cb;
+    _cb_always.push_back(cb);
 
   return this;
 }
@@ -321,22 +338,19 @@ void Request::setReadyState(ReadyState state)
     onDone();
     onAlways();
 
-    if( _cb_done )
-      _cb_done(this);
+    _cb_done(this);
   }
   else if( state == FAILED )
   {
     onFail();
     onAlways();
 
-    if( _cb_fail )
-      _cb_fail(this);
+    _cb_fail(this);
   }
   else
     return;
 
-  if( _cb_always )
-    _cb_always(this);
+  _cb_always(this);
 }
 
 //------------------------------------------------------------------------------