diff options
author | aunsane <aunsane@gmail.com> | 2017-12-28 21:21:10 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-12-28 21:21:28 +0300 |
commit | 0156ed41dceeef48f070adf67f14d4ba4c4f6d61 (patch) | |
tree | d0e1dca4c2c9c3c056ae9cb69dde10ea59316481 /protocols/Steam/src/request_queue.h | |
parent | f0075f2b956969f29acd3bc9289c8a5f78faddad (diff) |
Steam: refactoring
- reworking http requests
- added ability to get game name by appid
- another attempt to fix #633
- minor refactoring
Diffstat (limited to 'protocols/Steam/src/request_queue.h')
-rw-r--r-- | protocols/Steam/src/request_queue.h | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/protocols/Steam/src/request_queue.h b/protocols/Steam/src/request_queue.h deleted file mode 100644 index 6d14209fb8..0000000000 --- a/protocols/Steam/src/request_queue.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _REQUEST_QUEUE_H_
-#define _REQUEST_QUEUE_H_
-
-typedef void(*HttpResponseCallback)(const HttpResponse *response, void *arg);
-typedef void(*HttpFinallyCallback)(void *arg);
-
-struct RequestQueueItem
-{
- void *arg;
- HttpRequest *request;
- HttpResponseCallback responseCallback;
- HttpFinallyCallback finallyCallback;
-
- RequestQueueItem(HttpRequest *request, void *arg, HttpFinallyCallback finallyCallback) :
- request(request), responseCallback(NULL), arg(arg), finallyCallback(finallyCallback)
- {
- }
-
- RequestQueueItem(HttpRequest *request, HttpResponseCallback response, void *arg, HttpFinallyCallback finallyCallback) :
- request(request), responseCallback(response), arg(arg), finallyCallback(finallyCallback)
- {
- }
-
- ~RequestQueueItem()
- {
- delete request;
- request = NULL;
- responseCallback = NULL;
- finallyCallback = NULL;
- }
-};
-
-class RequestQueue
-{
- bool isTerminated;
- HNETLIBUSER hConnection;
- mir_cs requestQueueLock;
- LIST<RequestQueueItem> requests;
- HANDLE hRequestQueueEvent, hRequestQueueThread;
-
- void Execute(RequestQueueItem *item);
-
- static unsigned int __cdecl AsyncSendThread(void*, void*);
- static unsigned int __cdecl WorkerThread(void*);
-
-public:
- RequestQueue(HNETLIBUSER hConnection);
- ~RequestQueue();
-
- void Start();
- void Stop();
-
- void Push(HttpRequest *request, HttpResponseCallback response = NULL, void *arg = NULL, HttpFinallyCallback last = NULL);
- void Send(HttpRequest *request, HttpResponseCallback response = NULL, void *arg = NULL, HttpFinallyCallback last = NULL);
-
-};
-
-#endif //_REQUEST_QUEUE_H_
\ No newline at end of file |