[FFmpeg-cvslog] ffserver: increase buffer size in http_send_too_busy_reply()
Michael Niedermayer
git at videolan.org
Sun Sep 9 14:23:14 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Sep 9 13:35:01 2012 +0200| [9c6af3a3db9a85956680060696014635ee949641] | committer: Michael Niedermayer
ffserver: increase buffer size in http_send_too_busy_reply()
also add a assert0 to make sure the data is not truncated (which
should be impossible now)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c6af3a3db9a85956680060696014635ee949641
---
ffserver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ffserver.c b/ffserver.c
index 82d3288..2bd92a1 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -40,6 +40,7 @@
#include "libavformat/internal.h"
#include "libavformat/url.h"
+#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/lfg.h"
#include "libavutil/dict.h"
@@ -762,7 +763,7 @@ static void start_wait_request(HTTPContext *c, int is_rtsp)
static void http_send_too_busy_reply(int fd)
{
- char buffer[300];
+ char buffer[400];
int len = snprintf(buffer, sizeof(buffer),
"HTTP/1.0 503 Server too busy\r\n"
"Content-type: text/html\r\n"
@@ -772,6 +773,7 @@ static void http_send_too_busy_reply(int fd)
"<p>The number of current connections is %d, and this exceeds the limit of %d.</p>\r\n"
"</body></html>\r\n",
nb_connections, nb_max_connections);
+ av_assert0(len < sizeof(buffer));
send(fd, buffer, len, 0);
}
More information about the ffmpeg-cvslog
mailing list