summaryrefslogtreecommitdiff
path: root/sys/src/cmd/webfs/dat.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-11 16:17:54 +0100
committercinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-11 16:17:54 +0100
commit75e1ef0ab60acb6bccc54254b82770aec5786ead (patch)
treed273fc755a20e67801aa0a13df30ab75b2883419 /sys/src/cmd/webfs/dat.h
parent62fb4f97177d8e76f1fd49bb9d0073007b7c9bcc (diff)
new webfs, rc based hget
Diffstat (limited to 'sys/src/cmd/webfs/dat.h')
-rw-r--r--sys/src/cmd/webfs/dat.h139
1 files changed, 51 insertions, 88 deletions
diff --git a/sys/src/cmd/webfs/dat.h b/sys/src/cmd/webfs/dat.h
index fde326317..4235e48b3 100644
--- a/sys/src/cmd/webfs/dat.h
+++ b/sys/src/cmd/webfs/dat.h
@@ -1,104 +1,67 @@
-typedef struct Client Client;
-typedef struct Ctl Ctl;
-typedef struct Ibuf Ibuf;
typedef struct Url Url;
+typedef struct Buq Buq;
+typedef struct Buf Buf;
+typedef struct Key Key;
-/* simple buffered i/o for network connections; shared by http, ftp */
-struct Ibuf
-{
- int fd;
- Ioproc *io;
- char buf[4096];
- char *rp, *wp;
-};
+typedef struct {
+ char *s1;
+ char *s2;
+} Str2;
-struct Ctl
-{
- int acceptcookies;
- int sendcookies;
- int redirectlimit;
- char *useragent;
-};
+/* 9p */
+typedef struct Req Req;
-struct Client
+struct Url
{
- Url *url;
- Url *baseurl;
-
- Ctl ctl;
- Channel *creq; /* chan(Req*) */
- int num;
- int plumbed;
- char *contenttype;
- char *postbody;
- char *redirect;
- char *authenticate;
- char *ext;
- int npostbody;
- int havepostbody;
- int iobusy;
- int bodyopened;
- Ioproc *io;
- int ref;
- void *aux;
+ char *scheme;
+ char *user;
+ char *pass;
+ char *host;
+ char *port;
+ char *path;
+ char *query;
+ char *fragment;
};
-/*
- * If ischeme is USunknown, then the given URL is a relative
- * URL which references the "current document" in the context of the base.
- * If this is the case, only the "fragment" and "url" members will have
- * meaning, and the given URL structure may not be used as a base URL itself.
- */
-enum
+struct Buf
{
- USunknown,
- UShttp,
- UShttps,
- USftp,
- USfile,
- UScurrent,
+ Buf *next;
+ uchar *rp;
+ uchar *ep;
+ Req *wreq;
+ uchar end[];
};
-struct Url
+struct Key
{
- int ischeme;
- char* url;
- char* scheme;
- int (*open)(Client*, Url*);
- int (*read)(Client*, Req*);
- void (*close)(Client*);
- char* schemedata;
- char* authority;
- char* user;
- char* passwd;
- char* host;
- char* port;
- char* path;
- char* query;
- char* fragment;
- union {
- struct {
- char *page_spec;
- } http;
- struct {
- char *path_spec;
- char *type;
- } ftp;
- };
+ Key *next;
+ char *val;
+ char key[];
};
-enum
+struct Buq
{
- STACK = 32*1024, /* was 16*1024; there are big arrays on the stack */
-};
+ Ref;
+ QLock;
+
+ Url *url;
+ Key *hdr;
+ char *error;
+
+ int closed;
+ int limit;
+ int size;
-extern Client** client;
-extern int cookiedebug;
-extern Srv fs;
-extern int fsdebug;
-extern Ctl globalctl;
-extern int nclient;
-extern int urldebug;
-extern int httpdebug;
-extern char* status[];
+ /* write buffers */
+ Buf *bh;
+ Buf **bt;
+
+ /* read requests */
+ Req *rh;
+ Req **rt;
+
+ Rendez rz;
+};
+int debug;
+Url *proxy;