curl-library
i receive the http server response messages, but my program coredump in data->set.fwrite
Date: Thu, 23 Sep 2004 18:04:06 +0800
Now i am testing to use libcurl 's methods to communicate with a http server
HTTP Server version:apache-1.3.28 mod_ssl-2.8.15 openssl-0.9.6h[engine]
Curl Version:7.12.0
OS Platform: SunOS cry 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-60
I send a get method to http server and use the below callback func to store the response message
int cry::callback_receiveFromHTTPServer(void *LOC_H_ptr, size_t LOC_H_size, size_t LOC_H_nmemb, void * LOC_H_data)
{
int LOC_H_ret;
int LOC_H_totalMessageLen = (int)LOC_H_size * (int)LOC_H_nmemb;
tHttpNode_Memory_struct *LOC_H_mem = ( tHttpNode_Memory_struct *)LOC_H_data;
LOC_H_mem->memory = ( char *)ACE_OS::realloc(LOC_H_mem->memory, LOC_H_mem->size + LOC_H_totalMessageLen + 1);
if( LOC_H_mem->memory == NULL )
{
return (COMM_FAILURE);
}
ACE_OS::memcpy(&(LOC_H_mem->memory[LOC_H_mem->size]), LOC_H_ptr, LOC_H_totalMessageLen);
LOC_H_mem->size += LOC_H_totalMessageLen;
LOC_H_mem->memory[LOC_H_mem->size] = 0;
return COMM_SUCCESS;
}
after execute the curl_easy_perform, my program coredump at the place:
wrote = data->set.fwrite(ptr, 1, len, data->set.out);
and I got the following information about "data->set" and ptr below:
ptr related information:
ptr = 0x100ba4 "<html>^M\n^M\n<head>^M\n<meta http-equiv="Content-Language" content="zh-cn">^M\n<meta http-equiv="Content-Ty
pe" content="text/html; charset=gb2312">^M\n<meta name="GENERATOR" content="Microsoft FrontPage 4.0">^M\n<meta name="ProgId"
content="FrontPage.Editor.Document">^M\n<title>ÕâÊÇÒ»¸ö²âÊÔÒ³Ãæ</title>^M\n</head>^M\n^M\n<body>^M\n^M\n<h1 align="center">
<font size="4"><b>ÕâÊÇÒ»¸ö²âÊÔÒ³Ãæ</b></font></h1>^M\n<p>Èç¹û¿´µ½ÕâЩÄÚÈÝ˵Ã÷ÄãµÄapache·þÎñÆ÷ÒѾ°²×°³É¹¦ÁË¡£</p>^M\n<p>»¶Ó
·ÃÎÊ£ºapacheµÄ¹Ù·½Õ¾µã</" ...
data->set related information:
err = 0xd41b0
debugdata = (nil)
errorbuffer = (nil)
proxyuserpwd = (nil)
proxyport = 1080
out = 0xfac07244
in = 0xd4190
writeheader = (nil)
set_url = 0xfac07584 "https://10.70.107.123/noah.htm"
set_proxy = (nil)
use_port = 0
userpwd = (nil)
httpauth = 1
proxyauth = 1
set_range = (nil)
followlocation = 0
maxredirs = 0
set_referer = (nil)
free_referer = '\0'
useragent = (nil)
encoding = (nil)
postfields = (nil)
postfieldsize = 0
ftpport = (nil)
device = (nil)
fwrite = 0xfac07238
fwrite_header = (nil)
fread = 0xfb20ef78 = &fread()
fprogress = (nil)
fdebug = (nil)
progress_client = (nil)
timeout = 0
connecttimeout = 0
ftp_response_timeout = 0
infilesize = -1LL
low_speed_limit = 0
low_speed_time = 0
set_resume_from = 0
cookie = (nil)
headers = (nil)
httppost = (nil)
cert = 0xfac07330 "../certs/test_Cert.crt"
cert_type = 0xaf47e "PEM"
key = 0xfac0724c "../certs/test_Key.pem"
key_type = 0xaf46d "PEM"
key_passwd = 0xaf471 "infosecurity"
crypto_engine = (nil)
cookiejar = (nil)
cookiesession = '\0'
crlf = '\0'
quote = (nil)
postquote = (nil)
prequote = (nil)
telnet_options = (nil)
timecondition = CURL_TIMECOND_NONE
timevalue = 0
closepolicy = CURLCLOSEPOLICY_NONE
httpreq = HTTPREQ_GET
customrequest = (nil)
httpversion = 0
auth_host = (nil)
krb4_level = (nil)
ssl = {
version = 0
certverifyresult = 19
verifypeer = 0
verifyhost = 1
CApath = (nil)
CAfile = 0xfb3c4c24 "/home/tfm/curl/share/curl/curl-ca-bundle.crt"
random_file = (nil)
egdsocket = (nil)
cipher_list = (nil)
numsessions = 5
fsslctx = (nil)
fsslctxp = (nil)
}
proxytype = CURLPROXY_HTTP
dns_cache_timeout = 60
buffer_size = 0
private = (nil)
http200aliases = (nil)
ip_version = 0
max_filesize = 0
get_filetime = '\0'
tunnel_thru_httpproxy = '\0'
ftp_append = '\0'
ftp_ascii = '\0'
ftp_list_only = '\0'
ftp_create_missing_dirs = '\0'
ftp_use_port = '\0'
hide_progress = '\001'
http_fail_on_error = '\0'
http_follow_location = '\0'
http_disable_hostname_check_before_authentication = '\0'
include_header = '\0'
http_set_referer = '\0'
http_auto_referer = '\0'
opt_no_body = '\0'
set_port = '\0'
upload = '\0'
use_netrc = CURL_NETRC_IGNORED
netrc_file = (nil)
verbose = '\0'
krb4 = '\0'
reuse_forbid = '\0'
reuse_fresh = '\0'
expect100header = '\0'
ftp_use_epsv = '\001'
ftp_use_eprt = '\001'
ftp_ssl = CURLFTPSSL_NONE
no_signal = '\0'
global_dns_cache = '\0'
tcp_nodelay = '\0'
Received on 2004-09-23