mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 00:38:21 +01:00
remove warning
This commit is contained in:
parent
b72ea610c7
commit
0e84e46fab
@ -145,7 +145,7 @@ char* ext(const char* file)
|
||||
if(file == NULL) return NULL;
|
||||
char* str_cpy = strdup(file);
|
||||
char* str_org = str_cpy;
|
||||
if(strstr(str_cpy,".")<= 0)
|
||||
if(!strstr(str_cpy,"."))
|
||||
{
|
||||
free(str_org);
|
||||
return NULL;
|
||||
|
@ -95,7 +95,7 @@ int ws_read_data(void* client, ws_msg_header_t* header, int len, uint8_t* data)
|
||||
{
|
||||
// if len == -1 ==> read all remaining data to 'data';
|
||||
if(header->plen == 0) return 0;
|
||||
int dlen = (len==-1 || len > (int)header->plen)?header->plen:len;
|
||||
int dlen = (len==-1 || len > (int)header->plen)?(int)header->plen:len;
|
||||
if((dlen = antd_recv(client,data, dlen)) <0) return -1;
|
||||
header->plen = header->plen - dlen;
|
||||
// unmask received data
|
||||
@ -220,8 +220,6 @@ void ws_send_file(void* client, const char* file, int mask)
|
||||
while(!feof(ptr))
|
||||
{
|
||||
size = fread(buff,1,1024,ptr);
|
||||
if(size >= 0)
|
||||
{
|
||||
if(feof(ptr))
|
||||
header.fin = 1;
|
||||
else
|
||||
@ -238,7 +236,6 @@ void ws_send_file(void* client, const char* file, int mask)
|
||||
//printf("FIN: %d OC:%d\n", header.fin, header.opcode);
|
||||
ws_send_frame(client,buff,header);
|
||||
}
|
||||
}
|
||||
fclose(ptr);
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user