Subversion Repositories Kolibri OS

Rev

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

  1. //HTTP library
  2.  
  3. dword libHTTP = #alibHTTP;
  4. char alibHTTP[23] = "/sys/lib/http.obj\0";
  5.  
  6. dword http_lib_init       = #aLib_init;
  7. dword http_get            = #aHTTPget;
  8. dword http_process        = #aHTTPprocess;
  9. $DD 2 dup 0
  10.  
  11. char aLib_init[9]              = "lib_init\0";
  12. char aHTTPget[4]               = "get\0";
  13. char aHTTPprocess[8]           = "process\0";
  14.  
  15. #define FLAG_HTTP11             1 << 0
  16. #define FLAG_GOT_HEADER         1 << 1
  17. #define FLAG_GOT_DATA           1 << 2
  18. #define FLAG_CONTENT_LENGTH     1 << 3
  19. #define FLAG_CHUNKED            1 << 4
  20.  
  21. // error flags go into the upper word
  22. #define FLAG_INVALID_HEADER     1 << 16
  23. #define FLAG_NO_RAM             1 << 17
  24. #define FLAG_SOCKET_ERROR       1 << 18
  25.  
  26. struct  http_msg{
  27.         dword   socket;
  28.         dword   flags;
  29.         dword   write_ptr;
  30.         dword   buffer_length;
  31.         dword   chunk_ptr;
  32.  
  33.         dword   status;
  34.         dword   header_length;
  35.         dword   content_length;
  36.         char    data;
  37. };