enhancing the directory handling in http-file.c
This commit is contained in:
@ -171,7 +171,7 @@ typedef enum hio_svc_htts_file_bfmt_dir_type_t hio_svc_htts_file_bfmt_dir_type_t
|
||||
|
||||
struct hio_svc_htts_file_cbs_t
|
||||
{
|
||||
int (*bfmt_dir) (hio_svc_htts_t* htts, int fd, hio_svc_htts_file_bfmt_dir_type_t type, const hio_bch_t* name, void* ctx);
|
||||
int (*bfmt_dir) (hio_svc_htts_t* htts, int fd, const hio_bch_t* qpath, hio_svc_htts_file_bfmt_dir_type_t type, const hio_bch_t* name, void* ctx);
|
||||
void *ctx;
|
||||
};
|
||||
typedef struct hio_svc_htts_file_cbs_t hio_svc_htts_file_cbs_t;
|
||||
|
@ -719,12 +719,12 @@ static int open_peer_for_dir_listing (file_t* file, const hio_bch_t* dir_path, i
|
||||
if (file->cbs && file->cbs->bfmt_dir)
|
||||
{
|
||||
/* TODO: can support sorting?? */
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, HIO_SVC_HTTS_FILE_BFMT_DIR_HEADER, HIO_NULL, file->cbs->ctx);
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, file->req_qpath, HIO_SVC_HTTS_FILE_BFMT_DIR_HEADER, HIO_NULL, file->cbs->ctx);
|
||||
while ((de = readdir(dp)))
|
||||
{
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, HIO_SVC_HTTS_FILE_BFMT_DIR_ENTRY, de->d_name, file->cbs->ctx);
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, file->req_qpath, HIO_SVC_HTTS_FILE_BFMT_DIR_ENTRY, de->d_name, file->cbs->ctx);
|
||||
}
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, HIO_SVC_HTTS_FILE_BFMT_DIR_FOOTER, HIO_NULL, file->cbs->ctx);
|
||||
file->cbs->bfmt_dir (file->htts, alt_fd, file->req_qpath, HIO_SVC_HTTS_FILE_BFMT_DIR_FOOTER, HIO_NULL, file->cbs->ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user