From: Stephen D. <sd...@gm...> - 2008-10-22 20:41:07
|
On Wed, Oct 22, 2008 at 9:03 PM, Vlad Seryakov <vl...@cr...> wrote: > I tried to use Ns_SockSendBufs() but it sends data directly to socket > where i need to send via driver's send proc. Just pass your Send() proc directly, and delete SendBufs(): static ssize_t SendFile(Ns_Sock *sock, Ns_FileVec *bufs, int nbufs, Ns_Time *timeoutPtr, int flags) { - return Ns_SockSendFileBufsIndirect(sock->sock, bufs, nbufs, timeoutPtr, flags, SendBufs); + return Ns_SockSendFileBufsIndirect(sock->sock, bufs, nbufs, timeoutPtr, flags, Send); } > Why connPtr->nContentSent is not updated, all send called with conn > parameters should do this Yes, but Ns_ConnSend() is higher up the stack, so when sending data it looks something like this: return.c: Ns_ConnReturnData connio.c: Ns_ConnWriteData connio.c: Ns_ConnWriteVData connio.c: Ns_ConnSend driver.c: NsDriverSend nsssl/nsssl.c: Send By the time your Send() is called we've already passed through Ns_ConnSend(). nContentSent will be updated as the stack unwinds. If you call Ns_ConnSend() from within Send(), that's a loop... |