After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777326 - Session is not aborted after a new proxy resolver is set
Session is not aborted after a new proxy resolver is set
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.57.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks: 781590
 
 
Reported: 2017-01-16 14:08 UTC by Carlos Garcia Campos
Modified: 2017-04-26 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Abort session after a new proxy resolver is set (1.67 KB, patch)
2017-01-16 14:10 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2017-01-16 14:08:28 UTC
It's done for the proxy uri property but not for the proxy-resolver one.
Comment 1 Carlos Garcia Campos 2017-01-16 14:10:24 UTC
Created attachment 343555 [details] [review]
Abort session after a new proxy resolver is set
Comment 2 Michael Catanzaro 2017-02-13 14:36:12 UTC
I dunno about this one. The current behavior is clearly intentional, but I would think that you would always want an abort after changing the proxy settings to ensure nothing gets sent with the old settings?
Comment 3 Carlos Garcia Campos 2017-02-14 17:04:18 UTC
(In reply to Michael Catanzaro from comment #2)
> I dunno about this one. The current behavior is clearly intentional, but I
> would think that you would always want an abort after changing the proxy
> settings to ensure nothing gets sent with the old settings?

It could be clearly intentional for you, but Dan told me on IRC that it wasn't, and that we always want to abort when changing proxy settings
Comment 4 Michael Catanzaro 2017-02-14 17:54:07 UTC
I think Dan must have intended it to be this way at the time the code was written:

	case PROP_PROXY_URI:
		set_proxy_resolver (session, g_value_get_boxed (value),
				    NULL, NULL);
		soup_session_abort (session);
		socket_props_changed = TRUE;
		break;
	case PROP_PROXY_RESOLVER:
		set_proxy_resolver (session, NULL, NULL,
				    g_value_get_object (value));
		socket_props_changed = TRUE;
		break;

It would be pretty much impossible to just forget to call soup_session_abort() there, when you can see it's there just a couple lines up. And the documentation indicates the difference as well.

(But again, I have no clue why the current behavior would be desirable.)
Comment 5 Dan Winship 2017-02-20 19:58:50 UTC
Comment on attachment 343555 [details] [review]
Abort session after a new proxy resolver is set

Yeah, I think it ought to abort. Probably the only reason it doesn't is that I assumed people were only ever going to set that property at construct time anyway...

Really, all we need to do is ensure that all currently-open connections get closed after their current request completes (so we don't keep using a non-proxied or incorrectly-proxied connection for an arbitrarily long time after changing the proxy resolution rules). However (a) there is no function that does that, and (b) we assume people aren't going to change their proxy resolver a lot anyway. So, we just abort, because it's simpler.
Comment 6 Milan Crha 2017-04-26 15:38:10 UTC
This caused regression filled as bug #781590.