medfall

A super great game engine
Log | Files | Refs

commit 1b7cc892fefa7537934c850d1a149f45b0219d0f
parent f107ff71d72d931033f1be59015a472db841e24d
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri Jul  7 21:54:40 +0300

Fix http_get on OSX

Diffstat:
http.cc | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/http.cc b/http.cc @@ -36,7 +36,8 @@ GetResult http_get( const struct sockaddr_storage & address, const char * host, } SCOPE_EXIT( closesocket( sock ) ); - if( connect( sock, ( const sockaddr * ) &address, sizeof( address ) ) == -1 ) { + size_t address_size = address.ss_family == AF_INET ? sizeof( sockaddr_in ) : sizeof( sockaddr_in6 ); + if( connect( sock, ( const sockaddr * ) &address, address_size ) == -1 ) { return GET_ERROR_CONNECT; }