W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 2001

Posting problem using HttpManager

From: Menarek John-NJM010 <John_Menarek-NJM010@email.mot.com>
Date: Thu, 5 Jul 2001 09:52:18 -0400 (EDT)
Message-Id: <011B4725DFB4D3118BD300508B6F0B9D02989C98@il99exm02.icsd.mot.com>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>


		When running a test from junit I see the following in my trace tool:

		POST /VDGTestServer/servlet/ReadInput HTTP/1.1
		Cache-Control: max-stale=120
		Proxy-Connection: keep-alive
		Date: Fri, 29 Jun 2001 16:29:33 GMT
		Accept: */*
		Host: n0021-csppo002
		Proxy-Authorization: Basic bmptMDEwOm8xVlZvSmFH
		User-Agent: Jigsaw/2.2.0

		POST /VDGTestServer/servlet/ReadInput HTTP/1.1
		Cache-Control: max-stale=120
		Proxy-Connection: keep-alive
		Date: Fri, 29 Jun 2001 16:29:33 GMT
		Accept: */*
		Host: n0021-csppo002
		Proxy-Authorization: Basic bmptMDEwOm8xVlZvSmFH
		User-Agent: Jigsaw/2.2.0

		empname=john











		Two Http headers are going out!!!!!!

		In Jigsaw the sending of request bytes is done by three methods

		startEmit(OutputStream out, int what) 
		emitHeaders(OutputStream out, int what) 
		endEmit(OutputStream out, int what) 

		Each called in succession.

		endEmit looks like this:

		    protected void endEmit(OutputStream out, int what) 
			throws IOException 
		    {
		System.out.println("Request:endEmit");		
			if ((what & EMIT_BODY) != EMIT_BODY)
			{
			    return;
			}
			if ( output != null ) {
			    byte buf[] = new byte[1024];
			    int  cnt   = 0;
			    int total  = 0;
			    while ((cnt = output.read(buf)) > 0) {
		System.out.println( ":" + new String( buf, 0, cnt ) + ":" ); // PRINT STATEMENT
				total +=cnt;
				out.write(buf, 0, cnt); // *************LINE I COMMENT OUT
			    }
			    output.close();
			}
			return;
		    }

		Minus the print statements of course.

		On the screen all I see is one line :empname=john: per System.out.println( ":" + new String( buf, 0, cnt ) + ":" );

		WHEN I COMMENT OUT out.write(buf, 0, cnt); I don't see two sets of HTTP headers any more. Of course I'm also
		missing the body now.

		It's like outputstream is some how getting confused. I also tried putting a out.flush() at the top
		of the method to no avail. 

		I have checked JDC for any bugs reguarding this type of behavior but found none.

		Any suggestions?
Received on Thursday, 5 July 2001 12:55:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:35 GMT