From: <cha...@us...> - 2008-07-25 14:29:19
|
Revision: 517 http://sipp.svn.sourceforge.net/sipp/?rev=517&view=rev Author: charlespwright Date: 2008-07-25 14:29:17 +0000 (Fri, 25 Jul 2008) Log Message: ----------- Fix: Sending should reference send mode and forgot to add to dest for file inputs. Modified Paths: -------------- sipp/trunk/call.cpp Modified: sipp/trunk/call.cpp =================================================================== --- sipp/trunk/call.cpp 2008-07-23 17:13:00 UTC (rev 516) +++ sipp/trunk/call.cpp 2008-07-25 14:29:17 UTC (rev 517) @@ -673,13 +673,13 @@ if(transport == T_UDP) { struct sockaddr_storage saddr; - if(creationMode != MODE_CLIENT) + if(sendMode != MODE_CLIENT) return true; char peripaddr[256]; if (!peripsocket) { if ((associate_socket(new_sipp_call_socket(use_ipv6, transport, &existing))) == NULL) { - ERROR_NO("Unable to get a UDP socket"); + ERROR_NO("Unable to get a UDP socket (1)"); } } else { char *tmp = peripaddr; @@ -689,7 +689,7 @@ if (i == map_perip_fd.end()) { // Socket does not exist if ((associate_socket(new_sipp_call_socket(use_ipv6, transport, &existing))) == NULL) { - ERROR_NO("Unable to get a UDP socket"); + ERROR_NO("Unable to get a UDP socket (2)"); } else { /* Ensure that it stays persistent, because it is recorded in the map. */ call_socket->ss_count++; @@ -844,7 +844,7 @@ sock = call_socket; - if ((use_remote_sending_addr) && (creationMode == MODE_SERVER)) { + if ((use_remote_sending_addr) && (sendMode == MODE_SERVER)) { if (!call_remote_socket) { struct sockaddr_storage *L_dest = &remote_sending_sockaddr; @@ -2057,7 +2057,7 @@ break; case E_Message_Local_Port: int port; - if((transport == T_UDP) && (multisocket) && (creationMode != MODE_SERVER)) { + if((transport == T_UDP) && (multisocket) && (sendMode != MODE_SERVER)) { port = call_port; } else { port = local_port; @@ -2257,6 +2257,7 @@ int ret; while ((ret = fread(dest, 1, left, f)) > 0) { left -= ret; + dest += ret; } if (ret < 0) { ERROR("Error reading '%s': %s\n", buffer, strerror(errno)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |