[drakma-devel] Re: CLISP problem with READ-SEQUENCE; patch

Pixel // pinterface pinterface at gmail.com
Sat Mar 22 03:02:32 UTC 2008


"Anton Vodonosov" <avodonosov at yandex.ru> wrote in message
news:1778416840.20080322001226 at yandex.ru...
> Hello.
>
> When using HTTP-REQUEST for non text content types, we
> have following error in CLISP:
>
>   SYSTEM::STORE: #\< does not fit into #(0 0 0 0 0 0 0 0 0 0 ...), bad
type
>
>   [snipped Backtrace]
>
> This is because CLISP doesn't support READ-SEQUENCE on
> a stream having STREAM-ELEMENT-TYPE == 'CHARACTER.
>
> The patch attached fixes this problem by explicit change
> of stream element type in the DRAKMA::READ-BODY function.

That's odd, I've been using clisp + drakma for months on streams which are a
mixture of ASCII and binary without problems.  /me checks something.

Aha!  I took a somewhat longer approach and mucked around with
system::read-sequence and system::write-sequence to prefer byte-sequences
over character-sequences (see attached).  Never made a patch to CLISP
because I figured it wasn't the right solution so much as something that
happens to work for my particular application.

I like your way better! :)


begin 666 clisp-fix.lisp
M.SL at 26X@8VQI<W L(')E860M<V5Q=65N8V4 at 86YD('=R:71E+7-E<75E;F-E
M('=I;&P@=')Y('1O(')E860@;W(@=W)I=&4*.SL at 8VAA<F%C=&5R<R!E=F5N
M('=H96X@>6]U(')E86QL>2!W86YT(&EN=&5G97)S+B!";&5H(2!&:7@@=&AI
M<R!B>2!S=V%P<&EN9PH[.R!S;VUE(&-O;F1I=&EO;G, at 87)O=6YD+B!%<W-E
M;G1I86QL>2P@<F5V97)S92!T:&4 at 8G5G('1O('!R969E<B!I;G1E9V5R<PH[
M.R!O=F5R(&-H87)A8W1E<G,L('-I;F-E('1H870G<R!P<F]B86)L>2!W:&%T
M('=E('=A;G1E9"!A;GEW87DN"CL[("A!(&QI='1L92!A<'!L:6-A=&EO;BUS
M<&5C:69I8R!K;F]W;&5D9V4 at 9V]E<R!A(&QO;F<@=V%Y+BD*"BAI;BUP86-K
M86=E(#IS>7-T96TI"@HH97AT.G=I=&AO=70M<&%C:V%G92UL;V-K("@I"B @
M*&1E9G5N('-Y<W1E;3HZ<F5A9"US97%U96YC92 H<V5Q=65N8V4@<W1R96%M
M("9R97-T(')E<W0@)FME>2 H<W1A<G0@,"D@*&5N9"!N:6PI*0H@(" @*&1E
M8VQA<F4@*&EG;F]R92!S=&%R="!E;F0I*0H@(" @*&QE=" H*'-E;'1Y<&4@
M*'-T<F5A;2UI;G!U="UE;&5M96YT+71Y<&4@<W1R96%M*2D*(" @(" @(" @
M("AV96QT>7!E("AI9B H=F5C=&]R<"!S97%U96YC92D@*&%R<F%Y+65L96UE
M;G0M='EP92!S97%U96YC92D@="DI*0H@(" @(" H8V]N9" H*&]R("AS=6)T
M>7!E<"!S96QT>7!E("=)3E1%1T52*2 H<W5B='EP97 @=F5L='EP92 G24Y4
M14=%4BDI"B @(" @(" @(" @(" H87!P;'D@(R=R96%D+6)Y=&4M<V5Q=65N
M8V4@<V5Q=65N8V4@<W1R96%M(')E<W0I*0H@(" @(" @(" @(" H*&]R("AE
M<2!S96QT>7!E("=.24PI("AE<2!S96QT>7!E("=#2$%204-415(I"B @(" @
M(" @(" @(" @(" @*&5Q('9E;'1Y<&4@)T-(05)!0U1%4BDI"B @(" @(" @
M(" @(" H87!P;'D@(R=R96%D+6-H87(M<V5Q=65N8V4@<V5Q=65N8V4@<W1R
M96%M(')E<W0I*0H@(" @(" @(" @(" H= H@(" @(" @(" @(" @*&5R<F]R
M("A415A4(")^4SH at 96QE;65N="!T>7!E<R!O9B!^4R!A;F0@?E, at 87)E(&%M
M8FEG=6]U<RX at 4&QE87-E('5S92!^4R!O<B!^4RXB*0H@(" @(" @(" @(" @
M(" @(" @("=R96%D+7-E<75E;F-E('-E<75E;F-E('-T<F5A;0H@(" @(" @
M(" @(" @(" @(" @("=R96%D+6-H87(M<V5Q=65N8V4@)W)E860M8GET92US
M97%U96YC92DI*2DI"B H9&5F=6X@<WES=&5M.CIW<FET92US97%U96YC92 H
M<V5Q=65N8V4@<W1R96%M("9R97-T(')E<W0@)FME>2 H<W1A<G0@,"D@*&5N
M9"!N:6PI*0H@(" H9&5C;&%R92 H:6=N;W)E('-T87)T(&5N9"DI"B @("AL
M970@*"AS96QT>7!E("AS>7-T96TZ.G-T<F5A;2UO=71P=70M96QE;65N="UT
M>7!E('-T<F5A;2DI"B @(" @(" @("AV96QT>7!E("AI9B H=F5C=&]R<"!S
M97%U96YC92D@*&%R<F%Y+65L96UE;G0M='EP92!S97%U96YC92D@="DI*0H@
M(" @("AC;VYD("@H;W(@*'-U8G1Y<&5P('-E;'1Y<&4@)TE.5$5'15(I("AS
M=6)T>7!E<"!V96QT>7!E("=)3E1%1T52*2D*(" @(" @(" @(" @.SL at 8'=R
M:71E+6)Y=&4M<V5Q=65N8V4G(&%C8V5P=', at .DY/+4A!3D<@86YD(')E='5R
M;G, at 86X@97AT<F$@=F%L=64*(" @(" @(" @(" @.SL@<VEN8V4@;6%K:6YG
M(&!W<FET92UC:&%R+7-E<75E;F-E)R!D;R!T:&4@<V%M92!W;W5L9"!B92!H
M86ER>2P*(" @(" @(" @(" @.SL@=V4@:6=N;W)E('1H:7,@<V5C;VYD(')E
M='5R;B!V86QU92!F;W(@=&AE('-A:V4@;V8 at 04Y320H@(" @(" @(" @(" H
M=F%L=65S("AA<'!L>2 C)W-Y<W1E;3HZ=W)I=&4M8GET92US97%U96YC92!S
M97%U96YC92!S=')E86T@<F5S="DI*0H@(" @(" @(" @("@H;W(@*&5Q('-E
M;'1Y<&4@)TY)3"D@*&5Q('-E;'1Y<&4@)T-(05)!0U1%4BD*(" @(" @(" @
M(" @(" @("AE<2!V96QT>7!E("=#2$%204-415(I*0H@(" @(" @(" @(" H
M87!P;'D@(R=S>7-T96TZ.G=R:71E+6-H87(M<V5Q=65N8V4@<V5Q=65N8V4@
M<W1R96%M(')E<W0I*0H@(" @(" @(" @("AT"B @(" @(" @(" @("AE<G)O
M<B H5$585" B?E,Z(&5L96UE;G0@='EP97,@;V8@?E, at 86YD('Y3(&%R92!A
M;6)I9W5O=7,N(%!L96%S92!U<V4@?E,@;W(@?E,N(BD*(" @(" @(" @(" @
M(" @(" @("=W<FET92US97%U96YC92!S97%U96YC92!S=')E86T*(" @(" @
M(" @(" @(" @(" @("=W<FET92UC:&%R+7-E<75E;F-E("=W<FET92UB>71E
0+7-E<75E;F-E*2DI*2DI"@``
`
end





More information about the Drakma-devel mailing list