[Python-Dev] Re: httplib (was: Adding LDAP to the Python core... ?!)

Jeremy Hylton jeremy@beopen.com
Mon, 5 Jun 2000 00:58:11 -0400 (EDT)


>>>>> "GS" == Greg Stein <gstein@lyra.org> writes:

  GS> I found the problem. Sneaky...  sock.makefile() does a dup() on
  GS> the file descriptor, then opens a FILE* with that. See it coming
  GS> yet? ...

Bingo!  I was suspicious of all these dup'd file descriptors, but
missed the connection to a FILE* object.

  [In a previous message you wrote:]
  >> 
  >> Regarding the pipeline request thing. I think it would probably
  >> be best to just drop the whole "hold the previous response and
  >> wait for it to be closed" thing.
  [...]
  >> 
  >> Oh. Wait. Maybe that was it. You can't read the "next" response
  >> until the first one has been read. Well... no need to block
  >> putting new responses; we just need to create a way to "get the
  >> next reply" and/or "can I get the next reply yet?"
  >> 

Maybe I should clarify the concern I had here.  I think we're on the
same page, but I'm not sure.

The problem with pipelined requests is that the client must be sure to
read all of response I before it can call getreply to get response
I+1.  I imagine that it could add a lot of complexity to use code to
implement this requirement, e.g. when multiple threads are sharing a
single connection.  It would be good if the library could do something
reasonable about the multiplexing.  In the absence of making it just
work, the library could raise an error that makes clear what has gone
wrong -- that the client isn't using the interface properly.

Jeremy