curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: A string issue that after received the http 204, the curl_formadd function seems couldn't work again

From: 杨俊 <yangjun9772_at_gmail.com>
Date: Tue, 17 Jan 2017 16:24:03 +0800

Sorry I didn't describe it clearly.
> What exactly does it mean when you say you "can't use" it? What happens
when you do?

For example, the code flow like this:
Firstly, the program will do this function "curl_sync_state" to tell the
server this demo's state.
It use the CURL *curl = handles[EVENT_HANDLE].
It send the messages and then receive a 204 response from the server.
After the demo got the response, then it will use "curl_send_audio_content"
to send another messages to the server again.
this "curl_send_audio_content" also use the handles[EVENT_HANDLE] and
 they have the same configuration of curl_opt "curl_send_audio_cfg".
But the result is NG.
And In this step, I found the program didn't use the "readFileFunc"
function which I configured in "curl_send_audio_cfg".
So the program didn't upload the content just the header.
Of course when the program do "curl_sync_state", it could upload the header
and the content, the "readFileFunc" would be used.(This is what "can't use
it" mean)
Or dose it seem this function didn't work?
//=============Audio=================//
curl_formadd(&postFirst, &postLast,
CURLFORM_COPYNAME, "audio",
CURLFORM_STREAM, &micRing,
CURLFORM_CONTENTTYPE, "application/octet-stream", //"audio/L16; rate=16000;
channels=1",
CURLFORM_END);
the "readFileFunc" is used for CURLFORM_STREAM.

Thx

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-01-17