The Samba-Bugzilla – Attachment 14 Details for
Bug 113
Request to aggregate updates to change_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
proposed patch
fix.c (text/plain), 3.75 KB, created by
Gerald (Jerry) Carter (dead mail address)
on 2003-05-22 18:53:57 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Gerald (Jerry) Carter (dead mail address)
Created:
2003-05-22 18:53:57 UTC
Size:
3.75 KB
patch
obsolete
> >static uint32 lastChangeId = 0; /* Slow Down Fix new static variable */ >#define CHANGE_ID_UPDATE_TIMEOUT 10000 /* Slow Down Fix new definition */ > >static BOOL construct_printer_info_0(PRINTER_INFO_0 *printer, int snum) >{ > pstring chaine; > int count; > NT_PRINTER_INFO_LEVEL *ntprinter = NULL; > counter_printer_0 *session_counter; > uint32 global_counter; > uint32 up_time; /* Slow Down Fix new local variable */ > struct tm *t; > time_t setuptime; > print_status_struct status; > > if (!W_ERROR_IS_OK(get_a_printer(&ntprinter, 2, lp_servicename(snum)))) > return False; > > count = print_queue_length(snum, &status); > > /* check if we already have a counter for this printer */ > session_counter = (counter_printer_0 *)ubi_dlFirst(&counter_list); > > for(; session_counter; session_counter = (counter_printer_0 *)ubi_dlNext(session_counter)) { > if (session_counter->snum == snum) > break; > } > > /* it's the first time, add it to the list */ > if (session_counter==NULL) { > if((session_counter=(counter_printer_0 *)malloc(sizeof(counter_printer_0))) == NULL) { > free_a_printer(&ntprinter, 2); > return False; > } > ZERO_STRUCTP(session_counter); > session_counter->snum=snum; > session_counter->counter=0; > ubi_dlAddHead( &counter_list, (ubi_dlNode *)session_counter); > } > > /* increment it */ > session_counter->counter++; > > /* JFM: > * the global_counter should be stored in a TDB as it's common to all the clients > * and should be zeroed on samba startup > */ > global_counter=session_counter->counter; > > pstrcpy(chaine,ntprinter->info_2->printername); > > init_unistr(&printer->printername, chaine); > > slprintf(chaine,sizeof(chaine)-1,"\\\\%s", get_called_name()); > init_unistr(&printer->servername, chaine); > > printer->cjobs = count; > printer->total_jobs = 0; > printer->total_bytes = 0; > > setuptime = (time_t)ntprinter->info_2->setuptime; > t=gmtime(&setuptime); > > printer->year = t->tm_year+1900; > printer->month = t->tm_mon+1; > printer->dayofweek = t->tm_wday; > printer->day = t->tm_mday; > printer->hour = t->tm_hour; > printer->minute = t->tm_min; > printer->second = t->tm_sec; > printer->milliseconds = 0; > > printer->global_counter = global_counter; > printer->total_pages = 0; >#ifndef EMULATE_WIN2K_HACK /* JERRY */ > printer->major_version = 0x0004; /* NT 4 */ > printer->build_version = 0x0565; /* build 1381 */ >#else > printer->major_version = 0x0005; /* NT 5 */ > printer->build_version = 0x0893; /* build 2195 */ >#endif > printer->unknown7 = 0x1; > printer->unknown8 = 0x0; > printer->unknown9 = 0x0; > printer->session_counter = session_counter->counter; > printer->unknown11 = 0x0; > printer->printer_errors = 0x0; /* number of print failure */ > printer->unknown13 = 0x0; > printer->unknown14 = 0x1; > printer->unknown15 = 0x024a; /* 586 Pentium ? */ > printer->unknown16 = 0x0; >/* Start Slow Down Fix */ > up_time = rev_changeid(); > if (up_time < ntprinter->info_2->changeid) ntprinter->info_2->changeid = up_time; /* serve time overflow */ > if (up_time > (ntprinter->info_2->changeid + CHANGE_ID_UPDATE_TIMEOUT)){ > lastChangeId = ntprinter->info_2->changeid; > } > printer->change_id = lastChangeId; > >// printer->change_id = ntprinter->info_2->changeid; /* ChangeID in milliseconds*/ >/* End Slow Down Fix */ > > printer->unknown18 = 0x0; > printer->status = nt_printq_status(status.status); > printer->unknown20 = 0x0; > printer->c_setprinter = get_c_setprinter(); /* monotonically increasing sum of delta printer counts */ > printer->unknown22 = 0x0; > printer->unknown23 = 0x6; /* 6 ???*/ > printer->unknown24 = 0; /* unknown 24 to 26 are always 0 */ > printer->unknown25 = 0; > printer->unknown26 = 0; > printer->unknown27 = 0; > printer->unknown28 = 0; > printer->unknown29 = 0; > > free_a_printer(&ntprinter,2); > return (True); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 113
: 14