meiru at gmx.net
Thu Sep 1 08:06:21 PDT 2005
I'm trying to build a custom backend for cups. It should do the same as the "socket" backend, but it should first send the string "dps", before sending the printjob.
So, I took the "socket"-backend sourcecode and changed what it returns if the argc is 1 to this:
puts("network socket \"dps\" \"dps backend\"");
and then, after this first if/elseif I inserted this:
argv = "socket://192.168.0.1:9000" to overwrite the address, because I want, that it always connects to this server (at least now).
The last change I made is this: I inserted a block after the "if (argc < 7)" block which sets SIGTERM to ignore.
if (send(fd, "dps", 3, 0) < 0)
perror("ERROR: Unable to send print file to printer");
Now, what happens? If I configure my printer to use the address "socket://192.168.0.1:9000" it works, but it seemes to use the standard socket backend (I don't get the "dps" string at the server). So I thought, maybe I have to change the address to "dps://192.168.0.1:9000" (for the backend itself it doesn't make a difference, since it's overwritten)... but then I get a error -> "client-error-not-possible"
can someone explain me what's wrong? I thought, what I want to get shouldn't be very difficult...
thanks for your help
More information about the cups