[3/5] http: Reorder two code blocks

Message ID 1321014025-81875-3-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö Nov. 11, 2011, 12:20 p.m.
---
 libavformat/http.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

Comments

Anton Khirnov Nov. 18, 2011, 8:03 a.m. | #1
On Fri, 11 Nov 2011 14:20:23 +0200, Martin Storsjö <martin@martin.st> wrote:
> ---
>  libavformat/http.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 

You could mention a reason for this, so future generations
don't have to figure it out.

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index e476fa1..48986bc 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -110,6 +110,14 @@  static int http_open_cnx(URLContext *h)
                  path1, sizeof(path1), s->location);
     ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, hostname, port, NULL);
 
+    if (!strcmp(proto, "https")) {
+        lower_proto = "tls";
+        if (port < 0)
+            port = 443;
+    }
+    if (port < 0)
+        port = 80;
+
     if (path1[0] == '\0')
         path = "/";
     else
@@ -124,13 +132,6 @@  static int http_open_cnx(URLContext *h)
         av_url_split(NULL, 0, proxyauth, sizeof(proxyauth),
                      hostname, sizeof(hostname), &port, NULL, 0, proxy_path);
     }
-    if (!strcmp(proto, "https")) {
-        lower_proto = "tls";
-        if (port < 0)
-            port = 443;
-    }
-    if (port < 0)
-        port = 80;
 
     ff_url_join(buf, sizeof(buf), lower_proto, NULL, hostname, port, NULL);
     err = ffurl_open(&hd, buf, AVIO_FLAG_READ_WRITE);