Changeset 7968 for lang/c

Show
Ignore:
Timestamp:
03/15/08 13:38:33 (9 months ago)
Author:
frsyuki
Message:

lang/c/partty: fixed wrong header parsing

Location:
lang/c/partty/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/c/partty/trunk/configure.in

    r7879 r7968  
    3737AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h termios.h unistd.h]) 
    3838 
     39AC_LANG_PUSH([C++]) 
     40AC_CHECK_HEADERS([tr1/functional boost/tr1/functional.hpp boost/function.hpp boost/bind.hpp]) 
     41AC_LANG_POP([C++]) 
     42 
    3943# Checks for typedefs, structures, and compiler characteristics. 
    4044AC_HEADER_STDBOOL 
  • lang/c/partty/trunk/src/server.cc

    r7867 r7968  
    262262        next_host->readonly_password_length = header->readonly_password_length; 
    263263 
     264        // message 
    264265        std::memcpy( next_host->message, 
    265266                     payload, 
     
    267268        next_host->message[header->message_length] = '\0'; 
    268269 
     270        // session name 
    269271        std::memcpy( next_host->session_name, 
    270272                     (char*)payload + next_host->message_length, 
     
    272274        next_host->session_name[header->session_name_length] = '\0'; 
    273275 
     276        // writable password 
    274277        std::memcpy( next_host->writable_password, 
    275278                     (char*)payload + next_host->message_length 
     
    278281        next_host->writable_password[header->writable_password_length] = '\0'; 
    279282 
     283        // readonly password 
    280284        std::memcpy( next_host->readonly_password, 
    281285                     (char*)payload + next_host->message_length 
    282286                                    + next_host->session_name_length 
    283                                     + next_host->readonly_password_length, 
     287                                    + next_host->writable_password_length, 
    284288                     header->readonly_password_length); 
    285289        next_host->readonly_password[header->readonly_password_length] = '\0'; 
     
    338342        stream.write(info.message, info.message_length) << "\n"; 
    339343 
     344        stream << "operation-password: "; 
     345        stream.write(info.writable_password, info.writable_password_length) << "\n"; 
     346 
    340347        stream << "view-only-password: "; 
    341         stream.write(info.readonly_password, info.readonly_password_length) << "\n"; 
    342  
    343         stream << "operation-password: "; 
    344348        stream.write(info.readonly_password, info.readonly_password_length) << "\n"; 
    345349}