version 1.364, 2006/08/30 14:46:19
|
version 1.365, 2006/09/07 16:36:50
|
Line 2705 static AHTReqContext *LoopRequest= NULL;
|
Line 2705 static AHTReqContext *LoopRequest= NULL;
|
static int LoopForStop (AHTReqContext *me) |
static int LoopForStop (AHTReqContext *me) |
{ |
{ |
int status_req = HT_OK; |
int status_req = HT_OK; |
|
int count = 0; |
|
|
#ifdef _WINGUI |
#ifdef _WINGUI |
MSG msg; |
MSG msg; |
Line 2717 static int LoopForStop (AHTReqContext *m
|
Line 2718 static int LoopForStop (AHTReqContext *m
|
old_active_window = GetActiveWindow (); |
old_active_window = GetActiveWindow (); |
libwww_window = HTEventList_getWinHandle (&libwww_msg); |
libwww_window = HTEventList_getWinHandle (&libwww_msg); |
|
|
while (me->reqStatus != HT_END && me->reqStatus != HT_ERR |
while (me->reqStatus != HT_END && |
&& me->reqStatus != HT_ABORT && AmayaIsAlive () && |
me->reqStatus != HT_ERR |
|
&& me->reqStatus != HT_ABORT && |
|
AmayaIsAlive () && |
GetMessage (&msg, NULL, 0, 0)) |
GetMessage (&msg, NULL, 0, 0)) |
{ |
{ |
if (msg.message != WM_QUIT) |
if (msg.message != WM_QUIT) |
TtaHandleOneEvent (&msg); |
TtaHandleOneEvent (&msg); |
else |
else |
break; |
break; |
|
if (count < 300) |
|
count ++; // no more than 300 retries |
|
else |
|
me->reqStatus = HT_ABORT; |
} |
} |
if (!AmayaIsAlive ()) |
if (!AmayaIsAlive ()) |
/* Amaya was killed by one of the callback handlers */ |
/* Amaya was killed by one of the callback handlers */ |
Line 2740 static int LoopForStop (AHTReqContext *m
|
Line 2747 static int LoopForStop (AHTReqContext *m
|
/* Loop while waiting for new events, exists when the request is over */ |
/* Loop while waiting for new events, exists when the request is over */ |
while (me->reqStatus != HT_ABORT && |
while (me->reqStatus != HT_ABORT && |
me->reqStatus != HT_END && |
me->reqStatus != HT_END && |
me->reqStatus != HT_ERR) { |
me->reqStatus != HT_ERR) |
if (!AmayaIsAlive ()) |
{ |
/* Amaya was killed by one of the callback handlers */ |
if (!AmayaIsAlive ()) |
exit (0); |
/* Amaya was killed by one of the callback handlers */ |
|
exit (0); |
if (TtaFetchOneAvailableEvent (&ev)) |
if (TtaFetchOneAvailableEvent (&ev)) |
TtaHandleOneEvent (&ev); |
TtaHandleOneEvent (&ev); |
|
if (count < 300) |
|
count ++; // no more than 300 retries |
|
else |
|
me->reqStatus = HT_ABORT; |
#ifdef _WX |
#ifdef _WX |
/* this is necessary for synchronous request*/ |
/* this is necessary for synchronous request*/ |
/* check the socket stats */ |
/* check the socket stats */ |
if (me->reqStatus != HT_ABORT) |
if (me->reqStatus != HT_ABORT) |
// the request is not aborted |
// the request is not aborted |
wxAmayaSocketEvent::CheckSocketStatus( 500 ); |
wxAmayaSocketEvent::CheckSocketStatus( 500 ); |
#endif /* _WX */ |
#endif /* _WX */ |
} |
} |
#endif /* #if defined(_GTK) || defined(_WX) */ |
#endif /* #if defined(_GTK) || defined(_WX) */ |
|
|
switch (me->reqStatus) |
switch (me->reqStatus) |