{
Request::responseHeadersComplete();
+ if( responseCode() != 200 )
+ return setFailure(responseCode(), responseReason());
+
if( !_filename.empty() )
{
// TODO validate path? (would require to expose fgValidatePath somehow to
SG_LOG
(
SG_IO,
- SG_WARN,
- "HTTP::FileRequest: error writing to '" << _filename << "'"
+ SG_DEBUG,
+ "HTTP::FileRequest: received data for closed file '" << _filename << "'"
);
return;
}
virtual void onFail();
virtual void onAlways();
+ void setFailure(int code, const std::string& reason);
+
private:
friend class Client;
friend class Connection;
Request& operator=(const Request&); // = delete;
void processBodyBytes(const char* s, int n);
- void setFailure(int code, const std::string& reason);
void setReadyState(ReadyState state);
std::string _method;