From b97e22c0ca7469762e422960245009648b0e0edf Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Sun, 6 May 2001 18:58:51 +0000 Subject: [PATCH] added clientcontext variable to Open Transport initialisation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/gsocket.c | 26 ++++++++++++++++---------- src/mac/gsocket.c | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c index ed895445f2..20e4049f58 100644 --- a/src/mac/carbon/gsocket.c +++ b/src/mac/carbon/gsocket.c @@ -195,19 +195,25 @@ static void SetDefaultEndpointModes(EndpointRef ep , void *data ) int GSocket_Init() { - OSStatus err ; + OSStatus err ; #if TARGET_CARBON - InitOpenTransportInContext( kInitOTForApplicationMask , NULL ) ; + // Marc Newsam: added the clientcontext variable + // however, documentation is unclear how this works + OTClientContextPtr clientcontext; + + InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext); + gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath, + NULL, &err, clientcontext); #else - InitOpenTransport() ; + InitOpenTransport() ; + gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); #endif - gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); - if ( gInetSvcRef == NULL || err != kOTNoError ) - { - OTAssert("Could not open Inet Services", err == noErr); - return FALSE ; - } - return TRUE; + if ( gInetSvcRef == NULL || err != kOTNoError ) + { + OTAssert("Could not open Inet Services", err == noErr); + return FALSE ; + } + return TRUE; } void GSocket_Cleanup() diff --git a/src/mac/gsocket.c b/src/mac/gsocket.c index ed895445f2..20e4049f58 100644 --- a/src/mac/gsocket.c +++ b/src/mac/gsocket.c @@ -195,19 +195,25 @@ static void SetDefaultEndpointModes(EndpointRef ep , void *data ) int GSocket_Init() { - OSStatus err ; + OSStatus err ; #if TARGET_CARBON - InitOpenTransportInContext( kInitOTForApplicationMask , NULL ) ; + // Marc Newsam: added the clientcontext variable + // however, documentation is unclear how this works + OTClientContextPtr clientcontext; + + InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext); + gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath, + NULL, &err, clientcontext); #else - InitOpenTransport() ; + InitOpenTransport() ; + gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); #endif - gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); - if ( gInetSvcRef == NULL || err != kOTNoError ) - { - OTAssert("Could not open Inet Services", err == noErr); - return FALSE ; - } - return TRUE; + if ( gInetSvcRef == NULL || err != kOTNoError ) + { + OTAssert("Could not open Inet Services", err == noErr); + return FALSE ; + } + return TRUE; } void GSocket_Cleanup()