delphi2010 indy10 mime编码 bug
来源:互联网 发布:软件著作权真伪查询 编辑:程序博客网 时间:2024/04/28 06:12
一直到Update4都没修复这个bug
版本 Delphi® 2010 Version 14.0.3513.24210
单元 IdCoderMIME.Pas
1.
procedure TIdDecoderMIMELineByLine.DecodeEnd;
var
LStream: TMemoryStream;
LPos: Integer;
begin
if Length(FLeftFromLastTime) > 0 then begin
LPos := Length(FLeftFromLastTime)+1;
SetLength(FLeftFromLastTime, 4);
while LPos <= 4 do begin
FLeftFromLastTime[LPos-1] := Ord(FFillChar);
//原代码 FLeftFromLastTime[LPos] := Ord(FFillChar);
Inc(LPos);
end;
LStream := TMemoryStream.Create;
try
WriteTIdBytesToStream(LStream, FLeftFromLastTime);
LStream.Position := 0;
inherited Decode(LStream);
finally
FreeAndNil(LStream);
SetLength(FLeftFromLastTime, 0);
end;
end;
inherited DecodeEnd;
end;
2.
procedure TIdDecoderMIMELineByLine.Decode(ASrcStream: TStream; const ABytes: Integer = -1);
var
LMod, LDiv: integer;
LIn, LSrc: TIdBytes;
LStream: TMemoryStream;
begin
LIn := FLeftFromLastTime;
if ReadTIdBytesFromStream(ASrcStream, LSrc, ABytes) > 0 then begin
AppendBytes(LIn, LSrc);
end;
LMod := Length(LIn) mod 4;
if LMod <> 0 then begin
LDiv := (Length(LIn) div 4) * 4;
FLeftFromLastTime := Copy(LIn, LDiv, Length(LIn)-LDiv);
LIn := Copy(LIn, 0, LDiv);
//原代码
//FLeftFromLastTime := Copy(LIn, LDiv+1, Length(LIn)-LDiv);
//LIn := Copy(LIn, 1, LDiv);
end else begin
SetLength(FLeftFromLastTime, 0);
end;
LStream := TMemoryStream.Create;
try
WriteTIdBytesToStream(LStream, LIn);
LStream.Position := 0;
inherited Decode(LStream, ABytes);
finally
FreeAndNil(LStream);
end;
end;
- delphi2010 indy10 mime编码 bug
- delphi2010的编码问题
- 解决delphi2010 无法继承窗体的bug
- Delphi2010
- MIME 编码方式简介
- [转]HTTP MIME编码
- MIME编码介绍
- MIME编码介绍
- MIME编码介绍
- MIME邮件的编码方式
- MIME 编码方式简介
- Base64编码图片及MIME
- MIME协议(五) -- MIME邮件的编码方式
- Indy10线程池BUG:Idyarn线程使用Synchronize导致TerminateAllYarns挂死的解决办法
- 运用设计模式设计MIME编码类
- MIME编码(Base64、QP)介绍
- 编码bug解决
- 避免硬编码bug
- [转帖]卡尔曼滤波器通俗解释 – Kalman Filter
- php基本表单验证
- 恐惧着,并且进步着
- Cisco交换机端口广播风暴设置
- 辞职了
- delphi2010 indy10 mime编码 bug
- 想清楚再动手vs敏捷
- CAPTCHA(验证码)的来源与作用
- IIS错误解决方法:The specified module could not be found、访问 IIS 元数据库失败
- Android 开发之旅:短信的收发及在android模拟器之间实践(一)
- 我的神呀
- ehcache在struts2中的使用
- 关于Gsoap的简单客户端使用【GSoap的HelloWorld】
- CSS控设置Table内外边框颜色