Alien-uv

 view release on metacpan or  search on metacpan

libuv/AUTHORS  view on Meta::CPAN

# Authors ordered by first contribution.
Ryan Dahl <ryan@joyent.com>
Bert Belder <bertbelder@gmail.com>
Josh Roesslein <jroesslein@gmail.com>
Alan Gutierrez <alan@prettyrobots.com>
Joshua Peek <josh@joshpeek.com>
Igor Zinkovsky <igorzi@microsoft.com>
San-Tai Hsu <vanilla@fatpipi.com>
Ben Noordhuis <info@bnoordhuis.nl>
Henry Rawas <henryr@schakra.com>
Robert Mustacchi <rm@joyent.com>
Matt Stevens <matt@alloysoft.com>
Paul Querna <pquerna@apache.org>
Shigeki Ohtsu <ohtsu@iij.ad.jp>

libuv/LICENSE-docs  view on Meta::CPAN

          extent necessary to allow You to exercise the Licensed
          Rights, but not otherwise.

       2. Patent and trademark rights are not licensed under this
          Public License.

       3. To the extent possible, the Licensor waives any right to
          collect royalties from You for the exercise of the Licensed
          Rights, whether directly or through a collecting society
          under any voluntary or waivable statutory or compulsory
          licensing scheme. In all other cases the Licensor expressly
          reserves any right to collect such royalties.


Section 3 -- License Conditions.

Your exercise of the Licensed Rights is expressly made subject to the
following conditions.

  a. Attribution.

       1. If You Share the Licensed Material (including in modified
          form), You must:

            a. retain the following if it is supplied by the Licensor
               with the Licensed Material:

libuv/LICENSE-docs  view on Meta::CPAN

     distributing the Licensed Material at any time; however, doing so
     will not terminate this Public License.

  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
     License.


Section 7 -- Other Terms and Conditions.

  a. The Licensor shall not be bound by any additional or different
     terms or conditions communicated by You unless expressly agreed.

  b. Any arrangements, understandings, or agreements regarding the
     Licensed Material not stated herein are separate from and
     independent of the terms and conditions of this Public License.


Section 8 -- Interpretation.

  a. For the avoidance of doubt, this Public License does not, and
     shall not be interpreted to, reduce, limit, restrict, or impose

libuv/LICENSE-docs  view on Meta::CPAN

     be made without permission under this Public License.

  b. To the extent possible, if any provision of this Public License is
     deemed unenforceable, it shall be automatically reformed to the
     minimum extent necessary to make it enforceable. If the provision
     cannot be reformed, it shall be severed from this Public License
     without affecting the enforceability of the remaining terms and
     conditions.

  c. No term or condition of this Public License will be waived and no
     failure to comply consented to unless expressly agreed to by the
     Licensor.

  d. Nothing in this Public License constitutes or may be interpreted
     as a limitation upon, or waiver of, any privileges and immunities
     that apply to the Licensor or You, including from the legal
     processes of any jurisdiction or authority.


=======================================================================

libuv/samples/socks5-proxy/s5.c  view on Meta::CPAN

#include <stdlib.h>  /* abort() */
#include <string.h>  /* memset() */

enum {
  s5_version,
  s5_nmethods,
  s5_methods,
  s5_auth_pw_version,
  s5_auth_pw_userlen,
  s5_auth_pw_username,
  s5_auth_pw_passlen,
  s5_auth_pw_password,
  s5_req_version,
  s5_req_cmd,
  s5_req_reserved,
  s5_req_atyp,
  s5_req_atyp_host,
  s5_req_daddr,
  s5_req_dport0,
  s5_req_dport1,
  s5_dead

libuv/samples/socks5-proxy/s5.c  view on Meta::CPAN

        cx->state = s5_auth_pw_username;
        break;

      case s5_auth_pw_username:
        if (cx->arg0 < cx->userlen) {
          cx->username[cx->arg0] = c;
          cx->arg0 += 1;
        }
        if (cx->arg0 == cx->userlen) {
          cx->username[cx->userlen] = '\0';
          cx->state = s5_auth_pw_passlen;
        }
        break;

      case s5_auth_pw_passlen:
        cx->arg0 = 0;
        cx->passlen = c;
        cx->state = s5_auth_pw_password;
        break;

      case s5_auth_pw_password:
        if (cx->arg0 < cx->passlen) {
          cx->password[cx->arg0] = c;
          cx->arg0 += 1;
        }
        if (cx->arg0 == cx->passlen) {
          cx->password[cx->passlen] = '\0';
          cx->state = s5_req_version;
          err = s5_auth_verify;
          goto out;
        }
        break;

      case s5_req_version:
        if (c != 5) {
          err = s5_bad_version;
          goto out;

libuv/samples/socks5-proxy/s5.h  view on Meta::CPAN

} s5_cmd;

typedef struct {
  uint32_t arg0;  /* Scratch space for the state machine. */
  uint32_t arg1;  /* Scratch space for the state machine. */
  uint8_t state;
  uint8_t methods;
  uint8_t cmd;
  uint8_t atyp;
  uint8_t userlen;
  uint8_t passlen;
  uint16_t dport;
  uint8_t username[257];
  uint8_t password[257];
  uint8_t daddr[257];  /* TODO(bnoordhuis) Merge with username/password. */
} s5_ctx;

void s5_init(s5_ctx *ctx);

s5_err s5_parse(s5_ctx *cx, uint8_t **data, size_t *size);

libuv/src/unix/stream.c  view on Meta::CPAN


    /* NOTE: call callback AFTER freeing the request data. */
    if (req->cb)
      req->cb(req, req->error);
  }
}


uv_handle_type uv__handle_type(int fd) {
  struct sockaddr_storage ss;
  socklen_t sslen;
  socklen_t len;
  int type;

  memset(&ss, 0, sizeof(ss));
  sslen = sizeof(ss);

  if (getsockname(fd, (struct sockaddr*)&ss, &sslen))
    return UV_UNKNOWN_HANDLE;

  len = sizeof type;

  if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len))
    return UV_UNKNOWN_HANDLE;

  if (type == SOCK_STREAM) {
#if defined(_AIX) || defined(__DragonFly__)
    /* on AIX/DragonFly the getsockname call returns an empty sa structure
     * for sockets of type AF_UNIX.  For all other types it will
     * return a properly filled in structure.
     */
    if (sslen == 0)
      return UV_NAMED_PIPE;
#endif
    switch (ss.ss_family) {
      case AF_UNIX:
        return UV_NAMED_PIPE;
      case AF_INET:
      case AF_INET6:
        return UV_TCP;
      }
  }



( run in 1.416 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )