1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: Lift the server_messaging_context from print_queue_length

This commit is contained in:
Volker Lendecke 2010-08-08 15:47:51 +02:00
parent 31d23c83fe
commit a4c27786ff
3 changed files with 13 additions and 9 deletions

View File

@ -134,7 +134,8 @@ bool print_job_resume(struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
int snum, uint32 jobid, WERROR *errcode);
ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size);
int print_queue_length(int snum, print_status_struct *pstatus);
int print_queue_length(struct messaging_context *msg_ctx, int snum,
print_status_struct *pstatus);
WERROR print_job_start(struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
int snum, const char *docname, const char *filename,

View File

@ -2366,7 +2366,8 @@ static int get_queue_status(const char* sharename, print_status_struct *status)
Determine the number of jobs in a queue.
****************************************************************************/
int print_queue_length(int snum, print_status_struct *pstatus)
int print_queue_length(struct messaging_context *msg_ctx, int snum,
print_status_struct *pstatus)
{
const char* sharename = lp_const_servicename( snum );
print_status_struct status;
@ -2376,7 +2377,7 @@ int print_queue_length(int snum, print_status_struct *pstatus)
/* make sure the database is up to date */
if (print_cache_expired(lp_const_servicename(snum), True))
print_queue_update(server_messaging_context(), snum, False);
print_queue_update(msg_ctx, snum, False);
/* also fetch the queue status */
memset(&status, 0, sizeof(status));
@ -2545,7 +2546,7 @@ static WERROR print_job_checks(struct auth_serversupplied_info *server_info,
}
/* Insure the maximum queue size is not violated */
*njobs = print_queue_length(snum, NULL);
*njobs = print_queue_length(msg_ctx, snum, NULL);
if (*njobs > lp_maxprintjobs(snum)) {
DEBUG(3, ("print_job_checks: Queue %s number of jobs (%d) "
"larger than max printjobs per queue (%d).\n",

View File

@ -2741,7 +2741,7 @@ static void spoolss_notify_status(int snum,
{
print_status_struct status;
print_queue_length(snum, &status);
print_queue_length(server_messaging_context(), snum, &status);
SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, status.status);
}
@ -2755,7 +2755,9 @@ static void spoolss_notify_cjobs(int snum,
struct spoolss_PrinterInfo2 *pinfo2,
TALLOC_CTX *mem_ctx)
{
SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, print_queue_length(snum, NULL));
SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(
data, print_queue_length(server_messaging_context(), snum,
NULL));
}
/*******************************************************************
@ -3478,7 +3480,7 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
r->servername = talloc_strdup(mem_ctx, info2->servername);
W_ERROR_HAVE_NO_MEMORY(r->servername);
count = print_queue_length(snum, &status);
count = print_queue_length(msg_ctx, snum, &status);
/* check if we already have a counter for this printer */
for (session_counter = counter_list; session_counter; session_counter = session_counter->next) {
@ -3589,7 +3591,7 @@ static WERROR construct_printer_info2(TALLOC_CTX *mem_ctx,
int count;
print_status_struct status;
count = print_queue_length(snum, &status);
count = print_queue_length(server_messaging_context(), snum, &status);
r->servername = talloc_strdup(mem_ctx, info2->servername);
W_ERROR_HAVE_NO_MEMORY(r->servername);
@ -3727,7 +3729,7 @@ static WERROR construct_printer_info6(TALLOC_CTX *mem_ctx,
int count;
print_status_struct status;
count = print_queue_length(snum, &status);
count = print_queue_length(server_messaging_context(), snum, &status);
r->status = nt_printq_status(status.status);