W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1998

Possible Etag bug?

From: Soam Acharya <soam@CS.Cornell.EDU>
Date: Fri, 20 Feb 1998 14:40:35 -0500 (EST)
Message-Id: <199802201940.OAA25384@hoho.cs.cornell.edu>
To: www-jigsaw@w3.org

Hi all!

I tried sending this to jigsaw@w3.org: perhaps it didn't get through?
Anyway, here goes:

I'm using the Jigsaw release version 1.0 beta 2 and when I try to PUT a
virgin entity to a Jigsaw server (whose configuration files I have modified
to make a sub-directory putable) I don't get an ETag back. 

Here's a sample run:

[ telnet to molson.cs.cornell.edu, port 8001 as this is where the server is 
  running. "moovDir" is the Putable directory ]

===== begin =======
PUT /root/moovDir/pep2.html HTTP/1.1
host: molson.cs.cornell.edu:8001
Content-Length: 154
Content-Type: text/html

FARG/1.1 007 Wot Implement-d
Date: Sun, 26 Oct NINA 22:43:24 GMT
Content-Length: 28
Content-Type: text/html
Server: 1.0beta2

Method DIT bot implement-e.
==== eof =====

This creates the file "/moovDir/pep2.html" just fine. Problem is that
the response from the server is:

HTTP/1.1 201 Created
Date: Thu, 12 Feb 1998 01:19:53 GMT
Content-Length: 34
Content-Type: text/html
Location: http://molson.cs.cornell.edu:8001/root/moovDir/pep2.html
Server: 1.0beta1

<p>Entity body saved succesfully !


which does not provide an Etag. If, however, I do a HEAD on the same entity

HEAD /root/moovDir/pep2.html HTTP/1.1
host: molson.cs.cornell.edu:8001

then I get back:

HTTP/1.1 200 OK
Date: Thu, 12 Feb 1998 01:20:22 GMT
Content-Length: 154
Content-Type: text/html
Etag: "1vsn7hi:pqa033l8"
Last-Modified: Thu, 12 Feb 1998 01:19:53 GMT
Accept-Ranges: bytes
Server: 1.0beta1


which, as you can see, includes the etag. Infact, if I *repeat* the PUT
process, overwriting the entity "pep2.html", then I do get back an etag.

Now, it could be that I've misunderstood the HTTP 1.1 specs but I'm
supposed to get back an etag the first time I create an entity from
scratch, right?

I've looked into the files and I think the problem lies in 

w3c.jigsaw.resources.FileResource.java, lines 572-576

the code fragment: 

	if ( status == HTTP.CREATED ) {
	    reply = request.makeReply(status);
	    reply.setContent ("<p>Entity body saved succesfully !") ;

probably should include an additional line:

	if ( status == HTTP.CREATED ) {
	    reply = request.makeReply(status);
	    if ( etag != null )
		reply.setHeaderValue(reply.H_ETAG, etag);
	    reply.setContent ("<p>Entity body saved succesfully !") ;

to include the tags with the reply. 

Let me know if this sounds right! 

FYI, I'm using Jigsaw to build a WWW Video Caching Proxy simulator. My
trace requires me to simulate about 40 caching proxies. I'm planning on
doing this by having 40 Jigsaw httpd threads run at the same time!
Additionally, I'm hoping to build the simulator with little or no
modification to Jigsaw itself. I'm going to do it by creating new resources
and filters. Should be interesting when I get it working :-)

Received on Friday, 20 February 1998 14:40:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:41:24 UTC