Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
lzpong committed Jul 18, 2018
1 parent 2f56eae commit 8d0d904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tinyweb.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void tw_send_data(uv_stream_t* client, const void* data, size_t len, size_t need
//u8data:utf-8编码的数据
//content_length:数据长度,为-1时自动计算(strlen)
//respone_size:获取响应最终发送的数据长度,为0表示放不需要取此长度
void tw_send_200_OK(uv_stream_t* client, const char* content_type, const void* u8data, int content_length, int* respone_size);
void tw_send_200_OK(uv_stream_t* client, const char* content_type, const void* u8data, size_t content_length, size_t* respone_size);

//关闭客户端连接
void tw_close_client(uv_stream_t* client);
Expand Down
8 changes: 4 additions & 4 deletions tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ inline struct _finddata_t GetFileInfo(const char* lpPath)
{
struct _finddata_t fileinfo;
memset(&fileinfo, 0, sizeof(struct _finddata_t));
HANDLE hFind = _findfirst(lpPath, &fileinfo);
FindClose(hFind);
intptr_t hFind = _findfirst(lpPath, &fileinfo);
_findclose(hFind);
return fileinfo;
}

Expand Down Expand Up @@ -249,7 +249,7 @@ char* listDir(const char* fullpath, const char* reqPath)

//文件(size>-1) 或 目录(size=-1) [name:"file1.txt",mtime:"2016-11-28 16:25:46",size:123],\r\n
struct _finddatai64_t fdt;
HANDLE hFind;
intptr_t hFind;
char szFind[256];

snprintf(szFind, 255, "%s\\*", fullpath);
Expand Down Expand Up @@ -277,7 +277,7 @@ char* listDir(const char* fullpath, const char* reqPath)
if (_findnexti64(hFind, &fdt))
break;//下一个文件
}
FindClose(hFind);
_findclose(hFind);
//membuf_remove(&buf, buf.size-1, 1);
buf.data[--buf.size] = 0; buf.data[--buf.size] = 0;
membuf_append_format(&buf, "],total:%d}", fnum);
Expand Down

0 comments on commit 8d0d904

Please sign in to comment.