[patch] Winsock fixes

Paul Rupe prupe at nc.rr.invalid
Wed Nov 28 15:09:35 CST 2001


I have found two bugs in dlls/winsock/socket.c.  One I posted about a 
few days ago in wine.devel.  WS_accept calls WS_getpeername but passes 
it the Unix file descriptor rather than the Windows socket handle.  A 
simple one-line change takes care of that.

The second problem is more subtle, and I'm not sure if my solution is 
enough.  In WINSOCK_DoAsyncEvent there is a loop that dispatches all 
events currently available on the socket.  The problem is the order, it 
simply calls them in increasing order by FD_xxx values.  Since FD_READ 
is numerically smaller than FD_CONNECT, a socket that has both events 
will fire the read event before the connect.  When that happens, the app
gets a read event before it thinks it's connected and ignores it. 
Ideally, the loop should post them in the order in which they occurred,
but does wine keep track of that?  Instead, I changed the loop so that
it checks FD_CONNECT and FD_CLOSE before FD_READ and FD_WRITE.  I'm not 
sure if the order I chose is the optimal one, but the app I was testing 
(Xnews) works every time now.

This patch for dlls/winsock/socket.c contains both fixes.


-- 
Paul Rupe                                        "She smiled, in the end."
p r u p e @ n c . r r . c o m

begin 644 winepatch.dff
M26YD97 at Z('-O8VME="YC"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*4D-3(&9I
M;&4Z("]H;VUE+W=I;F4O=VEN92]D;&QS+W=I;G-O8VLO<V]C:V5T+F,L=@IR
M971R:65V:6YG(')E=FES:6]N(#$N-C@*9&EF9B`M=2`M<C$N-C@@<V]C:V5T
M+F,*+2TM('-O8VME="YC"3(P,#$O,3$O,30@,C$Z,C8Z,C,),2XV.`HK*RL@
M<V]C:V5T+F,),C`P,2\Q,2\R."`Q.#HT.3HR,0I`0"`M,C`R+#8@*S(P,BPR
M,R!`0`H@"3`*('T["B`**R\J(%!E<FUU=&%T:6]N(&]F(#`N+D9$7TU!6%]%
M5D5.5%, at +2`Q(')E<')E<V5N=&EN9R!T:&4@;W)D97(@:6X@=VAI8V@@=V4@
M<&]S=`HK("H@;65S<V%G97,@:68@=&AE<F4 at 87)E(&UU;'1I<&QE(&5V96YT
M<RX@(%5S960@:6X at 5TE.4T]#2U]$;T%S>6YC179E;G0N("!4:&4**R`J('!R
M;V)L96T@:7,@:68@=&AE<F4@:7, at 8F]T:"!A($9$7T-/3DY%0U0 at 979E;G0@
M86YD+"!S87DL(&%N($9$7U)%040 at 979E;G0**R`J(&%V86EL86)L92!O;B!T
M:&4@<V%M92!S;V-K970L('=E('=A;G0@=&\@;F]T:69Y('1H92!A<'`@;V8@
M=&AE(&-O;FYE8W0 at 979E;G0**R`J(&9I<G-T+B`@3W1H97)W:7-E(&ET(&UA
M>2!D:7-C87)D('1H92!R96%D(&5V96YT(&)E8V%U<V4@:70@=&AI;FMS(&ET
M(&AA<VXG=`HK("H at 8V]N;F5C=&5D('EE="X**R`J+PHK<W1A=&EC(&-O;G-T
M(&EN="!E=F5N=%]B:71O<F1E<EM&1%]-05A?159%3E1372`]('L**R`@("!&
M1%]#3TY.14-47T))5"P**R`@("!&1%]#3$]315]"250L"BL@("`@1D1?04-#
M15!47T))5"P**R`@("!&1%]/3T)?0DE4+`HK("`@($9$7U=2251%7T))5"P*
M*R`@("!&1%]214%$7T))5"P**R`@("`V+"`W+"`X+"`Y("`O*B!L969T;W9E
M<G,@*B\**WT["BL*("\J('-E="!L87-T(&5R<F]R(&-O9&4 at 9G)O;2!.5"!S
M=&%T=7,@=VET:&]U="!M87!P:6YG(%=302!E<G)O<G,@*B\*(&EN;&EN92!S
M=&%T:6,@=6YS:6=N960@:6YT('-E=%]E<G)O<B@@=6YS:6=N960@:6YT(&5R
M<B`I"B!["D!`("TY,#<L-R`K.3(T+#<@0$`*(`EI9B`H87,I"B`)>PH@"2`@
M("!U;G-I9VYE9"!O;6%S:R`](%]G971?<V]C:U]M87-K*"!S("D["BT)("`@
M(%=37V=E='!E97)N86UE*&9D+"!A9&1R+"!A9&1R;&5N,S(I.PHK"2`@("!7
M4U]G971P965R;F%M92AA<RP at 861D<BP at 861D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('1H92!E=F5N=%]B:71O<F1E<@HK("`@("`J(&%R<F%Y+ at HK
M("`@("`J+PHK("`@(&9O<B`H:3TP.R!I/$9$7TU!6%]%5D5.5%,[(&DK*RD@
M>PHK("`@("`@("!J(#T at 979E;G1?8FET;W)D97);:5T["BL@("`@("`@(&EF
M("AP;6%S:R`F("@Q/#QJ*2D@>PHK("`@("`@("`@("`@5%)!0T4H(G!O<W0Z
M(&5V96YT(&)I="`E9"P at 97)R;W(@)61<;B(L(&HL(&5R<F]R<UMJ72D["BL@
M("`@("`@("`@("!0;W-T365S<V%G94$H:6YF;RT^:%=N9"P@:6YF;RT^=4US
M9RP@:6YF;RT^<V]C:RP**R`@("`@("`@("`@("`@("`@("`@("`@("!74T%-
M04M%4T5,14-44D503%DH,3P\:BP at 97)R;W)S6VI=*2D["BL@("`@("`@('T*
M*R`@("!]"B`@("`@+RH at 8VQE86YU<"`J+PH@("`@(&EF("AO<G!H86XI"B`@
%("`@>PH`
`
end






More information about the wine-patches mailing list