💾 Archived View for gemini.rmf-dev.com › repo › Vaati › UploadService › files › d1c25aca788075f551df… captured on 2023-04-19 at 23:41:45. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2023-09-08)

🚧 View Differences

-=-=-=-=-=-=-

0 /* See LICENSE for license details. */

1 #ifndef PARSER_H

2 #define PARSER_H

3

4 #include <netinet/in.h>

5 #include <stdio.h>

6 #include <time.h>

7

8 enum method {

9 GET,

10 HEAD,

11 POST,

12 PUT,

13 DELETE,

14 CONNECT,

15 OPTIONS,

16 TRACE

17 };

18

19 struct http_request {

20 int socket;

21 int data;

22 struct sockaddr_in addr;

23 enum method method;

24 char host[512];

25 char useragent[256];

26 char xrealip[128];

27 char xforwardedproto[128];

28 char version[128];

29 char uri[4096];

30 char contentlength[32];

31 char contenttype[512];

32 char boundary[512];

33 int boundary_found;

34 size_t size;

35 char* content;

36 size_t content_allocated;

37 char packet[32768];

38 size_t length;

39 size_t sent;

40 int done;

41 time_t started;

42 time_t last;

43 char header[1024];

44 char updata[4096];

45 };

46

47 int http_parse(struct http_request* req);

48

49 #endif

50