diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-04-16 06:22:31 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-04-16 06:22:31 +0000 |
commit | 54de56a1be8ede7476c741cd1631ad1ac8107fcc (patch) | |
tree | a89c1c9ef109ae03623c6080331da3a36f2bfc76 /source3/smbd/reply.c | |
parent | 8a91379a00cade86a0b448c6a7c4e949cc58185c (diff) | |
download | samba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.tar.gz samba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.tar.xz samba-54de56a1be8ede7476c741cd1631ad1ac8107fcc.zip |
the changes to the main smb code
------------
The following series of commits are for the new tdb based printing
backend. This completely replaces our old printing backend.
Major changes include:
- all print ops are now done in printing/*.c rather than scattered all
over the place
- system job ids are decoupled from SMB job ids
- the lpq parsers don't need to be nearly so smart, they only need to
parse the filename, the status and system job id
- we can store lots more info about a job, including the full job name
- the queue cache control is much better
I also added a new utility routine file_lines_load() that loads a text
file and parses it into lines. This is used in out lpq parsing and I
also want to use it to replace all of our fgets() based code in other
places.
(This used to be commit d870542c2884510bd45fd5b54ff2157434d53f4c)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r-- | source3/smbd/reply.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index b280b07f7cd..e998e1741c0 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -393,6 +393,7 @@ int reply_ioctl(connection_struct *conn, uint32 ioctl_code = (device << 16) + function; int replysize, outsize; char *p; + files_struct *fsp = file_fsp(inbuf,smb_vwv0); DEBUG(4, ("Received IOCTL (code 0x%x)\n", ioctl_code)); @@ -413,8 +414,8 @@ int reply_ioctl(connection_struct *conn, switch (ioctl_code) { - case IOCTL_QUERY_JOB_INFO: - SSVAL(p,0,1); /* Job number */ + case IOCTL_QUERY_JOB_INFO: + SSVAL(p,0,fsp->print_jobid); /* Job number */ StrnCpy(p+2, global_myname, 15); /* Our NetBIOS name */ StrnCpy(p+18, lp_servicename(SNUM(conn)), 13); /* Service name */ break; @@ -3029,7 +3030,7 @@ int reply_printopen(connection_struct *conn, return(ERROR(ERRSRV,ERRnofids)); /* Open for exclusive use, write only. */ - print_open_file(fsp,conn,"dos.prn"); + print_fsp_open(fsp,conn,"dos.prn"); if (!fsp->open) { file_free(fsp); @@ -3104,7 +3105,7 @@ int reply_printqueue(connection_struct *conn, { print_queue_struct *queue = NULL; char *p = smb_buf(outbuf) + 3; - int count = get_printqueue(SNUM(conn), conn,&queue,NULL); + int count = print_queue_status(SNUM(conn), &queue,NULL); int num_to_get = ABS(max_count); int first = (max_count>0?start_index:start_index+max_count+1); int i; @@ -3118,8 +3119,7 @@ int reply_printqueue(connection_struct *conn, for (i=first;i<first+num_to_get;i++) { put_dos_date2(p,0,queue[i].time); CVAL(p,4) = (queue[i].status==LPQ_PRINTING?2:3); - SSVAL(p,5,printjob_encode(SNUM(conn), - queue[i].job)); + SSVAL(p,5, queue[i].job); SIVAL(p,7,queue[i].size); CVAL(p,11) = 0; StrnCpy(p+12,queue[i].user,16); |