File tree 1 file changed +2
-15
lines changed
hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/SDWebServer
1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -111,23 +111,10 @@ bool loadFromSdCard(String path){
111
111
dataType = 0 ;
112
112
path = 0 ;
113
113
114
- uint8_t obuf[WWW_BUF_SIZE];
115
-
116
- while (dataFile.available () > WWW_BUF_SIZE){
117
- dataFile.read (obuf, WWW_BUF_SIZE);
118
- if (client.write (obuf, WWW_BUF_SIZE) != WWW_BUF_SIZE){
119
- DBG_OUTPUT_PORT.println (" Sent less data than expected!" );
120
- dataFile.close ();
121
- return true ;
122
- }
123
- }
124
- uint16_t leftLen = dataFile.available ();
125
- dataFile.read (obuf, leftLen);
126
- if (client.write (obuf, leftLen) != leftLen){
114
+ if (client.write (dataFile) != dataFile.size ()){
127
115
DBG_OUTPUT_PORT.println (" Sent less data than expected!" );
128
- dataFile.close ();
129
- return true ;
130
116
}
117
+
131
118
dataFile.close ();
132
119
client.stop ();
133
120
return true ;
You can’t perform that action at this time.
0 commit comments