Skip to content

Commit 05cf67a

Browse files
committed
Cosmetic (fixed typo in names of two local variables)
1 parent b8c5202 commit 05cf67a

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

ipp.go

+43-43
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func IppService(log *LogMessage, services *DNSSdServices,
4747

4848
// Decode IPP service info
4949
attrs := newIppDecoder(msg)
50-
ippinfo, ippScv := attrs.decode(usbinfo)
50+
ippinfo, ippSvc := attrs.decode(usbinfo)
5151

5252
// Check for fax support
5353
canFax := false
@@ -72,26 +72,26 @@ func IppService(log *LogMessage, services *DNSSdServices,
7272
}
7373

7474
if canFax {
75-
ippScv.Txt.Add("Fax", "T")
76-
ippScv.Txt.Add("rfo", "ipp/faxout")
75+
ippSvc.Txt.Add("Fax", "T")
76+
ippSvc.Txt.Add("rfo", "ipp/faxout")
7777
} else {
78-
ippScv.Txt.Add("Fax", "F")
78+
ippSvc.Txt.Add("Fax", "F")
7979
}
8080

8181
// Construct LPD info. Per Apple spec, we MUST advertise
8282
// LPD with zero port, even if we don't support it
83-
lpdScv := DNSSdSvcInfo{
83+
lpdSvc := DNSSdSvcInfo{
8484
Type: "_printer._tcp",
8585
Port: 0,
8686
Txt: nil,
8787
}
8888

8989
// Pack it all together
90-
ippScv.Port = port
91-
services.Add(lpdScv)
90+
ippSvc.Port = port
91+
services.Add(lpdSvc)
9292

9393
ippinfo.IppSvcIndex = len(*services)
94-
services.Add(ippScv)
94+
services.Add(ippSvc)
9595

9696
return
9797
}
@@ -100,9 +100,9 @@ func IppService(log *LogMessage, services *DNSSdServices,
100100
// using the specified http.Client and uri
101101
//
102102
// If this function returns nil error, it means that:
103-
// 1) HTTP transaction performed successfully
104-
// 2) Received reply successfully decoded
105-
// 3) It is not an IPP error response
103+
// 1. HTTP transaction performed successfully
104+
// 2. Received reply successfully decoded
105+
// 3. It is not an IPP error response
106106
//
107107
// Otherwise, the appropriate error is generated and returned
108108
func ippGetPrinterAttributes(log *LogMessage, c *http.Client,
@@ -218,34 +218,33 @@ func newIppDecoder(msg *goipp.Message) ippAttrs {
218218
//
219219
// This is where information comes from:
220220
//
221-
// DNS-SD name: "printer-dns-sd-name" with fallback to "printer-info",
222-
// "printer-make-and-model" and finally to MfgAndProduct
223-
// from the UsbDeviceInfo
224-
//
225-
// TXT fields:
226-
// air: hardcoded as "none"
227-
// mopria-certified: "mopria-certified"
228-
// rp: hardcoded as "ipp/print"
229-
// kind: "printer-kind"
230-
// PaperMax: based on decoding "media-size-supported"
231-
// URF: "urf-supported" with fallback to
232-
// URF extracted from "printer-device-id"
233-
// UUID: "printer-uuid", without "urn:uuid:" prefix
234-
// Color: "color-supported"
235-
// Duplex: search "sides-supported" for strings with
236-
// prefix "one" or "two"
237-
// note: "printer-location"
238-
// qtotal: hardcoded as "1"
239-
// usb_MDL: MDL, extracted from "printer-device-id"
240-
// usb_MFG: MFG, extracted from "printer-device-id"
241-
// usb_CMD: CMD, extracted from "printer-device-id"
242-
// ty: "printer-make-and-model"
243-
// priority: hardcoded as "50"
244-
// product: "printer-make-and-model", in round brackets
245-
// pdl: "document-format-supported"
246-
// txtvers: hardcoded as "1"
247-
// adminurl: "printer-more-info"
221+
// DNS-SD name: "printer-dns-sd-name" with fallback to "printer-info",
222+
// "printer-make-and-model" and finally to MfgAndProduct
223+
// from the UsbDeviceInfo
248224
//
225+
// TXT fields:
226+
// air: hardcoded as "none"
227+
// mopria-certified: "mopria-certified"
228+
// rp: hardcoded as "ipp/print"
229+
// kind: "printer-kind"
230+
// PaperMax: based on decoding "media-size-supported"
231+
// URF: "urf-supported" with fallback to
232+
// URF extracted from "printer-device-id"
233+
// UUID: "printer-uuid", without "urn:uuid:" prefix
234+
// Color: "color-supported"
235+
// Duplex: search "sides-supported" for strings with
236+
// prefix "one" or "two"
237+
// note: "printer-location"
238+
// qtotal: hardcoded as "1"
239+
// usb_MDL: MDL, extracted from "printer-device-id"
240+
// usb_MFG: MFG, extracted from "printer-device-id"
241+
// usb_CMD: CMD, extracted from "printer-device-id"
242+
// ty: "printer-make-and-model"
243+
// priority: hardcoded as "50"
244+
// product: "printer-make-and-model", in round brackets
245+
// pdl: "document-format-supported"
246+
// txtvers: hardcoded as "1"
247+
// adminurl: "printer-more-info"
249248
func (attrs ippAttrs) decode(usbinfo UsbDeviceInfo) (
250249
ippinfo *IppPrinterInfo, svc DNSSdSvcInfo) {
251250

@@ -349,11 +348,12 @@ func (attrs ippAttrs) getDuplex() string {
349348
//
350349
// According to Bonjour Printing Specification, Version 1.2.1,
351350
// it can take one of following values:
352-
// "<legal-A4"
353-
// "legal-A4"
354-
// "tabloid-A3"
355-
// "isoC-A2"
356-
// ">isoC-A2"
351+
//
352+
// "<legal-A4"
353+
// "legal-A4"
354+
// "tabloid-A3"
355+
// "isoC-A2"
356+
// ">isoC-A2"
357357
//
358358
// If PaperMax cannot be guessed, it returns empty string
359359
func (attrs ippAttrs) getPaperMax() string {

0 commit comments

Comments
 (0)