mirror of
https://github.com/lxsang/ant-http
synced 2025-07-13 13:04:23 +02:00
remove strdup calles
This commit is contained in:
12
lib/handle.c
12
lib/handle.c
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -135,4 +135,5 @@ wait for event
|
||||
*/
|
||||
void antd_wait(antd_scheduler_t *);
|
||||
|
||||
antd_callback_t* callback_of( void* (*callback)(void*) );
|
||||
#endif
|
Reference in New Issue
Block a user