main/task_http.c

changeset 93
24cb415af787
parent 91
255a75322212
child 94
87aa80b8e452
equal deleted inserted replaced
92:bac0a860f5dd 93:24cb415af787
190 190
191 /* 191 /*
192 * If we have a If-Modified-Since parameter, compare that with the current 192 * If we have a If-Modified-Since parameter, compare that with the current
193 * filedate on disk. If It's the same send a 304 response. 193 * filedate on disk. If It's the same send a 304 response.
194 * Cannot work on /spiffs. 194 * Cannot work on /spiffs.
195 * Update 18-05-2021 it seems better on idf 4.2.1 but still not correct.
195 */ 196 */
196 #if 0 197 #if 0
197 time_t Now; 198 time_t Now;
198 struct tm timeInfo; 199 struct tm timeInfo;
199 if (mod_since && strlen(strftime_buf)) { 200 if (mod_since && strlen(strftime_buf)) {
200 time(&Now); 201 time(&Now);
201 localtime_r(&Now, &timeInfo); 202 localtime_r(&Now, &timeInfo);
202 strftime(strftime_buf, sizeof(strftime_buf), "%a, %d %b %Y %T %z", &timeInfo); 203 strftime(strftime_buf, sizeof(strftime_buf), "%a, %d %b %Y %T %z", &timeInfo);
203 sprintf(header, "HTTP/1.1 304 Not Modified\r\nDate: %s\r\n\r\n", strftime_buf); 204 sprintf(header, "HTTP/1.1 304 Not Modified\r\nDate: %s\r\n\r\n", strftime_buf);
204 netconn_write(conn, header, strlen(header), NETCONN_NOCOPY); 205 netconn_write(conn, header, strlen(header), NETCONN_NOCOPY);
205 ESP_LOGI(TAG, "http_sendfile %s Not Modified, ok", temp_url); 206 ESP_LOGI(TAG, "%s sendfile %s Not Modified, ok", ipstr, temp_url);
206 return; 207 return;
207 } 208 }
208 #endif 209 #endif
209 210
210 if (send_gz) { 211 if (send_gz) {

mercurial