@@ -414,14 +414,15 @@ static int tls_read(URLContext *h, uint8_t *buf, int len)
return ret;
}
}
-
+ c->tls_shared.tcp->flags &= ~AVIO_FLAG_NONBLOCK;
+ c->tls_shared.tcp->flags |= h->flags & AVIO_FLAG_NONBLOCK;
ret = ffurl_read(s->tcp, c->enc_buf + c->enc_buf_offset,
c->enc_buf_size - c->enc_buf_offset);
if (ret == AVERROR_EOF) {
c->connection_closed = 1;
ret = 0;
} else if (ret < 0) {
- av_log(h, AV_LOG_ERROR, "Unable to read from socket\n");
+ av_log(h, AV_LOG_ERROR, "Unable to read from socket ret = [%s]\n", av_err2str(ret));
return ret;
}
-----------------------------------------
This way will get error code when ret < 0,
but all the hls PUT will success process,
there maybe have some risk for other module if merge this modify,
-----------------------------------------
Second way:
$ git diff
@@ -314,9 +314,11 @@ static int hlsenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filename)
#if CONFIG_HTTP_PROTOCOL
} else {
URLContext *http_url_context = ffio_geturlcontext(*pb);
+ const char *proto = avio_find_protocol_name(filename);
av_assert0(http_url_context);
avio_flush(*pb);
ffurl_shutdown(http_url_context, AVIO_FLAG_WRITE);
+ if (av_strcasecmp(proto, "https"))
ret = ff_http_get_shutdown_status(http_url_context);
#endif
}
-----------------------------------------
This way can fix the problem too,
But this will ignore all the http status which return from server base on all operating systems.
Third way:
@@ -317,7 +317,9 @@ static int hlsenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filename)
av_assert0(http_url_context);
avio_flush(*pb);
ffurl_shutdown(http_url_context, AVIO_FLAG_WRITE);
+#if !CONFIG_SCHANNEL
ret = ff_http_get_shutdown_status(http_url_context);
+#endif
#endif
}
return ret;