Re: net_db.c

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 16 Aug 2000 23:35:54 +0200

Jens-S. Voeckler wrote:

> I would favour getting rid of most STDIO except possibly stdout/stderr -
> there should be no portability problems as open()/write()/close() is
> almost universally available.

I think I tend to agree with you there, especially when considering that
STDIO does not fit that well in the I/O programming model of Squid.

> The drawback with my suggested writen() approach is that the error
> handling is still not sufficient/robust enough for my taste. Same goes for
> the temporary buffer handling. Would it be very difficult to queue writes
> into Squids event handling scheme, or would that be overkill?

Well.. most of the needed code are there already. For this type of
operation memBufPrintf and file_write_mbuf seem like the most
appropriate ones. If you really feel like doing some invention, add a
file_printf call which wraps the two together, hiding the MemBuf magic
from the caller...

/Henrik
Received on Wed Aug 16 2000 - 16:00:50 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:35 MST