Thread: RE: [INTERFACES] libpq sockets on win32

RE: [INTERFACES] libpq sockets on win32

From
"Jeff Johnson"
Date:
> I have done exactly that.  I assume fcntl(), ioctl(),
> select() use errno
> even if used on a socket, while getsockopt(), setsockopt(),
socket(),
> connect(), getsockname(), send(), recv() use WSAGetLastError.  Is
this
> list correct?

I don't know enough about such things.

>
> The patch is attached.  Please let me know so I can finalize it and
> apply it.

Couple of changes required to compile on Win32:

Change:
#define sockerrno WSAGetLastError
To:
#define sockerrno WSAGetLastError()


This has to go back into fe-connect.c, EINPROGRESS isn't defined in
Win32 for some reason..
#ifndef WIN32
        if (errno == EINPROGRESS || errno == 0)
#else
        if (WSAGetLastError() == WSAEINPROGRESS)
#endif



I tested it out but I'm getting this error when sending a large SQL
statement (>16k).


  File "WebKit\Application.py", line 340, in dispatchRequest
    self.handleGoodURL(transaction)
  File "WebKit\Application.py", line 457, in handleGoodURL
    self.respond(transaction)
  File "WebKit\Application.py", line 569, in respond
    transaction.respond()
  File "H:\webware\Webware\WebKit\Transaction.py", line 93, in respond
    self._servlet.respond(self)
  File "H:\webware\Webware\WebKit\HTTPServlet.py", line 38, in respond
    method(self, trans)
  File "H:\webware\Webware\WebKit\Page.py", line 34, in respondToGet
    self._respond(transaction)
  File "H:\webware\Webware\WebKit\Page.py", line 67, in _respond
    self.writeHTML()
  File "H:\webware\Webware\WebKit\Page.py", line 129, in writeHTML
    self.writeBody()
  File "H:\webware\Webware\WebKit\Page.py", line 186, in writeBody
    self.writeBodyParts()
  File "/EA\www\SitePage.py", line 305, in writeBodyParts
    self.writeContent()
  File "\EA\www\MyTest.py", line 9, in writeContent
    self.transferRecords()
  File "\EA\www\MyTest.py", line 45, in transferRecords
    cu.execute(sql)
  File "c:\python20\pgdb.py", line 189, in execute
    self.executemany(operation, (params,))
  File "c:\python20\pgdb.py", line 204, in executemany
    rows = self.__source.execute(sql)
ValueError: pqReadData() --  read() failed: errno=10035
Unknown error