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.

42 lines
1.3 KiB

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. curlRequestsManager * m_pHttpAccessManager;
  17. CSTR m_pCurlPostType;
  18. config_setting_t * m_pSettings;
  19. //clientPort *m_oDataTransport;
  20. //int packetChecker(unsigned char *Buffer, size_t BufferSize);
  21. //protocolPackage *packetExtractor(unsigned char *Buffer, size_t BufferSize);
  22. virtual bool packetHandler( protocolPackage *Package ){ return false; };
  23. public:
  24. // Constructor
  25. explicit protocolHTTP( config_setting_t *Settings = NULL );
  26. //ToDo: change Serial to BaseClass of some kind of socket
  27. // protocolHTTP( clientPort *SocketTransport, config_setting_t *Settings = NULL );
  28. // Destructor
  29. virtual ~protocolHTTP();
  30. bool issueGet( CSTR URL );
  31. bool issuePost(CSTR URL, char *Buffer, int &BufferSize);
  32. /*virtual bool init(){ return true; };*/
  33. static void *requestFinished(void *, void *);
  34. };
  35. #endif