/[jscoverage]/trunk/tests/http-client-bad-url.c
ViewVC logotype

Diff of /trunk/tests/http-client-bad-url.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 125 by siliconforks, Sat May 31 21:39:39 2008 UTC revision 126 by siliconforks, Mon Jun 2 17:53:43 2008 UTC
# Line 17  Line 17 
17      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */  */
19    
20    #include <config.h>
21    
22  #include <assert.h>  #include <assert.h>
23  #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  
24  #include <string.h>  #include <string.h>
25    
26  #include <arpa/inet.h>  #include "http-server.h"
 #include <netinet/in.h>  
 #include <netdb.h>  
 #include <sys/socket.h>  
 #include <unistd.h>  
   
27  #include "util.h"  #include "util.h"
28    
29  int main(int argc, char ** argv) {  int main(int argc, char ** argv) {
30    #ifdef __MINGW32__
31      WSADATA data;
32      if (WSAStartup(MAKEWORD(1, 1), &data) != 0) {
33        return 1;
34      }
35    #endif
36    
37    int result;    int result;
38    
39    if (argc < 3) {    if (argc < 3) {
# Line 46  Line 49 
49    a.sin_port = htons(connect_port);    a.sin_port = htons(connect_port);
50    a.sin_addr.s_addr = htonl(INADDR_LOOPBACK);    a.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
51    
52    int s = socket(PF_INET, SOCK_STREAM, 0);    SOCKET s = socket(PF_INET, SOCK_STREAM, 0);
53    assert(s > 0);    assert(s != INVALID_SOCKET);
54    
55    result = connect(s, (struct sockaddr *) &a, sizeof(a));    result = connect(s, (struct sockaddr *) &a, sizeof(a));
56    assert(result == 0);    assert(result == 0);
# Line 69  Line 72 
72      }      }
73    }    }
74    
75    close(s);    closesocket(s);
76    return 0;    return 0;
77  }  }

Legend:
Removed from v.125  
changed lines
  Added in v.126

  ViewVC Help
Powered by ViewVC 1.1.24