You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
  1. #ifndef __PROTOCOL_HTTP_STREAM_HEADER__
  2. #define __PROTOCOL_HTTP_STREAM_HEADER__
  3. #include "../../data/net/clientPort.h"
  4. #include "../../data/curl/curlRequestsManager.h"
  5. #include "protocol.h"
  6. #include "../../components/base/basicTransport.h"
  7. #include "../../components/base/basicSettingsProvider.h"
  8. #define HTTP_PROTOCOL_CONTENT_SETTINGS "CURL_POST_CONTENT_TYPE"
  9. /**
  10. * TODO: Add class description
  11. *
  12. * @author gagua
  13. */
  14. class protocolHTTP /*: public protocolParser */ {
  15. protected:
  16. basicLogCollection * m_pLog;
  17. curlRequestsManager * m_pHttpAccessManager;
  18. CSTR m_pCurlPostType;
  19. config_setting_t * m_pSettings;
  20. //clientPort *m_oDataTransport;
  21. //int packetChecker(unsigned char *Buffer, size_t BufferSize);
  22. //protocolPackage *packetExtractor(unsigned char *Buffer, size_t BufferSize);
  23. virtual bool packetHandler( protocolPackage *Package ){ return false; };
  24. public:
  25. // Constructor
  26. protocolHTTP();
  27. explicit protocolHTTP( config_setting_t *Settings );
  28. //ToDo: change Serial to BaseClass of some kind of socket
  29. // protocolHTTP( clientPort *SocketTransport, config_setting_t *Settings = NULL );
  30. // Destructor
  31. virtual ~protocolHTTP();
  32. bool loadSettings( config_setting_t* Settings );
  33. bool issueGet( CSTR URL );
  34. bool issuePost(CSTR URL, char *Buffer, int &BufferSize);
  35. /*virtual bool init(){ return true; };*/
  36. static void *requestFinished(void *, void *);
  37. };
  38. #endif