httpsrv.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. typedef struct HSPriv HSPriv;
  2. enum
  3. {
  4. HSTIMEOUT = 15 * 60 * 1000,
  5. /* rewrite replacement field modifiers */
  6. Modsilent = '@',
  7. Modperm = '=',
  8. };
  9. struct HSPriv
  10. {
  11. char *remotesys;
  12. char *remoteserv;
  13. };
  14. extern int logall[3];
  15. extern char* HTTPLOG;
  16. extern char* webroot;
  17. extern char* netdir;
  18. #define STRLEN(s) (sizeof(s)-1)
  19. /* emem.c */
  20. char *estrdup(char*);
  21. void* ezalloc(ulong);
  22. /* sendfd.c */
  23. int authcheck(HConnect *c);
  24. int checkreq(HConnect *c, HContent *type, HContent *enc, long mtime, char *etag);
  25. int etagmatch(int, HETag*, char*);
  26. HRange *fixrange(HRange *h, long length);
  27. int sendfd(HConnect *c, int fd, Dir *dir, HContent *type, HContent *enc);
  28. /* content.c */
  29. void contentinit(void);
  30. HContents dataclass(HConnect *, char*, int);
  31. int updateQid(int, Qid*);
  32. HContents uriclass(HConnect *, char*);
  33. /* anonymous.c */
  34. void anonymous(HConnect*);
  35. /* hint.c */
  36. void hintprint(HConnect *hc, Hio*, char *, int, int);
  37. void statsinit(void);
  38. void urlcanon(char *url);
  39. void urlinit(void);
  40. /* init.c */
  41. HConnect* init(int, char**);
  42. vlong Bfilelen(void*);
  43. /* redirect.c */
  44. void redirectinit(void);
  45. char* redirect(HConnect *hc, char*);
  46. char* masquerade(char*);
  47. char* authrealm(HConnect *hc, char *path);
  48. int isdecorated(char *repl);
  49. char *undecorated(char *repl);
  50. /* log.c */
  51. void logit(HConnect*, char*, ...);
  52. #pragma varargck argpos logit 2
  53. void writelog(HConnect*, char*, ...);
  54. #pragma varargck argpos writelog 2
  55. /* authorize.c */
  56. int authorize(HConnect*, char*);