[PATCH] [BUG] http.c does not follow redirections at all
"Angel Fradejas" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Current http.c does not follow 302 Location redirections at all. I tracked down the problem down to the handle_transaction() function. If we leave trans->host and trans->port set there, there will be no parse_url() for the redirection, and the original url is fetched again and again :-( Attached is a patch that fixes it. I've created a bug report in mantis anyway. Angel Fradejas Mediafusión España, S.A. [email protected] www.mediafusion.es Tel. +34 91 252 32 00 Fax +34 91 572 27 08
http_redirection_fix.diff
(application/octet-stream, 762 B)
Index: gwlib/http.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/http.c,v
retrieving revision 1.187
diff -u -r1.187 http.c
--- gwlib/http.c 9 Mar 2003 13:25:38 -0000 1.187
+++ gwlib/http.c 28 Mar 2003 12:46:15 -0000
@@ -996,6 +996,17 @@
if (h != NULL) {
octstr_strip_blanks(h);
octstr_destroy(trans->url);
+ octstr_destroy(trans->host);
+ trans->port = 0;
+ octstr_destroy(trans->uri);
+ octstr_destroy(trans->username);
+ octstr_destroy(trans->password);
+ trans->host = NULL;
+ trans->port = 0;
+ trans->uri = NULL;
+ trans->username = NULL;
+ trans->password = NULL;
+ trans->ssl = 0;
trans->url = h;
trans->state = request_not_sent;
trans->status = -1;