curb icon indicating copy to clipboard operation
curb copied to clipboard

Curl::Easy seems to have a limit for CURLOPT_INFILESIZE in Curl::Easy#http_put

Open flazz opened this issue 14 years ago • 4 comments

the error i get: integer 3154698240 too big to convert to 'int'

line 829 in curb_easy.c: curl_easy_setopt(curl, CURLOPT_INFILESIZE, FIX2INT(size));

in ruby's numeric.c line 1599 check_int(num) line 1646 rb_fix2int(val)

curl_easy_setopt seems to take a long but on systems where int < long the most you will get is long. there is fix2uint but still smaller than long.

what is a good way to get a long out of stat.size? or is there a way in Curb to upload this big of a file?

flazz avatar Dec 21 '10 20:12 flazz

I'm just curious - isn't one of the problems here?

curb_upload.h:

/*
 * Maintain the state of an upload e.g. for putting large streams with very little memory
 * out to a server. via PUT requests
 */
typedef struct {
  VALUE stream;
  size_t offset;
 } ruby_curl_upload;

grf avatar Dec 21 '10 20:12 grf

  curl_easy_setopt(curl, CURLOPT_INFILESIZE, FIX2LONG(size));

?

taf2 avatar Dec 22 '10 01:12 taf2

check my latest commit

taf2 avatar Dec 22 '10 01:12 taf2

thanks!

i'll give it 0.7.9 a roll

flazz avatar Dec 22 '10 13:12 flazz