Fri Jan  6 16:12:13 GMT 2012

Code merged from cinap:
	- code to unescape filenames from remote,
	- one of the strings use to build the content
		range header was too short

Mon Dec  5 17:00:45 GMT 2011

should escape and unescape filenames using the url escaping techniques.
The code for this is already in webfs but it cannot help us with
paths embedded in xml snippets.

at present it all works however you just get (for example)
filenames containing spaces get an embedded '%20' in them.

Interestingly svn doesn't care and will accept either 'file name'
or 'file%20name' - I don't know if all servers are as friendly.

Thu Jun 17 17:01:22 BST 2010

	Cacheing broken for now. 
	
	look in cache, take the entry from there if possible.

	When I do a stat of a file I should scan the directory above it
	
	dirread called by:
		dirgen - rescan if dir info expired in cache
			reload cache
		attach
			never in cache
		walk1
			dir scan
		stat
			in cache?
		create - to get qid
			in cache
		open - for dirgen
			in cache

Fri Apr 23 17:00:04 BST 2010
	Digest works, though there is some clever stuff to do with
	nonce changes and stale nonces that I haven't really looked at,
	so it make be inefficent or plain just not work.

	session digest auth needs some changes to take advantage of the
	performance win it offers (not so many md5's each transaction).

	I now do an OPTIONS request on dial() - if this fails then you don't
	have a webdav server and I give up.

	found a w3c http 1.1 conformance testing site.
		http://jigsaw.w3.org/HTTP/

Mon Apr 19 12:46:48 BST 2010

webfs:
	Digest auth in progress, does not even try to work.
	
	Need other stuff to make webfs 1.1 compliant
	see: http://www2.research.att.com/~bala/papers/h0vh1.html

wdfs:
	seems to work, no support for svn checkout/checkin yet

	need some way to detect partial get/partial put support (its there
	I just need to re-read the RFC).

	cacheing files as well as dir info - a step too far perhaps?

--------------------------


Partial get/put
	Partial gets are supported by box.net (Apache mod_dav) ok. Subversion
	does not support them and sends the whole file. I should be able to auto
	detect by doing another read - if the data from the network is bigger than
	that requested, open a tmpfile, put what I have got so far into the file
	and absorb the remainder. if I get EOF when I try to read more then
	partial gets are supported.

	Partial puts doen't seem to be supported - though these infers they
	might be:

	http://www.mail-archive.com/slide-user@jakarta.apache.org/msg12297.html
	http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal
	http://lists.w3.org/Archives/Public/w3c-dist-auth/2002JanMar/0144.html

Multithreadness - arbitary optimisations...
	Even when partialgets is enabled I could do readahead in a seperate thread
	for the next block after satisfying the current read request, espicially if the
	requests are all 8192 long, there is a good chance the next read will
	be for the next chunk.

	could rewrite so fsopen() just sends the GET
	and enqueues a thread to download of the remainder of the file.

	reads should look at wdf->length first to see if they can be satisfied
	and if so then just do the read, however if the doenload is still in
	progress they should wait (sleep perhaps, maybe exchange a message
	detailing which part of the file is needed). This could be useful for
	cases like "p bigfile" or "sed 10q bigfile".

	Similarly writes should enque the write but wait for it to finish
	on close - This is a rare case though, usually files are written
	in one go - Put from Acme, cp(1) etc.

	If we have the file opened rdwr we could generate an MD5 on download
	and then (if the file is the same size) md5 again on close. We can
	then only do the write if the file is changed - probably an
	optimisation too far.


Looks like microsoft may support
	isreadonly	- value "0" or "1"
	lastaccessed	- date (not sure which type)

svn ls --verbose --username SteveSimon --password xxxxxxxxxxx  https://172.19.71.149/repos/Engineering

mydrive
	move and delete both work, but they both return 404 not found error ??!?
	delete should reply No content (204)
	move should reply Created (201)
	Looking at cadaver the only obvious difference is they specify
	two extra headers
		Connection: TE
		TE: trailers
	I wonder why mod_dav is picky about these?

	partial puts look as though they work but in fact they don't,
	each partial chunk is written at the start of the file. I wonder
	if mod_dav is closing the file and not seeking if the connection
	is not persistent?

box.net
	DOES support Range requests on Gets!

	dreadfull RTT - I think they are bandwidth limiting me.

	account works (use email address as username)

	put works, but put at an offset does not

	server claims to be: "nginx/0.6.39"

	Their web interface knows who created files, there may be a 
		property which holds this info.

	when you try to do a propfind allprop
	the reply contains only one empty XML element:
		<D:multistatus  xxmlns:D="DAV:"/>
		see below

svn 
	svn does not respect Range headers in GET requests

	supports an executable property:
		either T or F (true or false)
		always in in upper case.

 	revision number in group ID field.

	has username of last person to write file

	has revision number - I put in the gid field of Dir

Xparse reports an error when passed a single element, e.g.:
	<D:multistatus  xxmlns:D="DAV:"/>

Need specs on readonly and executable properties,
	they seem to be variable depending on the server,
	apache and MS IIS have subtly different styles.

maybe I need to respect \r\n -> \n in GETs depending on Mime type???

would be nice to optionally display the Server: header data,
	i.e. the remote software's name/version. This may be useful
	to differentiate between incompatible servers (sigh).

problems with webfs:
	want to be able to examine headers before and after transaction.

	headers file seperate from body file

	xmlfs layered on top of body file?

	posting large items are held in memory rather than switten direct to the network.

	persistant sessions.

	more complete HTTP 1.1 support

	gzip / compress 

	file descriptor leak in existing code

	webfs very asymetric in its design, built for web browsing not web services

New webfs:

	top level is similar to get a connection.

	/mnt
		webfs
			ctl
			clone
			0
				def
					as tx below but sets up defaults for session
				tx
					method		get
					content-length	123
					content-type	application/octet-stream
					depth		1
					...		create new files to add new headers

				rx
					rawheader	raw header of reply	
					body		body of reply
					status		200 ok
					protocol	http 1.1
					content-range	100-199

Transaction
	The request header is sent when any rx file is read,
	or when the first write occurs to the tx/body.

Auth
	support for Basic and Digest auth, perhaps NTLM one day.
	should try to use Digest in reply to Negoiate (Windows)
	which will often work.

Factotum interface
	perhaps should use the same auth request if the request URL is http: or
	https: so we don't need two factotum entries to support encrypted and
	non-encrypted sessions - not sure about this.
should send options on attach (commented out) and remember the Allow: header
which tells us what requests are valid.

http://www.pps.jussieu.fr/~jch/software/polipo/

