2-add-keyword-support (#6)
More development. More types. Fixed attribute groups in requests. Started on client. Saving data to file. More types. Printing from chromeos works a little bit. More types. Spelling corrections. WIP: Fix keyword handling Move request to a separate file and add test. Co-authored-by: Henrik Sölver <henrik.solver@gmail.com> Reviewed-on: #6 Co-Authored-By: henrik <henrik.solver@gmail.com> Co-Committed-By: henrik <henrik.solver@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
22
server/handleprintjob.go
Normal file
22
server/handleprintjob.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"ippserver/packages/ipp"
|
||||
"os"
|
||||
)
|
||||
|
||||
func handlePrintJob(r *ipp.Request, byteStream io.Reader) *ipp.Response {
|
||||
|
||||
a := r.GetAttribute("job-name")
|
||||
//a.(nameWithoutLanguage).Value
|
||||
f, err := os.Create(a.(*ipp.NameWithoutLanguage).Value())
|
||||
if err != nil {
|
||||
panic("fail")
|
||||
}
|
||||
defer f.Close()
|
||||
io.Copy(f, byteStream)
|
||||
response := ipp.NewResponse(ipp.SuccessfulOk, r.RequestId())
|
||||
|
||||
return response
|
||||
}
|
||||
Reference in New Issue
Block a user