HTResponse_handOverHeader removes mime separator

I used ComLine to GET a document that was multipart/mixed. When
HTStreamStack tried to construct an HTBoundary, it got back an
HTErrorStream as HTBoundary could not find the boundary from the
response:
      HTAssocList * type_param = response ?
	  HTResponse_formatParam(response) :
	  HTAnchor_formatParam(anchor);
      char * boundary = HTAssocList_findObject(type_param, "boundary");

This was because HTMIME.c::pumpData had already called HTAnchor_update
to move the headers into the anchor object from the response:
  me->headers = HTResponse_handOverHeader(response);

In the process, it wiped out the format parameters which were needed
later on for construction of the stream stack:
  PUBLIC HTAssocList * HTResponse_handOverHeader (HTResponse * me)
  {
      HTAssocList * headers = NULL;
      if (me) {
	  headers = me->headers;
	  me->headers = NULL;
	  /*  me->type_parameters = NULL; */	/* @@@ */
      }
      return headers;
  }

There are two obvious solutions that I see: re-parse the MIME
separator from the anchor's newly acquired headers or leave
HTResponse::type_parameters alone.

I see from the CVS log that Jose has wrestled with this before:

2.12.2.1
log
@JK: The format parameters were being systematically lost each time.
I commented that line, as it seem wrong
@
text
@d6 1
a6 1
**      @@(#) $Id: HTResponse.c,v 2.12 2000/10/30 10:04:23 kahan Exp $
d665 1
a665 4
        /* JK: commented this line. Seems to be something that
           wasn't completed. And it kept us from getting the
           charset in the response object */
        /* me->type_parameters = NULL;  */ /* @@@@@@ */
@


2.12.2.1.2.1
log
@JK: moving back to the previous version
@
text
@d665 4
a668 1
        me->type_parameters = NULL;     /* @@@@@@ */
@


Does anybody out there use libwww to fetch multipart documents?

-- 
-eric

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Tuesday, 4 September 2001 13:04:11 UTC