GNOME Bugzilla – Bug 711865
g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed
Last modified: 2013-12-21 17:00:25 UTC
If an error occurs when opening a file for writing (e.g. opening a directory, which generates a 553 error), the following occurs and all further requests hang: -- 0 -> PASV <- 0 -- 227 Entering Passive Mode (127,0,0,1,235,239) ** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed -- 0 -> PASV <- 0 -- 227 Entering Passive Mode (127,0,0,1,61,5) ** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed ** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed -- 0 -> EPSV <- 0 -- 229 Extended Passive mode OK (|||20371|) ** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed ** (process:1555): CRITICAL **: g_vfs_ftp_connection_listen_data_connection: assertion 'conn->data == NULL' failed ** (process:1555): CRITICAL **: g_vfs_ftp_connection_listen_data_connection: assertion 'conn->data == NULL' failed To reproduce (against a Pure-FTPd server): $ gvfs-save -a ftp://ross@localhost/Public/data Error opening file: Invalid filename $ gvfs-save -a ftp://ross@localhost/Public/data # ... hang
Created attachment 259594 [details] [review] ftp: Always close the data connection when an error occurs If an error occurs when receiving an ftp code, close any potentially open data connection to prevent the open data connection confusing further operations. When this happens warnings of the following form appear: ** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed It can be reproduced against a Pure-FTPd server by running the following command twice: gvfs-save -a ftp://host/some/dir
Created attachment 264660 [details] [review] ftp: Always close data connections when done Opening data connections is a complex process and can fail in multiple stages. Instead of requiring the code to close them manually and throwing assertions when that doesn't work we just clean up after all jobs automatically.
Review of attachment 264660 [details] [review]: LGTM. Thanks!
Comment on attachment 264660 [details] [review] ftp: Always close data connections when done Attachment 264660 [details] pushed as 28cf48f - ftp: Always close data connections when done