~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/sockets/test_sockets_echo_server.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
#if !USE_UDP
73
73
  // for TCP sockets, we may need to accept a connection
74
74
  if (FD_ISSET(server.fd, &fdr)) {
 
75
#if TEST_ACCEPT_ADDR
 
76
    // Do an accept with non-NULL addr and addlen parameters. This tests a fix to a bug in the implementation of
 
77
    // accept which had a parameter "addrp" but used "addr" internally if addrp was set - giving a ReferenceError.
 
78
    struct sockaddr_in addr = {0};
 
79
    addr.sin_family = AF_INET;
 
80
    socklen_t addrlen = sizeof(addr);
 
81
    client.fd = accept(server.fd, (struct sockaddr *) &addr, &addrlen);
 
82
#else
75
83
    client.fd = accept(server.fd, NULL, NULL);
 
84
#endif
76
85
    assert(client.fd != -1);
77
86
  }
78
87
#endif