Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi. I wonder if there is any difference between

xOpt webopts [5];
webopts [0].nId = WEBOPT_HEADERHANDLER;
webopts [0].pVal = (void*)&HeaderHandler;
webopts [1].nId = WEBOPT_HANDLERDATA;
webopts [1].pVal = this;
webopts [2].nId = WEBOPT_HEADER;
webopts [2].pVal = m_Headers;
webopts [3].nId = WEBOPT_DEFAULTS;
webopts [3].pVal = m_Certs;
webopts [4].nId = XOPT_END;
IWEB_AddOpt(m_Web, webopts);
IWEB_GetResponse(m_Web,(m_Web,&m_Resp,&m_webCB,App::GetAppPointer()->m_LicenseURL));

and

IWeb_GetResponse(m_Web, &m_Resp, &m_webCB, App::GetAppPointer()->m_LicenseURL,
WEBOPT_HEADERHANDLER, (void*)&HeaderHandler,
WEBOPT_HANDLERDATA, this,
WEBOPT_HEADER, m_Headers,
WEBOPT_DEFAULTS, m_Certs,
WEBOPT_END);

?

The data in options passed to IWeb_GetResponse() are not copied by default, they must stay valid until the IWeb_GetResponse() callback fires whereas the data passed as options to IWeb_AddOpt() *are* copied by default, so they do not need to be kept around, unless the WEBOPT_COPYOPTS option is specifically removed from the IWeb instance.

The data in options passed to IWeb_GetResponse() are not copied by default, they must stay valid until the IWeb_GetResponse() callback fires whereas the data passed as options to IWeb_AddOpt() *are* copied by default, so they do not need to be kept around, unless the WEBOPT_COPYOPTS option is specifically removed from the IWeb instance.