Przeglądaj źródła

Fix mg_send_chunk return value check in example (#1026)

bel2125 3 lat temu
rodzic
commit
a55f5f72fc
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      examples/embedded_c/embedded_c.c

+ 1 - 1
examples/embedded_c/embedded_c.c

@@ -655,7 +655,7 @@ PostResponser(struct mg_connection *conn, void *cbdata)
 	while (r > 0) {
 	while (r > 0) {
 		r_total += r;
 		r_total += r;
 		s = mg_send_chunk(conn, buf, r);
 		s = mg_send_chunk(conn, buf, r);
-		if (r != s) {
+		if (s <= 0) {
 			/* Send error */
 			/* Send error */
 			break;
 			break;
 		}
 		}