Fix for mixed usage of SOCKET and int.
This commit is contained in:
parent
a5fb5edfc9
commit
4b47e6a51d
@ -179,7 +179,7 @@ static UPNP_INLINE int notify_send_and_recv(
|
||||
http_parser_t *response)
|
||||
{
|
||||
uri_type url;
|
||||
int conn_fd;
|
||||
SOCKET conn_fd;
|
||||
membuffer start_msg;
|
||||
int ret_code;
|
||||
int err_code;
|
||||
|
@ -74,7 +74,7 @@
|
||||
|
||||
struct mserv_request_t {
|
||||
/*! Connection handle. */
|
||||
int connfd;
|
||||
SOCKET connfd;
|
||||
/*! . */
|
||||
struct sockaddr_storage foreign_sockaddr;
|
||||
};
|
||||
@ -218,7 +218,7 @@ static void handle_request(
|
||||
http_message_t *hmsg = NULL;
|
||||
int timeout = HTTP_DEFAULT_TIMEOUT;
|
||||
struct mserv_request_t *request = (struct mserv_request_t *)args;
|
||||
int connfd = request->connfd;
|
||||
SOCKET connfd = request->connfd;
|
||||
|
||||
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
|
||||
"miniserver %d: READING\n", connfd );
|
||||
@ -269,7 +269,7 @@ error_handler:
|
||||
*/
|
||||
static UPNP_INLINE void schedule_request_job(
|
||||
/*! [in] Socket Descriptor on which connection is accepted. */
|
||||
int connfd,
|
||||
SOCKET connfd,
|
||||
/*! [in] Clients Address information. */
|
||||
struct sockaddr *clientAddr)
|
||||
{
|
||||
@ -301,17 +301,17 @@ static UPNP_INLINE void schedule_request_job(
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void fdset_if_valid(int sock, fd_set *set)
|
||||
static UPNP_INLINE void fdset_if_valid(SOCKET sock, fd_set *set)
|
||||
{
|
||||
if (sock != -1) {
|
||||
FD_SET(sock, set);
|
||||
}
|
||||
}
|
||||
|
||||
static void web_server_accept(int lsock, fd_set *set)
|
||||
static void web_server_accept(SOCKET lsock, fd_set *set)
|
||||
{
|
||||
#ifdef INTERNAL_WEB_SERVER
|
||||
int asock;
|
||||
SOCKET asock;
|
||||
socklen_t clientLen;
|
||||
struct sockaddr_storage clientAddr;
|
||||
char errorBuffer[ERROR_BUFFER_LEN];
|
||||
@ -333,14 +333,14 @@ static void web_server_accept(int lsock, fd_set *set)
|
||||
#endif /* INTERNAL_WEB_SERVER */
|
||||
}
|
||||
|
||||
static void ssdp_read(int rsock, fd_set *set)
|
||||
static void ssdp_read(SOCKET rsock, fd_set *set)
|
||||
{
|
||||
if (rsock != -1 && FD_ISSET(rsock, set)) {
|
||||
readFromSSDPSocket(rsock);
|
||||
}
|
||||
}
|
||||
|
||||
static int receive_from_stopSock(int ssock, fd_set *set)
|
||||
static int receive_from_stopSock(SOCKET ssock, fd_set *set)
|
||||
{
|
||||
int byteReceived;
|
||||
socklen_t clientLen;
|
||||
@ -387,9 +387,9 @@ static void RunMiniServer(
|
||||
char errorBuffer[ERROR_BUFFER_LEN];
|
||||
fd_set expSet;
|
||||
fd_set rdSet;
|
||||
int maxMiniSock;
|
||||
SOCKET maxMiniSock;
|
||||
int ret = 0;
|
||||
int stopSock = 0;
|
||||
SOCKET stopSock = 0;
|
||||
|
||||
maxMiniSock = 0;
|
||||
maxMiniSock = max(maxMiniSock, miniSock->miniServerSock4);
|
||||
@ -464,7 +464,7 @@ static void RunMiniServer(
|
||||
*/
|
||||
static int get_port(
|
||||
/*! [in] Socket descriptor. */
|
||||
int sockfd)
|
||||
SOCKET sockfd)
|
||||
{
|
||||
struct sockaddr_storage sockinfo;
|
||||
socklen_t len;
|
||||
@ -779,7 +779,7 @@ static int get_miniserver_stopsock(
|
||||
{
|
||||
char errorBuffer[ERROR_BUFFER_LEN];
|
||||
struct sockaddr_in stop_sockaddr;
|
||||
int miniServerStopSock = 0;
|
||||
SOCKET miniServerStopSock = 0;
|
||||
int ret = 0;
|
||||
|
||||
miniServerStopSock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
@ -108,7 +108,7 @@ const int CHUNK_TAIL_SIZE = 10;
|
||||
* Returns: int
|
||||
* 0 if successful else -1
|
||||
***************************************************************************/
|
||||
static int Make_Socket_NoBlocking(int sock)
|
||||
static int Make_Socket_NoBlocking(SOCKET sock)
|
||||
{
|
||||
#ifdef WIN32
|
||||
u_long val = 1;
|
||||
@ -219,7 +219,7 @@ static int Check_Connect_And_Wait_Connection(int sock, int connect_res)
|
||||
#endif /* UPNP_BLOCKING_CONNECT */
|
||||
|
||||
static int private_connect(
|
||||
int sockfd,
|
||||
SOCKET sockfd,
|
||||
const struct sockaddr *serv_addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
@ -316,15 +316,15 @@ int http_FixStrUrl(
|
||||
* Gets destination address from URL and then connects to the remote end
|
||||
*
|
||||
* Returns:
|
||||
* socket descriptor on sucess
|
||||
* socket descriptor on success
|
||||
* UPNP_E_OUTOF_SOCKET
|
||||
* UPNP_E_SOCKET_CONNECT on error
|
||||
************************************************************************/
|
||||
int http_Connect(
|
||||
SOCKET http_Connect(
|
||||
IN uri_type *destination_url,
|
||||
OUT uri_type *url)
|
||||
{
|
||||
int connfd;
|
||||
SOCKET connfd;
|
||||
int sockaddr_len;
|
||||
int ret_connect;
|
||||
|
||||
@ -692,7 +692,7 @@ int http_RequestAndResponse(
|
||||
IN int timeout_secs,
|
||||
OUT http_parser_t *response)
|
||||
{
|
||||
int tcp_connection;
|
||||
SOCKET tcp_connection;
|
||||
int ret_code;
|
||||
int sockaddr_len;
|
||||
int http_error_code;
|
||||
@ -1159,7 +1159,7 @@ int http_OpenHttpPost(
|
||||
{
|
||||
int ret_code;
|
||||
int sockaddr_len;
|
||||
int tcp_connection;
|
||||
SOCKET tcp_connection;
|
||||
membuffer request;
|
||||
http_post_handle_t *handle = NULL;
|
||||
uri_type url;
|
||||
@ -1724,7 +1724,7 @@ int http_OpenHttpGetProxy(
|
||||
int sockaddr_len;
|
||||
int http_error_code;
|
||||
memptr ctype;
|
||||
int tcp_connection;
|
||||
SOCKET tcp_connection;
|
||||
membuffer request;
|
||||
http_get_handle_t *handle = NULL;
|
||||
uri_type url;
|
||||
@ -2361,7 +2361,7 @@ int http_OpenHttpGetEx(
|
||||
{
|
||||
int http_error_code;
|
||||
memptr ctype;
|
||||
int tcp_connection;
|
||||
SOCKET tcp_connection;
|
||||
int sockaddr_len;
|
||||
membuffer request;
|
||||
http_get_handle_t *handle = NULL;
|
||||
|
@ -156,7 +156,7 @@ int sock_destroy(
|
||||
*/
|
||||
static inline int sock_close(
|
||||
/*! Socket descriptor. */
|
||||
int sock)
|
||||
SOCKET sock)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user