From: Lars H. <lhe...@us...> - 2003-04-25 15:14:21
|
After the next release of amavis/amavisd, I intend to tackle the amavisd client protocol, but I need to sort out some basic issues first. One of the shortcomings of the current protocol is that no attempt is made to deal with data larger than the socket buffer size. I think I have an idea how to deal with this on the client side (C), but how is it done on the daemon side (perl)? How can the daemon be made to detect that the data transmitted isn't complete yet? This is slightly complicated by the fact that perl's recv shrinks or grows its size the the amount of data actually read. Or is this handled transparently in perl, i.e. one recv() takes the data from several subsequent send()? In the client: buffer p pointer to buffer len = size of buffer r = return code while ( ( r = send(... p, len, ...)) > -1) { if r == len break if r < len { p += r len -= r } } if r < 0 error handling Any ideas? |