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>
23 lines
423 B
Go
23 lines
423 B
Go
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
|
|
}
|