Wip_cerr_pipe_broken with http post

Hi , i am trying to send some data to a web server using http post. My problem is that my code sometimes works and some times it doesn’t work and i just cant figure out why. When it doesn’t work i get this error wip_cerr_pipe_broken -987 TCP connection broken what does this mean?
And one more thing when it does work it seems i can’t send thought post more then around 310 bytes , i don’t think this is ok. Anybody knows why is this happening?

And even more strange thing is that this happens only if a build a custom string with which i do the post, if a have a hardcoded string then every time it works fine

It means that the TCP connection that carried your HTTP request has been closed in an unexpected way, i.e. at a time when it’s not legal to close it according to HTTP protocol. In a POST, that might be because you try to send more data than promised by a Content-Length header.

Given C’s unforgiveness with respect to strings handling, I’d advise you to triple-check your dynamic string generation code, in particular length related issues.

this content header is the lenght that you specify here in the wip_write function? Because if so i have something like this

wip_write(http_channel_comm, httpData.data, httpData.dataLen);

my httpData.dataLen is wrong then? Strange because when i debug it seems fine. But then why sometimes it works and sometimes it does not? Shouldn’t never work or always?

When do you call wip_HTTPClientCreate?

If you just assume that the Session channel is still valid - it might not be!

A wip_getFileOpts will still cause the WIP_CEV_OPEN and WIP_CEV_WRITE events even if the Session channel has died… :angry:

The code that i use I’ve posted it here

except that in the wip_write i have wip_write(http_channel_comm, httpData.data, httpData.dataLen);

it seems that when i use wm_strlen(httpData.data) it works so i guess for some reason the length of the text wasn’t calculated right although when i print a trace i get the same values
Thanks anyway for your help