Remove B_PROT_* and related code

Use standard error codes instead.
This allows using error code returned by the underlying functions
directly, and makes it possible to use strerror for debugging. So, we
can also remove StatusString() from the various *Request classes.
This commit is contained in:
Adrien Destugues
2014-01-13 08:05:32 +01:00
parent 5e9a96156d
commit 3d864cd870
7 changed files with 87 additions and 147 deletions
-8
View File
@@ -49,7 +49,6 @@ public:
status_t Stop();
const BUrlResult& Result() const;
const char* StatusString(status_t threadStatus) const;
static bool IsInformationalStatusCode(int16 code);
static bool IsSuccessStatusCode(int16 code);
@@ -123,13 +122,6 @@ private:
bool fOptAutoReferer : 1;
};
// ProtocolLoop return status
enum {
B_PROT_HTTP_NOT_FOUND = B_PROT_THREAD_STATUS__END,
B_PROT_HTTP_THREAD_STATUS__END
};
// Request method
const char* const B_HTTP_GET = "GET";
const char* const B_HTTP_POST = "POST";
-21
View File
@@ -42,8 +42,6 @@ public:
// URL protocol informations
bool IsRunning() const;
status_t Status() const;
virtual const char* StatusString(status_t threadStatus)
const;
virtual const BUrlResult& Result() const = 0;
@@ -66,23 +64,4 @@ protected:
};
// TODO: Rename, this is in the global namespace.
enum {
B_PROT_THREAD_STATUS__BASE = 0,
B_PROT_SUCCESS = B_PROT_THREAD_STATUS__BASE,
B_PROT_RUNNING,
B_PROT_PAUSED,
B_PROT_ABORTED,
B_PROT_SOCKET_ERROR,
B_PROT_CONNECTION_FAILED,
B_PROT_CANT_RESOLVE_HOSTNAME,
B_PROT_WRITE_FAILED,
B_PROT_READ_FAILED,
B_PROT_NO_MEMORY,
B_PROT_PROTOCOL_ERROR,
// Thread status over this one are guaranteed to be
// errors
B_PROT_THREAD_STATUS__END
};
#endif // _B_URL_REQUEST_H_