Subversion Repositories Kolibri OS

Rev

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

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