@@ -67,20 +67,23 @@ void update_info_destroy(struct update_info *info)
6767 bfree (info );
6868}
6969
70- static size_t http_write (uint8_t * ptr , size_t size , size_t nmemb , struct update_info * info )
70+ static size_t http_write (char * ptr , size_t size , size_t nmemb , void * info_param )
7171{
7272 size_t total = size * nmemb ;
73- if (total )
73+ if (total ) {
74+ struct update_info * info = (struct update_info * )info_param ;
7475 da_push_back_array (info -> file_data , ptr , total );
76+ }
7577
7678 return total ;
7779}
7880
79- static size_t http_header (char * buffer , size_t size , size_t nitems , struct update_info * info )
81+ static size_t http_header (char * buffer , size_t size , size_t nitems , void * info_param )
8082{
8183 if (!strncmp (buffer , "ETag: " , 6 )) {
8284 char * etag = buffer + 6 ;
8385 if (* etag ) {
86+ struct update_info * info = (struct update_info * )info_param ;
8487 char * etag_clean , * p ;
8588
8689 etag_clean = bstrdup (etag );
@@ -110,8 +113,8 @@ static bool do_http_request(struct update_info *info, const char *url, long *res
110113 curl_easy_setopt (info -> curl , CURLOPT_ERRORBUFFER , info -> error );
111114 curl_easy_setopt (info -> curl , CURLOPT_WRITEFUNCTION , http_write );
112115 curl_easy_setopt (info -> curl , CURLOPT_WRITEDATA , info );
113- curl_easy_setopt (info -> curl , CURLOPT_FAILONERROR , true );
114- curl_easy_setopt (info -> curl , CURLOPT_NOSIGNAL , 1 );
116+ curl_easy_setopt (info -> curl , CURLOPT_FAILONERROR , 1L );
117+ curl_easy_setopt (info -> curl , CURLOPT_NOSIGNAL , 1L );
115118 curl_easy_setopt (info -> curl , CURLOPT_ACCEPT_ENCODING , "" );
116119 curl_obs_set_revoke_setting (info -> curl );
117120
0 commit comments