--- libwww/Library/src/HTReader.c 1996/10/29 21:27:14 2.8.2.1 +++ libwww/Library/src/HTReader.c 1996/10/29 22:13:08 2.8.2.2 @@ -3,7 +3,7 @@ ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. -** @(#) $Id: HTReader.c,v 2.8.2.1 1996/10/29 21:27:14 eric Exp $ +** @(#) $Id: HTReader.c,v 2.8.2.2 1996/10/29 22:13:08 eric Exp $ ** ** HISTORY: ** 6 June 95 HFN Written @@ -26,7 +26,6 @@ struct _HTInputStream { const HTInputStreamClass * isa; HTChannel * ch; HTHost * host; - HTStream * target; /* Target for incoming data */ char * write; /* Last byte written */ char * read; /* Last byte read */ char data [INPUT_BUFFER_SIZE]; /* buffer */ @@ -38,15 +37,15 @@ struct _HTInputStream { PRIVATE int HTReader_flush (HTInputStream * me) { HTNet * net = HTHost_getReadNet(me->host); - return net && net->readStream ? (*net->readStream->isa->flush)(me->target) : HT_OK; + return net && net->readStream ? (*net->readStream->isa->flush)(net->readStream) : HT_OK; } PRIVATE int HTReader_free (HTInputStream * me) { HTNet * net = HTHost_getReadNet(me->host); if (net && net->readStream) { - int status = (*net->readStream->isa->_free)(me->target); - /* if (status != HT_WOULD_BLOCK) me->target = NULL; */ + int status = (*net->readStream->isa->_free)(net->readStream); + /* if (status != HT_WOULD_BLOCK) net->readStream = NULL; */ return status; } return HT_OK; @@ -56,8 +55,8 @@ PRIVATE int HTReader_abort (HTInputStrea { HTNet * net = HTHost_getReadNet(me->host); if (net && net->readStream) { - (*net->readStream->isa->abort)(me->target, NULL); - /* me->target = NULL; */ + (*net->readStream->isa->abort)(net->readStream, NULL); + /* net->readStream = NULL; */ } return HT_ERROR; } @@ -85,7 +84,7 @@ PRIVATE int HTReader_read (HTInputStream int status; HTNet * net = HTHost_getReadNet(host); - me->b_read = me->read - me->data; + /* me->b_read = me->read - me->data; */ /* Read from socket if we got rid of all the data previously read */ do { /* don't read if we have to push unwritten data from last call */ @@ -160,7 +159,7 @@ PRIVATE int HTReader_read (HTInputStream /* Now push the data down the stream */ if ((status = (*net->readStream->isa->put_block) - (net->readStream, me->data, me->b_read)) != HT_OK) { + (net->readStream, me->write, me->b_read)) != HT_OK) { if (status == HT_WOULD_BLOCK) { if (PROT_TRACE) HTTrace("Read Socket. Target WOULD BLOCK\n"); HTHost_unregister(host, net, HTEvent_READ); @@ -201,7 +200,7 @@ PRIVATE int HTReader_close (HTInputStrea int status = HT_OK; HTNet * net = HTHost_getReadNet(me->host); if (net && net->readStream) { - if ((status = (*net->readStream->isa->_free)(me->target))==HT_WOULD_BLOCK) + if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK) return HT_WOULD_BLOCK; } if (PROT_TRACE) HTTrace("Socket read. FREEING....\n");