+// 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>
if( _ready_state == DONE )
cb(this);
else
- _cb_done = cb;
+ _cb_done.push_back(cb);
return this;
}
if( _ready_state == FAILED )
cb(this);
else
- _cb_fail = cb;
+ _cb_fail.push_back(cb);
return this;
}
if( isComplete() )
cb(this);
else
- _cb_always = cb;
+ _cb_always.push_back(cb);
return this;
}
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);
}
//------------------------------------------------------------------------------