httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@hyperreal.com>
Subject cvs commit: apache/src http_protocol.c
Date Thu, 20 Feb 1997 01:23:25 GMT
akosut      97/02/19 17:23:25

  Modified:    src       http_protocol.c
  Log:
  Add a check for MSIE 3 to send multipart/x-byteranges instead of byteranges.
  Remove quotes from the boundary string (MSIE has problems with them).
  
  Reviewed by: Paul, Jim, Ben
  
  Revision  Changes    Path
  1.103     +17 -3     apache/src/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_protocol.c,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -C3 -r1.102 -r1.103
  *** http_protocol.c	1997/02/18 14:41:29	1.102
  --- http_protocol.c	1997/02/20 01:23:23	1.103
  ***************
  *** 1053,1058 ****
  --- 1053,1073 ----
        return OK;
    }
    
  + /*
  +  * Here we try to be compatible with clients that want multipart/x-byteranges
  +  * instead of multipart/byteranges (also see above), as per HTTP/1.1. We
  +  * look for the Request-Range header (e.g. Netscape 2 and 3) as an indication
  +  * that the browser supports an older protocol. We also check User-Agent
  +  * for Microsoft Internet Explorer 3, which needs this as well.
  +  */
  + 
  + static int use_range_x(request_rec *r) {
  +     char *ua;
  +     return (table_get(r->headers_in, "Request-Range") ||
  + 	    ((ua = table_get(r->headers_in, "User-Agent"))
  + 	     && strstr(ua, "MSIE 3")));
  + }
  + 
    void send_http_header(request_rec *r)
    {
        conn_rec *c = r->connection;
  ***************
  *** 1083,1091 ****
    
        if (r->byterange > 1)
            bvputs(fd, "Content-Type: multipart/",
  ! 	       table_get(r->headers_in, "Request-Range") ?
  ! 	       "x-byteranges" : "byteranges",
  ! 	       "; boundary=\"", r->boundary, "\"\015\012", NULL);
        else if (r->content_type)
            bvputs(fd, "Content-Type: ", 
    		 nuke_mime_parms (r->pool, r->content_type), "\015\012", NULL);
  --- 1098,1105 ----
    
        if (r->byterange > 1)
            bvputs(fd, "Content-Type: multipart/",
  ! 	       use_range_x(r) ? "x-byteranges" : "byteranges",
  ! 	       "; boundary=", r->boundary, "\015\012", NULL);
        else if (r->content_type)
            bvputs(fd, "Content-Type: ", 
    		 nuke_mime_parms (r->pool, r->content_type), "\015\012", NULL);
  
  
  

Mime
View raw message