change SFServerInfo to ConnectionInfo
parent
1928ae42cc
commit
b622ed6b63
|
|
@ -19,7 +19,7 @@
|
|||
#include "sf_global.h"
|
||||
#include "sf_func.h"
|
||||
|
||||
int sf_parse_server_info(const char* pServerStr, SFServerInfo* pServerInfo,
|
||||
int sf_parse_server_info(const char *pServerStr, ConnectionInfo *pServerInfo,
|
||||
const int default_port)
|
||||
{
|
||||
char *parts[2];
|
||||
|
|
@ -67,12 +67,13 @@ int sf_parse_server_info(const char* pServerStr, SFServerInfo* pServerInfo,
|
|||
__LINE__, pServerStr, parts[0]);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
pServerInfo->socket_domain = AF_INET;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sf_load_server_info(IniContext *pIniContext, const char *filename,
|
||||
const char *item_name, SFServerInfo *pServerInfo,
|
||||
const char *item_name, ConnectionInfo *pServerInfo,
|
||||
const int default_port)
|
||||
{
|
||||
char *pServerStr;
|
||||
|
|
@ -113,4 +114,3 @@ int sf_connect_to_server(const char *ip_addr, const int port, int *sock)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
int sf_load_server_info(IniContext *pIniContext, const char *filename,
|
||||
const char *item_name, SFServerInfo *pServerInfo,
|
||||
const char *item_name, ConnectionInfo *pServerInfo,
|
||||
const int default_port);
|
||||
|
||||
int sf_parse_server_info(const char* pServerStr, SFServerInfo* pServerInfo,
|
||||
int sf_parse_server_info(const char *pServerStr, ConnectionInfo *pServerInfo,
|
||||
const int default_port);
|
||||
|
||||
int sf_connect_to_server(const char *ip_addr, const int port, int *sock);
|
||||
|
|
@ -24,4 +24,3 @@ int sf_connect_to_server(const char *ip_addr, const int port, int *sock);
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,6 @@ int sf_client_sock_write(int sock, short event, void *arg)
|
|||
|
||||
bytes = write(sock, pTask->data + pTask->offset,
|
||||
pTask->length - pTask->offset);
|
||||
//printf("%08X sended %d bytes\n", (int)pTask, bytes);
|
||||
if (bytes < 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,10 +17,5 @@ typedef int (*sf_set_body_length_callback)(struct fast_task_info *pTask);
|
|||
typedef int (*sf_deal_task_func)(struct fast_task_info *pTask);
|
||||
typedef int (*sf_recv_timeout_callback)(struct fast_task_info *pTask);
|
||||
|
||||
typedef struct {
|
||||
char ip_addr[IP_ADDRESS_SIZE];
|
||||
int port;
|
||||
} SFServerInfo;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue