lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LYNX-DEV http://www.flora.org/lynx-dev/html/month0398/msg01003.html


From: afn06760
Subject: LYNX-DEV http://www.flora.org/lynx-dev/html/month0398/msg01003.html
Date: Mon, 30 Mar 1998 19:40:00 GMT

>     * From: Sinan Kaan Yerli <address@hidden>
>     * Date: Mon, 30 Mar 1998 16:46:59 +0100 (BST)
>
>On Mon, 30 Mar 1998, Wayne Buttles wrote:
>
>>For some reason, the following page screws up lynx with
>>your patch (yes, BAD HTML ;-).  http://www.fdisk.com/search/
>>
Strange.  It works fine on my super deluxe version of lynx for Windows
95, compiled by MINGW32.  Odd that you would select that particular
page as a `BAD HTML', but not disturbing.

What doesn't work fine is the WSAAsyncGetHostByName call as a basis for
NSL fork:

The following is a log of a test program attempt to use
WSAAsyncGetHostByName as a basis for the NSL_FORK code
in the lynx web browser:


E:\src\bcsock>gcc -O -o socktest asyncsocktest.c -luser32 -lwsock32

E:\src\bcsock>socktest
Unable to cancel GetHost.
Contents of phost:  ░SΣ░S
        39057524
Value returned: 10022
 WSAEINVAL 10022, WSAEINPROGRESS 10036, WSAEALREADY 10037
=========================================================
Quote from the manual:
WSAEINVAL       Indicates that the specified
                asynchronous task handle was invalid

==========================================================
asyncsocktest.c:
==========================================================
#define Win32_Winsock
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>


int main (int argc, char **argv)
{
 HANDLE hThread;
 HWND hDeskWind;
 WSADATA WSAbuffer;
 WORD wVerReq;
 MSG SocketMessage;
 const char FAR *host = "www.mit.edu";
 struct hostent FAR *phost;
 char buffer[MAXGETHOSTSTRUCT] = {0};

        wVerReq = MAKEWORD(1,1);

        if (WSAStartup(wVerReq, &WSAbuffer))
         {printf("Unable to start wsock32.dll\n"); return 1; };

        phost = (struct hostent FAR *)buffer;
        hDeskWind = GetDesktopWindow();
        hThread = WSAAsyncGetHostByName(hDeskWind,
                (WM_USER+64), host, (char FAR *)phost,
                MAXGETHOSTSTRUCT);
        if (!hThread)
         printf("Unable to initiate GetHost. hThread = %d\n", (int)hThread);

        while (!PeekMessage((LPMSG)&SocketMessage, hDeskWind,
                        (WM_USER+64), (WM_USER+64), PM_REMOVE))
         if (kbhit())
           if (WSACancelAsyncRequest((HANDLE)hThread))
            {
             wVerReq = WSAGetLastError();
             printf("Unable to cancel GetHost.\n");
             printf("Contents of phost: %s\n\t%d\n",
                (char *)buffer, (int *)buffer);
             printf("Value returned: %d\n"
" WSAEINVAL %d, WSAEINPROGRESS %d, WSAEALREADY %d\n",
                        wVerReq, WSAEINVAL,
                        WSAEINPROGRESS, WSAEALREADY);
             return WSACleanup();
            };
             
        MessageBox((HWND)NULL, buffer,
                        "Host found. host:", MB_OK);
        return WSACleanup();
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]