comparison stream/http.c @ 32630:2653cb380532

Add support for HTTP 307 (Temporary Redirect) responses. Patch by chocolateboy (chocolateboy from cpan org)
author cboesch
date Thu, 16 Dec 2010 19:58:35 +0000
parents be61988fb5c4
children 146fb0958630
comparison
equal deleted inserted replaced
32629:7afaaaa3f4f4 32630:2653cb380532
238 break; 238 break;
239 // Redirect 239 // Redirect
240 case 301: // Permanently 240 case 301: // Permanently
241 case 302: // Temporarily 241 case 302: // Temporarily
242 case 303: // See Other 242 case 303: // See Other
243 case 307: // Temporarily (since HTTP/1.1)
243 ret=-1; 244 ret=-1;
244 next_url = http_get_field( http_hdr, "Location" ); 245 next_url = http_get_field( http_hdr, "Location" );
245 246
246 if (next_url != NULL) 247 if (next_url != NULL)
247 rd_url=url_new(next_url); 248 rd_url=url_new(next_url);
811 goto out; 812 goto out;
812 // Redirect 813 // Redirect
813 case 301: // Permanently 814 case 301: // Permanently
814 case 302: // Temporarily 815 case 302: // Temporarily
815 case 303: // See Other 816 case 303: // See Other
817 case 307: // Temporarily (since HTTP/1.1)
816 // TODO: RFC 2616, recommand to detect infinite redirection loops 818 // TODO: RFC 2616, recommand to detect infinite redirection loops
817 next_url = http_get_field( http_hdr, "Location" ); 819 next_url = http_get_field( http_hdr, "Location" );
818 if( next_url!=NULL ) { 820 if( next_url!=NULL ) {
819 int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; 821 int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0;
820 stream->streaming_ctrl->url = url_redirect( &url, next_url ); 822 stream->streaming_ctrl->url = url_redirect( &url, next_url );