Control: tag -1 + patch upstream

On 03/20/2015 04:11 PM, Ansgar Burchardt wrote:
> gnome-settings-daemon keeps >1000 tcp connections to a remote ipp port
> in CLOSE-WAIT state. From the output from `ss -t':

The bug can be triggered by printing stuff: every time I send a document
to the remote print server, gnome-settings-daemon will leak a file
descriptor with a connection to the print server a bit later.

Running "xvfb-run -a strace -e connect,close gnome-settings-daemon" as a
different user was enough to observe this problem.

I noticed that
  plugins/print-notifications/gsd-print-notifications-manager.c
calls httpConnectEncrypt() in three places, but httpClose() is only
called in renew_subscription().  httpClose() will close the file
descriptor as part of the cleanup...

After adding calls to httpClose() in process_cups_notification() and
cancel_subscription() the file descriptor leak seems to have stopped.
I've attached the patch.

Ansgar

--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -443,6 +443,7 @@
                                 ippDelete(response);
                         }
                         g_free (job_uri);
+                        httpClose (http);
                 }
         }
 
@@ -1040,6 +1041,7 @@
                 ippAddInteger (request, IPP_TAG_OPERATION, IPP_TAG_INTEGER,
                               "notify-subscription-id", id);
                 ippDelete (cupsDoRequest (http, request, "/"));
+                httpClose (http);
         }
 }
 

Reply via email to