Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Jun 2012 17:52:35 +0000 (19:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Jun 2012 17:59:39 +0000 (19:59 +0200)
* qatar/master:
  http: Add the url_shutdown function for https, too
  http: Simplify code by removing a local variable
  http: Clear the old URLContext pointer when closed
  tcp: Try enabling SO_REUSEADDR when listening
  tcp: Check the return values from bind and accept
  avisynth: Make sure the filename passed to avisynth is in the right code page

Conflicts:
libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/avisynth.c
libavformat/http.c
libavformat/tcp.c

Simple merge
@@@ -163,8 -157,8 +160,7 @@@ static int http_open_cnx(URLContext *h
      if (s->http_code == 401) {
          if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
              s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
-             ffurl_closep(&hd);
 -            ffurl_close(s->hd);
--            s->hd = NULL;
++            ffurl_closep(&s->hd);
              goto redo;
          } else
              goto fail;
      if (s->http_code == 407) {
          if ((cur_proxy_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
              s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
-             ffurl_closep(&hd);
 -            ffurl_close(s->hd);
--            s->hd = NULL;
++            ffurl_closep(&s->hd);
              goto redo;
          } else
              goto fail;
      if ((s->http_code == 301 || s->http_code == 302 || s->http_code == 303 || s->http_code == 307)
          && location_changed == 1) {
          /* url moved, get next */
-         ffurl_closep(&hd);
 -        ffurl_close(s->hd);
--        s->hd = NULL;
++        ffurl_closep(&s->hd);
          if (redirects++ >= MAX_REDIRECTS)
              return AVERROR(EIO);
          /* Restart the authentication process with the new target, which
      }
      return 0;
   fail:
-     if (hd)
-         ffurl_closep(&hd);
-     s->hd = NULL;
+     if (s->hd)
 -        ffurl_close(s->hd);
 -    s->hd = NULL;
++        ffurl_closep(&s->hd);
      return AVERROR(EIO);
  }
  
Simple merge