This commit is contained in:
henrik
2021-03-17 16:01:19 +01:00
parent 617d7834cc
commit 27dec52bf7
4 changed files with 5 additions and 23 deletions

View File

@@ -58,7 +58,6 @@ func handlePrintJob(r *ipp.Request, byteStream io.Reader, requestID uint32) *ipp
j := l[len(l)-1]
joburi := r.GetAttribute("printer-uri").(*ipp.URIValue).Value() + "/" + j
log.Infof(">>>>>>>>>>>>>>>>>>>>>>joburi: %v", joburi)
response.AddJobAttribute(ipp.NewURIValue("job-uri", joburi))
}
response.AddJobAttribute(rb.GetAttribute("job-id"))

View File

@@ -41,17 +41,8 @@ func handle(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Unsupported method", http.StatusMethodNotAllowed)
}
//log.Info(r.Header)
//body := make([]byte, r.ContentLength)
//io.ReadFull(r.Body, body)
//log.Infof("Body %x", body)
request := ipp.NewRequest(0, 0)
//rdata := make([]byte, r.ContentLength)
//io.ReadFull(r.Body, rdata)
//log.Printf("Data %x", rdata)
//fmt.Printf("data % #0x", rdata)
//buf := bytes.NewBuffer(rdata)
request.UnMarshal(r.Body)
log.Infof("Upstream Request: \n%v\n", request)
var response *ipp.Response
@@ -72,8 +63,5 @@ func handle(w http.ResponseWriter, r *http.Request) {
log.Infof("Upstream Response:\n%v\n", response)
data := response.Marshal()
//log.Debugf("% x", data)
w.Write(data)
}