Commit Graph

40 Commits

Author SHA1 Message Date
Steve Grubb
30bc602db0 Fix unnecessary error checks 2009-10-02 11:18:40 +02:00
Steve Grubb
2e926fb016 Fix memory leaks
I was doing some code reviews of the 4.54 release and found a few memory
leaks. These are mostly in error paths.
2009-10-02 11:18:16 +02:00
Till Kamppeter
74799904f8 Make discovery mode work with CUPS 1.4.x
The new CUPS 1.4.x does device discovery only for a given time frame
requested by the client (printer setup tool, "lpinfo" command). CUPS's
default for CUPS-1.3.x-ish requests without timeout specification
seems to be 10 seconds. CUPS starts all backends at once in the
beginning (in parallel) and kills every backend which remains running
at the end of the timeout. It accepts output from the backends
whenever it occurs not only when the backend finishes, so a backend
can search for printers infinitely long if it outputs every found
device immediately. Then all printers found during CUPS' timeout are
taken into account.

The bluetooth backend of 4.48 asks the Bluetooth daemon for printers
and collects results for 10 seconds and after that it outputs
them. This takes a total of 10.5 sec and so CUPS kills the backend
right before it answers (at least with the 10-second default timeout),
resulting in Bluetooth printers never being discovered by CUPS.

This change fixes it by making each new printer added to the list
being output immediately. Note that the list structure cannot be
removed from cups/main.c as otherwise we would get duplicate
listings. Also important is the addition of unbuffered output on
stdout.
2009-08-30 09:26:56 -07:00
Marcel Holtmann
a5b1e3d02c Switch to a full non-recursive build system 2009-08-23 00:40:59 -07:00
Bastien Nocera
5929a3c52d Actually read the CreateDevice reply
Fixes aborts when the printer isn't a known device.
2009-08-11 15:31:28 -07:00
Bastien Nocera
8782cdd9ee Don't abort cups backend on property change
Make sure the cups backend doesn't abort when trying to
access a property that's not Discovering.
2009-08-11 15:31:01 -07:00
Till Kamppeter
b9ce196c06 Mark Bluetooth printers as being local
For discovery purposes. Also add a better label for the printer,
and append "(Bluetooth") to the "unique" name.
2009-08-11 15:13:14 -07:00
Bastien Nocera
03a49242f7 Less errors from the cups backend
Don't error out when either D-Bus isn't available,
bluetoothd isn't running, or there's no adapters.
2009-06-27 12:25:57 +02:00
Johan Hedberg
1ac96952d1 Fix device_get_ieee1284_id return value 2009-03-14 10:27:46 -03:00
Bastien Nocera
a6e265bcd6 Port CUPS discovery to BlueZ 4.x
Adapt CUPS printer discovery to the BlueZ 4.x API.
2009-03-13 15:12:00 -03:00
Marcel Holtmann
9c0b5859e6 Fix mostly every warning caused by -Wsign-compare 2009-01-29 17:58:28 +01:00
Marcel Holtmann
fb333f1c88 Update copyright information 2009-01-01 19:33:20 +01:00
Marcel Holtmann
0a14f620f8 Fix inclusion of SDP and protocol function declarations 2008-12-23 05:55:16 +01:00
Marcel Holtmann
56726c8298 Use correct object path for manager interface 2008-10-31 22:49:33 +01:00
Marcel Holtmann
0124ee98f7 Add temporary fix for the CUPS compile issue 2008-09-06 18:55:26 +02:00
Marcel Holtmann
aa215d6fa5 Emulate libgdbus API for mainloop integration 2008-05-08 19:39:12 +00:00
Marcel Holtmann
33191e6275 Move D-Bus mainloop integration into libgdbus 2008-05-08 19:12:44 +00:00
Marcel Holtmann
a71ed7ebdf Add CLASS support and retry on unavailable printers 2008-03-14 14:21:01 +00:00
Marcel Holtmann
69f9e21b46 Fix CUPS error and state reporting 2008-03-06 10:46:26 +00:00
Marcel Holtmann
cf824c4d12 Remove the support for SDP parsing via expat 2008-03-05 20:03:08 +00:00
Marcel Holtmann
e823c15e43 Update copyright information 2008-02-02 03:37:05 +00:00
Marcel Holtmann
0ab5125673 Let CUPS plugin discover printers in range 2007-06-07 10:07:13 +00:00
Marcel Holtmann
afa617e410 Don't create backend directory if disabled 2006-08-20 02:21:03 +00:00
Marcel Holtmann
493a35c0e0 Install cups backend only when enabled 2006-08-20 02:14:05 +00:00
Marcel Holtmann
b102348e98 Fix declared with attribute warn_unused_result errors 2006-07-26 13:32:44 +00:00
Marcel Holtmann
f2e48c44a7 Update copyright information 2006-01-03 13:28:56 +00:00
Marcel Holtmann
632a943277 Big cleanup of CVS relics 2005-10-29 22:36:31 +00:00
Marcel Holtmann
1f422e5f2b Fix some GCC 4.0 warnings 2005-07-05 21:15:41 +00:00
Marcel Holtmann
adbb22a47c Use LDADD instead of LIBS 2005-04-21 21:34:08 +00:00
Marcel Holtmann
bbda499067 Add memset() to different places to initialize the structures 2004-12-25 17:43:16 +00:00
Marcel Holtmann
b2622e897b Print a dummy device list when called with no arguments 2004-08-18 10:38:50 +00:00
Marcel Holtmann
c37be1ab24 Make more parts optional 2004-07-27 13:01:42 +00:00
Marcel Holtmann
dc56ba1a60 Retry SDP connect if busy 2004-07-22 18:10:03 +00:00
Marcel Holtmann
15c1cf1ca0 Make use of MAINTAINERCLEANFILES 2004-07-21 15:20:28 +00:00
Marcel Holtmann
43f017c952 Use AM_CFLAGS instead of INCLUDES 2004-07-21 15:05:27 +00:00
Marcel Holtmann
7ac6ede99a Use LIBS instead of LDFLAGS 2004-05-23 10:39:50 +00:00
Marcel Holtmann
ae9e56a7b1 Add missing include of sys/socket.h 2004-05-09 00:21:31 +00:00
Marcel Holtmann
7aebf78831 Use definitions from the Bluetooth library 2004-05-02 21:55:36 +00:00
Marcel Holtmann
8566cd3b75 Moved the sdp_get_add_access_protos() function into the Bluetooth library 2004-05-02 21:45:21 +00:00
Marcel Holtmann
bc08505422 Add Bluetooth backend for CUPS 2004-05-02 03:36:18 +00:00