apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r652951 - in /apr/apr/trunk: CHANGES network_io/unix/sockaddr.c
Date Fri, 02 May 2008 23:50:47 GMT
Author: trawick
Date: Fri May  2 16:50:47 2008
New Revision: 652951

URL: http://svn.apache.org/viewvc?rev=652951&view=rev
Log:
apr_getservbyname(): Use proper method for converting port
to host byte order.

PR 44903.
Submitted by:  Chris Taylor <ctaylor wadeford.plus.com>
Reviewed by: trawick



Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/network_io/unix/sockaddr.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=652951&r1=652950&r2=652951&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Fri May  2 16:50:47 2008
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.4.0
 
+  *) apr_getservbyname(): Use proper method for converting port
+     to host byte order.  PR 44903.
+     [Chris Taylor <ctaylor wadeford.plus.com>]
+
   *) Introduce apr_pollset_wakeup() for interrupting
      the blocking apr_pollset_poll call.
      [Mladen Turk]

Modified: apr/apr/trunk/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockaddr.c?rev=652951&r1=652950&r2=652951&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockaddr.c (original)
+++ apr/apr/trunk/network_io/unix/sockaddr.c Fri May  2 16:50:47 2008
@@ -711,7 +711,7 @@
         return APR_EINVAL;
 
     if ((se = getservbyname(servname, NULL)) != NULL){
-        sockaddr->port = htons(se->s_port);
+        sockaddr->port = ntohs(se->s_port);
         sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
         sockaddr->sa.sin.sin_port = se->s_port;
         return APR_SUCCESS;



Mime
View raw message