summaryrefslogtreecommitdiff
path: root/src/input/input_http.c
diff options
context:
space:
mode:
authorTim Champagne <tchamp@users.sourceforge.net>2003-05-20 16:23:44 +0000
committerTim Champagne <tchamp@users.sourceforge.net>2003-05-20 16:23:44 +0000
commit2ff0f33b6345f193ef9dbd6547b268c0bc12552a (patch)
tree7cc5933246205fe58d25ffad0c0d4c41a0dce57a /src/input/input_http.c
parentcee76d5b9b53b098178ce66789e0d491406afad2 (diff)
downloadxine-lib-2ff0f33b6345f193ef9dbd6547b268c0bc12552a.tar.gz
xine-lib-2ff0f33b6345f193ef9dbd6547b268c0bc12552a.tar.bz2
This adds http and network input for Win32. I have no idea how to test this under win32 though?
CVS patchset: 4889 CVS date: 2003/05/20 16:23:44
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r--src/input/input_http.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 09b058a43..d05ae687d 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -31,9 +31,13 @@
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
+
+#ifndef WIN32
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
+#endif /* WIN32 */
+
#include <sys/time.h>
#include "xine_internal.h"
@@ -123,8 +127,13 @@ static int http_plugin_host_connect_attempt (struct in_addr ia, int port,
sin.sin_family = AF_INET;
sin.sin_addr = ia;
sin.sin_port = htons(port);
-
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) {
+
+#ifndef WIN32
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+#else
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError != WSAEINPROGRESS)
+#endif /* WIN32 */
+ {
xine_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "cannot connect to host", NULL);
xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: cannot connect to host\n"));
close(s);