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 681493 - Add a way to avoid need_new_connection
Add a way to avoid need_new_connection
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.38.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-09 05:58 UTC by Milan Crha
Modified: 2012-08-20 10:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lsp patch (891 bytes, patch)
2012-08-09 06:04 UTC, Milan Crha
rejected Details | Review
proposed lsp patch ][ (2.33 KB, patch)
2012-08-13 12:32 UTC, Milan Crha
none Details | Review

Description Milan Crha 2012-08-09 05:58:26 UTC
As we spoke with Dan on IRC, the POST method is not considered idempotent (it is not part of SOUP_METHOD_IS_IDEMPOTENT() macro), thus when using it, then even with idle connection it cannot be reused and libsoup keeps to reconnect to the server, which is unnecessary and only slows down things. Testing with my server suggests that adding the POST to idempotent macro works as expected.

Looking around, I guess POST is also safe (SOUP_METHOD_IS_SAFE()), isn't it?
Comment 1 Milan Crha 2012-08-09 06:04:32 UTC
Created attachment 220760 [details] [review]
lsp patch

for libsoup;

Here's a patch for it, which also fixes a header define to correspond to file name.

I looked on SOUP_METHOD_IS_SAFE() usage and the POST doesn't belong there, thus I didn't change that part (and I also answered my above question).
Comment 2 Dan Winship 2012-08-09 11:18:20 UTC
Comment on attachment 220760 [details] [review]
lsp patch

(as discussed in email)
Comment 3 Dan Winship 2012-08-09 11:23:30 UTC
Responding to your email here:

> With respect of conflict resolution after POST, exchange servers use
> ChangeKey on items/folders, which is mandatory on certain operations,
> and it's used to ensure that the caller modifies what he/she wants to
> modify. Thus they manage conflicts on their side.

So I guess we want a SoupMessageFlag for this... SOUP_MESSAGE_IDEMPOTENT I guess?

> Thinking of it, the GET is not idempotent in your definition too in
> certain cases.

Yes, but it's *supposed* to be according to the spec, and it's considered a bug when it's not...
Comment 4 Milan Crha 2012-08-10 12:05:44 UTC
(In reply to comment #3)
> So I guess we want a SoupMessageFlag for this... SOUP_MESSAGE_IDEMPOTENT I
> guess?

Yes, that will make it too. I can add it to evolution-ews, when you'll have it in sources. Do you want me to create the right patch?
Comment 5 Dan Winship 2012-08-10 12:56:54 UTC
Sure. (Preferably as a "git format-patch" style patch.)
Comment 6 Milan Crha 2012-08-13 12:32:02 UTC
Created attachment 221015 [details] [review]
proposed lsp patch ][

for libsoup;

Here you are. I noticed that with this patch I end up with SoupSocket 2, instead of 1 for some reason (in debug logs of libsoup), I guess it's because of NTLM? Though I think I saw only 1 socket being used with the previous patch. Anyway, this is still much better than before.
Comment 7 Dan Winship 2012-08-19 19:06:39 UTC
pushed with slightly-edited docs and commit message
Comment 8 Milan Crha 2012-08-20 10:25:59 UTC
Thanks.