Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Driver #481

Open
wants to merge 91 commits into
base: driver
Choose a base branch
from
Open

Driver #481

wants to merge 91 commits into from

Conversation

TeoCrack
Copy link

No description provided.

Jacob Marble and others added 30 commits February 27, 2016 16:21
Replaced utility update-config-file with backfill-config-file and
sparse-config-file. Utility init now creates a config file that is
sparse, except for user-specified values that are != default values.

Fixes google#125
Read/write sparse config files.
This fixes build errors when building on non-Windows with
go get github.com/google/cups-connector/...
Installs binaries and dependencies
Displays license agreement
English x64 only
Installs service
Service does not start currently when installed

Note: RTF version of license agreement is necessary for Windows Installer

Tested:
all the actions in various install states, but not with actual GCP
binaries
Create WIX files for building Windows Installer
Parse page sizes specified in points, like "w81h252"
Instead of ephemeral ports, use ports from a selected range (default:
26000 to 26999). This makes packaging easier when the target system has
to configure a firewall.

Fixes google#161
Added benchmark and test. BenchmarkListen_range1000_available100 took
over one minute before this change; now it takes less than 500 ms.
privet: HTTP API server port range
…oogle#217)

* Implemented cups_job_full_username option in Windows port

- Implemented cups_job_full_username option in Windows port
- Changed the job status logic to treat paused jobs as "done" (because
other software may pause jobs, and we aren't checking for the native
printed/deleted statuses)
- Renamed SetJob to SetJobCommand since it only uses commands
- Added SetJobInfo1 & SetJobUserName which are used to change the
username
- Corrected error handling for: EnumPrinters, OpenPrinter, ClosePrinter,
GetJob, SetJobCommand, StartDoc, EndDoc, StartPage, EndPage,
SetGraphicsMode

Note
I have not added boilerplate "err == NO_ERROR" checks everywhere like
SetWorldTransform has. Those "The operation completed successfully"
Windows bugs are pretty rare.

* Fixed Unix build error for CUPSJobFullUsername

CUPSJobFullUsername had been moved above the CUPS only section.
…#234)

Colors were being set in the CDD and ticket structures as VendorKey:"", VendorId:"key:value". Now we properly do VendorKey:"key", VendorId:"value" so things decode properly later.
…google#236)

All the other json specifications seemed correct, only infoResponse was missing omitempty annotations.
See https://developers.google.com/cloud-print/docs/privet#42-privetinfo-api
Trivial fixes for:
cups-connector\privet\privet.go:79: too many arguments in call to p.zc.addPrinter
cups-connector\privet\privet.go:105: too many arguments in call to p.zc.updatePrinterTXT
…nector

For issue google#241. We still need to do a big rename of imports, but it should work
ok for now.
Initial renaming from google/cups-connector to google/cloud-print-connector
)

Added new flags for GCPOAuthClientID and GCPOAuthClientSecret.
Replaced references to these in lib.DefaultConfig with context.String(...).
* Rename to cloud-print-connector in import paths and other places

* Remove CUPS from identifier in windows installer file

* Rename temp files to be consistent with new name

* Update app test in main_unix.go to match new name

* Rename default socket and log to new name
sbeaufort and others added 28 commits January 19, 2017 11:16
…RICOH printer when password is empty (google#341)

* Fix of issue 340 : Failed to submit to native print system with some RICOH printers when password is empty

* Fix of issue 340 : Failed to submit to native print system with some RICOH printers when password is empty
We already retry connecting to XMPP when it has a problem after startup,
but we do not do so on initial startup. Use the same logic for
startup retries as we do for restart retries.

Fixes google#140 and google#160.
cli requires special handling for errors in order to return an error
code back to the OS. Otherwise, errors look like success. This
patch generates the special error type that cli expects.

Fixes google#357.
* Remove unused AvahiThreadedPoll parameters from several C functions

* Factor out populateGroup from addAvahiGroup

We will need to reuse the code in populateGroup to do resetAvahiGroup soon.

* Fix inconsistency in "serviceName" vs "service_name" in avahi.h

* Introduce resetAvahiGroup, which will be used for recovering from collision

* Add printer_name parameter to addAvahiGroup

When resolving collisions, the printer name will diverge from the
mDNS service name.

* Handle mDNS collisions in privet with Avahi

Avahi makes it a bit tricky to handle service name collisions,
so it was not implemented before. Now multiple printers with
the same name can be registered on the same local network. This
comes up in the case where a privet-enabled printer is also
connected with the Cloud Print Connector.

Fixes google#342.
* Added support for Brother duplexing (BRDuplex)

* Added test for Brother duplexing (BRDuplex)
…ens (google#361)

* Listen for printer changes and refresh the printers list when such happen.

This reduces the delay after new printer is added until it shows up
as a printer avaiable for printing in Goolge Cloud Print on Windows.

Timer based refreshes still need to happen due to other sources of
printers eg Privet etc.

* Adjust the code to the commited version of golang.org/x/sys/windows/svc.
Cloud Print URLs in case
developer needs to access testing oauth server or testing local GCP
servers.

The old command still works with production URLs by default:

gcp-connector-util init

Then in order to connect to testing server, you need following command:

gcp-connector-util init --gcp-oauth-client-id="<TEST CLIENT ID>"
--gcp-oauth-client-secret="<TEST CLIENT SECRET>"
--gcp-oauth-auth-url="<OAUTH AUTH URL>"
--gcp-oauth-token-url="<OAUTH TOKEN URL>"
--gcp-oauth-device-code-url="<DEVICE CODE URL>"
--gcp-base-url="<GCP API BASE URL>"
--gcp-oauth-token-poll-url="<OAUTH TOKEN POLL URL>"
Parameterize OAuth credentials and URLs
The current CL enables connector to receive both xmpp and FCM notifications from GCP server.
The switch happens only when fcm flag is passed during connector start up else the behaviour is exactly same as before.
Test Added.
The current CL enables connector to be able to switch printer notification channel b/w XMPP and FCM

Fcm channel is enabled if fcm flag is passed during connector start up , else connector falls back to XMPP channel.

Gcp will migrate printers b/w FCM and XMPP accordingly.
This change will simplify enabling fcm notifications on windows connector.
Includes minor reformatting changes.
* Further windows build fixes

* Delete dependencies.wxs

This should be regenerated on every run of build-msi.sh and should not be in git

* remove generated dependencies.wxs after each run.
* Update cups.go

* Update gcp-cups-connector.go

* Update gcp-windows-connector.go

* Update winspool.go
* Update list of travis go versions

The list is quite old and there seems to be problems building on Mac with some of these.

https://docs.travis-ci.com/user/languages/go/#Specifying-a-Go-version-to-use
* generalize build-msi.sh for 32/64 builds

* Rename windows-connector.wxs to windows-connector-x64.wxs

* Create windows-connector-x86.wxs
Helps in reducing load on FCM (during outage).
- Fixes google#301
- Move retain code to be later in the printing process
- Check for paused jobs and don't retain them, because retain/release deletes them
- Don't release if the job wasn't retained (avoids logging an error)
3 printer sync messages get logged constantly at INFO level spamming log
files and Windows event viewer. Reduce regular sync messages to DEBUG to
keep them off by default. Other log entries like printer
add/update/delete are still INFO.
* reduce level info > debug for sync messages

3 printer sync messages get logged constantly at INFO level spamming log
files and Windows event viewer. Reduce regular sync messages to DEBUG to
keep them off by default. Other log entries like printer
add/update/delete are still INFO.

* Windows: move whitelsit/blacklist check earlier

Currently we scan all native printers before filtering unwanted printers
with config whitelsit/blacklist. This is inefficient and means we can't
avoid deep scanning settings of a printer we don't want to touch.

This PR moves the whitelist/blacklist check into the native printer scan
loop right after we have printer name. Scans are faster and unwanted
printers don't have any details pulled other than name.

* No chnages to manager/printermanager.go in this PR

* cups: move wl/bl filter into loop

* Fixes to make sure we compile and run on *nix

* make go fmt happy

* remove tests for old lib functions
* Migrate urfave/cli from v1 to v2

* Migrate urfave/cli for Windows as well
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.