~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to common/http.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
{
305
305
#ifdef HTTP_USE_GNUTLS
306
306
  tls_callback = (gpg_error_t (*) (http_t, gnutls_session_t, int))cb;
 
307
#else
 
308
  (void)cb;
307
309
#endif  
308
310
}
309
311
 
396
398
  else
397
399
#endif /*HTTP_USE_ESTREAM*/
398
400
    {
 
401
#ifdef HAVE_W32_SYSTEM
 
402
      HANDLE handle = (HANDLE)hd->sock;
 
403
      if (!DuplicateHandle (GetCurrentProcess(), handle,
 
404
                            GetCurrentProcess(), &handle, 0,
 
405
                            TRUE, DUPLICATE_SAME_ACCESS ))
 
406
        return gpg_error_from_syserror ();
 
407
      hd->sock = (int)handle;
 
408
#else
399
409
      hd->sock = dup (hd->sock);
 
410
#endif
400
411
      if (hd->sock == -1)
401
412
        return gpg_error_from_syserror ();
402
413
    }
1490
1501
}
1491
1502
#endif
1492
1503
 
1493
 
/* Actually connect to a server.  Returns the file descripto or -1 on
 
1504
/* Actually connect to a server.  Returns the file descriptor or -1 on
1494
1505
   error.  ERRNO is set on error. */
1495
1506
static int
1496
1507
connect_server (const char *server, unsigned short port,
1765
1776
    {
1766
1777
      do
1767
1778
        {
 
1779
#ifdef HAVE_W32_SYSTEM
 
1780
          /* Under Windows we need to use recv for a socket.  */
 
1781
          nread = recv (c->fd, buffer, size, 0);
 
1782
#else          
1768
1783
          nread = read (c->fd, buffer, size);
 
1784
#endif
1769
1785
        }
1770
1786
      while (nread == -1 && errno == EINTR);
1771
1787
    }