loadrunner Lr_类函数之 lr_eval_string_ext_free()

lr_eval_string_ext_free()

释放由lr_eval_string_ext分配的缓冲区。

void lr_eval_string_ext_free(const char** param);

 

参数说明:

 param指向缓冲区的指针。

lr_eval_string_ext_free函数释放由lr_eval_string_ext分配的内存。

 

示例:lr_eval_string_ext_free

在以下示例中,lr_eval_string_ext_free函数在关联期间释放由lr_eval_string_ext分配的缓冲区。

/ *原始网址/

web_url(“Response_1.dat”,

“URL = http://209.88.184.66/SmWeb/Data/S_DFFA13B8DFB711D3AA6D009027E00675/Response_1.dat”,

 

“RecContentType = application / octet-stream”,

“SupportFrames = 0”,

LAST);

 

web_save_header(RESPONSE,“headerVar”)

web_create_html_param(“returnedBuffer”,“”,“”);

web_submit_data(“SmartWeb.asp”,

    “Action =http:/207.86.104.1/SmWeb/Asp/SmartWeb.asp?App = Web&SmStream @,

“Method = POST”,

“TargetFrame =”,

“RecContentType = application / octet-stream”,

“SupportFrames = 0”,

ITEMDATA,

“name =?App”,

“value = Web”,

ENDITEM,

“name = SmStream @ Request”,

“value = ClassDescription”,

ENDITEM,

LAST);

 

/ *计算头的长度* /

len = strlen(lr_eval_string(“{headerVar}”));

/ *获取指向缓​​冲区的指针* /

lr_eval_string_ext(“{Param1}”,8,&newParam,&prmLen,0,0,-1);

//保存缓冲区地址

newParamAdr = newParam;

/ *从缓冲区检索数据* /

newParam + =(len + 9); / *移动标题的长度+ 9个字节* /

fileLocationLength [0] = newParam [0]; / *读取缓冲区的长度

fileLocationLength [1] = newParam [1]; / *前两个字节与我们相关..* /

fileLocationLength [2] = 0;

fileLocationLength [3] = 0;

fileLocationLengthASCII =(short *)(&fileLocationLength[0]); / * cast this to a short *以确保我们只读取两个字节* /

newParam + = 2; / *将流中的指针移动到实际字符串的开头* /

for(i = 0,j = 0; i<= * fileLocationLengthASCII; ++ i)

        if(!memcmp(newParam,“\ r \ n”,1)){/ *将新的字符串复制到一个叫做info*

            memcpy(info [j],newParam [i],1); / *仅复制ASCII字符和无空值* /

            ++j;

}}

 

/ *我们现在有一个字符串,URL,这是我们下一次调用所需要的值。 * /

char * URL = strcat(“URL = http://207.86.104.1”,info);

web_url(“Response_1.dat”,

URL,/ *此字符串现在保存相关值*/

“RecContentType = application / octet-stream”,

“SupportFrames = 0”,

LAST);

lr_eval_string_ext_free(newParamAdr);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值