ISAPI扩展重定向器 [英] ISAPI Extension Redirector

查看:109
本文介绍了ISAPI扩展重定向器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C ++中开发了一个ISAPI扩展,它产生了一些输出,但是在我的页面上插入cookie后立即发生的任何重定向都会返回以下内容:

HTTP / 1.1 302对象移动连接:关闭日期:2009年12月11日星期五17:32:12 GMT内容长度:162内容类型:text / html位置:http://Localhost/Paginas/principal.html服务器:Microsoft -IIS / 6.0 Set-Cookie :status = active; path = /;

对象已移动

此文档可在此处找到

解决此问题的方法是什么?

感谢大家的帮助。

William

解决方案

发现错误因为发送HTTP标头而出现HTML页面。



使用MFC类我使用pCtxt-> m_bSendHeaders = false;禁用发送标头。不使用MFC类,就像我那样做? pECB中没有相应的内容?



感谢大家的帮助。



William

这也可以使用pECB来完成。

使用EXTENSION_CONTROL_BLOCK提供的ServerSupportFunction方法。



阅读本文:

EXTENSION_CONTROL_BLOCK结构 [< a href =https://msdn.microsoft.com/en-us/library/aa251512(v=vs.60).aspx\"target =_ blanktitle =New Window> ^



例如:

pHdr =包含Set-Cookie,Location,Status等的响应头。

hdrSize = strlen( pHdr)

pECB-> ServerSupportFunction(pECB-> ConnID,HSE_REQ_SEND_RESPONSE_HEADER,(LPDWORD)302 Moved,& hdrSize,(LPDWORD)pHdr);


I developed an ISAPI Extension in C++ which makes some output, but any redirection that occurs immediately after the insertion of a cookie on my page returns me the following:
HTTP/1.1 302 Object Moved Connection: close Date: Fri, 11 Dec 2009 17:32:12 GMT Content-Length: 162 Content-Type: text / html Location: http://Localhost/Paginas/principal.html Server: Microsoft -IIS/6.0 Set-Cookie: status = active; path = /;
Object Moved
This document may be found here
What is the way to solve this problem?
Thank you for the help everyone.
William

解决方案

Found that the error appears due to the sending of HTTP headers along with the HTML page.

Using MFC class I use pCtxt-> m_bSendHeaders = false; to disable the sending of headers. Without using MFC classes, as I do that? There is no equivalent in pECB?

Thank you for the help everyone.

William


This can be done using pECB as well.
Use ServerSupportFunction method provided by EXTENSION_CONTROL_BLOCK.

Read this:
EXTENSION_CONTROL_BLOCK Structure[^

Example:
pHdr= response header containing Set-Cookie, Location, Status etc.
hdrSize = strlen(pHdr)
pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, (LPDWORD)"302 Moved", &hdrSize, (LPDWORD)pHdr);


这篇关于ISAPI扩展重定向器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆