Daniel Stenberg | 1 Jun 2006 08:46
Picon
Favicon
Gravatar

Re: Downloading multipart

On Thu, 1 Jun 2006, Daniel Moore wrote:

> Then read data & send it back to CURLOPT_WRITEDATA as usual, but watch for 
> either the appropriate number of bytes received (content-length) or for the 
> multipart boundary. When the end of the part is detected, return from 
> curl_easy_perform, having stashed away any remaining data read from the 
> stream.
>
> At this stage, we've read the first part of a multipart in a single call to 
> curl_easy_perform, and returned to the caller.

I could agree to most of what you said until this point. Having 
curl_easy_perform() return before the entire request is complete would 
introduce a huge can of worms as that is not how curl_easy_perform() behaves 
today. I would say that it should continue spitting out parts to the callback 
as long as the stream is alive. It would of course also require some sort of 
separating info/callback to the app when one part is completely transfered.

If you'd want to get back "control" and do something else before allowing 
another multipart, you'd instead use the multi interface as it would then 
provide such a feature "automatically".

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Frme | 1 Jun 2006 12:15
Picon

Touble using cURL

Good afternoon!

I'm a newbe with cURL and currently I'm trying
to get responce from server using cURL in my C++ programm.

I use the following url:
http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false

in MS IE i receive the responce from server (XML-format responce)i need, but using curl
under Linux I can't.

What am I doing wrong?
--

-- 
Best regards,
 Frme                          mailto:frme <at> mail.ru

Daniel Stenberg | 1 Jun 2006 12:31
Picon
Favicon
Gravatar

Re: Touble using cURL

On Thu, 1 Jun 2006, Frme wrote:

> What am I doing wrong?

Too many to count:

You didn't tell us what you did or how, nor did you show us any source code, 
explained with details how it failed or mention which libcurl version you used 
for your program.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Frme | 1 Jun 2006 12:58
Picon

Touble using cURL

> On Thu, 1 Jun 2006, Frme wrote:

>> What am I doing wrong?

> Too many to count:

> You didn't tell us what you did or how, nor did you show us any source code,
> explained with details how it failed or mention which libcurl version you used
> for your program.
ok, it's realy my fault...
so,
under Linux in bash I typed the following command:
curl http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false
I received no response at all, no errors messages nothing.

(some minutes before I tried to get response from C++ code: the result
is the same, so I decided to fetch the url from command line)

I use the cURL version 7.15.3

What steps should I do to receive the response?

Thanks in advance.

--

-- 
Best regards,
 Frme                          mailto:frme <at> mail.ru

Tor Arntsen | 1 Jun 2006 12:53
Picon
Favicon

Re: Touble using cURL

On Jun 1, 11:51, Frme wrote:
>under Linux in bash I typed the following command:
>curl http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false
>I received no response at all, no errors messages nothing.

Hm..

>curl "http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false"
<adresponse id="1149159073331875">
<adlist>
<ad id="105" num="0"><url>/home/rhythm/Content/Rhythm/uploaded/targeted//original/00000123-00000168.mf</url>
</ad>

<content id="-1" num="1"><url>sports.3gp</url>
</content>

</adlist>
</adresponse>

Seems to work?

-Tor

Ralph Mitchell | 1 Jun 2006 13:00
Picon

Re: Touble using cURL

Well, to start with, when using a unix shell, the url needs to be enclosed in quotes.  The shell treats the & and ? characters differently differently to alphanumerics unless quoted.

You'll probably want to add

   -o filename

in there as well, or the file contents will stream past in the console.

Ralph Mitchell


On 6/1/06, Frme <frme <at> mail.ru> wrote:
> On Thu, 1 Jun 2006, Frme wrote:

>> What am I doing wrong?

> Too many to count:

> You didn't tell us what you did or how, nor did you show us any source code,
> explained with details how it failed or mention which libcurl version you used
> for your program.
ok, it's realy my fault...
so,
under Linux in bash I typed the following command:
curl http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false
I received no response at all, no errors messages nothing.

(some minutes before I tried to get response from C++ code: the result
is the same, so I decided to fetch the url from command line)

I use the cURL version 7.15.3

What steps should I do to receive the response?

Thanks in advance.

--
Best regards,
Frme                          mailto:frme <at> mail.ru



Frme | 1 Jun 2006 13:13
Picon

Re[2]: Touble using cURL

> Hm..

>>curl
>>"http://qac1.rnmd.net:8080/coreservices/getAds?user=1&contentURL=sports.3gp&clip=sports.3gp&index=0&longform=false"
> <adresponse id="1149159073331875">
> <adlist>
> <ad id="105"
> num="0"><url>/home/rhythm/Content/Rhythm/uploaded/targeted//original/00000123-00000168.mf</url>
> </ad>

> <content id="-1" num="1"><url>sports.3gp</url>
> </content>

> </adlist>
> </adresponse>

> Seems to work?

> -Tor
It is!!
So, the point was in double quotes around the url-string?
Before I tested different urls without double quotes and appropriate
servers got me it's responses...

ok, in any cases thanks.
--

-- 
Best regards,
 Frme                            mailto:frme <at> mail.ru

Frme | 1 Jun 2006 13:17
Picon

Re[2]: Touble using cURL

Hello Ralph,

Thursday, June 1, 2006, 2:00:14 PM, you wrote:

> Well, to start with, when using a unix shell, the url needs to be
> enclosed in quotes.  The shell treats the & and ? characters
> differently differently to alphanumerics unless quoted.

>  You'll probably want to add

>     -o filename

>  in there as well, or the file contents will stream past in the console.

>  Ralph Mitchell
ok, thanks, I'll note this in my work :)))

--

-- 
Best regards,
 Frme                            mailto:frme <at> mail.ru

Nilesh | 2 Jun 2006 05:58

How to Disconnect ?

Hi,

How to disconnect from the URL to which connection might have already established ?
I want to explicitely disconnect for that URL ?

Would cleaup function on handles( multi/easy) and global cleanup suffice ?

Thanks,
Nilesh

Daniel Moore | 2 Jun 2006 06:32
Favicon

Re: Downloading multipart

On 2006-06-01, Daniel Stenberg wrote:
> I could agree to most of what you said until this point. Having 
> curl_easy_perform() return before the entire request is complete would 
> introduce a huge can of worms as that is not how curl_easy_perform() 
> behaves today. I would say that it should continue spitting out parts to 
> the callback as long as the stream is alive. It would of course also 
> require some sort of separating info/callback to the app when one part is 
> completely transfered.

Yeah, it is different...

> If you'd want to get back "control" and do something else before allowing 
> another multipart, you'd instead use the multi interface as it would then 
> provide such a feature "automatically".

Maybe a new call could be added to syncronously get one part?

I'll get back to you when/if I get back to this stuff!

Thanks for your time 

Regards,
Daniel


Gmane