diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-04-09 12:06:39 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-04-09 12:06:39 +0000 |
commit | 5d2487dc97a63b0545b2d7d56405e7417fa2dd75 (patch) | |
tree | 8dea03916b8f166232dfe2fe28c5c218596e75c5 /protocols/Steam/src/http_request.h | |
parent | 33011dcb857b9e762c44bc9a9875365e2f5d0f91 (diff) |
Steam:
- add searching by name
- added contact info updating
- small improvements
git-svn-id: http://svn.miranda-ng.org/main/trunk@8901 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/http_request.h')
-rw-r--r-- | protocols/Steam/src/http_request.h | 54 |
1 files changed, 9 insertions, 45 deletions
diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h index f69b524c8a..2e3f9e17a2 100644 --- a/protocols/Steam/src/http_request.h +++ b/protocols/Steam/src/http_request.h @@ -5,7 +5,8 @@ enum HTTP_STATUS
{
- HTTP_STATUS_OK = 200/*,
+ HTTP_STATUS_NONE = 0,
+ HTTP_STATUS_OK = 200,
HTTP_STATUS_BAD_REQUEST = 400,
HTTP_STATUS_UNAUTHORIZED = 401,
HTTP_STATUS_FORBIDDEN = 403,
@@ -13,10 +14,10 @@ enum HTTP_STATUS HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
HTTP_STATUS_TOO_MANY_REQUESTS = 429,
HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
- HTTP_STATUS_INSUFICIENTE_STORAGE = 507*/
+ HTTP_STATUS_INSUFICIENTE_STORAGE = 507
};
-class HttpRequest : public NETLIBHTTPREQUEST//, public MZeroedObject
+class HttpRequest : protected NETLIBHTTPREQUEST//, public MZeroedObject
{
public:
HttpRequest(HANDLE hNetlibUser, int request, LPCSTR url)
@@ -74,48 +75,6 @@ public: memcpy(pData, data, size);
}
- /*void AddBasicAuthHeader(LPCSTR szLogin, LPCSTR szPassword)
- {
- char cPair[128];
- mir_snprintf(
- cPair,
- SIZEOF(cPair),
- "%s:%s",
- szLogin,
- szPassword);
-
- char *ePair = (char *)mir_base64_encode((BYTE*)cPair, (UINT)strlen(cPair));
-
- char value[128];
- mir_snprintf(
- value,
- SIZEOF(value),
- "Basic %s",
- ePair);
-
- mir_free(ePair);
-
- headers = (NETLIBHTTPHEADER*)mir_realloc(headers, sizeof(NETLIBHTTPHEADER)*(headersCount+1));
- headers[headersCount].szName = mir_strdup("Authorization");
- headers[headersCount].szValue = mir_strdup(value);
- headersCount++;
- }
-
- void AddBearerAuthHeader(LPCSTR szValue)
- {
- char value[128];
- mir_snprintf(
- value,
- SIZEOF(value),
- "Bearer %s",
- szValue);
-
- headers = (NETLIBHTTPHEADER*)mir_realloc(headers, sizeof(NETLIBHTTPHEADER)*(headersCount+1));
- headers[headersCount].szName = mir_strdup("Authorization");
- headers[headersCount].szValue = mir_strdup(value);
- headersCount++;
- }*/
-
void AddUrlPart(LPCSTR szPart)
{
m_szUrl += szPart;
@@ -153,6 +112,11 @@ public: m_szUrl.AppendFormat("&%s", szValue);
}
+ void SetTimeout(int timeout)
+ {
+ timeout = timeout;
+ }
+
NETLIBHTTPREQUEST *Send()
{
szUrl = m_szUrl.GetBuffer();
|