Don't continue sending the file when there has been an error
[asterisk/asterisk.git] / main / http.c
index 89bde86..dcbfc4d 100644 (file)
@@ -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;
                                }
                        }
                }