BBS2chProxyAuth.h 417 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <pthread.h>
  3. #include <curl/curl.h>
  4. #include <string>
  5. class BBS2chProxyAuth {
  6. private:
  7. std::string sid;
  8. int expire;
  9. pthread_mutex_t mutex;
  10. public:
  11. BBS2chProxyAuth() : expire(0) {
  12. pthread_mutex_init(&mutex, NULL);
  13. };
  14. ~BBS2chProxyAuth() {
  15. pthread_mutex_destroy(&mutex);
  16. };
  17. std::string requestBodyForURL(const char *url, CURL *curl);
  18. private:
  19. bool updateSID(CURL *curl);
  20. };