mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 22:38:51 +00:00
Fixed #1989 (clang bug with function definition within method)
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
#import "MSExchangeFreeBusySOAPRequest.h"
|
||||
#import "MSExchangeFreeBusy.h"
|
||||
|
||||
size_t curlBodyFunction(void *ptr, size_t size, size_t nmemb, void *inSelf)
|
||||
size_t curl_body_function_freebusy(void *ptr, size_t size, size_t nmemb, void *inSelf)
|
||||
{
|
||||
return [(MSExchangeFreeBusy *)inSelf curlWritePtr:ptr size:size number:nmemb];
|
||||
}
|
||||
@@ -139,7 +139,7 @@ size_t curlBodyFunction(void *ptr, size_t size, size_t nmemb, void *inSelf)
|
||||
//curl_easy_setopt(curl, CURLOPT_HEADER, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlBodyFunction);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_body_function_freebusy);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, self);
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error);
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* SOGoWebAppointmentFolder.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009 Inverse inc.
|
||||
* Copyright (C) 2009-2012 Inverse inc.
|
||||
*
|
||||
* Author: Cyril Robert <crobert@inverse.ca>
|
||||
* Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +27,10 @@
|
||||
#import "SOGoAppointmentFolder.h"
|
||||
|
||||
@interface SOGoWebAppointmentFolder : SOGoAppointmentFolder
|
||||
{
|
||||
@public
|
||||
NSMutableData *buffer;
|
||||
}
|
||||
|
||||
- (void) setUsername: (NSString *) username
|
||||
andPassword: (NSString *) password;
|
||||
|
||||
@@ -46,6 +46,16 @@
|
||||
|
||||
@class WOHTTPURLHandle;
|
||||
|
||||
size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *inSelf)
|
||||
{
|
||||
size_t total;
|
||||
|
||||
total = size * nmemb;
|
||||
[((SOGoWebAppointmentFolder *)inSelf)->buffer appendBytes: ptr length: total];
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
@implementation SOGoWebAppointmentFolder
|
||||
|
||||
- (void) deleteAllContent
|
||||
@@ -107,7 +117,6 @@
|
||||
{
|
||||
NSString *location, *httpauth;
|
||||
NSDictionary *authInfos;
|
||||
NSMutableData *bodyData;
|
||||
NSURL *url;
|
||||
CURL *curl;
|
||||
CURLcode rc;
|
||||
@@ -142,17 +151,11 @@
|
||||
curl_easy_setopt (curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||
}
|
||||
|
||||
bodyData = [NSMutableData data];
|
||||
size_t curlBodyFunction (void *ptr, size_t size, size_t nmemb, void *inSelf)
|
||||
{
|
||||
size_t total;
|
||||
/* buffering ivar, no need to retain/release */
|
||||
buffer = [NSMutableData data];
|
||||
|
||||
total = size * nmemb;
|
||||
[bodyData appendBytes: ptr length: total];
|
||||
|
||||
return total;
|
||||
}
|
||||
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, curlBodyFunction);
|
||||
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, curl_body_function);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, self);
|
||||
|
||||
error[0] = 0;
|
||||
curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, &error);
|
||||
@@ -167,10 +170,10 @@
|
||||
|
||||
if (status == 200)
|
||||
{
|
||||
content = [[NSString alloc] initWithData: bodyData
|
||||
content = [[NSString alloc] initWithData: buffer
|
||||
encoding: NSUTF8StringEncoding];
|
||||
if (!content)
|
||||
content = [[NSString alloc] initWithData: bodyData
|
||||
content = [[NSString alloc] initWithData: buffer
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
[content autorelease];
|
||||
calendar = [iCalCalendar parseSingleFromSource: content];
|
||||
|
||||
Reference in New Issue
Block a user