Gentoo Archives: gentoo-commits

From: "Alex Alexander (wired)" <wired@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-im/bitlbee/files: bitlbee-3.0.3-msn-login-fix.patch
Date: Mon, 14 Nov 2011 23:31:59
Message-Id: 20111114233148.733F82004B@flycatcher.gentoo.org
1 wired 11/11/14 23:31:48
2
3 Added: bitlbee-3.0.3-msn-login-fix.patch
4 Log:
5 fix for msn login failures
6
7 (Portage version: 2.2.0_alpha74/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-im/bitlbee/files/bitlbee-3.0.3-msn-login-fix.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/bitlbee/files/bitlbee-3.0.3-msn-login-fix.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/bitlbee/files/bitlbee-3.0.3-msn-login-fix.patch?rev=1.1&content-type=text/plain
14
15 Index: bitlbee-3.0.3-msn-login-fix.patch
16 ===================================================================
17 fix for msn login failures
18
19 http://bugs.bitlbee.org/bitlbee/changeset/devel,824
20 --- lib/http_client.c.old
21 +++ lib/http_client.c
22 @@ -313,7 +313,7 @@
23 req->status_code = -1;
24 }
25
26 - if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 )
27 + if( ( req->status_code >= 301 && req->status_code <= 303 ) && req->redir_ttl-- > 0 )
28 {
29 char *loc, *new_request, *new_host;
30 int error = 0, new_port, new_proto;
31 @@ -374,10 +374,13 @@
32 /* So, now I just allocated enough memory, so I'm
33 going to use strcat(), whether you like it or not. :-) */
34
35 - sprintf( new_request, "GET %s HTTP/1.0", url->file );
36 + s = 0;
37 + sprintf( new_request, "%s %s HTTP/1.0\r\nHost: %s",
38 + req->status_code == 303 || req->request[0] == 'G' ? "GET" : "POST", url->file, url->host );
39 + s = ' ';
40
41 - s = strstr( req->request, "\r\n" );
42 - if( s == NULL )
43 + if( !( ( s = strstr( req->request, "\r\nHost: " ) ) &&
44 + ( s = strstr( s + strlen( "\r\nHost: " ), "\r\n" ) ) ) )
45 {
46 req->status_string = g_strdup( "Error while rebuilding request string" );
47 g_free( new_request );