Subversion Repositories Kolibri OS

Rev

Rev 6887 | Rev 8305 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef INCLUDE_LIBHTTP_H
  2. #define INCLUDE_LIBHTTP_H
  3.  
  4. #ifndef INCLUDE_KOLIBRI_H
  5. #include "../lib/kolibri.h"
  6. #endif
  7.  
  8. #ifndef INCLUDE_DLL_H
  9. #include "../lib/dll.h"
  10. #endif
  11.  
  12. dword libHTTP = #alibHTTP;
  13. char alibHTTP[] = "/sys/lib/http.obj";
  14.  
  15. dword http_lib_init          = #aHTTPinit;
  16. dword http_get               = #aHTTPget;
  17. dword http_head              = #aHTTPhead;
  18. dword http_post              = #aHTTPpost;
  19. dword http_find_header_field = #aFHF;
  20. dword http_send              = #aHTTPsend;
  21. dword http_receive           = #aHTTPreceive;
  22. dword http_disconnect        = #aHTTPdisconnect;
  23. dword http_free              = #aHTTPfree;
  24. dword uri_escape             = #aURIescape;
  25. dword uri_unescape           = #aURIunescape;
  26. $DD 2 dup 0
  27.  
  28. char aHTTPinit[]             = "lib_init";
  29. char aHTTPget[]              = "get";
  30. char aHTTPhead[]             = "head";
  31. char aHTTPpost[]             = "post";
  32. char aFHF[]                  = "find_header_field";
  33. char aHTTPsend[]             = "send";
  34. char aHTTPreceive[]          = "receive";
  35. char aHTTPdisconnect[]       = "disconnect";
  36. char aHTTPfree[]             = "free";
  37. char aURIescape[]            = "escape";
  38. char aURIunescape[]          = "unescape";
  39.  
  40. // status flags
  41. #define FLAG_HTTP11             1 << 0
  42. #define FLAG_GOT_HEADER         1 << 1
  43. #define FLAG_GOT_ALL_DATA       1 << 2
  44. #define FLAG_CONTENT_LENGTH     1 << 3
  45. #define FLAG_CHUNKED            1 << 4
  46. #define FLAG_CONNECTED          1 << 5
  47.  
  48. // user flags
  49. #define FLAG_KEEPALIVE          1 << 8
  50. #define FLAG_MULTIBUFF          1 << 9
  51.  
  52. // error flags
  53. #define FLAG_INVALID_HEADER     1 << 16
  54. #define FLAG_NO_RAM             1 << 17
  55. #define FLAG_SOCKET_ERROR       1 << 18
  56. #define FLAG_TIMEOUT_ERROR      1 << 19
  57. #define FLAG_TRANSFER_FAILED    1 << 20
  58.  
  59. struct  http_msg{
  60.         dword   socket;
  61.         dword   flags;
  62.         dword   write_ptr;
  63.         dword   buffer_length;
  64.         dword   chunk_ptr;
  65.         dword   timestamp;
  66.         dword   status;
  67.         dword   header_length;
  68.         dword   content_ptr;
  69.         dword   content_length;
  70.         dword   content_received;
  71.         char    http_header;
  72. };
  73.  
  74.  
  75. #endif