Diff for /libaitio/src/sock.c between versions 1.15 and 1.16

version 1.15, 2014/05/18 23:35:16 version 1.16, 2016/08/18 09:06:31
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004 - 2014Copyright 2004 - 2016
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 168  io_txNet(sched_task_t *task) Line 168  io_txNet(sched_task_t *task)
                 if (s->sock_type == SOCK_STREAM)                  if (s->sock_type == SOCK_STREAM)
                         wlen = send(TASK_FD(task), buf, len, 0);                          wlen = send(TASK_FD(task), buf, len, 0);
                 else                  else
                        wlen = sendto(TASK_FD(task), buf, len, 0, #ifndef __linux__
                                        &cli->cli_addr.sa, cli->cli_addr.sa.sa_len);                        wlen = sendto(TASK_FD(task), buf, len, 0, &cli->cli_addr.sa, cli->cli_addr.sa.sa_len);
 #else
                         wlen = sendto(TASK_FD(task), buf, len, 0, &cli->cli_addr.sa, 
                                         cli->cli_addr.sa.sa_family == AF_INET ? 
                                         sizeof cli->cli_addr.sin : sizeof cli->cli_addr.sin6);
 #endif
                 if (wlen < 1) {                  if (wlen < 1) {
                         schedEvent(TASK_ROOT(task), io_closeClient, cli, 0, NULL, 0);                          schedEvent(TASK_ROOT(task), io_closeClient, cli, 0, NULL, 0);
                         break;                          break;
Line 452  ioInitSocket(int role, int type, int proto, const char Line 457  ioInitSocket(int role, int type, int proto, const char
                 e_free(s);                  e_free(s);
                 return NULL;                  return NULL;
         }          }
   #ifndef __linux__
         if (bind(s->sock_fd, &s->sock_addr.sa, s->sock_addr.sa.sa_len) == -1) {          if (bind(s->sock_fd, &s->sock_addr.sa, s->sock_addr.sa.sa_len) == -1) {
   #else
           if (bind(s->sock_fd, &s->sock_addr.sa, s->sock_addr.sa.sa_family == AF_INET ? 
                                   sizeof s->sock_addr.sin : sizeof s->sock_addr.sin6) == -1) {
   #endif
                 LOGERR;                  LOGERR;
                 AIT_FREE_VAL(&s->sock_buf);                  AIT_FREE_VAL(&s->sock_buf);
                 e_free(s);                  e_free(s);
Line 549  ioUpSocket(sock_t * __restrict s, void *arg, int timeo Line 559  ioUpSocket(sock_t * __restrict s, void *arg, int timeo
                 case IO_SOCK_ROLE_CLIENT:                  case IO_SOCK_ROLE_CLIENT:
                         memcpy(&s->sock_peer, peer, sizeof s->sock_peer);                          memcpy(&s->sock_peer, peer, sizeof s->sock_peer);
   
                        if (connect(s->sock_fd, &s->sock_peer.sa, #ifndef __linux__
                                                s->sock_peer.sa.sa_len) == -1) {                        if (connect(s->sock_fd, &s->sock_peer.sa, s->sock_peer.sa.sa_len) == -1) {
 #else
                         if (connect(s->sock_fd, &s->sock_peer.sa, s->sock_addr.sa.sa_family == AF_INET ? 
                                                 sizeof s->sock_peer.sin : sizeof s->sock_peer.sin6) == -1) {
 #endif
                                 LOGERR;                                  LOGERR;
                                 return -1;                                  return -1;
                         }                          }

Removed from v.1.15  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>