Simplified even more the previous commit.

This commit is contained in:
Ludovic Marcotte
2012-09-24 13:26:20 -04:00
parent a6b07cd158
commit d024a62e98
2 changed files with 10 additions and 13 deletions

View File

@@ -27,10 +27,6 @@
#import "SOGoAppointmentFolder.h"
@interface SOGoWebAppointmentFolder : SOGoAppointmentFolder
{
@public
NSMutableData *buffer;
}
- (void) setUsername: (NSString *) username
andPassword: (NSString *) password;

View File

@@ -46,12 +46,12 @@
@class WOHTTPURLHandle;
size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *inSelf)
size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *buffer)
{
size_t total;
total = size * nmemb;
[((SOGoWebAppointmentFolder *)inSelf)->buffer appendBytes: ptr length: total];
[(NSMutableData *)buffer appendBytes: ptr length: total];
return total;
}
@@ -115,16 +115,17 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *inSelf)
- (NSDictionary *) loadWebCalendar
{
NSString *location, *httpauth;
NSString *location, *httpauth, *content, *newDisplayName;
NSMutableDictionary *result;
NSDictionary *authInfos;
iCalCalendar *calendar;
NSMutableData *buffer;
NSURL *url;
CURL *curl;
CURLcode rc;
char error[CURL_ERROR_SIZE];
NSMutableDictionary *result;
NSString *content, *newDisplayName;
iCalCalendar *calendar;
NSUInteger imported, status;
char error[CURL_ERROR_SIZE];
CURLcode rc;
result = [NSMutableDictionary dictionary];
@@ -155,7 +156,7 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *inSelf)
buffer = [NSMutableData data];
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, curl_body_function);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, self);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
error[0] = 0;
curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, &error);