How to get entire PDU size without spooling?

lorin liu jordanliuster at gmail.com
Fri Nov 14 09:05:18 GMT 2008


Hi all,

When we start print a file through samba + CUPS, then the data flows
as follows(in samba):
smbd_process() -> receive InBuffer -> process_smb(InBuffer, OutBuffer)
-> pipe_write -> spoolss_command -> spoolss_writeprinter ->
print_job_write -> temp files in /tmp.

And the final job size(PDU file) can be obtained by the following
function(printing.c):
ssize_t print_job_write(int snum, uint32 jobid, const char *buf,
SMB_OFF_T pos, size_t size)
{
...
pjob->size += size;
...
}

Now, I don't want to generate this temp file, so I set job.fd to be a
socket fd. Meanwhile, when samba start a print job to make spooling I
DO submit print request to my printer server. Notice that this action
happen before wirte the PDU data(print_job_write), and then there is a
question: How to get the entire PDU file size before invoke
print_job_write function?

I am very appreciated for any suggestions for this issue.

Thanks.

Best Regards,

Lorin Liu


More information about the samba-technical mailing list