remove strdup calles

This commit is contained in:
lxsang
2019-12-22 14:33:42 +01:00
parent ea07981160
commit c429a7dd66
8 changed files with 51 additions and 66 deletions

View File

@ -670,17 +670,7 @@ int ws_enable(dictionary_t dic)
if(!v) return 0;
return atoi(v) == 1;
}
/**
* read the request as a string line format
* @param sock socket
* @return a request string
*/
char* read_line(void* sock)
{
char buf[BUFFLEN];
read_buf(sock,buf,sizeof(buf));
return strdup(buf);
}
/**
* Read the socket request in to a buffer or size
* The data is read until the buffer is full or

View File

@ -116,7 +116,6 @@ int upload(const char*, const char*);
void antd_error(void* client, int status, const char* msg);
int ws_enable(dictionary_t);
char* read_line(void* sock);
int read_buf(void* sock,char* buf,int i);
int antd_send( void *source, const void* data, int len);
int antd_recv( void *source, void* data, int len);

View File

@ -53,7 +53,7 @@ static antd_task_item_t dequeue(antd_task_queue_t* q)
}
static antd_callback_t* callback_of( void* (*callback)(void*) )
antd_callback_t* callback_of( void* (*callback)(void*) )
{
antd_callback_t* cb = NULL;
if(callback)

View File

@ -135,4 +135,5 @@ wait for event
*/
void antd_wait(antd_scheduler_t *);
antd_callback_t* callback_of( void* (*callback)(void*) );
#endif