But the error does not happen when debugging. It only occurs in service mode which is not debuggable. That's the whole problem!
Thanks, SZ ----- Original Message ----- From: "Francois Piette" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Tuesday, October 11, 2005 12:47 PM Subject: Re: [twsocket] Fw: Sync THttpConnection derivative Again, use the debugger to know where the AV occurs. -- [EMAIL PROTECTED] http://www.overbyte.be ----- Original Message ----- From: "Fastream Technologies" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Tuesday, October 11, 2005 11:30 AM Subject: Re: [twsocket] Fw: Sync THttpConnection derivative > I know have a second very strange problem: I have two .bpr projects for > the > same code except that one is for debugging with a dummy form and the other > one is a service. The object creation/destruction orders are the same. > However, when I run the ISAPI code (even once) as below, the service gives > an AV and the "Please tell M$ about this" screen appears. This does not > happen in the form project! > > Your constructive response will be appreciated! > > Best Regards, > > SubZ > > ----- Original Message ----- > From: "Francois Piette" <[EMAIL PROTECTED]> > To: "ICS support mailing" <twsocket@elists.org> > Sent: Tuesday, October 11, 2005 10:38 AM > Subject: Re: [twsocket] Fw: Sync THttpConnection derivative > > > > Debugger, just like the MessageBox showed correct values! > > Do you still have message box in the code ? This may cause the problem > because it call the message > pump and wsocket_send may be called from elsewhere. Never use MessageBox > to > show values, use > Windows.OutputDebugString or use Writeln (don't forget to make your app a > console mode app). > > Maybe I found the problem. WSocket_send is defined as: > function WSocket_send(s: TSocket; var Buf; len, flags: Integer): Integer; > > This means you have t call it like this: > Count := WSocket_send(HSocket, Data^, DataLen, 0); > > See the "^" that I added. Since the Buf argument is declare as untype var, > the compiler > automatically take the address. So when you pas "Data", then it is the > pointer address that is > passed. When you pass "Data^", the actual pointer value is passed. > > -- > [EMAIL PROTECTED] > http://www.overbyte.be > > > ----- Original Message ----- > From: "Fastream Technologies" <[EMAIL PROTECTED]> > To: "ICS support mailing" <twsocket@elists.org> > Sent: Tuesday, October 11, 2005 9:13 AM > Subject: Re: [twsocket] Fw: Sync THttpConnection derivative > > > > Debugger, just like the MessageBox showed correct values! > > > > However the socket printed something with a first line like: > > > > ÿº > > > > (This was suppose to be a long line but OE only printed this much!) > > > > Regards, > > > > SubZ > > > > ----- Original Message ----- > > From: "Francois PIETTE" <[EMAIL PROTECTED]> > > To: "ICS support mailing" <twsocket@elists.org> > > Sent: Monday, October 10, 2005 7:33 PM > > Subject: Re: [twsocket] Fw: Sync THttpConnection derivative > > > > > > >> I still get garbage data with NO HTTP header. > > >> Any idea why? > > > > > > No idea why. But did you use the debugger to verify that Data and > > > DataLen > > > have correct values ? > > > > > > To debug further, you can add an Windows.OutputDebugString in > > > WSocket_Synchronized_send function to display what is really sent by > > > the > > > component, no matter if called "normally" by the component or by a > > > direct > > > call to WSocket_Send. To see messages printed out by > > > OutputDebugString, > > > you > > > simply hit CTRL+ALT+V within Delphi (Probably the same with BCB). > > > > > > -- > > > Contribute to the SSL Effort. Visit > > > http://www.overbyte.be/eng/ssl.html > > > -- > > > [EMAIL PROTECTED] > > > http://www.overbyte.be > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Fastream Technologies" <[EMAIL PROTECTED]> > > > To: "ICS support mailing" <twsocket@elists.org> > > > Sent: Monday, October 10, 2005 4:45 PM > > > Subject: Re: [twsocket] Fw: Sync THttpConnection derivative > > > > > > > > >> Hello and thanks for your replies, > > >> > > >> I now have the following code that do not raise any exception: > > >> > > >> In the connection class derived from TWebConnection: > > >> > > >> Pause(); > > >> > > >> int iMode = 0; > > >> WSocket_ioctlsocket(HSocket, FIONBIO, iMode); > > >> > > >> if(!serverThread->DXISAPI->Execute(this, > > >> ISAPIInterpreter, > > >> Method, > > >> Params, > > >> Path, > > >> LastFilePath, > > >> RequestContentType, > > >> POSTString, > > >> postedDataLen, scriptResult)) > > >> result = dpError; > > >> else > > >> { > > >> iMode = 1; > > >> if(WSocket_ioctlsocket(HSocket, FIONBIO, > > >> iMode)) > > >> { > > >> Resume(); > > >> Close(); > > >> } > > >> else > > >> Resume(); > > >> } > > >> > > >> and in the TWebConnection that is derived from THttpConnection and > > >> can > > >> be > > >> called from pascal DXISAPI code by callback functions: > > >> > > >> OldDataAvailable := FOnDataAvailable; > > >> OldSendData := FOnSendData; > > >> OldDataSent := FOnDataSent; > > >> FOnDataAvailable := nil; > > >> FOnSendData := nil; > > >> FOnDataSent := nil; > > >> > > >> if FTerminated or > > >> ((State <> wsConnected) and (State <> wsSocksConnected)) then > > >> begin > > >> Result := false; > > >> Exit; > > >> end; > > >> > > >> Count := WSocket_send(HSocket, > > >> Data, > > >> DataLen, > > >> 0); > > >> > > >> Result := Count > 0; > > >> if Result = true then > > >> DataSent := DataSent + Count; > > >> > > >> if FTerminated or > > >> ((State <> wsConnected) and (State <> wsSocksConnected)) then > > >> begin > > >> Result := false; > > >> end; > > >> > > >> if Result = true then > > >> begin > > >> FOnDataAvailable := OldDataAvailable; > > >> FOnSendData := OldSendData; > > >> FOnDataSent := OldDataSent; > > >> end; > > >> > > >> I still get garbage data with NO HTTP header. > > >> > > >> Any idea why? > > >> > > >> Best Regards, > > >> > > >> SubZ > > > > > > -- > > > To unsubscribe or change your settings for TWSocket mailing list > > > please goto http://www.elists.org/mailman/listinfo/twsocket > > > Visit our website at http://www.overbyte.be > > > > -- > > To unsubscribe or change your settings for TWSocket mailing list > > please goto http://www.elists.org/mailman/listinfo/twsocket > > Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be