httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject 1.3.14; RE: general/6769: Byterange/Byte-serving problem
Date Tue, 31 Oct 2000 19:31:44 GMT
Byterange gurus;

We quite likely have a problem here, if anyone else is better
able to review the issue please do so, I'd really like to know
if the behavior can be reproduced on a un*x server.

If so it's a showstopper to 1.3.15 and better roll out with
Tony's latest rewrite update.

There was a patch to the byterange handling in http_protocol.c
that possibly corresponds to this issue.  I've attached the
1.3.12->1.3.14 diff below the report.  It smells like a bug,
although it could simply be a bug in Apache's .pdf handling.
Whichever, we may have broken clients.

> From: Mikkel Johansen [mailto:mj@if.dk]
> Sent: Tuesday, October 31, 2000 10:12 AM
> To: submit@bugz.apache.org
> 
> >Number:         6769
> >Category:       general
> >Synopsis:       Byterange/Byte-serving problem
> >Confidential:   no
> >Severity:       critical
> >Priority:       medium
> >Responsible:    apache
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          sw-bug
> >Submitter-Id:   apache
> >Arrival-Date:   Tue Oct 31 08:20:01 PST 2000
> >Closed-Date:
> >Last-Modified:
> >Originator:     mj@if.dk
> >Release:        1.3.14
> >Organization:
> apache
> >Environment:
> WinNt 4.0 (SP6), Apache 1.3.14
> >Description:
> When installing Apache 1.3.14 on the server, Adobe Acrobat 
> (have not been able to test with other programs) locks the 
> client when retrieving a pdf-file.
> 
> Client: Windows 95/98/NT/2000 etc. + IE 5.x + Adobe Acrobat 4.x
> >How-To-Repeat:
> Simple install 1.3.14 and put some pdf-files (optimized) on 
> the site. Try to read them on a client.
> Install 1.3.12 and everything works!!!
> >Fix:
> It could be something with Byterange or Byte-serving. But it 
> is just a guess.
> >Release-Note:
> >Audit-Trail:

===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
retrieving revision 1.289
retrieving revision 1.291
diff -u -r1.289 -r1.291
--- apache-1.3/src/main/http_protocol.c	2000/02/20 01:14:47	1.289
+++ apache-1.3/src/main/http_protocol.c	2000/10/10 03:29:08	1.291
@@ -235,13 +235,21 @@
         /* a multiple range */
         const char *r_range = ap_pstrdup(r->pool, range + 6);
         long tlength = 0;
-
-        r->byterange = 2;
+	int ret;
+	
         r->boundary = ap_psprintf(r->pool, "%lx%lx",
 				r->request_time, (long) getpid());
-        while (internal_byterange(0, &tlength, r, &r_range, NULL, NULL));
+        do {
+	    /* Loop while we have another range spec to process */
+	    ret = internal_byterange(0, &tlength, r, &r_range, NULL, NULL);
+	} while (ret == 1);
+	/* If an error occured processing one of the range specs, we
+	 * must fail */
+	if (ret < 0)
+	    return 0;
         ap_table_setn(r->headers_out, "Content-Length",
 	    ap_psprintf(r->pool, "%ld", tlength));
+        r->byterange = 2;
     }
 
     r->status = PARTIAL_CONTENT;
@@ -262,8 +270,8 @@
  * If it is called with realreq=0, it will add to tlength the length
  * it *would* have used with realreq=1.
  *
- * Either case will return 1 if it should be called again, and 0
- * when done.
+ * Either case will return 1 if it should be called again, 0 when done,
+ * or -1 if an error occurs AND realreq=0.
  */
 static int internal_byterange(int realreq, long *tlength, request_rec *r,
                               const char **r_range, long *offset, long *length)
@@ -296,9 +304,12 @@
 #ifdef CHARSET_EBCDIC
         POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
 #endif /*CHARSET_EBCDIC*/
-        /* Skip this one */
-        return internal_byterange(realreq, tlength, r, r_range, offset,
-                                  length);
+	if (!realreq)
+	    /* Return error on invalid syntax */
+	    return -1;
+	else
+	    /* Should never get here */
+	    return 0;
     }
 
     if (r->byterange > 1) {

Mime
View raw message