W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2004

Re: PATCH vs PUT w/Content-Range

From: Alex Rousskov <rousskov@measurement-factory.com>
Date: Thu, 29 Apr 2004 12:03:56 -0600 (MDT)
To: Lisa Dusseault <lisa@osafoundation.org>
Cc: HTTP working group <ietf-http-wg@w3.org>
Message-ID: <Pine.BSF.4.58.0404291148500.48149@measurement-factory.com>

On Thu, 29 Apr 2004, Lisa Dusseault wrote:

> Updates should be atomic -- the entire patch should be applied or
> entirely failed.  I will make that explicit.

You may want to note in the draft that, in many cases, the atomicity
requirement is expensive because it requires copying the entire
content or "trying to patch" first, before actually patching, while
holding the file lock.

To avoid copying, a special --dry-run feature of the library/program
that supports the given patch format would be needed. In fact, as the
"internal error" part of the example below illustrates, copying may
always be required for safe operation when the patch library/program
does not guarantee atomicity:

	lock
	if patch --dry-run
	then
		if patch
		then
			unlock
			report success
		else
			internal error!
			revert to original content?
			...
		fi
	else
		unlock
		error, report to the client
	fi

Alex.
Received on Thursday, 29 April 2004 14:04:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:49:30 GMT