From: Terry Wilson Date: Tue, 15 Jun 2010 21:42:33 +0000 (+0000) Subject: Don't continue sending the file when there has been an error X-Git-Tag: 11.0.0-beta1~2833 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de18661beeda1c0d868a76157e970001b98e1b1a;p=thirdparty%2Fasterisk.git Don't continue sending the file when there has been an error If there is a problem with a firmware file, Polycom phones will close the connection. We were continuing to send the file anyway. There should be no reason to continue sending a file if there is an error writing it. (closes issue #16682) Reported by: lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270692 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/http.c b/main/http.c index 89bde86799..dcbfc4d665 100644 --- a/main/http.c +++ b/main/http.c @@ -415,6 +415,7 @@ void ast_http_send(struct ast_tcptls_session_instance *ser, while ((len = read(fd, buf, sizeof(buf))) > 0) { if (fwrite(buf, len, 1, ser->f) != 1) { ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno)); + break; } } }