--- libwww/Library/src/HTTPServ.c 1996/07/02 22:55:14 2.18 +++ libwww/Library/src/HTTPServ.c 1996/07/04 18:40:33 2.19 @@ -3,7 +3,7 @@ ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. -** @(#) $Id: HTTPServ.c,v 2.18 1996/07/02 22:55:14 frystyk Exp $ +** @(#) $Id: HTTPServ.c,v 2.19 1996/07/04 18:40:33 frystyk Exp $ ** ** This module implments the HTTP protocol as a state machine ** @@ -140,10 +140,18 @@ PRIVATE int MakeReplyPipe (HTStream * me } /* - ** We now have to create the rest of the response stream + ** We now have to create the rest of the response stream. We see whether + ** there is a data object or not by looking at the Content Type of the + ** client anchor. */ - me->target = HTMIMERequest_new(client, - HTTPResponse_new(client, me->target, NO), YES); + { + HTParentAnchor * anchor = HTRequest_anchor(client); + HTFormat format = HTAnchor_format(anchor); + me->target = (format == WWW_UNKNOWN) ? + HTTPResponse_new(client, me->target, YES) : + HTMIMERequest_new(client, + HTTPResponse_new(client,me->target,NO), YES); + } return HT_OK; } @@ -414,6 +422,10 @@ PUBLIC int HTServHTTP (SOCKET soc, HTReq HTRequest * client = HTRequest_new(); void * context = HTRequest_context(request); if (context) HTRequest_setContext(client, context); + HTRequest_setOutputConnected(client, NO); + HTRequest_setGnHd(client, HTRequest_gnHd(request)); + HTRequest_setRsHd(client, HTRequest_rsHd(request)); + HTRequest_setEnHd(client, HTRequest_enHd(request)); HTList_addObject(http->clients, client); /*