/[jscoverage]/trunk/tests/http-server-chunked.c
ViewVC logotype

Diff of /trunk/tests/http-server-chunked.c

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

revision 120 by siliconforks, Sun Jun 1 14:06:35 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 <string.h>  #include <string.h>
24    
25  #include <netinet/in.h>  #include "http-server.h"
 #include <sys/socket.h>  
 #include <unistd.h>  
   
26  #include "stream.h"  #include "stream.h"
27  #include "util.h"  #include "util.h"
28    
29  int main(void) {  int main(void) {
30    int s = socket(PF_INET, SOCK_STREAM, 0);  #ifdef __MINGW32__
31    assert(s > 0);    WSADATA data;
32      if (WSAStartup(MAKEWORD(1, 1), &data) != 0) {
33        return 1;
34      }
35    #endif
36    
37      SOCKET s = socket(PF_INET, SOCK_STREAM, 0);
38      assert(s != INVALID_SOCKET);
39    
40    int optval = 1;    int optval = 1;
41    setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *) &optval, sizeof(optval));    setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *) &optval, sizeof(optval));
# Line 183  Line 189 
189      ssize_t bytes_sent = send(client_socket, message, message_length, 0);      ssize_t bytes_sent = send(client_socket, message, message_length, 0);
190      assert(bytes_sent == (ssize_t) message_length);      assert(bytes_sent == (ssize_t) message_length);
191    
192      close(client_socket);      closesocket(client_socket);
193    }    }
194    return 0;    return 0;
195  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.24