cURL / Mailing Lists / curl-library / Single Mail


Re: write callback issues (was Re: A new problem)

From: Linus Nielsen Feltzing <>
Date: Thu, 10 Apr 2008 08:54:16 +0200

Prasad J Pandit wrote:
> And also this: "1869110..." followed by some N number of squares. It
> seems to be changing every time.

Hmmm, I'm reaching for straws here, but if it returns and prints this
garbage even before you start typing in netcat, couldn't it be that the
connection failed, and curl_easy_perform returns with an error code?

If your MessageBox() call is placed after the call to curl_perform(), it
would print uninitialized data, since the callback was never called.

I remember that you wrote this:

"See, The `nc(1)' acts as my server(cmd: $ nc -vl <port>)."

That exact command will not listen on <port>, but instead choose a
random port. But your C code always posts to port 9999:

curl_easy_setopt (gcurl, CURLOPT_URL, "");

This raises more questions:

1) Where exactly did you place the call to MessageBox() to produce the
hex output? In the callback?
2) What is the exact command line you use to start nc?

Received on 2008-04-10