* limitations under the License.
*/
-#define _XOPEN_SOURCE 500 /* strptime() ... */
-#define _BSD_SOURCE /* scandir() ... */
+#define _XOPEN_SOURCE 500 /* strptime() */
+#define _BSD_SOURCE /* scandir(), timegm() */
#include "uhttpd.h"
#include "uhttpd-utils.h"
return strcmp(e->d_name, ".") ? 1 : 0;
}
-static void uh_file_dirlist(struct client *cl, struct http_request *req, struct uh_path_info *pi)
+static void uh_file_dirlist(struct client *cl, struct http_request *req, struct path_info *pi)
{
int i, count;
char filename[PATH_MAX];
}
-void uh_file_request(struct client *cl, struct http_request *req, struct uh_path_info *pi)
+void uh_file_request(struct client *cl, struct http_request *req, struct path_info *pi)
{
int fd, rlen;
char buf[UH_LIMIT_MSGHEAD];
/* pump file data */
while( (rlen = read(fd, buf, sizeof(buf))) > 0 )
{
- uh_http_send(cl, req, buf, rlen);
+ if( uh_http_send(cl, req, buf, rlen) < 0 )
+ break;
}
/* send trailer in chunked mode */